// Token: 0x06000192 RID: 402 RVA: 0x0000CD0C File Offset: 0x0000AF0C
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Prize Rifle", "prize_rifle");

            Game.Items.Rename("outdated_gun_mods:prize_rifle", "bb:prize_rifle");
            gun.gameObject.AddComponent <PrizeRifle>();
            GunExt.SetShortDescription(gun, "Definitely Not Fair");
            GunExt.SetLongDescription(gun, "Hit targets while reloading to gain a damage boost for your next clip.\n\nA personal gun of Winchester's. He used it all the time for his leisure, but it seems that it has other uses as well...");
            GunExt.SetupSprite(gun, null, "prize_rifle_idle_001", 1);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 1);
            GunExt.SetAnimationFPS(gun, gun.idleAnimation, 1);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 10);
            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("prize_rifle_fire");

            fireClip.wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            fireClip.loopStart = 1;
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(251) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 3f;
            gun.DefaultModule.cooldownTime        = 0.133333f;
            gun.DefaultModule.numberOfShotsInClip = 20;
            gun.barrelOffset.position            += new Vector3(1f, 0f, 0f);
            gun.carryPixelOffset = new IntVector2(1, 0);
            gun.SetBaseMaxAmmo(500);
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "77696e63686573746572";
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 6;
            projectile.baseData.range        = 60;
            projectile.SetProjectileSpriteRight("game_projectile_001", 18, 8, 15, 5);
            projectile.shouldRotate = true;
            projectile.name         = "ArtfulDodgerRifleProjectile";
            BounceProjModifier bounce = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            bounce.numberOfBounces      = 5;
            projectile.transform.parent = gun.barrelOffset;
            GameObject trail = UnityEngine.Object.Instantiate <GameObject>((PickupObjectDatabase.GetById(251) as Gun).DefaultModule.projectiles[0].transform.Find("Trail").gameObject);

            ItemAPI.FakePrefab.MarkAsFakePrefab(trail);
            UnityEngine.Object.DontDestroyOnLoad(trail);
            trail.SetActive(true);
            trail.transform.parent = projectile.transform;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            BuildTarget();
        }
Example #2
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Verdant Blaster", "leafblower");

            Game.Items.Rename("outdated_gun_mods:verdant_blaster", "rtr:verdant_blaster");
            gun.gameObject.AddComponent <Leafblower>();
            gun.SetShortDescription("Leaf Storm");
            gun.SetLongDescription("Gun carved from the tree branch of a Great Oak.\n\n" +
                                   "The deadliness of its leaves is not to be underestimated inside the Gungeon.");
            gun.SetupSprite(null, "leafblower_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            Gun targetGun  = PickupObjectDatabase.GetById(339) as Gun;
            Gun targetGun2 = PickupObjectDatabase.GetById(620) as Gun;

            gun.AddProjectileModuleFrom("klobb", true, false);
            gun.SetBaseMaxAmmo(600);

            gun.DefaultModule.customAmmoType = targetGun.DefaultModule.customAmmoType;
            gun.DefaultModule.ammoType       = targetGun.DefaultModule.ammoType;
            gun.DefaultModule.ammoCost       = 1;
            gun.DefaultModule.shootStyle     = ProjectileModule.ShootStyle.Automatic;
            gun.damageModifier = 1;
            gun.reloadTime     = 1.7f;
            gun.barrelOffset.transform.localPosition += new Vector3(0.2f, -0.1f, 0);
            gun.DefaultModule.cooldownTime            = 0.07f;
            gun.DefaultModule.numberOfShotsInClip     = 100;
            gun.DefaultModule.angleVariance           = 10f;
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "leafblower";
            gun.gunClass     = GunClass.FULLAUTO;
            gun.CanBeDropped = true;
            Gun component = PickupObjectDatabase.GetById(339) as Gun;

            gun.muzzleFlashEffects = component.muzzleFlashEffects;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            LeafblowerID = gun.PickupObjectId;


            //CREATES NEW PROJECTILE
            Projectile NewProjectileLeaf = Instantiate <Projectile>(targetGun2.DefaultModule.chargeProjectiles[0].Projectile);

            NewProjectileLeaf.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(NewProjectileLeaf.gameObject);
            DontDestroyOnLoad(NewProjectileLeaf);
            gun.DefaultModule.projectiles[0]   = NewProjectileLeaf;
            NewProjectileLeaf.transform.parent = gun.barrelOffset;

            //SETS PROJECTILE STATS
            NewProjectileLeaf.AdditionalScaleMultiplier *= 1.1f;
        }
        public static void Init(AssetBundle expandSharedAssets1)
        {
            m_BlinkPassive = PickupObjectDatabase.GetById(436).GetComponent <BlinkPassiveItem>();

            if (!m_BlinkPassive)
            {
                return;
            }

            EXRedScarfObject = expandSharedAssets1.LoadAsset <GameObject>("Bloodied Scarf");
            EXRedScarfObject.AddComponent <ExpandRedScarf>();
            EXRedScarfObject.AddComponent <tk2dSprite>();
            ExpandUtility.DuplicateSprite(EXRedScarfObject.GetComponent <tk2dSprite>(), m_BlinkPassive.GetComponent <tk2dSprite>());

            ExpandRedScarf redScarf = EXRedScarfObject.GetComponent <ExpandRedScarf>();

            ItemBuilder.SetupItem(redScarf, "Blink Away", "Dodge roll is augmented with a blink\n\nThis simple scarf was once worn by a skilled assassin. Betrayed by his brothers and assumed dead...", "ex");
            ItemBuilder.AddPassiveStatModifier(redScarf, PlayerStats.StatType.ReloadSpeed, 1.3f, StatModifier.ModifyMethod.MULTIPLICATIVE);
            // redScarf.PickupObjectId = m_BlinkPassive.PickupObjectId;
            redScarf.itemName       = "Red Bandana";
            redScarf.PickupObjectId = 436;
            redScarf.quality        = m_BlinkPassive.quality;
            redScarf.additionalMagnificenceModifier = m_BlinkPassive.additionalMagnificenceModifier;
            redScarf.ItemSpansBaseQualityTiers      = m_BlinkPassive.ItemSpansBaseQualityTiers;
            redScarf.ItemRespectsHeartMagnificence  = m_BlinkPassive.ItemRespectsHeartMagnificence;
            redScarf.associatedItemChanceMods       = m_BlinkPassive.associatedItemChanceMods;
            redScarf.contentSource             = m_BlinkPassive.contentSource;
            redScarf.ShouldBeExcludedFromShops = m_BlinkPassive.ShouldBeExcludedFromShops;
            redScarf.CanBeDropped = m_BlinkPassive.CanBeDropped;
            redScarf.PreventStartingOwnerFromDropping = m_BlinkPassive.PreventStartingOwnerFromDropping;
            redScarf.PersistsOnDeath   = m_BlinkPassive.PersistsOnDeath;
            redScarf.RespawnsIfPitfall = m_BlinkPassive.RespawnsIfPitfall;
            redScarf.PreventStartingOwnerFromDropping = m_BlinkPassive.PreventStartingOwnerFromDropping;
            redScarf.IgnoredByRat = m_BlinkPassive.IgnoredByRat;
            redScarf.SaveFlagToSetOnAcquisition  = m_BlinkPassive.SaveFlagToSetOnAcquisition;
            redScarf.ForcedPositionInAmmonomicon = m_BlinkPassive.ForcedPositionInAmmonomicon;
            redScarf.UsesCustomCost                  = m_BlinkPassive.UsesCustomCost;
            redScarf.CustomCost                      = m_BlinkPassive.CustomCost;
            redScarf.PersistsOnPurchase              = m_BlinkPassive.PersistsOnPurchase;
            redScarf.CanBeSold                       = m_BlinkPassive.CanBeSold;
            redScarf.passiveStatModifiers            = m_BlinkPassive.passiveStatModifiers;
            redScarf.ArmorToGainOnInitialPickup      = m_BlinkPassive.ArmorToGainOnInitialPickup;
            redScarf.minimapIcon                     = m_BlinkPassive.minimapIcon;
            redScarf.DodgeRollTimeMultiplier         = m_BlinkPassive.DodgeRollTimeMultiplier;
            redScarf.DodgeRollDistanceMultiplier     = m_BlinkPassive.DodgeRollDistanceMultiplier;
            redScarf.AdditionalInvulnerabilityFrames = m_BlinkPassive.AdditionalInvulnerabilityFrames;
            redScarf.ScarfPrefab                     = m_BlinkPassive.ScarfPrefab;
            redScarf.BlinkpoofVfx                    = m_BlinkPassive.BlinkpoofVfx;

            // Try to prevent original item from showing up. (can still be accessed via MTG console's give command however)
            m_BlinkPassive.quality = ItemQuality.EXCLUDED;
        }
 private void Update()
 {
     if (!this.gun.PreventNormalFireAudio)
     {
         this.gun.PreventNormalFireAudio = true;
     }
     if (this.forme == 1)
     {
         this.gun.DefaultModule.customAmmoType = "burning hand";
         this.gun.DefaultModule.projectiles[0] = SequencerController.replacementProjectiles[0];
         this.gun.muzzleFlashEffects           = (PickupObjectDatabase.GetById(384) as Gun).muzzleFlashEffects;
     }
     else if (this.forme == 2)
     {
         this.gun.DefaultModule.customAmmoType = "poison_blob";
         this.gun.DefaultModule.projectiles[0] = SequencerController.replacementProjectiles[1];
         this.gun.muzzleFlashEffects           = (PickupObjectDatabase.GetById(207) as Gun).muzzleFlashEffects;
     }
     else
     {
         this.gun.DefaultModule.customAmmoType = "ghost_small";
         this.gun.DefaultModule.projectiles[0] = SequencerController.replacementProjectiles[2];
         this.gun.muzzleFlashEffects           = (PickupObjectDatabase.GetById(156) as Gun).muzzleFlashEffects;
     }
     if (!this.gun.IsReloading)
     {
         this.reloaded = true;
     }
     if (this.gun.CurrentOwner != null && this.gun.CurrentOwner is PlayerController)
     {
         lastOwner = this.gun.CurrentOwner as PlayerController;
         if (this.electricityImmunity == null)
         {
             this.electricityImmunity = new DamageTypeModifier
             {
                 damageMultiplier = 0,
                 damageType       = CoreDamageTypes.Electric
             };
             this.lastOwner.healthHaver.damageTypeModifiers.Add(this.electricityImmunity);
         }
     }
     else
     {
         if (this.electricityImmunity != null)
         {
             this.lastOwner.healthHaver.damageTypeModifiers.Remove(this.electricityImmunity);
             this.electricityImmunity = null;
         }
     }
     this.gun.idleAnimation  = SequencerController.UpdateSequencerAnimation(this, "idle", null, false);
     this.gun.shootAnimation = SequencerController.UpdateSequencerAnimation(this, "fire", null, true);
 }
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Black Stabbith", "stab");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:black_stabbith", "ski:black_stabbith");
            gun.gameObject.AddComponent <BlackStabbith>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Judge jury and executioner");
            gun.SetLongDescription("This blade of blades was weilded by a terrifying vigilanty of justice. This style of blades is typically reserved for executions however this blade takes its duty one step further. If the convicted manages to escape the initial blow a flurry of blades will manifest to cripple their escape. " +
                                   "\n\n\n - Knife_to_a_Gunfight" +
                                   "___________________________________________");
            gun.SetupSprite(null, "stab_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 50);
            gun.SetAnimationFPS(gun.reloadAnimation, 24);

            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(541) as Gun, true, false);
            gun.DefaultModule.ammoCost                  = 1;
            gun.DefaultModule.angleVariance             = 0f;
            gun.DefaultModule.shootStyle                = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle             = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.preventFiringDuringCharge = true;
            Gun gun3 = (Gun)ETGMod.Databases.Items["wonderboy"];

            gun.muzzleFlashEffects                = gun3.muzzleFlashEffects;
            gun.reloadTime                        = 1f;
            gun.DefaultModule.cooldownTime        = .0f;
            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.InfiniteAmmo                      = true;
            gun.quality = PickupObject.ItemQuality.B;

            gun.encounterTrackable.EncounterGuid = "stab stab stab";
            //This block of code helps clone our projectile. Basically it makes it so things like Shadow Clone and Hip Holster keep the stats/sprite of your custom gun's projectiles.
            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 = 11f;
            projectile.baseData.speed  = 1f;
            projectile.baseData.range  = 1f;

            projectile.transform.parent = gun.barrelOffset;



            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Copygat", "copygat");

            Game.Items.Rename("outdated_gun_mods:copygat", "nn:copygat");
            var behav = gun.gameObject.AddComponent <Copygat>();

            behav.overrideNormalFireAudio = "Play_BOSS_DragunGold_Baby_Death_01";
            behav.preventNormalFireAudio  = true;
            gun.SetShortDescription("Follow The Leader");
            gun.SetLongDescription("Mimics the projectiles of other guns." + "\n\nThis industrial mimigoo weapon has attained a low level of sentience, and now communicates solely in meowing and scratching.");

            gun.SetupSprite(null, "copygat_idle_001", 8);

            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.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.5f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.numberOfShotsInClip    = 10;
            gun.barrelOffset.transform.localPosition = new Vector3(2.5f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.ammo     = 200;
            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 = 20f;
            projectile.SetProjectileSpriteRight("wrench_null_projectile", 13, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 12, 7);
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.RedLaserCircleVFX;
            projectile.transform.parent = gun.barrelOffset;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Copygat Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/copygat_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/copygat_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;
            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            CopygatID = gun.PickupObjectId;
        }
 public override void Pickup(PlayerController player)
 {
     if (!this.m_pickedUpThisRun)
     {
         AkSoundEngine.PostEvent("Play_OBJ_crystal_shatter_01", base.gameObject);
         PickupObject byId = PickupObjectDatabase.GetById(565);
         player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
         player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
         player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
     }
     base.Pickup(player);
     GameManager.Instance.OnNewLevelFullyLoaded += this.RandomEffect;
 }
Example #8
0
        public static void AddForms()
        {
            AdvancedTransformGunSynergyProcessor IonFistTransform = ETGMod.Databases.Items["ion_fist"].gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();

            IonFistTransform.NonSynergyGunId = ETGMod.Databases.Items["ion_fist"].PickupObjectId;
            IonFistTransform.SynergyGunId    = ETGMod.Databases.Items["nen_fist"].PickupObjectId;
            IonFistTransform.SynergyToCheck  = "Jajanken";
            AdvancedTransformGunSynergyProcessor CharmedBowTransform = (PickupObjectDatabase.GetById(200) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();

            CharmedBowTransform.NonSynergyGunId = (PickupObjectDatabase.GetById(200) as Gun).PickupObjectId;
            CharmedBowTransform.SynergyGunId    = ETGMod.Databases.Items["evil_charmed_bow"].PickupObjectId;
            CharmedBowTransform.SynergyToCheck  = "All Out Of Love";
        }
        public override void Pickup(PlayerController player)
        {
            base.Pickup(player);
            player.OnReceivedDamage += this.IgniteAll;
            player.OnUsedPlayerItem += this.HandleActiveItemUsed;
            player.OnTableFlipped    = (Action <FlippableCover>)Delegate.Combine(player.OnTableFlipped, new Action <FlippableCover>(this.CheckForSynergy));
            bool hasntAlreadyBeenCollected = !this.m_pickedUpThisRun;

            if (hasntAlreadyBeenCollected)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, player);
            }
        }
        /// <summary>
        /// Adds an item to a loot table via PickupObjectId
        /// </summary>
        /// <param name="lootTable">The loot table you want to add to</param>
        /// <param name="poID">The id of the PickupObject you're adding</param>
        /// <param name="weight">The Weight of the item you're adding (default is 1)</param>
        /// <returns></returns>
        public static void AddItemToPool(this GenericLootTable lootTable, int poID, float weight = 1)
        {
            var po = PickupObjectDatabase.GetById(poID);

            lootTable.defaultItemDrops.Add(new WeightedGameObject()
            {
                pickupId                = po.PickupObjectId,
                weight                  = weight,
                rawGameObject           = po.gameObject,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });
        }
Example #11
0
        public void GoldOnRoomClear(PlayerController player)
        {
            int amtToGive = 3;

            if (Owner.HasPickupID(Gungeon.Game.Items["gilded_bullets"].PickupObjectId))
            {
                amtToGive *= 2;
            }
            for (int i = 0; i < amtToGive; i++)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(68).gameObject, player);
            }
        }
Example #12
0
        protected override void DoEffect(PlayerController user)
        {
            Rift.HoleObject = PickupObjectDatabase.GetById(155).GetComponent <SpawnObjectPlayerItem>();
            Rift hellcomponent = gameObject.GetComponent <Rift>();

            hellcomponent.synergyobject = Rift.HoleObject.objectToSpawn;
            BlackHoleDoer holer = synergyobject.GetComponent <BlackHoleDoer>();

            gameObject1 = UnityEngine.Object.Instantiate <GameObject>(holer.HellSynergyVFX, new Vector3(base.transform.position.x + 0.7f, base.transform.position.y - 0.3f, base.transform.position.z + 5f), Quaternion.Euler(0f, 0f, 0f));;
            MeshRenderer component = gameObject.GetComponent <MeshRenderer>();

            base.StartCoroutine(this.HoldPortalOpen(component, user.sprite.WorldCenter, gameObject1));
        }
Example #13
0
 protected override void OnDestroy()
 {
     if ((PickupObjectDatabase.GetById(565) as PlayerOrbitalItem).BreakVFX && this.sprite != null)
     {
         for (int i = 0; i < 5; i++)
         {
             SpawnManager.SpawnVFX((PickupObjectDatabase.GetById(565) as PlayerOrbitalItem).BreakVFX, this.sprite.WorldCenter.ToVector3ZisY(0f), Quaternion.identity);
         }
         SpawnManager.SpawnVFX((PickupObjectDatabase.GetById(538) as SilverBulletsPassiveItem).SynergyPowerVFX, this.sprite.WorldCenter.ToVector3ZisY(0f), Quaternion.identity).GetComponent <tk2dBaseSprite>().PlaceAtPositionByAnchor(
             this.sprite.WorldCenter.ToVector3ZisY(0f), tk2dBaseSprite.Anchor.MiddleCenter);
     }
     base.OnDestroy();
 }
Example #14
0
        private void OnGuonHit(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider)
        {
            Projectile component = other.GetComponent <Projectile>();

            if (component != null && !(component.Owner is PlayerController))
            {
                if (UnityEngine.Random.value < 0.1f && cashSpawnedThisRoom < 20)
                {
                    LootEngine.SpawnItem(PickupObjectDatabase.GetById(68).gameObject, other.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
                    cashSpawnedThisRoom += 1;
                }
            }
        }
        public override void Pickup(PlayerController player)
        {
            bool hasntAlreadyBeenCollected = !this.m_pickedUpThisRun;

            if (hasntAlreadyBeenCollected)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
            }
            player.OnReceivedDamage += this.SpawnGuons;
            base.Pickup(player);
        }
Example #16
0
        private IEnumerator RobotCrestgain()
        {
            PlayerController player = this.Owner;

            yield return(new WaitForSeconds(1f));

            AkSoundEngine.PostEvent("Play_OBJ_metalskin_deflect_01", base.gameObject);
            PickupObject byId = PickupObjectDatabase.GetById(305);

            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            player.healthHaver.Armor -= 1f;
            yield break;
        }
        public override void Pickup(PlayerController player)
        {
            base.Pickup(player);
            HealthHaver healthHaver = player.healthHaver;

            healthHaver.ModifyDamage = (Action <HealthHaver, HealthHaver.ModifyDamageEventArgs>)Delegate.Combine(healthHaver.ModifyDamage, new Action <HealthHaver, HealthHaver.ModifyDamageEventArgs>(this.ModifyIncomingDamage));
            bool hasntAlreadyBeenCollected = !this.m_pickedUpThisRun;

            if (hasntAlreadyBeenCollected)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, player);
            }
        }
        private void KaliberShit(Projectile self, SpeculativeRigidbody enemy, bool fatal)
        {
            GameObject prefab   = (PickupObjectDatabase.GetById(761) as Gun).DefaultModule.projectiles[0].gameObject;
            GameObject spawnBee = SpawnManager.SpawnProjectile(prefab, enemy.UnitCenter, Quaternion.Euler(0f, 0f, self.Direction.ToAngle()), true);

            if (spawnBee.GetComponent <Projectile>())
            {
                Projectile beeproj = spawnBee.GetComponent <Projectile>();
                beeproj.Owner            = self.Owner;
                beeproj.Shooter          = self.Shooter;
                beeproj.baseData.damage *= 0;
            }
        }
        // Token: 0x0600754B RID: 30027 RVA: 0x002DBB68 File Offset: 0x002D9D68
        private void Awake()
        {
            this.m_gun = base.GetComponent <Gun>();
            LifeOrbGunModifier orig = (PickupObjectDatabase.GetById(595) as Gun).GetComponent <LifeOrbGunModifier>();

            OnBurstDamageVFX = orig.OnBurstDamageVFX;
            OnBurstGunVFX    = orig.OnBurstGunVFX;
            OnKilledEnemyVFX = orig.OnKilledEnemyVFX;
            OverheadVFX      = orig.OverheadVFX;
            Gun gun = this.m_gun;

            gun.OnReloadPressed = (Action <PlayerController, Gun, bool>)Delegate.Combine(gun.OnReloadPressed, new Action <PlayerController, Gun, bool>(this.HandleReloadPressed));
        }
Example #20
0
        public static bool GiveItemID(int id)
        {
            if (!GameManager.GameManager_0.PlayerController_1)
            {
                Debug.Log("Couldn't access static current PlayerController in GameManager");
                return(false);
            }
            PlayerController playercontroller = GameManager.GameManager_0.PlayerController_1;
            GameObject       pickupobject     = PickupObjectDatabase.GetById(id).gameObject;

            _GiveItem.Xs(pickupobject, playercontroller, false);
            return(true);
        }
 protected override void DoEffect(PlayerController user)
 {
     AkSoundEngine.PostEvent("Play_OBJ_lock_pick_01", base.gameObject);
     foreach (AIActor aiactor in user.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All))
     {
         bool flag = aiactor != null;
         if (flag)
         {
             float currentHealthPercentage = aiactor.healthHaver.GetCurrentHealthPercentage();
             bool  flaga3 = currentHealthPercentage <= 0.3f;
             bool  isBoss = aiactor.healthHaver.IsBoss;
             bool  flag4  = flaga3 && !isBoss;
             if (flag4)
             {
                 aiactor.healthHaver.ApplyDamage(100000f, Vector2.zero, "Telefrag", CoreDamageTypes.Void, DamageCategory.Normal, true, null, false);
                 bool synergy = user.PlayerHasActiveSynergy("Judge, Jury and...");
                 if (synergy)
                 {
                     AssetBundle    assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");
                     GoopDefinition goopDef     = assetBundle.LoadAsset <GoopDefinition>("assets/data/goops/napalmgoopquickignite.asset");
                     DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(goopDef).TimedAddGoopCircle(aiactor.sprite.WorldBottomCenter, 2.5f, 1.4f, false);
                 }
             }
             else
             {
                 aiactor.healthHaver.ApplyDamage(10f, Vector2.zero, "Telefrag", CoreDamageTypes.Void, DamageCategory.Normal, true, null, false);
                 bool synergy = user.PlayerHasActiveSynergy("Lost Humanity");
                 if (synergy)
                 {
                     Vector3    position   = aiactor.sprite.WorldCenter;
                     GameObject gameObject = SpawnManager.SpawnProjectile((PickupObjectDatabase.GetById(45) as Gun).DefaultModule.projectiles[0].gameObject, position, Quaternion.Euler(0f, 0f, BraveMathCollege.Atan2Degrees(user.sprite.WorldCenter - aiactor.sprite.WorldCenter)), true);
                     Projectile component  = gameObject.GetComponent <Projectile>();
                     bool       flag12     = component != null;
                     bool       flag2      = flag12;
                     if (flag2)
                     {
                         PierceProjModifier spook = component.gameObject.AddComponent <PierceProjModifier>();
                         spook.penetration = 10;
                         component.SpawnedFromOtherPlayerProjectile = true;
                         component.Shooter                   = user.specRigidbody;
                         component.Owner                     = user;
                         component.baseData.speed            = 4f;
                         component.baseData.damage           = 10f;
                         component.AdditionalScaleMultiplier = 0.7f;
                         component.ignoreDamageCaps          = true;
                     }
                 }
             }
         }
     }
 }
Example #22
0
        public static void InitProjectile()
        {
            Projectile coin     = (PickupObjectDatabase.GetById(15) as Gun).DefaultModule.projectiles[0];
            Projectile initCoin = UnityEngine.Object.Instantiate(coin);

            List <string> spriteIds = new List <string>
            {
                "bronzecoin_001",
                "bronzecoin_002",
                "bronzecoin_003",
                "bronzecoin_004",
                "bronzecoin_005",
                "bronzecoin_006",
                "bronzecoin_007",
                "bronzecoin_008",
                "bronzecoin_009",
                "bronzecoin_010",
                "bronzecoin_011",
                "bronzecoin_012",
            };
            List <IntVector2> intVectors = new List <IntVector2>
            {
                new IntVector2(15, 15),
                new IntVector2(13, 15),
                new IntVector2(8, 15),
                new IntVector2(2, 15),
                new IntVector2(8, 15),
                new IntVector2(13, 15),
                new IntVector2(15, 15),
                new IntVector2(13, 15),
                new IntVector2(8, 15),
                new IntVector2(2, 15),
                new IntVector2(8, 15),
                new IntVector2(13, 15),
            };

            {
                initCoin.AnimateProjectile(spriteIds, 24, true, intVectors, dontEvenKnowWhatThisIs, anchors, changesColliders, fixesScale, vector2dotZero, offsets, offsets, uh);
                initCoin.shouldRotate    = true;
                initCoin.baseData.damage = 15;
                initCoin.baseData.speed  = 12;

                /*initCoin.gameObject.SetActive(false);
                 * UnityEngine.Object.DontDestroyOnLoad(initCoin.gameObject);
                 * FakePrefab.MarkAsFakePrefab(initCoin.gameObject);*/
            }
            coinProjectile = initCoin;
            coinProjectile.gameObject.SetActive(false);
            UnityEngine.Object.DontDestroyOnLoad(coinProjectile.gameObject);
            FakePrefab.MarkAsFakePrefab(coinProjectile.gameObject);
        }
Example #23
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Purpler", "purpler");

            Game.Items.Rename("outdated_gun_mods:purpler", "nn:purpler");
            gun.gameObject.AddComponent <Purpler>();
            gun.SetShortDescription("Burning Bills");
            gun.SetLongDescription("Fires purple in it's rawest form." + "\n\nThis inconveniently small blaster was made for much more diminutive beings with no fingers.");

            gun.SetupSprite(null, "purpler_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(89) as Gun, true, false);

            //GUN STATS
            gun.DefaultModule.ammoCost          = 1;
            gun.DefaultModule.shootStyle        = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.burstShotCount    = 3;
            gun.DefaultModule.burstCooldownTime = 0.2f;
            gun.DefaultModule.angleVariance     = 5f;
            gun.DefaultModule.sequenceStyle     = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.7f;
            gun.DefaultModule.numberOfShotsInClip    = 12;
            gun.barrelOffset.transform.localPosition = new Vector3(1.06f, 0.5f, 0f);
            gun.SetBaseMaxAmmo(300);
            gun.gunClass = GunClass.SHITTY;
            //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      *= 1.6f;

            projectile.baseData.range  *= 0.7f;
            projectile.transform.parent = gun.barrelOffset;
            projectile.SetProjectileSpriteRight("purpler_projectile", 8, 6, true, tk2dBaseSprite.Anchor.MiddleCenter, 6, 6);
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.RedLaserCircleVFX;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "Thinline Bullets";

            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "this is the Purpler";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            PurplerID = gun.PickupObjectId;
        }
Example #24
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Repetitron", "repetiton");

            Game.Items.Rename("outdated_gun_mods:repetitron", "nn:repetitron");
            var behav = gun.gameObject.AddComponent <Repetitron>();

            gun.SetShortDescription("We've Done This Before");
            gun.SetLongDescription("Fires bullets... again... and again... and again." + "\n\nThis gun is powered by a miniature recursive sub-space anomaly. Do not look at the operational end.");

            gun.SetupSprite(null, "repetiton_idle_001", 8);

            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(89) as Gun).gunSwitchGroup;
            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.DefaultModule.cooldownTime           = 0.2f;
            gun.DefaultModule.angleVariance          = 4;
            gun.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(89) as Gun).muzzleFlashEffects;
            gun.DefaultModule.numberOfShotsInClip    = 5;
            gun.barrelOffset.transform.localPosition = new Vector3(2.0f, 0.25f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.ammo     = 200;
            gun.gunClass = GunClass.SILLY;

            //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.force                   *= 1f;
            projectile.baseData.speed                   *= 1f;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.GreenLaserCircleVFX;
            projectile.baseData.range                   *= 0.5f;
            projectile.SetProjectileSpriteRight("repetiton_projectile", 10, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 6);

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Repetitron Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/repetitron_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/repetitron_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #25
0
        public static void ChestPreOpen(Action <Chest, PlayerController> orig, Chest self, PlayerController opener)
        {
            if (opener.HasPickupID(CakeIDs.PlatJunk))
            {
                self.PredictContents(opener);
                int bighead = UnityEngine.Random.Range(1, 101);
                if (bighead == 1)
                {
                    PickupObject obj = PickupObjectDatabase.GetById(580);
                    self.contents.Add(obj);
                }
                if (bighead == 2)
                {
                    PickupObject obj1 = PickupObjectDatabase.GetById(641);
                    self.contents.Add(obj1);
                }
                if (bighead == 3)
                {
                    PickupObject obj11 = PickupObjectDatabase.GetById(CakeIDs.PlatJunk);
                    self.contents.Add(obj11);
                }
                PickupObject obj2 = PickupObjectDatabase.GetById(127);
                self.contents.Add(obj2);
            }

            if (opener.HasPickupID(CakeIDs.CH))
            {
                self.PredictContents(opener);
                int bighead = UnityEngine.Random.Range(1, 31);
                if (bighead == 1)
                {
                    List <int> excludedGunsIds = new List <int>()
                    {
                    };

                    foreach (Gun gun in opener.inventory.AllGuns)
                    {
                        excludedGunsIds.Add(gun.PickupObjectId);
                    }
                    PickupObject obj2 = PickupObjectDatabase.GetRandomGunOfQualities(new System.Random(), excludedGunsIds, ItemQuality.D, ItemQuality.C);
                    self.contents.Add(obj2);
                }
                int          lootID = BraveUtility.RandomElement(ExtendedLoots);
                PickupObject obj3   = PickupObjectDatabase.GetById(lootID);
                self.contents.Add(obj3);
            }



            orig(self, opener);
        }
        public static void SetItem()
        {
            int[] array = new int[]
            {
                131,//유틸리티 벨트
                102,
                212,
                115,
                309,
                457,
                170,
                281,
                260,
                262,
                263,
                264,
                466,
                269,
                270,
                307,
                343,
                437,
                452,
                454,
                490,
                491,
                492,
                249,
                301,
                318,
                442,
                232,
                451,
                461,
                494,
                434,
                271,
                529,
                572,
                564,
                580,
                526,
                641
            };


            for (int i = 0; i < array.Length; i++)
            {
                LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(array[i]).gameObject, GameManager.Instance.PrimaryPlayer, true);
            }
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Gravitron", "gravitron");

            Game.Items.Rename("outdated_gun_mods:gravitron", "nn:gravitron");
            gun.gameObject.AddComponent <Gravitron>();
            gun.SetShortDescription("Outstanding In It's Field");
            gun.SetLongDescription("Bullets orbit enemies." + "\n\nMilitary adaptation of orbtial projectile technology, these bullets are clever enough to latch onto the target instead of their owner.");

            gun.SetupSprite(null, "gravitron_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(13) as Gun).gunSwitchGroup;

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime         = 1.1f;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(334) as Gun).muzzleFlashEffects;

            gun.DefaultModule.cooldownTime           = 0.2f;
            gun.DefaultModule.numberOfShotsInClip    = 25;
            gun.barrelOffset.transform.localPosition = new Vector3(2.12f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(360);
            gun.ammo     = 360;
            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.range *= 2f;
            GravitronBulletsBehaviour behav = projectile.gameObject.GetOrAddComponent <GravitronBulletsBehaviour>();

            behav.maxOrbitalRadius = 6;
            behav.minOrbitalRadius = 3.5f;
            projectile.SetProjectileSpriteRight("gravitron_projectile", 7, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 6, 6);

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Gravitron Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/gravitron_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/gravitron_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            GravitronID = gun.PickupObjectId;
        }
Example #28
0
        // Token: 0x06000036 RID: 54 RVA: 0x000037D8 File Offset: 0x000019D8
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Robotic Injector", "directiveinject");

            Game.Items.Rename("outdated_gun_mods:robotic_injector", "bny:robotic_injector");
            gun.gameObject.AddComponent <REXNeedler>();
            GunExt.SetShortDescription(gun, "Directive: Inject");
            GunExt.SetLongDescription(gun, "An injector commonly used by hydroponic robots. Looks like its original carrier is off protocol.");
            GunExt.SetupSprite(gun, null, "directiveinject_idle_001", 11);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 36);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 7);
            GunExt.SetAnimationFPS(gun, gun.idleAnimation, 1);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(26) as Gun, true, false);
            gun.gunHandedness  = GunHandedness.HiddenOneHanded;
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(26) as Gun).gunSwitchGroup;
            gun.DefaultModule.burstShotCount    = 3;
            gun.DefaultModule.burstCooldownTime = 0.0833f;
            gun.DefaultModule.ammoCost          = 1;
            gun.DefaultModule.shootStyle        = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.sequenceStyle     = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0f;
            gun.DefaultModule.cooldownTime        = .7f;
            gun.DefaultModule.numberOfShotsInClip = 300;
            gun.SetBaseMaxAmmo(300);
            gun.quality = PickupObject.ItemQuality.C;
            gun.DefaultModule.angleVariance      = 0f;
            gun.encounterTrackable.EncounterGuid = "THE PLANT, THE PLANT, ITS THE PLANT";
            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.PoisonApplyChance     = 1f;
            projectile.baseData.damage       = 3f;
            projectile.baseData.speed        = 20f;
            projectile.baseData.range       *= 10f;
            projectile.baseData.force       *= 0.3f;
            projectile.HasDefaultTint        = true;
            projectile.SetProjectileSpriteRight("directiveinject_projectile_001", 11, 3, true, tk2dBaseSprite.Anchor.MiddleCenter, new int?(8), new int?(2), null, null, null);
            projectile.AdditionalScaleMultiplier = 1.1f;
            projectile.pierceMinorBreakables     = true;
            projectile.transform.parent          = gun.barrelOffset;
            projectile.damageTypes |= CoreDamageTypes.Poison;
            PoisonForDummiesLikeMe auegh = projectile.gameObject.AddComponent <PoisonForDummiesLikeMe>();

            auegh.procChance     = 1;
            auegh.useSpecialTint = false;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToSubShop(ItemBuilder.ShopType.Goopton, 1f);
        }
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Boomerang Scythe", "stab");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:boomerang_scythe", "ski:boomerang_scythe");
            gun.gameObject.AddComponent <SealedScythe>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Right back at ya!");
            gun.SetLongDescription("A high tech australian hunting device. A loosely fitted boomerang is fitted to the top of this scythe but don't worry it never breaks entirely." +
                                   "___________________________________________");
            gun.SetupSprite(null, "stab_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 24);
            gun.SetAnimationFPS(gun.reloadAnimation, 24);

            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(541) as Gun, true, false);
            gun.DefaultModule.ammoCost                  = 1;
            gun.DefaultModule.angleVariance             = 0f;
            gun.DefaultModule.shootStyle                = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle             = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.preventFiringDuringCharge = true;
            Gun gun3 = (Gun)ETGMod.Databases.Items["wonderboy"];

            gun.muzzleFlashEffects                = gun3.muzzleFlashEffects;
            gun.reloadTime                        = 1f;
            gun.DefaultModule.cooldownTime        = .0f;
            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.InfiniteAmmo                      = true;
            gun.quality = PickupObject.ItemQuality.B;

            gun.encounterTrackable.EncounterGuid = "stab stab stab";
            //This block of code helps clone our projectile. Basically it makes it so things like Shadow Clone and Hip Holster keep the stats/sprite of your custom gun's projectiles.
            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 = 11f;
            projectile.baseData.speed  = 1f;
            projectile.baseData.range  = 1f;

            projectile.transform.parent = gun.barrelOffset;



            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #30
0
        private void OnHitEnemy(Projectile projectile, SpeculativeRigidbody enemy, bool fatal)
        {
            ComplexProjectileModifier complexProjectileModifier = PickupObjectDatabase.GetById(298) as ComplexProjectileModifier;
            float chainGlitchPreventinator = complexProjectileModifier.ChainLightningMaxLinkDistance;

            if (Owner && m_owner.CurrentRoom != null && m_owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All) != null)
            {
                foreach (AIActor aiactor in this.m_owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All))
                {
                    if (Vector2.Distance(aiactor.CenterPosition, enemy.UnitCenter) < chainGlitchPreventinator)
                    {
                        GameObject gameObject = SpawnManager.SpawnProjectile((PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0].gameObject, aiactor.sprite.WorldCenter, Quaternion.identity, true);
                        Projectile component  = gameObject.GetComponent <Projectile>();
                        bool       flag4      = component != null;
                        if (flag4)
                        {
                            component.sprite.renderer.enabled          = false;
                            component.specRigidbody.CollideWithOthers  = false;
                            component.specRigidbody.CollideWithTileMap = false;
                            component.baseData.damage = 0f;
                            component.baseData.range  = float.MaxValue;
                            component.baseData.speed  = 0f;
                            component.Owner           = this.m_owner;
                            component.Shooter         = this.m_owner.specRigidbody;
                            ChainLightningModifier orAddComponent = gameObject.gameObject.GetOrAddComponent <ChainLightningModifier>();
                            orAddComponent.LinkVFXPrefab       = complexProjectileModifier.ChainLightningVFX;
                            orAddComponent.damageTypes         = complexProjectileModifier.ChainLightningDamageTypes;
                            orAddComponent.maximumLinkDistance = complexProjectileModifier.ChainLightningMaxLinkDistance;
                            orAddComponent.damagePerHit        = m_owner.HasMTGConsoleID("psm:thunder_shells") ? 3 : complexProjectileModifier.ChainLightningDamagePerHit;
                            orAddComponent.damageCooldown      = 0.1f;
                            StartCoroutine(DelProjectel(component));
                            bool flag5 = complexProjectileModifier.ChainLightningDispersalParticles != null;
                            if (flag5)
                            {
                                orAddComponent.UsesDispersalParticles        = true;
                                orAddComponent.DispersalParticleSystemPrefab = complexProjectileModifier.ChainLightningDispersalParticles;
                                orAddComponent.DispersalDensity      = complexProjectileModifier.ChainLightningDispersalDensity;
                                orAddComponent.DispersalMinCoherency = complexProjectileModifier.ChainLightningDispersalMinCoherence;
                                orAddComponent.DispersalMaxCoherency = complexProjectileModifier.ChainLightningDispersalMaxCoherence;
                            }
                            else
                            {
                                orAddComponent.UsesDispersalParticles = false;
                            }

                            chainGlitchPreventinator += Vector2.Distance(aiactor.CenterPosition, enemy.UnitCenter);
                        }
                    }
                }
            }
        }