diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm deleted file mode 100644 index 9099ff3bd1..0000000000 --- a/code/game/objects/items/weapons/dice.dm +++ /dev/null @@ -1,59 +0,0 @@ -/obj/item/weapon/dice - name = "d6" - desc = "A dice with six sides." - icon = 'icons/obj/dice.dmi' - icon_state = "d66" - w_class = ITEMSIZE_TINY - var/sides = 6 - attack_verb = list("diced") - -/obj/item/weapon/dice/New() - icon_state = "[name][rand(1,sides)]" - -/obj/item/weapon/dice/d4 - name = "d4" - desc = "A dice with four sides." - icon_state = "d44" - sides = 4 - -/obj/item/weapon/dice/d8 - name = "d8" - desc = "A dice with eight sides." - icon_state = "d88" - sides = 8 - -/obj/item/weapon/dice/d10 - name = "d10" - desc = "A dice with ten sides." - icon_state = "d1010" - sides = 10 - -/obj/item/weapon/dice/d12 - name = "d12" - desc = "A dice with twelve sides." - icon_state = "d1212" - sides = 12 - -/obj/item/weapon/dice/d20 - name = "d20" - desc = "A dice with twenty sides." - icon_state = "d2020" - sides = 20 - -/obj/item/weapon/dice/d100 - name = "d100" - desc = "A dice with ten sides. This one is for the tens digit." - icon_state = "d10010" - sides = 10 - -/obj/item/weapon/dice/attack_self(mob/user as mob) - var/result = rand(1, sides) - var/comment = "" - if(sides == 20 && result == 20) - comment = "Nat 20!" - else if(sides == 20 && result == 1) - comment = "Ouch, bad luck." - icon_state = "[name][result]" - user.visible_message("[user] has thrown [src]. It lands on [result]. [comment]", \ - "You throw [src]. It lands on a [result]. [comment]", \ - "You hear [src] landing on a [result]. [comment]") diff --git a/code/game/objects/items/weapons/storage/misc.dm b/code/game/objects/items/weapons/storage/misc.dm index bf4856501a..64952046a5 100644 --- a/code/game/objects/items/weapons/storage/misc.dm +++ b/code/game/objects/items/weapons/storage/misc.dm @@ -1,30 +1,3 @@ -/obj/item/weapon/storage/pill_bottle/dice //7d6 - name = "bag of dice" - desc = "It's a small bag with dice inside." - icon = 'icons/obj/dice.dmi' - icon_state = "dicebag" - -/obj/item/weapon/storage/pill_bottle/dice/New() - ..() - for(var/i = 1 to 7) - new /obj/item/weapon/dice( src ) - -/obj/item/weapon/storage/pill_bottle/dice_nerd //DnD dice - name = "bag of gaming dice" - desc = "It's a small bag with gaming dice inside." - icon = 'icons/obj/dice.dmi' - icon_state = "magicdicebag" - -/obj/item/weapon/storage/pill_bottle/dice_nerd/New() - ..() - new /obj/item/weapon/dice/d4( src ) - new /obj/item/weapon/dice( src ) - new /obj/item/weapon/dice/d8( src ) - new /obj/item/weapon/dice/d10( src ) - new /obj/item/weapon/dice/d12( src ) - new /obj/item/weapon/dice/d20( src ) - new /obj/item/weapon/dice/d100( src ) - /* * Donut Box */ diff --git a/code/modules/client/preference_setup/loadout/loadout_general.dm b/code/modules/client/preference_setup/loadout/loadout_general.dm index a97d5776fc..6f3115fd2f 100644 --- a/code/modules/client/preference_setup/loadout/loadout_general.dm +++ b/code/modules/client/preference_setup/loadout/loadout_general.dm @@ -10,6 +10,10 @@ display_name = "dice pack (gaming)" path = /obj/item/weapon/storage/pill_bottle/dice_nerd +/datum/gear/dice/cup + display_name = "dice cup and dice" + path = /obj/item/weapon/storage/dicecup/loaded + /datum/gear/cards display_name = "deck of cards" path = /obj/item/weapon/deck/cards diff --git a/code/modules/games/dice.dm b/code/modules/games/dice.dm new file mode 100644 index 0000000000..039631cdb4 --- /dev/null +++ b/code/modules/games/dice.dm @@ -0,0 +1,157 @@ +/obj/item/weapon/dice + name = "d6" + desc = "A dice with six sides." + icon = 'icons/obj/dice.dmi' + icon_state = "d66" + w_class = ITEMSIZE_TINY + var/sides = 6 + var/result = 6 + attack_verb = list("diced") + +/obj/item/weapon/dice/New() + icon_state = "[name][rand(1,sides)]" + +/obj/item/weapon/dice/d4 + name = "d4" + desc = "A dice with four sides." + icon_state = "d44" + sides = 4 + result = 4 + +/obj/item/weapon/dice/d8 + name = "d8" + desc = "A dice with eight sides." + icon_state = "d88" + sides = 8 + result = 8 + +/obj/item/weapon/dice/d10 + name = "d10" + desc = "A dice with ten sides." + icon_state = "d1010" + sides = 10 + result = 10 + +/obj/item/weapon/dice/d12 + name = "d12" + desc = "A dice with twelve sides." + icon_state = "d1212" + sides = 12 + result = 12 + +/obj/item/weapon/dice/d20 + name = "d20" + desc = "A dice with twenty sides." + icon_state = "d2020" + sides = 20 + result = 20 + +/obj/item/weapon/dice/d100 + name = "d100" + desc = "A dice with ten sides. This one is for the tens digit." + icon_state = "d10010" + sides = 10 + result = 10 + +/obj/item/weapon/dice/attack_self(mob/user as mob) + rollDice(user, 0) + +/obj/item/weapon/dice/proc/rollDice(mob/user as mob, var/silent = 0) + result = rand(1, sides) + icon_state = "[name][result]" + + if(!silent) + var/comment = "" + if(sides == 20 && result == 20) + comment = "Nat 20!" + else if(sides == 20 && result == 1) + comment = "Ouch, bad luck." + + user.visible_message("[user] has thrown [src]. It lands on [result]. [comment]", \ + "You throw [src]. It lands on a [result]. [comment]", \ + "You hear [src] landing on a [result]. [comment]") + +/* + * Dice packs + */ + +/obj/item/weapon/storage/pill_bottle/dice //7d6 + name = "bag of dice" + desc = "It's a small bag with dice inside." + icon = 'icons/obj/dice.dmi' + icon_state = "dicebag" + +/obj/item/weapon/storage/pill_bottle/dice/New() + ..() + for(var/i = 1 to 7) + new /obj/item/weapon/dice( src ) + +/obj/item/weapon/storage/pill_bottle/dice_nerd //DnD dice + name = "bag of gaming dice" + desc = "It's a small bag with gaming dice inside." + icon = 'icons/obj/dice.dmi' + icon_state = "magicdicebag" + +/obj/item/weapon/storage/pill_bottle/dice_nerd/New() + ..() + new /obj/item/weapon/dice/d4( src ) + new /obj/item/weapon/dice( src ) + new /obj/item/weapon/dice/d8( src ) + new /obj/item/weapon/dice/d10( src ) + new /obj/item/weapon/dice/d12( src ) + new /obj/item/weapon/dice/d20( src ) + new /obj/item/weapon/dice/d100( src ) + +/* + *Liar's Dice cup + */ + +/obj/item/weapon/storage/dicecup + name = "dice cup" + desc = "A cup used to conceal and hold dice." + icon = 'icons/obj/dice.dmi' + icon_state = "dicecup" + w_class = ITEMSIZE_SMALL + storage_slots = 5 + can_hold = list( + /obj/item/weapon/dice, + ) + +/obj/item/weapon/storage/dicecup/attack_self(mob/user as mob) + user.visible_message("[user] shakes [src].", \ + "You shake [src].", \ + "You hear dice rolling.") + rollCup(user) + +/obj/item/weapon/storage/dicecup/proc/rollCup(mob/user as mob) + for(var/obj/item/weapon/dice/I in src.contents) + var/obj/item/weapon/dice/D = I + D.rollDice(user, 1) + +/obj/item/weapon/storage/dicecup/proc/revealDice(var/mob/viewer) + for(var/obj/item/weapon/dice/I in src.contents) + var/obj/item/weapon/dice/D = I + to_chat(viewer, "The [D.name] shows a [D.result].") + +/obj/item/weapon/storage/dicecup/verb/peekAtDice() + set category = "Object" + set name = "Peek at Dice" + set desc = "Peek at the dice under your cup." + + revealDice(usr) + +/obj/item/weapon/storage/dicecup/verb/revealDiceHand() + + set category = "Object" + set name = "Reveal Dice" + set desc = "Reveal the dice hidden under your cup." + + for(var/mob/living/player in viewers(3)) + to_chat(player, "[usr] reveals their dice.") + revealDice(player) + + +/obj/item/weapon/storage/dicecup/loaded/New() + ..() + for(var/i = 1 to 5) + new /obj/item/weapon/dice( src ) \ No newline at end of file diff --git a/html/changelogs/Anewbe - Dice Cup.yml b/html/changelogs/Anewbe - Dice Cup.yml new file mode 100644 index 0000000000..8c9803b363 --- /dev/null +++ b/html/changelogs/Anewbe - Dice Cup.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Anewbe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds a cup for dice games, in the loadout." \ No newline at end of file diff --git a/icons/obj/dice.dmi b/icons/obj/dice.dmi index f6a209b468..17a3c64cd4 100644 Binary files a/icons/obj/dice.dmi and b/icons/obj/dice.dmi differ diff --git a/polaris.dme b/polaris.dme index e758a5eb7f..0c59b07288 100644 --- a/polaris.dme +++ b/polaris.dme @@ -822,7 +822,6 @@ #include "code\game\objects\items\weapons\cigs_lighters.dm" #include "code\game\objects\items\weapons\clown_items.dm" #include "code\game\objects\items\weapons\cosmetics.dm" -#include "code\game\objects\items\weapons\dice.dm" #include "code\game\objects\items\weapons\dna_injector.dm" #include "code\game\objects\items\weapons\explosives.dm" #include "code\game\objects\items\weapons\extinguisher.dm" @@ -1399,6 +1398,7 @@ #include "code\modules\games\cah_white_cards.dm" #include "code\modules\games\cardemon.dm" #include "code\modules\games\cards.dm" +#include "code\modules\games\dice.dm" #include "code\modules\games\spaceball_cards.dm" #include "code\modules\games\tarot.dm" #include "code\modules\genetics\side_effects.dm"