public static float CalculateBasePhysical(WeaponStats weaponStats, CharacterStats stats) { float physicalDmg = 0; if (stats.physical > 8 * weaponStats.physical) { return(physicalDmg = 0.10f * weaponStats.physical); } else if (stats.physical > weaponStats.physical) { return(physicalDmg = (19.2f / 49 * Mathf.Pow((weaponStats.physical / stats.physical - 0.125f), 2) + 0.1f) * weaponStats.physical); } else if (stats.physical > 0.4f * weaponStats.physical) { return(physicalDmg = (-0.43f * Mathf.Pow((weaponStats.physical / stats.physical - 2.5f), 2) + 0.7f) * weaponStats.physical); } else if (stats.physical > 0.125f * weaponStats.physical) { return(physicalDmg = (-0.8f / 121 * Mathf.Pow((weaponStats.physical / stats.physical - 8), 2) + 0.9f) * weaponStats.physical); } else if (stats.physical < 0.125f * weaponStats.physical) { return(physicalDmg = 0.90f * weaponStats.physical); } if (physicalDmg <= 0) { return(physicalDmg = 1); } return(physicalDmg); }
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.fire = from.fire; to.lightning = from.lightning; to.dark = from.dark; }
public static int CalculateBaseDamage(WeaponStats weaponStats, CharacterStats stats, float multiplier = 1) { float physical = (weaponStats.physical * multiplier) - stats.physical; float slash = (weaponStats.slash * multiplier) - stats.vs_slash; float strike = (weaponStats.strike * multiplier) - stats.vs_strike; float thrust = (weaponStats.thrust * multiplier) - stats.vs_thrust; float sum = physical + slash + strike + thrust; float magic = (weaponStats.magic * multiplier) - stats.magic_def; float fire = (weaponStats.fire * multiplier) - stats.fire_def; float lightning = (weaponStats.lightning * multiplier) - stats.lightning_def; float dark = (weaponStats.dark * multiplier) - stats.dark_def; sum += magic + fire + lightning + dark; if (sum < 0) { sum = 1; } return(Mathf.RoundToInt(sum)); }
public static float GatherPhysicals(WeaponStats weaponStats, CharacterStats stats) { float physicalDmg = 0; return(physicalDmg); }