Files
vgstation13/code/modules/spells/targeted/card.dm
boy2mantwicethefam 5f4e3d4fa8 Is this your card? (#29517)
* Card

* typo fix

* is_full()

* Update screen_spells.dmi

* Update screen_spells.dmi
2021-06-13 22:33:11 -05:00

36 lines
1.4 KiB
Plaintext

/spell/targeted/card
name = "Card Trick"
desc = "Ask a person about whether a random card is theirs. Their whole inventory is filled with copies of the card."
abbreviation = "CT"
user_type = USER_TYPE_SPELLBOOK //It's quite the exquisite meme
school = "transmutation"
charge_max = 150 //15 seconds
spell_flags = WAIT_FOR_CLICK
invocation_type = SpI_SHOUT
max_targets = 1
compatible_mobs = list(/mob/living/carbon/human)
hud_state = "card_trick"
var/current_card
var/list/card_type = list("Hearts", "Spades", "Clubs", "Diamonds")
var/list/card_number = list("2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace")
/spell/targeted/card/before_cast(list/targets, user)
. = ..()
current_card = "[pick(card_number)] of [pick(card_type)]"
/spell/targeted/card/invocation(mob/user, list/targets)
invocation = "IS THE [uppertext(current_card)] YOUR CARD?"
..()
/spell/targeted/card/cast(list/targets, mob/user)
..()
for(var/mob/living/carbon/human/H in targets)
for(var/obj/item/weapon/storage/S in recursive_type_check(H, /obj/item/weapon/storage))
while(!S.is_full())
new /obj/item/toy/singlecard/unflipped(S, newcardname = "[current_card]")
if(!H.get_item_by_slot(slot_l_store))
H.l_store = new /obj/item/toy/singlecard/unflipped(newcardname = "[current_card]")
if(!H.get_item_by_slot(slot_r_store))
H.r_store = new /obj/item/toy/singlecard/unflipped(newcardname = "[current_card]")
H.update_inv_pockets(0)