Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #def SUMMON 1
- /obj/item/griffening_single
- name = "Griffening Single Card"
- desc = "A single griffening card, this probably shouldn't exist in this state."
- ////TODO: Vars to make things easier or better to play
- /obj/item/cthtool
- name = "Card-To-Hologram Tool"
- desc = "Makes playing cards become holograms somehow."
- icon_state = "gangtool-white"
- item_state = "electronic"
- lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
- righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
- icon = 'icons/obj/device.dmi'
- w_class = WEIGHT_CLASS_TINY
- var/mode = SUMMON
- var/obj/item/griffening_single/loadedcard
- var/ckey //The last person that used this device, good to know who played the card
- /obj/item/cthtool/attackby(obj/item/I, mob/user, params)
- if(istype(I, obj/item/griffening_single))
- if(loadedcard)
- to_chat(user, "The [src] already has a card loaded in it.")
- else
- loadedcard = I
- to_chat(user, "You insert the [I] into the [src].")
- else
- if(!user.put_in_hands(loadedcard))
- to_chat(user, "It's a bit hard to take the card out inside if you are holding something.")
- return
- to_chat(user, "You take the [loadedcard] out of the [src].")
- /obj/item/cthtool/examine(mob/user)
- if(loadedcard)
- to_chat(user, "The [src] has a [loadedcard] inserted into it.")
- /obj/item/cthtool/afterattack(/obj/structure/cardtile/C, mob/user)
- if(!istype(C))
- return
- if(C.cardshowing) && if(loadedcard.card_type == "creature")
- to_chat(user, "That tile already has a creature summoned on it!")
- return
- if(!C.cardshowing)
- if(loadedcard.card_type == "equipment")
- to_chat(user, "There's nothing to equip to!")
- return
- if(C.ckey) && if(!C.ckey == ckey)
- to_chat(user, "That isn't your tile!")
- return
- C.display_card(loadedcard, TRUE) //This is probably a summon
- user.visible_message("[user] points the [src] at the [C], summoning a [loadedcard]!", "<span class='notice'>You summon the [loadedcard[ on the [C]!</span>")
- if(!C.ckey)
- C.ckey = user.ckey //If no owner, make the player of the card the owner
- /obj/structure/cardtile
- name = "Griffening Card Tile"
- desc = "A tile where you can summon holograms on. Useful for playing some interactive Griffening."
- anchored = FALSE
- var/cardshowing //The card it currently has loaded into it
- var/outfit //If the card is something like a job giver, then it will put the outfit thingy on the dummy
- var/weapon //What weapon the creature is currently holding.
- var/ckey //The player that owns this thing
- var/hologramoverlay
- /obj/structure/cardtile/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/wrench))
- if(!anchored)
- anchored = TRUE
- to_chat(user, "You fasten the bolts of the [src] in place.")
- else
- anchored = FALSE
- to_chat(user, "You loosen the bolts of the [src].")
- /obj/structure/cardtile/proc/display_card(/obj/item/griffening_single/card, IsSummon)
- if(!istype(card)) //No runtimes
- return
- if(cardshowing)
- return //Prevents a new card from overriding another card
- cardshowing == card
- hologramoverlay = updategraphic() //The proc returns the fancy hologram
- if(IsSummon)
- if(card.summonsound)
- playsound(src, summonsound, 50, 1)
- visible_message("A [card] is summoned on [src]!")
- /obj/structure/cardtile/proc/updategraphic() //Making a new, random looking dummy every proc call is probably a bad idea.
- qdel(hologramobject)
- hologramobject = null //This is probably overkill
- var/mob/living/carbon/human/dummy/holo = generate_or_wait_for_human_dummy("holo")
- if(outfit)
- holo.equipOutfit(outfit) //If they have a specific job, equip the outfit. Useful for identifying certain creatures easier
- if(weapon)
- var/obj/item/weapon = new weapon(src)
- if(holo.put_in_hands(weapon)) //Put weapons into hands, pretty fancy
- holo.setDir(SOUTH) //Gotta have that full frontal view of stuff
- COMPILE_OVERLAYS(holo)
- unset_busy_human_dummy("holo")
- . = getFlatIcon(dummy)
- #undef SUMMON
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement