Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        disarmButton.OnInteract += delegate {
            audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, transform);
            isPressedDisarm = true;
            return(false);
        };
        disarmButton.OnInteractEnded += delegate
        {
            disarmButton.AddInteractionPunch();
            audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonRelease, transform);
            isPressedDisarm = false;
            if (hasActivated)
            {
                syncSolveTester.DisarmAll();
            }
        };
        modSelf.OnActivate += delegate
        {
            // Setup Global Interaction
            KMBomb bombAlone = entireModule.GetComponentInParent <KMBomb>();            // Get the bomb that the module is attached on. Required for intergration due to modified value.
            //Required for Multiple Bombs stable interaction in case of different bomb seeds.

            if (!groupedSyncSolveTesters.ContainsKey(bombAlone))
            {
                groupedSyncSolveTesters[bombAlone] = new SyncSolveGlobal();
            }
            syncSolveTester = groupedSyncSolveTesters[bombAlone];
            syncSolveTester.syncSolveMods.Add(this);

            // Start Main Handling
            StartCoroutine(HandleGlobalModule());
            hasActivated = true;
        };
    }
Beispiel #2
0
    public string[] GetAttachedIgnoredModuleIDs(string moduleName, string[] @default = null)
    {
        string[] modNamesIgnored = GetIgnoredModules(moduleName, @default);
        // Redirect to KM Boss Module for standard boss module handling.

        if (Application.isEditor)
        {
            return(@default ?? new string[0]);
        }


        KMBomb bombAttached = gameObject.GetComponentInParent <KMBomb>();

        if (bombAttached == null)
        {
            Debug.LogFormat("[KMBossModuleExtensions] Unable to grab ignored mod IDs for “{0}” because KMBomb does not exist.", moduleName);
            return(@default ?? new string[0]);
        }
        KMBombModule[] allSolvables = bombAttached.gameObject.GetComponentsInChildren <KMBombModule>();
        if (allSolvables == null || !allSolvables.Any())
        {
            Debug.LogFormat("[KMBossModuleExtensions] Unable to grab ignored mod IDs for “{0}” because there are no solvable modules.", moduleName);
            return(@default ?? new string[0]);
        }
        string[] output = allSolvables.Where(a => modNamesIgnored.Contains(a.ModuleDisplayName)).Select(a => a.ModuleType).Distinct().ToArray();
        Debug.LogFormat("[KMBossModuleExtensions] Successfully grabbed ALL ignored module ids from the given bomb for “{0}”. Returning this: {1}", moduleName, output == null || !output.Any() ? "<null>" : output.Join(", "));
        return(output);
    }
Beispiel #3
0
 /// <summary>
 /// Attempts to remove a solved bomb from play, may fail if bomb not found or only one bomb remaining and not freeplay mode
 /// </summary>
 public bool RemoveSolvedBomb(KMBomb bomb)
 {
     if (OnRemoveSolvedBomb != null)
     {
         return(OnRemoveSolvedBomb(bomb));
     }
     return(false);
 }
    // Use this for initialization
    void Start()
    {
        KMBomb bombAlone = entireModule.GetComponentInParent <KMBomb>();        // Get the bomb that the module is attached on. Required for intergration due to modified value.

        //Required for Multiple Bombs stable interaction in case of identical bomb seeds.

        if (!groupedSingularityWires.ContainsKey(bombAlone))
        {
            groupedSingularityWires[bombAlone] = new SingularityWireInfo();
        }
        wireInfo = groupedSingularityWires[bombAlone];
        wireInfo.singularityWires.Add(this);
        colorblindDetected = colorblindMode.ColorblindModeActive;
        StartCoroutine(HandleGlobalModule());
    }
 void Start()
 {
     disarmButton.OnInteract += delegate {
         audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, transform);
         isPressedDisarm = true;
         return(false);
     };
     disarmButton.OnInteractEnded += delegate
     {
         disarmButton.AddInteractionPunch(1f);
         audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonRelease, transform);
         isPressedDisarm = false;
         if (isSolved)
         {
             if (!hasDisarmed)
             {
                 Debug.LogFormat("[Singularity Button #{0}]: Module disarmed.", curmodID);
                 string[] possibleDisarmMessages = { "MODULE\nDISARMED", "CHECK\nYOUR\nMODULES" };
                 textDisarm.text = possibleDisarmMessages.PickRandom();
                 disarmBacking.material.color = Color.green * 0.5f;
             }
             modSelf.HandlePass();
             hasDisarmed = true;
         }
     };
     buttonFront.OnInteract += delegate
     {
         audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.BigButtonPress, transform);
         if (!isSolved && hasActivated && !singularityButtonInfo.canDisarm)
         {
             singularityButtonInfo.HandleInteraction(this, (int)bombInfo.GetTime());
         }
         isPressedMain = true;
         onHoldState   = hasActivated;
         return(false);
     };
     buttonFront.OnInteractEnded += delegate
     {
         audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.BigButtonRelease, transform);
         buttonFront.AddInteractionPunch();
         if (!isSolved && hasActivated && onHoldState && !singularityButtonInfo.canDisarm)
         {
             singularityButtonInfo.HandleInteraction(this, (int)bombInfo.GetTime());
             singularityButtonInfo.HandleButtonRelease();
         }
         isPressedMain = false;
     };
     modSelf.OnActivate += delegate
     {
         textDisarm.text = "";
         // Setup Global Interaction
         KMBomb bombAlone = entireModule.GetComponentInParent <KMBomb>();            // Get the bomb that the module is attached on. Required for intergration due to modified value.
         //Required for Multiple Bombs stable interaction in case of different bomb seeds.
         if (!groupedSingularityButtons.ContainsKey(bombAlone))
         {
             groupedSingularityButtons[bombAlone] = new SingularityButtonInfo();
         }
         singularityButtonInfo = groupedSingularityButtons[bombAlone];
         singularityButtonInfo.singularButtons.Add(this);
         // Start Main Handling
         //AddOthersModulesOntoList();
         StartCoroutine(HandleGlobalModule());
     };
     bombInfo.OnBombExploded += delegate
     {
         singularityButtonInfo.StopAll();
         StopAllCoroutines();
     };
     lightStrike.range *= modSelf.transform.lossyScale.x;
     textDisarm.text    = "";
     hasActivated       = true;
 }
Beispiel #6
0
    void Start()
    {
        disarmButton.OnInteract += delegate {
            audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, transform);
            isPressedDisarm = true;
            return(false);
        };
        disarmButton.OnInteractEnded += delegate
        {
            disarmButton.AddInteractionPunch(1f);
            audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonRelease, transform);
            isPressedDisarm = false;
            if (isSolved)
            {
                modSelf.HandlePass();
                hasDisarmed = true;
            }
        };
        buttonFront.OnInteract += delegate
        {
            audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.BigButtonPress, transform);
            if (!isSolved && hasActivated)
            {
                singularityButtonInfo.HandleInteraction(this, (int)bombInfo.GetTime());
            }
            isPressedMain = true;
            onHoldState   = hasActivated;
            return(false);
        };
        buttonFront.OnInteractEnded += delegate
        {
            audioSelf.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.BigButtonRelease, transform);
            buttonFront.AddInteractionPunch();
            if (!isSolved && hasActivated && onHoldState)
            {
                singularityButtonInfo.HandleInteraction(this, (int)bombInfo.GetTime());
            }
            isPressedMain = false;
        };
        modSelf.OnActivate += delegate
        {
            // Setup Global Interaction
            KMBomb bombAlone = entireModule.GetComponentInParent <KMBomb>();            // Get the bomb that the module is attached on. Required for intergration due to modified value.
            //Required for Multiple Bombs stable interaction in case of different bomb seeds.

            if (!groupedSingularityButtons.ContainsKey(bombAlone))
            {
                groupedSingularityButtons[bombAlone] = new SingularityButtonInfo();
            }
            singularityButtonInfo = groupedSingularityButtons[bombAlone];
            singularityButtonInfo.singularButtons.Add(this);
            colorblindDetected = colorblindMode.ColorblindModeActive;
            // Start Main Handling
            //AddOthersModulesOntoList();
            StartCoroutine(HandleGlobalModule());
            hasActivated = true;
        };
        bombInfo.OnBombExploded += delegate
        {
            singularityButtonInfo.StopAll();
        };
    }