コード例 #1
0
ファイル: MidGameSaveData.cs プロジェクト: dadebert/Semi
        public void InitializePlayerData(PlayerController p1, MidGamePlayerData playerData, bool isPlayerOne)
        {
            IsInitializingPlayerData = true;

            p1.MasteryTokensCollectedThisRun = playerData.MasteryTokensCollected;
            p1.CharacterUsesRandomGuns       = playerData.CharacterUsesRandomGuns;
            p1.HasTakenDamageThisRun         = playerData.HasTakenDamageThisRun;
            p1.HasFiredNonStartingGun        = playerData.HasFiredNonStartingGun;

            ChallengeManager.ChallengeModeType = playerData.ChallengeMode;

            if (levelSaved == GlobalDungeonData.ValidTilesets.FINALGEON)
            {
                p1.CharacterUsesRandomGuns = false;
            }
            if (levelSaved != GlobalDungeonData.ValidTilesets.FINALGEON || !(p1 is PlayerSpaceshipController))
            {
                p1.inventory.DestroyAllGuns();
                p1.RemoveAllPassiveItems();
                p1.RemoveAllActiveItems();

                if (playerData.passiveItems != null)
                {
                    for (int i = 0; i < playerData.passiveItems.Count; i++)
                    {
                        var item = (MidGamePassiveItemData)(object)playerData.passiveItems[i];

                        EncounterTrackable.SuppressNextNotification = true;
                        LootEngine.GivePrefabToPlayer(Registry.Items[item.ItemID].gameObject, p1);
                    }
                }
                if (playerData.activeItems != null)
                {
                    for (int j = 0; j < playerData.activeItems.Count; j++)
                    {
                        var item = (MidGameActiveItemData)(object)playerData.activeItems[j];

                        EncounterTrackable.SuppressNextNotification = true;
                        LootEngine.GivePrefabToPlayer(Registry.Items[item.ItemID].gameObject, p1);
                    }
                }
                if (playerData.guns != null)
                {
                    for (int k = 0; k < playerData.guns.Count; k++)
                    {
                        var gun = (MidGameGunData)(object)playerData.guns[k];

                        EncounterTrackable.SuppressNextNotification = true;
                        LootEngine.GivePrefabToPlayer(Registry.Items[gun.ItemID].gameObject, p1);
                    }
                    for (int l = 0; l < playerData.guns.Count; l++)
                    {
                        var savegun = (MidGameGunData)(object)playerData.guns[l];

                        for (int m = 0; m < p1.inventory.AllGuns.Count; m++)
                        {
                            var invgun = (PickupObject)(global::PickupObject)p1.inventory.AllGuns[m];
                            if (invgun.UniqueItemID == savegun.ItemID)
                            {
                                p1.inventory.AllGuns[m].MidGameDeserialize(playerData.guns[l].SerializedData);
                                for (int n = 0; n < playerData.guns[l].DuctTapedGunIDs.Count; n++)
                                {
                                    Gun gun = PickupObjectDatabase.GetById(playerData.guns[l].DuctTapedGunIDs[n]) as Gun;
                                    // TODO @save here's the call site for the duct tape id thing, fix to use a string list eventually
                                    if (gun)
                                    {
                                        DuctTapeItem.DuctTapeGuns(gun, p1.inventory.AllGuns[m]);
                                    }
                                }
                                p1.inventory.AllGuns[m].ammo = playerData.guns[l].CurrentAmmo;
                            }
                        }
                    }
                }
                if (playerData.CurrentHealth <= 0f && playerData.CurrentArmor <= 0f)
                {
                    p1.healthHaver.Armor = 0f;
                    p1.DieOnMidgameLoad();
                }
                else
                {
                    p1.healthHaver.ForceSetCurrentHealth(playerData.CurrentHealth);
                    p1.healthHaver.Armor = playerData.CurrentArmor;
                }
                if (isPlayerOne)
                {
                    p1.carriedConsumables.KeyBullets = playerData.CurrentKeys;
                    p1.carriedConsumables.Currency   = playerData.CurrentCurrency;
                }
                p1.Blanks = Mathf.Max(p1.Blanks, playerData.CurrentBlanks);
                if (playerData.activeItems != null)
                {
                    for (int num = 0; num < playerData.activeItems.Count; num++)
                    {
                        for (int num2 = 0; num2 < p1.activeItems.Count; num2++)
                        {
                            if (playerData.activeItems[num].PickupID == p1.activeItems[num2].PickupObjectId)
                            {
                                p1.activeItems[num2].MidGameDeserialize(playerData.activeItems[num].SerializedData);
                                p1.activeItems[num2].CurrentDamageCooldown = playerData.activeItems[num].DamageCooldown;
                                p1.activeItems[num2].CurrentRoomCooldown   = playerData.activeItems[num].RoomCooldown;
                                p1.activeItems[num2].CurrentTimeCooldown   = playerData.activeItems[num].TimeCooldown;
                                if (p1.activeItems[num2].consumable && playerData.activeItems[num].NumberOfUses > 0)
                                {
                                    p1.activeItems[num2].numberOfUses = playerData.activeItems[num].NumberOfUses;
                                }
                            }
                        }
                    }
                }
                if (playerData.passiveItems != null)
                {
                    for (int num3 = 0; num3 < playerData.passiveItems.Count; num3++)
                    {
                        for (int num4 = 0; num4 < p1.passiveItems.Count; num4++)
                        {
                            if (playerData.passiveItems[num3].PickupID == p1.passiveItems[num4].PickupObjectId)
                            {
                                p1.passiveItems[num4].MidGameDeserialize(playerData.passiveItems[num3].SerializedData);
                            }
                        }
                    }
                }
                if (playerData.ownerlessStatModifiers != null)
                {
                    if (p1.ownerlessStatModifiers == null)
                    {
                        p1.ownerlessStatModifiers = new List <StatModifier>();
                    }
                    for (int num5 = 0; num5 < playerData.ownerlessStatModifiers.Count; num5++)
                    {
                        p1.ownerlessStatModifiers.Add(playerData.ownerlessStatModifiers[num5]);
                    }
                }
                if (levelSaved == GlobalDungeonData.ValidTilesets.FINALGEON)
                {
                    p1.ResetToFactorySettings(true, true, false);
                }
                if (p1 && p1.stats != null)
                {
                    p1.stats.RecalculateStats(p1, false, false);
                }
                if (playerData.HasBloodthirst)
                {
                    p1.gameObject.GetOrAddComponent <Bloodthirst>();
                }
            }
            IsInitializingPlayerData = false;
            EncounterTrackable.SuppressNextNotification = false;
        }
コード例 #2
0
        internal void AddDefaultCommands()
        {
            _LoggerSubscriber = (logger, loglevel, indent, str) => {
                PrintLine(logger.String(loglevel, str, indent: indent), color: _LoggerColors[loglevel]);
            };


            AddCommand("!!", (args, histindex) => {
                if (histindex - 1 < 0)
                {
                    throw new Exception("Can't run previous command (history is empty).");
                }
                return(History.Execute(histindex.Value - 1));
            });

            AddCommand("!'", (args, histindex) => {
                if (histindex - 1 < 0)
                {
                    throw new Exception("Can't run previous command (history is empty).");
                }
                return(History.Entries[histindex.Value - 1]);
            });

            AddCommand("echo", (args) => {
                return(string.Join(" ", args.ToArray()));
            }).WithSubCommand("hello", (args) => {
                return("Hello, world!\nHello, world!\nHello, world!\nHello, world!\nHello, world!\nHello, world!");
            });

            AddGroup("debug")
            .WithSubCommand("summon", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("At least 1 argument required.");
                }
                var myguid = args[0];
                int count  = 0;

                if (args.Count >= 2)
                {
                    count = int.Parse(args[1]);
                }

                var prefab = EnemyDatabase.GetOrLoadByGuid(myguid);
                for (int i = 0; i < count; i++)
                {
                    IntVector2?targetCenter = new IntVector2?(GameManager.Instance.PrimaryPlayer.CenterPosition.ToIntVector2(VectorConversions.Floor));
                    Pathfinding.CellValidator cellValidator = delegate(IntVector2 c) {
                        for (int j = 0; j < prefab.Clearance.x; j++)
                        {
                            for (int k = 0; k < prefab.Clearance.y; k++)
                            {
                                if (GameManager.Instance.Dungeon.data.isTopWall(c.x + j, c.y + k))
                                {
                                    return(false);
                                }
                                if (targetCenter.HasValue)
                                {
                                    if (IntVector2.Distance(targetCenter.Value, c.x + j, c.y + k) < 4)
                                    {
                                        return(false);
                                    }
                                    if (IntVector2.Distance(targetCenter.Value, c.x + j, c.y + k) > 20)
                                    {
                                        return(false);
                                    }
                                }
                            }
                        }
                        return(true);
                    };
                    IntVector2?randomAvailableCell = GameManager.Instance.PrimaryPlayer.CurrentRoom.GetRandomAvailableCell(new IntVector2?(prefab.Clearance), new Dungeonator.CellTypes?(prefab.PathableTiles), false, cellValidator);
                    if (randomAvailableCell.HasValue)
                    {
                        AIActor aIActor = AIActor.Spawn(prefab, randomAvailableCell.Value, GameManager.Instance.PrimaryPlayer.CurrentRoom, true, AIActor.AwakenAnimationType.Default, true);
                        aIActor.HandleReinforcementFallIntoRoom(0);
                    }
                }
                return(prefab?.ActorName ?? "[Unknown]");
            })
            .WithSubCommand("force-dual-wield", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("At least 1 argument required.");
                }
                var partner_id  = int.Parse(args[0]);
                var player      = GameManager.Instance.PrimaryPlayer;
                var gun         = player.inventory.CurrentGun;
                var partner_gun = PickupObjectDatabase.GetById(partner_id) as Gun;
                player.inventory.AddGunToInventory(partner_gun);
                var forcer          = gun.gameObject.AddComponent <DualWieldForcer>();
                forcer.Gun          = gun;
                forcer.PartnerGunID = partner_gun.PickupObjectId;
                forcer.TargetPlayer = player;
                return("Done");
            })
            .WithSubCommand("unexclude-all-items", (args) => {
                foreach (var ent in PickupObjectDatabase.Instance.Objects)
                {
                    if (ent == null)
                    {
                        continue;
                    }
                    ent.quality = PickupObject.ItemQuality.SPECIAL;
                }
                return("Done");
            })
            .WithSubCommand("activate-all-synergies", (args) => {
                foreach (var ent in GameManager.Instance.SynergyManager.synergies)
                {
                    if (ent == null)
                    {
                        continue;
                    }
                    ent.ActivationStatus = SynergyEntry.SynergyActivation.ACTIVE;
                }
                return("Done");
            })
            .WithSubCommand("character", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("At least 1 argument required.");
                }
                StartCoroutine(_ChangeCharacter(args[0], args.Count > 1));
                return($"Changed character to {args[0]}");
            })
            .WithSubCommand("parser-bounds-test", (args) => {
                var text           = "echo Hello! \"Hello world!\" This\\ is\\ great \"It\"works\"with\"\\ wacky\" stuff\" \\[\\] \"\\[\\]\" [e[echo c][echo h][echo [echo \"o\"]] \"hel\"[echo lo][echo !]]";
                CurrentCommandText = text;
                return(null);
            })
            .WithSubCommand("giveid", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required.");
                }
                var pickup_obj = PickupObjectDatabase.Instance.InternalGetById(int.Parse(args[0]));

                if (pickup_obj == null)
                {
                    return("Item ID {args[0]} doesn't exist!");
                }

                LootEngine.TryGivePrefabToPlayer(pickup_obj.gameObject, GameManager.Instance.PrimaryPlayer, true);
                return(pickup_obj.EncounterNameOrDisplayName);
            });

            AddGroup("pool")
            .WithSubGroup(
                new Group("items")
                .WithSubCommand("idof", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required (numeric ID).");
                }
                var id = int.Parse(args[0]);
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    if (pair.Value.PickupObjectId == id)
                    {
                        return(pair.Key);
                    }
                }
                return("Entry not found.");
            })
                .WithSubCommand("nameof", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required (ID).");
                }
                var id = args[0];
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    if (pair.Key == id)
                    {
                        return(_GetPickupObjectName(pair.Value));
                    }
                }
                return("Entry not found.");
            })
                .WithSubCommand("numericof", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required (ID).");
                }
                var id = args[0];
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    if (pair.Key == id)
                    {
                        return(pair.Value.PickupObjectId.ToString());
                    }
                }
                return("Entry not found.");
            })
                .WithSubCommand("list", (args) => {
                var s     = new StringBuilder();
                var pairs = new List <KeyValuePair <string, PickupObject> >();
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    pairs.Add(pair);
                }
                foreach (var pair in pairs)
                {
                    if (_GetPickupObjectName(pair.Value) == "NO NAME")
                    {
                        s.AppendLine($"[{pair.Key}] {_GetPickupObjectName(pair.Value)}");
                    }
                }
                pairs.Sort((x, y) => string.Compare(_GetPickupObjectName(x.Value), _GetPickupObjectName(y.Value)));
                foreach (var pair in pairs)
                {
                    if (_GetPickupObjectName(pair.Value) == "NO NAME")
                    {
                        continue;
                    }
                    s.AppendLine($"[{pair.Key}] {_GetPickupObjectName(pair.Value)}");
                }
                return(s.ToString());
            })
                .WithSubCommand("random", (args) => {
                return(ETGMod.Items.RandomKey);
            })
                );

            AddCommand("listmods", (args) => {
                var s = new StringBuilder();

                s.AppendLine("Loaded mods:");
                foreach (var mod in ETGMod.ModLoader.LoadedMods)
                {
                    _GetModInfo(s, mod);
                }
                return(s.ToString());
            });

            AddCommand("lua", (args) => {
                LuaMode = true;
                return("[entered lua mode]");
            });

            AddCommand("give", (args) => {
                LootEngine.TryGivePrefabToPlayer(ETGMod.Items[args[0]].gameObject, GameManager.Instance.PrimaryPlayer, true);
                return(args[0]);
            });

            AddGroup("dump")
            .WithSubCommand("synergy_chest", (args) => {
                System.Console.WriteLine(ObjectDumper.Dump(GameManager.Instance.RewardManager.Synergy_Chest, depth: 10));
                return("Dumped to log");
            })
            .WithSubCommand("synergies", (args) => {
                var id = 0;
                foreach (var synergy in GameManager.Instance.SynergyManager.synergies)
                {
                    if (synergy.NameKey != null)
                    {
                        var name = StringTableManager.GetSynergyString(synergy.NameKey);
                        System.Console.WriteLine($"== SYNERGY ID {id} NAME {name} ==");
                    }
                    else
                    {
                        System.Console.WriteLine($"== SYNERGY ID {id} ==");
                    }
                    System.Console.WriteLine($"  ACTIVATION STATUS: {synergy.ActivationStatus}");
                    System.Console.WriteLine($"  # OF OBJECTS REQUIRED: {synergy.NumberObjectsRequired}");
                    System.Console.WriteLine($"  ACTIVE WHEN GUN UNEQUIPPED?: {synergy.ActiveWhenGunUnequipped}");
                    System.Console.WriteLine($"  REQUIRES AT LEAST ONE GUN AND ONE ITEM?: {synergy.RequiresAtLeastOneGunAndOneItem}");
                    System.Console.WriteLine($"  MANDATORY GUNS:");
                    foreach (var itemid in synergy.MandatoryGunIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  OPTIONAL GUNS:");
                    foreach (var itemid in synergy.OptionalGunIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  MANDATORY ITEMS:");
                    foreach (var itemid in synergy.MandatoryItemIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  OPTIONAL ITEMS:");
                    foreach (var itemid in synergy.OptionalItemIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  BONUS SYNERGIES:");
                    foreach (var bonus in synergy.bonusSynergies)
                    {
                        System.Console.WriteLine($"  - {bonus}");
                    }
                    System.Console.WriteLine($"  STAT MODIFIERS:");
                    foreach (var statmod in synergy.statModifiers)
                    {
                        System.Console.WriteLine($"  - STAT: {statmod.statToBoost}");
                        System.Console.WriteLine($"    AMOUNT: {statmod.amount}");
                        System.Console.WriteLine($"    MODIFY TYPE: {statmod.modifyType}");
                        System.Console.WriteLine($"    PERSISTS ON COOP DEATH?: {statmod.PersistsOnCoopDeath}");
                        System.Console.WriteLine($"    IGNORED FOR SAVE DATA?: {statmod.ignoredForSaveData}");
                    }
                    id++;
                }
                return("Dumped to log");
            })
            .WithSubCommand("items", (args) => {
                var b  = new StringBuilder();
                var db = PickupObjectDatabase.Instance.Objects;
                for (int i = 0; i < db.Count; i++)
                {
                    PickupObject obj  = null;
                    string nameprefix = "";
                    string name       = null;
                    try {
                        obj = db[i];
                    } catch {
                        name = "[ERROR: failed getting object by index]";
                    }
                    if (obj != null)
                    {
                        try {
                            var displayname = obj.encounterTrackable.journalData.PrimaryDisplayName;
                            name            = StringTableManager.ItemTable[displayname].GetWeightedString();
                        } catch {
                            name = "[ERROR: failed getting ammonomicon name]";
                        }
                        if (name == null)
                        {
                            try {
                                name = obj.EncounterNameOrDisplayName;
                            } catch {
                                name = "[ERROR: failed getting encounter or display name]";
                            }
                        }
                    }
                    if (name == null && obj != null)
                    {
                        name = "[NULL NAME (but object is not null)]";
                    }

                    name = $"{nameprefix} {name}";

                    if (name != null)
                    {
                        b.AppendLine($"{i}: {name}");
                        _Logger.Info($"{i}: {name}");
                    }
                }
                return(b.ToString());
            });

            AddGroup("log")
            .WithSubCommand("sub", (args) => {
                if (_Subscribed)
                {
                    return("Already subscribed.");
                }
                Logger.Subscribe(_LoggerSubscriber);
                _Subscribed = true;
                return("Done.");
            })
            .WithSubCommand("unsub", (args) => {
                if (!_Subscribed)
                {
                    return("Not subscribed yet.");
                }
                Logger.Unsubscribe(_LoggerSubscriber);
                _Subscribed = false;
                return("Done.");
            })
            .WithSubCommand("level", (args) => {
                if (args.Count == 0)
                {
                    return(_LogLevel.ToString().ToLowerInvariant());
                }
                else
                {
                    switch (args[0])
                    {
                    case "debug": _LogLevel = Logger.LogLevel.Debug; break;

                    case "info": _LogLevel = Logger.LogLevel.Info; break;

                    case "warn": _LogLevel = Logger.LogLevel.Warn; break;

                    case "error": _LogLevel = Logger.LogLevel.Error; break;

                    default: throw new Exception($"Unknown log level '{args[0]}");
                    }
                    return("Done.");
                }
            });
            // test commands to dump collection
            AddGroup("texdump")
            .WithSubCommand("collection", (args) =>
            {
                if (args.Count == 0)
                {
                    return("No name specified");
                }
                else
                {
                    string collectionName = args[0];
                    Animation.Collection.Dump(collectionName);
                    return("Successfull");
                }
            });
        }
コード例 #3
0
 private void OnEnemyDamaged(float damage, bool fatal, HealthHaver enemy)
 {
     if (fatal == true && enemy.aiActor)
     {
         if (GameStatsManager.Instance.IsRainbowRun == true && mimicGuids.Contains(enemy.aiActor.EnemyGuid))
         {
             LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
             LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
             LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
         }
         else
         {
             var itemQuality = PickupObject.ItemQuality.D;
             if (enemy.aiActor.EnemyGuid == "2ebf8ef6728648089babb507dec4edb7") //BROWN CHEST MIMIC
             {
                 itemQuality = PickupObject.ItemQuality.D;
                 SpawnBonusItem(enemy, itemQuality);
             }
             else if (enemy.aiActor.EnemyGuid == "d8d651e3484f471ba8a2daa4bf535ce6") //BLUE CHEST MIMIC
             {
                 itemQuality = PickupObject.ItemQuality.C;
                 SpawnBonusItem(enemy, itemQuality);
             }
             else if (enemy.aiActor.EnemyGuid == "abfb454340294a0992f4173d6e5898a8") //GREEN CHEST MIMIC
             {
                 itemQuality = PickupObject.ItemQuality.B;
                 SpawnBonusItem(enemy, itemQuality);
             }
             else if (enemy.aiActor.EnemyGuid == "d8fd592b184b4ac9a3be217bc70912a2" || enemy.aiActor.EnemyGuid == "ac9d345575444c9a8d11b799e8719be0") //RED CHEST MIMIC & RAT CHEST MIMIC
             {
                 itemQuality = PickupObject.ItemQuality.A;
                 SpawnBonusItem(enemy, itemQuality);
             }
             else if (enemy.aiActor.EnemyGuid == "6450d20137994881aff0ddd13e3d40c8") //Black CHEST MIMIC
             {
                 itemQuality = PickupObject.ItemQuality.S;
                 SpawnBonusItem(enemy, itemQuality);
             }
             else if (enemy.aiActor.EnemyGuid == "479556d05c7c44f3b6abb3b2067fc778") // WALL MIMIC
             {
                 int randomTierSelectionNumber = UnityEngine.Random.Range(1, 100);
                 if (randomTierSelectionNumber <= 50)
                 {
                     itemQuality = PickupObject.ItemQuality.D;                                  //Make Tier D
                 }
                 else if (randomTierSelectionNumber <= 67)
                 {
                     itemQuality = PickupObject.ItemQuality.C;                                       //Make Tier C
                 }
                 else if (randomTierSelectionNumber <= 87)
                 {
                     itemQuality = PickupObject.ItemQuality.B;                                       //Make Tier B
                 }
                 else if (randomTierSelectionNumber <= 98)
                 {
                     itemQuality = PickupObject.ItemQuality.A;                                       //Make Tier A
                 }
                 else if (randomTierSelectionNumber <= 100)
                 {
                     itemQuality = PickupObject.ItemQuality.S;                                        //Make Tier S
                 }
                 SpawnBonusItem(enemy, itemQuality);
             }
             else if (enemy.aiActor.EnemyGuid == "796a7ed4ad804984859088fc91672c7f") //PEDESTAL MIMIC
             {
                 LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
                 LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
                 LootEngine.SpawnItem(PickupObjectDatabase.GetById(78).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
             }
             else if (enemy.aiActor.EnemyGuid == "9189f46c47564ed588b9108965f975c9") //DOOR LORD
             {
                 itemQuality = PickupObject.ItemQuality.S;
                 GameManager.Instance.RewardManager.SpawnTotallyRandomItem(enemy.specRigidbody.UnitCenter, itemQuality, itemQuality);
                 itemQuality = PickupObject.ItemQuality.A;
                 GameManager.Instance.RewardManager.SpawnTotallyRandomItem(enemy.specRigidbody.UnitCenter, itemQuality, itemQuality);
                 itemQuality = PickupObject.ItemQuality.B;
                 GameManager.Instance.RewardManager.SpawnTotallyRandomItem(enemy.specRigidbody.UnitCenter, itemQuality, itemQuality);
             }
         }
     }
 }
コード例 #4
0
        public new void Interact(PlayerController player)
        {
            if (this.item && this.item is HealthPickup)
            {
                if ((this.item as HealthPickup).healAmount > 0f && (this.item as HealthPickup).armorAmount <= 0 && player.healthHaver.GetCurrentHealthPercentage() >= 1f)
                {
                    return;
                }
            }
            else if (this.item && this.item is AmmoPickup && (player.CurrentGun == null || player.CurrentGun.ammo == player.CurrentGun.AdjustedMaxAmmo || !player.CurrentGun.CanGainAmmo || player.CurrentGun.InfiniteAmmo))
            {
                GameUIRoot.Instance.InformNeedsReload(player, new Vector3(player.specRigidbody.UnitCenter.x - player.transform.position.x, 1.25f, 0f), 1f, "#RELOAD_FULL");
                return;
            }
            this.LastInteractingPlayer = player;
            bool flag  = false;
            bool flag2 = true;

            if (this.ShouldSteal(player))
            {
                flag  = this.m_baseParentShop.AttemptToSteal();
                flag2 = false;
                if (!flag)
                {
                    player.DidUnstealthyAction();
                    this.m_baseParentShop.NotifyStealFailed();
                    return;
                }
            }
            if (flag2)
            {
                bool flag3 = false;
                if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.COINS)
                {
                    flag3 = (player.carriedConsumables.Currency >= this.ModifiedPrice);
                }
                else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.META_CURRENCY)
                {
                    int num2 = Mathf.RoundToInt(GameStatsManager.Instance.GetPlayerStatValue(TrackedStats.META_CURRENCY));
                    flag3 = (num2 >= this.ModifiedPrice);
                }
                else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.KEYS)
                {
                    flag3 = (player.carriedConsumables.KeyBullets >= this.ModifiedPrice);
                }
                else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.BLANKS)
                {
                    flag3 = (player.Blanks >= this.ModifiedPrice);
                }
                else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.CUSTOM)
                {
                    if (customCanBuy != null)
                    {
                        flag3 = customCanBuy(this.m_baseParentShop, player, ModifiedPrice);
                    }
                    else
                    {
                        ETGModConsole.Log("customCanBuy is sadly null please look into this!");
                    }
                }
                if (!flag3)
                {
                    AkSoundEngine.PostEvent("Play_OBJ_purchase_unable_01", base.gameObject);
                    if (this.m_parentShop != null)
                    {
                        this.m_parentShop.NotifyFailedPurchase(this);
                    }
                    if (this.m_baseParentShop != null)
                    {
                        this.m_baseParentShop.NotifyFailedPurchase(this);
                    }
                    return;
                }
            }
            if (!this.pickedUp)
            {
                this.pickedUp = !this.item.PersistsOnPurchase;
                LootEngine.GivePrefabToPlayer(this.item.gameObject, player);
                if (flag2)
                {
                    if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.COINS)
                    {
                        player.carriedConsumables.Currency -= this.ModifiedPrice;
                    }
                    else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.KEYS)
                    {
                        player.carriedConsumables.KeyBullets -= this.ModifiedPrice;
                    }
                    else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.BLANKS)
                    {
                        player.Blanks -= this.ModifiedPrice;
                    }
                    else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.META_CURRENCY)
                    {
                        int num2 = Mathf.RoundToInt(GameStatsManager.Instance.GetPlayerStatValue(TrackedStats.META_CURRENCY));
                        GameStatsManager.Instance.ClearStatValueGlobal(TrackedStats.META_CURRENCY);
                        GameStatsManager.Instance.SetStat(TrackedStats.META_CURRENCY, (float)(num2 - this.ModifiedPrice));
                    }
                    else if (this.CurrencyType == CustomShopItemController.ShopCurrencyType.CUSTOM)
                    {
                        if (removeCurrency != null)
                        {
                            removeCurrency(this.m_baseParentShop, player, ModifiedPrice);
                        }
                        else
                        {
                            ETGModConsole.Log("removeCurrency is sadly null please look into this!");
                        }
                    }
                    if (OnPurchase != null)
                    {
                        OnPurchase(player, this.item, this.ModifiedPrice);
                    }
                }
                if (this.m_baseParentShop != null)
                {
                    this.m_baseParentShop.PurchaseItem(this, !flag, true);
                }
                if (flag)
                {
                    StatModifier statModifier = new StatModifier();
                    statModifier.statToBoost = PlayerStats.StatType.Curse;
                    statModifier.amount      = 1f;
                    statModifier.modifyType  = StatModifier.ModifyMethod.ADDITIVE;
                    player.ownerlessStatModifiers.Add(statModifier);
                    player.stats.RecalculateStats(player, false, false);
                    player.HandleItemStolen(this);
                    this.m_baseParentShop.NotifyStealSucceeded();
                    player.IsThief = true;
                    GameStatsManager.Instance.RegisterStatChange(TrackedStats.MERCHANT_ITEMS_STOLEN, 1f);
                    if (this.SetsFlagOnSteal)
                    {
                        GameStatsManager.Instance.SetFlag(this.FlagToSetOnSteal, true);
                    }
                    if (OnSteal != null)
                    {
                        OnSteal(player, this.item, this.ModifiedPrice);
                    }
                }
                else
                {
                    player.HandleItemPurchased(this);
                }
                if (!this.item.PersistsOnPurchase)
                {
                    GameUIRoot.Instance.DeregisterDefaultLabel(base.transform);
                }
                AkSoundEngine.PostEvent("Play_OBJ_item_purchase_01", base.gameObject);
            }
        }
コード例 #5
0
 protected override void DoEffect(PlayerController user)
 {
     base.DoEffect(user);
     LootEngine.GivePrefabToPlayer(Gungeon.Game.Items["psm:stabiliser"].gameObject, user);
 }
コード例 #6
0
            public static IEnumerator SpewGun(PlayerController user)
            {
                yield return(new WaitForSeconds(0.5f));

                PlayerController lastOwner = user;
                float            num       = UnityEngine.Random.Range(0f, 1f);
                bool             flag      = (double)num < 0.7;
                bool             flag2     = flag;

                if (flag2)
                {
                    PickupObject.ItemQuality itemQuality          = PickupObject.ItemQuality.D;
                    PickupObject             itemOfTypeAndQuality = LootEngine.GetItemOfTypeAndQuality <PickupObject>(itemQuality, GameManager.Instance.RewardManager.GunsLootTable, false);
                    bool flag3 = itemOfTypeAndQuality;
                    if (flag3)
                    {
                        LootEngine.SpawnItem(itemOfTypeAndQuality.gameObject, lastOwner.CenterPosition, Vector2.up, 1f, true, true, false);
                    }
                }
                else
                {
                    bool flag4 = (double)num < 0.85;
                    bool flag5 = flag4;
                    if (flag5)
                    {
                        PickupObject.ItemQuality itemQuality2          = PickupObject.ItemQuality.C;
                        PickupObject             itemOfTypeAndQuality2 = LootEngine.GetItemOfTypeAndQuality <PickupObject>(itemQuality2, GameManager.Instance.RewardManager.GunsLootTable, false);
                        bool flag6 = itemOfTypeAndQuality2;
                        if (flag6)
                        {
                            LootEngine.SpawnItem(itemOfTypeAndQuality2.gameObject, lastOwner.CenterPosition, Vector2.up, 1f, true, true, false);
                        }
                    }
                    else
                    {
                        bool flag7 = (double)num < 0.95;
                        bool flag8 = flag7;
                        if (flag8)
                        {
                            PickupObject.ItemQuality itemQuality3          = PickupObject.ItemQuality.B;
                            PickupObject             itemOfTypeAndQuality3 = LootEngine.GetItemOfTypeAndQuality <PickupObject>(itemQuality3, GameManager.Instance.RewardManager.GunsLootTable, false);
                            bool flag9 = itemOfTypeAndQuality3;
                            if (flag9)
                            {
                                LootEngine.SpawnItem(itemOfTypeAndQuality3.gameObject, lastOwner.CenterPosition, Vector2.up, 1f, true, true, false);
                            }
                        }
                        else
                        {
                            bool flag10 = (double)num < 0.98;
                            bool flag11 = flag10;
                            if (flag11)
                            {
                                PickupObject.ItemQuality itemQuality4          = PickupObject.ItemQuality.A;
                                PickupObject             itemOfTypeAndQuality4 = LootEngine.GetItemOfTypeAndQuality <PickupObject>(itemQuality4, GameManager.Instance.RewardManager.GunsLootTable, false);
                                bool flag12 = itemOfTypeAndQuality4;
                                if (flag12)
                                {
                                    LootEngine.SpawnItem(itemOfTypeAndQuality4.gameObject, lastOwner.CenterPosition, Vector2.up, 1f, true, true, false);
                                }
                            }
                            else
                            {
                                PickupObject.ItemQuality itemQuality5          = PickupObject.ItemQuality.S;
                                PickupObject             itemOfTypeAndQuality5 = LootEngine.GetItemOfTypeAndQuality <PickupObject>(itemQuality5, GameManager.Instance.RewardManager.GunsLootTable, false);
                                bool flag13 = itemOfTypeAndQuality5;
                                if (flag13)
                                {
                                    LootEngine.SpawnItem(itemOfTypeAndQuality5.gameObject, lastOwner.CenterPosition, Vector2.up, 1f, true, true, false);
                                }
                            }
                        }
                    }
                }
                yield break;
            }
コード例 #7
0
        protected override void DoEffect(PlayerController user)
        {
            IPlayerInteractable nearestInteractable = user.CurrentRoom.GetNearestInteractable(user.CenterPosition, 1f, user);

            if (!(nearestInteractable is Chest))
            {
                return;
            }

            AkSoundEngine.PostEvent("Play_ENM_electric_charge_01", user.gameObject);

            Chest rerollChest = nearestInteractable as Chest;
            int   selected    = UnityEngine.Random.Range(1, 15);

            ETGModConsole.Log(selected.ToString());

            VFXToolbox.GlitchScreenForSeconds(1.5f);


            switch (selected)
            {
            case 1:     //Blow up chest
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    Exploder.DoDefaultExplosion(rerollChest.specRigidbody.UnitCenter, Vector2.zero);
                    if (rerollChest.IsMimic)
                    {
                        OMITBReflectionHelpers.ReflectSetField <bool>(typeof(Chest), "m_isMimic", false, rerollChest);
                    }
                    rerollChest.majorBreakable.Break(Vector2.zero);
                    if (rerollChest.GetChestTier() == ChestToolbox.ChestTier.RAT)
                    {
                        UnityEngine.Object.Destroy(rerollChest.gameObject);
                    }
                }
                break;

            case 2:     //Open Chest
                rerollChest.ForceOpen(user);
                break;

            case 3:     //Break Lock
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    if (rerollChest.IsLocked)
                    {
                        rerollChest.BreakLock();
                    }
                    else
                    {
                        rerollChest.majorBreakable.Break(Vector2.zero);
                    }
                }
                break;

            case 4:     //Duplicate Chest
                DupeChest(rerollChest, user);
                break;

            case 5:     //Turn into mimic
                if (!rerollChest.IsMimic)
                {
                    rerollChest.overrideMimicChance = 100; rerollChest.MaybeBecomeMimic();
                }
                rerollChest.ForceOpen(user);
                break;

            case 6:     //Englitch
                List <GlobalDungeonData.ValidTilesets> bannedGlitchFloors = new List <GlobalDungeonData.ValidTilesets>()
                {
                    GlobalDungeonData.ValidTilesets.CATACOMBGEON,
                    GlobalDungeonData.ValidTilesets.HELLGEON,
                    GlobalDungeonData.ValidTilesets.OFFICEGEON,
                    GlobalDungeonData.ValidTilesets.FORGEGEON,
                };
                if (!bannedGlitchFloors.Contains(GameManager.Instance.Dungeon.tileIndices.tilesetId))
                {
                    rerollChest.BecomeGlitchChest();
                }
                else
                {
                    if (!rerollChest.IsMimic)
                    {
                        rerollChest.MaybeBecomeMimic();
                    }
                    rerollChest.ForceOpen(user);
                }
                break;

            case 7:     //Enrainbow
                if (UnityEngine.Random.value <= 0.65f)
                {
                    UpgradeChest(rerollChest, user);
                }
                else
                {
                    rerollChest.BecomeRainbowChest();
                }
                break;

            case 8:     //Reroll
                RerollChest(rerollChest, user);
                break;

            case 9:     //Turn into pickups
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        LootEngine.SpawnItem(PickupObjectDatabase.GetById(BraveUtility.RandomElement(BabyGoodChanceKin.lootIDlist)).gameObject, rerollChest.sprite.WorldCenter, Vector2.zero, 0);
                    }
                    LootEngine.SpawnCurrency(rerollChest.sprite.WorldCenter, UnityEngine.Random.Range(5, 11));
                    user.CurrentRoom.DeregisterInteractable(rerollChest);
                    rerollChest.DeregisterChestOnMinimap();
                    UnityEngine.Object.Destroy(rerollChest.gameObject);
                }
                break;

            case 10:     //Fuse
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    var type = typeof(Chest);
                    var func = type.GetMethod("TriggerCountdownTimer", BindingFlags.Instance | BindingFlags.NonPublic);
                    var ret  = func.Invoke(rerollChest, null);
                    AkSoundEngine.PostEvent("Play_OBJ_fuse_loop_01", rerollChest.gameObject);
                }
                break;

            case 11:     //Unlock
                if (rerollChest.IsLocked)
                {
                    rerollChest.ForceUnlock();
                }
                else
                {
                    rerollChest.ForceOpen(user);
                }
                break;

            case 12:     //Enjam
                rerollChest.gameObject.GetOrAddComponent <JammedChestBehav>();
                break;

            case 13:     //TeleportChest
                TeleportChest(rerollChest, user);
                break;

            case 14:     //Drill
                FauxDrill(rerollChest, user);
                break;
            }
        }
コード例 #8
0
        public static void OnOpen(Action <Chest, PlayerController> orig, Chest self, PlayerController player)
        {
            if (self.breakAnimName.Contains("black"))
            {
                AdvancedGameStatsManager.Instance.SetFlag(CustomDungeonFlags.CUSTOMFLAG_OPENED_BLACK_CHEST, true);
            }
            if (ETGMod.Databases.Items["Suspiscious Strongbox"] != null)
            {
                bool hasSynergy = player.PlayerHasActiveSynergy("#BOWLERS_APPROVAL");
                if (hasSynergy && GameStatsManager.Instance.IsRainbowRun && !self.IsRainbowChest)
                {
                    List <PickupObject> d = self.PredictContents(player);
                    List <int>          b = new List <int>();
                    foreach (PickupObject po in d)
                    {
                        b.Add(po.PickupObjectId);
                    }
                    self.BecomeRainbowChest();
                    self.forceContentIds = b;
                }
            }
            bool hasCloversFlowersSynergy = player.PlayerHasActiveSynergy("#CLOVERS_FLOWERS");

            if (hasCloversFlowersSynergy)
            {
                self.PredictContents(player);
                self.contents.Add(UnityEngine.Random.value < 0.5f ? PickupObjectDatabase.GetById(78) : PickupObjectDatabase.GetById(600));
            }
            foreach (PassiveItem passive in player.passiveItems)
            {
                if (passive is KeyOfChaosItem)
                {
                    if (!self.IsLocked && !self.IsLockBroken && !self.IsSealed)
                    {
                        if (player.PlayerHasActiveSynergy("#KEY_OF_BATTLE"))
                        {
                            player.ownerlessStatModifiers.Add(Toolbox.SetupStatModifier(PlayerStats.StatType.Damage, 1.75f, StatModifier.ModifyMethod.MULTIPLICATIVE, true));
                        }
                        List <PickupObject> d = self.PredictContents(player);
                        if (d != null)
                        {
                            List <int> contentIds = new List <int>();
                            foreach (PickupObject po in d)
                            {
                                PickupObject.ItemQuality quality = po.quality;
                                float value       = UnityEngine.Random.value;
                                bool  doubleChaos = player.PlayerHasActiveSynergy("#THERE_IS_ONLY_CHAOS") && UnityEngine.Random.value < 0.5f;
                                bool  dropJunk    = false;
                                bool  isChaosJunk = false;
                                if (value < 0.25f)
                                {
                                    if (po.quality != ItemQuality.SPECIAL && po.quality != ItemQuality.EXCLUDED && po.quality != ItemQuality.COMMON)
                                    {
                                        if ((po.quality == ItemQuality.D && !doubleChaos) || (po.quality == ItemQuality.C && doubleChaos))
                                        {
                                            dropJunk = true;
                                        }
                                        else if (po.quality == ItemQuality.D && doubleChaos)
                                        {
                                            dropJunk    = true;
                                            isChaosJunk = true;
                                        }
                                        else
                                        {
                                            quality -= doubleChaos ? 2 : 1;
                                        }
                                    }
                                }
                                else if (value < 0.5f)
                                {
                                    if (po.quality != ItemQuality.SPECIAL && po.quality != ItemQuality.EXCLUDED && po.quality != ItemQuality.COMMON)
                                    {
                                        if ((po.quality == ItemQuality.S && !doubleChaos) || (po.quality == ItemQuality.A && doubleChaos))
                                        {
                                            contentIds.Add(LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.D, UnityEngine.Random.value < 0.5f ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable).PickupObjectId);
                                        }
                                        if (po.quality == ItemQuality.S && doubleChaos)
                                        {
                                            contentIds.Add(LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.C, UnityEngine.Random.value < 0.5f ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable).PickupObjectId);
                                        }
                                        else
                                        {
                                            quality += doubleChaos ? 2 : 1;
                                        }
                                    }
                                }
                                if (!dropJunk)
                                {
                                    PickupObject item;
                                    if (quality != ItemQuality.COMMON && quality != ItemQuality.EXCLUDED && quality != ItemQuality.SPECIAL)
                                    {
                                        item = LootEngine.GetItemOfTypeAndQuality <PickupObject>(quality, UnityEngine.Random.value < 0.5f ? GameManager.Instance.RewardManager.GunsLootTable : GameManager.Instance.RewardManager.ItemsLootTable);
                                    }
                                    else
                                    {
                                        item = po;
                                    }
                                    contentIds.Add(item.PickupObjectId);
                                }
                                else
                                {
                                    contentIds.Add(isChaosJunk ? SpecialItemIds.PointlessJunk : GlobalItemIds.Junk);
                                }
                            }
                            self.contents        = null;
                            self.forceContentIds = contentIds;
                            self.ChestType       = (Chest.GeneralChestType)UnityEngine.Random.Range(1, 2);
                        }
                    }
                }
            }
            orig(self, player);
        }
コード例 #9
0
            // Token: 0x06008129 RID: 33065 RVA: 0x00333610 File Offset: 0x00331810
            private IEnumerator HandleTeleportToPoint(Vector2 targetPoint, GameObject departureVFXPrefab, GameObject arrivalVFX1Prefab, GameObject arrivalVFX2Prefab, PlayerController teleporter)
            {
                teleporter.healthHaver.IsVulnerable = false;
                CameraController cameraController = GameManager.Instance.MainCameraController;
                Vector2          offsetVector     = cameraController.transform.position - teleporter.transform.position;

                offsetVector -= cameraController.GetAimContribution();
                Minimap.Instance.ToggleMinimap(false, false);
                cameraController.SetManualControl(true, false);
                cameraController.OverridePosition = cameraController.transform.position;
                teleporter.CurrentInputState      = PlayerInputState.NoInput;
                yield return(new WaitForSeconds(0.1f));

                teleporter.ToggleRenderer(false, "arbitrary teleporter.");
                teleporter.ToggleGunRenderers(false, "arbitrary teleporter.");
                teleporter.ToggleHandRenderers(false, "arbitrary teleporter.");
                if (departureVFXPrefab != null)
                {
                    GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(departureVFXPrefab);
                    gameObject.GetComponent <tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(teleporter.specRigidbody.UnitBottomCenter + new Vector2(0f, -0.5f), tk2dBaseSprite.Anchor.LowerCenter);
                    gameObject.transform.position = gameObject.transform.position.Quantize(0.0625f);
                    gameObject.GetComponent <tk2dBaseSprite>().UpdateZDepth();
                }
                yield return(new WaitForSeconds(0.4f));

                Pixelator.Instance.FadeToBlack(0.1f, false, 0f);
                yield return(new WaitForSeconds(0.1f));

                teleporter.specRigidbody.Position = new Position(targetPoint);
                if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER)
                {
                    cameraController.OverridePosition = cameraController.GetIdealCameraPosition();
                }
                else
                {
                    cameraController.OverridePosition = (targetPoint + offsetVector).ToVector3ZUp(0f);
                }
                Pixelator.Instance.MarkOcclusionDirty();
                if (arrivalVFX1Prefab != null)
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(arrivalVFX1Prefab);
                    gameObject2.transform.position = targetPoint;
                    gameObject2.transform.position = gameObject2.transform.position.Quantize(0.0625f);
                }
                Pixelator.Instance.FadeToBlack(0.1f, true, 0f);
                yield return(null);

                cameraController.SetManualControl(false, true);
                yield return(new WaitForSeconds(0.75f));

                if (arrivalVFX2Prefab != null)
                {
                    GameObject gameObject3 = UnityEngine.Object.Instantiate <GameObject>(arrivalVFX2Prefab);
                    gameObject3.GetComponent <tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(teleporter.specRigidbody.UnitBottomCenter + new Vector2(0f, -0.5f), tk2dBaseSprite.Anchor.LowerCenter);
                    gameObject3.transform.position = gameObject3.transform.position.Quantize(0.0625f);
                    gameObject3.GetComponent <tk2dBaseSprite>().UpdateZDepth();
                }
                teleporter.DoVibration(Vibration.Time.Normal, Vibration.Strength.Medium);
                yield return(new WaitForSeconds(0.25f));

                LootEngine.DoDefaultPurplePoof(teleporter.sprite.WorldBottomCenter);
                teleporter.ToggleRenderer(true, "arbitrary teleporter.");
                teleporter.ToggleGunRenderers(true, "arbitrary teleporter.");
                teleporter.ToggleHandRenderers(true, "arbitrary teleporter.");
                PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(teleporter.specRigidbody, null, false);
                teleporter.CurrentInputState        = PlayerInputState.AllInput;
                teleporter.healthHaver.IsVulnerable = true;
                yield break;
            }
コード例 #10
0
ファイル: Jankan.cs プロジェクト: Lichton/Fallen-Items
 protected override void DoEffect(PlayerController user)
 {
     LootEngine.SpawnItem(Gungeon.Game.Items["junk"].gameObject, user.specRigidbody.UnitCenter, Vector2.left, 1.0f, false, true, false);
 }
コード例 #11
0
        public static void ArtifactsOnLoad(Action <PlayerController, float> orig, PlayerController self, float invisibleDelay)
        {
            orig(self, invisibleDelay);
            PlayerController player = (GameManager.Instance.PrimaryPlayer);
            //BunnyModule.Log("GIVE AN ARTIFACT YOU F**K");
            bool sonoclone = player.HasPickupID(Game.Items["bny:attraction"].PickupObjectId) || player.HasPickupID(Game.Items["bny:avarice"].PickupObjectId) || player.HasPickupID(Game.Items["bny:bolster"].PickupObjectId) || player.HasPickupID(Game.Items["bny:daze"].PickupObjectId) || player.HasPickupID(Game.Items["bny:fodder"].PickupObjectId) || player.HasPickupID(Game.Items["bny:frailty"].PickupObjectId) || player.HasPickupID(Game.Items["bny:glass"].PickupObjectId) || player.HasPickupID(Game.Items["bny:megalomania"].PickupObjectId) || player.HasPickupID(Game.Items["bny:prey"].PickupObjectId) || player.HasPickupID(Game.Items["bny:revenge"].PickupObjectId) || player.HasPickupID(Game.Items["bny:sacrifice"].PickupObjectId) || player.HasPickupID(Game.Items["bny:enigma"].PickupObjectId);

            if (!sonoclone)
            {
                if (ArtifactMonger.RandomArtifactMode)
                {
                    //BunnyModule.Log("GIVE AN ARTIFACT YOU F**K");
                    ArtifactMonger.Char = UnityEngine.Random.Range(1, 13);
                    switch (ArtifactMonger.Char)
                    {
                    case 1:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Attraction"].gameObject, player, true);
                        break;

                    case 2:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Revenge"].gameObject, player, true);
                        break;

                    case 3:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Glass"].gameObject, player, true);
                        break;

                    case 4:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Avarice"].gameObject, player, true);
                        break;

                    case 5:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Daze"].gameObject, player, true);
                        break;

                    case 6:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Prey"].gameObject, player, true);
                        break;

                    case 7:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Megalomania"].gameObject, player, true);
                        break;

                    case 8:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Fodder"].gameObject, player, true);
                        break;

                    case 9:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Bolster"].gameObject, player, true);
                        break;

                    case 10:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Frailty"].gameObject, player, true);
                        break;

                    case 11:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Sacrifice"].gameObject, player, true);
                        break;

                    case 12:
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Enigma"].gameObject, player, true);
                        break;
                    }
                }
                if (DeicideShrine.AllArtifactMode)
                {
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Attraction"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Revenge"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Glass"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Avarice"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Daze"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Prey"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Megalomania"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Fodder"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Bolster"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Frailty"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Sacrifice"].gameObject, player, true);
                    LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Enigma"].gameObject, player, true);
                }
                if (Commands.CustomLoadoutArtifactsEnabled)
                {
                    if (Commands.AttractionEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Attraction"].gameObject, player, true);
                    }
                    if (Commands.AvariceEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Avarice"].gameObject, player, true);
                    }
                    if (Commands.BolsterEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Bolster"].gameObject, player, true);
                    }
                    if (Commands.DazeEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Daze"].gameObject, player, true);
                    }
                    if (Commands.FodderEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Fodder"].gameObject, player, true);
                    }
                    if (Commands.FrailtyEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Frailty"].gameObject, player, true);
                    }
                    if (Commands.GlassEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Glass"].gameObject, player, true);
                    }
                    if (Commands.MegalomaniaEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Megalomania"].gameObject, player, true);
                    }
                    if (Commands.PreyEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Prey"].gameObject, player, true);
                    }
                    if (Commands.RevengeEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Revenge"].gameObject, player, true);
                    }
                    if (Commands.SacrificeEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Sacrifice"].gameObject, player, true);
                    }
                    if (Commands.EnigmaEnabled)
                    {
                        LootEngine.TryGivePrefabToPlayer(ETGMod.Databases.Items["Enigma"].gameObject, player, true);
                    }
                }
            }
        }
コード例 #12
0
        private void ModifyIncomingDamage(HealthHaver source, HealthHaver.ModifyDamageEventArgs args)
        {
            PlayableCharacters characterIdentity = Owner.characterIdentity;

            if (characterIdentity != PlayableCharacters.Robot)
            {
                if (source.GetCurrentHealth() <= 0.5 && source.Armor <= 0)
                {
                    if (Owner.carriedConsumables.Currency > 0)
                    {
                        int procVariable = UnityEngine.Random.Range(1, 101);

                        if (Owner.carriedConsumables.Currency > 100)
                        {
                            if (Owner.HasPickupID(93) || Owner.HasPickupID(321) || Owner.HasPickupID(641) || Owner.HasPickupID(53) || Owner.HasPickupID(231))
                            {
                                Owner.carriedConsumables.Currency = UnityEngine.Random.Range(1, Owner.carriedConsumables.Currency);
                            }
                            else
                            {
                                Owner.carriedConsumables.Currency = 0;
                            }
                            args.ModifiedDamage = 0f;
                            Owner.healthHaver.ApplyHealing(0.5f);
                            Owner.healthHaver.ApplyDamage(0.5f, Vector2.zero, "GoldenArmourBug(PlsReport)", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                            if (Owner.HasPickupID(538))
                            {
                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                            }
                        }
                        else
                        {
                            if (Owner.carriedConsumables.Currency >= procVariable)
                            {
                                //Synergy
                                if (Owner.HasPickupID(93) || Owner.HasPickupID(321) || Owner.HasPickupID(641) || Owner.HasPickupID(53) || Owner.HasPickupID(231))
                                {
                                    Owner.carriedConsumables.Currency = procVariable;
                                }
                                else
                                {
                                    Owner.carriedConsumables.Currency = 0;
                                }
                                args.ModifiedDamage = 0f;
                                Owner.healthHaver.ApplyHealing(0.5f);
                                Owner.healthHaver.ApplyDamage(0.5f, Vector2.zero, "GoldenArmourBug(PlsReport)", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                if (Owner.HasPickupID(538))
                                {
                                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                if (source.Armor <= 1)
                {
                    if (Owner.carriedConsumables.Currency > 0)
                    {
                        int procVariable = UnityEngine.Random.Range(1, 101);
                        if (Owner.carriedConsumables.Currency > 100)
                        {
                            if (Owner.HasPickupID(93) || Owner.HasPickupID(321) || Owner.HasPickupID(641) || Owner.HasPickupID(53) || Owner.HasPickupID(231))
                            {
                                Owner.carriedConsumables.Currency = UnityEngine.Random.Range(1, Owner.carriedConsumables.Currency);
                            }
                            else
                            {
                                Owner.carriedConsumables.Currency = 0;
                            }
                            args.ModifiedDamage      = 0f;
                            Owner.healthHaver.Armor += 1;
                            Owner.healthHaver.ApplyDamage(0.5f, Vector2.zero, "GoldenArmourBug(PlsReport)", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                            if (Owner.HasPickupID(538))
                            {
                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                            }
                        }
                        else
                        {
                            if (Owner.carriedConsumables.Currency >= procVariable)
                            {
                                //Synergy with Old Goldie, Gold Ammolet, Gold Junk, AU Gun, Gilded Hydra
                                if (Owner.HasPickupID(93) || Owner.HasPickupID(321) || Owner.HasPickupID(641) || Owner.HasPickupID(53) || Owner.HasPickupID(231))
                                {
                                    Owner.carriedConsumables.Currency = procVariable;
                                }
                                else
                                {
                                    Owner.carriedConsumables.Currency = 0;
                                }
                                args.ModifiedDamage      = 0f;
                                Owner.healthHaver.Armor += 1;
                                Owner.healthHaver.ApplyDamage(0.5f, Vector2.zero, "GoldenArmourBug(PlsReport)", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                if (Owner.HasPickupID(538))
                                {
                                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #13
0
        private void HandleRandomEffect(PlayerController player)
        {
            if (m_PickedUp | AllowedEffects == null | AllowedEffects.Count <= 0)
            {
                return;
            }

            ExpandShaders.Instance.GlitchScreenForDuration();

            AllowedEffects = AllowedEffects.Shuffle();

            m_SelectedEffect = BraveUtility.RandomElement(AllowedEffects);

            if (m_SelectedEffect == ItemEffectType.ArmorUp)
            {
                player.healthHaver.Armor += 10f;
            }
            else if (m_SelectedEffect == ItemEffectType.BigCash)
            {
                player.carriedConsumables.Currency = 999;
            }
            else if (m_SelectedEffect == ItemEffectType.ManyKeys)
            {
                player.carriedConsumables.KeyBullets = 999;
            }
            else if (m_SelectedEffect == ItemEffectType.BlanksRUS)
            {
                PickupObject blankPickup = PickupObjectDatabase.GetById(224);
                for (int i = 0; i < UnityEngine.Random.Range(5, 10); i++)
                {
                    if (blankPickup)
                    {
                        LootEngine.GivePrefabToPlayer(blankPickup.gameObject, player);
                    }
                }
            }
            else if (m_SelectedEffect == ItemEffectType.HealthPak)
            {
                if (player.characterIdentity != PlayableCharacters.Robot)
                {
                    StatModifier healthUp = new StatModifier()
                    {
                        statToBoost   = PlayerStats.StatType.Health,
                        amount        = UnityEngine.Random.Range(4, 6),
                        modifyType    = StatModifier.ModifyMethod.ADDITIVE,
                        isMeatBunBuff = false,
                    };
                    player.ownerlessStatModifiers.Add(healthUp);
                    player.stats.RecalculateStats(player, false, false);
                }
                else
                {
                    player.healthHaver.Armor += UnityEngine.Random.Range(4, 6);
                }
            }
            else if (m_SelectedEffect == ItemEffectType.DrStone)
            {
                PickupObject glassStone = PickupObjectDatabase.GetById(565);
                for (int i = 0; i < UnityEngine.Random.Range(8, 12); i++)
                {
                    if (glassStone)
                    {
                        LootEngine.GivePrefabToPlayer(glassStone.gameObject, player);
                    }
                }
            }
            else if (m_SelectedEffect == ItemEffectType.MuchAmmo)
            {
                StatModifier ManyBullets = new StatModifier()
                {
                    statToBoost   = PlayerStats.StatType.AmmoCapacityMultiplier,
                    amount        = UnityEngine.Random.Range(1.5f, 3),
                    modifyType    = StatModifier.ModifyMethod.MULTIPLICATIVE,
                    isMeatBunBuff = false,
                };
                player.ownerlessStatModifiers.Add(ManyBullets);
                player.stats.RecalculateStats(player, false, false);
            }
            return;
        }
コード例 #14
0
 protected override void DoEffect(PlayerController user)
 {
     AkSoundEngine.PostEvent("Play_OBJ_heart_heal_01", user.gameObject);
     user.PlayEffectOnActor((PickupObjectDatabase.GetById(73).GetComponent <HealthPickup>().healVFX), Vector3.zero, true, false, false);
     if (user.characterIdentity == PlayableCharacters.Robot)
     {
         if (user.PlayerHasActiveSynergy("Apple A Day"))
         {
             LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
         }
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
         if (user.PlayerHasActiveSynergy("Golden Apple"))
         {
             LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
             LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
             LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
         }
     }
     else
     {
         if (user.PlayerHasActiveSynergy("Golden Apple"))
         {
             user.healthHaver.ApplyHealing(100000000000000f);
         }
         else if (user.PlayerHasActiveSynergy("Apple A Day"))
         {
             user.healthHaver.ApplyHealing(3f);
         }
         else
         {
             user.healthHaver.ApplyHealing(1.5f);
         }
     }
     if (user.PlayerHasActiveSynergy("Golden Apple"))
     {
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(GoldenAppleCore.GoldenAppleCoreID).gameObject, user);
         GoldenAppleEffectHandler handler = ETGModMainBehaviour.Instance.gameObject.AddComponent <GoldenAppleEffectHandler>();
         handler.timer  = 60;
         handler.target = user;
     }
     else
     {
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(AppleCore.AppleCoreID).gameObject, user);
     }
     foreach (PassiveItem item in user.passiveItems)
     {
         if (item.PickupObjectId == AppleCore.AppleCoreID || item.PickupObjectId == GoldenAppleCore.GoldenAppleCoreID)
         {
             AppleCore       core     = item.GetComponent <AppleCore>();
             GoldenAppleCore goldcore = item.GetComponent <GoldenAppleCore>();
             if (user.PlayerHasActiveSynergy("Newton"))
             {
                 if (core != null)
                 {
                     core.givesFlight = true;
                 }
                 if (goldcore != null)
                 {
                     goldcore.givesFlight = true;
                 }
             }
         }
     }
 }
コード例 #15
0
ファイル: MimicSkin.cs プロジェクト: blazeykat/prismatism
        private void OnEnemyDamaged(float damage, bool fatal, HealthHaver enemy)
        {
            if (enemy.specRigidbody != null && enemy.aiActor != null && base.Owner != null)
            {
                PlayerController player = base.Owner;
                PickupObject     ItemofqualityandtypeD   = LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.D, GameManager.Instance.RewardManager.ItemsLootTable, false);
                PickupObject     ItemofqualityandtypeC   = LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.C, GameManager.Instance.RewardManager.ItemsLootTable, false);
                PickupObject     ItemofqualityandtypeB   = LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.B, GameManager.Instance.RewardManager.ItemsLootTable, false);
                PickupObject     ItemofqualityandtypeA   = LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.A, GameManager.Instance.RewardManager.ItemsLootTable, false);
                PickupObject     ItemofqualityandtypeS   = LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.S, GameManager.Instance.RewardManager.ItemsLootTable, false);
                PickupObject     ItemofqualityandtypeAny = LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.B, GameManager.Instance.RewardManager.ItemsLootTable, true);
                bool             flag = (enemy.aiActor.IsMimicEnemy);
                if (flag && fatal && !GameStatsManager.Instance.IsRainbowRun)
                {
                    switch (enemy.aiActor.EnemyGuid)
                    {
                    case "2ebf8ef6728648089babb507dec4edb7":
                        LootEngine.SpawnItem(ItemofqualityandtypeD.gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        break;

                    case "d8d651e3484f471ba8a2daa4bf535ce6":
                        LootEngine.SpawnItem(ItemofqualityandtypeC.gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        break;

                    case "abfb454340294a0992f4173d6e5898a8":
                        LootEngine.SpawnItem(ItemofqualityandtypeB.gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        break;

                    case "d8fd592b184b4ac9a3be217bc70912a2":
                        LootEngine.SpawnItem(ItemofqualityandtypeA.gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        break;

                    case "6450d20137994881aff0ddd13e3d40c8":
                        LootEngine.SpawnItem(ItemofqualityandtypeS.gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        break;

                    default:
                        LootEngine.SpawnItem(ItemofqualityandtypeAny.gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        break;
                    }
                    if (player.HasPickupID(293))
                    {
                        if (flag)
                        {
                            LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
                        }
                    }
                    if (this.doesNNInstalled != true)
                    {
                        try
                        {
                            if (player.HasMTGConsoleID("nn:book_of_mimic_anatomy"))
                            {
                                if (flag)
                                {
                                    LootEngine.SpawnItem(PickupObjectDatabase.GetById(120).gameObject, enemy.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
                                }
                            }
                        }
                        catch
                        {
                            this.doesNNInstalled = true;
                        }
                    }
                }
            }
        }
コード例 #16
0
 public static void ammoPickupHookMethod(Action <AmmoPickup, PlayerController> orig, AmmoPickup self, PlayerController player)
 {
     if (player.CurrentGun && player.CurrentGun.PickupObjectId == Blankannon.BlankannonId)
     {
         if (player.CurrentGun.CurrentAmmo == player.CurrentGun.AdjustedMaxAmmo)
         {
             HandleFuckedUpGunAmmoPickup(self, player);
         }
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(224).gameObject, player);
     }
     orig(self, player);
     if (player.HasPickupID(MengerAmmoBox.MengerAmmoBoxID))
     {
         if (self.mode == AmmoPickup.AmmoPickupMode.FULL_AMMO)
         {
             for (int i = 0; i < player.inventory.AllGuns.Count; i++)
             {
                 if (player.inventory.AllGuns[i] && player.CurrentGun != player.inventory.AllGuns[i])
                 {
                     player.inventory.AllGuns[i].GainAmmo(Mathf.FloorToInt((float)player.inventory.AllGuns[i].AdjustedMaxAmmo * 0.2f));
                 }
             }
             player.CurrentGun.ForceImmediateReload(false);
             if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER)
             {
                 PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(player);
                 if (!otherPlayer.IsGhost)
                 {
                     for (int j = 0; j < otherPlayer.inventory.AllGuns.Count; j++)
                     {
                         if (otherPlayer.inventory.AllGuns[j])
                         {
                             otherPlayer.inventory.AllGuns[j].GainAmmo(Mathf.FloorToInt((float)otherPlayer.inventory.AllGuns[j].AdjustedMaxAmmo * 0.2f));
                         }
                     }
                     otherPlayer.CurrentGun.ForceImmediateReload(false);
                 }
             }
         }
         else if (self.mode == AmmoPickup.AmmoPickupMode.SPREAD_AMMO)
         {
             if (player.CurrentGun != null && player.CurrentGun.CanGainAmmo)
             {
                 player.CurrentGun.GainAmmo(player.CurrentGun.AdjustedMaxAmmo);
                 player.CurrentGun.ForceImmediateReload(false);
             }
         }
     }
     if (player.HasPickupID(BloodyAmmo.BloodyAmmoID))
     {
         int bloodyAmount = player.GetNumberOfItemInInventory(BloodyAmmo.BloodyAmmoID);
         for (int i = 0; i < bloodyAmount; i++)
         {
             player.healthHaver.ApplyHealing(0.5f);
             if (player.characterIdentity == PlayableCharacters.Robot)
             {
                 LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, player);
             }
         }
     }
 }
コード例 #17
0
        private IEnumerator HandleSoldItem(PickupObject targetItem)
        {
            if (!targetItem)
            {
                m_currentlySellingAnItem = false; yield break;
            }
            while (m_currentlySellingAnItem)
            {
                yield return(null);
            }
            m_currentlySellingAnItem = true;
            targetItem.IsBeingSold   = true;
            float magnitude = (targetItem.sprite.WorldCenter - specRigidbody.UnitCenter).magnitude;

            if (!targetItem.sprite || magnitude > 1.8f)
            {
                targetItem.IsBeingSold   = false;
                m_currentlySellingAnItem = false;
                yield break;
            }
            IPlayerInteractable ixable = null;

            if (targetItem is PassiveItem)
            {
                PassiveItem passiveItem = targetItem as PassiveItem;
                passiveItem.GetRidOfMinimapIcon();
                ixable = (targetItem as PassiveItem);
            }
            else if (targetItem is Gun)
            {
                Gun gun = targetItem as Gun;
                gun.GetRidOfMinimapIcon();
                ixable = (targetItem as Gun);
            }
            else if (targetItem is PlayerItem)
            {
                PlayerItem playerItem = targetItem as PlayerItem;
                playerItem.GetRidOfMinimapIcon();
                ixable = (targetItem as PlayerItem);
            }
            if (ixable != null)
            {
                RoomHandler.unassignedInteractableObjects.Remove(ixable);
                GameManager.Instance.PrimaryPlayer.RemoveBrokenInteractable(ixable);
            }
            float          elapsed      = 0f;
            float          duration     = 0.5f;
            Vector3        startPos     = targetItem.transform.position;
            Vector3        finalOffset  = Vector3.zero;
            tk2dBaseSprite targetSprite = targetItem.GetComponentInChildren <tk2dBaseSprite>();

            if (targetSprite)
            {
                finalOffset = targetSprite.GetBounds().extents;
            }
            while (elapsed < duration)
            {
                elapsed += BraveTime.DeltaTime;
                if (!targetItem || !targetItem.transform)
                {
                    m_currentlySellingAnItem = false; yield break;
                }
                targetItem.transform.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.01f, 0.01f, 1f), elapsed / duration);
                targetItem.transform.position   = Vector3.Lerp(startPos, startPos + new Vector3(finalOffset.x, 0f, 0f), elapsed / duration);
                yield return(null);
            }
            if (!targetItem || !targetItem.transform)
            {
                m_currentlySellingAnItem = false; yield break;
            }
            SellPitDweller.SendPlaymakerEvent("playerSoldSomething");
            int sellPrice = Mathf.Clamp(Mathf.CeilToInt(targetItem.PurchasePrice * SellValueModifier), 0, 200);

            if (targetItem.quality == PickupObject.ItemQuality.SPECIAL || targetItem.quality == PickupObject.ItemQuality.EXCLUDED)
            {
                sellPrice = 3;
            }
            LootEngine.SpawnCurrency(targetItem.sprite.WorldCenter, sellPrice, false);
            m_thingsSold++;
            if (targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Castle || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Catacombs || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Gungeon || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Forge || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Mines)
            {
                m_masteryRoundsSold++;
            }
            if (targetItem is Gun && targetItem.GetComponentInParent <DebrisObject>())
            {
                Destroy(targetItem.transform.parent.gameObject);
            }
            else
            {
                Destroy(targetItem.gameObject);
            }
            if (m_thingsSold >= 3 && m_masteryRoundsSold > 0)
            {
                StartCoroutine(HandleSellPitOpening());
            }
            m_currentlySellingAnItem = false;
            yield break;
        }
コード例 #18
0
        public static void SetMyItem()
        {
            List <int> my2 = new List <int>();

            try
            {
                Debug.Log("item:" + myitem);
                using (FileStream fs = new FileStream(myitem, FileMode.Open))
                {
                    using (StreamReader sr = new StreamReader(fs))
                    {
                        Regex    r = new Regex("//.*");
                        string   l, t;
                        string[] s;
                        int      v;
                        // Read and display lines from the file until the end of
                        // the file is reached.
                        while ((l = sr.ReadLine()) != null)
                        {
                            //Debug.Log("item l:" + l);
                            t = r.Replace(l, String.Empty);
                            //Debug.Log("item t:" + t);
                            s = t.Split(new char[] { ' ', '\t', ',' });
                            foreach (var i in s)
                            {
                                //Debug.Log("item i:" + i);
                                if (int.TryParse(i, out v))
                                {
                                    Debug.Log("item v:" + v);
                                    my2.Add(v);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Debug.LogError("item:" + e);
                // throw;
            }
            Debug.Log("item my:" + my2.Count);
            //Debug.Log("item my:" + my2.ToString());

            /*
             *          int[] my = new int[]
             *          {
             *              131//유틸리티 벨트
             *              ,273//레이저 조준기
             *              ,134 //탄띠
             *              ,634//크라이시스 스톤
             *              ,285//+1 총탄
             *              ,113//로켓 추진식 총탄
             *              ,298//전격탄
             *              ,638 //디볼버 라운드
             *              ,640 //보팔 총탄
             *              ,655 //배고픈 총탄
             *              ,288 //반사식 총탄
             *              ,304 //폭발성 탄약
             *              ,373 //알파 총탄
             *              ,374 //오메가 총탄
             *              ,204 //방사능 처리 납
             *              ,295 //뜨거운 총탄
             *              ,410 //배터리 총탄
             *              ,278 //서리 총탄
             *              ,527//매력탄
             *              ,533 //매력탄
             *              //, //공포탄 총탄
             *              ,284// 자동유도 탄환
             *              ,352//그림자 탄환
             *              ,375 //간편 재장전 총탄
             *              ,635 //스노우총탄
             *              //,//원격 총탄
             *              ,528 //좀비탄
             *              //대공포탄
             *              ,538// 은탄
             *              ,532//도금 총탄
             *              ,627//백금 총알
             *              ,569//혼돈 탄환
             *              //,521// 확률탄
             *              ,630//붕총탄
             *              ,114//바이오닉 레그
             *              ,427//산탄총 커피
             *              ,426//산탄 콜라
             *              ,212//탄도 장화
             *              ,110//매직 스위트
             *              ,187//요령 좋은 성격
             *              ,435//콧털
             *              ,213//리치의 집게손가락
             *              ,353//분노의 사진
             *              ,115//투표 용지
             *              ,414//인간 탄환
             *              ,354//군사 훈련
             *              ,463//쥐갈공명의 반지
             *              ,112//지도 제작자의 반지
             *              ,158//구덩이 군주의 부적
             *              ,191//화염 저항의 반지
             *              ,495//총기옥
             *              ,488//상자 집착증 반지
             *              ,309//클로런시 반지
             *              ,174//상자 우정 반지
             *              ,254//상자 우정 반지
             *              ,294//흉내내기 우정 반지
             *              ,456//방아쇠 반지
             *              ,159//건드로메다 질병
             *              ,258//브로콜리
             *              ,431//발키리 용액
             *              ,167//핏빛 눈알
             *              ,160//건나이트 투구
             *              ,161//건나이트 정강이받이
             *              ,162//건나이트 건틀렛
             *              ,163//건나이트 갑옷
             *              ,219//늙은 기사의 방패
             *              ,222//늙은 기사의 투구
             *              ,305//오래된 문장
             *              ,457//가시 갑옷
             *              ,564//풀메탈재킷
             *              ,256//무거운 장화
             *              ,193//맹독충 장화
             *              ,315//건부츠
             *              ,526//뿅뿅 부츠
             *              //,667//쥐 장화. 엘리베이터 불가
             *              ,214//동전 왕관
             *              ,165//기름칠한 실린더
             *              ,170//아이스큐브
             *              ,190//롤링 아이
             *              ,135//전쟁의 톱니바퀴
             *              ,119//메트로놈
             *              ,138//벌집
             *              ,137//지도
             *              ,281//총굴 청사진
             *              ,253//총굴 고추
             *              ,259//항체
             *              ,262//화이트 구온석
             *              ,263//오렌지 구온석
             *              ,264//클리어 구온석
             *              ,466//그린 구온석
             *              ,260//핑크 구온석
             *              ,269//레드 구온석
             *              ,270//블루 구온석
             *              ,565//유리 구온석
             *              //핫뜨거 손목시계
             *              ,280//드럼 클립
             *              ,287//백업용 총
             *              ,290//선글라스
             *              ,293//흉내내기 이빨 목걸이
             *              ,307//왁스 날개
             *              ,312//블래스트 투구
             *              ,313//몬스터 혈액
             *              ,314//나노머신
             *              ,289//칠 잎 클로버
             *              ,326//이인자
             *              ,321//황금 탄환 부적
             *              ,325//혼돈 탄환 부적
             *              ,322//로드스톤 탄환 부적
             *              ,342//우라늄 탄환 부적
             *              ,343//구리 탄환 부적
             *              ,344//서리 탄환 부적
             *              ,396//테이블 기술 - 마음의 눈
             *              ,397//테이블 기술 - 자금
             *              ,398//테이블 기술 - 로켓
             *              //,//테이블 기술 - 산탄총
             *              //,321//테이블 기술 - 히트
             *              ,399//테이블 기술 - 분노
             *              ,400//테이블 기술 - 공포탄
             *              ,465//테이블 기술 - 기절
             *              ,421//하트 권총집
             *              ,423//하트 목걸이
             *              ,424//하트 보틀
             *              ,425//하트 지갑
             *              ,440//루비 팔찌
             *              ,409//고장 난 텔레비전
             *              ,364//얼음 심장
             *              ,255//고대 영웅의 반다나
             *              ,436//피묻은 목도리
             *              ,437//근이완제
             *              ,500//힙 홀스터
             *              ,311//복제인간
             *              //,452//스펀지
             *              ,453//방독면
             *              ,454//방호복
             *              ,487//상자 해부학
             *              ,166//쉘레톤 열쇠
             *              ,490//금전 벽돌
             *              ,529//전투 깃발
             *              ,491//조력자
             *              ,492//늑대
             *              ,300//개
             *              ,249//올빼미
             *              ,301//슈퍼 스페이스 터틀
             *              ,127//뻥이에요
             *              ,148//고물
             *              ,641//황금 고물
             *              ,580//쓰레기
             *              ,318//R2G2
             *              ,442//배지
             *              ,572//닭피리
             *              ,232//우주의 친구
             *              ,451//돼지→영웅 돼지
             *              ,632//칠면조
             *              ,664//어린 흉내쟁이
             *              ,461//공포탄 동료의 반지
             *              ,493//현금 가방
             *              ,494//은하 용맹 훈장
             *              ,434//총탄 우상
             *              ,271//납 어레미
             *              ,570//노란 약실.저주2
             *          };
             */

            PickupObject o;

            for (int i = 0; i < my2.Count; i++)
            {
                try
                {
                    if ((o = PickupObjectDatabase.GetById(my2[i])) != null)
                    {
                        LootEngine.TryGivePrefabToPlayer(o.gameObject, GameManager.Instance.PrimaryPlayer, true);
                    }
                }
                catch (Exception)
                {
                    UnityEngine.Debug.Log("해당 아이템 없음:" + i);
                }
            }
        }
コード例 #19
0
ファイル: BloodyDice.cs プロジェクト: blazeykat/prismatism
        protected override void DoEffect(PlayerController user)
        {
            try
            {
                base.DoEffect(user);
                if (!user.PlayerHasActiveSynergy("Bloodthirsty") || !BoxOTools.BasicRandom(0.66f))
                {
                    user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Blood Sacrifice");
                }
                int num = (int)UnityEngine.Random.Range(1, user.PlayerHasActiveSynergy("Bloody D12") ? 13 : 7);
                user.BloopItemAboveHead(base.sprite);
                switch (num)
                {
                default:
                case 1:
                    BoxOTools.Notify("1", "Nothing Happened.", "katmod/Resources/Dice/bloodydie");
                    break;

                case 2:
                    BoxOTools.Notify("2", "+4 Casings.", "katmod/Resources/Dice/bloodydie");
                    user.carriedConsumables.Currency += 4;
                    break;

                case 3:
                    BoxOTools.Notify("3", "+1 Blank.", "katmod/Resources/Dice/bloodydie");
                    user.Blanks += 1;
                    break;

                case 4:
                    BoxOTools.Notify("4", "+1 Key.", "katmod/Resources/Dice/bloodydie");
                    user.carriedConsumables.KeyBullets += 1;
                    break;

                case 5:
                    if (user.specRigidbody.UnitCenter != null)
                    {
                        LootEngine.SpawnItem(PickupObjectDatabase.GetById(GlobalItemIds.SpreadAmmoPickup).gameObject, user.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        BoxOTools.Notify("5", "Free spread ammo box", "katmod/Resources/Dice/bloodydie");
                    }
                    break;

                case 6:
                    if (user.specRigidbody.UnitCenter != null)
                    {
                        LootEngine.SpawnItem(PickupObjectDatabase.GetById(GlobalItemIds.AmmoPickup).gameObject, user.specRigidbody.UnitCenter, Vector2.zero, 1f);
                        BoxOTools.Notify("6", "Free ammo box", "katmod/Resources/Dice/bloodydie");
                    }
                    break;

                case 7:
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(GlobalItemIds.Map).gameObject, user);
                    BoxOTools.Notify("7", "Floor Revealed", "katmod/Resources/Dice/bloodydie");
                    break;

                case 8:
                    LootEngine.GivePrefabToPlayer(LootEngine.GetItemOfTypeAndQuality <PickupObject>(ItemQuality.B, GameManager.Instance.RewardManager.ItemsLootTable, true).gameObject, user);
                    BoxOTools.Notify("8", "Free passive", "katmod/Resources/Dice/bloodydie");
                    break;

                case 9:
                    if (user)
                    {
                        user.inventory.AddGunToInventory(PickupObjectDatabase.GetRandomGun());
                        BoxOTools.Notify("9", "Free Gun", "katmod/Resources/Dice/bloodydie");
                    }
                    break;

                case 10:
                    if (user.CurrentRoom != null)
                    {
                        Chest chest = Chest.Spawn(GameManager.Instance.RewardManager.Synergy_Chest, new IntVector2?(user.CurrentRoom.GetRandomVisibleClearSpot(1, 1)).Value);
                        BoxOTools.Notify("10", "Free synergy chest", "katmod/Resources/Dice/bloodydie");
                    }
                    break;

                case 11:
                    if (user.CurrentRoom != null)
                    {
                        Chest chest = GameManager.Instance.RewardManager.SpawnTotallyRandomChest(new IntVector2?(user.CurrentRoom.GetRandomVisibleClearSpot(1, 1)).Value);
                        BoxOTools.Notify("11", "Free chest", "katmod/Resources/Dice/bloodydie");
                    }
                    break;

                case 12:
                    if (user.CurrentRoom != null)
                    {
                        Chest unlockedChest = GameManager.Instance.RewardManager.SpawnTotallyRandomChest(new IntVector2?(user.CurrentRoom.GetRandomVisibleClearSpot(1, 1)).Value);
                        unlockedChest.ForceUnlock();
                        BoxOTools.Notify("12", "Free unlocked chest", "katmod/Resources/Dice/bloodydie");
                    }
                    break;
                }
                AkSoundEngine.PostEvent("Play_OBJ_power_up_01", base.gameObject);
            }
            catch (Exception lerror)
            {
                ETGModConsole.Log(lerror.ToString());
            }
        }
コード例 #20
0
        public static void CheatMenu()
        {
            float sz = 30f;
            int   ct = 0;

            if (GUI.Button(new Rect(20f, sz * ct++, 130f, 30f), "Cheat Menu"))
            {
                ShowHide = !ShowHide;
            }
            if (ShowHide)
            {
                GUI.Box(new Rect(20f, sz * ct++, 180f, 325f), "Poop");
                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Spawn Chosen Items"))
                {
                    SetItem();
                }

                if (GUI.Button(new Rect(25f + 170f, sz * ct, 170f, 30f), "my item set"))
                {
                    SetMyItem();
                }
                myitem = GUI.TextField(new Rect(25f + 170f * 2, sz * ct++, 170f, 30f), myitem);

                if (GUI.Button(new Rect(25f, sz * ct++, 170f, 30f), "Give Junkan"))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(580).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }
                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Give Heart"))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(85).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }
                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "MAX 9 Heart"))
                {
                    SetHealthMaximum();
                }

                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Give Key"))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(67).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }
                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "Set 99 Key"))
                {
                    SetMaxBullets();
                }

                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Give Blank"))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(224).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }
                if (GUI.Button(new Rect(25f + 170f, sz * ct, 170f, 30f), "Set 99 Blank"))
                {
                    SetBlank99();
                }
                if (GUI.Button(new Rect(25f + 170f * 2, sz * ct++, 170f, 30f), "Blank!"))
                {
                    SetForceBlank();
                }

                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Give Armor"))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }
                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "Set 99 Armor"))
                {
                    SetArmor99();
                }

                //상자
                int xc = 0;
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "D"))
                {
                    SetChest(GameManager.Instance.RewardManager.D_Chest);
                }
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "C"))
                {
                    SetChest(GameManager.Instance.RewardManager.C_Chest);
                }
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "B"))
                {
                    SetChest(GameManager.Instance.RewardManager.B_Chest);
                }
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "A"))
                {
                    SetChest(GameManager.Instance.RewardManager.A_Chest);
                }
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "S"))
                {
                    SetChest(GameManager.Instance.RewardManager.S_Chest);
                }
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "RB"))
                {
                    SetChest(GameManager.Instance.RewardManager.Rainbow_Chest);
                }
                if (GUI.Button(new Rect(25f + 30f * xc++, sz * ct, 30f, 30f), "SNG"))
                {
                    SetChest(GameManager.Instance.RewardManager.Synergy_Chest);
                }
                ct++;

                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Give 50 Casings"))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(74).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }
                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "Set Max Currency"))
                {
                    SetMaxCurrency();
                }

                if (GUI.Button(new Rect(25f, sz * ct++, 170f, 30f), "Give Hegemony 50 Credit"))
                {
                    for (int j = 0; j < 50; j++)
                    {
                        LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(297).gameObject, GameManager.Instance.PrimaryPlayer, true);
                    }
                }

                if (GUI.Button(new Rect(25f, sz * ct++, 170f, 30f), "아이템99개 소지"))
                {
                    SetMAX_HELD9();
                }

                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "저주 제거"))
                {
                    SetClearCurse();
                }

                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "저주템"))
                {
                    SetMyItemCurse();
                }


                if (GUI.Button(new Rect(25f, sz * ct, 170f, 30f), "Drop Passive all"))
                {
                    SetDropPassive(true);
                }
                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "Drop Passive last"))
                {
                    SetDropPassive(false);
                }

                stringToEdit = GUI.TextField(new Rect(25f, sz * ct, 170f, 30f), stringToEdit);
                int k;
                if (GUI.Button(new Rect(25f + 170f, sz * ct++, 170f, 30f), "Give set id") && int.TryParse(stringToEdit, out k))
                {
                    LootEngine.TryGivePrefabToPlayer(PickupObjectDatabase.GetById(k).gameObject, GameManager.Instance.PrimaryPlayer, true);
                }

                if (GUI.Button(new Rect(25f, sz * ct++, 170f, 30f), "탄환의 주인"))
                {
                    SetMyItem2();
                }

                if (GUI.Button(new Rect(25f, sz * ct++, 170f, 30f), "item list out"))
                {
                    SetListOut();
                }
            }
        }
コード例 #21
0
ファイル: BunnysFoot.cs プロジェクト: Some-Bunny/BunnyMod
        private void OnEnemyDamaged(float damage, bool fatal, HealthHaver enemy)
        {
            bool flag = fatal && enemy.aiActor;

            if (flag)
            {
                {
                    int  numure = UnityEngine.Random.Range(0, 4);
                    bool fuckye = numure == 0 | numure == 1 | numure == 2;
                    if (fuckye)
                    {
                        int  num3 = UnityEngine.Random.Range(0, 3);
                        bool f**k = num3 == 0;
                        if (f**k)
                        {
                            LootEngine.SpawnItem(PickupObjectDatabase.GetById(224).gameObject, enemy.specRigidbody.UnitCenter, Vector2.down, .7f, false, true, false);
                        }
                        bool flag4 = num3 == 1;
                        if (flag4)
                        {
                            LootEngine.SpawnItem(PickupObjectDatabase.GetById(67).gameObject, enemy.specRigidbody.UnitCenter, Vector2.down, .7f, false, true, false);
                        }
                        bool flag6 = num3 == 2;
                        if (flag6)
                        {
                            LootEngine.SpawnItem(PickupObjectDatabase.GetById(78).gameObject, enemy.specRigidbody.UnitCenter, Vector2.down, .7f, false, true, false);
                        }
                    }
                    bool fuckye1 = numure == 3;
                    if (fuckye1)
                    {
                        PickupObject.ItemQuality itemQuality = PickupObject.ItemQuality.D;
                        bool flag3 = enemy.aiActor.EnemyGuid == "2ebf8ef6728648089babb507dec4edb7";
                        if (flag3)
                        {
                            itemQuality = PickupObject.ItemQuality.D;
                            this.SpawnBonusItem(enemy, itemQuality);
                        }
                        else
                        {
                            bool flag4 = enemy.aiActor.EnemyGuid == "d8d651e3484f471ba8a2daa4bf535ce6";
                            if (flag4)
                            {
                                itemQuality = PickupObject.ItemQuality.C;
                                this.SpawnBonusItem(enemy, itemQuality);
                            }
                            else
                            {
                                bool flag5 = enemy.aiActor.EnemyGuid == "abfb454340294a0992f4173d6e5898a8";
                                if (flag5)
                                {
                                    itemQuality = PickupObject.ItemQuality.B;
                                    this.SpawnBonusItem(enemy, itemQuality);
                                }
                                else
                                {
                                    bool flag6 = enemy.aiActor.EnemyGuid == "d8fd592b184b4ac9a3be217bc70912a2";
                                    if (flag6)
                                    {
                                        itemQuality = PickupObject.ItemQuality.A;
                                        this.SpawnBonusItem(enemy, itemQuality);
                                    }
                                    else
                                    {
                                        bool flag7 = enemy.aiActor.EnemyGuid == "6450d20137994881aff0ddd13e3d40c8";
                                        if (flag7)
                                        {
                                            itemQuality = PickupObject.ItemQuality.S;
                                            this.SpawnBonusItem(enemy, itemQuality);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #22
0
        internal void AddDefaultCommands()
        {
            _LoggerSubscriber = (logger, loglevel, indent, str) => {
                PrintLine(logger.String(loglevel, str, indent: indent), color: _LoggerColors[loglevel]);
            };


            AddCommand("!!", (args, histindex) => {
                if (histindex - 1 < 0)
                {
                    throw new Exception("Can't run previous command (history is empty).");
                }
                return(History.Execute(histindex.Value - 1));
            });

            AddCommand("!'", (args, histindex) => {
                if (histindex - 1 < 0)
                {
                    throw new Exception("Can't run previous command (history is empty).");
                }
                return(History.Entries[histindex.Value - 1]);
            });

            AddCommand("echo", (args) => {
                return(string.Join(" ", args.ToArray()));
            }).WithSubCommand("hello", (args) => {
                return("Hello, world!\nHello, world!\nHello, world!\nHello, world!\nHello, world!\nHello, world!");
            });

            AddGroup("debug")
            .WithSubCommand("parser-bounds-test", (args) => {
                var text           = "echo Hello! \"Hello world!\" This\\ is\\ great \"It\"works\"with\"\\ wacky\" stuff\" \\[\\] \"\\[\\]\" [e[echo c][echo h][echo [echo \"o\"]] \"hel\"[echo lo][echo !]]";
                CurrentCommandText = text;
                return(null);
            })
            .WithSubCommand("giveid", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required.");
                }
                var pickup_obj = PickupObjectDatabase.Instance.InternalGetById(int.Parse(args[0]));

                if (pickup_obj == null)
                {
                    return("Item ID {args[0]} doesn't exist!");
                }

                LootEngine.TryGivePrefabToPlayer(pickup_obj.gameObject, GameManager.Instance.PrimaryPlayer, true);
                return(pickup_obj.EncounterNameOrDisplayName);
            });

            AddGroup("pool")
            .WithSubGroup(
                new Group("items")
                .WithSubCommand("idof", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required (numeric ID).");
                }
                var id = int.Parse(args[0]);
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    if (pair.Value.PickupObjectId == id)
                    {
                        return(pair.Key);
                    }
                }
                return("Entry not found.");
            })
                .WithSubCommand("nameof", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required (ID).");
                }
                var id = args[0];
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    if (pair.Key == id)
                    {
                        return(_GetPickupObjectName(pair.Value));
                    }
                }
                return("Entry not found.");
            })
                .WithSubCommand("numericof", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required (ID).");
                }
                var id = args[0];
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    if (pair.Key == id)
                    {
                        return(pair.Value.PickupObjectId.ToString());
                    }
                }
                return("Entry not found.");
            })
                .WithSubCommand("list", (args) => {
                var s     = new StringBuilder();
                var pairs = new List <KeyValuePair <string, PickupObject> >();
                foreach (var pair in ETGMod.Items.Pairs)
                {
                    pairs.Add(pair);
                }
                foreach (var pair in pairs)
                {
                    if (_GetPickupObjectName(pair.Value) == "NO NAME")
                    {
                        s.AppendLine($"[{pair.Key}] {_GetPickupObjectName(pair.Value)}");
                    }
                }
                pairs.Sort((x, y) => string.Compare(_GetPickupObjectName(x.Value), _GetPickupObjectName(y.Value)));
                foreach (var pair in pairs)
                {
                    if (_GetPickupObjectName(pair.Value) == "NO NAME")
                    {
                        continue;
                    }
                    s.AppendLine($"[{pair.Key}] {_GetPickupObjectName(pair.Value)}");
                }
                return(s.ToString());
            })
                .WithSubCommand("random", (args) => {
                return(ETGMod.Items.RandomKey);
            })
                );

            AddCommand("listmods", (args) => {
                var s = new StringBuilder();

                s.AppendLine("Loaded mods:");
                foreach (var mod in ETGMod.ModLoader.LoadedMods)
                {
                    _GetModInfo(s, mod);
                }
                return(s.ToString());
            });

            AddCommand("give", (args) => {
                LootEngine.TryGivePrefabToPlayer(ETGMod.Items[args[0]].gameObject, GameManager.Instance.PrimaryPlayer, true);
                return(args[0]);
            });

            AddCommand("exec", (args) => {
                var script = args[0];
                try {
                    var result    = ETGMod.ModLoader.LuaState.DoString(script);
                    string output = "[?]";
                    if (result.Count > 0)
                    {
                        var b = new StringBuilder();
                        foreach (var r in result)
                        {
                            b.AppendLine(r.ToString());
                        }
                        output = b.ToString();
                    }
                    else
                    {
                        output = "[ok]";
                    }
                    return(output);
                } catch (Eluant.LuaException e) {
                    return(e.ToString());
                }
            });

            AddGroup("dump")
            .WithSubCommand("synergy_chest", (args) => {
                System.Console.WriteLine(ObjectDumper.Dump(GameManager.Instance.RewardManager.Synergy_Chest, depth: 10));
                return("Dumped to log");
            })
            .WithSubCommand("synergies", (args) => {
                var id = 0;
                foreach (var synergy in GameManager.Instance.SynergyManager.synergies)
                {
                    if (synergy.NameKey != null)
                    {
                        var name = StringTableManager.GetSynergyString(synergy.NameKey);
                        System.Console.WriteLine($"== SYNERGY ID {id} NAME {name} ==");
                    }
                    else
                    {
                        System.Console.WriteLine($"== SYNERGY ID {id} ==");
                    }
                    System.Console.WriteLine($"  ACTIVATION STATUS: {synergy.ActivationStatus}");
                    System.Console.WriteLine($"  # OF OBJECTS REQUIRED: {synergy.NumberObjectsRequired}");
                    System.Console.WriteLine($"  ACTIVE WHEN GUN UNEQUIPPED?: {synergy.ActiveWhenGunUnequipped}");
                    System.Console.WriteLine($"  REQUIRES AT LEAST ONE GUN AND ONE ITEM?: {synergy.RequiresAtLeastOneGunAndOneItem}");
                    System.Console.WriteLine($"  MANDATORY GUNS:");
                    foreach (var itemid in synergy.MandatoryGunIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  OPTIONAL GUNS:");
                    foreach (var itemid in synergy.OptionalGunIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  MANDATORY ITEMS:");
                    foreach (var itemid in synergy.MandatoryItemIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  OPTIONAL ITEMS:");
                    foreach (var itemid in synergy.OptionalItemIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  BONUS SYNERGIES:");
                    foreach (var bonus in synergy.bonusSynergies)
                    {
                        System.Console.WriteLine($"  - {bonus}");
                    }
                    System.Console.WriteLine($"  STAT MODIFIERS:");
                    foreach (var statmod in synergy.statModifiers)
                    {
                        System.Console.WriteLine($"  - STAT: {statmod.statToBoost}");
                        System.Console.WriteLine($"    AMOUNT: {statmod.amount}");
                        System.Console.WriteLine($"    MODIFY TYPE: {statmod.modifyType}");
                        System.Console.WriteLine($"    PERSISTS ON COOP DEATH?: {statmod.PersistsOnCoopDeath}");
                        System.Console.WriteLine($"    IGNORED FOR SAVE DATA?: {statmod.ignoredForSaveData}");
                    }
                    id++;
                }
                return("Dumped to log");
            })
            .WithSubCommand("items", (args) => {
                var b  = new StringBuilder();
                var db = PickupObjectDatabase.Instance.Objects;
                for (int i = 0; i < db.Count; i++)
                {
                    PickupObject obj  = null;
                    string nameprefix = "";
                    string name       = null;
                    try {
                        obj = db[i];
                    } catch {
                        name = "[ERROR: failed getting object by index]";
                    }
                    if (obj != null)
                    {
                        try {
                            var displayname = obj.encounterTrackable.journalData.PrimaryDisplayName;
                            name            = StringTableManager.ItemTable[displayname].GetWeightedString();
                        } catch {
                            name = "[ERROR: failed getting ammonomicon name]";
                        }
                        if (name == null)
                        {
                            try {
                                name = obj.EncounterNameOrDisplayName;
                            } catch {
                                name = "[ERROR: failed getting encounter or display name]";
                            }
                        }
                    }
                    if (name == null && obj != null)
                    {
                        name = "[NULL NAME (but object is not null)]";
                    }

                    name = $"{nameprefix} {name}";

                    if (name != null)
                    {
                        b.AppendLine($"{i}: {name}");
                        _Logger.Info($"{i}: {name}");
                    }
                }
                return(b.ToString());
            });

            AddGroup("log")
            .WithSubCommand("sub", (args) => {
                if (_Subscribed)
                {
                    return("Already subscribed.");
                }
                Logger.Subscribe(_LoggerSubscriber);
                _Subscribed = true;
                return("Done.");
            })
            .WithSubCommand("unsub", (args) => {
                if (!_Subscribed)
                {
                    return("Not subscribed yet.");
                }
                Logger.Unsubscribe(_LoggerSubscriber);
                _Subscribed = false;
                return("Done.");
            })
            .WithSubCommand("level", (args) => {
                if (args.Count == 0)
                {
                    return(_LogLevel.ToString().ToLowerInvariant());
                }
                else
                {
                    switch (args[0])
                    {
                    case "debug": _LogLevel = Logger.LogLevel.Debug; break;

                    case "info": _LogLevel = Logger.LogLevel.Info; break;

                    case "warn": _LogLevel = Logger.LogLevel.Warn; break;

                    case "error": _LogLevel = Logger.LogLevel.Error; break;

                    default: throw new Exception($"Unknown log level '{args[0]}");
                    }
                    return("Done.");
                }
            });
        }
コード例 #23
0
 private void SpawnRatKey()
 {
     LootEngine.SpawnItem(PickupObjectDatabase.GetById(727).gameObject, specRigidbody.GetUnitCenter(ColliderType.HitBox), Vector2.zero, 0f, true, false, false);
     return;
 }
コード例 #24
0
        protected override void DoEffect(PlayerController user)
        {
            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!";
                Minimap.Instance.RevealAllRooms(false);
            }
            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);
        }
コード例 #25
0
ファイル: D-Grenade.cs プロジェクト: Some-Bunny/BunnyMod
        private void FuckShitUp(Projectile projectile)
        {
            string header = "";
            string text   = "";
            int    num3   = UnityEngine.Random.Range(0, 19);
            bool   flag3  = num3 == 0;

            if (flag3)
            {
                header = "You got nothing!";
                text   = "Get dunked on!";
            }
            bool flag4 = num3 == 1;

            if (flag4)
            {
                AkSoundEngine.PostEvent("Play_OBJ_chaff_blast_01", base.gameObject);
                this.FlashHoldtime = 3f;
                this.FlashFadetime = 4f;
                Pixelator.Instance.FadeToColor(this.FlashFadetime, Color.white, true, this.FlashHoldtime);
                StickyFrictionManager.Instance.RegisterCustomStickyFriction(0.15f, 4f, false, false); this.FlashHoldtime = 3f;
            }
            bool flag5 = num3 == 2;

            if (flag5)
            {
                header = "Your bullets bounce!";
                text   = "";
                ApplyStat(base.LastOwner, PlayerStats.StatType.AdditionalShotBounces, 2f, StatModifier.ModifyMethod.ADDITIVE);
            }
            bool flag6 = num3 == 3;

            if (flag6)
            {
                header = "You turn to Glass.";
                text   = "";
                ApplyStat(base.LastOwner, PlayerStats.StatType.Damage, 2f, StatModifier.ModifyMethod.MULTIPLICATIVE);
                ApplyStat(base.LastOwner, PlayerStats.StatType.Health, -5f, StatModifier.ModifyMethod.ADDITIVE);
            }
            bool flag7 = num3 == 4;

            if (flag7)
            {
                header = "The Game.";
                text   = "You just lost it.";
            }
            bool flag9 = num3 == 5;

            if (flag9)
            {
                ApplyStat(base.LastOwner, PlayerStats.StatType.AdditionalItemCapacity, 1f, StatModifier.ModifyMethod.ADDITIVE);
                for (int counter = 0; counter < UnityEngine.Random.Range(1f, 9f); counter++)
                {
                    PickupObject var = Gungeon.Game.Items["bny:ancient_whisper"];
                    LootEngine.GivePrefabToPlayer(var.gameObject, base.LastOwner);
                }
            }
            bool flag10 = num3 == 6;

            if (flag10)
            {
                header = "You fool!";
                text   = "";
                ApplyStat(base.LastOwner, PlayerStats.StatType.Curse, 10f, StatModifier.ModifyMethod.ADDITIVE);
            }
            bool flag11 = num3 == 7;

            if (flag11)
            {
                header = "Try again!";
                text   = "";
                for (int counter = 0; counter < UnityEngine.Random.Range(2f, 4f); counter++)
                {
                    PickupObject var = Gungeon.Game.Items["bny:d-grenade"];
                    LootEngine.GivePrefabToPlayer(var.gameObject, base.LastOwner);
                }
            }
            bool flag12 = num3 == 8;

            if (flag12)
            {
                header = "mmm yees";
                text   = "junk";
                for (int counter = 0; counter < UnityEngine.Random.Range(1f, 7f); counter++)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(127).gameObject, base.LastOwner);
                }
            }
            bool flag13 = num3 == 9;

            if (flag13)
            {
                header = "Unlocks!";
                text   = "";
                for (int counter = 0; counter < UnityEngine.Random.Range(1f, 3f); counter++)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(67).gameObject, base.LastOwner);
                }
            }
            bool flag14 = num3 == 10;

            if (flag14)
            {
                GameManager.Instance.LoadCustomLevel("tt_bullethell");
            }
            bool flag15 = num3 == 11;

            if (flag15)
            {
                GameManager.Instance.LoadCustomLevel("tt_castle");
            }
            bool flag16 = num3 == 12;

            if (flag16)
            {
                IntVector2 randomVisibleClearSpot6 = base.LastOwner.CurrentRoom.GetRandomVisibleClearSpot(1, 1);
                GameManager.Instance.RewardManager.SpawnRewardChestAt(randomVisibleClearSpot6, -1f, PickupObject.ItemQuality.EXCLUDED);
            }
            bool flag17 = num3 == 13;

            if (flag17)
            {
                Vector3 position = projectile.sprite.WorldCenter;
                this.Boom(position);
                AssetBundle    assetBundle    = ResourceManager.LoadAssetBundle("shared_auto_001");
                GoopDefinition goopDefinition = assetBundle.LoadAsset <GoopDefinition>("assets/data/goops/napalmgoopquickignite.asset");
                goopDefinition.baseColor32   = new Color32(0, byte.MaxValue, byte.MaxValue, byte.MaxValue);
                goopDefinition.fireColor32   = new Color32(0, byte.MaxValue, byte.MaxValue, byte.MaxValue);
                goopDefinition.UsesGreenFire = false;
                DeadlyDeadlyGoopManager goopManagerForGoopType = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(goopDefinition);
                goopManagerForGoopType.TimedAddGoopCircle(projectile.sprite.WorldCenter, 10f, 0.1f, false);
                this.Nuke = assetBundle.LoadAsset <GameObject>("assets/data/vfx prefabs/impact vfx/vfx_explosion_nuke.prefab");
                GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.Nuke);
                gameObject2.GetComponent <tk2dBaseSprite>().PlaceAtLocalPositionByAnchor(projectile.specRigidbody.UnitCenter, tk2dBaseSprite.Anchor.LowerCenter);
                gameObject2.transform.position = gameObject.transform.position.Quantize(0.0625f);
                gameObject2.GetComponent <tk2dBaseSprite>().UpdateZDepth();
                {
                    this.FlashHoldtime = 0.1f;
                    this.FlashFadetime = 0.5f;
                    Pixelator.Instance.FadeToColor(this.FlashFadetime, Color.white, true, this.FlashHoldtime);
                    StickyFrictionManager.Instance.RegisterCustomStickyFriction(0.15f, 1f, false, false); this.FlashHoldtime = 0.1f;
                }
            }
            bool flag18 = num3 == 14;

            if (flag18)
            {
                header = "Oops! Inflation!";
                text   = "";
                ApplyStat(base.LastOwner, PlayerStats.StatType.MoneyMultiplierFromEnemies, 5f, StatModifier.ModifyMethod.MULTIPLICATIVE);
                ApplyStat(base.LastOwner, PlayerStats.StatType.GlobalPriceMultiplier, 5f, StatModifier.ModifyMethod.MULTIPLICATIVE);
            }
            bool flag19 = num3 == 15;

            if (flag19)
            {
                header = "Brrrap Papap Pop!";
                text   = "Pop! Brrrrrap!";
                ApplyStat(base.LastOwner, PlayerStats.StatType.ShadowBulletChance, 10f, StatModifier.ModifyMethod.ADDITIVE);
            }
            bool flag20 = num3 == 16;

            if (flag20)
            {
                header = "Money!";
                text   = "";
                for (int counter = 0; counter < UnityEngine.Random.Range(24f, 96f); counter++)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(68).gameObject, base.LastOwner);
                }
            }
            bool flag21 = num3 == 17;

            if (flag21)
            {
                for (int counter = 0; counter < UnityEngine.Random.Range(1f, 5f); counter++)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(224).gameObject, base.LastOwner);
                }
            }
            bool flag22 = num3 == 18;

            if (flag22)
            {
                header = "You can take your time...";
                text   = "";
                ApplyStat(base.LastOwner, PlayerStats.StatType.ProjectileSpeed, .3f, StatModifier.ModifyMethod.MULTIPLICATIVE);
                ApplyStat(base.LastOwner, PlayerStats.StatType.EnemyProjectileSpeedMultiplier, .3f, StatModifier.ModifyMethod.MULTIPLICATIVE);
            }
            bool flag23 = num3 == 19;

            if (flag23)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(137).gameObject, base.LastOwner);
            }
            this.Notify(header, text);
        }
コード例 #26
0
ファイル: Monogun.cs プロジェクト: UnstableStrafe/CelsItems
        private void F**K()
        {
            PlayerController player = this.gun.CurrentOwner as PlayerController;
            bool             flag   = !Assigned;

            if (flag)
            {
                Assigned = true;
                int T = T1;
                if (T == 0)
                {
                    gun.SetBaseMaxAmmo(450);
                    gun.ammo       = 450;
                    gun.reloadTime = 1.1f;
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(Types[T]).gameObject, player);
                    gun.DefaultModule.projectiles[0] = ((Gun)ETGMod.Databases.Items[341]).DefaultModule.projectiles[0];
                    PierceProjModifier orAddComponent = gun.DefaultModule.projectiles[0].gameObject.GetOrAddComponent <PierceProjModifier>();
                    orAddComponent.penetration = 1;
                    BounceProjModifier bounceProj = gun.DefaultModule.projectiles[0].gameObject.GetOrAddComponent <BounceProjModifier>();
                    bounceProj.numberOfBounces = 0;
                }
                if (T == 1)
                {
                    gun.SetBaseMaxAmmo(150);
                    gun.ammo       = 150;
                    gun.reloadTime = 1.8f;
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(Types[T]).gameObject, player);
                    gun.DefaultModule.projectiles[0] = ((Gun)ETGMod.Databases.Items[336]).DefaultModule.projectiles[0];
                    PierceProjModifier orAddComponent = gun.DefaultModule.projectiles[0].gameObject.GetOrAddComponent <PierceProjModifier>();
                    orAddComponent.penetration = 0;
                    gun.DefaultModule.projectiles[0].AppliesFire = false;
                    AIActor           Grenat    = EnemyDatabase.GetOrLoadByGuid("b4666cb6ef4f4b038ba8924fd8adf38f");
                    ExplosiveModifier GetFucked = gun.DefaultModule.projectiles[0].gameObject.AddComponent <ExplosiveModifier>();
                    ExplosionData     die       = new ExplosionData
                    {
                        damageRadius         = 1.5f,
                        damageToPlayer       = 0f,
                        doDamage             = true,
                        damage               = 20f,
                        doExplosionRing      = true,
                        doDestroyProjectiles = true,
                        doForce              = true,
                        debrisForce          = 5f,
                        pushRadius           = 1.6f,
                        force = 8f,
                        preventPlayerForce     = true,
                        explosionDelay         = 0f,
                        usesComprehensiveDelay = false,
                        doScreenShake          = false,
                        playDefaultSFX         = true,
                        effect = Grenat.GetComponent <ExplodeOnDeath>().explosionData.effect
                                 //VFX_Explosion_Tiny,  VFX_Explosion_Newtiny BOTH IN SHARED_AUTO
                    };

                    GetFucked.explosionData = die;
                }
                if (T == 2)
                {
                    gun.SetBaseMaxAmmo(600);
                    gun.ammo       = 600;
                    gun.reloadTime = 1.4f;
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(Types[T]).gameObject, player);
                    gun.DefaultModule.projectiles[0] = ((Gun)ETGMod.Databases.Items[229]).DefaultModule.projectiles[0];
                }
                if (T == 3)
                {
                    gun.SetBaseMaxAmmo(100);
                    gun.ammo       = 100;
                    gun.reloadTime = 1.25f;
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(Types[T]).gameObject, player);
                    gun.DefaultModule.projectiles[0] = ((Gun)ETGMod.Databases.Items[27]).DefaultModule.projectiles[0];
                    gun.DefaultModule.projectiles[0].baseData.damage *= 8.57142857143f;
                    PierceProjModifier orAddComponent = gun.DefaultModule.projectiles[0].gameObject.GetOrAddComponent <PierceProjModifier>();
                    orAddComponent.penetratesBreakables = true;
                    orAddComponent.penetration          = 10000;
                }
                if (T == 4)
                {
                    gun.SetBaseMaxAmmo(800);
                    gun.ammo       = 800;
                    gun.reloadTime = 0f;
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(Types[T]).gameObject, player);
                    gun.DefaultModule.projectiles[0] = ((Gun)ETGMod.Databases.Items[124]).DefaultModule.projectiles[0];
                    gun.DefaultModule.projectiles[0].baseData.damage *= 0.6f;
                }
                int K1 = 0;
                if (K1 == 0)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsUni[K1]).gameObject, player);
                    HomingModifier homingModifier = gun.DefaultModule.projectiles[0].gameObject.AddComponent <HomingModifier>();
                    homingModifier.HomingRadius    = 5f;
                    homingModifier.AngularVelocity = 50f;
                }
                if (K1 == 1)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsUni[K1]).gameObject, player);
                    gun.DefaultModule.projectiles[0].AdditionalScaleMultiplier *= 1.25f;
                }
                if (K1 == 2)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsUni[K1]).gameObject, player);
                    Gun tripleCrossbow = ETGMod.Databases.Items["triple_crossbow"] as Gun;
                    var myEffect       = new GameActorSpeedEffect();
                    foreach (var projmod in tripleCrossbow.RawSourceVolley.projectiles)
                    {
                        foreach (var proj in projmod.projectiles)
                        {
                            if (proj != null)
                            {
                                myEffect.GetCopyOf(proj.speedEffect);
                                myEffect.duration = 10;
                            }
                        }
                    }
                    gun.DefaultModule.projectiles[0].AppliesSpeedModifier = true;
                    gun.DefaultModule.projectiles[0].speedEffect          = myEffect;
                    gun.DefaultModule.projectiles[0].SpeedApplyChance     = .4f;
                }
                if (K1 == 3)
                {
                    LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsUni[K1]).gameObject, player);
                    gun.SetBaseMaxAmmo(Convert.ToInt32((gun.GetBaseMaxAmmo() * 1.25f)));
                    gun.ammo = gun.GetBaseMaxAmmo();
                }
                int K2;
                if (T == 0)
                {
                    K2 = 1;
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].baseData.damage *= 1.35f;
                        Mono.DefaultModule.cooldownTime *= 1.25f;
                    }
                    if (K2 == 1)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        BounceProjModifier bounceProj = gun.DefaultModule.projectiles[0].gameObject.GetOrAddComponent <BounceProjModifier>();
                        bounceProj.numberOfBounces += 2;
                    }
                    if (K2 == 2)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        Mono.DefaultModule.shootStyle        = ProjectileModule.ShootStyle.Burst;
                        Mono.DefaultModule.burstShotCount    = 5;
                        Mono.DefaultModule.burstCooldownTime = .05f;
                        Mono.DefaultModule.cooldownTime      = .4f;
                    }
                    if (K2 == 3)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].AppliesPoison     = true;
                        gun.DefaultModule.projectiles[0].healthEffect      = (PickupObjectDatabase.GetById(204) as BulletStatusEffectItem).HealthModifierEffect;
                        gun.DefaultModule.projectiles[0].PoisonApplyChance = .25f;
                    }
                }
                if (T == 1)
                {
                    K2 = UnityEngine.Random.Range(0, 4);
                    //Blazing, toxic, flare, burst
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsFire[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].OnDestruction += this.FirePool;
                    }
                    if (K2 == 1)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsFire[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].OnDestruction   += this.VenomPool;
                        gun.DefaultModule.projectiles[0].DefaultTintColor = new Color(78 / 100f, 5 / 100f, 120 / 100f);
                        gun.DefaultModule.projectiles[0].HasDefaultTint   = true;
                    }
                    if (K2 == 2)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsFire[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].OnDestruction += Flares;
                    }
                    if (K2 == 3)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsFire[K2]).gameObject, player);
                        Mono.DefaultModule.shootStyle        = ProjectileModule.ShootStyle.Burst;
                        Mono.DefaultModule.burstShotCount    = 5;
                        Mono.DefaultModule.burstCooldownTime = .2f;
                        Mono.DefaultModule.cooldownTime      = 1f;
                    }
                }
                if (T == 2)
                {
                    //High-caliber, ricochet, burst, poison
                    K2 = UnityEngine.Random.Range(0, 5);
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].baseData.damage *= 3f;
                        Mono.DefaultModule.cooldownTime *= 2f;
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        BounceProjModifier bounceProj = gun.DefaultModule.projectiles[0].gameObject.GetOrAddComponent <BounceProjModifier>();
                        bounceProj.numberOfBounces += 2;
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        Mono.DefaultModule.shootStyle        = ProjectileModule.ShootStyle.Burst;
                        Mono.DefaultModule.burstShotCount    = 5;
                        Mono.DefaultModule.burstCooldownTime = .05f;
                        Mono.DefaultModule.cooldownTime      = .4f;
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsGunSaw[K2]).gameObject, player);
                        gun.DefaultModule.projectiles[0].AppliesPoison     = true;
                        gun.DefaultModule.projectiles[0].healthEffect      = (PickupObjectDatabase.GetById(204) as BulletStatusEffectItem).HealthModifierEffect;
                        gun.DefaultModule.projectiles[0].PoisonApplyChance = .25f;
                    }
                }
                if (T == 3)
                {
                    //Quick, power up, sidearm
                    K2 = UnityEngine.Random.Range(0, 4);
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsRail[K2]).gameObject, player);
                        Mono.reloadTime *= .6f;
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsRail[K2]).gameObject, player);
                        Mono.DefaultModule.projectiles[0].baseData.damage *= 1.25f;
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsRail[K2]).gameObject, player);
                        Mono.DefaultModule.numberOfShotsInClip             = 5;
                        Mono.DefaultModule.projectiles[0].baseData.damage *= .33f;
                    }
                }
                if (T == 4)
                {
                    //Critical, backshot, chain gun
                    K2 = UnityEngine.Random.Range(0, 4);
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsRapid[K2]).gameObject, player);
                        gun.PostProcessProjectile += Proj;
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsRapid[K2]).gameObject, player);
                        GunVolleyModificationItem.AddDuplicateOfBaseModule(gun.Volley, player, 1, 7.35f, 180);
                    }
                    if (K2 == 0)
                    {
                        LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(KeyWordsRapid[K2]).gameObject, player);
                        Mono.SetBaseMaxAmmo(Mono.GetBaseMaxAmmo() * 2);
                        Mono.ammo = Mono.GetBaseMaxAmmo();
                        Mono.DefaultModule.cooldownTime = .001f;
                    }
                }
            }
        }
コード例 #27
0
 public Action <Vector2> hegemonyMark(GameActor actor)
 {
     LootEngine.SpawnItem(PickupObjectDatabase.GetById(297).gameObject, actor.specRigidbody.UnitCenter, actor.specRigidbody.UnitCenter, 1f, false, true, false);
     throw new NotImplementedException();
 }
コード例 #28
0
 private void OnGuonHitByBullet(SpeculativeRigidbody myRigidbody, PixelCollider myCollider, SpeculativeRigidbody other, PixelCollider otherCollider)
 {
     if (other.projectile && !(other.projectile.Owner is PlayerController))
     {
         //ETGModConsole.Log("Orbital was hit by a bullet");
         if (RandomlySelectedGuonState == GuonState.GOLD)
         {
             float procChance = 0.1f;
             if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone"))
             {
                 procChance = 0.15f;
             }
             if (UnityEngine.Random.value <= procChance)
             {
                 LootEngine.SpawnItem(PickupObjectDatabase.GetById(68).gameObject, other.specRigidbody.UnitCenter, Vector2.zero, 1f, false, true, false);
             }
         }
         if (RandomlySelectedGuonState == GuonState.BLUE)
         {
             if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone"))
             {
                 if (canDoBlueSynergyRoomDMG)
                 {
                     canDoBlueSynergyRoomDMG = false;
                     List <AIActor> activeEnemies = Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
                     if (activeEnemies != null)
                     {
                         for (int i = 0; i < activeEnemies.Count; i++)
                         {
                             AIActor aiactor = activeEnemies[i];
                             aiactor.healthHaver.ApplyDamage(15, Vector2.zero, "Blue Guon Stone", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                         }
                     }
                     Invoke("resetBlueRoomDMG", 1f);
                 }
             }
         }
         if (RandomlySelectedGuonState == GuonState.GREY)
         {
             if (canDoGreyCollisionDMG && other.projectile.Owner is AIActor)
             {
                 float DMG = 5f;
                 if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone"))
                 {
                     DMG *= 2f;
                 }
                 if ((other.projectile.Owner as AIActor).IsBlackPhantom)
                 {
                     DMG *= 3f;
                 }
                 DMG *= Owner.stats.GetStatValue(PlayerStats.StatType.Damage);
                 (other.projectile.Owner as AIActor).healthHaver.ApplyDamage(DMG, Vector2.zero, "Guon Wrath", CoreDamageTypes.None, DamageCategory.Unstoppable, true, null, false);
                 Invoke("resetGreyCollisionDMG", 0.15f);
             }
         }
         if (RandomlySelectedGuonState == GuonState.RED)
         {
             if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone"))
             {
                 Owner.StartCoroutine(this.HandleMachoDamageBoost(Owner));
             }
         }
         if (RandomlySelectedGuonState == GuonState.INDIGO)
         {
             if (Owner.IsDodgeRolling)
             {
                 PhysicsEngine.SkipCollision = true;
             }
             else
             {
                 float procChance = 0.35f;
                 if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone"))
                 {
                     procChance = 0.6f;
                 }
                 if (UnityEngine.Random.value <= procChance)
                 {
                     EasyBlankType blankType = EasyBlankType.MINI;
                     if (Owner.PlayerHasActiveSynergy("Rainbower Guon Stone") && UnityEngine.Random.value <= 0.2)
                     {
                         blankType = EasyBlankType.FULL;
                     }
                     Owner.DoEasyBlank(this.m_extantOrbital.transform.position, blankType);
                 }
             }
         }
     }
 }
コード例 #29
0
        private void SpawnBomb(Projectile proj)
        {
            PlayerController player = this.Owner;
            AIActor          enemy  = proj.Owner as AIActor;

            if (cooldown == false)
            {
                float value = UnityEngine.Random.Range(0.0f, 1.0f);
                bool  flag  = value < 0.3;
                if (flag || player.HasPickupID(421) || player.HasPickupID(422) || player.HasPickupID(423) || player.HasPickupID(424) || player.HasPickupID(425))
                {
                    if (enemy != null)
                    {
                        cooldown = true;
                        GameManager.Instance.StartCoroutine(StartCooldown());
                        LootEngine.DoDefaultItemPoof(enemy.sprite.WorldBottomCenter, false, true);
                        AkSoundEngine.PostEvent("Play_OBJ_bomb_fuse_01", gameObject);

                        if (player.HasPickupID(109) || player.HasPickupID(364) || player.HasPickupID(170))
                        {
                            SpawnObjectPlayerItem icebombPrefab = PickupObjectDatabase.GetById(109).GetComponent <SpawnObjectPlayerItem>();
                            GameObject            icebombObject = icebombPrefab.objectToSpawn.gameObject;

                            GameObject     icebombObject2 = UnityEngine.Object.Instantiate <GameObject>(icebombObject, enemy.sprite.WorldBottomCenter, Quaternion.identity);
                            tk2dBaseSprite icebombsprite  = icebombObject2.GetComponent <tk2dBaseSprite>();
                            if (icebombsprite)
                            {
                                icebombsprite.PlaceAtPositionByAnchor(enemy.sprite.WorldBottomCenter, tk2dBaseSprite.Anchor.MiddleCenter);
                            }
                        }

                        else if (!player.HasPickupID(109) || !player.HasPickupID(364) || !player.HasPickupID(170))
                        {
                            SpawnObjectPlayerItem bigbombPrefab = PickupObjectDatabase.GetById(108).GetComponent <SpawnObjectPlayerItem>();
                            GameObject            bigbombObject = bigbombPrefab.objectToSpawn.gameObject;

                            GameObject     bigbombObject2 = UnityEngine.Object.Instantiate <GameObject>(bigbombObject, enemy.sprite.WorldBottomCenter, Quaternion.identity);
                            tk2dBaseSprite bombsprite     = bigbombObject2.GetComponent <tk2dBaseSprite>();
                            if (bombsprite)
                            {
                                bombsprite.PlaceAtPositionByAnchor(enemy.sprite.WorldBottomCenter, tk2dBaseSprite.Anchor.MiddleCenter);
                            }
                        }
                    }

                    else
                    {
                        RoomHandler absoluteRoom = player.CurrentRoom;
                        if (absoluteRoom.HasActiveEnemies(RoomHandler.ActiveEnemyType.All))
                        {
                            AIActor randomActiveEnemy = absoluteRoom.GetNearestEnemy(Vector2.zero, out float nearestDistance, true, true);
                            nearestDistance = float.MaxValue;
                            if (randomActiveEnemy != null)
                            {
                                if (player.HasPickupID(109) || player.HasPickupID(364) || player.HasPickupID(170))
                                {
                                    SpawnObjectPlayerItem icebombPrefab = PickupObjectDatabase.GetById(109).GetComponent <SpawnObjectPlayerItem>();
                                    GameObject            icebombObject = icebombPrefab.objectToSpawn.gameObject;

                                    GameObject     icebombObject2 = UnityEngine.Object.Instantiate <GameObject>(icebombObject, randomActiveEnemy.sprite.WorldBottomCenter, Quaternion.identity);
                                    tk2dBaseSprite icebombsprite  = icebombObject2.GetComponent <tk2dBaseSprite>();
                                    if (icebombsprite)
                                    {
                                        icebombsprite.PlaceAtPositionByAnchor(randomActiveEnemy.sprite.WorldBottomCenter, tk2dBaseSprite.Anchor.MiddleCenter);
                                    }
                                }

                                else if (!player.HasPickupID(109) || !player.HasPickupID(364) || !player.HasPickupID(170))
                                {
                                    SpawnObjectPlayerItem bigbombPrefab = PickupObjectDatabase.GetById(108).GetComponent <SpawnObjectPlayerItem>();
                                    GameObject            bigbombObject = bigbombPrefab.objectToSpawn.gameObject;

                                    GameObject     bigbombObject2 = UnityEngine.Object.Instantiate <GameObject>(bigbombObject, randomActiveEnemy.sprite.WorldBottomCenter, Quaternion.identity);
                                    tk2dBaseSprite bombsprite     = bigbombObject2.GetComponent <tk2dBaseSprite>();
                                    if (bombsprite)
                                    {
                                        bombsprite.PlaceAtPositionByAnchor(randomActiveEnemy.sprite.WorldBottomCenter, tk2dBaseSprite.Anchor.MiddleCenter);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #30
0
 private void CreateGuon(PlayerController player)
 {
     if (!player.HasPickupID(264))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(264).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
     else if (!player.HasPickupID(270))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(270).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
     else if (!player.HasPickupID(262))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(262).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
     else if (!player.HasPickupID(269))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(269).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
     else if (!player.HasPickupID(260))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(260).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
     else if (!player.HasPickupID(263))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(263).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
     else if (!player.HasPickupID(466))
     {
         player.healthHaver.ApplyDamage(0.5f, Vector2.zero, "The Infinity Guontlet", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(466).gameObject, player);
         if (player.HasPickupID(565))
         {
             player.RemovePassiveItem(565);
         }
     }
 }