public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Junk Sword", "junk1_sword"); Game.Items.Rename("outdated_gun_mods:junk_sword", "spapi:junk_sword"); gun.gameObject.AddComponent <JunkSwordController>(); GunExt.SetShortDescription(gun, "Next Time... What is This?"); GunExt.SetLongDescription(gun, "Just a sword made out of junk. Some of the junk seems enchanted and may react different the more normal junk is around."); GunExt.SetupSprite(gun, null, "junk1_sword_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 8); GunExt.AddProjectileModuleFrom(gun, "wonderboy", true, true); gun.DefaultModule.projectiles[0].baseData.damage = 5; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; gun.DefaultModule.numberOfShotsInClip = 999; gun.reloadTime = 0; gun.InfiniteAmmo = true; gun.quality = PickupObject.ItemQuality.C; gun.barrelOffset.transform.localPosition = new Vector3(1.750f, 0.3f, 0f); gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(574) as Gun).muzzleFlashEffects; gun.encounterTrackable.EncounterGuid = "junkan1_sword"; gun.OverrideNormalFireAudioEvent = "Play_WPN_blasphemy_shot_01"; gun.gunClass = GunClass.SILLY; gun.gunSwitchGroup = "Shotgun"; gun.IsHeroSword = true; gun.HeroSwordDoesntBlank = true; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); JunkSwordController.NormalSwordId = gun.PickupObjectId; JunkSwordController.InitFormes(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(417); }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Celebration", "mk1"); Game.Items.Rename("outdated_gun_mods:celebration", "spapi:celebration"); gun.gameObject.AddComponent <CelebrationMk1>(); GunExt.SetShortDescription(gun, "Great For Gunparties!"); GunExt.SetLongDescription(gun, "Shoots fireworks. Yes, fireworks.\n\nGun originally designed for being in highest-tier chests, but because of hate it got it was moved to lower-tier chests."); GunExt.SetupSprite(gun, null, "mk1_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16); for (int i = 0; i < 3; i++) { GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); } foreach (ProjectileModule mod in gun.Volley.projectiles) { mod.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; mod.angleVariance /= 1.25f; mod.ammoType = GameUIAmmoType.AmmoType.GRENADE; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(275) as Gun).DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); mod.projectiles[0] = projectile; projectile.transform.parent = gun.barrelOffset; projectile.name = "Firework_Rocket"; ExplosiveModifier explosiveMod = projectile.gameObject.AddComponent <ExplosiveModifier>(); explosiveMod.explosionData = new ExplosionData(); explosiveMod.explosionData.CopyFrom((PickupObjectDatabase.GetById(593) as Gun).DefaultModule.projectiles[0].GetComponent <ExplosiveModifier>().explosionData); explosiveMod.explosionData.effect = EnemyDatabase.GetOrLoadByGuid(RnGEnemyDatabase.GetRnGEnemyGuid(RnGEnemyDatabase.RnGEnemyType.DynaM80_Guy)).GetComponent <ExplodeOnDeath>().explosionData.effect; explosiveMod.IgnoreQueues = true; projectile.SuppressHitEffects = true; projectile.damageTypes = CoreDamageTypes.None; projectile.AppliesFire = false; mod.cooldownTime = 1f; mod.numberOfShotsInClip = 1; if (mod != gun.DefaultModule) { mod.ammoCost = 0; } } gun.Volley.UsesShotgunStyleVelocityRandomizer = true; gun.Volley.DecreaseFinalSpeedPercentMin = -10f; gun.Volley.IncreaseFinalSpeedPercentMax = 10f; gun.reloadTime = 2.5f; gun.gunSwitchGroup = Toolbox.GetGunById(39).gunSwitchGroup; gun.SetBaseMaxAmmo(75); gun.quality = PickupObject.ItemQuality.A; gun.barrelOffset.transform.localPosition = new Vector3(1f, 0.35f, 0f); gun.encounterTrackable.EncounterGuid = "celebration_mk1"; gun.gunClass = GunClass.EXPLOSIVE; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToCursulaShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(275); }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Ugly Gun", "ugly_gun"); Game.Items.Rename("outdated_gun_mods:ugly_gun", "spapi:ugly_gun"); gun.gameObject.AddComponent <UglyGun>(); GunExt.SetShortDescription(gun, "Ew!"); GunExt.SetLongDescription(gun, "A very ugly gun. It doesn't even have a clip, how the heck does it shoot!?\n\nThis gun is a result of a mage trying to smith his own gun. That mage was very expirienced in magic and " + "enchantments, but he suck at gunsmithing.\n\nThis gun turned out to be a total fail. It has some parts missing, and light doesn't even affect it. Why the hell did you pick it up???"); GunExt.SetupSprite(gun, null, "ugly_gun_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16); GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(35) as Gun).DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.projectiles[0] = projectile; projectile.transform.parent = gun.barrelOffset; projectile.baseData.damage = 12.123412342348102398f; projectile.baseData.speed /= 4.412387401289374012438523f; projectile.SetProjectileSpriteRight("ugly_projectile_001", 11, 11); projectile.name = "uGLy_PR0jeCt1L3"; gun.clipObject = Toolbox.CreateCustomClip("ugly_clip_001", 14, 10); gun.muzzleFlashEffects = Toolbox.CreateMuzzleflash("UglyMuzzleflash", new List <string> { "kill_me", "kill_me2" }, 1, new List <IntVector2> { new IntVector2(64, 46), new IntVector2(64, 46) }, new List <tk2dBaseSprite.Anchor> { tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft }, new List <Vector2> { Vector2.zero, Vector2.zero }, false, false, false, false, 0, VFXAlignment.Fixed, true, new List <float> { 100f, 100f }, new List <Color> { Color.red, Color.red }); gun.reloadClipLaunchFrame = 0; gun.DefaultModule.cooldownTime = 0.369817263493402345209387f; gun.DefaultModule.numberOfShotsInClip = 7; gun.reloadTime = 1.34871023948710239481f; gun.SetBaseMaxAmmo(513); gun.quality = PickupObject.ItemQuality.C; gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f); gun.encounterTrackable.EncounterGuid = "very_ugly_gun"; gun.gunClass = GunClass.PISTOL; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Big Gun", "big_gun"); Game.Items.Rename("outdated_gun_mods:big_gun", "spapi:big_gun"); gun.gameObject.AddComponent <BigGunController>(); GunExt.SetShortDescription(gun, "A Gun That's Big"); GunExt.SetLongDescription(gun, "A big gun.\n\nIn comparison with the Magnum, this one is bigger."); GunExt.SetupSprite(gun, null, "big_gun_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16); GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(601) as Gun, true, false); gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(601) as Gun).DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.projectiles[0] = projectile; projectile.transform.parent = gun.barrelOffset; projectile.baseData.damage *= 2f; projectile.baseData.speed *= 2f; projectile.name = "BigGun_Projectile"; gun.DefaultModule.cooldownTime = 0.15f; gun.DefaultModule.numberOfShotsInClip = 3; gun.reloadTime = 2.1f; gun.SetBaseMaxAmmo(60); gun.quality = PickupObject.ItemQuality.S; gun.barrelOffset.transform.localPosition = new Vector3(1.90f, 1.0f, 0f); gun.muzzleFlashEffects.type = VFXPoolType.None; gun.encounterTrackable.EncounterGuid = "oh_look_this_gun_is_big"; gun.gunClass = GunClass.PISTOL; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(601); AdvancedDualWieldSynergyProcessor dualWieldController = gun.gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>(); dualWieldController.SynergyNameToCheck = "#BIG_GUN_SHOTGUN-GUN"; dualWieldController.PartnerGunID = 601; }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Infinity", "infinity"); Game.Items.Rename("outdated_gun_mods:infinity", "spapi:infinity"); gun.gameObject.AddComponent <InfinityController>(); GunExt.SetShortDescription(gun, "[sprite \"infinite-big\"]"); GunExt.SetLongDescription(gun, "A small piece of never ending time matter, this gun might be older than the universe itself.\nEven though it isn't very powerful, it has a great potential..."); GunExt.SetupSprite(gun, null, "infinity_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16); GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = "infinity"; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(35) as Gun).DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.projectiles[0] = projectile; projectile.transform.parent = gun.barrelOffset; projectile.baseData.damage = 12.123412342348102398f; projectile.baseData.speed /= 4.412387401289374012438523f; gun.DefaultModule.cooldownTime = 0.369817263493402345209387f; gun.DefaultModule.numberOfShotsInClip = 1; gun.reloadTime = 0f; gun.InfiniteAmmo = false; gun.quality = PickupObject.ItemQuality.C; gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f); gun.encounterTrackable.EncounterGuid = "infinity"; gun.gunClass = GunClass.PISTOL; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); //Toolbox.CreateAmmoType("", ""); //gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; //gun.DefaultModule.customAmmoType = "ExampleUIClip"; }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Bullat Launcher", "batlauncher"); Game.Items.Rename("outdated_gun_mods:bullat_launcher", "spapi:bullat_launcher"); GunExt.SetShortDescription(gun, "Fires Bullats"); GunExt.SetLongDescription(gun, "Shoots angry bullats.\n\nCatching Bullats is fairly easy and every good gundead hunter has to have a Bullat collection. Frifle through had an idea to weaponize his collection, and made this gun."); GunExt.SetupSprite(gun, null, "batlauncher_idle_001", 16); GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Charged; AdvancedGunBehaviour advancedGunBehaviour = gun.gameObject.AddComponent <AdvancedGunBehaviour>(); advancedGunBehaviour.preventNormalFireAudio = true; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; AIActor bullat = EnemyDatabase.GetOrLoadByGuid("2feb50a6a40f4f50982e89fd276f6f15"); Projectile toInstantiate = null; foreach (AttackBehaviorBase behav in bullat.behaviorSpeculator.AttackBehaviors) { if (behav is AttackBehaviorGroup) { foreach (AttackBehaviorGroup.AttackGroupItem item in (behav as AttackBehaviorGroup).AttackBehaviors) { if (item.Behavior is SuicideShotBehavior) { toInstantiate = bullat.bulletBank.GetBullet((item.Behavior as SuicideShotBehavior).bulletBankName).BulletObject.GetComponent <Projectile>(); } } } else if (behav is SuicideShotBehavior) { toInstantiate = bullat.bulletBank.GetBullet((behav as SuicideShotBehavior).bulletBankName).BulletObject.GetComponent <Projectile>(); } } Projectile projectile = UnityEngine.Object.Instantiate(toInstantiate); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> { new ProjectileModule.ChargeProjectile { ChargeTime = 1.5f, Projectile = projectile } }; projectile.transform.parent = gun.barrelOffset; projectile.collidesWithEnemies = true; projectile.baseData.damage = 20f; gun.gunHandedness = GunHandedness.OneHanded; projectile.name = "Bullat_Projectile"; gun.DefaultModule.cooldownTime = 0.5f; gun.DefaultModule.numberOfShotsInClip = 1; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = "finished small"; gun.muzzleFlashEffects.type = VFXPoolType.None; gun.reloadTime = 1.5f; gun.SetBaseMaxAmmo(50); gun.quality = PickupObject.ItemQuality.C; gun.barrelOffset.transform.localPosition = new Vector3(1.25f, 1.0625f, 0f); gun.encounterTrackable.EncounterGuid = "batlauncher"; gun.gunClass = GunClass.CHARGE; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[1].FrameToDefinition().MakeOffset(new Vector2(-0.0625f, 0.0625f)); gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[3].FrameToDefinition().MakeOffset(new Vector2(-0.0625f, 0.0625f)); gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio = "Play_ENM_bullat_tackle_01"; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].eventAudio = "Play_ENM_bullat_charge_01"; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].triggerEvent = true; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode = tk2dSpriteAnimationClip.WrapMode.LoopSection; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 2; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); AdvancedInfiniteAmmoSynergyProcessor processor = gun.gameObject.AddComponent <AdvancedInfiniteAmmoSynergyProcessor>(); processor.RequiredSynergy = "#KING_BULLAT_SHOOTER"; processor.PreventsReload = false; }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Soul Orb", "soul_orb"); Game.Items.Rename("outdated_gun_mods:soul_orb", "spapi:soul_orb"); SoulOrbController component = gun.gameObject.AddComponent <SoulOrbController>(); GunExt.SetShortDescription(gun, "Contains SOUL"); GunExt.SetLongDescription(gun, "Charges up. Firing consumes 3 charges and casts a powerful spell. Reloading swaps the spell and holding \"reload\" consumes 3 charge to heal the owner.\n\nSOUL is the essence of life in a far away kingdom. " + "It somehow works here too, even through gundead do not contain it."); GunExt.SetupSprite(gun, null, "soul_orb_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16); GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.angleVariance = 0; gun.SetBaseMaxAmmo(1); gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; Projectile oldProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(47) as Gun).DefaultModule.projectiles[0]); SoulProjectileBehaviour projectile = Toolbox.CopyFields <SoulProjectileBehaviour>(oldProjectile); Destroy(oldProjectile); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.projectiles[0] = projectile; projectile.transform.parent = gun.barrelOffset; projectile.AnimateProjectile(new List <string> { "vs_001", "vs_002", "vs_003", "vs_004", "vs_005" }, 16, true, new List <IntVector2> { new IntVector2(30, 12), new IntVector2(30, 12), new IntVector2(26, 12), new IntVector2(27, 14), new IntVector2(29, 12) }, Toolbox.ConstructListOfSameValues(true, 5), Toolbox.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 5), Toolbox.ConstructListOfSameValues(true, 5), Toolbox.ConstructListOfSameValues(true, 5), Toolbox.ConstructListOfSameValues <Vector3?>(null, 5), Toolbox.ConstructListOfSameValues <IntVector2?>(null, 5), Toolbox.ConstructListOfSameValues <IntVector2?>(null, 5), Toolbox.ConstructListOfSameValues <Projectile>(null, 5)); gun.DefaultModule.cooldownTime = 0f; component.preventNormalFireAudio = true; component.overrideNormalFireAudio = "Play_WPN_bsg_shot_01"; projectile.AdditionalScaleMultiplier = 2f; projectile.hitEffects = Toolbox.GetGunById(417).DefaultModule.projectiles[0].hitEffects; projectile.ignoreDamageCaps = true; projectile.baseData.damage = 100f; gun.InfiniteAmmo = true; gun.DefaultModule.numberOfShotsInClip = 1; gun.reloadTime = 0f; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = "white"; gun.quality = PickupObject.ItemQuality.S; gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f); gun.encounterTrackable.EncounterGuid = "soul_orb"; gun.gunClass = GunClass.PISTOL; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); SoulFocusVFX = (PickupObjectDatabase.GetById(538) as SilverBulletsPassiveItem).SynergyPowerVFX; }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Super Bullat Launcher", "superbatlauncher"); Game.Items.Rename("outdated_gun_mods:super_bullat_launcher", "spapi:bullat_launcher+king_bullat_shooter"); GunExt.SetShortDescription(gun, "Fires Bullats"); GunExt.SetLongDescription(gun, "Shoots angry bullats.\n\nCatching Bullats is fairly easy and every good gundead hunter has to have a Bullat collection. Frifle through had an idea to weaponize his collection, and made this gun."); GunExt.SetupSprite(gun, null, "superbatlauncher_idle_001", 12); for (int i = 0; i < 12; i++) { GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); } int j = 0; foreach (ProjectileModule mod in gun.Volley.projectiles) { mod.angleVariance = 0; mod.shootStyle = ProjectileModule.ShootStyle.Charged; mod.cooldownTime = 0.5f; mod.numberOfShotsInClip = 10; Projectile projectile = Instantiate(Toolbox.GetGunById(38).DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); DontDestroyOnLoad(projectile); projectile.transform.parent = gun.barrelOffset; projectile.baseData.damage = 15f; projectile.name = "SuperBullat_Projectile"; BounceProjModifier modifier = projectile.gameObject.GetOrAddComponent <BounceProjModifier>(); modifier.numberOfBounces = 1; mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> { new ProjectileModule.ChargeProjectile { ChargeTime = 1.5f, Projectile = projectile } }; mod.ammoType = GameUIAmmoType.AmmoType.CUSTOM; mod.customAmmoType = "finished small"; mod.angleFromAim = j * 30; j++; } AdvancedGunBehaviour advancedGunBehaviour = gun.gameObject.AddComponent <AdvancedGunBehaviour>(); advancedGunBehaviour.preventNormalFireAudio = true; gun.muzzleFlashEffects.type = VFXPoolType.None; gun.reloadTime = 1.5f; gun.gunHandedness = GunHandedness.OneHanded; gun.SetBaseMaxAmmo(50); gun.InfiniteAmmo = true; gun.quality = PickupObject.ItemQuality.EXCLUDED; gun.barrelOffset.transform.localPosition = new Vector3(1.625f, 1.5625f, 0f); gun.encounterTrackable.EncounterGuid = "superbatlauncher"; gun.gunClass = GunClass.CHARGE; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio = "Play_ENM_bullat_tackle_01"; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].eventAudio = "Play_ENM_bullat_charge_01"; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].triggerEvent = true; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode = tk2dSpriteAnimationClip.WrapMode.LoopSection; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 1; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("Blue Chamber", "blue_chamber"); Game.Items.Rename("outdated_gun_mods:blue_chamber", "spapi:blue_chamber"); gun.gameObject.AddComponent <BlueChamberController>(); GunExt.SetShortDescription(gun, "\"it shoots stuff\""); GunExt.SetLongDescription(gun, "Even through this gun seems a chamber, it's actually a gun.\n\nKills the weak."); GunExt.SetupSprite(gun, null, "blue_chamber_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 10); GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 10); GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Charged; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(761) as Gun).DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> { new ProjectileModule.ChargeProjectile { Projectile = projectile, ChargeTime = 1.6f } }; projectile.transform.parent = gun.barrelOffset; projectile.RemoveComponent <KthuliberProjectileController>(); projectile.gameObject.AddComponent <KillTheWeakBehaviour>(); projectile.name = "BlueChamber_Projectile"; gun.reloadClipLaunchFrame = 0; gun.DefaultModule.cooldownTime = 2f; gun.DefaultModule.numberOfShotsInClip = 10; gun.reloadTime = 2f; gun.DefaultModule.ammoCost = 6; gun.SetBaseMaxAmmo(666); gun.quality = PickupObject.ItemQuality.C; gun.barrelOffset.transform.localPosition = new Vector3(1.3f, 0.65f, 0f); gun.gunSwitchGroup = "Kthulu"; gun.encounterTrackable.EncounterGuid = "blue_chamber"; gun.muzzleFlashEffects.type = VFXPoolType.None; gun.gunClass = GunClass.PISTOL; ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.Curse, 2f); ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.Health, 2f); ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.RateOfFire, 0.15f); tk2dSpriteAnimator animator = gun.GetComponent <tk2dSpriteAnimator>(); for (int i = animator.GetClipByName(gun.chargeAnimation).frames.Length - 2; i > -1; i--) { tk2dSpriteAnimationFrame frame2 = animator.GetClipByName(gun.chargeAnimation).frames[i]; tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = frame2.spriteId, spriteCollection = frame2.spriteCollection }; animator.GetClipByName(gun.shootAnimation).frames = animator.GetClipByName(gun.shootAnimation).frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray(); } animator.GetClipByName(gun.chargeAnimation).wrapMode = tk2dSpriteAnimationClip.WrapMode.LoopSection; animator.GetClipByName(gun.chargeAnimation).loopStart = 15; animator.GetClipByName(gun.shootAnimation).frames[0].FrameToDefinition().MakeOffset(new Vector2(-0.125f, 0.125f)); animator.GetClipByName(gun.shootAnimation).frames[1].FrameToDefinition().MakeOffset(new Vector2(0.0625f, -0.0625f)); animator.GetClipByName(gun.shootAnimation).frames[2].FrameToDefinition().MakeOffset(new Vector2(-0.0625f, 0.0625f)); ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); }
public static void Init() { Gun gun = ETGMod.Databases.Items.NewGun("SpecialGUN", "special_gun"); Game.Items.Rename("outdated_gun_mods:specialgun", "spapi:specialgun"); GunExt.SetShortDescription(gun, "GunAPI When?"); GunExt.SetLongDescription(gun, "Gun made by a sentient golden lock. Smites all things unworthy of living in Gungeon.\n\nThe word \"BAD\" can be heard from inside."); GunExt.SetupSprite(gun, null, "special_gun_idle_001", 8); GunExt.SetAnimationFPS(gun, gun.shootAnimation, 11); GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 11); GunExt.AddProjectileModuleFrom(gun, "klobb", true, false); AdvancedGunBehaviour behav = gun.gameObject.AddComponent <AdvancedGunBehaviour>(); behav.preventNormalReloadAudio = true; behav.overrideNormalReloadAudio = "Play_WPN_magnum_reload_01"; gun.gunSwitchGroup = "BeholsterEye"; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET; SpecialGunProjectile projectile = Toolbox.CopyFields <SpecialGunProjectile>(UnityEngine.Object.Instantiate((PickupObjectDatabase.GetById(35) as Gun).DefaultModule.projectiles[0])); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); gun.DefaultModule.projectiles[0] = projectile; projectile.transform.parent = gun.barrelOffset; projectile.baseData.damage = 10f; projectile.baseData.speed = 20f; gun.carryPixelOffset += new IntVector2(1, 0); gun.DefaultModule.cooldownTime = 0.15f; gun.DefaultModule.numberOfShotsInClip = 7; gun.reloadTime = 0.78f; gun.SetBaseMaxAmmo(100); gun.muzzleFlashEffects = Toolbox.GetGunById(53).muzzleFlashEffects; gun.quality = PickupObject.ItemQuality.S; gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f); gun.encounterTrackable.EncounterGuid = "special_gun"; gun.gunClass = GunClass.PISTOL; int index = 0; foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames) { tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId]; if (def != null) { def.MakeOffset(offsets[0][index]); } index++; } index = 0; foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames) { tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId]; if (def != null) { def.MakeOffset(offsets[1][index]); } index++; } index = 0; foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames) { tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId]; if (def != null) { def.MakeOffset(offsets[2][index]); } index++; } gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames = new tk2dSpriteAnimationFrame[0]; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames = new tk2dSpriteAnimationFrame[0]; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames = new tk2dSpriteAnimationFrame[0]; index = 0; foreach (string name in spriteNames[0]) { tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(name), spriteCollection = ETGMod.Databases.Items.WeaponCollection }; Toolbox.Add(ref gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames, frame); index++; } index = 0; foreach (string name in spriteNames[1]) { tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(name), spriteCollection = ETGMod.Databases.Items.WeaponCollection }; Toolbox.Add(ref gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames, frame); index++; } index = 0; foreach (string name in spriteNames[2]) { tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(name), spriteCollection = ETGMod.Databases.Items.WeaponCollection }; Toolbox.Add(ref gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames, frame); index++; } gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames[3].eventAudio = "Play_WPN_SAA_spin_01"; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames[3].triggerEvent = true; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToTrorkShop(); gun.AddToBlacksmithShop(); gun.RemovePeskyQuestionmark(); gun.PlaceItemInAmmonomiconAfterItemById(22); GameObject obj = SpriteBuilder.SpriteFromResource("SpecialItemPack/Resources/rad_vfx_bad_intro_001", new GameObject("SmiteVFX")).ProcessGameObject(); tk2dSpriteAnimator animator = obj.AddComponent <tk2dSpriteAnimator>(); animator.Library = obj.AddComponent <tk2dSpriteAnimation>(); tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip { name = "idle", fps = 7, frames = new tk2dSpriteAnimationFrame[0], wrapMode = tk2dSpriteAnimationClip.WrapMode.Once }; foreach (string spritePath in smiteVFXSpritePaths) { int id = SpriteBuilder.AddSpriteToCollection(spritePath, SpriteBuilder.itemCollection); tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = id, spriteCollection = SpriteBuilder.itemCollection }; frame.FrameToDefinition().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, frame.FrameToDefinition().position3); Toolbox.Add(ref clip.frames, frame); } animator.Library.clips = new tk2dSpriteAnimationClip[] { clip }; animator.playAutomatically = true; animator.DefaultClipId = animator.GetClipIdByName("idle"); SpriteAnimatorKiller kill = animator.gameObject.AddComponent <SpriteAnimatorKiller>(); kill.fadeTime = -1f; kill.animator = animator; kill.delayDestructionTime = -1f; SmiteVFX = obj; GameObject obj2 = SpriteBuilder.SpriteFromResource("SpecialItemPack/Resources/rad_vfx_bad_intro_001", new GameObject("SmiteVFX")).ProcessGameObject(); tk2dSpriteAnimator animator2 = obj2.AddComponent <tk2dSpriteAnimator>(); animator2.Library = obj2.AddComponent <tk2dSpriteAnimation>(); tk2dSpriteAnimationClip clip2 = new tk2dSpriteAnimationClip { name = "idle", fps = 7, frames = new tk2dSpriteAnimationFrame[0], wrapMode = tk2dSpriteAnimationClip.WrapMode.Once }; foreach (string spritePath in notSmiteVFXSpritePaths) { int id = SpriteBuilder.AddSpriteToCollection(spritePath, SpriteBuilder.itemCollection); tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame { spriteId = id, spriteCollection = SpriteBuilder.itemCollection }; frame.FrameToDefinition().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, frame.FrameToDefinition().position3); Toolbox.Add(ref clip2.frames, frame); } animator2.Library.clips = new tk2dSpriteAnimationClip[] { clip2 }; animator2.playAutomatically = true; animator2.DefaultClipId = animator2.GetClipIdByName("idle"); SpriteAnimatorKiller kill2 = animator2.gameObject.AddComponent <SpriteAnimatorKiller>(); kill2.fadeTime = -1f; kill2.animator = animator2; kill2.delayDestructionTime = -1f; NotSmiteVFX = obj2; }