Exemplo n.º 1
0
        private void OnWeaponFired(BaseProjectile projectile, BasePlayer player, ItemModProjectile mod, ProtoBuf.ProjectileShoot projectiles)
        {
            /* TODO :
             *      - Remove retarded cone of fire/bloom
             *      - Put back the old crazy recoil of Ak, f**k noobs
             */

            var item = projectile.GetItem();

            Debug($"SHOOT : {projectile.GetAimCone()} {projectile.aimCone} {projectile.aimSway}");

            var shotgunsNerfed = new int[2, 2]
            {
                { -1009492144, 30 },            // Shotgun Pump
                { 191795897, 30 }               // Double Barrel
            };

            //Debug("Shooting with : " + item.info.shortname + " (" + item.info.itemid + ")");

            for (var x = 0; x < shotgunsNerfed.Length / 2; x++)
            {
                if (shotgunsNerfed[x, 0] != item.info.itemid)
                {
                    continue;
                }
                Chance = shotgunsNerfed[x, 1];
                Random = UnityEngine.Random.Range(0, 100);
                //Debug("Shotgun fail : " + Random + " of " + Chance);
                if (Chance <= Random)
                {
                    return;
                }
                item.LoseCondition(10f);
                break;
            }

            if (item.info.itemid != 2077983581)
            {
                return;
            }
            OnPipeShotgunUse(player, item);
        }