Testing making a TGS command

Simple coinflip command.
Throws a hissyfit if you dont guess.

Only accepts lowercase

Possibly adds newlines on error message.
Compiles with no errors or warns-

May tidy it later this is just a test
This commit is contained in:
Sharkmare
2021-02-23 11:45:57 +01:00
parent f191567b5f
commit 1be4ee303a
2 changed files with 25 additions and 0 deletions

View File

@@ -16,4 +16,5 @@
#include "v5\api_vgs.dm" // VOREStation Edit - Include here so it has access to v5 defines
#include "v5\commands.dm"
#include "v5\chat_commands.dm"
#include "v5\chat_commands_zz_ch.dm"
#include "v5\undefs.dm"

View File

@@ -0,0 +1,24 @@
/datum/tgs_chat_command/sharktest
name = "flip"
help_text = "babies first TGS command"
admin_only = FALSE
/datum/tgs_chat_command/sharktest/Run(datum/tgs_chat_user/sender, params)
var/x
if(params != "tails" && params != "heads")
return "```You need to guess!\n either heads or tails!```"
if(prob(50))
if(params == "tails")
x = "correct"
else
x = "wrong"
return "```Tails. [x]!```"
if(params == "tails")
x = "wrong"
else
x = "correct"
return "```Heads. [x]!```"
/datum/tgs_chat_command/sharktest/alias
name = "coin"