コード例 #1
0
 public static void Log(this KMBombModule module, object message)
 {
     if (module.GetIDNumber() == 0)
     {
         module.GenerateLogFriendlyName();
     }
     Debug.LogFormat("[{0}] {1}", module.name, message);
 }
コード例 #2
0
 public static void LogFormat(this KMBombModule module, string format, params object[] args)
 {
     if (module.GetIDNumber() == 0)
     {
         module.GenerateLogFriendlyName();
     }
     Debug.LogFormat("[{0}] {1}", module.name, string.Format(format, args));
 }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        _modSettings = new ModSettings(BombModule);
        _modSettings.ReadSettings();

        BombModule.GenerateLogFriendlyName();
        BombModule.OnActivate += OnActivate;

        _incident = _modSettings.Settings.DebugMode
            ? _incidents[Rnd.Range(1, _incidents.Length)]
            : _incidents[((BombModule.GetIDNumber() - 1) % (_incidents.Length - 1)) + 1];

        _characters = new List <Character>
        {
            //             Name                  Di  Ra  Heroine   Forbidden Incident
            new Character("Crow Tengu", 3, 2, true),
            new Character("Elegant Maid", 3, 3, true),
            new Character("Gatekeeper", 2, 1),
            new Character("Great Librarian", 2, 3),
            new Character("Great Magician", 5, 5),
            //             Name                  Di  Ra  Heroine   Forbidden Incident
            new Character("Green Shaman", 2, 3, true, Incidents.EndlessParty),
            new Character("Heavenly Swordgirl", 4, 5, Incidents.CosmicWeather),
            new Character("Ice Fairy", 1, 2, true, Incidents.FairyWars),
            new Character("Kappa", 1, 2),
            new Character("Legendary Student", 4, 4, Incidents.OccultInvasion),
            //             Name                  Di  Ra  Heroine   Forbidden Incident
            new Character("Lunar Doctor", 1, 3, Incidents.OverdrivenNight),
            new Character("Moon Rabbit", 2, 2, true, Incidents.OverdrivenNight),
            new Character("Ordinary Magician", 2, 4, true),
            new Character("Phoenix", 4, 3),
            new Character("Puppeteer", 3, 1),
            //             Name                  Di  Ra  Heroine   Forbidden Incident
            new Character("Red Shaman", 3, 5, true, Incidents.EndlessParty),
            new Character("Satori", 1, 2),
            new Character("Scarlet Devil", 2, 1, Incidents.ScarletMist),
            new Character("Scarlet Sister", 3, 1, Incidents.ScarletMist),
            new Character("Unidentified Girl", 5, 4, Incidents.UndefinedFantasticObject),
        };

        _incidedentSets = new List <IncidentSet>
        {
            new IncidentSet(),
            //                Incident Name                (Boss #1   Boss Name             BASE     Bonus    Widget)      (Boss #2  Boss name           Base     Bonus    Widget)  Bonus Reason              //
            //                                                                             Di  Ra    Di  Ra   Di  Ra                                    Di  Ra    Di  Ra   Di  Ra)
            new IncidentSet("Cosmic Weather", new Boss("Heavenly Swordgirl", 12, 14, 1, 1, 3, 3), "season"),
            new IncidentSet("Endless Party", new Boss("Green Shaman", 6, 14, 0, 0, 2, 1), new Boss("Red Shaman", 7, 13, 0, 0, 0, 1), ""),
            new IncidentSet("Fairy Wars", new Boss("Ice Fairy", 7, 8, 1, 1, 1, 1), new Boss("Sunflower Fairy", 8, 9, 1, 2, 1, 1), "season"),
            new IncidentSet("Lily Black and White", new Boss("Lily Black", 13, 12, 1, 1, 2, 1), new Boss("Lily White", 12, 13, 2, 0, 1, 2), "season"),
            new IncidentSet("Lunar War", new Boss("Lunar King", 11, 12, 1, 1, 3, 2), new Boss("Lunar Queen", 12, 11, 1, 1, 2, 3), "serial number digit sum"),

            //                Incident Name                (Boss #1   Boss Name             BASE     Bonus    Widget)      (Boss #2  Boss name           Base     Bonus    Widget)  Bonus Reason              //
            //                                                                             Di  Ra    Di  Ra   Di  Ra                                    Di  Ra    Di  Ra   Di  Ra)
            new IncidentSet("Occult Invasion", new Boss("Legendary Student", 11, 12, 1, 2, 3, 3), "season"),
            new IncidentSet("Overdriven Night", new Boss("Lunar Doctor", 14, 12, 0, 0, 2, 3), new Boss("Moon Rabbit", 12, 13, 0, 0, 2, 3), ""),
            new IncidentSet("Undefined Fantastic Object", new Boss("Undefined Girl", 12, 12, 0, 0, 3, 4), new Boss("Fantastic Girl", 14, 13, 0, 0, 1, 2), ""),
            new IncidentSet("Scarlet Mist", new Boss("Scarlet Devil", 14, 13, 0, 0, 3, 3), new Boss("Scarlet Sister", 12, 14, 0, 0, 3, 3), ""),
            new IncidentSet("Worldly Desires", new Boss("Wise Hermit", 12, 15, 0, 0, 3, 1), new Boss("Wicked Hermit", 13, 16, 0, 0, 4, 2), "")
        };

        _inventoryItems = new List <Inventory>
        {   //              Name              Di  Ra
            new Inventory("Flower", -2, 2),
            new Inventory("Glove", 2, 2),
            new Inventory("Gohei", 4, 5),
            new Inventory("Grimoire", -2, 4),
            new Inventory("Hisou Sword", 2, 3),
            //              Name              Di  Ra
            new Inventory("Ice", 3, 3),
            new Inventory("Jeweled Pagoda", 5, 6),
            new Inventory("Keystone", 5, 5),
            new Inventory("Lunar Cape", 4, 4),
            new Inventory("Mini-Hakkero", -2, 8),
            //              Name              Di  Ra
            new Inventory("Miracle Mallet", 3, 4),
            new Inventory("Nimble Cloth", 8, 1),
            new Inventory("Rock", 1, 3),
            new Inventory("Occult Orb", 4, 7),
            new Inventory("Seal", 6, 5),
            //              Name              Di  Ra
            new Inventory("Soul Torch", 3, 1),
            new Inventory("Sunflower", 1, 2),
            new Inventory("Trident", 2, 3),
            new Inventory("UFO", 5, 5),
            new Inventory("Yin-Yang Orb", 3, 6),
        };

        IdleScreens = new List <DisplayScreens>
        {
            new DisplayScreens("It is Time", "To Resolve", "Some Incidents!"),
            new DisplayScreens("That Character", "Did Not Spill", "A Drop Of Sake!"),
            new DisplayScreens("Did You", "hear An Incident", "occurred Nearby?"),
            new DisplayScreens("Have you", "ever wonder what a", "youkai is like?"),
            new DisplayScreens("Sorry, Characters.", "It is that", "time again..."),
            new DisplayScreens("Extra! Extra!", "Nothing Really Happened!", "Still an Extra!"),
            new DisplayScreens("Three Characters?", "This must be", "an incident!"),
            new DisplayScreens("This Must Be", "Some Kind", "Of Incident"),
            new DisplayScreens("This Must Be", "The Youkai's", "Doing Again."),
            new DisplayScreens("That's Sweet!", "I only get", "Weekends Off, Though..."),
            new DisplayScreens("I'll Tell You", "My Weakness...", "It's Nothing."),
            new DisplayScreens("Your surrounding", "are full of", "unnatural naturalness."),
            new DisplayScreens("Oh No.", "Toshi!", "Where Are You??", 0, 10),
            new DisplayScreens("Resolving Incidents", "By Toshi", "and CaitSith2", 0, 5),
            new DisplayScreens("Thank You", "For Resolving Incidents", "With Us!", 0, 1)
        };

        SolvedScreens = new List <DisplayScreens>
        {
            new DisplayScreens("Well Done!", "You Are Victorious", "Heroine!"),
            new DisplayScreens("Congratulations!", "The Incident Is Now", "Resolved!"),
            new DisplayScreens("Congratulations!", "You Have Well Played", "This Round!"),
            new DisplayScreens("20,000,000 points!", "Spell Card Bonus Get!", "20,000,000 points"),
            new DisplayScreens("Extra! Extra!", "The Heroine Defeats", "The Incidents's Boss"),
            new DisplayScreens("Extra! Extra!", "The Heroine Resolves", "The Incident!"),
            new DisplayScreens("Extra! Extra!", "The Boss is Defeated", "Incident Resolved!"),
            new DisplayScreens("!     !     ! ", "This  Incident is Resolved", "!     !     ! ")
        };

        InventoryLeft.OnInteract  += () => HandleInventory(true);
        InventoryRight.OnInteract += () => HandleInventory(false);
        WinButton.OnInteract      += () => ResolveIncident(IncidentResult.Win);
        LoseButton.OnInteract     += () => ResolveIncident(IncidentResult.Loss);
        OffLED.SetActive(true);
        OnLED.SetActive(false);

        int screenChance = Rnd.Range(0, 100);

        IdleScreens.OrderBy(x => Rnd.value).First(y => screenChance >= y.MinChance && screenChance < y.MaxChance).UpdateScreens(ref CharacterText, ref IncidentText, ref InventoryText);
    }