Cyborgs grabbing ore works consistently
This commit is contained in:
@@ -30,48 +30,39 @@
|
|||||||
show_message = FALSE
|
show_message = FALSE
|
||||||
break
|
break
|
||||||
var/obj/item/weapon/storage/bag/ore/OB
|
var/obj/item/weapon/storage/bag/ore/OB
|
||||||
if(istype(loc, /turf/open/floor/plating/asteroid))
|
if(ishuman(AM))
|
||||||
if(ishuman(AM))
|
var/mob/living/carbon/human/H = AM
|
||||||
var/mob/living/carbon/human/H = AM
|
OB = locate(/obj/item/weapon/storage/bag/ore) in H.get_storage_slots()
|
||||||
for(var/thing in H.get_storage_slots())
|
if(!OB)
|
||||||
if(istype(thing, /obj/item/weapon/storage/bag/ore))
|
OB = locate(/obj/item/weapon/storage/bag/ore) in H.held_items
|
||||||
OB = thing
|
else if(iscyborg(AM))
|
||||||
break
|
var/mob/living/silicon/robot/R = AM
|
||||||
for(var/thing in H.held_items)
|
OB = locate(/obj/item/weapon/storage/bag/ore) in R.held_items
|
||||||
if(istype(thing, /obj/item/weapon/storage/bag/ore))
|
if(OB)
|
||||||
OB = thing
|
var/obj/structure/ore_box/box
|
||||||
break
|
if(!OB.can_be_inserted(src, TRUE, AM))
|
||||||
else if(iscyborg(AM))
|
if(!OB.spam_protection)
|
||||||
var/mob/living/silicon/robot/R = AM
|
to_chat(AM, "<span class='warning'>Your [OB.name] is full and can't hold any more ore!</span>")
|
||||||
for(var/thing in R.module_active)
|
OB.spam_protection = TRUE
|
||||||
if(istype(thing, /obj/item/weapon/storage/bag/ore))
|
sleep(1)
|
||||||
OB = thing
|
OB.spam_protection = FALSE
|
||||||
break
|
else
|
||||||
if(OB)
|
OB.handle_item_insertion(src, TRUE, AM)
|
||||||
var/obj/structure/ore_box/box
|
// Then, if the user is dragging an ore box, empty the satchel
|
||||||
if(!OB.can_be_inserted(src, TRUE, AM))
|
// into the box.
|
||||||
if(!OB.spam_protection)
|
var/mob/living/L = AM
|
||||||
to_chat(AM, "<span class='warning'>Your [OB.name] is full and can't hold any more ore!</span>")
|
if(istype(L.pulling, /obj/structure/ore_box))
|
||||||
OB.spam_protection = TRUE
|
box = L.pulling
|
||||||
sleep(1)
|
for(var/obj/item/weapon/ore/O in OB)
|
||||||
OB.spam_protection = FALSE
|
OB.remove_from_storage(src, box)
|
||||||
|
if(show_message)
|
||||||
|
playsound(L, "rustle", 50, TRUE)
|
||||||
|
if(box)
|
||||||
|
L.visible_message("<span class='notice'>[L] offloads the ores into [box].</span>", \
|
||||||
|
"<span class='notice'>You offload the ores beneath you into your [box.name].</span>")
|
||||||
else
|
else
|
||||||
OB.handle_item_insertion(src, TRUE, AM)
|
L.visible_message("<span class='notice'>[L] scoops up the ores beneath them.</span>", \
|
||||||
// Then, if the user is dragging an ore box, empty the satchel
|
"<span class='notice'>You scoop up the ores beneath you with your [OB.name].</span>")
|
||||||
// into the box.
|
|
||||||
var/mob/living/L = AM
|
|
||||||
if(istype(L.pulling, /obj/structure/ore_box))
|
|
||||||
box = L.pulling
|
|
||||||
for(var/obj/item/weapon/ore/O in OB)
|
|
||||||
OB.remove_from_storage(src, box)
|
|
||||||
if(show_message)
|
|
||||||
playsound(L, "rustle", 50, TRUE)
|
|
||||||
if(box)
|
|
||||||
L.visible_message("<span class='notice'>[L] offloads the ores into [box].</span>", \
|
|
||||||
"<span class='notice'>You offload the ores beneath you into your [box.name].</span>")
|
|
||||||
else
|
|
||||||
L.visible_message("<span class='notice'>[L] scoops up the ores beneath them.</span>", \
|
|
||||||
"<span class='notice'>You scoop up the ores beneath you with your [OB.name].</span>")
|
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/item/weapon/ore/uranium
|
/obj/item/weapon/ore/uranium
|
||||||
|
|||||||
@@ -656,29 +656,6 @@
|
|||||||
add_overlay(head_overlay)
|
add_overlay(head_overlay)
|
||||||
update_fire()
|
update_fire()
|
||||||
|
|
||||||
#define BORG_CAMERA_BUFFER 30
|
|
||||||
|
|
||||||
/mob/living/silicon/robot/proc/do_camera_update(oldLoc)
|
|
||||||
if(oldLoc != src.loc)
|
|
||||||
GLOB.cameranet.updatePortableCamera(src.camera)
|
|
||||||
updating = 0
|
|
||||||
|
|
||||||
/mob/living/silicon/robot/Move(a, b, flag)
|
|
||||||
var/oldLoc = src.loc
|
|
||||||
. = ..()
|
|
||||||
if(.)
|
|
||||||
if(src.camera)
|
|
||||||
if(!updating)
|
|
||||||
updating = 1
|
|
||||||
addtimer(CALLBACK(src, .proc/do_camera_update, oldLoc), BORG_CAMERA_BUFFER)
|
|
||||||
if(module)
|
|
||||||
if(istype(module, /obj/item/weapon/robot_module/miner))
|
|
||||||
if(istype(loc, /turf/open/floor/plating/asteroid))
|
|
||||||
for(var/obj/item/I in held_items)
|
|
||||||
if(istype(I, /obj/item/weapon/storage/bag/ore))
|
|
||||||
loc.attackby(I, src)
|
|
||||||
#undef BORG_CAMERA_BUFFER
|
|
||||||
|
|
||||||
/mob/living/silicon/robot/proc/self_destruct()
|
/mob/living/silicon/robot/proc/self_destruct()
|
||||||
if(emagged)
|
if(emagged)
|
||||||
if(mmi)
|
if(mmi)
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
/mob/living/silicon/robot/Moved(oldLoc, dir)
|
||||||
|
. = ..()
|
||||||
|
update_camera_location(oldLoc)
|
||||||
|
|
||||||
|
/mob/living/silicon/robot/forceMove(atom/destination)
|
||||||
|
. = ..()
|
||||||
|
update_camera_location(destination)
|
||||||
|
|
||||||
|
/mob/living/silicon/robot/proc/do_camera_update(oldLoc)
|
||||||
|
if(!QDELETED(camera) && oldLoc != get_turf(src))
|
||||||
|
GLOB.cameranet.updatePortableCamera(camera)
|
||||||
|
updating = FALSE
|
||||||
|
|
||||||
|
#define BORG_CAMERA_BUFFER 30
|
||||||
|
/mob/living/silicon/robot/proc/update_camera_location(oldLoc)
|
||||||
|
oldLoc = get_turf(oldLoc)
|
||||||
|
if(!QDELETED(camera) && !updating && oldLoc != get_turf(src))
|
||||||
|
updating = TRUE
|
||||||
|
addtimer(CALLBACK(src, .proc/do_camera_update, oldLoc), BORG_CAMERA_BUFFER)
|
||||||
|
#undef BORG_CAMERA_BUFFER
|
||||||
|
|
||||||
/mob/living/silicon/robot/Process_Spacemove(movement_dir = 0)
|
/mob/living/silicon/robot/Process_Spacemove(movement_dir = 0)
|
||||||
if(ionpulse())
|
if(ionpulse())
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user