public override void Update(float elapsedTime_) { textures.GetTex("swipe").Update(elapsedTime_); if (state == GodState.Attacking) { if (textures.GetTex("swipe").Ended()) { GameData.godHunger -= GameData.GodFeed; if (GameData.godHunger < 0) { GameData.godHunger = 0; } target.exists = false; GameData.citizensOutside--; state = GodState.Idle; } } if (GameData.godAnger == 100) { GameData.attacks++; GameData.DestroyBuilding(); GameData.godAnger = 50; } base.Update(elapsedTime_); }
public void Attack() { if (state != GodState.Attacking) { if (FindVillager()) { state = GodState.Attacking; textures.GetTex("swipe").Reset(); GameData.madness += GameData.MadnessGain; if (GameData.madness > 100) { GameData.madness = 100; } SoundManager.PlayEffect("sacrifice"); } } }
public God(DrawerCollection textures_, PositionManager pos_, List <Property> properties_, string name_, string type_) : base(textures_, pos_, properties_, name_, type_) { state = GodState.Idle; mood = GodMood.Ok; currentTex = textures.GetTex("idle"); }