public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Heavy Assault Rifle", "heavyassaultrifle"); Game.Items.Rename("outdated_gun_mods:heavy_assault_rifle", "nn:heavy_assault_rifle"); gun.gameObject.AddComponent <HeavyAssaultRifle>(); gun.SetShortDescription("It's so big..."); gun.SetLongDescription("An oversized assault rifle from the FUTURE... which by now has already become the past."); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(81) as Gun).gunSwitchGroup; gun.SetupSprite(null, "heavyassaultrifle_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 15); 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 = 2.5f; gun.DefaultModule.cooldownTime = 0.11f; gun.DefaultModule.numberOfShotsInClip = 40; gun.barrelOffset.transform.localPosition = new Vector3(4.18f, 0.87f, 0f); gun.SetBaseMaxAmmo(250); gun.gunClass = GunClass.FULLAUTO; //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 *= 6f; projectile.SetProjectileSpriteRight("heavyassaultrifle_projectile", 22, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 22, 7); projectile.transform.parent = gun.barrelOffset; PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>(); orAddComponent.penetratesBreakables = true; orAddComponent.penetration = 5; gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 0.8f, StatModifier.ModifyMethod.MULTIPLICATIVE); gun.AddCurrentGunStatModifier(PlayerStats.StatType.DodgeRollSpeedMultiplier, 0.8f, StatModifier.ModifyMethod.MULTIPLICATIVE); gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("HeavyAssaultRifle Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/heavyassaultrifle_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/heavyassaultrifle_clipempty"); gun.DefaultModule.projectiles[0] = projectile; gun.quality = PickupObject.ItemQuality.S; gun.encounterTrackable.EncounterGuid = "this is the Heavy Assault Rifle"; ETGMod.Databases.Items.Add(gun, null, "ANY"); HeavyAssaultRifleID = gun.PickupObjectId; gun.AddToSubShop(ItemBuilder.ShopType.Trorc); }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Mantid Augment", "mantidaugment"); Game.Items.Rename("outdated_gun_mods:mantid_augment", "nn:mantid_augment"); var behav = gun.gameObject.AddComponent <MantidAugment>(); behav.preventNormalFireAudio = true; gun.SetShortDescription("Flashy and Lethal"); gun.SetLongDescription("A cybernetic augment concealed in the forearm, this cruel blade extends to slash at your enemies with inhuman speed."); gun.SetupSprite(null, "mantidaugment_idle_001", 8); gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE); gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 1f, StatModifier.ModifyMethod.ADDITIVE); gun.SetAnimationFPS(gun.shootAnimation, 20); gun.SetAnimationFPS(gun.reloadAnimation, 12); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false); //GUN STATS gun.gunHandedness = GunHandedness.HiddenOneHanded; gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Automatic; gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.BEAM; gun.reloadTime = 1f; gun.muzzleFlashEffects.type = VFXPoolType.None; gun.DefaultModule.cooldownTime = 0.01f; gun.DefaultModule.numberOfShotsInClip = 100; gun.barrelOffset.transform.localPosition = new Vector3(1.56f, 0.56f, 0f); gun.SetBaseMaxAmmo(2077); gun.ammo = 2077; gun.gunClass = GunClass.FULLAUTO; //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 *= 2f; projectile.baseData.force *= 0.5f; projectile.sprite.renderer.enabled = false; NoCollideBehaviour nocollide = projectile.gameObject.AddComponent <NoCollideBehaviour>(); nocollide.worksOnEnemies = true; nocollide.worksOnProjectiles = true; projectile.specRigidbody.CollideWithTileMap = false; ProjectileSlashingBehaviour slashing = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>(); slashing.DestroyBaseAfterFirstSlash = true; slashing.SlashDamageUsesBaseProjectileDamage = true; slashing.slashParameters = new SlashData(); slashing.slashParameters.hitVFX = (PickupObjectDatabase.GetById(369) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.tileMapVertical; gun.DefaultModule.projectiles[0] = projectile; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = "red_beam"; gun.quality = PickupObject.ItemQuality.A; ETGMod.Databases.Items.Add(gun, null, "ANY"); MantidAugmentID = 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; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Burst Rifle", "burstrifle"); Game.Items.Rename("outdated_gun_mods:burst_rifle", "nn:burst_rifle"); gun.gameObject.AddComponent <BurstRifle>(); gun.SetShortDescription("Trifling Matters"); gun.SetLongDescription("Designed by famous gunsmith Algernon Burst, this classic weapon features a stylish leather grip." + "\n\nPuts the tat-tat in 'ratta tat-tat'. Whatever the hell that means."); gun.SetupSprite(null, "burstrifle_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 12); gun.SetAnimationFPS(gun.reloadAnimation, 0); gun.gunSwitchGroup = (PickupObjectDatabase.GetById(5) as Gun).gunSwitchGroup; gun.AddCurrentGunStatModifier(PlayerStats.StatType.Coolness, 2f, StatModifier.ModifyMethod.ADDITIVE); gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false); gun.gunHandedness = GunHandedness.TwoHanded; gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(5) as Gun).muzzleFlashEffects; //GUN STATS gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Burst; gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random; gun.reloadTime = 1.2f; gun.DefaultModule.burstShotCount = 4; gun.DefaultModule.burstCooldownTime = 0.1f; gun.DefaultModule.cooldownTime = 0.25f; gun.DefaultModule.numberOfShotsInClip = 8; gun.DefaultModule.angleVariance = 3.5f; gun.barrelOffset.transform.localPosition = new Vector3(2.68f, 0.87f, 0f); gun.SetBaseMaxAmmo(240); gun.ammo = 240; gun.gunClass = GunClass.RIFLE; //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.baseData.speed *= 3f; projectile.baseData.range *= 10f; PierceDeadActors piercedead = projectile.gameObject.AddComponent <PierceDeadActors>(); projectile.SetProjectileSpriteRight("burstrifle_proj", 7, 4, true, tk2dBaseSprite.Anchor.MiddleCenter, 7, 4); EasyTrailBullet trail4 = projectile.gameObject.AddComponent <EasyTrailBullet>(); trail4.TrailPos = projectile.transform.position; trail4.StartWidth = 0.25f; trail4.EndWidth = 0f; trail4.LifeTime = 0.1f; trail4.BaseColor = ExtendedColours.honeyYellow; trail4.EndColor = ExtendedColours.honeyYellow; projectile.hitEffects.alwaysUseMidair = true; projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(647) as Gun).DefaultModule.projectiles[0].hitEffects.tileMapVertical.effects[0].effects[0].effect; projectile.transform.parent = gun.barrelOffset; gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM; gun.DefaultModule.customAmmoType = "Rifle"; gun.quality = PickupObject.ItemQuality.A; ETGMod.Databases.Items.Add(gun, null, "ANY"); gun.AddToSubShop(ItemBuilder.ShopType.Trorc); ID = gun.PickupObjectId; }