virtual protected void InstantDMGDelegate(Collider2D collision) { if (GameManager.CheckHostile(NPCinfo.tag, collision.tag)) { NPCBase target = collision.GetComponent <NPCBase>(); NPCinfo.DealDmg2Target(AADmg / cnt, target, DMGType.None); SpeedStatus tmp = target.GetComponent <SpeedStatus>(); if (tmp == null) { tmp = target.gameObject.AddComponent <SpeedStatus>(); tmp.duration = slowDuration; tmp.addSpeedMult = -slow; } } }
NPCBase SpawnNPCAtLocation(IndividualCard myCard, NPCBase myNPCPrefab) { if (myNPCPrefab == null) { DataLogger.LogError("Trying to spawn null npc"); return(null); } NPCBase myNPC = Instantiate(myNPCPrefab.gameObject, npcSpawnPos.position, Quaternion.identity).GetComponent <NPCBase> (); myNPC.transform.localScale = new Vector3(1, 1, 1) * GS.a.gridSettings.scaleMultiplier; myNPC.Spawn(myCard); if (DataHandler.s.myPlayerInteger == 0) { ActiveNPCS.Add(myNPC); SendNPCAction(myCard.x, myCard.y, myNPC.GetComponent <NPCBase> (), ActionType.Spawn, -1); } return(myNPC); }