Exemplo n.º 1
0
    private string GetMPText(BattalionState state)
    {
        int maxMP     = state.GetAttribute(BattalionAttribute.MaxMoral);
        int currentMP = state.GetAttribute(BattalionAttribute.RemainingMoral);

        return("MP:" + currentMP + "\\" + maxMP);
    }
Exemplo n.º 2
0
    private string GetHPText(BattalionState state)
    {
        int maxHP     = state.GetAttribute(BattalionAttribute.MaxHitpoints);
        int currentHP = state.GetAttribute(BattalionAttribute.RemainingHitpoints);

        return("HP:" + currentHP + "\\" + maxHP);
    }
Exemplo n.º 3
0
    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());
    }
Exemplo n.º 4
0
    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);
        }
    }
Exemplo n.º 5
0
    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());
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
        private bool GetIsAdvancer(BattalionState state)
        {
            int advancing = state.GetAttribute(BattalionAttribute.Advancing);

            return(advancing > 0);
        }
Exemplo n.º 8
0
 private static bool IsAntiCharge(BattalionState state)
 {
     return(state.GetAttribute(BattalionAttribute.AntiCharge) > 0);
 }