public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("St4ke", "st4ke"); Game.Items.Rename("outdated_gun_mods:st4ke", "nn:st4ke"); gun.gameObject.AddComponent <St4ke>(); gun.SetShortDescription("For Robot Vampires"); gun.SetLongDescription("Fires miniature tesla coils that stick into walls." + "\n\nFollowing the success of her remote diote transmitter experiment, the tinker set about seeing if she could make both ends of the tesla-relay mobile."); gun.SetupSprite(null, "st4ke_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 17); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) 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 = 1f; gun.DefaultModule.cooldownTime = 0.15f; gun.DefaultModule.numberOfShotsInClip = 4; gun.barrelOffset.transform.localPosition = new Vector3(1.68f, 0.62f, 0f); gun.SetBaseMaxAmmo(175); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup; gun.ammo = 175; gun.gunClass = GunClass.PISTOL; //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 = 8f; projectile.pierceMinorBreakables = true; projectile.SetProjectileSpriteRight("st4keproj", 13, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 5); St4keProj orAddComponent = projectile.gameObject.GetOrAddComponent <St4keProj>(); PierceProjModifier piercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); piercing.penetration++; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Stk4ke Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/st4ke_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/st4ke_clipempty"); gun.quality = PickupObject.ItemQuality.A; ETGMod.Databases.Items.Add(gun, null, "ANY"); St4keID = gun.PickupObjectId; gun.AddToSubShop(ItemBuilder.ShopType.Trorc); LinkVFXPrefab = FakePrefab.Clone(Game.Items["shock_rounds"].GetComponent <ComplexProjectileModifier>().ChainLightningVFX); FakePrefab.MarkAsFakePrefab(LinkVFXPrefab); UnityEngine.Object.DontDestroyOnLoad(LinkVFXPrefab); }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Portal Gun", "portalgun"); Game.Items.Rename("outdated_gun_mods:portal_gun", "nn:portal_gun"); gun.gameObject.AddComponent <PortalGun>(); gun.SetShortDescription("For Science"); gun.SetLongDescription(""); gun.SetupSprite(null, "st4ke_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 17); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) 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 = 1f; gun.DefaultModule.cooldownTime = 0.15f; gun.DefaultModule.numberOfShotsInClip = 4; gun.barrelOffset.transform.localPosition = new Vector3(1.68f, 0.62f, 0f); gun.SetBaseMaxAmmo(175); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup; gun.ammo = 175; 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 = 8f; projectile.pierceMinorBreakables = true; projectile.SetProjectileSpriteRight("st4keproj", 13, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 5); St4keProj orAddComponent = projectile.gameObject.GetOrAddComponent <St4keProj>(); PierceProjModifier piercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); piercing.penetration++; gun.quality = PickupObject.ItemQuality.EXCLUDED; ETGMod.Databases.Items.Add(gun, null, "ANY"); PortalGunID = gun.PickupObjectId; //gun.AddToSubShop(ItemBuilder.ShopType.Trorc); allPortals = new List <OMITBPortalController>(); }