コード例 #1
0
 public static bool LoopRunPrefix(RunCtrl __instance)
 {
     CustomZoneUtil.TriggerZoneEvent("Loop");
     if (__instance.currentRun != null)
     {
         __instance.currentRun.unvisitedWorldNames.Clear();
     }
     if (CustomZoneUtil.currentCampaign != "Default")
     {
         __instance.currentRun.visitedWorldNames.Clear();
         ++__instance.currentRun.loopNum;
         CustomZoneUtil.GenerateCampaignWorlds();
         __instance.currentRun.Loop();
         if (__instance.ctrl.currentPlayer.beingObj.tags.Contains(Tag.Shopkeeper))
         {
             __instance.currentRun.yamiObtained = true;
         }
         __instance.ResetWorld(__instance.currentWorld.nameString);
         __instance.StartZone(__instance.currentRun.zoneNum, __instance.currentZoneDot, true);
         if (__instance.currentRun.loopNum > SaveDataCtrl.Get <int>("MostLoops"))
         {
             SaveDataCtrl.Set <int>("MostLoops", __instance.currentRun.loopNum);
         }
         if (__instance.currentRun.loopNum > SaveDataCtrl.Get <int>(__instance.ctrl.currentHeroObj.nameString + "MostLoops"))
         {
             SaveDataCtrl.Set <int>(__instance.ctrl.currentHeroObj.nameString + "MostLoops", __instance.currentRun.loopNum);
         }
         return(false);
     }
     return(true);
 }
コード例 #2
0
            public static void Switch(XmlReader reader, BeingObject beingObj)
            {
                switch (reader.Name)
                {
                case "FaceRight":
                    CustomBossIndex.face_right.Add(beingObj.beingID);
                    break;

                case "Unlocks":
                    var heroID = beingObj.nameString.Replace("Boss", "");
                    if (S.I.spCtrl.heroDictionary.ContainsKey(heroID))
                    {
                        S.I.spCtrl.heroDictionary[heroID].tags.Remove(Tag.Unlock);
                    }
                    break;

                case "DebugUnlocks":
                    var heroID2 = beingObj.nameString.Replace("Boss", "");
                    SaveDataCtrl.Set <bool>(heroID2, false);
                    break;

                case "Music":
                    if (!CustomBossIndex.boss_music.ContainsKey(beingObj.beingID))
                    {
                        var content = reader.ReadElementContentAsString();
                        if (!string.IsNullOrEmpty(content))
                        {
                            CustomBossIndex.boss_music.Add(beingObj.beingID, content);
                        }
                    }
                    break;

                case "SerifMode":
                    if (reader.ReadElementContentAsBoolean())
                    {
                        Debug.Log("Serif mode boss added with ID" + beingObj.beingID);
                        CustomBossIndex.serif_mode_bosses.Add(beingObj.beingID);
                    }
                    break;

                case "FinalBoss":
                    if (reader.ReadElementContentAsBoolean())
                    {
                        CustomBossIndex.final_bosses.Add(beingObj.beingID);
                    }
                    break;

                case "IntroLine":
                    if (!CustomBossIndex.intro_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.intro_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.intro_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "ExecutionLine":
                    if (!CustomBossIndex.execution_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.execution_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.execution_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "SpareLine":
                    if (!CustomBossIndex.spare_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.spare_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.spare_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "DownedLine":
                    if (!CustomBossIndex.defeated_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.defeated_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.defeated_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "FlawlessLine":
                    if (!CustomBossIndex.perfect_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.perfect_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.perfect_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "KilledLine":
                    if (!CustomBossIndex.genocide_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.genocide_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.genocide_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "MercyLine":
                    if (!CustomBossIndex.mercy_lines.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.mercy_lines.Add(beingObj.beingID, new List <string>());
                    }
                    CustomBossIndex.mercy_lines[beingObj.beingID].Add(reader.ReadElementContentAsString());
                    break;

                case "Mercy":
                    if (!CustomBossIndex.mercy.ContainsKey(beingObj.beingID))
                    {
                        CustomBossIndex.mercy.Add(beingObj.beingID, reader.ReadElementContentAsBoolean());
                    }
                    break;

                case "DontCountKill":
                    if (reader.ReadElementContentAsBoolean())
                    {
                        CustomBossIndex.kill_not_counted.Add(beingObj.beingID);
                    }
                    break;
                }
            }