Gamble buffs (#18403)

* Gambling buffs

Added replica casino chips that can be ordered in a new gambling games crate from cargo. These can't be used in any casino vendors.

Added a triple size deck of cards.

Added the ability to set dice to a specific face with a verb or ctrl-click.

Added quick use abilities to decks of cards: Alt click to shuffle, Ctrl click to deal, Ctrl+Shift click to deal multiple.

Added quick use abilities to hands of cards: "Alt click to remove a card, Ctrl click to discard cards."

Fixed people being able to see your hand of cards whilst it was in your hand by examining you.

* Update cards.dm

* Update dice.dm

* Adds stuff to bits and bobs vendor
This commit is contained in:
SatinIsle
2025-09-09 00:44:55 +01:00
committed by GitHub
parent 890537411b
commit 41969fe83d
6 changed files with 250 additions and 1 deletions
+56
View File
@@ -6,6 +6,7 @@
/obj/item/deck
w_class = ITEMSIZE_SMALL
icon = 'icons/obj/playing_cards.dmi'
description_info = "Alt click to shuffle, Ctrl click to deal, Ctrl+Shift click to deal multiple."
var/list/cards = list()
var/cooldown = 0 // to prevent spam shuffle
@@ -165,6 +166,12 @@
deal_at(usr, M, dcard)
/obj/item/deck/CtrlClick(mob/user)
deal_card()
/obj/item/deck/CtrlShiftClick(mob/user)
deal_card_multi()
/obj/item/deck/proc/deal_at(mob/user, mob/target, dcard) // Take in the no. of card to be dealt
var/obj/item/hand/H = new(get_step(user, user.dir))
var/i
@@ -236,6 +243,10 @@
else
return
/obj/item/deck/AltClick(mob/user)
if(user.stat || !Adjacent(user))
return
shuffle(user)
/obj/item/deck/MouseDrop(mob/user) // Code from Paper bin, so you can still pick up the deck
if((user == usr && (!( user.restrained() ) && (!( user.stat ) && (user.contents.Find(src) || in_range(src, user))))))
@@ -273,6 +284,42 @@
user.put_in_hands(src)
return
/obj/item/deck/cards/triple
name = "big deck of cards"
desc = "A simple deck of playing cards with triple the number of cards."
/obj/item/deck/cards/triple/Initialize(mapload)
. = ..()
var/datum/playingcard/P
for(var/a = 0, a<3, a++)
for(var/suit in list("spades","clubs","diamonds","hearts"))
var/colour
if(suit == "spades" || suit == "clubs")
colour = "black_"
else
colour = "red_"
for(var/number in list("ace","two","three","four","five","six","seven","eight","nine","ten"))
P = new()
P.name = "[number] of [suit]"
P.card_icon = "[colour]num"
P.back_icon = "card_back"
cards += P
for(var/number in list("jack","queen","king"))
P = new()
P.name = "[number] of [suit]"
P.card_icon = "[colour]col"
P.back_icon = "card_back"
cards += P
for(var/i = 0, i<2, i++)
P = new()
P.name = "joker"
P.card_icon = "joker"
cards += P
/obj/item/pack/
name = "Card Pack"
desc = "For those with disposible income."
@@ -302,6 +349,7 @@
/obj/item/hand
name = "hand of cards"
desc = "Some playing cards."
description_info = "Alt click to remove a card, Ctrl click to discard cards."
icon = 'icons/obj/playing_cards.dmi'
icon_state = "empty"
drop_sound = 'sound/items/drop/paper.ogg'
@@ -465,3 +513,11 @@
/obj/item/hand/pickup(mob/user)
..()
src.update_icon()
/obj/item/hand/CtrlClick(mob/user)
if(user.stat || !Adjacent(user))
return
discard()
/obj/item/hand/AltClick(mob/user)
Removecard()
+28 -1
View File
@@ -35,7 +35,7 @@
..()
if(cheater)
if(!loaded)
var/to_weight = tgui_input_number(user, "What should the [name] be weighted towards?","Set the desired result", 1, 6, 1)
var/to_weight = tgui_input_number(user, "What should the [name] be weighted towards?","Set the desired result", 1, sides, 1)
if(isnull(to_weight) || (to_weight < 1) || (to_weight > sides) ) //You must input a number higher than 0 and no greater than the number of sides
return 0
else
@@ -115,6 +115,33 @@
span_notice("You throw [src]. It lands on a [result]. [comment]"), \
span_notice("You hear [src] landing on a [result]. [comment]"))
/obj/item/dice/verb/set_dice_verb()
set category = "Object"
set name = "Set Face"
set desc = "Turn the dice to a specific face."
set src in view(1)
var/mob/living/carbon/user = usr
if(!istype(user))
return
set_dice(user)
/obj/item/dice/proc/set_dice(mob/user)
if(user.stat || !Adjacent(user))
return
var/to_value = tgui_input_number(user, "What face should \the [src] be turned to?","Set die face", 1, sides, 1)
if(!to_value)
return
result = to_value
icon_state = "[name][result]"
user.visible_message(span_notice("\The [user] turned \the [src] to the face reading [result] manually."))
/obj/item/dice/CtrlClick(mob/user)
set_dice(user)
/*
* Dice packs
*/