public override void OnPostFired(PlayerController player, Gun gun) { if (gun.ClipShotsRemaining <= 2) { RandomProjectileReplacementItem berserkPrefab = PickupObjectDatabase.GetById(524).GetComponent <RandomProjectileReplacementItem>(); String berserkAudio = berserkPrefab.ReplacementAudioEvent; AkSoundEngine.PostEvent(berserkAudio, base.gameObject); } else { AkSoundEngine.PostEvent("Play_WPN_h4mmer_shot_01", base.gameObject); } }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Test Gun", "syntest"); Game.Items.Rename("outdated_gun_mods:test_gun", "bot:test_gun-"); gun.gameObject.AddComponent <syntest>(); gun.SetShortDescription("wip"); gun.SetLongDescription("wip"); gun.SetupSprite(null, "syntest_idle_001", 8); Gun MakeshiftCannon = PickupObjectDatabase.GetById(180) as Gun; GunExt.SetAnimationFPS(gun, gun.shootAnimation, 24); GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 4); Gun gun2 = PickupObjectDatabase.GetById(762) as Gun; GunExt.AddProjectileModuleFrom(gun, "makeshift_cannon", true, false); gun.SetBaseMaxAmmo(444); RandomProjectileReplacementItem component = PickupObjectDatabase.GetById(524).GetComponent <RandomProjectileReplacementItem>(); Projectile replacementProjectile = component.ReplacementProjectile; //Gun gun3 = MakeshiftCannon.PickupObjectDatabase.GetById(329) as Gun; gun.DefaultModule.usesOptionalFinalProjectile = MakeshiftCannon.DefaultModule.usesOptionalFinalProjectile; gun.DefaultModule.numberOfFinalProjectiles = MakeshiftCannon.DefaultModule.numberOfFinalProjectiles; gun.DefaultModule.finalProjectile = MakeshiftCannon.DefaultModule.finalProjectile; gun.DefaultModule.finalCustomAmmoType = MakeshiftCannon.DefaultModule.finalCustomAmmoType; gun.DefaultModule.finalAmmoType = MakeshiftCannon.DefaultModule.finalAmmoType; gun.DefaultModule.ammoCost = MakeshiftCannon.DefaultModule.ammoCost; gun.DefaultModule.shootStyle = MakeshiftCannon.DefaultModule.shootStyle; gun.damageModifier = MakeshiftCannon.damageModifier; gun.reloadTime = MakeshiftCannon.reloadTime; gun.DefaultModule.cooldownTime = MakeshiftCannon.DefaultModule.cooldownTime; gun.DefaultModule.numberOfShotsInClip = MakeshiftCannon.DefaultModule.numberOfShotsInClip; gun.DefaultModule.angleVariance = MakeshiftCannon.DefaultModule.angleVariance; gun.barrelOffset.transform.localPosition += MakeshiftCannon.barrelOffset.transform.localPosition; gun.quality = PickupObject.ItemQuality.EXCLUDED; gun.encounterTrackable.EncounterGuid = "test test this is a test bla bla bla"; gun.gunClass = MakeshiftCannon.gunClass; gun.CanBeDropped = MakeshiftCannon.CanBeDropped; //Gun gun4 = MakeshiftCannon.PickupObjectDatabase.GetById(519) as Gun;; gun.muzzleFlashEffects = MakeshiftCannon.muzzleFlashEffects; //Gun gun5 = MakeshiftCannon.PickupObjectDatabase.GetById(37) as Gun; gun.finalMuzzleFlashEffects = MakeshiftCannon.finalMuzzleFlashEffects; ETGMod.Databases.Items.Add(gun, null, "ANY"); Projectile projectile = MakeshiftCannon.projectile; }
public static void Add() { Gun gun = ETGMod.Databases.Items.NewGun("Berserker Rifle", "ragerifle"); Game.Items.Rename("outdated_gun_mods:berserker_rifle", "rtr:berserker_rifle"); gun.gameObject.AddComponent <RageRifle>(); gun.SetShortDescription("Unstoppable Frenzy"); gun.SetLongDescription("Contains pure and unfettered rage.\n\n" + "Simply holding this gun can turn even the most peaceful beings into bloodthirsty killing machines."); gun.SetupSprite(null, "ragerifle_idle_001", 8); gun.SetAnimationFPS(gun.shootAnimation, 24); gun.SetAnimationFPS(gun.reloadAnimation, 4); Gun targetGun = PickupObjectDatabase.GetById(762) as Gun; gun.AddProjectileModuleFrom("klobb", true, false); gun.SetBaseMaxAmmo(666); RandomProjectileReplacementItem berserkPrefab = PickupObjectDatabase.GetById(524).GetComponent <RandomProjectileReplacementItem>(); Projectile berserkProj = berserkPrefab.ReplacementProjectile; Gun projGun = PickupObjectDatabase.GetById(329) as Gun; gun.DefaultModule.usesOptionalFinalProjectile = true; gun.DefaultModule.numberOfFinalProjectiles = 2; gun.DefaultModule.finalProjectile = berserkProj; gun.DefaultModule.finalCustomAmmoType = targetGun.DefaultModule.customAmmoType; gun.DefaultModule.finalAmmoType = targetGun.DefaultModule.ammoType; gun.DefaultModule.ammoCost = 1; gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Automatic; gun.damageModifier = 1; gun.reloadTime = 1.5f; gun.DefaultModule.cooldownTime = 0.05f; gun.DefaultModule.numberOfShotsInClip = 22; gun.DefaultModule.angleVariance = 40f; gun.barrelOffset.transform.localPosition += new Vector3(1f, 0f, 0); gun.quality = PickupObject.ItemQuality.S; gun.encounterTrackable.EncounterGuid = "ragerifle"; gun.gunClass = GunClass.RIFLE; gun.CanBeDropped = true; Gun muzzleGun = PickupObjectDatabase.GetById(519) as Gun; gun.muzzleFlashEffects = muzzleGun.muzzleFlashEffects; Gun component = PickupObjectDatabase.GetById(37) as Gun; gun.finalMuzzleFlashEffects = component.muzzleFlashEffects; ETGMod.Databases.Items.Add(gun, null, "ANY"); //CREATES NEW PROJECTILE Projectile NewProjectileBerserk = Instantiate <Projectile>(projGun.DefaultModule.chargeProjectiles[1].Projectile); NewProjectileBerserk.gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(NewProjectileBerserk.gameObject); DontDestroyOnLoad(NewProjectileBerserk); gun.DefaultModule.projectiles[0] = NewProjectileBerserk; NewProjectileBerserk.transform.parent = gun.barrelOffset; //SETS PROJECTILE STATS NewProjectileBerserk.AdditionalScaleMultiplier *= 0.6f; NewProjectileBerserk.baseData.damage = 4f; }