Beispiel #1
0
 private void GiveHunterLoadout(PlayerController user)
 {
     //Give Dog
     if (!user.HasPickupID(300))
     {
         PickupObject DogItem = PickupObjectDatabase.GetById(300);
         LastOwner.AcquirePassiveItemPrefabDirectly(DogItem as PassiveItem);
     }
     //Give Crossbow
     if (!user.HasPickupID(12))
     {
         Gun Crossbow = (PickupObjectDatabase.GetById(12) as Gun);
         LastOwner.inventory.AddGunToInventory(Crossbow, true);
     }
     //Give Rusty Sidearm
     if (!user.HasPickupID(99) && !user.HasPickupID(810))
     {
         Gun RustySidearm = (PickupObjectDatabase.GetById(99) as Gun);
         LastOwner.inventory.AddGunToInventory(RustySidearm, true);
     }
     foreach (Gun gun in user.inventory.AllGuns)
     {
         if (gun.GetComponent <Paraglocks>() != null)
         {
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(99);
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(810);
         }
     }
 }
        private void GiveEngravedBulletsRemoveUnengravedBullets()
        {
            var engravedBulletsItem = Gungeon.Game.Items["nn:engraved_bullets"];

            LastOwner.AcquirePassiveItemPrefabDirectly(engravedBulletsItem as PassiveItem);
            LastOwner.RemoveActiveItem(this.PickupObjectId);
        }
 private void BookSynergy()
 {
     if (LastOwner.HasPickupID(ETGMod.Databases.Items["Blank Spellbook"].PickupObjectId))
     {
         ResetCooldown();
     }
 }
Beispiel #4
0
 private void GiveRobotLoadout(PlayerController user)
 {
     //Give Battery Bullets
     if (!user.HasPickupID(410))
     {
         PickupObject CharacterPassive = PickupObjectDatabase.GetById(410);
         LastOwner.AcquirePassiveItemPrefabDirectly(CharacterPassive as PassiveItem);
     }
     //Give Robots Right Hand
     if (!user.HasPickupID(88) && !user.HasPickupID(812))
     {
         Gun CharacterStarterGun = (PickupObjectDatabase.GetById(88) as Gun);
         LastOwner.inventory.AddGunToInventory(CharacterStarterGun, true);
     }
     //Give Coolant Leak
     if (!user.HasPickupID(411))
     {
         PickupObject CharacterActive = PickupObjectDatabase.GetById(411);
         LootEngine.SpawnItem(CharacterActive.gameObject, LastOwner.specRigidbody.UnitCenter, Vector2.left, 1f, false, true, false);
     }
     foreach (Gun gun in user.inventory.AllGuns)
     {
         if (gun.GetComponent <Paraglocks>() != null)
         {
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(88);
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(812);
         }
     }
 }
 public override void Update()
 {
     base.Update();
     if (!Dungeon.IsGenerating && m_PickedUp)
     {
         if (m_HammersHidden && LastOwner && LastOwner.GetAbsoluteParentRoom() != null)
         {
             if (!LastOwner.IsInCombat)
             {
                 m_HammersHidden = false;
                 if (StaticReferenceManager.AllEnemies.Count > 0)
                 {
                     List <AIActor> m_BabyHammers = new List <AIActor>();
                     foreach (AIActor enemy in StaticReferenceManager.AllEnemies)
                     {
                         if (enemy.EnemyGuid == CompanionGuid && enemy.IsGone)
                         {
                             RoomHandler CurrentRoom = LastOwner.GetAbsoluteParentRoom();
                             // Vector3 ReturnPosition = (LastOwner.gameObject.transform.position + new Vector3(UnityEngine.Random.Range(0, 0.25f), 4.5f));
                             Vector3 ReturnPosition = (new Vector3(0, 5.5f) + LastOwner.CurrentRoom.GetBestRewardLocation(new IntVector2(2, 2), RoomHandler.RewardLocationStyle.PlayerCenter, false).ToVector3());
                             StartCoroutine(HandleHammerReturn(enemy, ReturnPosition));
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #6
0
 private void GiveMarineLoadout(PlayerController user)
 {
     //Give Military Training
     if (!user.HasPickupID(354))
     {
         PickupObject CharacterPassive = PickupObjectDatabase.GetById(354);
         LastOwner.AcquirePassiveItemPrefabDirectly(CharacterPassive as PassiveItem);
     }
     //Give Marine Sidearm
     if (!user.HasPickupID(86) && !user.HasPickupID(809))
     {
         Gun CharacterStarterGun = (PickupObjectDatabase.GetById(86) as Gun);
         LastOwner.inventory.AddGunToInventory(CharacterStarterGun, true);
     }
     //Give Supply Drop
     if (!user.HasPickupID(77))
     {
         PickupObject CharacterActive = PickupObjectDatabase.GetById(77);
         LootEngine.SpawnItem(CharacterActive.gameObject, LastOwner.specRigidbody.UnitCenter, Vector2.left, 1f, false, true, false);
     }
     //Give 1 Armour
     LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, LastOwner);
     foreach (Gun gun in user.inventory.AllGuns)
     {
         if (gun.GetComponent <Paraglocks>() != null)
         {
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(86);
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(809);
         }
     }
 }
Beispiel #7
0
 private void GivePilotLoadout(PlayerController user)
 {
     //Give Disarming Personality
     if (!user.HasPickupID(187))
     {
         PickupObject EnragingPhoto = PickupObjectDatabase.GetById(187);
         LastOwner.AcquirePassiveItemPrefabDirectly(EnragingPhoto as PassiveItem);
     }
     //Give Hidden Compartment
     if (!user.HasPickupID(473))
     {
         PickupObject EnragingPhoto = PickupObjectDatabase.GetById(473);
         LastOwner.AcquirePassiveItemPrefabDirectly(EnragingPhoto as PassiveItem);
     }
     //Give Rogue Special
     if (!user.HasPickupID(89) && !user.HasPickupID(651))
     {
         Gun RustySidearm = (PickupObjectDatabase.GetById(89) as Gun);
         LastOwner.inventory.AddGunToInventory(RustySidearm, true);
     }
     //Give Trusty Lockpicks
     if (!user.HasPickupID(356))
     {
         PickupObject Molotov = PickupObjectDatabase.GetById(356);
         LootEngine.SpawnItem(Molotov.gameObject, LastOwner.specRigidbody.UnitCenter, Vector2.left, 1f, false, true, false);
     }
     foreach (Gun gun in user.inventory.AllGuns)
     {
         if (gun.GetComponent <Paraglocks>() != null)
         {
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(89);
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(651);
         }
     }
 }
Beispiel #8
0
 private void GiveConvictLoadout(PlayerController user)
 {
     //Give Enraging Photo
     if (!user.HasPickupID(353))
     {
         PickupObject EnragingPhoto = PickupObjectDatabase.GetById(353);
         LastOwner.AcquirePassiveItemPrefabDirectly(EnragingPhoto as PassiveItem);
     }
     //Give SawedOff
     if (!user.HasPickupID(202))
     {
         Gun SawedOff = (PickupObjectDatabase.GetById(202) as Gun);
         LastOwner.inventory.AddGunToInventory(SawedOff, true);
     }
     //Give Budget Revolver
     if (!user.HasPickupID(80) && !user.HasPickupID(652))
     {
         Gun RustySidearm = (PickupObjectDatabase.GetById(80) as Gun);
         LastOwner.inventory.AddGunToInventory(RustySidearm, true);
     }
     //Give Molotov
     if (!user.HasPickupID(366))
     {
         PickupObject Molotov = PickupObjectDatabase.GetById(366);
         LootEngine.SpawnItem(Molotov.gameObject, LastOwner.specRigidbody.UnitCenter, Vector2.left, 1f, false, true, false);
     }
     foreach (Gun gun in user.inventory.AllGuns)
     {
         if (gun.GetComponent <Paraglocks>() != null)
         {
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(80);
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(652);
         }
     }
 }
Beispiel #9
0
 protected override void DoEffect(PlayerController user)
 {
     AkSoundEngine.PostEvent("Play_BOSS_bulletbros_anger_01", base.gameObject);
     GameManager.Instance.StartCoroutine(SpawnMimic(user));
     GameManager.Instance.StartCoroutine(SpawnMimic(user));
     if (LastOwner.HasMTGConsoleID("mimic_tooth_necklace")) //Extra mimic
     {
         GameManager.Instance.StartCoroutine(SpawnMimic(user));
     }
     //StartCoroutine(ItemBuilder.HandleDuration(this, 2f, user, null));
 }
Beispiel #10
0
        public void PlaceBomb(Vector3 position)
        {
            SpawnObjectPlayerItem playerItem = PickupObjectDatabase.GetById(LastOwner.PlayerHasActiveSynergy("Cold as Ice") ? 109 : 108).GetComponent <SpawnObjectPlayerItem>();
            GameObject            bombPrefab = playerItem.objectToSpawn.gameObject;
            GameObject            BombObject = Object.Instantiate <GameObject>(bombPrefab, position, Quaternion.identity);
            tk2dBaseSprite        bombSprite = BombObject.GetComponent <tk2dBaseSprite>();

            if (bombSprite)
            {
                bombSprite.PlaceAtPositionByAnchor(position, tk2dBaseSprite.Anchor.MiddleCenter);
            }
        }
 public override void Update()
 {
     if (LastOwner)
     {
         if (LastOwner.PlayerHasActiveSynergy("Golden Apple") && !WasGoldenLastChecked)
         {
             base.sprite.SetSprite(AppleActive.spriteIDs[1]);
             WasGoldenLastChecked = true;
         }
         else if (!LastOwner.PlayerHasActiveSynergy("Golden Apple") && WasGoldenLastChecked)
         {
             base.sprite.SetSprite(AppleActive.spriteIDs[0]);
             WasGoldenLastChecked = false;
         }
     }
     base.Update();
 }
Beispiel #12
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);
     }
 }
Beispiel #13
0
 public override void Update()
 {
     base.Update();
     if (LastOwner)
     {
         bool NewSynergyCheck = LastOwner.PlayerHasActiveSynergy("Bloody D12");
         if (NewSynergyCheck != SynergyExists)
         {
             SynergyExists = NewSynergyCheck;
             if (SynergyExists)
             {
                 this.sprite.SetSprite(D12SpriteID);
             }
             else
             {
                 this.sprite.SetSprite(BloodyDiceSpriteID);
             }
         }
     }
 }
Beispiel #14
0
 private IEnumerator BombsAway()
 {
     for (int i = 0; i < 30; i++)
     {
         if (LastOwner != null)
         {
             if (LastOwner.CurrentRoom != null)
             {
                 Vector3 position = LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1).ToVector3();
                 PlaceBomb(position);
                 if (LastOwner.PlayerHasActiveSynergy("Bomb Buds") && BoxOTools.BasicRandom(0.5f))
                 {
                     Vector3 position2 = LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1).ToVector3();
                     PlaceBomb(position2); // i should probably use a for here but im too lazy to set it up
                 }
             }
             yield return(new WaitForSeconds(0.5f));
         }
     }
     yield break;
 }
        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;
                        }
                    }
                }
            }
        }
Beispiel #16
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
        }
Beispiel #17
0
        private void DetonateDrone()
        {
            Vector2 position         = extant_drone.GetComponent <tk2dSprite>().WorldCenter;
            var     defaultExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData;

            explosionData.effect     = defaultExplosion.effect;
            explosionData.ignoreList = defaultExplosion.ignoreList;
            if (LastOwner.HasMTGConsoleID("remote_bullets") || LastOwner.HasMTGConsoleID("3rd_party_controller")) //remote bullets = x2 damage
            {
                explosionData.damage = 100f;
            }
            else
            {
                explosionData.damage = 50f;
            }

            if (LastOwner.HasMTGConsoleID("air_strike")) //air strike = +4 'splosions
            {
                for (int i = -1; i <= 1; i++)
                {
                    for (int j = -1; j <= 1; j++)
                    {
                        if (Mathf.Abs(i) + Mathf.Abs(j) == 1)
                        {
                            Exploder.Explode(position + new Vector2(i * 3f, j * 3f), explosionData, Vector2.zero);
                        }
                    }
                }
            }

            if (LastOwner.HasMTGConsoleID("napalm_strike")) //napalm strike = fire circle
            {
                DoNapalmSynergy(position);
            }

            Exploder.Explode(position, explosionData, Vector2.zero);
            GameObject.Destroy(extant_drone);
        }
Beispiel #18
0
 private void GiveBulletLoadout(PlayerController user)
 {
     //Give Live Ammo
     if (!user.HasPickupID(414))
     {
         PickupObject CharacterPassive = PickupObjectDatabase.GetById(414);
         LastOwner.AcquirePassiveItemPrefabDirectly(CharacterPassive as PassiveItem);
     }
     //Give Blasphemy
     if (!user.HasPickupID(417) && !user.HasPickupID(813))
     {
         Gun CharacterStarterGun = (PickupObjectDatabase.GetById(417) as Gun);
         LastOwner.inventory.AddGunToInventory(CharacterStarterGun, true);
     }
     foreach (Gun gun in user.inventory.AllGuns)
     {
         if (gun.GetComponent <Paraglocks>() != null)
         {
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(417);
             gun.GetComponent <Paraglocks>().idsBuffedByAssociatedDissasociationsSynergy.Add(813);
         }
     }
 }
        public void KillDropWeirdActive(PlayerItem item)
        {
            DebrisObject debrisObject = LastOwner.DropActiveItem(item);

            UnityEngine.Object.Destroy(debrisObject.gameObject, 0.01f);
        }
        public void KillDropWeirdItem(PassiveItem item)
        {
            DebrisObject debrisObject = LastOwner.DropPassiveItem(item);

            UnityEngine.Object.Destroy(debrisObject.gameObject, 0.01f);
        }
Beispiel #21
0
        private void Pandamoment(PlayerController user)
        {
            if (LastOwner.PlayerHasActiveSynergy("Agent of Chaos"))

            {
                string header = "You feel sick.";
                string text   = "You drank a potion.";
                AkSoundEngine.PostEvent("Play_WPN_Bubbler_Drink_01", gameObject);
                int bighead = UnityEngine.Random.Range(1, 19);
                if (bighead == 1)
                {
                    header = "Damage up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.Damage, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 2)
                {
                    header = "Projectile speed up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.ProjectileSpeed, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 3)
                {
                    header = "Movement speed up.";
                    text   = "Lucky you!.";
                    this.ApplyStat(user, PlayerStats.StatType.MovementSpeed, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 4)
                {
                    header = "Damage to bosses up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.DamageToBosses, 0.05f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 5)
                {
                    header = "Blanks up.";
                    text   = "Lucky you!";
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(224).gameObject, LastOwner);
                }
                if (bighead == 6)
                {
                    header = "Curse up.";
                    text   = "Unlucky.";

                    this.ApplyStat(user, PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 7)
                {
                    header = "Ammo Capacity up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.AmmoCapacityMultiplier, 1.05f, StatModifier.ModifyMethod.MULTIPLICATIVE);
                }
                if (bighead == 8)
                {
                    header = "Coolness up.";
                    text   = "Lucky you!";
                    this.ApplyStat(user, PlayerStats.StatType.Coolness, 3f, StatModifier.ModifyMethod.ADDITIVE);
                }
                if (bighead == 9)
                {
                    header = "Armour up.";
                    text   = "Lucky you!";
                    LastOwner.healthHaver.Armor = LastOwner.healthHaver.Armor + 1;
                }
                if (bighead == 10)
                {
                    header = "Money up.";
                    text   = "Lucky you!";
                    LastOwner.carriedConsumables.Currency = LastOwner.carriedConsumables.Currency + 15;
                }
                if (bighead == 11)
                {
                    header = "Damage.";
                    text   = "Unlucky.";
                    LastOwner.healthHaver.ApplyDamage(1, Vector2.zero, "Chaotic Forces", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                }
                if (bighead == 12)
                {
                    header = "Keys up.";
                    text   = "Lucky you!";
                    LastOwner.carriedConsumables.KeyBullets = LastOwner.carriedConsumables.KeyBullets + 1;
                }
                if (bighead == 13)
                {
                    header = "Mapped out.";
                    text   = "Lucky you!";
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(137).gameObject, LastOwner);
                }
                if (bighead == 14)
                {
                    header = "Lead Embrace.";
                    text   = "Unlucky.";
                    AIActor    orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("cd4a4b7f612a4ba9a720b9f97c52f38c");
                    IntVector2?intVector    = new IntVector2?(base.LastOwner.CurrentRoom.GetRandomVisibleClearSpot(2, 2));

                    AIActor aiactor = AIActor.Spawn(orLoadByGuid.aiActor, intVector.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(intVector.Value), true, AIActor.AwakenAnimationType.Default, true);
                }
                if (bighead == 15)
                {
                    header = "Glass blessing.";
                    text   = "Lucky you!";
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, LastOwner);
                }
                if (bighead == 16)
                {
                    header = "Green fire.";
                    text   = "Lucky you!";
                    DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.GreenFireDef);
                    goopManagerForGoopType.TimedAddGoopCircle(LastOwner.sprite.WorldCenter, 5f, 0.35f, false);
                }
                if (bighead == 17)
                {
                    header = "Poison!";
                    text   = "Unlucky.";
                    DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.PoisonDef);
                    goopManagerForGoopType.TimedAddGoopCircle(LastOwner.sprite.WorldCenter, 5f, 0.35f, false);
                }
                if (bighead == 18)
                {
                    header = "Fire!";
                    text   = "Unlucky.";
                    DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(EasyGoopDefinitions.FireDef);
                    goopManagerForGoopType.TimedAddGoopCircle(LastOwner.sprite.WorldCenter, 5f, 0.35f, false);
                }
                this.Notify(header, text);
            }
        }
Beispiel #22
0
 private void RoomCleared()
 {
     LastOwner.RemovePassiveItem(815);
     LastOwner.OnEnteredCombat -= this.RoomCleared;
 }