private void PostProcessProjectile(Projectile sourceProjectile, float effectChanceScalar) { PierceProjModifier piercing = sourceProjectile.gameObject.GetOrAddComponent <PierceProjModifier>(); piercing.penetration += 5; piercing.penetratesBreakables = true; MaintainDamageOnPierce maintenance = sourceProjectile.gameObject.GetOrAddComponent <MaintainDamageOnPierce>(); maintenance.damageMultOnPierce = 1.25f; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Gaxe", "gaxe"); Game.Items.Rename("outdated_gun_mods:gaxe", "nn:gaxe"); gun.gameObject.AddComponent <Gaxe>(); gun.SetShortDescription("Diggy Diggy"); gun.SetLongDescription("Advanced powder-powered mining tech only recently developed for use in the Black Powder Mine."); gun.SetupSprite(null, "gaxe_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 16); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(335) as Gun).gunSwitchGroup; gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false); //GUN STATS gun.reloadTime = 1f; gun.barrelOffset.transform.localPosition = new Vector3(2.62f, 1.12f, 0f); gun.SetBaseMaxAmmo(150); gun.gunClass = GunClass.PISTOL; //BULLET STATS bool iterator = false; foreach (ProjectileModule mod in gun.Volley.projectiles) { if (iterator == false) { mod.ammoCost = 1; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]); mod.projectiles[0] = projectile; projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); projectile.transform.parent = gun.barrelOffset; projectile.baseData.range *= 2; projectile.baseData.speed *= 1.5f; projectile.baseData.damage = 7; iterator = true; } else { mod.ammoCost = 0; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]); mod.projectiles[0] = projectile; projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); projectile.transform.parent = gun.barrelOffset; UnityEngine.Object.DontDestroyOnLoad(projectile); projectile.baseData.range *= 0.1f; projectile.baseData.damage = 15; projectile.specRigidbody.CollideWithTileMap = false; projectile.pierceMinorBreakables = true; PierceProjModifier piercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); piercing.penetration = 100; MaintainDamageOnPierce maintenance = projectile.gameObject.GetOrAddComponent <MaintainDamageOnPierce>(); projectile.SetProjectileSpriteRight("gaxe_projectile", 12, 40, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 30); DamageSecretWalls damageWalls = projectile.gameObject.GetOrAddComponent <DamageSecretWalls>(); //damageWalls.damageToDeal = 10f; } mod.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; mod.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; mod.cooldownTime = 0.35f; mod.angleVariance = 5f; mod.numberOfShotsInClip = 5; } gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Gaxe Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/gaxe_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/gaxe_clipempty"); gun.quality = PickupObject.ItemQuality.B; ETGMod.Databases.Items.Add(gun, null, "ANY"); GaxeID = gun.PickupObjectId; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Red Diamond Cutter", "reddiamondcutter"); Game.Items.Rename("outdated_gun_mods:red_diamond_cutter", "nn:diamond_cutter+ranger_class"); var behav = gun.gameObject.AddComponent <DiamondCutterRangerClass>(); behav.preventNormalReloadAudio = true; behav.preventNormalFireAudio = true; behav.overrideNormalFireAudio = "Play_WPN_blasphemy_shot_01"; gun.SetShortDescription("Face It!"); gun.SetLongDescription("Fires piercing gemstones." + "\n\nLeft in a chest by a powerful warrior of shimmering crystal... who didn't show up to work today."); gun.SetupSprite(null, "reddiamondcutter_idle_001", 8); gun.SetAnimationFPS(gun.reloadAnimation, 1); gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(97) as Gun).muzzleFlashEffects; gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false); //GUN STATS foreach (ProjectileModule mod in gun.Volley.projectiles) { mod.ammoCost = 1; mod.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic; mod.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; mod.cooldownTime = 0.2f; mod.numberOfShotsInClip = 3; mod.angleVariance = 20f; Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]); projectile.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(projectile.gameObject); UnityEngine.Object.DontDestroyOnLoad(projectile); projectile.baseData.damage = 10f; projectile.baseData.speed *= 1.5f; projectile.hitEffects.alwaysUseMidair = true; projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(506) as Gun).DefaultModule.projectiles[0].hitEffects.overrideMidairDeathVFX; PierceProjModifier pierce = projectile.gameObject.AddComponent <PierceProjModifier>(); pierce.penetration = 10; MaintainDamageOnPierce maintain = projectile.gameObject.AddComponent <MaintainDamageOnPierce>(); maintain.damageMultOnPierce = 1.2f; projectile.pierceMinorBreakables = true; projectile.SetProjectileSpriteRight("diamondcutter_proj", 23, 13, false, tk2dBaseSprite.Anchor.MiddleCenter, 17, 5); mod.projectiles[0] = projectile; mod.ammoType = GameUIAmmoType.AmmoType.CUSTOM; mod.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("RedDiamondCutter Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/reddiamondcutter_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/diamondcutter_clipempty"); if (mod != gun.DefaultModule) { mod.ammoCost = 0; } } gun.reloadTime = 0.8f; gun.barrelOffset.transform.localPosition = new Vector3(1.81f, 1.43f, 0f); gun.SetBaseMaxAmmo(100); gun.ammo = 100; gun.gunClass = GunClass.SILLY; //gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE); //BULLET STATS gun.quality = PickupObject.ItemQuality.EXCLUDED; ETGMod.Databases.Items.Add(gun, null, "ANY"); RedDiamondCutterID = gun.PickupObjectId; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Pumhart", "pumhart"); Game.Items.Rename("outdated_gun_mods:pumhart", "nn:pumhart"); var behav = gun.gameObject.AddComponent <Pumhart>(); gun.SetShortDescription("Mega Bore"); gun.SetLongDescription("A magnificent example of bombard weaponry, built to slay giants!" + "\n\nNormally impossible for a single person to wield, Gunymede's reduced gravity somewhat allows this ridiculous feat."); gun.SetupSprite(null, "pumhart_idle_001", 8); gun.SetAnimationFPS(gun.chargeAnimation, 1); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false); gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 0.6f, StatModifier.ModifyMethod.MULTIPLICATIVE); gun.AddCurrentGunStatModifier(PlayerStats.StatType.DodgeRollSpeedMultiplier, 0.6f, StatModifier.ModifyMethod.MULTIPLICATIVE); //GUN STATS gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Charged; gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; gun.reloadTime = 5f; gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(37) as Gun).muzzleFlashEffects; gun.DefaultModule.cooldownTime = 5f; gun.DefaultModule.angleVariance = 0; gun.DefaultModule.numberOfShotsInClip = 1; gun.barrelOffset.transform.localPosition = new Vector3(6.43f, 1.81f, 0f); gun.SetBaseMaxAmmo(10); gun.ammo = 10; gun.gunClass = GunClass.CHARGE; //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 = 100f; projectile.baseData.force *= 10f; projectile.baseData.speed *= 1f; projectile.baseData.range *= 100f; PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); pierce.penetration += 70; MaintainDamageOnPierce maintainDMG = projectile.gameObject.GetOrAddComponent <MaintainDamageOnPierce>(); pierce.penetratesBreakables = true; BlockEnemyProjectilesMod block = projectile.gameObject.GetOrAddComponent <BlockEnemyProjectilesMod>(); block.projectileSurvives = true; BounceProjModifier bounce = projectile.gameObject.GetOrAddComponent <BounceProjModifier>(); bounce.numberOfBounces += 70; bounce.additionalScreenShake = (PickupObjectDatabase.GetById(37) as Gun).DefaultModule.chargeProjectiles[0].Projectile.GetComponent <BounceProjModifier>().additionalScreenShake; projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(37) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.overrideMidairDeathVFX; projectile.hitEffects.alwaysUseMidair = true; projectile.SetProjectileSpriteRight("pumhart_proj", 48, 48, false, tk2dBaseSprite.Anchor.MiddleCenter, 30, 30); ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile { Projectile = projectile, ChargeTime = 5, }; gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> { chargeProj }; gun.quality = PickupObject.ItemQuality.S; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode = tk2dSpriteAnimationClip.WrapMode.LoopSection; gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 4; tk2dSpriteAnimationClip chargeClip = gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation); foreach (tk2dSpriteAnimationFrame frame in chargeClip.frames) { tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId]; if (def != null) { def.MakeOffset(new Vector2(-2.12f, -1.75f)); } } tk2dSpriteAnimationClip fireClip = gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation); foreach (tk2dSpriteAnimationFrame frame in fireClip.frames) { tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId]; if (def != null) { def.MakeOffset(new Vector2(-2.12f, -1.75f)); } } gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup; gun.gunScreenShake = new ScreenShakeSettings(5f, 1f, 0.5f, 0.5f); PumhartID = gun.PickupObjectId; }