Пример #1
0
 // --- Inherited Methods ---
 // Called when the unit has a new stat effect added
 public override bool onStatsEffected(Profession prof, bool isEffected, ref Unit unit, ref StatEffect statEffect, ref BattleMap map)
 {
     if(statEffect.type== EffectType.Debuff)
     {
         unit.addStatEffect(
             new StatEffect(
                 EffectType.Buff,
                 "Sturdy",
                 "+25% Def",
                 sturdySE,
                 -1
             ),
             ref map
         );
     }
     return isEffected;
 }
Пример #2
0
 // Called when the unit's attack has missed
 public override void onMissedAttack(Profession prof, ref Unit unit, int amount, ref Unit victim, ref BattleMap map)
 {
     if(!unit.hasStatEffect("Enraged"))
         return;
     if(Start.rng.Next(0, 10)< 3)
         victim.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
 }
Пример #3
0
            // --- Inherited Methods ---
            // Called when the unit has taken damage
            public override int onTakeDamage(Profession prof, ref Unit unit, int oldHealth, int newHealth, int amount, ref Unit instigator, ref BattleMap map)
            {
                if(!unit.hasStatEffect("Enraged"))
                    return amount;
                if(Start.rng.Next(0, 10)< 3)
                    instigator.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);

                return amount;
            }
Пример #4
0
            // Called when the unit is about to deal damage
            public override int onDealtDamage(Profession prof, ref Unit unit, int victimHP, int amount, ref Unit victim, ref BattleMap map)
            {
                if(!unit.hasStatEffect("Enraged"))
                    return amount;
                if(Start.rng.Next(0, 10)< 3)
                    victim.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);

                return amount;
            }
Пример #5
0
        // Makes the unit attack the given unit, given that unit's coords on the map, the name of the attack, and a reference to the map
        public override bool attackUnit(Unit unit, bool initiatedAttack, ref Unit victim, int x, int y, ref AttackInfo info, ref BattleMap map)
        {
            switch(info.skillID)
            {
                default:
                case "basic_attack":
                case "piercing_jab":
                case "counter_swipe":
                {
                    if(victim== null)
                        break;
                    victim.takeDamage(ref info, ref unit, ref map);
                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;

                case "enrage":	{
                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "Enrage",
                            "+25% +4 Atk for 3 turns",
                            enrageSE,
                            3
                        ),
                        ref map
                    );
                    unit.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
                    if(!unit.isAI)
                        unit.gainExp(ref unit, ref map);
                };return true;

                case "furious_slash":	{
                    if(victim== null)
                        break;
                    victim.takeDamage(ref info, ref unit, ref map);
                    unit.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;

                case "let_loose":	{
                    if(victim== null)
                        break;
                    victim.takeDamage(ref info, ref unit, ref map);
                    unit.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Debuff,
                            "Let Loose",
                            "-25% Def for 3 turns",
                            letLooseSE,
                            3
                        ),
                        ref map
                    );
                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;

                case "intimidate":	{
                    if(victim== null)
                        break;
                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Debuff,
                            "Intimidated",
                            "-12% Atk, Def, and Res for 3 turns",
                            intimidateSE,
                            3
                        ),
                        ref map
                    );
                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;

                case "stockpile_rage":	{
                    stockpiled+=	0.12f;
                    if(!unit.isAI)
                        unit.gainExp(ref unit, ref map);
                };return true;

                case "suicidal_slash":	{
                    if(victim== null)
                        break;
                    unit.defense=	(int)(unit.defense*0.96f);
                    unit.originalDefense=	(int)(unit.originalDefense*0.96f);
                    victim.takeDamage(ref info, ref unit, ref map);
                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;

                case "fury_swipes":	{
                    if(victim== null)
                        break;

                    // Variables
                    bool	hit=	false;

                    info.damage/=	3;
                    for(int i= 0; i< 3; i++)
                    {
                        victim.takeDamage(ref info, ref unit, ref map);
                        if(!hit && !info.missed)
                            hit=	true;
                    }
                    if(hit && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;
            }

            return false;
        }
Пример #6
0
            // --- Inherited Methods ---
            // Called when the unit is about to deal damage
            public override int onDealtDamage(Profession prof, ref Unit unit, int victimHP, int amount, ref Unit victim, ref BattleMap map)
            {
                victim.addStatEffect(
                    new StatEffect(
                        EffectType.Debuff,
                        "Intimidated",
                        "-12% Atk, Def, and Res for 2 turns",
                        intimidateSE,
                        2
                    ),
                    ref map
                );

                return amount;
            }
Пример #7
0
 // --- Methods ---
 // Adds the effect to the given unit
 private void addEffect(ref Unit unit, ref BattleMap map)
 {
     unit.addStatEffect(
         new StatEffect(
             EffectType.Buff,
             "Power in Numbers",
             "+2 Def and Res for each ally nearby",
             powerInNumbersSE,
             1
         ),
         ref map
     );
 }
Пример #8
0
        // Makes the unit attack the given unit, given that unit's coords on the map, the name of the attack, and a reference to the map
        public override bool attackUnit(Unit unit, bool initiatedAttack, ref Unit victim, int x, int y, ref AttackInfo info, ref BattleMap map)
        {
            switch(info.skillID)
            {
                case "smite":
                case "basic_attack":	{
                    if(victim== null)
                        return false;

                    victim.takeDamage(ref info, ref unit, ref map);

                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };break;

                case "multicure":	{
                    // Variables
                    List<int[]>	allies=	map.findAllies(unit.mapPos[0], unit.mapPos[1], 1, 2, map.getTeamID(unit.mapPos));

                    for(int i= 0; i< allies.size; i++)
                        map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].heal(-1*info.damage, ref unit, ref map);

                    if(unit.isAlive && !unit.isAI)
                        unit.gainExp(64*allies.size, ref map);
                };break;

                case "armor_of_god":	{
                    if(victim== null)
                        return false;
                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "Armor of God",
                            "+35 Def and Res",
                            armorOfGodSE,
                            2
                        ),
                        ref map
                    );
                    if(unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };break;

                case "rally_spirit":	{
                    // Variables
                    List<int[]>	allies=	map.findAllies(unit.mapPos[0], unit.mapPos[1], 0, 2, map.getTeamID(unit.mapPos));

                    for(int i= 0; i< allies.size; i++)
                    {
                        map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].addStatEffect(
                            new StatEffect(
                                EffectType.Buff,
                                "Rally Spirit",
                                "+10% to all stats",
                                rallySpiritSE,
                                3
                            ),
                            ref map
                        );
                    }

                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(32*allies.size, ref map);
                };break;

                case "rejuvinate":	{
                    if(victim== null)
                        return false;

                    if(victim.getStatusEffect()== null)
                        victim.clearDebuffs();
                    else
                    {
                        if(!victim.clearStatusEffect())
                            info.missed=	false;
                    }

                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };break;

                case "healing_prayer":	{
                    // Variables
                    List<int[]>	allies=	map.findAllAllies(map.getTeamID(unit.mapPos));

                    for(int i= 0; i< allies.size; i++)
                    {
                        map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].heal(
                            map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].originalHealth,
                            ref unit,
                            ref map
                        );
                    }

                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Debuff,
                            "Humility",
                            "-75% to all stats",
                            healingPrayerSE,
                            2
                        ),
                        ref map
                    );

                    if(unit.isAlive && !unit.isAI)
                        unit.gainExp(256*allies.size, ref map);
                };break;

                case "mend":	{
                    if(victim== null)
                        return false;
                    victim.heal(-1*info.damage, ref unit, ref map);

                    if(unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };break;

                case "prophetic_reap":	{
                    if(activatedPropheticReap)
                        return false;

                    activatedPropheticReap=	true;
                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "Prophetic Prayer",
                            "Deal "+((float)(unit.magic)/7f)+" damage to all enemies once dissipated",
                            propheticReapSE,
                            3
                        ),
                        ref map
                    );
                };break;

                case "banish_spirits":	{
                    if(victim== null)
                        return false;

                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "Banish Spirits",
                            "+10% Atk",
                            positiveBanishSpiritsSE,
                            3
                        ),
                        ref map
                    );
                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Debuff,
                            "Banish Spirits",
                            "-15% Def and Res",
                            negativeBanishSpiritsSE,
                            3
                        ),
                        ref map
                    );
                    victim.addStatEffect(
                        StatEffect.create(StatusEffect.Enraged, 3),
                        ref map
                    );
                };break;

                case "rest_in_god":	{
                    if(victim== null)
                        return false;

                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "God\'s Blessing",
                            "+20 to all stats",
                            restInGodSE,
                            1
                        ),
                        ref map
                    );
                    map.endUnitWalking(map.getFullUnitID(unit.mapPos));
                };break;
            }

            return true;
        }