private void OnGuonHitByBullet(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider) { if (Owner && this.m_extantOrbital) { if (other.projectile && other.projectile.Owner is PlayerController) { if (!other.projectile.GetComponent <BuffedByMaroonGuonStone>()) { float damageMult = 1.5f; if (Owner.PlayerHasActiveSynergy("Marooner Guon Stone")) { damageMult = 2f; } other.projectile.baseData.damage *= damageMult; other.projectile.RuntimeUpdateScale(1.2f); other.projectile.gameObject.AddComponent <BuffedByMaroonGuonStone>(); other.projectile.AdjustPlayerProjectileTint(ExtendedColours.maroon, 2); ExtremelySimpleStatusEffectBulletBehaviour StatusEffect = other.projectile.gameObject.GetOrAddComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); if (Owner.PlayerHasActiveSynergy("Toxic Core")) { StatusEffect.usesPoisonEffect = true; } if (Owner.PlayerHasActiveSynergy("Charming Core")) { StatusEffect.usesCharmEffect = true; } if (Owner.PlayerHasActiveSynergy("Burning Core")) { StatusEffect.usesFireEffect = true; } if (Owner.PlayerHasActiveSynergy("Explosive Core")) { ExplosiveModifier Splodey = other.projectile.gameObject.GetOrAddComponent <ExplosiveModifier>(); Splodey.doExplosion = true; Splodey.explosionData = StaticExplosionDatas.explosiveRoundsExplosion; } if (Owner.PlayerHasActiveSynergy("Hungry Core")) { HungryProjectileModifier hungry = other.projectile.gameObject.GetOrAddComponent <HungryProjectileModifier>(); } if (Owner.PlayerHasActiveSynergy("Smart Core")) { HomingModifier homing = other.projectile.gameObject.GetOrAddComponent <HomingModifier>(); } } PhysicsEngine.SkipCollision = true; } else if (other.projectile && !(other.projectile.Owner is PlayerController)) { PhysicsEngine.SkipCollision = true; } } }
public override void PostProcessProjectile(Projectile projectile) { if (projectile.Owner is PlayerController) { PlayerController player = projectile.Owner as PlayerController; if (player.PlayerHasActiveSynergy("Heat Stress")) { ExtremelySimpleStatusEffectBulletBehaviour burning = projectile.gameObject.GetComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); if (burning != null) { burning.onHitProcChance *= 3f; } } if (player.PlayerHasActiveSynergy("Stick In The Mud")) { ApplyLockdownBulletBehaviour lockingdown = projectile.gameObject.GetComponent <ApplyLockdownBulletBehaviour>(); if (lockingdown != null) { lockingdown.duration *= 2f; } } } }
public override void PostProcessProjectile(Projectile projectile) { if (projectile.Owner is PlayerController) { PlayerController player = projectile.Owner as PlayerController; LorebookFantasyBullet loreness = projectile.gameObject.GetComponent <LorebookFantasyBullet>(); if (loreness != null) { if (loreness.Class == LorebookFantasyBullet.PartyMember.KNIGHT) { if (player.PlayerHasActiveSynergy("Level 20 Fighter")) { projectile.baseData.damage *= 1.25f; projectile.baseData.speed *= 1.15f; projectile.UpdateSpeed(); PierceProjModifier knightPiercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); knightPiercing.penetration += 5; MakeLookLikeJammedBullet(projectile); } } else if (loreness.Class == LorebookFantasyBullet.PartyMember.ROGUE) { if (player.PlayerHasActiveSynergy("Level 20 Rogue")) { projectile.baseData.damage *= 1.25f; ExtremelySimpleStatusEffectBulletBehaviour roguePoisoning = projectile.gameObject.GetOrAddComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); roguePoisoning.usesPoisonEffect = true; roguePoisoning.poisonEffect = StaticStatusEffects.irradiatedLeadEffect; MakeLookLikeJammedBullet(projectile); } } else if (loreness.Class == LorebookFantasyBullet.PartyMember.WIZARD) { if (player.PlayerHasActiveSynergy("Level 20 Wizard")) { projectile.baseData.damage *= 1.25f; SpawnProjModifier WizardShooting = projectile.gameObject.GetComponent <SpawnProjModifier>(); if (WizardShooting != null) { WizardShooting.inFlightSpawnCooldown = 0.35f; } MakeLookLikeJammedBullet(projectile); } } else if (loreness.Class == LorebookFantasyBullet.PartyMember.BARD) { if (player.PlayerHasActiveSynergy("Level 20 Bard")) { projectile.baseData.damage *= 1.25f; GameActorCharmEffect UpgradedCharm = new GameActorCharmEffect { duration = StaticStatusEffects.charmingRoundsEffect.duration * 3, TintColor = StaticStatusEffects.charmingRoundsEffect.TintColor, DeathTintColor = StaticStatusEffects.charmingRoundsEffect.DeathTintColor, effectIdentifier = "Upgraded Bard Charm", AppliesTint = true, AppliesDeathTint = true, resistanceType = EffectResistanceType.Charm, //Eh OverheadVFX = StaticStatusEffects.charmingRoundsEffect.OverheadVFX, AffectsEnemies = true, AffectsPlayers = false, AppliesOutlineTint = false, OutlineTintColor = StaticStatusEffects.charmingRoundsEffect.OutlineTintColor, PlaysVFXOnActor = false, }; ExtremelySimpleStatusEffectBulletBehaviour BardCharming = projectile.gameObject.GetComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); BardCharming.charmEffect = UpgradedCharm; BardCharming.usesCharmEffect = true; MakeLookLikeJammedBullet(projectile); } } } } base.PostProcessProjectile(projectile); }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Lorebook", "lorebook"); Game.Items.Rename("outdated_gun_mods:lorebook", "nn:lorebook"); var behav = gun.gameObject.AddComponent <Lorebook>(); behav.preventNormalFireAudio = true; behav.preventNormalReloadAudio = true; behav.overrideNormalFireAudio = "Play_ENM_wizard_summon_01"; behav.overrideNormalReloadAudio = "Play_ENM_book_blast_01"; gun.SetShortDescription("Party Cohesion"); gun.SetLongDescription("Summons brave and noble bullet warriors of several different classes to destroy everything in sight and wreak havoc." + "\n(Like real heroes!)" + "\n\nThis magical tome of stories and scenarios was stolen from one of the most evil creatures in the Gungeon; a Lore Gunjurer."); gun.SetupSprite(null, "lorebook_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 18); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false); //gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) 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.6f; gun.muzzleFlashEffects.type = VFXPoolType.None; gun.DefaultModule.numberOfShotsInClip = 4; gun.barrelOffset.transform.localPosition = new Vector3(0.93f, 0.87f, 0f); gun.SetBaseMaxAmmo(110); gun.gunClass = GunClass.SILLY; Projectile wizardSpellProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]); wizardSpellProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(wizardSpellProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(wizardSpellProjectile); wizardSpellProjectile.baseData.damage *= 1f; wizardSpellProjectile.baseData.speed *= 0.7f; wizardSpellProjectile.baseData.range *= 5f; wizardSpellProjectile.SetProjectileSpriteRight("smallspark_projectile", 7, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 6, 6); Projectile wizardProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]); wizardProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(wizardProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(wizardProjectile); wizardProjectile.baseData.damage *= 3f; wizardProjectile.baseData.speed *= 0.08f; wizardProjectile.baseData.range *= 5f; LorebookFantasyBullet wizardClassing = wizardProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>(); wizardClassing.Class = LorebookFantasyBullet.PartyMember.WIZARD; wizardProjectile.pierceMinorBreakables = true; SpawnProjModifier wizardshot = wizardProjectile.gameObject.GetOrAddComponent <SpawnProjModifier>(); wizardshot.usesComplexSpawnInFlight = true; wizardshot.spawnOnObjectCollisions = false; wizardshot.spawnProjecitlesOnDieInAir = false; wizardshot.spawnProjectilesOnCollision = false; wizardshot.spawnProjectilesInFlight = true; wizardshot.projectileToSpawnInFlight = wizardSpellProjectile; wizardshot.inFlightAimAtEnemies = true; wizardshot.inFlightSpawnCooldown = 1.15f; wizardshot.numberToSpawnOnCollison = 0; wizardshot.numToSpawnInFlight = 1; wizardshot.PostprocessSpawnedProjectiles = true; HomingModifier wizardHoming = wizardProjectile.gameObject.AddComponent <HomingModifier>(); wizardHoming.AngularVelocity = 120f; wizardHoming.HomingRadius = 1000f; BounceProjModifier wizardBouncing = wizardProjectile.gameObject.GetOrAddComponent <BounceProjModifier>(); wizardBouncing.numberOfBounces = 10; wizardProjectile.AnimateProjectile(new List <string> { "playerwizardprojectile_001", "playerwizardprojectile_002", "playerwizardprojectile_003", "playerwizardprojectile_004", }, 10, true, new List <IntVector2> { new IntVector2(17, 22), //1 new IntVector2(17, 22), //2 new IntVector2(17, 22), //3 new IntVector2(17, 22), //3 }, AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), new List <IntVector2?> { new IntVector2(11, 16), //1 new IntVector2(11, 16), //2 new IntVector2(11, 16), //3 new IntVector2(11, 16), //3 }, AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4)); wizardProjectile.shouldFlipHorizontally = true; Projectile bardProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]); bardProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(bardProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(bardProjectile); bardProjectile.baseData.damage *= 4f; bardProjectile.baseData.range *= 5f; bardProjectile.baseData.speed *= 0.25f; LorebookFantasyBullet bardClassing = bardProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>(); bardClassing.Class = LorebookFantasyBullet.PartyMember.BARD; bardProjectile.pierceMinorBreakables = true; HomingModifier bardHoming = bardProjectile.gameObject.AddComponent <HomingModifier>(); bardHoming.AngularVelocity = 120f; bardHoming.HomingRadius = 1000f; ExtremelySimpleStatusEffectBulletBehaviour bardCharming = bardProjectile.gameObject.AddComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); bardCharming.usesCharmEffect = true; bardCharming.charmEffect = StaticStatusEffects.charmingRoundsEffect; BounceProjModifier bardBouncing = bardProjectile.gameObject.GetOrAddComponent <BounceProjModifier>(); bardBouncing.numberOfBounces = 10; bardProjectile.AnimateProjectile(new List <string> { "playerbardbullet_001", "playerbardbullet_002", "playerbardbullet_003", "playerbardbullet_004", }, 10, true, new List <IntVector2> { new IntVector2(16, 15), //1 new IntVector2(16, 15), //2 new IntVector2(16, 15), //3 new IntVector2(16, 15), //3 }, AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), new List <IntVector2?> { new IntVector2(10, 9), //1 new IntVector2(10, 9), //2 new IntVector2(10, 9), //3 new IntVector2(10, 9), //3 }, AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4)); bardProjectile.shouldFlipHorizontally = true; Projectile rogueProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]); rogueProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(rogueProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(rogueProjectile); rogueProjectile.baseData.damage *= 4f; rogueProjectile.baseData.speed *= 0.3f; rogueProjectile.baseData.range *= 5f; LorebookFantasyBullet rogueClassing = rogueProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>(); rogueClassing.Class = LorebookFantasyBullet.PartyMember.ROGUE; rogueProjectile.shouldFlipHorizontally = true; rogueProjectile.pierceMinorBreakables = true; HomingModifier rogueHoming = rogueProjectile.gameObject.AddComponent <HomingModifier>(); rogueHoming.AngularVelocity = 120f; rogueHoming.HomingRadius = 1000f; BounceProjModifier rogueBouncing = rogueProjectile.gameObject.GetOrAddComponent <BounceProjModifier>(); rogueBouncing.numberOfBounces = 10; //Set Up Teleport Effect GameObject BaseEnemyRogueBullet = EnemyDatabase.GetOrLoadByGuid("56fb939a434140308b8f257f0f447829").bulletBank.GetBullet("rogue").BulletObject; Projectile BaseEnemyProjectileComponent = BaseEnemyRogueBullet.GetComponent <Projectile>(); if (BaseEnemyProjectileComponent != null) { TeleportProjModifier tp = BaseEnemyProjectileComponent.GetComponent <TeleportProjModifier>(); if (tp != null) { PlayerProjectileTeleportModifier rogueTeleport = rogueProjectile.gameObject.AddComponent <PlayerProjectileTeleportModifier>(); rogueTeleport.teleportVfx = tp.teleportVfx; rogueTeleport.teleportCooldown = tp.teleportCooldown; rogueTeleport.teleportPauseTime = tp.teleportPauseTime; rogueTeleport.trigger = PlayerProjectileTeleportModifier.TeleportTrigger.DistanceFromTarget; rogueTeleport.distToTeleport = tp.distToTeleport * 2f; rogueTeleport.behindTargetDistance = tp.behindTargetDistance; rogueTeleport.leadAmount = tp.leadAmount; rogueTeleport.minAngleToTeleport = tp.minAngleToTeleport; rogueTeleport.numTeleports = tp.numTeleports; rogueTeleport.type = PlayerProjectileTeleportModifier.TeleportType.BehindTarget; } else { ETGModConsole.Log("Base Eney TeleportProjModifier was null???"); } } else { ETGModConsole.Log("Base Enemy Rogue Bullet had no projectile component???"); } rogueProjectile.AnimateProjectile(new List <string> { "playerroguebullet_001", "playerroguebullet_002", "playerroguebullet_003", "playerroguebullet_004", }, 10, true, new List <IntVector2> { new IntVector2(16, 15), //1 new IntVector2(16, 15), //2 new IntVector2(16, 15), //3 new IntVector2(16, 15), //3 }, AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), new List <IntVector2?> { new IntVector2(10, 9), //1 new IntVector2(10, 9), //2 new IntVector2(10, 9), //3 new IntVector2(10, 9), //3 }, AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4)); //BULLET STATS Projectile knightProjectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]); knightProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(knightProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(knightProjectile); knightProjectile.baseData.range *= 5f; knightProjectile.baseData.damage *= 5f; LorebookFantasyBullet knightClassing = knightProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>(); knightClassing.Class = LorebookFantasyBullet.PartyMember.KNIGHT; knightProjectile.pierceMinorBreakables = true; knightProjectile.baseData.speed *= 0.25f; HomingModifier knightHoming = knightProjectile.gameObject.AddComponent <HomingModifier>(); knightHoming.AngularVelocity = 120f; knightHoming.HomingRadius = 1000f; BounceProjModifier knightBouncing = knightProjectile.gameObject.GetOrAddComponent <BounceProjModifier>(); knightBouncing.numberOfBounces = 10; knightProjectile.AnimateProjectile(new List <string> { "playerknightbullet_001", "playerknightbullet_002", "playerknightbullet_003", "playerknightbullet_004", }, 10, true, new List <IntVector2> { new IntVector2(19, 15), //1 new IntVector2(19, 15), //2 new IntVector2(19, 15), //3 new IntVector2(19, 15), //3 }, AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), new List <IntVector2?> { new IntVector2(13, 9), //1 new IntVector2(13, 9), //2 new IntVector2(13, 9), //3 new IntVector2(13, 9), //3 }, AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4)); knightProjectile.shouldFlipHorizontally = true; gun.DefaultModule.projectiles[0] = knightProjectile; gun.DefaultModule.projectiles.Add(wizardProjectile); gun.DefaultModule.projectiles.Add(bardProjectile); gun.DefaultModule.projectiles.Add(rogueProjectile); gun.quality = PickupObject.ItemQuality.B; ETGMod.Databases.Items.Add(gun, null, "ANY"); LorebookID = gun.PickupObjectId; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Glue Gunner", "gluegunner"); Game.Items.Rename("outdated_gun_mods:glue_gunner", "nn:hot_glue_gun+glue_gunner"); gun.gameObject.AddComponent <GlueGunGlueGunnerSynergy>(); gun.SetShortDescription("yes this is a btd reference"); gun.SetLongDescription("im too tired to write a snarky description"); gun.SetupSprite(null, "gluegunner_idle_001", 8); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(199) as Gun).gunSwitchGroup; gun.SetAnimationFPS(gun.shootAnimation, 12); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false); //GUN STATS gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Automatic; gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; gun.reloadTime = 1f; gun.DefaultModule.cooldownTime = 0.15f; gun.DefaultModule.numberOfShotsInClip = 15; gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.56f, 0f); gun.SetBaseMaxAmmo(340); gun.ammo = 340; //BULLET STATS Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); projectile.baseData.damage *= 1f; projectile.baseData.speed *= 1f; projectile.baseData.range *= 1f; ApplyLockdownBulletBehaviour applylockdown = projectile.gameObject.AddComponent <ApplyLockdownBulletBehaviour>(); applylockdown.useSpecialBulletTint = false; applylockdown.duration = 6f; applylockdown.enemyTintColour = ExtendedColours.paleYellow; applylockdown.TintEnemy = true; applylockdown.TintCorpse = true; applylockdown.corpseTintColour = ExtendedColours.paleYellow; ExtremelySimpleStatusEffectBulletBehaviour burning = projectile.gameObject.AddComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); burning.onHitProcChance = 0.14f; burning.onFiredProcChance = 1f; burning.usesFireEffect = false; burning.usesPoisonEffect = true; burning.poisonEffect = StaticStatusEffects.irradiatedLeadEffect; projectile.SetProjectileSpriteRight("gluegunner_projectile", 19, 8, false, tk2dBaseSprite.Anchor.MiddleCenter, 18, 7); gun.DefaultModule.projectiles[0] = projectile; gun.quality = PickupObject.ItemQuality.EXCLUDED; ETGMod.Databases.Items.Add(gun, null, "ANY"); GlueGunnerID = gun.PickupObjectId; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Master's Gun", "mastersgun"); Game.Items.Rename("outdated_gun_mods:master's_gun", "nn:masters_gun"); gun.gameObject.AddComponent <MastersGun>(); gun.SetShortDescription("Firing On All Cylinders"); gun.SetLongDescription("A humongous firearm, created by the Gungeon's Master to fire the legendary master rounds, though he never truly finished it." + "\n\nAfter it's recent rediscovery, the Blacksmith managed to finish the spectacular weapon, and even forged Master-Sized bullet replicas for ammo." + "\n\nNothing can beat the gun's original purpose though, so getting your grubby hands on some master rounds would be good."); gun.SetupSprite(null, "mastersgun_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 11); 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.muzzleFlashEffects = (PickupObjectDatabase.GetById(37) as Gun).muzzleFlashEffects; gun.DefaultModule.cooldownTime = 0.4f; gun.DefaultModule.numberOfShotsInClip = 6; gun.barrelOffset.transform.localPosition = new Vector3(3.62f, 1.81f, 0f); gun.SetBaseMaxAmmo(50); gun.gunClass = GunClass.PISTOL; //DEFAULT 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 *= 10f; projectile.ignoreDamageCaps = true; projectile.baseData.speed *= 1f; projectile.pierceMinorBreakables = true; PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); orAddComponent.penetratesBreakables = true; orAddComponent.penetration++; projectile.SetProjectileSpriteRight("mastersgun_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12); projectile.transform.parent = gun.barrelOffset; //KEEP BULLET STATS keepProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]); keepProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(keepProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(keepProjectile); keepProjectile.baseData.damage *= 16f; keepProjectile.ignoreDamageCaps = true; keepProjectile.baseData.speed *= 1f; keepProjectile.pierceMinorBreakables = true; PierceProjModifier keepComponent = keepProjectile.gameObject.GetOrAddComponent <PierceProjModifier>(); keepComponent.penetratesBreakables = true; keepComponent.penetration++; BounceProjModifier Bouncing = keepProjectile.gameObject.GetOrAddComponent <BounceProjModifier>(); Bouncing.numberOfBounces = 5; keepProjectile.SetProjectileSpriteRight("mastersgun_keep_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12); keepProjectile.transform.parent = gun.barrelOffset; gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup; //PROPER BULLET STATS properProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]); properProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(properProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(properProjectile); properProjectile.baseData.damage *= 16f; properProjectile.ignoreDamageCaps = true; properProjectile.baseData.speed *= 1f; properProjectile.pierceMinorBreakables = true; PierceProjModifier properComponent = properProjectile.gameObject.GetOrAddComponent <PierceProjModifier>(); properComponent.penetratesBreakables = true; properComponent.penetration++; ApplyLockdownBulletBehaviour properLockdown = properProjectile.gameObject.GetOrAddComponent <ApplyLockdownBulletBehaviour>(); properLockdown.duration = 6; properProjectile.SetProjectileSpriteRight("mastersgun_proper_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12); properProjectile.transform.parent = gun.barrelOffset; //MINES BULLET STATS minesProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]); minesProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(minesProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(minesProjectile); minesProjectile.baseData.damage *= 16f; minesProjectile.ignoreDamageCaps = true; minesProjectile.baseData.speed *= 1f; minesProjectile.pierceMinorBreakables = true; PierceProjModifier minesComponent = minesProjectile.gameObject.GetOrAddComponent <PierceProjModifier>(); minesComponent.penetratesBreakables = true; minesComponent.penetration++; ExtremelySimplePoisonBulletBehaviour minesPoisoning = minesProjectile.gameObject.GetOrAddComponent <ExtremelySimplePoisonBulletBehaviour>(); minesPoisoning.procChance = 1; minesPoisoning.useSpecialTint = false; minesProjectile.SetProjectileSpriteRight("mastersgun_mines_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12); minesProjectile.transform.parent = gun.barrelOffset; //HOLLOW BULLET STATS hollowProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]); hollowProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(hollowProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(hollowProjectile); hollowProjectile.baseData.damage *= 16f; hollowProjectile.ignoreDamageCaps = true; hollowProjectile.baseData.speed *= 1f; hollowProjectile.pierceMinorBreakables = true; PierceProjModifier hollowComponent = hollowProjectile.gameObject.GetOrAddComponent <PierceProjModifier>(); hollowComponent.penetratesBreakables = true; hollowComponent.penetration++; SimpleFreezingBulletBehaviour freezing = hollowProjectile.gameObject.GetOrAddComponent <SimpleFreezingBulletBehaviour>(); freezing.procChance = 1; freezing.useSpecialTint = false; freezing.freezeAmount = 150; freezing.freezeAmountForBosses = 100; hollowProjectile.SetProjectileSpriteRight("mastersgun_hollow_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12); hollowProjectile.transform.parent = gun.barrelOffset; //FORGE BULLET STATS forgeProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]); forgeProjectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(forgeProjectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(forgeProjectile); forgeProjectile.baseData.damage *= 20f; forgeProjectile.ignoreDamageCaps = true; forgeProjectile.baseData.speed *= 1f; forgeProjectile.pierceMinorBreakables = true; PierceProjModifier forgeComponent = forgeProjectile.gameObject.GetOrAddComponent <PierceProjModifier>(); forgeComponent.penetratesBreakables = true; forgeComponent.penetration++; ExtremelySimpleStatusEffectBulletBehaviour burning = forgeProjectile.gameObject.GetOrAddComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); burning.onFiredProcChance = 1; burning.usesFireEffect = true; burning.fireEffect = StaticStatusEffects.hotLeadEffect; burning.useSpecialTint = false; forgeProjectile.SetProjectileSpriteRight("mastersgun_forge_projectile", 33, 18, false, tk2dBaseSprite.Anchor.MiddleLeft, 27, 12); forgeProjectile.transform.parent = gun.barrelOffset; gun.quality = PickupObject.ItemQuality.S; //S gun.encounterTrackable.EncounterGuid = "this is the Master's Gun"; ETGMod.Databases.Items.Add(gun, null, "ANY"); }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Hot Glue Gun", "hotgluegun"); Game.Items.Rename("outdated_gun_mods:hot_glue_gun", "nn:hot_glue_gun"); gun.gameObject.AddComponent <HotGlueGun>(); gun.SetShortDescription("Ow!.. Heat was Hot!"); gun.SetLongDescription("Glues your foes in place, and has a chance to set them ablaze." + "\n\nPioneered by amateur guncrafters, and generally considered one of the most painful methods of adhesive application."); gun.SetupSprite(null, "hotgluegun_idle_001", 8); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(199) as Gun).gunSwitchGroup; gun.SetAnimationFPS(gun.shootAnimation, 12); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false); //GUN STATS gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; gun.reloadTime = 0.7f; gun.DefaultModule.cooldownTime = 0.4f; gun.DefaultModule.numberOfShotsInClip = 5; gun.barrelOffset.transform.localPosition = new Vector3(0.75f, 0.31f, 0f); gun.SetBaseMaxAmmo(150); gun.ammo = 150; gun.gunClass = GunClass.FIRE; //BULLET STATS Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); projectile.baseData.damage *= 1.6f; projectile.baseData.speed *= 0.5f; projectile.baseData.range *= 0.5f; ApplyLockdownBulletBehaviour applylockdown = projectile.gameObject.AddComponent <ApplyLockdownBulletBehaviour>(); applylockdown.useSpecialBulletTint = false; applylockdown.duration = 5f; applylockdown.enemyTintColour = ExtendedColours.paleYellow; applylockdown.TintEnemy = true; applylockdown.TintCorpse = true; applylockdown.corpseTintColour = ExtendedColours.paleYellow; ExtremelySimpleStatusEffectBulletBehaviour burning = projectile.gameObject.AddComponent <ExtremelySimpleStatusEffectBulletBehaviour>(); burning.onHitProcChance = 0.07f; burning.onFiredProcChance = 1f; burning.usesFireEffect = true; burning.fireEffect = StaticStatusEffects.hotLeadEffect; projectile.AnimateProjectile(new List <string> { "gluegunproj_1", "gluegunproj_2", "gluegunproj_1", "gluegunproj_3", }, 8, true, new List <IntVector2> { new IntVector2(5, 5), //1 new IntVector2(4, 6), //2 new IntVector2(5, 5), //3 new IntVector2(6, 4), //4 }, AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4)); gun.DefaultModule.projectiles[0] = projectile; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("HotGlueGun Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/hotgluegun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/hotgluegun_clipempty"); gun.quality = PickupObject.ItemQuality.B; ETGMod.Databases.Items.Add(gun, null, "ANY"); HotGlueGunID = gun.PickupObjectId; }