From a0f119b9dc4007f28610a4c42f2dfe698e5caa71 Mon Sep 17 00:00:00 2001 From: volas Date: Sat, 9 May 2015 19:53:25 +0300 Subject: [PATCH] Admin dice --- baystation12.dme | 1 + code/modules/admin/admin_verbs.dm | 4 +++- code/modules/admin/verbs/dice.dm | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 code/modules/admin/verbs/dice.dm diff --git a/baystation12.dme b/baystation12.dme index 15dcee4dcec..c8173f401e7 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -815,6 +815,7 @@ #include "code\modules\admin\verbs\deadsay.dm" #include "code\modules\admin\verbs\debug.dm" #include "code\modules\admin\verbs\diagnostics.dm" +#include "code\modules\admin\verbs\dice.dm" #include "code\modules\admin\verbs\getlogs.dm" #include "code\modules\admin\verbs\icarus.dm" #include "code\modules\admin\verbs\mapping.dm" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index d495bacecbf..877b29b0b1b 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -110,7 +110,8 @@ var/list/admin_verbs_fun = list( /client/proc/cmd_admin_add_random_ai_law, /client/proc/make_sound, /client/proc/toggle_random_events, - /client/proc/editappear + /client/proc/editappear, + /client/proc/roll_dices ) var/list/admin_verbs_spawn = list( /datum/admins/proc/spawn_fruit, @@ -255,6 +256,7 @@ var/list/admin_verbs_hideable = list( /client/proc/cmd_debug_tog_aliens, /client/proc/air_report, /client/proc/enable_debug_verbs, + /client/proc/roll_dices, /proc/possess, /proc/release ) diff --git a/code/modules/admin/verbs/dice.dm b/code/modules/admin/verbs/dice.dm new file mode 100644 index 00000000000..e5877a9da28 --- /dev/null +++ b/code/modules/admin/verbs/dice.dm @@ -0,0 +1,24 @@ +/client/proc/roll_dices() + set category = "Fun" + set name = "Roll Dice" + if(!check_rights(R_FUN)) + return + + var/sum = input("How many times should we throw?") as num + var/side = input("Select the number of sides.") as num + if(!side) + side = 6 + if(!sum) + sum = 2 + + var/dice = num2text(sum) + "d" + num2text(side) + + if(alert("Do you want to inform the world about your game?",,"Yes", "No") == "Yes") + world << "

The dice have been rolled by Gods!

" + + var/result = roll(dice) + + if(alert("Do you want to inform the world about the result?",,"Yes", "No") == "Yes") + world << "

Gods rolled [dice], result is [result]

" + + message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]", 1) \ No newline at end of file