Ejemplo n.º 1
0
 private void BookSynergy()
 {
     if (LastOwner.HasPickupID(ETGMod.Databases.Items["Blank Spellbook"].PickupObjectId))
     {
         ResetCooldown();
     }
 }
Ejemplo n.º 2
0
 public void DoSafeExplosion(Vector3 position)
 {
     if (LastOwner.HasPickupID(332))
     {
         var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData;
         bigPlayerSafeExplosion.effect     = defaultExplosion.effect;
         bigPlayerSafeExplosion.ignoreList = defaultExplosion.ignoreList;
         bigPlayerSafeExplosion.ss         = defaultExplosion.ss;
         Exploder.Explode(position, bigPlayerSafeExplosion, Vector2.zero);
     }
     else
     {
         var defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData;
         smallPlayerSafeExplosion.effect     = defaultExplosion.effect;
         smallPlayerSafeExplosion.ignoreList = defaultExplosion.ignoreList;
         smallPlayerSafeExplosion.ss         = defaultExplosion.ss;
         Exploder.Explode(position, smallPlayerSafeExplosion, Vector2.zero);
     }
 }
Ejemplo n.º 3
0
        //Add the item's functionality down here! I stole most of this from the Stuffed Star active item code!

        protected override void DoEffect(PlayerController user)
        {
            int cashToGive = 20;

            if (LastOwner.HasPickupID(Gungeon.Game.Items["nn:rusty_casing"].PickupObjectId))
            {
                cashToGive *= 2;
            }
            if (LastOwner.HasPickupID(Gungeon.Game.Items["nn:heart_of_gold"].PickupObjectId))
            {
                cashToGive *= 2;
            }
            for (int i = 0; i < cashToGive; i++)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(68).gameObject, LastOwner);
            }

            //Activates the effect
            PlayableCharacters characterIdentity = user.characterIdentity;

            if (characterIdentity != PlayableCharacters.Robot)
            {
                float MaxHP2 = user.stats.GetBaseStatValue(PlayerStats.StatType.Health);
                MaxHP2 -= 1;
                user.stats.SetBaseStatValue(PlayerStats.StatType.Health, MaxHP2, user);
                float currentStat = user.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
                currentStat += 1f;
                user.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, currentStat, user);
            }
            else if (characterIdentity == PlayableCharacters.Robot)
            {
                user.healthHaver.Armor = user.healthHaver.Armor - 2;
                float currentStat = user.stats.GetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity);
                currentStat += 1f;
                user.stats.SetBaseStatValue(PlayerStats.StatType.AdditionalItemCapacity, currentStat, user);
            }

            //start a coroutine which calls the EndEffect method when the item's effect duration runs out
        }
Ejemplo n.º 4
0
        public override void Update()
        {
            if (LastOwner)
            {
                if (!LastOwner.HasPickupID(541))
                {
                    hasSynergy = false;
                }

                if (LastOwner.CurrentGun.PickupObjectId == 541)
                {
                    if (LastOwner.CurrentGun.ClipShotsRemaining > 0)
                    {
                        CanShootNade = true;
                    }
                }

                foreach (Gun gun in LastOwner.inventory.AllGuns)
                {
                    if (gun.PickupObjectId == 541 && hasSynergy == false)
                    {
                        hasSynergy = true;
                        LastOwner.CurrentGun.OnFinishAttack += OnPostFired;
                    }

                    if (gun.PickupObjectId == 19)
                    {
                        if (gun.CurrentAmmo != 0)
                        {
                            this.numberOfUses = (gun.CurrentAmmo + 3);
                        }
                        else if (this.m_cachedNumberOfUses != 3)
                        {
                            this.m_cachedNumberOfUses = 3;
                        }
                    }
                }
            }
        }