Remove drop_item, drop_item_v, put_in_hands_or_del

This commit is contained in:
Jordan Brown
2017-10-07 13:36:33 -04:00
committed by CitadelStationBot
parent 5f4b3594d0
commit 075cb673c0
152 changed files with 1778 additions and 425 deletions
@@ -20,6 +20,7 @@
Radio = new/obj/item/device/radio(src)
Radio.listening = FALSE
locate_stacking_machine()
<<<<<<< HEAD
/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/card/id/prisoner))
@@ -122,6 +123,108 @@
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
if(!emagged)
=======
/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/card/id/prisoner))
if(!inserted_id)
if(!user.transferItemToLoc(I, src))
return
inserted_id = I
to_chat(user, "<span class='notice'>You insert [I].</span>")
return
else
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
return ..()
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "labor_claim_console", name, 450, 475, master_ui, state)
ui.open()
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
var/list/data = list()
var/can_go_home = FALSE
data["emagged"] = emagged
if(inserted_id)
data["id"] = inserted_id
data["id_name"] = inserted_id.registered_name
data["points"] = inserted_id.points
data["goal"] = inserted_id.goal
if(check_auth())
can_go_home = TRUE
var/list/ores = list()
if(stacking_machine)
data["unclaimed_points"] = stacking_machine.points
for(var/ore in stacking_machine.ore_values)
var/list/O = list()
O["ore"] = ore
O["value"] = stacking_machine.ore_values[ore]
ores += list(O)
data["ores"] = ores
data["can_go_home"] = can_go_home
return data
/obj/machinery/mineral/labor_claim_console/ui_act(action, params)
if(..())
return
switch(action)
if("handle_id")
if(inserted_id)
if(!usr.get_active_held_item())
usr.put_in_hands(inserted_id)
inserted_id = null
else
inserted_id.forceMove(get_turf(src))
inserted_id = null
else
var/obj/item/I = usr.get_active_held_item()
if(istype(I, /obj/item/card/id/prisoner))
if(!usr.transferItemToLoc(I, src))
return
inserted_id = I
if("claim_points")
inserted_id.points += stacking_machine.points
stacking_machine.points = 0
to_chat(usr, "Points transferred.")
if("move_shuttle")
if(!alone_in_area(get_area(src), usr))
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
else
switch(SSshuttle.moveShuttle("laborcamp","laborcamp_home"))
if(1)
to_chat(usr, "<span class='notice'>Shuttle not found</span>")
if(2)
to_chat(usr, "<span class='notice'>Shuttle already at station</span>")
if(3)
to_chat(usr, "<span class='notice'>No permission to dock could be granted.</span>")
else
if(!emagged)
Radio.set_frequency(GLOB.SEC_FREQ)
Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", GLOB.SEC_FREQ, get_spans(), get_default_language())
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
/obj/machinery/mineral/labor_claim_console/proc/check_auth()
if(emagged)
return 1 //Shuttle is emagged, let any ol' person through
return (istype(inserted_id) && inserted_id.points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota.
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
if(stacking_machine)
stacking_machine.CONSOLE = src
else
qdel(src)
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
if(!emagged)
>>>>>>> b6d349e... Remove drop_item, drop_item_v, put_in_hands_or_del (#31386)
emagged = TRUE
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")