예제 #1
0
        public static int CalculateDamage(GameClient Session, GameClient TargetSession)
        {
            int    Damage           = 0;
            string WeaponName       = "";
            double WeaponLevelKills = Session.GetRoleplay().MeleeKills / 250;
            int    WeaponLevel      = (int)Math.Round(WeaponLevelKills, 0);
            int    WeaponDamage     = WeaponManager.WeaponsData[Session.GetRoleplay().Equiped].Max_Damage;

            foreach (KeyValuePair <string, Weapon> Weapon in Session.GetRoleplay().Weapons)
            {
                string WeaponData = Weapon.Key;
                WeaponName = WeaponManager.GetWeaponName(WeaponData);
            }

            int Damage2 = new Random().Next(WeaponManager.WeaponsData[Session.GetRoleplay().Equiped].Min_Damage, WeaponManager.WeaponsData[Session.GetRoleplay().Equiped].Max_Damage);

            Damage = new Random().Next((Session.GetRoleplay().Strength + Session.GetRoleplay().savedSTR), Damage2 + WeaponLevel * 3);
            return(Damage);
        }
예제 #2
0
        public static int DamageCalculator(GameClient Session, bool isWeapon = false)
        {
            int Damage = 0;
            int Bonus  = 0;
            int str    = 0;

            int fistDamage = 0;

            if (!isWeapon)
            {
                if (Session.GetRoleplay().inColourWars)
                {
                    str = new Random().Next(5, 13);
                }
                else
                {
                    str = Session.GetRoleplay().Strength + Session.GetRoleplay().UsingWeed_Bonus + Session.GetRoleplay().savedSTR;
                }

                int rndNum = new Random().Next(1, 15);

                if (rndNum == 1)
                {
                    fistDamage += (str + Bonus + 1) * 3;
                }

                else if (rndNum < 5)
                {
                    fistDamage += (str + Bonus + 1) * 2;
                }

                else if (rndNum < 10)
                {
                    fistDamage += str + Bonus + 3;
                }

                else
                {
                    fistDamage += str + Bonus + 1;
                }

                Damage = new Random().Next(Session.GetRoleplay().Strength + Session.GetRoleplay().savedSTR, fistDamage);
            }
            else
            {
                string WeaponName       = "";
                double WeaponLevelKills = Session.GetRoleplay().GunKills / 500;
                int    WeaponLevel      = (int)Math.Round(WeaponLevelKills, 0);
                int    WeaponDamage     = WeaponManager.WeaponsData[Session.GetRoleplay().Equiped].Max_Damage;

                foreach (KeyValuePair <string, Weapon> Weapon in Session.GetRoleplay().Weapons)
                {
                    string WeaponData = Weapon.Key;
                    WeaponName = WeaponManager.GetWeaponName(WeaponData);
                }

                Damage = new Random().Next(WeaponManager.WeaponsData[Session.GetRoleplay().Equiped].Min_Damage, WeaponManager.WeaponsData[Session.GetRoleplay().Equiped].Max_Damage);
            }

            return(Damage);
        }