// Token: 0x06002BC7 RID: 11207
 public void ShowAreaIcons()
 {
     for (int i = 0; i < GameWorld.Instance.RuntimeAreas.Count; i++)
     {
         RuntimeGameWorldArea runtimeGameWorldArea = GameWorld.Instance.RuntimeAreas[i];
         foreach (MoonGuid guid in RandomizerPlantManager.Plants.Keys)
         {
             RandomizerPlantManager.PlantData plant = RandomizerPlantManager.Plants[guid];
             if (runtimeGameWorldArea.Area.InsideFace(plant.Position))
             {
                 RuntimeWorldMapIcon runtimeWorldMapIcon = null;
                 for (int j = 0; j < runtimeGameWorldArea.Icons.Count; j++)
                 {
                     if (runtimeGameWorldArea.Icons[j].Guid == guid)
                     {
                         runtimeWorldMapIcon = runtimeGameWorldArea.Icons[j];
                         break;
                     }
                 }
                 if (runtimeWorldMapIcon == null && RandomizerPlantManager.Display(guid))
                 {
                     GameWorldArea.WorldMapIcon icon = new GameWorldArea.WorldMapIcon
                     {
                         Guid     = guid,
                         Icon     = WorldMapIconType.Experience,
                         IsSecret = false,
                         Position = plant.Position
                     };
                     runtimeGameWorldArea.Icons.Add(new RuntimeWorldMapIcon(icon, runtimeGameWorldArea));
                 }
                 else if (runtimeWorldMapIcon != null)
                 {
                     runtimeWorldMapIcon.Icon = (RandomizerPlantManager.Display(guid) ? WorldMapIconType.Experience : WorldMapIconType.Invisible);
                 }
             }
         }
         for (int k = 0; k < runtimeGameWorldArea.Icons.Count; k++)
         {
             runtimeGameWorldArea.Icons[k].Hide();
         }
         if (!runtimeGameWorldArea.Area.VisitableCondition || runtimeGameWorldArea.Area.VisitableCondition.Validate(null))
         {
             for (int l = 0; l < runtimeGameWorldArea.Icons.Count; l++)
             {
                 RuntimeWorldMapIcon runtimeWorldMapIcon2 = runtimeGameWorldArea.Icons[l];
                 if (!GameMapUI.Instance.ShowingTeleporters || runtimeWorldMapIcon2.Icon != WorldMapIconType.SavePedestal)
                 {
                     runtimeWorldMapIcon2.Show();
                 }
             }
         }
     }
 }
 // Token: 0x06003837 RID: 14391
 public static bool Display(MoonGuid guid)
 {
     return(RandomizerPlantManager.Display(RandomizerPlantManager.Plants[guid].Id));
 }
    public static void initialize()
    {
        Randomizer.OHKO                 = false;
        Randomizer.ZeroXP               = false;
        Randomizer.BonusActive          = true;
        Randomizer.GiveAbility          = false;
        Randomizer.Chaos                = false;
        Randomizer.ChaosVerbose         = false;
        Randomizer.Returning            = false;
        Randomizer.Sync                 = false;
        Randomizer.ForceMaps            = false;
        Randomizer.SyncMode             = 4;
        Randomizer.StringKeyPickupTypes = new List <string> {
            "TP", "SH", "NO", "WT", "MU", "HN", "WP", "RP", "WS"
        };
        Randomizer.ShareParams = "";
        RandomizerChaosManager.initialize();
        Randomizer.DamageModifier             = 1f;
        Randomizer.Table                      = new Hashtable();
        Randomizer.GridFactor                 = 4.0;
        Randomizer.Message                    = "Good luck on your rando!";
        Randomizer.MessageProvider            = (RandomizerMessageProvider)ScriptableObject.CreateInstance(typeof(RandomizerMessageProvider));
        Randomizer.ProgressiveMapStones       = true;
        Randomizer.ForceTrees                 = false;
        Randomizer.CluesMode                  = false;
        Randomizer.Shards                     = false;
        Randomizer.WorldTour                  = false;
        Randomizer.SeedMeta                   = "";
        Randomizer.MistySim                   = new WorldEvents();
        Randomizer.MistySim.MoonGuid          = new MoonGuid(1061758509, 1206015992, 824243626, -2026069462);
        Randomizer.TeleportTable              = new Hashtable();
        Randomizer.TeleportTable["Forlorn"]   = "forlorn";
        Randomizer.TeleportTable["Grotto"]    = "moonGrotto";
        Randomizer.TeleportTable["Sorrow"]    = "valleyOfTheWind";
        Randomizer.TeleportTable["Grove"]     = "spiritTree";
        Randomizer.TeleportTable["Swamp"]     = "swamp";
        Randomizer.TeleportTable["Valley"]    = "sorrowPass";
        Randomizer.TeleportTable["Ginso"]     = "ginsoTree";
        Randomizer.TeleportTable["Horu"]      = "mountHoru";
        Randomizer.TeleportTable["Glades"]    = "sunkenGlades";
        Randomizer.TeleportTable["Blackroot"] = "mangroveFalls";
        Randomizer.Entrance                   = false;
        Randomizer.DoorTable                  = new Hashtable();
        Randomizer.ColorShift                 = false;
        Randomizer.MessageQueue               = new Queue();
        Randomizer.MessageQueueTime           = 0;
        Randomizer.QueueBash                  = false;
        Randomizer.BashWasQueued              = false;
        Randomizer.BashTap                    = false;
        Randomizer.fragsEnabled               = false;
        Randomizer.LastTick                   = 10000000L;
        Randomizer.LockedCount                = 0;
        Randomizer.ResetTrackerCount          = 0;
        Randomizer.HotCold                    = false;
        Randomizer.HotColdTypes               = new string[] { "EV", "RB17", "RB19", "RB21", "RB28", "SK" };
        Randomizer.HotColdItems               = new Dictionary <int, RandomizerHotColdItem>();
        Randomizer.HotColdMaps                = new List <int>();
        int HotColdSaveId = 2000;

        Randomizer.HoruScene = "";
        Randomizer.HoruMap   = new Hashtable();
        Randomizer.HoruMap["mountHoruStomperSystemsR"]    = 2640380;
        Randomizer.HoruMap["mountHoruProjectileCorridor"] = 1720288;
        Randomizer.HoruMap["mountHoruMovingPlatform"]     = 3040304;
        Randomizer.HoruMap["mountHoruLaserTurretsR"]      = 2160192;
        Randomizer.HoruMap["mountHoruBlockableLasers"]    = -919624;
        Randomizer.HoruMap["mountHoruBigPushBlock"]       = -199724;
        Randomizer.HoruMap["mountHoruBreakyPathTop"]      = -1639664;
        Randomizer.HoruMap["mountHoruFallingBlocks"]      = -959848;
        Randomizer.OpenMode  = true;
        Randomizer.OpenWorld = false;
        RandomizerDataMaps.LoadGladesData();
        RandomizerDataMaps.LoadGinsoData();
        RandomizerDataMaps.LoadForlornData();
        RandomizerDataMaps.LoadHoruData();
        RandomizerDataMaps.LoadValleyData();
        RandomizerColorManager.Initialize();
        RandomizerPlantManager.Initialize();
        RandomizerRebinding.ParseRebinding();
        RandomizerSettings.ParseSettings();
        Randomizer.RelicZoneLookup = new Dictionary <string, string>();
        RandomizerTrackedDataManager.Initialize();
        RandomizerStatsManager.Initialize();
        Randomizer.RelicCount        = 0;
        Randomizer.GrenadeZone       = "MIA";
        Randomizer.StompZone         = "MIA";
        Randomizer.RepeatablePickups = new HashSet <int>();
        Randomizer.StompTriggers     = false;
        Randomizer.SpawnWith         = "";
        Randomizer.IgnoreEnemyExp    = false;
        bool relicCountOverride = false;

        try {
            if (File.Exists("randomizer.dat"))
            {
                string[] allLines = File.ReadAllLines("randomizer.dat");
                string[] flagLine = allLines[0].Split(new char[] { '|' });
                string   s        = flagLine[1];
                string[] flags    = flagLine[0].Split(new char[] { ',' });
                Randomizer.SeedMeta = allLines[0];
                foreach (string rawFlag in flags)
                {
                    string flag = rawFlag.ToLower();
                    if (flag == "ohko")
                    {
                        Randomizer.OHKO = true;
                    }
                    if (flag.StartsWith("worldtour"))
                    {
                        Randomizer.WorldTour = true;
                        if (flag.Contains("="))
                        {
                            relicCountOverride    = true;
                            Randomizer.RelicCount = int.Parse(flag.Substring(10));
                        }
                    }
                    if (flag.StartsWith("sync"))
                    {
                        Randomizer.Sync   = true;
                        Randomizer.SyncId = flag.Substring(4);
                        RandomizerSyncManager.Initialize();
                    }
                    if (flag.StartsWith("frags/"))
                    {
                        Randomizer.fragsEnabled = true;
                        string[] fragParams = flag.Split(new char[]
                        {
                            '/'
                        });
                        Randomizer.maxFrags      = int.Parse(fragParams[2]);
                        Randomizer.fragKeyFinish = int.Parse(fragParams[1]);
                    }
                    if (flag.StartsWith("mode="))
                    {
                        string modeStr = flag.Substring(5).ToLower();
                        int    syncMode;
                        if (modeStr == "shared")
                        {
                            syncMode = 1;
                        }
                        else if (modeStr == "none")
                        {
                            syncMode = 4;
                        }
                        else
                        {
                            syncMode = int.Parse(modeStr);
                        }
                        Randomizer.SyncMode = syncMode;
                    }
                    if (flag.StartsWith("shared="))
                    {
                        Randomizer.ShareParams = flag.Substring(7);
                    }
                    if (flag == "noextraexp")
                    {
                        Randomizer.IgnoreEnemyExp = true;
                    }
                    if (flag == "0xp")
                    {
                        Randomizer.IgnoreEnemyExp = true;
                        Randomizer.ZeroXP         = true;
                    }
                    if (flag == "nobonus")
                    {
                        Randomizer.BonusActive = false;
                    }
                    if (flag == "nonprogressivemapstones")
                    {
                        Randomizer.ProgressiveMapStones = false;
                    }
                    if (flag == "forcetrees")
                    {
                        Randomizer.ForceTrees = true;
                    }
                    if (flag == "forcemaps")
                    {
                        Randomizer.ForceMaps = true;
                    }
                    if (flag == "clues")
                    {
                        Randomizer.CluesMode = true;
                        RandomizerClues.initialize();
                    }
                    if (flag == "shards")
                    {
                        Randomizer.Shards = true;
                    }
                    if (flag == "entrance")
                    {
                        Randomizer.Entrance = true;
                    }
                    if (flag == "closeddungeons")
                    {
                        Randomizer.OpenMode = false;
                    }
                    if (flag == "openworld")
                    {
                        Randomizer.OpenWorld = true;
                    }
                    if (flag.StartsWith("hotcold="))
                    {
                        Randomizer.HotCold      = true;
                        Randomizer.HotColdTypes = flag.Substring(8).Split(new char[] { '+' });
                        Array.Sort(Randomizer.HotColdTypes);
                    }
                    if (flag.StartsWith("sense="))
                    {
                        Randomizer.HotColdTypes = flag.Substring(6).Split(new char[] { '+' });
                        Array.Sort(Randomizer.HotColdTypes);
                    }
                    if (flag == "noaltr")
                    {
                        Randomizer.AltRDisabled = true;
                    }
                    if (flag == "stomptriggers")
                    {
                        Randomizer.StompTriggers = true;
                    }
                }
                for (int i = 1; i < allLines.Length; i++)
                {
                    string[] lineParts = allLines[i].Split(new char[] { '|' });
                    int      coords;
                    int.TryParse(lineParts[0], out coords);
                    if (coords == 2)
                    {
                        SpawnWith = lineParts[1] + lineParts[2];
                        continue;
                    }
                    int index = Array.BinarySearch <string>(Randomizer.HotColdTypes, lineParts[1]);
                    if (index < 0)
                    {
                        index = -index - 1;
                    }
                    while (index < Randomizer.HotColdTypes.Length && Randomizer.HotColdTypes[index].Substring(0, 2) == lineParts[1])
                    {
                        if (Randomizer.HotColdTypes[index] == lineParts[1] || Randomizer.HotColdTypes[index].Substring(2) == lineParts[2])
                        {
                            if (Math.Abs(coords) > 100)
                            {
                                Randomizer.HotColdItems.Add(coords, new RandomizerHotColdItem(Randomizer.HashKeyToVector(coords), HotColdSaveId));
                                HotColdSaveId++;
                            }
                            else
                            {
                                Randomizer.HotColdMaps.Add(coords);
                            }
                        }
                        index++;
                    }
                    if (Randomizer.StringKeyPickupTypes.Contains(lineParts[1]))
                    {
                        Randomizer.Table[coords] = new RandomizerAction(lineParts[1], lineParts[2]);
                        if (lineParts[1] == "WT")
                        {
                            Randomizer.RelicZoneLookup[lineParts[2]] = lineParts[3];
                            if (!relicCountOverride)
                            {
                                Randomizer.RelicCount++;
                            }
                        }
                        if (lineParts[1] == "RP")
                        {
                            Randomizer.RepeatablePickups.Add(coords);
                        }
                    }
                    else
                    {
                        int id;
                        int.TryParse(lineParts[2], out id);
                        if (lineParts[1] == "EN")
                        {
                            // door entries are coord|EN|targetX|targetY
                            int doorY;
                            int.TryParse(lineParts[3], out doorY);
                            Randomizer.DoorTable[coords] = new Vector3((float)id, (float)doorY);
                        }
                        else
                        {
                            Randomizer.Table[coords] = new RandomizerAction(lineParts[1], id);
                            if (lineParts[1] == "SK")
                            {
                                if (id == 51)
                                {
                                    GrenadeZone = lineParts[3];
                                }
                                else if (id == 4)
                                {
                                    StompZone = lineParts[3];
                                }
                            }
                            if (Randomizer.CluesMode && lineParts[1] == "EV" && id % 2 == 0)
                            {
                                RandomizerClues.AddClue(lineParts[3], id / 2);
                            }
                        }
                    }
                }
                Randomizer.HotColdMaps.Sort();
                if (Randomizer.CluesMode)
                {
                    RandomizerClues.FinishClues();
                }
            }
            else
            {
                Randomizer.printInfo("Error: randomizer.dat not found");
            }
        }
        catch (Exception e) {
            Randomizer.printInfo("Error parsing randomizer.dat:" + e.Message, 300);
        }
        RandomizerBonusSkill.Reset();
    }
Exemple #4
0
    // Token: 0x060017AC RID: 6060 RVA: 0x0007AAFC File Offset: 0x00078CFC
    public override void OnRecieveDamage(Damage damage)
    {
        bool terrain = (damage.Type == DamageType.Crush || damage.Type == DamageType.Spikes || damage.Type == DamageType.Lava || damage.Type == DamageType.Laser);

        if (this.Entity is Enemy && !(terrain || damage.Type == DamageType.Projectile || damage.Type == DamageType.Enemy))
        {
            RandomizerBonus.DamageDealt(Math.Max(Math.Min(this.Health / 4f, damage.Amount), 0f));
        }
        this.OnModifyDamage(damage);
        if (damage.Type == DamageType.Enemy)
        {
            return;
        }
        if (damage.Type == DamageType.Projectile)
        {
            damage.SetAmount(damage.Amount * 4f);
        }
        if (damage.Type == DamageType.Spikes || damage.Type == DamageType.Lava)
        {
            damage.SetAmount(1000f);
        }
        if (this.Entity.gameObject != base.gameObject)
        {
            damage.DealToComponents(this.Entity.gameObject);
        }
        base.OnRecieveDamage(damage);
        if (base.NoHealthLeft)
        {
            EntityDamageReciever.OnEntityDeathEvent(this.Entity);
            if (damage.Type == DamageType.Projectile && this.Entity is Enemy)
            {
                Projectile component = damage.Sender.GetComponent <Projectile>();
                if (component != null && component.HasBeenBashedByOri)
                {
                    AchievementsLogic.Instance.OnProjectileKilledEnemy();
                }
                if (component != null && !component.HasBeenBashedByOri)
                {
                    AchievementsLogic.Instance.OnEnemyKilledAnotherEnemy();
                }
            }
            if (terrain)
            {
                Type type = this.Entity.GetType();
                if (type != typeof(DropSlugEnemy) && type != typeof(KamikazeSootEnemy) && !base.gameObject.name.ToLower().Contains("wall"))
                {
                    AchievementsLogic.Instance.OnEnemyKilledItself();
                }
            }
            if (this.Entity is Enemy)
            {
                RandomizerStatsManager.OnKill(damage.Type);
                if (damage.Type == DamageType.ChargeFlame)
                {
                    if (Characters.Sein && Characters.Sein.Abilities.Dash)
                    {
                        if (Characters.Sein.Abilities.Dash.CurrentState == SeinDashAttack.State.ChargeDashing)
                        {
                            AchievementsLogic.Instance.OnChargeDashKilledEnemy();
                        }
                        else
                        {
                            AchievementsLogic.Instance.OnChargeFlameKilledEnemy();
                        }
                    }
                    else
                    {
                        AchievementsLogic.Instance.OnChargeFlameKilledEnemy();
                    }
                }
                else if ((damage.Type == DamageType.Stomp && damage.Force.y < 0f) || damage.Type == DamageType.StompBlast)
                {
                    AchievementsLogic.Instance.OnStompKilledEnemy();
                }
                else if (damage.Type == DamageType.SpiritFlameSplatter || damage.Type == DamageType.SpiritFlame)
                {
                    AchievementsLogic.Instance.OnSpiritFlameKilledEnemy();
                }
                else if (damage.Type == DamageType.Grenade)
                {
                    AchievementsLogic.Instance.OnGrenaedKilledEnemy();
                }
            }
            if (this.Entity is PetrifiedPlant)
            {
                Randomizer.getPickup(this.Entity.Position);
                RandomizerPlantManager.DestroyPlant(this.Entity.MoonGuid);
            }
        }
    }