Пример #1
0
        public static bool Prefix(AbstractActor __instance)
        {
            var actor = __instance;

            foreach (Weapon weapon in actor.Weapons)
            {
                if (weapon.roundsSinceLastFire <= 0)
                {
                    continue;
                }
                ;
                if (CustomAmmoCategories.IsCooldown(weapon) > 0)
                {
                    var removedJam = CustomAmmoCategories.AttemptToRemoveCooldown(actor, weapon);
                    CustomAmmoCategoriesLog.Log.LogWrite($"Removed cooldown? {removedJam}\n");
                }
            }
            if (actor.IsShutDown)
            {
                return(true);
            }

            foreach (Weapon weapon in actor.Weapons)
            {
                if (weapon.roundsSinceLastFire <= 0)
                {
                    continue;
                }
                ;
                if (CustomAmmoCategories.IsJammed(weapon))
                {
                    var removedJam = CustomAmmoCategories.AttemptToRemoveJam(actor, weapon);
                    CustomAmmoCategoriesLog.Log.LogWrite($"Removed Jam? {removedJam}\n");
                }
            }
            return(true);
        }