Merge pull request #12169 from Ghommie/Ghommie-cit734
Porting some radial menu updates, and that one clown mask skin.
This commit is contained in:
@@ -6,17 +6,42 @@
|
||||
icon_state = "cutout_basic"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
resistance_flags = FLAMMABLE
|
||||
// Possible restyles for the cutout;
|
||||
// add an entry in change_appearance() if you add to here
|
||||
var/list/possible_appearances = list("Assistant", "Clown", "Mime",
|
||||
"Traitor", "Nuke Op", "Cultist", "Brass Cultist", "Clockwork Cultist",
|
||||
"Revolutionary", "Wizard", "Shadowling", "Xenomorph", "Xenomorph Maid", "Swarmer",
|
||||
"Ash Walker", "Deathsquad Officer", "Ian", "Slaughter Demon",
|
||||
"Laughter Demon", "Private Security Officer", "Securitron", "Gondola", "Monkey")
|
||||
var/pushed_over = FALSE //If the cutout is pushed over and has to be righted
|
||||
var/deceptive = FALSE //If the cutout actually appears as what it portray and not a discolored version
|
||||
/// Possible restyles for the cutout, add an entry in change_appearance() if you add to here
|
||||
var/static/list/possible_appearances
|
||||
/// If the cutout is pushed over and has to be righted
|
||||
var/pushed_over = FALSE
|
||||
/// If the cutout actually appears as what it portray and not a discolored version
|
||||
var/deceptive = FALSE
|
||||
|
||||
var/lastattacker = null
|
||||
/obj/item/cardboard_cutout/Initialize()
|
||||
. = ..()
|
||||
if(possible_appearances)
|
||||
return
|
||||
possible_appearances = sortList(list(
|
||||
"Assistant" = image(icon = src.icon, icon_state = "cutout_greytide"),
|
||||
"Clown" = image(icon = src.icon, icon_state = "cutout_clown"),
|
||||
"Mime" = image(icon = src.icon, icon_state = "cutout_mime"),
|
||||
"Traitor" = image(icon = src.icon, icon_state = "cutout_traitor"),
|
||||
"Nuke Op" = image(icon = src.icon, icon_state = "cutout_fluke"),
|
||||
"Cultist" = image(icon = src.icon, icon_state = "cutout_cultist"),
|
||||
"Brass Cultist" = image(icon = src.icon, icon_state = "cutout_servant"),
|
||||
"Clockwork Cultist" = image(icon = src.icon, icon_state = "cutout_new_servant"),
|
||||
"Revolutionary" = image(icon = src.icon, icon_state = "cutout_viva"),
|
||||
"Wizard" = image(icon = src.icon, icon_state = "cutout_wizard"),
|
||||
"Shadowling" = image(icon = src.icon, icon_state = "cutout_shadowling"),
|
||||
"Xenomorph" = image(icon = src.icon, icon_state = "cutout_fukken_xeno"),
|
||||
"Xenomorph Maid" = image(icon = src.icon, icon_state = "cutout_lusty"),
|
||||
"Swarmer" = image(icon = src.icon, icon_state = "cutout_swarmer"),
|
||||
"Ash Walker" = image(icon = src.icon, icon_state = "cutout_free_antag"),
|
||||
"Deathsquad Officer" = image(icon = src.icon, icon_state = "cutout_deathsquad"),
|
||||
"Ian" = image(icon = src.icon, icon_state = "cutout_ian"),
|
||||
"Slaughter Demon" = image(icon = 'icons/mob/mob.dmi', icon_state = "daemon"),
|
||||
"Laughter Demon" = image(icon = 'icons/mob/mob.dmi', icon_state = "bowmon"),
|
||||
"Private Security Officer" = image(icon = src.icon, icon_state = "cutout_ntsec"),
|
||||
"Securitron" = image(icon = src.icon, icon_state = "cutout_law"),
|
||||
"Gondola" = image(icon = src.icon, icon_state = "cutout_gondola"),
|
||||
"Monkey" = image(icon = src.icon, icon_state = "cutout_monky"),
|
||||
))
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/item/cardboard_cutout/attack_hand(mob/living/user)
|
||||
@@ -76,22 +101,21 @@
|
||||
push_over()
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
/**
|
||||
* change_appearance: Changes a skin of the cardboard cutout based on a user's choice
|
||||
*
|
||||
* Arguments:
|
||||
* * crayon The crayon used to change and recolor the cardboard cutout
|
||||
* * user The mob choosing a skin of the cardboard cutout
|
||||
*/
|
||||
/obj/item/cardboard_cutout/proc/change_appearance(obj/item/toy/crayon/crayon, mob/living/user)
|
||||
if(!crayon || !user)
|
||||
return
|
||||
if(pushed_over)
|
||||
to_chat(user, "<span class='warning'>Right [src] first!</span>")
|
||||
return
|
||||
if(crayon.check_empty(user))
|
||||
return
|
||||
if(crayon.is_capped)
|
||||
to_chat(user, "<span class='warning'>Take the cap off first!</span>")
|
||||
return
|
||||
var/new_appearance = input(user, "Choose a new appearance for [src].", "26th Century Deception") as null|anything in possible_appearances
|
||||
if(!new_appearance || !crayon || !user.canUseTopic(src))
|
||||
var/new_appearance = show_radial_menu(user, src, possible_appearances, custom_check = CALLBACK(src, .proc/check_menu, user, crayon), radius = 36, require_near = TRUE)
|
||||
if(!new_appearance)
|
||||
return
|
||||
if(!do_after(user, 10, FALSE, src, TRUE))
|
||||
return
|
||||
return FALSE
|
||||
if(!check_menu(user, crayon))
|
||||
return FALSE
|
||||
user.visible_message("<span class='notice'>[user] gives [src] a new look.</span>", "<span class='notice'>Voila! You give [src] a new look.</span>")
|
||||
crayon.use_charges(1)
|
||||
crayon.check_empty(user)
|
||||
@@ -196,7 +220,33 @@
|
||||
name = "monkey ([rand(1, 999)])"
|
||||
desc = "A cardboard cutout of a monkey."
|
||||
icon_state = "cutout_monky"
|
||||
return 1
|
||||
else
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
*
|
||||
* Arguments:
|
||||
* * user The mob interacting with a menu
|
||||
* * crayon The crayon used to interact with a menu
|
||||
*/
|
||||
/obj/item/cardboard_cutout/proc/check_menu(mob/living/user, obj/item/toy/crayon/crayon)
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(user.incapacitated())
|
||||
return FALSE
|
||||
if(pushed_over)
|
||||
to_chat(user, "<span class='warning'>Right [src] first!</span>")
|
||||
return FALSE
|
||||
if(!crayon || !user.is_holding(crayon))
|
||||
return FALSE
|
||||
if(crayon.check_empty(user))
|
||||
return FALSE
|
||||
if(crayon.is_capped)
|
||||
to_chat(user, "<span class='warning'>Take the cap off first!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/cardboard_cutout/setDir(newdir)
|
||||
dir = SOUTH
|
||||
|
||||
@@ -850,12 +850,6 @@
|
||||
|
||||
|
||||
|
||||
#define NODESIGN "None"
|
||||
#define NANOTRASEN "NanotrasenStandard"
|
||||
#define SYNDI "SyndiSnacks"
|
||||
#define HEART "Heart"
|
||||
#define SMILEY "SmileyFace"
|
||||
|
||||
/obj/item/storage/box/papersack
|
||||
name = "paper sack"
|
||||
desc = "A sack neatly crafted out of paper."
|
||||
@@ -863,7 +857,18 @@
|
||||
item_state = "paperbag_None"
|
||||
resistance_flags = FLAMMABLE
|
||||
foldable = null
|
||||
var/design = NODESIGN
|
||||
/// A list of all available papersack reskins
|
||||
var/list/papersack_designs = list()
|
||||
|
||||
/obj/item/storage/box/papersack/Initialize(mapload)
|
||||
. = ..()
|
||||
papersack_designs = sortList(list(
|
||||
"None" = image(icon = src.icon, icon_state = "paperbag_None"),
|
||||
"NanotrasenStandard" = image(icon = src.icon, icon_state = "paperbag_NanotrasenStandard"),
|
||||
"SyndiSnacks" = image(icon = src.icon, icon_state = "paperbag_SyndiSnacks"),
|
||||
"Heart" = image(icon = src.icon, icon_state = "paperbag_Heart"),
|
||||
"SmileyFace" = image(icon = src.icon, icon_state = "paperbag_SmileyFace")
|
||||
))
|
||||
|
||||
/obj/item/storage/box/papersack/update_icon_state()
|
||||
if(contents.len == 0)
|
||||
@@ -871,55 +876,64 @@
|
||||
else
|
||||
icon_state = "[item_state]_closed"
|
||||
|
||||
|
||||
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
//if a pen is used on the sack, dialogue to change its design appears
|
||||
if(contents.len)
|
||||
to_chat(user, "<span class='warning'>You can't modify [src] with items still inside!</span>")
|
||||
return
|
||||
var/list/designs = list(NODESIGN, NANOTRASEN, SYNDI, HEART, SMILEY, "Cancel")
|
||||
var/switchDesign = input("Select a Design:", "Paper Sack Design", designs[1]) in designs
|
||||
if(get_dist(usr, src) > 1)
|
||||
to_chat(usr, "<span class='warning'>You have moved too far away!</span>")
|
||||
return
|
||||
var/choice = designs.Find(switchDesign)
|
||||
if(design == designs[choice] || designs[choice] == "Cancel")
|
||||
return 0
|
||||
to_chat(usr, "<span class='notice'>You make some modifications to [src] using your pen.</span>")
|
||||
design = designs[choice]
|
||||
icon_state = "paperbag_[design]"
|
||||
item_state = "paperbag_[design]"
|
||||
switch(designs[choice])
|
||||
if(NODESIGN)
|
||||
var/choice = show_radial_menu(user, src , papersack_designs, custom_check = CALLBACK(src, .proc/check_menu, user, W), radius = 36, require_near = TRUE)
|
||||
if(!choice)
|
||||
return FALSE
|
||||
if(icon_state == "paperbag_[choice]")
|
||||
return FALSE
|
||||
switch(choice)
|
||||
if("None")
|
||||
desc = "A sack neatly crafted out of paper."
|
||||
if(NANOTRASEN)
|
||||
if("NanotrasenStandard")
|
||||
desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
|
||||
if(SYNDI)
|
||||
if("SyndiSnacks")
|
||||
desc = "The design on this paper sack is a remnant of the notorious 'SyndieSnacks' program."
|
||||
if(HEART)
|
||||
if("Heart")
|
||||
desc = "A paper sack with a heart etched onto the side."
|
||||
if(SMILEY)
|
||||
if("SmileyFace")
|
||||
desc = "A paper sack with a crude smile etched onto the side."
|
||||
return 0
|
||||
else
|
||||
return FALSE
|
||||
to_chat(user, "<span class='notice'>You make some modifications to [src] using your pen.</span>")
|
||||
icon_state = "paperbag_[choice]"
|
||||
item_state = "paperbag_[choice]"
|
||||
return FALSE
|
||||
else if(W.get_sharpness())
|
||||
if(!contents.len)
|
||||
if(item_state == "paperbag_None")
|
||||
user.show_message("<span class='notice'>You cut eyeholes into [src].</span>", MSG_VISUAL)
|
||||
new /obj/item/clothing/head/papersack(user.loc)
|
||||
qdel(src)
|
||||
return 0
|
||||
return FALSE
|
||||
else if(item_state == "paperbag_SmileyFace")
|
||||
user.show_message("<span class='notice'>You cut eyeholes into [src] and modify the design.</span>", MSG_VISUAL)
|
||||
new /obj/item/clothing/head/papersack/smiley(user.loc)
|
||||
qdel(src)
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
#undef NODESIGN
|
||||
#undef NANOTRASEN
|
||||
#undef SYNDI
|
||||
#undef HEART
|
||||
#undef SMILEY
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
*
|
||||
* Arguments:
|
||||
* * user The mob interacting with a menu
|
||||
* * P The pen used to interact with a menu
|
||||
*/
|
||||
/obj/item/storage/box/papersack/proc/check_menu(mob/user, obj/item/pen/P)
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(user.incapacitated())
|
||||
return FALSE
|
||||
if(contents.len)
|
||||
to_chat(user, "<span class='warning'>You can't modify [src] with items still inside!</span>")
|
||||
return FALSE
|
||||
if(!P || !user.is_holding(P))
|
||||
to_chat(user, "<span class='warning'>You need a pen to modify [src]!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/box/ingredients //This box is for the randomly chosen version the chef spawns with, it shouldn't actually exist.
|
||||
name = "ingredients box"
|
||||
|
||||
@@ -902,79 +902,57 @@
|
||||
name = "hand of cards"
|
||||
desc = "A number of cards not in a deck, customarily held in ones hand."
|
||||
icon = 'icons/obj/toy.dmi'
|
||||
icon_state = "nanotrasen_hand2"
|
||||
icon_state = "none"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/list/currenthand = list()
|
||||
var/choice = null
|
||||
|
||||
|
||||
/obj/item/toy/cards/cardhand/attack_self(mob/user)
|
||||
user.set_machine(src)
|
||||
var/list/handradial = list()
|
||||
interact(user)
|
||||
|
||||
/obj/item/toy/cards/cardhand/ui_interact(mob/user)
|
||||
. = ..()
|
||||
var/dat = "You have:<BR>"
|
||||
for(var/t in currenthand)
|
||||
dat += "<A href='?src=[REF(src)];pick=[t]'>A [t].</A><BR>"
|
||||
dat += "Which card will you remove next?"
|
||||
var/datum/browser/popup = new(user, "cardhand", "Hand of Cards", 400, 240)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
handradial[t] = image(icon = src.icon, icon_state = "sc_[t]_[deckstyle]")
|
||||
|
||||
|
||||
/obj/item/toy/cards/cardhand/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(usr.stat || !ishuman(usr))
|
||||
return
|
||||
var/mob/living/carbon/human/cardUser = usr
|
||||
var/O = src
|
||||
if(href_list["pick"])
|
||||
if (cardUser.is_holding(src))
|
||||
var/choice = href_list["pick"]
|
||||
var/obj/item/toy/cards/singlecard/C = new/obj/item/toy/cards/singlecard(cardUser.loc)
|
||||
src.currenthand -= choice
|
||||
C.parentdeck = src.parentdeck
|
||||
C.cardname = choice
|
||||
C.apply_card_vars(C,O)
|
||||
C.pickup(cardUser)
|
||||
cardUser.put_in_hands(C)
|
||||
cardUser.visible_message("<span class='notice'>[cardUser] draws a card from [cardUser.p_their()] hand.</span>", "<span class='notice'>You take the [C.cardname] from your hand.</span>")
|
||||
|
||||
interact(cardUser)
|
||||
if(src.currenthand.len < 3)
|
||||
src.icon_state = "[deckstyle]_hand2"
|
||||
else if(src.currenthand.len < 4)
|
||||
src.icon_state = "[deckstyle]_hand3"
|
||||
else if(src.currenthand.len < 5)
|
||||
src.icon_state = "[deckstyle]_hand4"
|
||||
if(src.currenthand.len == 1)
|
||||
var/obj/item/toy/cards/singlecard/N = new/obj/item/toy/cards/singlecard(src.loc)
|
||||
N.parentdeck = src.parentdeck
|
||||
N.cardname = src.currenthand[1]
|
||||
N.apply_card_vars(N,O)
|
||||
qdel(src)
|
||||
N.pickup(cardUser)
|
||||
cardUser.put_in_hands(N)
|
||||
to_chat(cardUser, "<span class='notice'>You also take [currenthand[1]] and hold it.</span>")
|
||||
cardUser << browse(null, "window=cardhand")
|
||||
if(!(cardUser.mobility_flags & MOBILITY_USE))
|
||||
return
|
||||
var/O = src
|
||||
var/choice = show_radial_menu(usr,src, handradial, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 36, require_near = TRUE)
|
||||
if(!choice)
|
||||
return FALSE
|
||||
var/obj/item/toy/cards/singlecard/C = new/obj/item/toy/cards/singlecard(cardUser.loc)
|
||||
currenthand -= choice
|
||||
handradial -= choice
|
||||
C.parentdeck = parentdeck
|
||||
C.cardname = choice
|
||||
C.apply_card_vars(C,O)
|
||||
C.pickup(cardUser)
|
||||
cardUser.put_in_hands(C)
|
||||
cardUser.visible_message("<span class='notice'>[cardUser] draws a card from [cardUser.p_their()] hand.</span>", "<span class='notice'>You take the [C.cardname] from your hand.</span>")
|
||||
|
||||
interact(cardUser)
|
||||
update_sprite()
|
||||
if(length(currenthand) == 1)
|
||||
var/obj/item/toy/cards/singlecard/N = new/obj/item/toy/cards/singlecard(loc)
|
||||
N.parentdeck = parentdeck
|
||||
N.cardname = currenthand[1]
|
||||
N.apply_card_vars(N,O)
|
||||
qdel(src)
|
||||
N.pickup(cardUser)
|
||||
cardUser.put_in_hands(N)
|
||||
to_chat(cardUser, "<span class='notice'>You also take [currenthand[1]] and hold it.</span>")
|
||||
|
||||
/obj/item/toy/cards/cardhand/attackby(obj/item/toy/cards/singlecard/C, mob/living/user, params)
|
||||
if(istype(C))
|
||||
if(C.parentdeck == src.parentdeck)
|
||||
src.currenthand += C.cardname
|
||||
user.visible_message("[user] adds a card to [user.p_their()] hand.", "<span class='notice'>You add the [C.cardname] to your hand.</span>")
|
||||
user.visible_message("<span class='notice'>[user] adds a card to [user.p_their()] hand.</span>", "<span class='notice'>You add the [C.cardname] to your hand.</span>")
|
||||
qdel(C)
|
||||
interact(user)
|
||||
if(currenthand.len > 4)
|
||||
src.icon_state = "[deckstyle]_hand5"
|
||||
else if(currenthand.len > 3)
|
||||
src.icon_state = "[deckstyle]_hand4"
|
||||
else if(currenthand.len > 2)
|
||||
src.icon_state = "[deckstyle]_hand3"
|
||||
update_sprite(src)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't mix cards from other decks!</span>")
|
||||
else
|
||||
@@ -983,7 +961,7 @@
|
||||
/obj/item/toy/cards/cardhand/apply_card_vars(obj/item/toy/cards/newobj,obj/item/toy/cards/sourceobj)
|
||||
..()
|
||||
newobj.deckstyle = sourceobj.deckstyle
|
||||
newobj.icon_state = "[deckstyle]_hand2" // Another dumb hack, without this the hand is invisible (or has the default deckstyle) until another card is added.
|
||||
update_sprite()
|
||||
newobj.card_hitsound = sourceobj.card_hitsound
|
||||
newobj.card_force = sourceobj.card_force
|
||||
newobj.card_throwforce = sourceobj.card_throwforce
|
||||
@@ -992,6 +970,31 @@
|
||||
newobj.card_attack_verb = sourceobj.card_attack_verb
|
||||
newobj.resistance_flags = sourceobj.resistance_flags
|
||||
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
*
|
||||
* Arguments:
|
||||
* * user The mob interacting with a menu
|
||||
*/
|
||||
/obj/item/toy/cards/cardhand/proc/check_menu(mob/living/user)
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(user.incapacitated())
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* This proc updates the sprite for when you create a hand of cards
|
||||
*/
|
||||
/obj/item/toy/cards/cardhand/proc/update_sprite()
|
||||
cut_overlays()
|
||||
var/overlay_cards = currenthand.len
|
||||
|
||||
var/k = overlay_cards == 2 ? 1 : overlay_cards - 2
|
||||
for(var/i = k; i <= overlay_cards; i++)
|
||||
var/card_overlay = image(icon=src.icon,icon_state="sc_[currenthand[i]]_[deckstyle]",pixel_x=(1-i+k)*3,pixel_y=(1-i+k)*3)
|
||||
add_overlay(card_overlay)
|
||||
|
||||
/obj/item/toy/cards/singlecard
|
||||
name = "card"
|
||||
desc = "a card"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
updateUsrDialog()
|
||||
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
|
||||
return
|
||||
|
||||
@@ -96,70 +95,82 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
|
||||
var/list/items = list()
|
||||
if(mybag)
|
||||
dat += "<a href='?src=[REF(src)];garbage=1'>[mybag.name]</a><br>"
|
||||
items += list("Trash bag" = image(icon = mybag.icon, icon_state = mybag.icon_state))
|
||||
if(mymop)
|
||||
dat += "<a href='?src=[REF(src)];mop=1'>[mymop.name]</a><br>"
|
||||
items += list("Mop" = image(icon = mymop.icon, icon_state = mymop.icon_state))
|
||||
if(mybroom)
|
||||
dat += "<a href='?src=[REF(src)];broom=1'>[mybroom.name]</a><br>"
|
||||
items += list("Broom" = image(icon = mybroom.icon, icon_state = mybroom.icon_state))
|
||||
if(myspray)
|
||||
dat += "<a href='?src=[REF(src)];spray=1'>[myspray.name]</a><br>"
|
||||
items += list("Spray bottle" = image(icon = myspray.icon, icon_state = myspray.icon_state))
|
||||
if(myreplacer)
|
||||
dat += "<a href='?src=[REF(src)];replacer=1'>[myreplacer.name]</a><br>"
|
||||
if(signs)
|
||||
dat += "<a href='?src=[REF(src)];sign=1'>[signs] sign\s</a><br>"
|
||||
var/datum/browser/popup = new(user, "janicart", name, 240, 160)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
items += list("Light replacer" = image(icon = myreplacer.icon, icon_state = myreplacer.icon_state))
|
||||
var/obj/item/caution/sign = locate() in src
|
||||
if(sign)
|
||||
items += list("Sign" = image(icon = sign.icon, icon_state = sign.icon_state))
|
||||
|
||||
|
||||
/obj/structure/janitorialcart/Topic(href, href_list)
|
||||
if(!in_range(src, usr))
|
||||
if(!length(items))
|
||||
return
|
||||
if(!isliving(usr))
|
||||
items = sortList(items)
|
||||
var/pick = show_radial_menu(user, src, items, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 38, require_near = TRUE)
|
||||
if(!pick)
|
||||
return
|
||||
var/mob/living/user = usr
|
||||
if(href_list["garbage"])
|
||||
if(mybag)
|
||||
switch(pick)
|
||||
if("Trash bag")
|
||||
if(!mybag)
|
||||
return
|
||||
user.put_in_hands(mybag)
|
||||
to_chat(user, "<span class='notice'>You take [mybag] from [src].</span>")
|
||||
mybag = null
|
||||
if(href_list["mop"])
|
||||
if(mymop)
|
||||
if("Mop")
|
||||
if(!mymop)
|
||||
return
|
||||
user.put_in_hands(mymop)
|
||||
to_chat(user, "<span class='notice'>You take [mymop] from [src].</span>")
|
||||
mymop = null
|
||||
if(href_list["broom"])
|
||||
if(mybroom)
|
||||
if("Broom")
|
||||
if(!mybroom)
|
||||
return
|
||||
user.put_in_hands(mybroom)
|
||||
to_chat(user, "<span class='notice'>You take [mybroom] from [src].</span>")
|
||||
mybroom = null
|
||||
if(href_list["spray"])
|
||||
if(myspray)
|
||||
if("Spray bottle")
|
||||
if(!myspray)
|
||||
return
|
||||
user.put_in_hands(myspray)
|
||||
to_chat(user, "<span class='notice'>You take [myspray] from [src].</span>")
|
||||
myspray = null
|
||||
if(href_list["replacer"])
|
||||
if(myreplacer)
|
||||
if("Light replacer")
|
||||
if(!myreplacer)
|
||||
return
|
||||
user.put_in_hands(myreplacer)
|
||||
to_chat(user, "<span class='notice'>You take [myreplacer] from [src].</span>")
|
||||
myreplacer = null
|
||||
if(href_list["sign"])
|
||||
if(signs)
|
||||
var/obj/item/caution/Sign = locate() in src
|
||||
if(Sign)
|
||||
user.put_in_hands(Sign)
|
||||
to_chat(user, "<span class='notice'>You take \a [Sign] from [src].</span>")
|
||||
signs--
|
||||
else
|
||||
WARNING("Signs ([signs]) didn't match contents")
|
||||
signs = 0
|
||||
if("Sign")
|
||||
if(signs <= 0)
|
||||
return
|
||||
user.put_in_hands(sign)
|
||||
to_chat(user, "<span class='notice'>You take \a [sign] from [src].</span>")
|
||||
signs--
|
||||
else
|
||||
return
|
||||
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
*
|
||||
* Arguments:
|
||||
* * user The mob interacting with a menu
|
||||
*/
|
||||
/obj/structure/janitorialcart/proc/check_menu(mob/living/user)
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(user.incapacitated())
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/janitorialcart/update_overlays()
|
||||
. = ..()
|
||||
|
||||
@@ -91,8 +91,13 @@
|
||||
if (!is_ghost && !in_range(src, user))
|
||||
return
|
||||
|
||||
var/list/tool_list = list(
|
||||
"Up" = image(icon = 'icons/testing/turf_analysis.dmi', icon_state = "red_arrow", dir = NORTH),
|
||||
"Down" = image(icon = 'icons/testing/turf_analysis.dmi', icon_state = "red_arrow", dir = SOUTH)
|
||||
)
|
||||
|
||||
if (up && down)
|
||||
var/result = alert("Go up or down [src]?", "Ladder", "Up", "Down", "Cancel")
|
||||
var/result = show_radial_menu(user, src, tool_list, custom_check = CALLBACK(src, .proc/check_menu, user), require_near = TRUE, tooltips = TRUE)
|
||||
if (!is_ghost && !in_range(src, user))
|
||||
return // nice try
|
||||
switch(result)
|
||||
@@ -112,6 +117,11 @@
|
||||
if(!is_ghost)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/ladder/proc/check_menu(mob/user)
|
||||
if(user.incapacitated() || !user.Adjacent(src))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/ladder/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
Reference in New Issue
Block a user