mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Makes conveyors easier to place with buildmode, adds vars to autogibbers
makes them kill stuff stupid fast
This commit is contained in:
@@ -15,6 +15,10 @@
|
||||
var/atom_say_verb = "says"
|
||||
var/dont_save = 0 // For atoms that are temporary by necessity - like lighting overlays
|
||||
|
||||
// A list of datums that desire to interact with this atom - used so that automated processes
|
||||
// don't step on one another's toes, if they are doing an action that takes time
|
||||
var/list/interaction_queue = list()
|
||||
|
||||
///Chemistry.
|
||||
var/datum/reagents/reagents = null
|
||||
|
||||
|
||||
@@ -132,6 +132,22 @@ Class Procs:
|
||||
else
|
||||
fast_processing += src
|
||||
|
||||
// gotta go fast
|
||||
/obj/machinery/proc/makeSpeedProcess()
|
||||
if(speed_process)
|
||||
return
|
||||
speed_process = 1
|
||||
machine_processing -= src
|
||||
fast_processing += src
|
||||
|
||||
// gotta go slow
|
||||
/obj/machinery/proc/makeNormalProcess()
|
||||
if(!speed_process)
|
||||
return
|
||||
speed_process = 0
|
||||
machine_processing += src
|
||||
fast_processing -= src
|
||||
|
||||
/obj/machinery/New() //new
|
||||
machines += src
|
||||
..()
|
||||
|
||||
@@ -446,22 +446,8 @@
|
||||
log_admin("Build Mode: [key_name(user)] built an airlock at ([object.x],[object.y],[object.z])")
|
||||
new/obj/machinery/door/airlock(get_turf(object))
|
||||
else if(istype(object,/turf) && ctrl_click && left_click)
|
||||
switch(build_dir)
|
||||
if(NORTH)
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.dir = NORTH
|
||||
if(SOUTH)
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.dir = SOUTH
|
||||
if(EAST)
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.dir = EAST
|
||||
if(WEST)
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.dir = WEST
|
||||
if(NORTHWEST)
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.dir = NORTHWEST
|
||||
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
|
||||
WIN.set_dir(build_dir)
|
||||
log_admin("Build Mode: [key_name(user)] built a window at ([object.x],[object.y],[object.z])")
|
||||
|
||||
if(ADV_BUILDMODE)
|
||||
@@ -472,7 +458,7 @@
|
||||
T.ChangeTurf(objholder)
|
||||
else
|
||||
var/obj/A = new objholder (get_turf(object))
|
||||
A.dir = build_dir
|
||||
A.set_dir(build_dir)
|
||||
log_admin("Build Mode: [key_name(user)] modified [A]'s ([A.x],[A.y],[A.z]) dir to [build_dir]")
|
||||
else if(right_click)
|
||||
if(isobj(object))
|
||||
@@ -561,7 +547,7 @@
|
||||
T.ChangeTurf(objholder)
|
||||
else
|
||||
var/obj/A = new objholder(T)
|
||||
A.dir = build_dir
|
||||
A.set_dir(build_dir)
|
||||
deselect_region()
|
||||
return
|
||||
|
||||
|
||||
@@ -12,7 +12,12 @@
|
||||
var/locked = 0 //Used to prevent mobs from breaking the feedin anim
|
||||
|
||||
var/gib_throw_dir = WEST // Direction to spit meat and gibs in. Defaults to west.
|
||||
|
||||
var/gibtime = 40 // Time from starting until meat appears
|
||||
var/animation_delay = GIBBER_ANIMATION_DELAY
|
||||
|
||||
// For hiding gibs, making an even more devious trap (invisible autogibbers)
|
||||
var/stealthmode = FALSE
|
||||
|
||||
var/list/victims = list()
|
||||
|
||||
@@ -110,25 +115,25 @@
|
||||
|
||||
/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
|
||||
if(occupant)
|
||||
to_chat(user, "<span class='danger'>The gibber is full, empty it first!</span>")
|
||||
to_chat(user, "<span class='danger'>The [src] is full, empty it first!</span>")
|
||||
return
|
||||
|
||||
if(operating)
|
||||
to_chat(user, "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>")
|
||||
to_chat(user, "<span class='danger'>The [src] is locked and running, wait for it to finish.</span>")
|
||||
return
|
||||
|
||||
if(!ishuman(victim) || issmall(victim))
|
||||
to_chat(user, "<span class='danger'>This is not suitable for the gibber!</span>")
|
||||
to_chat(user, "<span class='danger'>This is not suitable for the [src]]!</span>")
|
||||
return
|
||||
|
||||
if(victim.abiotic(1))
|
||||
to_chat(user, "<span class='danger'>Subject may not have abiotic items on.</span>")
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>[user] starts to put [victim] into the gibber!</span>")
|
||||
user.visible_message("<span class='danger'>[user] starts to put [victim] into the [src]!</span>")
|
||||
add_fingerprint(user)
|
||||
if(do_after(user, 30, target = victim) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message("<span class='danger'>[user] stuffs [victim] into the gibber!</span>")
|
||||
user.visible_message("<span class='danger'>[user] stuffs [victim] into the [src]]!</span>")
|
||||
|
||||
victim.forceMove(src)
|
||||
occupant = victim
|
||||
@@ -195,16 +200,16 @@
|
||||
holder2.layer = MOB_LAYER + 0.1 //3D, it's above the mob, rest of the gibber is behind
|
||||
holder2.anchored = 1
|
||||
|
||||
animate(holder, pixel_y = 16, time = GIBBER_ANIMATION_DELAY) //animate going down
|
||||
animate(holder, pixel_y = 16, time = animation_delay) //animate going down
|
||||
|
||||
sleep(GIBBER_ANIMATION_DELAY)
|
||||
sleep(animation_delay)
|
||||
|
||||
holder.overlays -= feedee //reset static icon
|
||||
feedee.icon += icon('icons/obj/kitchen.dmi', "footicon") //this is some byond magic; += to the icon var with a black and white image will mask it
|
||||
holder.overlays += feedee
|
||||
animate(holder, pixel_y = -3, time = GIBBER_ANIMATION_DELAY) //animate going down further
|
||||
animate(holder, pixel_y = -3, time = animation_delay) //animate going down further
|
||||
|
||||
sleep(GIBBER_ANIMATION_DELAY) //time everything right, animate doesn't prevent proc from continuing
|
||||
sleep(animation_delay) //time everything right, animate doesn't prevent proc from continuing
|
||||
|
||||
qdel(holder) //get rid of holder object
|
||||
qdel(holder2) //get rid of holder object
|
||||
@@ -281,15 +286,20 @@
|
||||
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
|
||||
operating = 0
|
||||
|
||||
for(var/obj/item/thing in contents) //Meat is spawned inside the gibber and thrown out afterwards.
|
||||
thing.loc = get_turf(thing) // Drop it onto the turf for throwing.
|
||||
thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15) // Being pelted with bits of meat and bone would hurt.
|
||||
sleep(1)
|
||||
if(stealthmode)
|
||||
for(var/atom/movable/AM in contents)
|
||||
qdel(AM)
|
||||
sleep(1)
|
||||
else
|
||||
for(var/obj/item/thing in contents) //Meat is spawned inside the gibber and thrown out afterwards.
|
||||
thing.loc = get_turf(thing) // Drop it onto the turf for throwing.
|
||||
thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15) // Being pelted with bits of meat and bone would hurt.
|
||||
sleep(1)
|
||||
|
||||
for(var/obj/effect/gibs in contents) //throw out the gibs too
|
||||
gibs.loc = get_turf(gibs) //drop onto turf for throwing
|
||||
gibs.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
|
||||
sleep(1)
|
||||
for(var/obj/effect/gibs in contents) //throw out the gibs too
|
||||
gibs.loc = get_turf(gibs) //drop onto turf for throwing
|
||||
gibs.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
|
||||
sleep(1)
|
||||
|
||||
pixel_x = initial(pixel_x) //return to it's spot after shaking
|
||||
operating = 0
|
||||
@@ -306,6 +316,8 @@
|
||||
var/acceptdir = NORTH
|
||||
var/lastacceptdir = NORTH
|
||||
var/turf/lturf
|
||||
var/consumption_delay = 3 SECONDS
|
||||
var/target_found = 0
|
||||
|
||||
/obj/machinery/gibber/autogibber/New()
|
||||
..()
|
||||
@@ -320,7 +332,7 @@
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/gibber/autogibber/process()
|
||||
if(!lturf || occupant || locked || dirty || operating)
|
||||
if(!lturf || occupant || locked || dirty || operating || occupant || target_found)
|
||||
return
|
||||
|
||||
if(acceptdir != lastacceptdir)
|
||||
@@ -331,15 +343,22 @@
|
||||
lturf = T
|
||||
|
||||
for(var/mob/living/carbon/human/H in lturf)
|
||||
if(istype(H) && H.loc == lturf)
|
||||
if(istype(H) && H.loc == lturf && !(locate(/obj/machinery/gibber/autogibber) in H.interaction_queue))
|
||||
target_found = 1
|
||||
H.interaction_queue += src
|
||||
visible_message({"<span class='danger'>\The [src] states, "Food detected!"</span>"})
|
||||
sleep(30)
|
||||
sleep(consumption_delay)
|
||||
if(H.loc == lturf) //still standing there
|
||||
if(force_move_into_gibber(H))
|
||||
locked = 1 // no escape
|
||||
ejectclothes(occupant)
|
||||
cleanbay()
|
||||
startgibbing(null, 1)
|
||||
locked = 0
|
||||
if(H)
|
||||
H.interaction_queue -= src
|
||||
break
|
||||
target_found = 0
|
||||
|
||||
/obj/machinery/gibber/autogibber/proc/force_move_into_gibber(var/mob/living/carbon/human/victim)
|
||||
if(!istype(victim)) return 0
|
||||
@@ -364,7 +383,7 @@
|
||||
continue
|
||||
if(istype(O,/obj/item/organ))
|
||||
continue
|
||||
if(O.flags & NODROP)
|
||||
if(O.flags & NODROP || stealthmode)
|
||||
qdel(O) //they are already dead by now
|
||||
H.unEquip(O)
|
||||
O.loc = loc
|
||||
@@ -372,7 +391,7 @@
|
||||
sleep(1)
|
||||
|
||||
for(var/obj/item/clothing/C in H)
|
||||
if(C.flags & NODROP)
|
||||
if(C.flags & NODROP || stealthmode)
|
||||
qdel(C)
|
||||
H.unEquip(C)
|
||||
C.loc = loc
|
||||
@@ -384,7 +403,9 @@
|
||||
/obj/machinery/gibber/autogibber/proc/cleanbay()
|
||||
var/spats = 0 //keeps track of how many items get spit out. Don't show a message if none are found.
|
||||
for(var/obj/O in src)
|
||||
if(istype(O))
|
||||
if(stealthmode)
|
||||
qdel(O)
|
||||
else if(istype(O))
|
||||
O.loc = loc
|
||||
O.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
|
||||
spats++
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
dir = newdir
|
||||
update_move_direction()
|
||||
|
||||
/obj/machinery/conveyor/set_dir(newdir)
|
||||
. = ..()
|
||||
update_move_direction()
|
||||
|
||||
|
||||
/obj/machinery/conveyor/proc/update_move_direction()
|
||||
switch(dir)
|
||||
|
||||
Reference in New Issue
Block a user