Пример #1
0
 public static void DeepCopyWeaponStats(WeaponStats from, WeaponStats to)
 {
     to.physical = from.physical;
     to.slash    = from.slash;
     to.strike   = from.strike;
     to.thrust   = from.thrust;
     to.magic    = from.magic;
     to.lighting = from.lighting;
     to.fire     = from.fire;
     to.dark     = from.dark;
 }
Пример #2
0
        public static int CalculateBaseDamage(WeaponStats w, CharacterStats st, float multiplier = 1)
        {
            float physical = w.physical * multiplier - st.physical;
            float strike   = w.strike * multiplier - st.vs_strike;
            float slash    = w.slash * multiplier - st.vs_slash;
            float thrust   = w.thrust * multiplier - st.vs_thrust;

            float sum = physical + strike + slash + thrust;

            float magic    = w.magic * multiplier - st.magic;
            float fire     = w.fire * multiplier - st.fire;
            float lighting = w.lighting * multiplier - st.lighting;
            float dark     = w.dark * multiplier - st.dark;

            sum += magic + fire + lighting + dark;

            if (sum <= 0)
            {
                sum = 1;
            }

            return(Mathf.RoundToInt(sum));
        }