Example #1
0
        public static void PhysicalAttack(int power, AbilityState state, int targetIndex)
        {
            ICombatant er = state.Performer;
            ICombatant ee = state.Target[targetIndex];

            bool restorative = false;

            if (!PhysicalHit(state, targetIndex))
            {
                return;
            }

            int bd  = PhysicalBase(er);
            int dam = PhysicalDamage(bd, power, ee);

            dam = Critical(dam, state, targetIndex);
            dam = Berserk(dam, state);
            dam = RowCheck(dam, state, targetIndex);
            dam = Frog(dam, state);
            dam = Sadness(dam, ee);
            dam = Split(dam, state);
            dam = Barrier(dam, state, targetIndex);
            dam = MPTurbo(dam, state);
            dam = Mini(dam, state);
            dam = RandomVariation(dam);
            dam = LowerSanityCkeck(dam);
            dam = RunElementalChecks(dam, ref restorative, state, targetIndex);
            dam = UpperSanityCheck(dam);

            ee.AcceptDamage(er, dam);
        }
Example #2
0
        public static void MagicSpell(int power, AbilityState state, int targetIndex)
        {
            ICombatant er = state.Performer;
            ICombatant ee = state.Target[targetIndex];

            if (!MagicHit(state, targetIndex))
            {
                return;
            }

            bool restorative = false;
            int  bd          = MagicalBase(er);
            int  dam         = MagicalDamage(bd, 4, ee);

            RunMagicModifiers(dam, ref restorative, state, targetIndex);

            if (restorative)
            {
                dam = -dam;
            }

            ee.AcceptDamage(er, dam);
        }