public static void AddDamage(RaycastInfo ri)
 {
     if (G.Settings.WeaponOptions.DamageIndicators && ri.point != new Vector3(0, 0, 0))
     {
         ItemGunAsset currentGun = Player.player.equipment.asset as ItemGunAsset;
         if (currentGun != null && ri.player != null)
         {
             IndicatorObject dmgi = new IndicatorObject
             {
                 HitPos   = ri.point,
                 Damage   = Mathf.FloorToInt(DamageTool.getPlayerArmor(ri.limb, ri.player) * currentGun.playerDamageMultiplier.multiply(ri.limb)), // big maths
                 ShotTime = DateTime.Now
             };
             DamageIndicators.Add(dmgi);
         }
     }
 }
示例#2
0
        private void DamageTool_damagePlayerRequested(ref DamagePlayerParameters parameters, ref bool shouldAllow)
        {
            if (!Dummies.ContainsKey(parameters.player.channel.owner.playerID.steamID))
            {
                return;
            }
            float totalTimes = parameters.times;

            if (parameters.respectArmor)
            {
                totalTimes *= DamageTool.getPlayerArmor(parameters.limb, parameters.player);
            }
            if (parameters.applyGlobalArmorMultiplier)
            {
                totalTimes *= Provider.modeConfigData.Players.Armor_Multiplier;
            }
            byte totalDamage = (byte)Mathf.Min(255, parameters.damage * totalTimes);

            ChatManager.say(parameters.killer, $"Amount damage to dummy: {totalDamage}", Color.green);
            shouldAllow = false;
        }
        // not sure if this is returning the right values, looks normal so w/e
        public static float GetDamage(Player player, ELimb limb)
        {
            ItemGunAsset currentGun = Player.player.equipment.asset as ItemGunAsset;

            return(currentGun.objectDamage * currentGun.playerDamageMultiplier.damage * DamageTool.getPlayerArmor(limb, player));
        }