mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
Cursed players have an increased chance of drawing bad tarot cards (#93511)
## About The Pull Request Having `TRAIT_CURSED` drastically increases your chance of drawing "Death" or "The Tower" from a tarot deck ## Why It's Good For The Game Well it's called "bad luck" for a reason ## Changelog 🆑 Melbert add: Cursed / Unlucky players have an increased chance of drawing bad tarot cards /🆑
This commit is contained in:
@@ -131,13 +131,18 @@
|
||||
|
||||
var/list/cards = fetch_card_atoms()
|
||||
|
||||
card = card || cards[1] //draw the card on top
|
||||
card ||= pick_card(user, cards)
|
||||
cards -= card
|
||||
|
||||
update_appearance()
|
||||
playsound(src, 'sound/items/cards/cardflip.ogg', 50, TRUE)
|
||||
return card
|
||||
|
||||
/// Picks what card the user draws from the deck
|
||||
/obj/item/toy/cards/proc/pick_card(mob/living/user, list/obj/item/toy/singlecard/cards)
|
||||
// By default just pick the top card
|
||||
return cards[1]
|
||||
|
||||
/// Returns the cards in this deck.
|
||||
/// Lazily generates the cards if they haven't already been made.
|
||||
/obj/item/toy/cards/proc/fetch_card_atoms()
|
||||
|
||||
@@ -28,6 +28,23 @@
|
||||
M.Turn(180)
|
||||
card.transform = M
|
||||
|
||||
/obj/item/toy/cards/deck/tarot/pick_card(mob/living/user, list/obj/item/toy/singlecard/cards)
|
||||
// If the user is cursed they have increase chance of drawing Death or The Tower
|
||||
if(!HAS_TRAIT(user, TRAIT_CURSED))
|
||||
return ..()
|
||||
|
||||
var/total_card = length(cards)
|
||||
// give a boosted chance if they're using the full deck
|
||||
var/chance_modifier = total_card >= 56 ? 24 : 4
|
||||
if(!prob(min(33, chance_modifier / total_card * 100)))
|
||||
return ..()
|
||||
|
||||
for(var/obj/item/toy/singlecard/card as anything in cards)
|
||||
if(card.cardname == "Death" || card.cardname == "The Tower")
|
||||
return card
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/toy/cards/deck/tarot/haunted
|
||||
name = "haunted tarot game deck"
|
||||
desc = "A spooky looking tarot deck. You can sense a supernatural presence linked to the cards..."
|
||||
|
||||
Reference in New Issue
Block a user