public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Gunger", "gunger"); Game.Items.Rename("outdated_gun_mods:gunger", "nn:gunger"); gun.gameObject.AddComponent <Gunger>(); gun.SetShortDescription("Hungry Gun"); gun.SetLongDescription("Reloading this strange creature near guns on the ground will cause them to be... consumed?" + "\n\nThese creatures are worshipped as gods in some cultures, though they know it not."); gun.SetupSprite(null, "gunger_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 12); gun.SetAnimationFPS(gun.idleAnimation, 9); gun.SetAnimationFPS(gun.reloadAnimation, 12); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(599) as Gun).gunSwitchGroup; gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false); //GUN STATS gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; gun.reloadTime = 1.2f; gun.DefaultModule.cooldownTime = 0.5f; gun.muzzleFlashEffects.type = VFXPoolType.None; gun.DefaultModule.numberOfShotsInClip = 10; gun.barrelOffset.transform.localPosition = new Vector3(2.31f, 0.62f, 0f); gun.SetBaseMaxAmmo(300); gun.ammo = 300; gun.gunClass = GunClass.SILLY; //BULLET STATS Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.projectiles[0] = projectile; projectile.baseData.damage *= 2f; projectile.baseData.speed *= 0.8f; projectile.baseData.range *= 1f; projectile.baseData.force *= 1.2f; GungerBaseProjectile gungerbase = projectile.gameObject.AddComponent <GungerBaseProjectile>(); projectile.SetProjectileSpriteRight("gunger_projectile", 17, 9, false, tk2dBaseSprite.Anchor.MiddleCenter, 16, 8); projectile.transform.parent = gun.barrelOffset; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Gunger Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/gunger_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/gunger_clipempty"); gun.quality = PickupObject.ItemQuality.A; ETGMod.Databases.Items.Add(gun, null, "ANY"); }
}; //ADD STUFF LIKE GUNDERTALE HERE UPON REINTEGRATION protected override void OnPickedUpByPlayer(PlayerController player) { if (!everPickedUpByPlayer) { foreach (Projectile proj in this.gun.RawSourceVolley.projectiles[0].projectiles) { GungerBaseProjectile baseProj = proj.GetComponent <GungerBaseProjectile>(); if (baseProj == null) { this.gun.RawSourceVolley.projectiles[0].projectiles.Remove(proj); } } if (player != null) { player.stats.RecalculateStats(player, true, false); } } base.OnPickedUpByPlayer(player); }