コード例 #1
0
 public 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 mutiplier = 1)
        {
            float physical = (w.physical * mutiplier) - st.physical;
            float strike   = (w.strike * mutiplier) - st.vs_strike;
            float slash    = (w.slash * mutiplier) - st.vs_slash;
            float thrust   = (w.thrust * mutiplier) - st.vs_thrust;

            float sum = physical + strike + slash + thrust;

            float magic    = (w.magic * mutiplier) - st.magic;
            float fire     = (w.fire * mutiplier) - st.fire;
            float lighting = (w.lighting * mutiplier) - st.lighting;
            float dark     = (w.dark * mutiplier) - st.dark;

            sum += magic + fire + lighting + dark;

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

            return(Mathf.RoundToInt(sum));
        }