mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-28 11:03:19 +00:00
Merge pull request #7951 from VOREStation/Arokha/perf
Performance tweaks
This commit is contained in:
@@ -29,8 +29,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define OPENCONTAINER (1<<4) // Is an open container for chemistry purposes.
|
||||
#define PHORONGUARD (1<<5) // Does not get contaminated by phoron.
|
||||
#define NOREACT (1<<6) // Reagents don't react inside this container.
|
||||
#define PROXMOVE (1<<7)// Does this object require proximity checking in Enter()?
|
||||
#define OVERLAY_QUEUED (1<<8)// Atom queued to SSoverlay for COMPILE_OVERLAYS
|
||||
#define OVERLAY_QUEUED (1<<7)// Atom queued to SSoverlay for COMPILE_OVERLAYS
|
||||
|
||||
//Flags for items (equipment) - Used in /obj/item/var/item_flags
|
||||
#define THICKMATERIAL (1<<0) // Prevents syringes, parapens and hyposprays if equipped to slot_suit or slot_head.
|
||||
|
||||
@@ -231,35 +231,43 @@
|
||||
. = list()
|
||||
// Returns a list of mobs who can hear any of the radios given in @radios
|
||||
var/list/speaker_coverage = list()
|
||||
for(var/obj/item/device/radio/R in radios)
|
||||
if(R)
|
||||
//Cyborg checks. Receiving message uses a bit of cyborg's charge.
|
||||
var/obj/item/device/radio/borg/BR = R
|
||||
if(istype(BR) && BR.myborg)
|
||||
var/mob/living/silicon/robot/borg = BR.myborg
|
||||
var/datum/robot_component/CO = borg.get_component("radio")
|
||||
if(!CO)
|
||||
continue //No radio component (Shouldn't happen)
|
||||
if(!borg.is_component_functioning("radio") || !borg.cell_use_power(CO.active_usage))
|
||||
continue //No power.
|
||||
|
||||
var/turf/speaker = get_turf(R)
|
||||
if(speaker)
|
||||
for(var/turf/T in hear(R.canhear_range,speaker))
|
||||
speaker_coverage[T] = R
|
||||
for(var/r in radios)
|
||||
var/obj/item/device/radio/R = r // You better fucking be a radio.
|
||||
var/turf/speaker = get_turf(R)
|
||||
if(speaker)
|
||||
for(var/turf/T in hear(R.canhear_range,speaker))
|
||||
speaker_coverage[T] = R
|
||||
|
||||
|
||||
// Try to find all the players who can hear the message
|
||||
for(var/i = 1; i <= player_list.len; i++)
|
||||
var/mob/M = player_list[i]
|
||||
if(M)
|
||||
var/turf/ear = get_turf(M)
|
||||
if(ear)
|
||||
// Ghostship is magic: Ghosts can hear radio chatter from anywhere
|
||||
if(speaker_coverage[ear] || (istype(M, /mob/observer/dead) && M.is_preference_enabled(/datum/client_preference/ghost_radio)))
|
||||
. |= M // Since we're already looping through mobs, why bother using |= ? This only slows things down.
|
||||
if(M.can_hear_radio(speaker_coverage))
|
||||
. += M
|
||||
return .
|
||||
|
||||
/mob/proc/can_hear_radio(var/list/hearturfs)
|
||||
return FALSE
|
||||
|
||||
/mob/living/can_hear_radio(var/list/hearturfs)
|
||||
return get_turf(src) in hearturfs
|
||||
|
||||
/mob/living/silicon/robot/can_hear_radio(var/list/hearturfs)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/item/device/radio/borg/R = hearturfs[T] // this should be an assoc list of turf-to-radio
|
||||
|
||||
// We heard it on our own radio? We use power for that.
|
||||
if(istype(R) && R.myborg == src)
|
||||
var/datum/robot_component/CO = get_component("radio")
|
||||
if(!CO || !is_component_functioning("radio") || !cell_use_power(CO.active_usage))
|
||||
return FALSE // Sorry, couldn't hear
|
||||
|
||||
return R // radio, true, false, what's the difference
|
||||
|
||||
/mob/observer/dead/can_hear_radio(var/list/hearturfs)
|
||||
return is_preference_enabled(/datum/client_preference/ghost_radio)
|
||||
|
||||
|
||||
//Uses dview to quickly return mobs and objects in view,
|
||||
// then adds additional mobs or objects if they are in range 'smartly',
|
||||
// based on their presence in lists of players or registered objects
|
||||
|
||||
@@ -43,17 +43,3 @@
|
||||
if (I.GetPixel(x_pixel, y_pixel))
|
||||
return y_pixel - 1
|
||||
return null
|
||||
|
||||
//Standard behaviour is to cut pixels from the main icon that are covered by pixels from the mask icon unless passed mask_ready, see below.
|
||||
/proc/get_icon_difference(var/icon/main, var/icon/mask, var/mask_ready)
|
||||
/*You should skip prep if the mask is already sprited properly. This significantly improves performance by eliminating most of the realtime icon work.
|
||||
e.g. A 'ready' mask is a mask where the part you want cut out is missing (no pixels, 0 alpha) from the sprite, and everything else is solid white.*/
|
||||
|
||||
if(istype(main) && istype(mask))
|
||||
if(!mask_ready) //Prep the mask if we're using a regular old sprite and not a special-made mask.
|
||||
mask.Blend(rgb(255,255,255), ICON_SUBTRACT) //Make all pixels on the mask as black as possible.
|
||||
mask.Opaque(rgb(255,255,255)) //Make the transparent pixels (background) white.
|
||||
mask.BecomeAlphaMask() //Make all the black pixels vanish (fully transparent), leaving only the white background pixels.
|
||||
|
||||
main.AddAlphaMask(mask) //Make the pixels in the main icon that are in the transparent zone of the mask icon also vanish (fully transparent).
|
||||
return main
|
||||
|
||||
33
code/datums/observation/turf_enterexit.dm
Normal file
33
code/datums/observation/turf_enterexit.dm
Normal file
@@ -0,0 +1,33 @@
|
||||
// Observer Pattern Implementation: Turf Entered/Exited
|
||||
// Registration type: /turf
|
||||
//
|
||||
// Raised when: A /turf has a new item in contents, or an item has left it's contents
|
||||
//
|
||||
// Arguments that the called proc should expect:
|
||||
// /turf: The turf that was entered/exited
|
||||
// /atom/movable/moving_instance: The instance that entered/exited
|
||||
// /atom/old_loc / /atom/new_loc: The previous/new loc of the mover
|
||||
|
||||
|
||||
GLOBAL_DATUM_INIT(turf_entered_event, /decl/observ/turf_entered, new)
|
||||
GLOBAL_DATUM_INIT(turf_exited_event, /decl/observ/turf_exited, new)
|
||||
|
||||
/decl/observ/turf_entered
|
||||
name = "Turf Entered"
|
||||
expected_type = /turf
|
||||
|
||||
/decl/observ/turf_exited
|
||||
name = "Turf Exited"
|
||||
expected_type = /turf
|
||||
|
||||
/********************
|
||||
* Movement Handling *
|
||||
********************/
|
||||
|
||||
/turf/Entered(var/atom/movable/am, var/atom/old_loc)
|
||||
. = ..()
|
||||
GLOB.turf_entered_event.raise_event(src, am, old_loc)
|
||||
|
||||
/turf/Exited(var/atom/movable/am, var/atom/new_loc)
|
||||
. = ..()
|
||||
GLOB.turf_exited_event.raise_event(src, am, new_loc)
|
||||
@@ -29,7 +29,6 @@
|
||||
density = 0
|
||||
unacidable = 1//Just to be sure.
|
||||
var/def_zone
|
||||
flags = PROXMOVE
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
|
||||
|
||||
@@ -118,15 +118,33 @@
|
||||
/atom/proc/CheckExit()
|
||||
return 1
|
||||
|
||||
// If you want to use this, the atom must have the PROXMOVE flag, and the moving
|
||||
// atom must also have the PROXMOVE flag currently to help with lag. ~ ComicIronic
|
||||
/atom/proc/HasProximity(atom/movable/AM as mob|obj)
|
||||
// Used to be for the PROXMOVE flag, but that was terrible, so instead it's just here as a stub for
|
||||
// all the atoms that still have the proc, but get events other ways.
|
||||
/atom/proc/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
return
|
||||
|
||||
//Register listeners on turfs in a certain range
|
||||
/atom/proc/sense_proximity(var/range = 1, var/callback)
|
||||
ASSERT(callback)
|
||||
ASSERT(isturf(loc))
|
||||
var/list/turfs = trange(range, src)
|
||||
for(var/t in turfs)
|
||||
var/turf/T = t
|
||||
GLOB.turf_entered_event.register(T, src, callback)
|
||||
|
||||
//Unregister from prox listening in a certain range. You should do this BEFORE you move, but if you
|
||||
// really can't, then you can set the center where you moved from.
|
||||
/atom/proc/unsense_proximity(var/range = 1, var/callback, var/center)
|
||||
ASSERT(isturf(center) || isturf(loc))
|
||||
var/list/turfs = trange(range, center ? center : src)
|
||||
for(var/t in turfs)
|
||||
var/turf/T = t
|
||||
GLOB.turf_entered_event.unregister(T, src, callback)
|
||||
|
||||
|
||||
/atom/proc/emp_act(var/severity)
|
||||
return
|
||||
|
||||
|
||||
/atom/proc/bullet_act(obj/item/projectile/P, def_zone)
|
||||
P.on_hit(src, 0, def_zone)
|
||||
. = 0
|
||||
|
||||
@@ -87,6 +87,8 @@
|
||||
// VOREStation Edit End
|
||||
|
||||
/obj/machinery/camera/Destroy()
|
||||
if(isMotion())
|
||||
unsense_proximity(callback = .HasProximity)
|
||||
deactivate(null, 0) //kick anyone viewing out
|
||||
if(assembly)
|
||||
qdel(assembly)
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
var/detectTime = 0
|
||||
var/area/ai_monitored/area_motion = null
|
||||
var/alarm_delay = 100 // Don't forget, there's another 10 seconds in queueAlarm()
|
||||
flags = PROXMOVE
|
||||
|
||||
/obj/machinery/camera/internal_process()
|
||||
// motion camera event loop
|
||||
if (stat & (EMPED|NOPOWER))
|
||||
return
|
||||
if(!isMotion())
|
||||
. = PROCESS_KILL
|
||||
return
|
||||
return PROCESS_KILL
|
||||
if (detectTime > 0)
|
||||
var/elapsed = world.time - detectTime
|
||||
if (elapsed > alarm_delay)
|
||||
@@ -56,7 +54,7 @@
|
||||
detectTime = -1
|
||||
return 1
|
||||
|
||||
/obj/machinery/camera/HasProximity(atom/movable/AM as mob|obj)
|
||||
/obj/machinery/camera/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
// Motion cameras outside of an "ai monitored" area will use this to detect stuff.
|
||||
if (!area_motion)
|
||||
if(isliving(AM))
|
||||
|
||||
@@ -212,9 +212,12 @@ var/global/list/engineering_networks = list(
|
||||
update_coverage()
|
||||
|
||||
/obj/machinery/camera/proc/upgradeMotion()
|
||||
if(!isturf(loc))
|
||||
return //nooooo
|
||||
assembly.upgrades.Add(new /obj/item/device/assembly/prox_sensor(assembly))
|
||||
setPowerUsage()
|
||||
START_MACHINE_PROCESSING(src)
|
||||
sense_proximity(callback = .HasProximity)
|
||||
update_coverage()
|
||||
|
||||
/obj/machinery/camera/proc/setPowerUsage()
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
anchored = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 2
|
||||
flags = PROXMOVE
|
||||
|
||||
/obj/machinery/flasher/portable //Portable version of the flasher. Only flashes when anchored
|
||||
name = "portable flasher"
|
||||
@@ -92,13 +91,13 @@
|
||||
flash()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj)
|
||||
if((disable) || (last_flash && world.time < last_flash + 150))
|
||||
/obj/machinery/flasher/portable/HasProximity(turf/T, atom/movable/AM, oldloc)
|
||||
if(disable || !anchored || (last_flash && world.time < last_flash + 150))
|
||||
return
|
||||
|
||||
if(istype(AM, /mob/living/carbon))
|
||||
if(iscarbon(AM))
|
||||
var/mob/living/carbon/M = AM
|
||||
if((M.m_intent != "walk") && (anchored))
|
||||
if(M.m_intent != "walk")
|
||||
flash()
|
||||
|
||||
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
@@ -108,11 +107,13 @@
|
||||
|
||||
if(!anchored)
|
||||
user.show_message(text("<span class='warning'>[src] can now be moved.</span>"))
|
||||
overlays.Cut()
|
||||
|
||||
cut_overlays()
|
||||
unsense_proximity(callback = .HasProximity)
|
||||
|
||||
else if(anchored)
|
||||
user.show_message(text("<span class='warning'>[src] is now secured.</span>"))
|
||||
overlays += "[base_state]-s"
|
||||
add_overlay("[base_state]-s")
|
||||
sense_proximity(callback = .HasProximity)
|
||||
|
||||
/obj/machinery/button/flasher
|
||||
name = "flasher button"
|
||||
|
||||
@@ -441,7 +441,6 @@
|
||||
|
||||
var/health = 100
|
||||
var/status = BURST //can be GROWING, GROWN or BURST; all mutually exclusive
|
||||
flags = PROXMOVE
|
||||
|
||||
/obj/effect/alien/egg/New()
|
||||
/*
|
||||
@@ -545,16 +544,4 @@
|
||||
/obj/effect/alien/egg/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 500 + T0C)
|
||||
health -= 5
|
||||
healthcheck()
|
||||
/*
|
||||
/obj/effect/alien/egg/HasProximity(atom/movable/AM as mob|obj)
|
||||
if(status == GROWN)
|
||||
if(!CanHug(AM))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C = AM
|
||||
if(C.stat == CONSCIOUS && C.status_flags & XENO_HOST)
|
||||
return
|
||||
|
||||
Burst(0)
|
||||
*/
|
||||
healthcheck()
|
||||
@@ -643,11 +643,6 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
//Looking through a scope or binoculars should /not/ improve your periphereal vision. Still, increase viewsize a tiny bit so that sniping isn't as restricted to NSEW
|
||||
/obj/item/var/ignore_visor_zoom_restriction = FALSE
|
||||
|
||||
/obj/item/on_loc_moved(var/oldloc)
|
||||
. = ..()
|
||||
if(zoom)
|
||||
zoom() // aka unzoom
|
||||
|
||||
/obj/item/proc/zoom(var/tileoffset = 14,var/viewsize = 9) //tileoffset is client view offset in the direction the user is facing. viewsize is how far out this thing zooms. 7 is normal view
|
||||
|
||||
var/devicename
|
||||
@@ -677,6 +672,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
H.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in
|
||||
H.set_viewsize(viewsize)
|
||||
zoom = 1
|
||||
GLOB.moved_event.register(H, src, .proc/zoom)
|
||||
|
||||
var/tilesize = 32
|
||||
var/viewoffset = tilesize * tileoffset
|
||||
@@ -705,6 +701,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
if(!H.hud_used.hud_shown)
|
||||
H.toggle_zoom_hud()
|
||||
zoom = 0
|
||||
GLOB.moved_event.unregister(H, src, .proc/zoom)
|
||||
|
||||
H.client.pixel_x = 0
|
||||
H.client.pixel_y = 0
|
||||
@@ -773,13 +770,13 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
if(!inhands)
|
||||
apply_custom(standing_icon) //Pre-image overridable proc to customize the thing
|
||||
apply_addblends(icon2use,standing_icon) //Some items have ICON_ADD blend shaders
|
||||
if(istype(clip_mask)) //VOREStation Edit - For taur bodies/tails clipping off parts of uniforms and suits.
|
||||
standing_icon = get_icon_difference(standing_icon, clip_mask, 1)
|
||||
|
||||
var/image/standing = image(standing_icon)
|
||||
standing.alpha = alpha
|
||||
standing.color = color
|
||||
standing.layer = layer2use
|
||||
if(istype(clip_mask)) //VOREStation Edit - For taur bodies/tails clipping off parts of uniforms and suits.
|
||||
standing.filters += filter(type = "alpha", icon = clip_mask)
|
||||
|
||||
//Apply any special features
|
||||
if(!inhands)
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
var/mob/attacher = null
|
||||
var/valve_open = 0
|
||||
var/toggle = 1
|
||||
flags = PROXMOVE
|
||||
|
||||
/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user)
|
||||
var/turf/location = get_turf(src) // For admin logs
|
||||
@@ -57,11 +56,15 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/transfer_valve/HasProximity(atom/movable/AM as mob|obj)
|
||||
if(!attached_device) return
|
||||
attached_device.HasProximity(AM)
|
||||
return
|
||||
/obj/item/device/transfer_valve/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
attached_device?.HasProximity(T, AM, old_loc)
|
||||
|
||||
/obj/item/device/transfer_valve/Moved(old_loc, direction, forced)
|
||||
. = ..()
|
||||
if(isturf(old_loc))
|
||||
unsense_proximity(callback = .HasProximity, center = old_loc)
|
||||
if(isturf(loc))
|
||||
sense_proximity(callback = .HasProximity)
|
||||
|
||||
/obj/item/device/transfer_valve/attack_self(mob/user as mob)
|
||||
ui_interact(user)
|
||||
|
||||
@@ -678,6 +678,11 @@ var/list/global/tank_gauge_cache = list()
|
||||
tank.update_icon()
|
||||
tank.overlays -= "bomb_assembly"
|
||||
|
||||
/obj/item/device/tankassemblyproxy/HasProximity(atom/movable/AM as mob|obj)
|
||||
if(src.assembly)
|
||||
src.assembly.HasProximity(AM)
|
||||
/obj/item/device/tankassemblyproxy/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
assembly?.HasProximity(T, AM, old_loc)
|
||||
|
||||
/obj/item/device/tankassemblyproxy/Moved(old_loc, direction, forced)
|
||||
if(isturf(old_loc))
|
||||
unsense_proximity(callback = .HasProximity, center = old_loc)
|
||||
if(isturf(loc))
|
||||
sense_proximity(callback = .HasProximity)
|
||||
|
||||
@@ -142,18 +142,8 @@ turf/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
sleep(2)
|
||||
O.update_transform()
|
||||
|
||||
var/const/enterloopsanity = 100
|
||||
/turf/Entered(atom/atom as mob|obj)
|
||||
|
||||
if(movement_disabled)
|
||||
to_chat(usr, "<span class='warning'>Movement is admin-disabled.</span>") //This is to identify lag problems
|
||||
return
|
||||
..()
|
||||
|
||||
if(!istype(atom, /atom/movable))
|
||||
return
|
||||
|
||||
var/atom/movable/A = atom
|
||||
/turf/Entered(var/atom/movable/A, var/old_loc)
|
||||
. = ..()
|
||||
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
@@ -166,16 +156,6 @@ var/const/enterloopsanity = 100
|
||||
M.inertia_dir = 0
|
||||
M.make_floating(0)
|
||||
|
||||
var/objects = 0
|
||||
if(A && (A.flags & PROXMOVE))
|
||||
for(var/atom/movable/thing in range(1))
|
||||
if(objects++ > enterloopsanity) break
|
||||
spawn(0)
|
||||
if(A) //Runtime prevention
|
||||
A.HasProximity(thing, 1)
|
||||
if ((thing && A) && (thing.flags & PROXMOVE))
|
||||
thing.HasProximity(A, 1)
|
||||
|
||||
/turf/CanPass(atom/movable/mover, turf/target)
|
||||
if(!target)
|
||||
return FALSE
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
icon = 'icons/obj/assemblies/new_assemblies.dmi'
|
||||
icon_state = "holder"
|
||||
item_state = "assembly"
|
||||
flags = PROXMOVE
|
||||
throwforce = 5
|
||||
w_class = ITEMSIZE_SMALL
|
||||
throw_speed = 3
|
||||
@@ -64,11 +63,18 @@
|
||||
else
|
||||
. += "\The [src] can be attached!"
|
||||
|
||||
/obj/item/device/assembly_holder/HasProximity(atom/movable/AM as mob|obj)
|
||||
/obj/item/device/assembly_holder/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
if(isturf(old_loc))
|
||||
unsense_proximity(callback = .HasProximity, center = old_loc)
|
||||
if(isturf(loc))
|
||||
sense_proximity(callback = .HasProximity)
|
||||
|
||||
/obj/item/device/assembly_holder/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
if(a_left)
|
||||
a_left.HasProximity(AM)
|
||||
a_left.HasProximity(T, AM, old_loc)
|
||||
if(a_right)
|
||||
a_right.HasProximity(AM)
|
||||
a_right.HasProximity(T, AM, old_loc)
|
||||
|
||||
/obj/item/device/assembly_holder/Crossed(atom/movable/AM as mob|obj)
|
||||
if(AM.is_incorporeal())
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
icon_state = "prox"
|
||||
origin_tech = list(TECH_MAGNET = 1)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 800, "glass" = 200, "waste" = 50)
|
||||
flags = PROXMOVE
|
||||
wires = WIRE_PULSE
|
||||
|
||||
secured = 0
|
||||
@@ -33,7 +32,7 @@
|
||||
update_icon()
|
||||
return secured
|
||||
|
||||
/obj/item/device/assembly/prox_sensor/HasProximity(atom/movable/AM as mob|obj)
|
||||
/obj/item/device/assembly/prox_sensor/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
if(!istype(AM))
|
||||
log_debug("DEBUG: HasProximity called with [AM] on [src] ([usr]).")
|
||||
return
|
||||
@@ -90,6 +89,10 @@
|
||||
|
||||
/obj/item/device/assembly/prox_sensor/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
if(isturf(old_loc))
|
||||
unsense_proximity(range = range, callback = .HasProximity, center = old_loc)
|
||||
if(isturf(loc))
|
||||
sense_proximity(range = range, callback = .HasProximity)
|
||||
sense()
|
||||
|
||||
/obj/item/device/assembly/prox_sensor/interact(mob/user as mob)//TODO: Change this to the wires thingy
|
||||
|
||||
@@ -72,8 +72,9 @@
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/plant
|
||||
|
||||
/obj/effect/plant/Destroy()
|
||||
if(plant_controller)
|
||||
plant_controller.remove_plant(src)
|
||||
if(seed.get_trait(TRAIT_SPREAD)==2)
|
||||
unsense_proximity(callback = .HasProximity, center = get_turf(src))
|
||||
plant_controller.remove_plant(src)
|
||||
for(var/obj/effect/plant/neighbor in range(1,src))
|
||||
plant_controller.add_plant(neighbor)
|
||||
return ..()
|
||||
@@ -106,6 +107,7 @@
|
||||
name = seed.display_name
|
||||
max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2)
|
||||
if(seed.get_trait(TRAIT_SPREAD)==2)
|
||||
sense_proximity(callback = .HasProximity) // Grabby
|
||||
max_growth = VINE_GROWTH_STAGES
|
||||
growth_threshold = max_health/VINE_GROWTH_STAGES
|
||||
icon = 'icons/obj/hydroponics_vines.dmi'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/effect/plant/HasProximity(var/atom/movable/AM)
|
||||
/obj/effect/plant/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
|
||||
if(!is_mature() || seed.get_trait(TRAIT_SPREAD) != 2)
|
||||
return
|
||||
@@ -13,6 +13,14 @@
|
||||
spawn(1)
|
||||
entangle(M)
|
||||
|
||||
/obj/effect/plant/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
if(seed.get_trait(TRAIT_SPREAD)==2)
|
||||
if(isturf(old_loc))
|
||||
unsense_proximity(callback = .HasProximity, center = old_loc)
|
||||
if(isturf(loc))
|
||||
sense_proximity(callback = .HasProximity)
|
||||
|
||||
/obj/effect/plant/attack_hand(var/mob/user)
|
||||
manual_unbuckle(user)
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
icon_state = "facehugger"
|
||||
item_state = "facehugger"
|
||||
w_class = 3 //note: can be picked up by aliens unlike most other items of w_class below 4
|
||||
flags = PROXMOVE
|
||||
body_parts_covered = FACE|EYES
|
||||
throw_range = 5
|
||||
|
||||
|
||||
@@ -591,11 +591,11 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
|
||||
//Build a uniform sprite
|
||||
//VOREStation Edit start.
|
||||
var/icon/c_mask = null
|
||||
if(tail_style && tail_style.clip_mask_icon && tail_style.clip_mask_state)
|
||||
var/icon/c_mask = tail_style?.clip_mask
|
||||
if(c_mask)
|
||||
var/obj/item/clothing/suit/S = wear_suit
|
||||
if(!(wear_suit && ((wear_suit.flags_inv & HIDETAIL) || (istype(S) && S.taurized)))) //Clip the lower half of the uniform off using the tail's clip mask.
|
||||
c_mask = new /icon(tail_style.clip_mask_icon, tail_style.clip_mask_state)
|
||||
if(!istype(S) || (wear_suit.flags_inv & HIDETAIL) || S.taurized) // Reasons to not mask
|
||||
c_mask = null
|
||||
overlays_standing[UNIFORM_LAYER] = w_uniform.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_w_uniform_str, default_icon = uniform_sprite, default_layer = UNIFORM_LAYER, clip_mask = c_mask)
|
||||
//VOREStation Edit end.
|
||||
apply_layer(UNIFORM_LAYER)
|
||||
@@ -779,10 +779,10 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
|
||||
//VOREStation Edit start.
|
||||
var/icon/c_mask = null
|
||||
var/tail_is_rendered = (overlays_standing[TAIL_LAYER] || overlays_standing[TAIL_LAYER_ALT])
|
||||
var/valid_clip_mask = (tail_style && tail_style.clip_mask_icon && tail_style.clip_mask_state)
|
||||
var/valid_clip_mask = tail_style?.clip_mask
|
||||
|
||||
if(tail_is_rendered && valid_clip_mask && !(suit && istype(suit) && suit.taurized)) //Clip the lower half of the suit off using the tail's clip mask for taurs since taur bodies aren't hidden.
|
||||
c_mask = new /icon(tail_style.clip_mask_icon, tail_style.clip_mask_state)
|
||||
c_mask = valid_clip_mask
|
||||
overlays_standing[SUIT_LAYER] = wear_suit.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_wear_suit_str, default_icon = suit_sprite, default_layer = SUIT_LAYER, clip_mask = c_mask)
|
||||
|
||||
//VOREStation Edit end.
|
||||
|
||||
@@ -1,50 +1,3 @@
|
||||
// WARNING - UNUSED PROC
|
||||
/mob/living/carbon/human/proc/get_wing_icon()
|
||||
if(QDESTROYING(src))
|
||||
return
|
||||
|
||||
var/icon_key = "[species.get_race_key(src)][r_skin][g_skin][b_skin][r_hair][g_hair][b_hair]"
|
||||
var/icon/wing_icon = wing_icon_cache[icon_key]
|
||||
if(!wing_icon)
|
||||
//generate a new one
|
||||
var/species_wing_anim = species.get_wing_animation(src)
|
||||
if(species.icobase_wing) species_wing_anim = species.icobase
|
||||
if(!species_wing_anim) species_wing_anim = 'icons/effects/species.dmi'
|
||||
wing_icon = new/icon(species_wing_anim)
|
||||
if(species.color_mult)
|
||||
wing_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_MULTIPLY)
|
||||
else
|
||||
wing_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
|
||||
// The following will not work with animated wings.
|
||||
var/use_species_wing = species.get_wing_hair(src)
|
||||
if(use_species_wing)
|
||||
var/icon/hair_icon = icon('icons/effects/species.dmi', "[species.get_wing(src)]_[use_species_wing]")
|
||||
hair_icon.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
|
||||
wing_icon.Blend(hair_icon, ICON_OVERLAY)
|
||||
wing_icon_cache[icon_key] = wing_icon
|
||||
|
||||
return wing_icon
|
||||
|
||||
// WARNING - UNUSED PROC
|
||||
/mob/living/carbon/human/proc/set_wing_state(var/t_state)
|
||||
if(QDESTROYING(src))
|
||||
return
|
||||
|
||||
var/image/wing_overlay = overlays_standing[WING_LAYER]
|
||||
|
||||
if(wing_overlay && species.get_wing_animation(src))
|
||||
wing_overlay.icon_state = t_state
|
||||
return wing_overlay
|
||||
return null
|
||||
|
||||
// WARNING - UNUSED PROC
|
||||
/mob/living/carbon/human/proc/animate_wing_reset(var/update_icons=1)
|
||||
if(stat != DEAD)
|
||||
set_wing_state("[species.get_wing(src)]_idle[rand(0,9)]")
|
||||
else
|
||||
set_wing_state("[species.get_wing(src)]_static")
|
||||
toggle_wing_vr(FALSE)
|
||||
|
||||
/mob/living/carbon/human/proc/get_wing_image()
|
||||
if(QDESTROYING(src))
|
||||
return
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
layer = MOB_LAYER
|
||||
plane = MOB_PLANE
|
||||
animate_movement = 2
|
||||
flags = PROXMOVE
|
||||
var/datum/mind/mind
|
||||
|
||||
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
|
||||
|
||||
@@ -10,12 +10,15 @@
|
||||
unacidable = 1
|
||||
use_power = USE_POWER_OFF
|
||||
light_range = 4
|
||||
flags = PROXMOVE
|
||||
var/obj/machinery/field_generator/FG1 = null
|
||||
var/obj/machinery/field_generator/FG2 = null
|
||||
var/hasShocked = 0 //Used to add a delay between shocks. In some cases this used to crash servers by spawning hundreds of sparks every second.
|
||||
|
||||
/obj/machinery/containment_field/Initialize()
|
||||
sense_proximity(callback = .HasProximity)
|
||||
|
||||
/obj/machinery/containment_field/Destroy()
|
||||
unsense_proximity(callback = .HasProximity)
|
||||
if(FG1 && !FG1.clean_up)
|
||||
FG1.cleanup()
|
||||
if(FG2 && !FG2.clean_up)
|
||||
@@ -33,7 +36,7 @@
|
||||
/obj/machinery/containment_field/ex_act(severity)
|
||||
return 0
|
||||
|
||||
/obj/machinery/containment_field/HasProximity(atom/movable/AM as mob|obj)
|
||||
/obj/machinery/containment_field/HasProximity(turf/T, atom/movable/AM, old_loc)
|
||||
if(istype(AM,/mob/living/silicon) && prob(40))
|
||||
shock(AM)
|
||||
return 1
|
||||
@@ -42,8 +45,6 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/machinery/containment_field/shock(mob/living/user as mob)
|
||||
if(hasShocked)
|
||||
return 0
|
||||
|
||||
@@ -791,6 +791,12 @@
|
||||
var/list/hide_body_parts = list() //Uses organ tag defines. Bodyparts in this list do not have their icons rendered, allowing for more spriter freedom when doing taur/digitigrade stuff.
|
||||
var/icon/clip_mask_icon = null //Icon file used for clip mask.
|
||||
var/clip_mask_state = null //Icon state to generate clip mask. Clip mask is used to 'clip' off the lower part of clothing such as jumpsuits & full suits.
|
||||
var/icon/clip_mask = null //Instantiated clip mask of given icon and state
|
||||
|
||||
/datum/sprite_accessory/tail/New()
|
||||
. = ..()
|
||||
if(clip_mask_icon && clip_mask_state)
|
||||
clip_mask = icon(icon = clip_mask_icon, icon_state = clip_mask_state)
|
||||
|
||||
// Species-unique tails
|
||||
|
||||
|
||||
@@ -355,6 +355,7 @@
|
||||
#include "code\datums\observation\shuttle_moved.dm"
|
||||
#include "code\datums\observation\stat_set.dm"
|
||||
#include "code\datums\observation\turf_changed.dm"
|
||||
#include "code\datums\observation\turf_enterexit.dm"
|
||||
#include "code\datums\observation\unequipped.dm"
|
||||
#include "code\datums\observation\z_moved.dm"
|
||||
#include "code\datums\observation\~cleanup.dm"
|
||||
|
||||
Reference in New Issue
Block a user