public TimezoneShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _buttons   = _component.GetValue <KMSelectable[]>("buttons");
     _submit    = _component.GetValue <KMSelectable>("InputButton");
 }
Example #2
0
 public ErrorCodesComponentSolver(BombCommander bombCommander, BombComponent bombComponent) :
     base(bombCommander, bombComponent)
 {
     _component = bombComponent.GetComponent(_componentType);
     _buttons   = (KMSelectable[])_buttonsField.GetValue(_component);
     submit     = (KMSelectable)_sendField.GetValue(_component);
     modInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Submit a decimal, octal, hexidecimal, or binary value using !{0} submit 00010100.");
 }
Example #3
0
 public MotionSenseComponentSolver(BombCommander bombCommander, BombComponent bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
     base(bombCommander, bombComponent, ircConnection, canceller)
 {
     _connection = ircConnection;
     _component  = bombComponent.GetComponent(_componentType);
     _needy      = (KMNeedyModule)_needyField.GetValue(_component);
     modInfo     = ComponentSolverFactory.GetModuleInfo(GetModuleType());
 }
 public RubiksCubeComponentSolver(BombCommander bombCommander, BombComponent bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
     base(bombCommander, bombComponent, ircConnection, canceller)
 {
     _component = bombComponent.GetComponent(_componentType);
     _cube      = (Transform)_transformField.GetValue(_component);
     _cube      = _cube.parent;
     modInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
 }
Example #5
0
 public SonicShim(TwitchModule module)
     : base(module)
 {
     ModInfo      = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component   = module.BombComponent.GetComponent(ComponentType);
     _monitors    = new KMSelectable[] { _component.GetValue <KMSelectable>("boots"), _component.GetValue <KMSelectable>("invincible"), _component.GetValue <KMSelectable>("life"), _component.GetValue <KMSelectable>("rings") };
     _startButton = _component.GetValue <KMSelectable>("startButton");
 }
Example #6
0
 public MemorableButtonsComponentSolver(TwitchModule module) :
     base(module)
 {
     _component  = module.BombComponent.GetComponent(ComponentSolverType);
     finalKeypad = _component.GetValue <KMSelectable[]>("solveKeypad");
     interKeypad = Module.BombComponent.GetComponent <KMSelectable>().Children;
     ModInfo     = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Press a button with '!{0} press 1' or '!{0} press TL'. When at the solving stage, press multiple buttons with '!{0} press 1 5 9 4 8 12 …'. Buttons are numbered in reading order at all times.");
 }
Example #7
0
    public AnagramsComponentSolver(BombCommander bombCommander, BombComponent bombComponent) :
        base(bombCommander, bombComponent)
    {
        _buttons = bombComponent.GetComponent <KMSelectable>().Children;
        string modType = GetModuleType();

        modInfo = ComponentSolverFactory.GetModuleInfo(modType, "Submit your answer with !{0} submit poodle", null, modType.Equals("AnagramsModule"));
    }
Example #8
0
 public LEGOComponentSolver(TwitchModule module) :
     base(module)
 {
     _component        = module.BombComponent.GetComponent(ComponentType);
     GridButtons       = _component.GetValue <KMSelectable[]>("GridButtons");
     ModInfo           = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Commands: select <column><row>, color <index>, left (times), right (times), clear and submit. The first two commands can be shortened to their first letter. Color indexes are specified in english reading order. You can also select the grid relative to your last position using a string of udlr characters. Commands are chainable using semicolons.");
     ChainableCommands = true;
 }
 public ColourFlashESShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _yes       = _component.GetValue <object>("ButtonYes").GetValue <KMSelectable>("KMSelectable");
     _no        = _component.GetValue <object>("ButtonNo").GetValue <KMSelectable>("KMSelectable");
 }
Example #10
0
 public MorseCodeComponentSolver(BombCommander bombCommander, MorseCodeComponent bombComponent) :
     base(bombCommander, bombComponent)
 {
     _upButton       = bombComponent.UpButton;
     _downButton     = bombComponent.DownButton;
     _transmitButton = bombComponent.TransmitButton;
     modInfo         = ComponentSolverFactory.GetModuleInfo("MorseCodeComponentSolver", "!{0} transmit 3.573, !{0} trans 573, !{0} transmit 3.573 MHz, !{0} tx 573 [transmit frequency 3.573]");
 }
Example #11
0
    public FlavorTextComponentSolver(TwitchModule module)
        : base(module)
    {
        object component = module.BombComponent.GetComponent(ComponentType);

        _buttons = (KMSelectable[])ButtonsField.GetValue(component);
        ModInfo  = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Press the button labeled Y with !{0} y. Press the button labeled N with !{0} n.");
    }
    public AnagramsComponentSolver(TwitchModule module) :
        base(module)
    {
        _buttons = module.BombComponent.GetComponent <KMSelectable>().Children;
        string modType = GetModuleType();

        ModInfo = ComponentSolverFactory.GetModuleInfo(modType, "Submit your answer with !{0} submit poodle");
    }
 public MurderComponentSolver(TwitchModule module) :
     base(module)
 {
     _component = module.BombComponent.GetComponent(ComponentType);
     _buttons   = (KMSelectable[])ButtonsField.GetValue(_component);
     _display   = (TextMesh[])DisplayField.GetValue(_component);
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Cycle the options with !{0} cycle or !{0} cycle people (also weapons and rooms). Make an accusation with !{0} It was Peacock, with the candlestick, in the kitchen. Or you can set the options individually, and accuse with !{0} accuse.");
 }
Example #14
0
	public static bool LoadDataFromFile()
	{
		FileModuleInformation[] modInfo;
		string path = Path.Combine(Application.persistentDataPath, usersSavePath);
		try
		{
			DebugHelper.Log($"Loading Module information data from file: {path}");
			modInfo = SettingsConverter.Deserialize<FileModuleInformation[]>(File.ReadAllText(path));
			lastRead = modInfo;
		}
		catch (FileNotFoundException)
		{
			DebugHelper.LogWarning($"File {path} was not found.");
			return false;
		}
		catch (Exception ex)
		{
			DebugHelper.LogException(ex);
			return false;
		}

		foreach (var fileInfo in modInfo)
		{
			ModuleInformation defaultInfo = null;
			if (fileInfo.moduleID != null)
			{
				defaultInfo = ComponentSolverFactory.GetDefaultInformation(fileInfo.moduleID);
			}

			var info = new ModuleInformation();
			foreach (FieldInfo fileFieldInfo in fileInfoFields)
			{
				if (fileFieldInfo.DeclaringType == typeof(ModuleInformation)) {
					if (fileInfoFields.Any(field => field.DeclaringType == typeof(FileModuleInformation) && field.Name == fileFieldInfo.Name))
						continue;

					fileFieldInfo.SetValue(info, fileFieldInfo.GetValue(fileInfo));
				}
				else
				{
					var baseFieldInfo = Array.Find(infoFields, field => field.Name == fileFieldInfo.Name);
					if (baseFieldInfo == null)
						throw new NotSupportedException("Superclass isn't overriding only base fields.");

					var value = fileFieldInfo.GetValue(fileInfo);
					if (value == null && defaultInfo != null)
					{
						value = baseFieldInfo.GetValue(defaultInfo);
					}

					baseFieldInfo.SetValue(info, value);
				}
			}

			ComponentSolverFactory.AddModuleInformation(info);
		}
		return true;
	}
 public QuintuplesShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _upBtns    = _component.GetValue <KMSelectable[]>("upCycleButtons");
     _downBtns  = _component.GetValue <KMSelectable[]>("downCycleButtons");
     _submit    = _component.GetValue <KMSelectable>("submitButton");
 }
Example #16
0
    public TranslatedButtonComponentSolver(BombCommander bombCommander, BombComponent bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
        base(bombCommander, bombComponent, ircConnection, canceller)
    {
        _button = (KMSelectable)_buttonField.GetValue(bombComponent.GetComponent(_componentType));
        modInfo = ComponentSolverFactory.GetModuleInfo(GetModuleType());
        Selectable selectable = bombComponent.GetComponent <Selectable>();

        selectable.OnCancel += () => { _selectedField.SetValue(bombComponent.GetComponent(_componentType), false); return(true); };
    }
Example #17
0
    public ErrorCodesComponentSolver(TwitchModule module) :
        base(module)
    {
        object component = module.BombComponent.GetComponent(ComponentType);

        _buttons = (KMSelectable[])ButtonsField.GetValue(component);
        _submit  = (KMSelectable)SendField.GetValue(component);
        ModInfo  = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Submit a decimal, octal, hexidecimal, or binary value using !{0} submit 00010100.");
    }
Example #18
0
 public MinecraftCipherShim(TwitchModule module)
     : base(module)
 {
     ModInfo        = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component     = module.BombComponent.GetComponent(ComponentType);
     _keypadButtons = _component.GetValue <KMSelectable[]>("Button");
     _clearButton   = _component.GetValue <KMSelectable>("clear");
     _submitButton  = _component.GetValue <KMSelectable>("submit");
 }
Example #19
0
    public MicrocontrollerComponentSolver(TwitchModule module) :
        base(module)
    {
        object component = module.BombComponent.GetComponent(ComponentType);

        _buttonOK = (KMSelectable)ButtonOKField.GetValue(component);
        _buttonUp = (KMSelectable)ButtonUpField.GetValue(component);
        ModInfo   = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Set the current pin color with !{0} set red. Cycle the current pin !{0} cycle. Valid colors: white, red, yellow, magenta, blue, green.");
    }
Example #20
0
 public ShapesAndBombsShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _buttons   = _component.GetValue <KMSelectable[]>("ModuleButtons");
     _display   = _component.GetValue <KMSelectable>("NumScreen");
     _submit    = _component.GetValue <KMSelectable>("SubmitButton");
 }
Example #21
0
 public NumbersShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _up        = _component.GetValue <KMSelectable>("buttonUp");
     _down      = _component.GetValue <KMSelectable>("buttonDown");
     _submit    = _component.GetValue <KMSelectable>("buttonDisplay");
 }
Example #22
0
 public FlagsShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _left      = _component.GetValue <KMSelectable>("leftButton");
     _right     = _component.GetValue <KMSelectable>("rightButton");
     _submit    = _component.GetValue <KMSelectable>("submitButton");
 }
Example #23
0
 public CodeShim(TwitchModule module)
     : base(module)
 {
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType());
     _component = module.BombComponent.GetComponent(ComponentType);
     _buttons   = _component.GetValue <KMSelectable[]>("NumberButtons");
     _clear     = _component.GetValue <KMSelectable>("ButtonR");
     _submit    = _component.GetValue <KMSelectable>("ButtonS");
 }
Example #24
0
    public MicrocontrollerComponentSolver(BombCommander bombCommander, BombComponent bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
        base(bombCommander, bombComponent, ircConnection, canceller)
    {
        object _component = bombComponent.GetComponent(_componentType);

        _buttonOK = (KMSelectable)_buttonOKField.GetValue(_component);
        _buttonUp = (KMSelectable)_buttonUpField.GetValue(_component);
        modInfo   = ComponentSolverFactory.GetModuleInfo(GetModuleType());
    }
 public SimonsStagesComponentSolver(TwitchModule module) :
     base(module)
 {
     _component   = Module.BombComponent.GetComponent(ComponentType);
     lightDevices = _component.GetValue <object[]>("lightDevices");
     colorOrder   = lightDevices.Select(device => device.GetValue <TextMesh>("lightText").text[0]).ToArray();
     selectables  = Module.BombComponent.GetComponent <KMSelectable>().Children;
     ModInfo      = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "!{0} press <letters> [press a sequence of colors based on their first letter]");
 }
Example #26
0
 public TheMatrixComponentSolver(TwitchModule module) :
     base(module)
 {
     _component = module.BombComponent.GetComponent(ComponentSolverType);
     Switch     = _component.GetValue <KMSelectable>("switchObject");
     bluePill   = _component.GetValue <KMSelectable>("bluePill");
     redPill    = _component.GetValue <KMSelectable>("redPill");
     ModInfo    = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Flip the switch and flip it again in x seconds with '!{0} flip for x'! Use '!{0} press <colour>' at # to press the pill corresponding to the colour you specified when the last digit of the timer equals to #");
 }
 public TurnTheKeyComponentSolver(TwitchModule module) :
     base(module)
 {
     _lock   = (MonoBehaviour)LockField.GetValue(Module.BombComponent.GetComponent(ComponentType));
     ModInfo = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Turn the key at specified time with !{0} turn 8:29");
     module.StartCoroutine(ReWriteTurnTheKey());
     module.BombComponent.GetComponent <KMBombModule>().OnActivate = OnActivate;
     SkipTimeAllowed = true;
 }
Example #28
0
    public MicrocontrollerComponentSolver(BombCommander bombCommander, BombComponent bombComponent) :
        base(bombCommander, bombComponent)
    {
        object _component = bombComponent.GetComponent(_componentType);

        _buttonOK = (KMSelectable)_buttonOKField.GetValue(_component);
        _buttonUp = (KMSelectable)_buttonUpField.GetValue(_component);
        modInfo   = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Set the current pin color with !{0} set red. Cycle the current pin !{0} cycle. Valid colors: white, red, yellow, magenta, blue, green.");
    }
Example #29
0
    public PasswordComponentSolver(TwitchModule module) :
        base(module)
    {
        var passwordModule = (PasswordComponent)module.BombComponent;

        _spinners     = passwordModule.Spinners;
        _submitButton = passwordModule.SubmitButton;
        ModInfo       = ComponentSolverFactory.GetModuleInfo("PasswordComponentSolver", "!{0} cycle 1 3 5 [cycle through the letters in columns 1, 3, and 5] | !{0} cycle [cycle through all columns] | !{0} toggle [move all columns down one letter] | !{0} world [try to submit a word]", "Password");
    }
    public KnowYourWayComponentSolver(TwitchModule module)
        : base(module)
    {
        object component = module.BombComponent.GetComponent(ComponentType);

        _buttons    = ButtonFields.Select(field => (KMSelectable)field.GetValue(component)).ToArray();
        _textMeshes = TextFields.Select(field => (TextMesh)field.GetValue(component)).ToArray();
        ModInfo     = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Press the buttons labeled UDLR with !{0} press UDLR.");
    }