public override void Pickup(PlayerController player) { if (player.GetComponent <NuclearPlayerController>()) { NuclearPlayerController heSucks = player.GetComponent <NuclearPlayerController>(); if (heSucks.Shells + 8 > Mathf.FloorToInt(55 * player.stats.GetStatValue(PlayerStats.StatType.AmmoCapacityMultiplier))) { BoxOTools.Notify("AMMO BOX", "Max Shells", "katmod/Resources/V3MiscItems/ammocrate"); heSucks.Shells = Mathf.FloorToInt(55 * player.stats.GetStatValue(PlayerStats.StatType.AmmoCapacityMultiplier)); } else { BoxOTools.Notify("AMMO BOX", "+8 Shells", "katmod/Resources/V3MiscItems/ammocrate"); heSucks.Shells += 8; } } player.BloopItemAboveHead(this.sprite); AkSoundEngine.PostEvent("Play_OBJ_ammo_pickup_01", base.gameObject); UnityEngine.Object.Destroy(base.gameObject); }
protected void Update() { if (this.gun.CurrentOwner != null) { bool flag3 = !this.gun.IsReloading && !this.HasReloaded; if (flag3) { this.HasReloaded = true; } NuclearPlayerController nuclear = this.gun.CurrentOwner.gameObject.GetComponent <NuclearPlayerController>(); if (nuclear) { if (this.gun.ammo != nuclear.Shells) { this.gun.ammo = nuclear.Shells; } } else { this.gun.CurrentOwner.gameObject.AddComponent <NuclearPlayerController>(); } } }