void PreventLastMeleeFromRepositioning() { List <Character> teamMelee = Character.Team.MeleeCharacters; int targetableMeleeCount = 0; Character lastMelee = null; for (int i = 0; i < teamMelee.Count; i++) { if (teamMelee[i].Targetable) { targetableMeleeCount++; lastMelee = teamMelee[i]; } } if (targetableMeleeCount == 1) { CharacterPositionHandler lastMeleeHandler = lastMelee.PositionHandler; lastMeleeHandler.IsLastMelee = true; lastMeleeHandler.UpdateCanDoReposition(); } else { for (int i = 0; i < teamMelee.Count; i++) { CharacterPositionHandler charHandler = teamMelee[i].PositionHandler; if (charHandler.IsLastMelee) { charHandler.IsLastMelee = false; charHandler.UpdateCanDoReposition(); } } } }
public Character(CharacterTemplateSlot templateSlot, Team team, CharacterActor actor, CharacterMover mover, CharacterFloatingTextHandler floatingTextHandler) { Template = templateSlot.Template; actor.Owner = this; mover.Owner = this; floatingTextHandler.Owner = this; Team = team; Actor = actor; Mover = mover; FloatingTextHandler = floatingTextHandler; ActionPointHandler = new CharacterActionPointHandler(this); PositionHandler = new CharacterPositionHandler(this, templateSlot.Position); AbilityHandler = new CharacterAbilityHandler(this); EventHandler = new CharacterEventHandler(this); StatusHandler = new CharacterStatusHandler(this); HealthHandler = new CharacterHealthHandler(this); AIHandler = new CharacterAIHandler(this); RegisterAvailabilityListeners(); }