Skip to content

Commit

Permalink
feat: Implement 'flash' command
Browse files Browse the repository at this point in the history
  • Loading branch information
Computerdores committed Apr 3, 2024
1 parent cc01794 commit eaad100
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions AdvancedTerminalAPI/Vanillin/FlashCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Computerdores.Vanillin;

public class FlashCommand : SimpleCommand, ICommand, IPredictable {
public string GetName() => "flash";

public string PredictInput(string partialInput) => Util.PredictPlayerName(partialInput);

protected override CommandResult Execute(string input, ITerminal terminal) {
CommandResult result = new();
int index = Util.GetPlayerIndexByName(input);
if (index == -1) {
index = StartOfRound.Instance.mapScreen.targetTransformIndex;
if (!StartOfRound.Instance.mapScreen.radarTargets[index].isNonPlayer) {
result.success = false;
result.clearScreen = false;
return result;
}
}
StartOfRound.Instance.mapScreen.FlashRadarBooster(index);
result.output = Util.GetSpecialNode(terminal.GetDriver().VanillaTerminal, 23).displayText;
return result;
}

public object Clone() => new FlashCommand();
}
1 change: 1 addition & 0 deletions AdvancedTerminalAPI/Vanillin/VanillinTerminal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class VanillinTerminal : ITerminal {
DebugLogNodeInfo();
// Add Vanillin Commands
AddBuiltinCommand(new EjectCommand());
AddBuiltinCommand(new FlashCommand());
AddBuiltinCommand(new HelpCommand());
AddBuiltinCommand(new OtherCommand());
AddBuiltinCommand(new PingCommand());
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- [ ] buy
- [ ] decor
- [x] eject
- [ ] flash
- [x] flash
- [x] help
- [ ] info
- [ ] moons
Expand Down

0 comments on commit eaad100

Please sign in to comment.