예제 #1
0
        public void MIMIC(RBYPokemon Attacker, RBYPokemon Defender)
        {
            int replace_index;
            var move = MoveEnyclopedia[Defender.Moveset[RandomNumberGenerator(1, 4)].Index];

            if (Attacker.Owner == 0)
            {
                replace_index = Trainer1.IndexPicked;
            }
            else
            {
                replace_index = Trainer2.IndexPicked;
            }

            var query = Attacker.Moveset.Where(p => p.Name == move.Name);

            if (query.Count() == 0)
            {
                Displayer.RelayMessage("The move failed");
                return;
            }

            Attacker.UsedMimic              = true;
            Attacker.MimicIndex             = replace_index;
            Attacker.OldMimic               = Attacker.Moveset[replace_index];
            Attacker.Moveset[replace_index] = move;
            Defender.NonDmgHit();
        }
예제 #2
0
        private void StatBoostTypeMove(RBYPokemon Attacker, RBYPokemon Defender, AttackType atk, int accuracy, bool sec = false)
        {
            var query = atk.Stats.Where(p => p.Boost < StatBoostDegree.MeDown);

            if (query.Count() != 0 && !sec)
            {
                Defender.LastDmg = 0;
                Defender.NonDmgHit();
                if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, accuracy) || Defender.IsMisted && !Unhittable(Defender))
                {
                    Displayer.AtkMissed();
                    return;
                }
            }

            foreach (var p in atk.Stats)
            {
                if (p.Boost < StatBoostDegree.MeDown)
                {
                    Defender.IncreaseStage(p.Stat, DetermineStatDegree(p.Boost));
                }
                else
                {
                    Attacker.IncreaseStage(p.Stat, DetermineStatDegree(p.Boost));
                }
            }
        }
예제 #3
0
 public void SUPER_FANG(RBYPokemon Attacker, RBYPokemon Defender)
 {
     if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, 100))
     {
         Displayer.AtkMissed();
         Displayer.Enter();
         Defender.NonDmgHit();
         return;
     }
     Defender.TakeDamage(Attacker.SubHPRemaining / 2, true);
 }
예제 #4
0
 public void DRAGON_RAGE(RBYPokemon Attacker, RBYPokemon Defender)
 {
     if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, 100))
     {
         Displayer.AtkMissed();
         Displayer.Enter();
         Defender.NonDmgHit();
         return;
     }
     Defender.TakeDamage(40, false, 1, true);
 }
예제 #5
0
 public void SONICBOOM(RBYPokemon Attacker, RBYPokemon Defender)
 {
     if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, 100))
     {
         Displayer.AtkMissed();
         Displayer.Enter();
         Defender.NonDmgHit();
         return;
     }
     Defender.TakeDamage(20, true, 1, true);
 }
예제 #6
0
 public void GUILLOTINE(RBYPokemon Attacker, RBYPokemon Defender)
 {
     if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, 30))
     {
         Displayer.AtkMissed();
         Displayer.Enter();
         Defender.NonDmgHit();
         return;
     }
     Defender.TakeDamage(Defender.SubHPRemaining, true, 1, true);
 }
예제 #7
0
        public void REST(RBYPokemon Attacker, RBYPokemon Defender)
        {
            if (Attacker.SubHPRemaining == Attacker.HealthPoints)
            {
                Displayer.RelayMessage("Pokemon is already healthy");
                return;
            }

            Attacker.PutToSleep(2);
            Attacker.HealDamage(Attacker.HealthPoints);
            Defender.NonDmgHit();
        }
예제 #8
0
        public void COUNTER(RBYPokemon Attacker, RBYPokemon Defender)
        {
            var type = MoveEnyclopedia[Attacker.OppPrevAtk].MoveType;

            if (type == ElementTypes.NORMAL || type == ElementTypes.FIGHTING && Attacker.LastDmg != 0)
            {
                Defender.TakeDamage(Defender.LastDmg << 1, true, 1, true);
            }


            Defender.NonDmgHit();
        }
예제 #9
0
 public void HAZE(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Attacker.ResetStatBoost();
     Defender.ResetStatBoost();
     Attacker.IsMisted = false;
     Defender.IsMisted = false;
     Defender.NonDmgHit();
     if (Defender.CurrentStatus == StatusConditionInflicted.Freeze)
     {
         Defender.UnFreez();
     }
 }
예제 #10
0
        private void StatusTypeMove(RBYPokemon Attacker, RBYPokemon Defender, Attacks atk, bool sec = false)
        {
            if (!sec)
            {
                Defender.LastDmg = 0;
                Defender.NonDmgHit();
                if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, atk.Accuracy) && !Defender.ActiveSub && !Unhittable(Defender))
                {
                    Displayer.AtkMissed();
                    return;
                }
            }

            switch (atk.Attack.Status)
            {
            case StatusConditionInflicted.BadPoison:
                PoisonLogic(Defender, true, sec);
                break;

            case StatusConditionInflicted.Burn:
                BurnLogic(Defender, sec);
                break;

            case StatusConditionInflicted.Confuse:
                ConfuseLogic(Defender);
                break;

            case StatusConditionInflicted.Flinch:
                FlinchLogic(Defender, atk.Attack.Chance);
                break;

            case StatusConditionInflicted.Freeze:
                YouAreFrozen(Defender);
                break;

            case StatusConditionInflicted.Leech:
                LeechedLogic(Defender);
                break;

            case StatusConditionInflicted.Para:
                ParalysisLogic(Defender, atk.MoveType);
                break;

            case StatusConditionInflicted.Poison:
                PoisonLogic(Defender, false, sec);
                break;

            case StatusConditionInflicted.Sleep:
                SleepLogic(Defender);
                break;
            }
        }
예제 #11
0
 public void LIGHT_SCREEN(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Attacker.LightScreen = true;
     if (Attacker.Owner == 0)
     {
         Trainer1.LightScreen = true;
     }
     else
     {
         Trainer2.LightScreen = true;
     }
     Defender.NonDmgHit();
 }
예제 #12
0
 public void REFLECT(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Attacker.Reflect = true;
     if (Attacker.Owner == 0)
     {
         Trainer1.Reflect = true;
     }
     else
     {
         Trainer2.Reflect = true;
     }
     Defender.NonDmgHit();
 }
예제 #13
0
 public void FOCUS_ENERGY(RBYPokemon Attacker, RBYPokemon Defender)
 {
     if (!Attacker.IsFocused)
     {
         Attacker.IsFocused = true;
         Displayer.RelayMessage("Getting pumped up");
     }
     else
     {
         Displayer.RelayMessage("The move failed");
     }
     Defender.NonDmgHit();
 }
예제 #14
0
        public void MIRROR_MOVE(RBYPokemon Attacker, RBYPokemon Defender)
        {
            if (Attacker.OppPrevAtk != -1)
            {
                var move = MoveEnyclopedia[Defender.OppPrevAtk];
                if (move.Name != "MIRROR MOVE")
                {
                    DeliverAttack(Attacker, Defender, move, move.Attack.Movetype);
                    return;
                }
            }

            Displayer.RelayMessage("Move failed");
            Defender.NonDmgHit();
        }
예제 #15
0
        public void PSYWAVE(RBYPokemon Attacker, RBYPokemon Defender)
        {
            if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, 100))
            {
                Displayer.AtkMissed();
                Displayer.Enter();
                Defender.NonDmgHit();
                return;
            }

            int rng = RandomNumberGenerator(10, 15);
            int dmg = (rng * Attacker.Level) / 10;

            Defender.TakeDamage(dmg, false, 1, true);
        }
예제 #16
0
        public void TRANSFORM(RBYPokemon Attacker, RBYPokemon Defender)
        {
            if (Attacker.Owner == 0)
            {
                Trainer1.TransformedPoke = (RBYPokemon)Attacker.Clone();
            }
            else
            {
                Trainer2.TransformedPoke = (RBYPokemon)Attacker.Clone();
            }

            Attacker             = new RBYPokemon(Defender, Attacker.Level);
            Attacker.Transformed = true;
            Defender.NonDmgHit();
        }
예제 #17
0
 public void SPLASH(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Displayer.RelayMessage("Move Failed");
     Defender.NonDmgHit();
 }
예제 #18
0
        private void DamageTypeMove(RBYPokemon Attacker, RBYPokemon Defender, Attacks atk, AttackingMoveSecondary attacktype, bool nomiss = false)
        {
            bool crit_chance = CriticalChance(Attacker, false);

            Attacker.RecalcStats(crit_chance);
            Defender.RecalcStats(crit_chance);

            if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, atk.Accuracy) && !Unhittable(Defender) && !nomiss)
            {
                Displayer.AtkMissed();
                Defender.NonDmgHit();
                return;
            }

            ElementTypes type    = atk.MoveType;
            int          basepwr = atk.BasePower;
            bool         physpec = PhysicalSpecial(type);

            float  multipler = TypeMatrixCalc(atk.MoveType, Defender.Type1, Defender.Type2);
            double stab      = 1;


            int power   = physpec == true ? Attacker.InBattleAtk : Attacker.InBattleSpecialAtk;
            int defense = physpec == true ? Defender.InBattleDef : Defender.InBattleSpecialAtk;

            if (Attacker.Type1 == type || Attacker.Type2 == type)
            {
                stab = 1.5;
            }
            int dmg = 0;

            if (attacktype != AttackingMoveSecondary.Turn2 && attacktype != AttackingMoveSecondary.SpecialMech)
            {
                if (crit_chance)
                {
                    Displayer.RelayMessage("Critical Hit!");
                }
            }

            switch (attacktype)
            {
            case AttackingMoveSecondary.None:
                dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance);
                Defender.TakeDamage(dmg, physpec, multipler);
                break;

            case AttackingMoveSecondary.MultiHit:
                MultiHitMove(atk.Name, power, defense, Attacker.Level, basepwr, stab, multipler, Defender, physpec, crit_chance);
                break;

            case AttackingMoveSecondary.Recoil:
                dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance);
                Defender.TakeDamage(dmg, physpec, multipler);
                RecoilLogic(Defender, Attacker, dmg);
                break;

            case AttackingMoveSecondary.SpecialMech: CallSpecialMove(atk.Name, Attacker, Defender);
                break;

            case AttackingMoveSecondary.Trap:
                dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance);
                Defender.TakeDamage(dmg, physpec, multipler);
                TrapLogic(Defender, Attacker);
                break;

            case AttackingMoveSecondary.Turn2:
                Attacker.ActivateTwoTurn(atk);
                break;

            case AttackingMoveSecondary.Absorbing:
                dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance);
                Defender.TakeDamage(dmg, physpec, multipler);
                Attacker.HealDamage(dmg / 2);
                break;

            case AttackingMoveSecondary.Recharge:
                dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance);
                Defender.TakeDamage(dmg, physpec, multipler);
                RechargeLogic(Defender, Attacker);
                break;
            }
            Defender.LastDmg = dmg;

            if (Defender.CurrentStatus == StatusConditionInflicted.Freeze && atk.MoveType == ElementTypes.FIRE)
            {
                Defender.UnFreez();
            }

            SecondaryAffects(Attacker, Defender, atk);
        }
예제 #19
0
 public void MIST(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Attacker.IsMisted = true;
     Defender.NonDmgHit();
 }
예제 #20
0
 public void WHIRLWIND(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Displayer.RelayMessage("Move failed");
     Defender.NonDmgHit();
 }
예제 #21
0
 public void SUBSTITUTE(RBYPokemon Attacker, RBYPokemon Defender)
 {
     Attacker.SetUpSubstitute();
     Defender.NonDmgHit();
 }