private void breakItem(PlayerController player)
        {
            PickupObject byId = PickupObjectDatabase.GetById(565);

            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            Owner.RemovePassiveItem(this.PickupObjectId);
        }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
        public override void Pickup(PlayerController player)
        {
            bool flag = !this.m_pickedUpThisRun;

            if (flag)
            {
                PickupObject byId = PickupObjectDatabase.GetById(565);
                player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                PickupObject byId2 = PickupObjectDatabase.GetById(127);
                player.AcquirePassiveItemPrefabDirectly(byId2 as PassiveItem);
            }
            player.PostProcessProjectile += this.PostProcess;
            player.PostProcessBeam       += this.ProcessBeam;
            base.Pickup(player);
        }
Esempio n. 4
0
        public override void OnPostFired(PlayerController player, Gun gun)
        {
            int blanksToRemove = 1;

            if (player.HasPickupID(TitaniumClip.TitaniumClipID))
            {
                blanksToRemove = 2;
            }
            if (player.PlayerHasActiveSynergy("Secrets of the Ancients") && UnityEngine.Random.value <= 0.25)
            {
                blanksToRemove = 0;
            }
            if (player.Blanks >= blanksToRemove)
            {
                player.Blanks -= blanksToRemove;
            }
            else
            {
                player.Blanks = 0;
            }
            if (player.PlayerHasActiveSynergy("Paned Expression"))
            {
                player.AcquirePassiveItemPrefabDirectly((PickupObjectDatabase.GetById(565)) as PassiveItem);
            }
            DoMicroBlank(gun.barrelOffset.position);
            base.OnPostFired(player, gun);
        }
Esempio n. 5
0
 protected override void DoEffect(PlayerController user)
 {
     if (user.HasPickupID(Gungeon.Game.Items["nn:forsaken_heart"].PickupObjectId))
     {
         if (UnityEngine.Random.value < .50f)
         {
             //No curse >:)
         }
         else
         {
             giveSomeCurse(user);
         }
     }
     else
     {
         giveSomeCurse(user);
     }
     if (user.PlayerHasActiveSynergy("Transparent Lies"))
     {
         PickupObject byId = PickupObjectDatabase.GetById(565);
         user.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
     }
     timesUsed += 1;
     user.ForceBlank(25f, 0.5f, false, true, null, true, -1f);
     if (timesUsed >= 10)
     {
         if (!SaveAPIManager.GetFlag(CustomDungeonFlags.USED_FALSE_BLANK_TEN_TIMES))
         {
             SaveAPIManager.SetFlag(CustomDungeonFlags.USED_FALSE_BLANK_TEN_TIMES, true);
         }
     }
 }
Esempio n. 6
0
        protected override void DoEffect(PlayerController user)
        {
            AkSoundEngine.PostEvent("Play_OBJ_dice_bless_01", base.gameObject);
            user.PlayEffectOnActor(ResourceCache.Acquire("Global VFX/VFX_Healing_Sparkles_001") as GameObject, Vector3.zero, true, false, false);

            // give items
            PickupObject byId = PickupObjectDatabase.GetById(264);

            user.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(264).gameObject, user);

            user.healthHaver.FullHeal();

            // curse cleansing
            StatModifier statModifier = new StatModifier
            {
                amount      = Mathf.Min((float)(PlayerStats.GetTotalCurse() * -1)),
                modifyType  = StatModifier.ModifyMethod.ADDITIVE,
                statToBoost = PlayerStats.StatType.Curse
            };

            user.ownerlessStatModifiers.Add(statModifier);

            user.stats.RecalculateStats(user, true, false);
        }
        private void GiveWoodGuon(FlippableCover obj)
        {
            PlayerController owner = base.Owner;
            var woodGuon           = Gungeon.Game.Items["nn:wood_guon_stone"];

            owner.AcquirePassiveItemPrefabDirectly(woodGuon as PassiveItem);
        }
 protected override void OnPickedUpByPlayer(PlayerController player)
 {
     if (!everPickedUpByPlayer)
     {
         player.AcquirePassiveItemPrefabDirectly(PickupObjectDatabase.GetById(565) as PassiveItem);
     }
     player.OnReceivedDamage += this.OnHit;
     base.OnPickedUpByPlayer(player);
 }
Esempio n. 9
0
        private IEnumerator Crestgain()
        {
            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);
            yield break;
        }
        public override void Pickup(PlayerController player)
        {
            bool flag = !this.m_pickedUpThisRun;

            if (flag)
            {
                PickupObject byId = PickupObjectDatabase.GetById(565);
                player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            }
            GameManager.Instance.OnNewLevelFullyLoaded += this.OnNewFloor;
            base.Pickup(player);
        }
Esempio n. 11
0
        public override void Pickup(PlayerController player)
        {
            bool flag = !this.m_pickedUpThisRun;

            if (flag)
            {
                PickupObject byId = PickupObjectDatabase.GetById(565);
                player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
            }
            player.OnUsedBlank += this.OnUsedBlank;
            base.Pickup(player);
        }
 public override void Pickup(PlayerController player)
 {
     if (!this.m_pickedUpThisRun)
     {
         for (int i = 0; i < 3; i++)
         {
             player.AcquirePassiveItemPrefabDirectly(PickupObjectDatabase.GetById(565) as PassiveItem);
         }
     }
     GameManager.Instance.OnNewLevelFullyLoaded += this.OnNewFloor;
     base.Pickup(player);
 }
        private static IEnumerator DoShrineEffect(PlayerController player)
        {
            float SST = UnityEngine.Random.value;
            TurtleShrineEffectHandler eff = player.gameObject.GetOrAddComponent <TurtleShrineEffectHandler>();

            yield return(null);

            if (player.characterIdentity == PlayableCharacters.Robot)
            {
                player.healthHaver.Armor -= 1;
                if (SST <= 0.01f)
                {
                    PickupObject byId = PickupObjectDatabase.GetById(301);
                    player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                }
                else
                {
                    eff.SpawnNewTurtle();
                    eff.SpawnNewTurtle();
                    eff.SpawnNewTurtle();
                    eff.SpawnNewTurtle();
                }
            }
            else
            {
                player.healthHaver.ApplyHealing(-0.5f);
                if (SST <= 0.005f)
                {
                    PickupObject byId = PickupObjectDatabase.GetById(301);
                    player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                }
                else
                {
                    eff.SpawnNewTurtle();
                    eff.SpawnNewTurtle();
                }
            }
            yield break;
        }
Esempio n. 14
0
        private IEnumerator RecoverGuonsCoroutine(PlayerController player, int count)
        {
            yield return(null);

            if (UnityEngine.Random.value <= 0.15f && !this.m_advancedSynergyUpgradeActive)
            {
                count -= 1;
            }
            if (count <= 0)
            {
                yield break;
            }
            for (int i = 0; i < count; i++)
            {
                player.AcquirePassiveItemPrefabDirectly(PickupObjectDatabase.GetById(565) as PassiveItem);
            }
        }
 private void OnItemPurchased(PlayerController player, ShopItemController obj)
 {
     //ETGModConsole.Log("You purchased an item");
     if (couponActive)
     {
         if (priceChange <= 0)
         {
             return;
         }
         float curPriceMod = player.stats.GetBaseStatValue(PlayerStats.StatType.GlobalPriceMultiplier);
         float newPriceMod = curPriceMod + priceChange;
         player.stats.SetBaseStatValue(PlayerStats.StatType.GlobalPriceMultiplier, newPriceMod, player);
         //Give the miserly ring
         if (playerHasMiserlyRing == true && !player.HasPickupID(451))
         {
             PickupObject byId = PickupObjectDatabase.GetById(132);
             player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
             PlayableCharacters characterIdentity = LastOwner.characterIdentity;
             if (characterIdentity == PlayableCharacters.Robot)
             {
                 LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, LastOwner);
                 LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, LastOwner);
             }
         }
         else if (playerHasMiserlyRing == true && player.HasPickupID(451))
         {
             applyWeirdHealing();
         }
         //Remove the second active slot upon purchasing an item
         float curActiveSlots = player.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
         curActiveSlots -= 1;
         player.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, curActiveSlots, player);
         priceChange = -1;
         player.RemoveActiveItem(this.PickupObjectId);
     }
 }
Esempio n. 16
0
        private void RandomEffect()
        {
            PlayerController player = this.Owner;

            AkSoundEngine.PostEvent("Play_WPN_burninghand_shot_01", base.gameObject);

            if (ETGMod.Databases.Items["Glass Ammolet"] != null && ETGMod.Databases.Items["Glass Chamber"] != null && ETGMod.Databases.Items["Glass Rounds"] != null)
            {
                float value = UnityEngine.Random.Range(0.0f, 1.0f);

                bool SingleStone = value <= 0.3;
                if (SingleStone && !player.HasPickupID(152))
                {
                    //SINGLE STONE
                    AkSoundEngine.PostEvent("Play_OBJ_crystal_shatter_01", base.gameObject);
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                }
                else
                {
                    bool DoubleStone = value <= 0.7;
                    if (DoubleStone && !player.HasPickupID(152))
                    {
                        //DOUBLE STONE
                        AkSoundEngine.PostEvent("Play_OBJ_crystal_shatter_01", base.gameObject);
                        PickupObject byId = PickupObjectDatabase.GetById(565);
                        player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                    }
                    else
                    {
                        bool TripleStone = value <= 0.9;
                        if (TripleStone)
                        {
                            //TRIPLE STONE
                            AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                            PickupObject byId = PickupObjectDatabase.GetById(565);
                            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                            LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                        }
                        else
                        {
                            bool Sunglasses = value <= 0.9125;
                            if (Sunglasses)
                            {
                                //SUNGLASSES
                                AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(290).gameObject, player);
                            }
                            else
                            {
                                bool Bottle = value <= 0.925;
                                if (Bottle && !player.HasPickupID(558))
                                {
                                    //BOTTLE
                                    AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                    float baseStatValue = player.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
                                    float num           = 1f + baseStatValue;
                                    player.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, num, player);
                                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(558).gameObject, player);
                                }
                                else
                                {
                                    bool Flask = value <= 0.9375;
                                    if (Flask && !player.HasPickupID(267))
                                    {
                                        //KNIGHT FLASK
                                        AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                        float baseStatValue = player.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
                                        float num           = 1f + baseStatValue;
                                        player.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, num, player);
                                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(267).gameObject, player);
                                    }
                                    else
                                    {
                                        bool Cannon = value <= 0.95;
                                        if (Cannon && !player.HasPickupID(540))
                                        {
                                            //GLASS CANNON
                                            AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                            LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(540).gameObject, player);
                                        }
                                        else
                                        {
                                            bool HeartBottle = value <= 0.9625;
                                            if (HeartBottle)
                                            {
                                                //HEART BOTTLE
                                                AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(424).gameObject, player);
                                            }
                                            else
                                            {
                                                bool GlassRounds = value <= 0.975;
                                                if (GlassRounds)
                                                {
                                                    //GLASS ROUNDS
                                                    AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                                    LootEngine.GivePrefabToPlayer(ETGMod.Databases.Items["Glass Rounds"].gameObject, player);
                                                }
                                                else
                                                {
                                                    bool GlassAmmolet = value <= 0.9875;
                                                    if (GlassAmmolet)
                                                    {
                                                        //GLASS AMMOLET
                                                        AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                                        LootEngine.GivePrefabToPlayer(ETGMod.Databases.Items["Glass Ammolet"].gameObject, player);
                                                    }
                                                    else
                                                    {
                                                        bool GlassChamber = value <= 1;
                                                        if (GlassChamber)
                                                        {
                                                            //GLASS CHAMBER
                                                            AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                                            LootEngine.GivePrefabToPlayer(ETGMod.Databases.Items["Glass Chamber"].gameObject, player);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            else if (ETGMod.Databases.Items["Glass Ammolet"] == null || ETGMod.Databases.Items["Glass Chamber"] == null || ETGMod.Databases.Items["Glass Rounds"] == null)
            {
                float value = UnityEngine.Random.Range(0.0f, 1.0f);

                bool SingleStone = value <= 0.3;
                if (SingleStone && !player.HasPickupID(152))
                {
                    //SINGLE STONE
                    AkSoundEngine.PostEvent("Play_OBJ_crystal_shatter_01", base.gameObject);
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                }
                else
                {
                    bool DoubleStone = value <= 0.7;
                    if (DoubleStone && !player.HasPickupID(152))
                    {
                        //DOUBLE STONE
                        AkSoundEngine.PostEvent("Play_OBJ_crystal_shatter_01", base.gameObject);
                        PickupObject byId = PickupObjectDatabase.GetById(565);
                        player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                    }
                    else
                    {
                        bool TripleStone = value <= 0.9;
                        if (TripleStone)
                        {
                            //TRIPLE STONE
                            AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                            PickupObject byId = PickupObjectDatabase.GetById(565);
                            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                            player.AcquirePassiveItemPrefabDirectly(byId as PassiveItem);
                            LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, player);
                        }
                        else
                        {
                            bool Sunglasses = value <= 0.92;
                            if (Sunglasses)
                            {
                                //SUNGLASSES
                                AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(290).gameObject, player);
                            }
                            else
                            {
                                bool Bottle = value <= 0.94;
                                if (Bottle && !player.HasPickupID(558))
                                {
                                    //BOTTLE
                                    AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                    float baseStatValue = player.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
                                    float num           = 1f + baseStatValue;
                                    player.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, num, player);
                                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(558).gameObject, player);
                                }
                                else
                                {
                                    bool Flask = value <= 0.96;
                                    if (Flask && !player.HasPickupID(267))
                                    {
                                        //KNIGHT FLASK
                                        AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                        float baseStatValue = player.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
                                        float num           = 1f + baseStatValue;
                                        player.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, num, player);
                                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(267).gameObject, player);
                                    }
                                    else
                                    {
                                        bool Cannon = value <= 0.98;
                                        if (Cannon && !player.HasPickupID(540))
                                        {
                                            //GLASS CANNON
                                            AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                            LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(540).gameObject, player);
                                        }
                                        else
                                        {
                                            bool HeartBottle = value <= 1;
                                            if (HeartBottle)
                                            {
                                                //HEART BOTTLE
                                                AkSoundEngine.PostEvent("Play_OBJ_ironcoin_wish_01", base.gameObject);
                                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(424).gameObject, player);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }