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
+1 -2
View File
@@ -67,8 +67,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
B.handle_item_insertion(src)
uses_left--
if(uses_left <= 0)
user.drop_item(src)
loc = A
user.transferItemToLoc(src, A, TRUE)
var/mutable_appearance/balloon
var/mutable_appearance/balloon2
var/mutable_appearance/balloon3
@@ -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>")
@@ -1005,7 +1005,7 @@
if(H == L)
continue
to_chat(H, "<span class='userdanger'>You have an overwhelming desire to kill [L]. [L.p_they(TRUE)] [L.p_have()] been marked red! Go kill [L.p_them()]!</span>")
H.put_in_hands_or_del(new /obj/item/kitchen/knife/butcher(H))
H.put_in_hands(new /obj/item/kitchen/knife/butcher(H), TRUE)
qdel(src)
+1 -2
View File
@@ -166,9 +166,8 @@
if(istype(W, /obj/item/card/id))
var/obj/item/card/id/I = user.get_active_held_item()
if(istype(I) && !istype(inserted_id))
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.forceMove(src)
inserted_id = I
interact(user)
return
+2 -4
View File
@@ -116,9 +116,8 @@
else if(href_list["choice"] == "insert")
var/obj/item/card/id/I = usr.get_active_held_item()
if(istype(I))
if(!usr.drop_item())
if(!usr.transferItemToLoc(I, src))
return
I.loc = src
inserted_id = I
to_chat(usr, "<span class='notice'>You insert the ID into [src]'s card slot.</span>")
else
@@ -155,9 +154,8 @@
if(istype(I, /obj/item/card/id))
var/obj/item/card/id/C = usr.get_active_held_item()
if(istype(C) && !istype(inserted_id))
if(!usr.drop_item())
if(!usr.transferItemToLoc(C, src))
return
C.loc = src
inserted_id = C
to_chat(usr, "<span class='notice'>You insert the ID into [src]'s card slot.</span>")
interact(user)
+1 -3
View File
@@ -11,9 +11,7 @@
/obj/structure/ore_box/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/ore))
if(!user.drop_item())
return
W.forceMove(src)
user.transferItemToLoc(W, src)
else if (istype(W, /obj/item/storage))
var/obj/item/storage/S = W
for(var/obj/item/ore/O in S.contents)