public void UpdateRevaDisplay()
            {
                revaDisplay.updateMode = AnimatorUpdateMode.UnscaledTime;
                //NPE Prevention
                if (ctrl.runCtrl.spCtrl == null)
                {
                    PlayerPrefs.SetInt("RevaDemoEnabled", 0);
                    revaText.text = heroName;
                    revaDisplay.runtimeAnimatorController = this.itemMan.GetAnim(heroAnim);
                    setup = false;
                    return;
                }
                if (!setup)
                {
                    setupCustomsAndSkins();
                    setup = true;
                }
                BeingObject hero = ctrl.runCtrl.spCtrl.heroDictionary[PlayerSelect.getCharacters()[option]];

                revaDisplay.runtimeAnimatorController = this.itemMan.GetAnim(hero.animName);
                revaDisplay.SetTrigger("spawn");
                revaText.text = hero.nameString;
                heroID        = hero.beingID;
                heroAnim      = hero.animName;
                heroName      = hero.nameString;
            }
Пример #2
0
 public static void AddBeing(GameObject gameObject, BeingObject being)
 {
     if (being.type == (BeingType)Enum.Parse(typeof(BeingType), "Boss"))
     {
         Debug.Log("Created CustomBoss component");
         gameObject.AddComponent <CustomBoss>();
     }
 }
            private void setupCustomsAndSkins()
            {
                //Skins handled here (Just Ciel for now)
                Dictionary <string, BeingObject> heroDictionary = ctrl.runCtrl.spCtrl.heroDictionary;
                BeingObject SaffronCiel = heroDictionary["SaffronDemo"].Clone();

                SaffronCiel.animName = "SaffronCiel";
                heroDictionary.Add("SaffronDemoCiel", SaffronCiel);
                ctrl.runCtrl.spCtrl.heroDictionary = heroDictionary;

                //Find characters to add to the menu
                moddedChars.Clear();
                foreach (KeyValuePair <String, BeingObject> entry in heroDictionary)
                {
                    if (entry.Value.tags.Contains("Selectable"))
                    {
                        moddedChars.Add(entry.Value.beingID);
                    }
                }
            }
Пример #4
0
 static void ReadXmlPrototype(ref BeingObject __instance)
 {
     if (__instance.tags.Contains(Tag.Boss) && !customBosses.ContainsKey(__instance.beingID))
     {
         Debug.Log("Found boss tag, adding custom boss to allBosses");
         GameObject customBoss = new GameObject();
         customBoss.AddComponent <DogeBoss>();
         Boss bossComponent = customBoss.GetComponent <Boss>();
         bossComponent.bossID  = __instance.beingID;
         bossComponent.enabled = false;
         customBosses.Add(__instance.beingID, customBoss);
         Debug.Log("Added " + bossComponent.bossID + " to customBosses");
         foreach (var bossObj in customBosses.Values.ToList())
         {
             foreach (var component in bossObj.GetComponents(typeof(Component)))
             {
                 Debug.Log(component.GetType());
             }
         }
     }
 }
Пример #5
0
            public static void Switch(XmlReader reader, BeingObject beingObj)
            {
                switch (reader.Name)
                {
                case "Music":
                    if (!DogeBossData.boss_music.ContainsKey(beingObj.beingID))
                    {
                        DogeBossData.boss_music.Add(beingObj.beingID, new CustomBossMusic(reader));
                    }
                    else
                    {
                        Debug.LogError("Boss " + beingObj.beingID + " can only have one boss music track");
                    }
                    break;

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

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

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

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

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

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

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

                case "ExecutionSpell":
                    if (!DogeBossData.execution_spells.ContainsKey(beingObj.beingID))
                    {
                        DogeBossData.execution_spells.Add(beingObj.beingID, new List <CustomExecution>());
                    }
                    var newExecution = new CustomExecution(reader);
                    DogeBossData.execution_spells[beingObj.beingID].Add(newExecution);
                    break;

                //case "Mercy":
                //    if (!CustomBossIndex.mercy.ContainsKey(beingObj.beingID)) CustomBossIndex.mercy.Add(beingObj.beingID, reader.ReadElementContentAsBoolean());
                //    break;
                case "DontCountKill":
                    if (reader.ReadElementContentAsBoolean())
                    {
                        DogeBossData.kill_not_counted.Add(beingObj.beingID);
                    }
                    break;
                }
            }
Пример #6
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;
                }
            }