Merge pull request #6824 from Citadel-Station-13/kevinz000-patch-1

Roll Dice Verb
This commit is contained in:
deathride58
2018-06-01 01:46:14 +00:00
committed by GitHub
3 changed files with 28 additions and 1 deletions
+2 -1
View File
@@ -99,7 +99,8 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/polymorph_all,
/client/proc/show_tip,
/client/proc/smite,
/client/proc/admin_away
/client/proc/admin_away,
/client/proc/roll_dices //CIT CHANGE - Adds dice verb
))
GLOBAL_PROTECT(admin_verbs_spawn)
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character))
+25
View File
@@ -0,0 +1,25 @@
/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")
to_chat(world, "<h2 style=\"color:#A50400\">The dice have been rolled by Gods!</h2>")
var/result = roll(dice)
if(alert("Do you want to inform the world about the result?",,"Yes", "No") == "Yes")
to_chat(world, "<h2 style=\"color:#A50400\">Gods rolled [dice], result is [result]</h2>")
message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]")
log_admin("[key_name_admin(src)] rolled dice [dice], result is [result]")