private string GetMPText(BattalionState state) { int maxMP = state.GetAttribute(BattalionAttribute.MaxMoral); int currentMP = state.GetAttribute(BattalionAttribute.RemainingMoral); return("MP:" + currentMP + "\\" + maxMP); }
private string GetHPText(BattalionState state) { int maxHP = state.GetAttribute(BattalionAttribute.MaxHitpoints); int currentHP = state.GetAttribute(BattalionAttribute.RemainingHitpoints); return("HP:" + currentHP + "\\" + maxHP); }
public override BattalionBattleEffects GetEffect(BattalionState self, BattleStageSide allies, BattleStageSide enemies) { BattalionEffectsBuilder builder = new BattalionEffectsBuilder(this); int rallyStrength = self.GetAttribute(BattalionAttribute.RallyStrength); foreach (BattalionState item in allies) { builder.Add(item.Id, BattalionAttribute.RemainingMoral, rallyStrength); } return(builder.ToEffects()); }
private void DoMeleeAttack(BattalionEffectsBuilder builder, BattalionState self, BattalionState target) { int strength = self.GetAttribute(BattalionAttribute.Strength); BattalionAttribute damageAttribute = GetDamageAttributeFor(damageType); builder.Add(target.Id, damageAttribute, strength + weaponStrength); int retributionDamage = target.GetAttribute(BattalionAttribute.MeleeRetribution); if (retributionDamage > 0) { builder.Add(self.Id, BattalionAttribute.Damage, retributionDamage); } }
public override BattalionBattleEffects GetEffect(BattalionState self, BattleStageSide allies, BattleStageSide enemies) { BattalionEffectsBuilder builder = new BattalionEffectsBuilder(this); int reloadingState = self.GetAttribute(BattalionAttribute.ReloadingState); if (reloadingState > 0) { builder.Add(self.Id, BattalionAttribute.ReloadingState, -1); } else { if (IsWithinAttackingRange(self.Position)) { DoAttack(builder, self, enemies); } } return(builder.ToEffects()); }
private void DoAttack(BattalionEffectsBuilder builder, BattalionState self, BattleStageSide enemies) { BattalionState target = enemies.GetTargetFor(self.Position); BattalionAttribute damageAttribute = GetDamageAttributeFor(damageType); builder.Add(target.Id, damageAttribute, weaponStrength); if (splashDamage > 0) { IEnumerable <BattalionState> splashTargets = GetSplashTargets(target, enemies).ToArray(); foreach (BattalionState splashTarget in splashTargets) { builder.Add(splashTarget.Id, damageAttribute, splashDamage); } } int reloadingSpeed = self.GetAttribute(BattalionAttribute.ReloadingSpeed); builder.Add(self.Id, BattalionAttribute.ReloadingState, reloadingSpeed); }
private bool GetIsAdvancer(BattalionState state) { int advancing = state.GetAttribute(BattalionAttribute.Advancing); return(advancing > 0); }
private static bool IsAntiCharge(BattalionState state) { return(state.GetAttribute(BattalionAttribute.AntiCharge) > 0); }