Exemple #1
0
        // Shows the player if he/she should attack
        public override AttackInfo showAttackDecision(string skillID, Unit unit, ref Unit defender, ref BattleMap map)
        {
            if(skillID== "basic_attack")
                return base.showAttackDecision(skillID, unit, ref defender, ref map);

            // Variables
            AttackInfo	info=	AttackInfo.create(skillID, map.getFullUnitID(unit.mapPos), map.getFullUnitID(defender.mapPos), ref map);

            if(hasPassive("critical_rage"))
                info.criticalChance=	Math.Max(info.criticalChance+0.05f, 1f);
            switch(skillID)
            {
                case "enrage":
                    info.accuracy=	1f;
                    info.criticalChance=	0f;
                    info.projAttackerStats[2]=	(int)(info.projAttackerStats[2]*1.25f+4f);
                    info.projAttackerStats[2]=	(int)(info.projAttackerStats[2]*(1.25f+stockpiled+((hasPassive("adrenaline_rush")) ? 0.1f : 0f)));
                    info.projAttackerStats[3]=	(int)(info.projAttackerStats[3]*0.80f);

                    info.projDefenderStats[2]=	(int)(info.projDefenderStats[2]*1.25f+4f);
                    info.projDefenderStats[2]=	(int)(info.projDefenderStats[2]*(1.25f+stockpiled+((hasPassive("adrenaline_rush")) ? 0.1f : 0f)));
                    info.projDefenderStats[3]=	(int)(info.projDefenderStats[3]*0.80f);
                    break;

                case "furious_slash":
                    info.damage=	info.calculateDamage(1.1f, 0f, 1f, 1f, ref map);
                    info.projAttackerStats[2]=	(int)(info.projAttackerStats[2]*(1.25f+stockpiled+((hasPassive("adrenaline_rush")) ? 0.1f : 0f)));
                    info.projAttackerStats[3]=	(int)(info.projAttackerStats[3]*0.80f);
                    info.projDefenderStats[0]-=	info.damage;
                    break;

                case "let_loose":
                    info.damage=	info.calculateDamage(ref map);
                    if(defender.getDefensePerc()== 0f)
                        info.damage+=	(int)(unit.defense*0.5f);
                    else
                        info.damage+=	Math.Max((int)(unit.defense*0.5f-defender.defense*defender.getDefensePerc()*0.5f), 4);
                    info.projDefenderStats[0]-=	info.damage;
                    info.projAttackerStats[2]=	(int)(info.projAttackerStats[2]*(1.25f+stockpiled+((hasPassive("adrenaline_rush")) ? 0.1f : 0f)));
                    info.projAttackerStats[3]=	(int)(info.projAttackerStats[3]*0.80f);
                    info.projAttackerStats[3]=	(int)(info.projAttackerStats[3]*0.75f);
                    info.criticalChance=	0f;
                    break;

                case "intimidate":
                    info.projDefenderStats[2]=	(int)(info.projDefenderStats[2]*0.88f);
                    info.projDefenderStats[3]=	(int)(info.projDefenderStats[3]*0.88f);
                    info.projDefenderStats[5]=	(int)(info.projDefenderStats[5]*0.88f);
                    info.criticalChance=	0f;
                    break;

                case "stockpile_rage":
                    info.accuracy=	1f;
                    info.criticalChance=	0f;
                    break;

                case "suicidal_slash":
                    info.damage=	info.calculateDamage(1.2f, 0f, 1f, 1f, ref map);
                    info.projAttackerStats[3]=	(int)(info.projAttackerStats[3]*0.96f);
                    info.projDefenderStats[0]-=	info.damage;
                    break;

                case "piercing_jab":
                    info.damage=	info.calculateDamage(1f, 0f, 0.5f, 1f, ref map);
                    info.projDefenderStats[0]-=	info.damage;
                    info.accuracy=	Math.Max(info.accuracy-0.2f, 0f);
                    break;

                case "counter_swipe":
                    info.damage=	info.calculateDamage(0.75f, 0f, 1f, 1f, ref map);
                    if(defender.getDefensePerc()== 0f)
                        info.damage+=	(int)(defender.attack*0.25f);
                    else
                        info.damage+=	Math.Max((int)(defender.attack*0.25f-defender.defense*defender.getDefensePerc()), 4);
                    info.projDefenderStats[0]-=	info.damage;
                    break;

                case "fury_swipes":
                    info.damage=	info.calculateDamage(0.5f, 0f, 1f, 1f, ref map);
                    info.damage*=	3;
                    info.projDefenderStats[0]-=	info.damage;
                    break;
                case "raging_battlecry":
                    info.projAttackerStats[2]=	(int)(info.projAttackerStats[2]*(1.25f+stockpiled+((hasPassive("adrenaline_rush")) ? 0.1f : 0f)));
                    info.projAttackerStats[3]=	(int)(info.projAttackerStats[3]*0.80f);

                    if(info.attackerID== info.defenderID)
                        info.projDefenderStats[2]=	(int)(info.projDefenderStats[2]*(1.25f+stockpiled+((hasPassive("adrenaline_rush")) ? 0.1f : 0f)));
                    else
                        info.projDefenderStats[2]=	(int)(info.projDefenderStats[2]*1.25f);
                    info.projDefenderStats[3]=	(int)(info.projDefenderStats[3]*0.80f);
                    break;
            }

            return info;
        }