mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Makes playing cards playable -- significantly reworks card interactions (#26585)
* Basic card interactions * initial interactions sorted * nails down some interactions, radial menu * Some more qol and keybind changes * improves card interactions * Unum decks can be flipped, showing the top card * Decks can now be split and recombined * minor tweaks to multi-deck stuff * Clean up a bunch of interactions * more cleanups * more cleanups and documentation * remote attacking looks pretty good * minor cleanups * ci * parser errs * Remove some debug things, re-add signal after merge * Adds a whole bunch more qol. * Improves examine messages * ci * concealed cards will now show properly in radial * Fixes some weird proximity monitor and control issues * Address reviews, clean up examine a bit more * radial fixes * remove todos * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> * better documentation, adds label of who did what * b etter grammar * augh * missing icon state * Update code/game/gamemodes/wizard/magic_tarot.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> * Add sleep on proximity monitor setup to hopefully avoid mapload issues * been writing too much c lately * Try late initialize * late init * 🧌 * map load --------- Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
+673
-167
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
|
||||
/obj/item/deck/tarot/deckshuffle()
|
||||
var/mob/living/user = usr
|
||||
if(cooldown < world.time - 1 SECONDS)
|
||||
if(shuffle_cooldown < world.time - 1 SECONDS)
|
||||
var/list/newcards = list()
|
||||
while(length(cards))
|
||||
var/datum/playingcard/P = pick(cards)
|
||||
@@ -27,9 +27,9 @@
|
||||
cards = newcards
|
||||
playsound(user, 'sound/items/cardshuffle.ogg', 50, TRUE)
|
||||
user.visible_message(
|
||||
"<span class='notice'>[user] shuffles [src].</span>",
|
||||
"<span class='notice'>[user] shuffles [src].</span>",
|
||||
"<span class='notice'>You shuffle [src].</span>",
|
||||
"<span class='notice'>You hear cards being shuffled.</span>"
|
||||
)
|
||||
cooldown = world.time
|
||||
shuffle_cooldown = world.time
|
||||
|
||||
|
||||
@@ -4,6 +4,19 @@
|
||||
desc = "A deck of UNUM! cards. House rules to argue over not included."
|
||||
icon_state = "deck_unum_full"
|
||||
card_style = "unum"
|
||||
/// Whether or not this deck should show the backs or fronts of its cards.
|
||||
var/show_front = FALSE
|
||||
|
||||
/obj/item/deck/unum/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>When held in hand, <b>Alt-Shift-Click</b> to flip [src].</span>"
|
||||
|
||||
/obj/item/deck/unum/AltShiftClick(mob/user)
|
||||
if(!Adjacent(user) || (user.get_active_hand() != src) && (user.get_inactive_hand() != src))
|
||||
return
|
||||
show_front = !show_front
|
||||
visible_message("<span class='notice'>[user] flips over [src].</span>")
|
||||
update_appearance(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/deck/unum/build_deck()
|
||||
for(var/color in list("Red", "Yellow", "Green", "Blue"))
|
||||
@@ -21,6 +34,7 @@
|
||||
/obj/item/deck/unum/update_icon_state()
|
||||
if(!length(cards))
|
||||
icon_state = "deck_[card_style]_empty"
|
||||
show_front = FALSE
|
||||
return
|
||||
var/percent = round((length(cards) / deck_total) * 100)
|
||||
switch(percent)
|
||||
@@ -31,3 +45,20 @@
|
||||
else
|
||||
icon_state = "deck_[deck_style ? "[deck_style]_" : ""][card_style]_full"
|
||||
|
||||
/obj/item/deck/unum/update_overlays()
|
||||
. = ..()
|
||||
if(!length(cards) || !show_front)
|
||||
return
|
||||
var/percent = round((length(cards) / deck_total) * 100)
|
||||
var/datum/playingcard/P = cards[1]
|
||||
var/image/I = new(icon, P.card_icon)
|
||||
switch(percent)
|
||||
if(0 to 20)
|
||||
I.pixel_y = 1
|
||||
if(21 to 50)
|
||||
I.pixel_y = 2
|
||||
else
|
||||
I.pixel_y = 4
|
||||
. += I
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
return l_hand
|
||||
if(istype(r_hand,typepath))
|
||||
return r_hand
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/has_organ(name)
|
||||
|
||||
Reference in New Issue
Block a user