Beispiel #1
0
    // Use this for initialization
    // ReSharper disable once UnusedMember.Local
    private void Start()
    {
        StartCoroutine(TwitchPlays.Refresh());
        _modSettings = new ModSettings(BombModule);
        _modSettings.ReadSettings();
        _movements = gameObject.AddComponent <CoroutineQueue>();
        BombModule.GenerateLogFriendlyName();

        Locations.Shuffle();
        SetMaze(0); //Hide the walls now.

        BombModule.OnActivate += Activate;
        FakeStatusLight        = Instantiate(FakeStatusLight);

        if (BombModule != null)
        {
            FakeStatusLight.Module = BombModule;
        }

        FakeStatusLight.PassColor          = _modSettings.Settings.SolvedState;
        FakeStatusLight.FailColor          = _modSettings.Settings.StrikeState;
        FakeStatusLight.OffColor           = _modSettings.Settings.OffState;
        FakeStatusLight.MorseTransmitColor = _modSettings.Settings.MorseXmitState;


        FakeStatusLight.GetStatusLights(StatusLight);
        FakeStatusLight.SetInActive();

        _currentLocation = Locations[0];
        _destination     = Locations[1];
        StartCoroutine(MoveStatusLightToStart());
    }
Beispiel #2
0
    private void Start()
    {
        for (int childIndex = 0; childIndex < KMSelectable.Children.Length; ++childIndex)
        {
            KMSelectable childSelectable = KMSelectable.Children[childIndex];
            SetupSelectableNote(childSelectable, (Semitone)childIndex);
        }

        _isCruel = GenerateCruelness();

        KMBombModule.ModuleDisplayName = _isCruel ? "Cruel Piano Keys" : "Piano Keys";
        KMBombModule.ModuleType        = _isCruel ? "CruelPianoKeys" : "PianoKeys";

        KMBombModule.GenerateLogFriendlyName();

        SetupMaterial();
        MusicSymbol[] pickedSymbols = PianoIndicator.PickSymbols(_isCruel);

        StringBuilder logString = new StringBuilder();

        logString.Append("Module generated with the following symbols: ");
        logString.Append(string.Join(", ", pickedSymbols.Select((x) => x.GetDescription()).ToArray()));

        KMBombModule.Log(logString.ToString());
    }
 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));
 }
 public static void Log(this KMBombModule module, object message)
 {
     if (module.GetIDNumber() == 0)
     {
         module.GenerateLogFriendlyName();
     }
     Debug.LogFormat("[{0}] {1}", module.name, message);
 }
    private void Awake()
    {
        _bombModule = GetComponent <KMBombModule>();
        _audio      = GetComponent <KMAudio>();
        _selectable = GetComponent <KMSelectable>();

        _displayBar = GetComponentInChildren <TangramDisplayBar>(true);
        _smoke      = GetComponentInChildren <ParticleSystem>(true);

        _bombModule.GenerateLogFriendlyName();

        RandomizePuzzle();
    }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     colorLookup = BigCircleRuleSet.Rules;
     BombModule.GenerateLogFriendlyName();
     _rotateCounterClockwise          = Rnd.value < 0.5;
     WedgeRenderers[0].material.color = Color.cyan;
     _colors.Shuffle();
     for (var i = 0; i < 8; i++)
     {
         WedgeRenderers[i].material.color = _wedgeColors[(int)_colors[i]];
         var j = _colors[i];
         Wedges[i].OnInteract += delegate { HandleWedge(j); return(false); };
     }
     //BombModule.LogFormat("Colors in Clockwise order: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", _colors[0], _colors[1], _colors[2], _colors[3], _colors[4], _colors[5], _colors[6], _colors[7]);
     BombModule.OnActivate += delegate { _activated = true; StartCoroutine(SpinCircle()); StartCoroutine(UpdateSolution()); };
 }
    // Use this for initialization
    private void Start()
    {
        MorseAMazeRuleGenerator.GenerateRules(RuleSeed.GetRNG());
        StartCoroutine(TwitchPlays.Refresh());
        _modSettings = new ModSettings(BombModule);
        _modSettings.ReadSettings();
        BombModule.GenerateLogFriendlyName();

        Locations.Shuffle();
        SetMaze(0); //Hide the walls now.

        BombModule.OnActivate += Activate;
        FakeStatusLight        = Instantiate(FakeStatusLight);
        FakeStatusLight.transform.SetParent(transform, false);

        if (BombModule != null)
        {
            FakeStatusLight.Module = BombModule;
        }

        EnableColorblindMode(GetComponent <KMColorblindMode>().ColorblindModeActive);


        FakeStatusLight.GetStatusLights(StatusLight);
        FakeStatusLight.SetInActive();

        _currentLocation = Locations[0];
        _destination     = Locations[1];
        StartCoroutine(MoveStatusLightToStart());

        var pass   = _forcedSolvePassword.ToList();
        var offset = 0;

        foreach (var c in BombInfo.GetSerialNumber())
        {
            if (c >= 'A' && c <= 'Z')
            {
                pass.Insert(c - 'A' + offset + 1, c);
            }
            else
            {
                pass.Insert(c - '0' + offset, c);
            }
            offset += 5;
        }
        _forcedSolvePassword = string.Join("", pass.Select(x => x.ToString()).ToArray());
    }
    private void Awake()
    {
        _module = GetComponent <KMBombModule>();
        _module.GenerateLogFriendlyName();
        _module.Log("There is some art to appreciate.");

        _info = GetComponent <KMBombInfo>();
        _info.OnBombExploded += OnBombExploded;

        _audio = GetComponent <KMAudio>();

        _mainCameraTransform          = Camera.main.transform;
        _appreciationRequiredDuration = UnityEngine.Random.Range(MinimumAppreciationTime, MaximumAppreciationTime);

        try
        {
            _defaultGameMusicVolume = GameMusicControl.GameMusicVolume;
        }
        catch (Exception)
        {
        }
    }
    private void Awake()
    {
        _bombModule = GetComponent <KMBombModule>();
        _bombInfo   = GetComponent <KMBombInfo>();
        _selectable = GetComponent <KMSelectable>();
        _painting   = GetComponentInChildren <Painting>();

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

        _paletteColors = GetComponentsInChildren <PaletteColor>();
        foreach (PaletteColor paletteColor in _paletteColors)
        {
            PaletteColor closurePaletteColor = paletteColor;
            closurePaletteColor.fluidSelectable.selectable.OnInteract += delegate()
            {
                _activeColor = closurePaletteColor.colorOption;
                return(true);
            };
        }

        Repaint();
    }
Beispiel #10
0
    // Use this for initialization
    void Start()
    {
        BigCircleRuleGenerator.CreateRules(RuleSeed.GetRNG());
        _colorblindMode = GetComponent <KMColorblindMode>().ColorblindModeActive;
        colorLookup     = BigCircleRuleGenerator.Rules;
        BombModule.GenerateLogFriendlyName();
        _rotateCounterClockwise          = Rnd.value < 0.5;
        WedgeRenderers[0].material.color = Color.cyan;
        _colors.Shuffle();
        for (var i = 0; i < 8; i++)
        {
            WedgeRenderers[i].material.color = _wedgeColors[(int)_colors[i]];
            var j = _colors[i];
            var k = i;
            Wedges[i].OnInteract += delegate
            {
                Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, Wedges[k].transform);
                _holdTime = 0;
                return(false);
            };
            Wedges[i].OnInteractEnded += delegate { HandleWedge(j); };

            //Colorblind mode
            WedgeTextMeshes[i].gameObject.SetActive(_colorblindMode);
            WedgeTextMeshes[i].text  = _colorNames[(int)_colors[i]];
            WedgeTextMeshes[i].color = _wedgeColors[(int)_colors[i]];
        }

        //BombModule.LogFormat("Colors in Clockwise order: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", _colors[0], _colors[1], _colors[2], _colors[3], _colors[4], _colors[5], _colors[6], _colors[7]);
        BombModule.OnActivate += delegate
        {
            _activated  = true;
            _spinCircle = StartCoroutine(SpinCircle());
            StartCoroutine(UpdateSolution());
        };
    }
 void Awake()
 {
     BombModule.GenerateLogFriendlyName();
 }
    // 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);
    }