public void StartWar() { for (int i = 0; i < transform.Find("Pnjs").childCount; i++) { TileEntity te = transform.Find("Pnjs").GetChild(i).GetComponent <TileEntity> (); if (te is Pnj) { Pnj p = (Pnj)te; p.hostile = true; } else if (te is PanneauPnj) { PanneauPnj p = (PanneauPnj)te; p.hostile = true; } print(te); if (i < 30) { te.tile = GetTile(i, 80); } else { te.tile = GetTile(i % 30, 81); } te.transform.position = te.tile.transform.position; } QuestManager.Instance.indexQuest = 16; }
public virtual void Attack(TileEntity TE) { if (TE is Mobs) { Mobs m = (Mobs)TE; if (m.hostile) { TE.hpv2 -= damage; if (TE.hpv2 <= 0) { TE.Death(); } } } else if (TE is Pnj) { Pnj m = (Pnj)TE; if (m.hostile) { TE.hpv2 -= damage; if (TE.hpv2 <= 0) { TE.Death(); } } } else if (TE is PanneauPnj) { PanneauPnj m = (PanneauPnj)TE; if (m.hostile) { TE.hpv2 -= damage; if (TE.hpv2 <= 0) { TE.Death(); } } } else if (TE is Player) { TE.hpv2 -= damage; if (TE.hpv2 <= 0) { TE.Death(); } } }