diff --git a/code/__defines/flags.dm b/code/__defines/flags.dm index e59dac70c5c..2ff8f44dbab 100644 --- a/code/__defines/flags.dm +++ b/code/__defines/flags.dm @@ -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. diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index 0e132a235fb..6ec3ccb9662 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -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 diff --git a/code/_helpers/icons_vr.dm b/code/_helpers/icons_vr.dm index 60765578e71..1b500862b6e 100644 --- a/code/_helpers/icons_vr.dm +++ b/code/_helpers/icons_vr.dm @@ -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 diff --git a/code/datums/observation/turf_enterexit.dm b/code/datums/observation/turf_enterexit.dm new file mode 100644 index 00000000000..30cec0c39d2 --- /dev/null +++ b/code/datums/observation/turf_enterexit.dm @@ -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) \ No newline at end of file diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 7308083ae6f..de7800acfb5 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -29,7 +29,6 @@ density = 0 unacidable = 1//Just to be sure. var/def_zone - flags = PROXMOVE pass_flags = PASSTABLE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 123daae6541..b1d994d3a36 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -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 diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 3dbe68fd29c..ba5e1038f0b 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -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) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index eac1f89386f..ad183a7be83 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -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)) diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index d028eedecb1..ab5d82b3a5f 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -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() diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 572977ceb43..169fc6386cd 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -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("[src] can now be moved.")) - overlays.Cut() - + cut_overlays() + unsense_proximity(callback = .HasProximity) + else if(anchored) user.show_message(text("[src] is now secured.")) - overlays += "[base_state]-s" + add_overlay("[base_state]-s") + sense_proximity(callback = .HasProximity) /obj/machinery/button/flasher name = "flasher button" diff --git a/code/game/objects/effects/alien/aliens.dm b/code/game/objects/effects/alien/aliens.dm index 203b768d756..d11b0547306 100644 --- a/code/game/objects/effects/alien/aliens.dm +++ b/code/game/objects/effects/alien/aliens.dm @@ -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) -*/ \ No newline at end of file + healthcheck() \ No newline at end of file diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a6013b53e09..6fd5f0b386c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -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) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 4169dfc947c..406919f96aa 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -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) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index a349f3b1fb1..0cdf8887a50 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -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) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 8cd5c237cd5..1357c71106e 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -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, "Movement is admin-disabled.") //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 diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 2f6d7ab02ff..824eb85b0a6 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -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()) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index c439163fc22..f7d8e3e59ed 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -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 diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index e3ac11ed76b..2f93bb108bd 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -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' diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index 8c694c8b007..58f4b4da08c 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -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) diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm index ff2f6301919..4bfffdfa474 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_facehugger.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 7b735b0dbef..fd39b2a745e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -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. diff --git a/code/modules/mob/living/carbon/human/update_icons_vr.dm b/code/modules/mob/living/carbon/human/update_icons_vr.dm index a8b941ebc32..45a5690ae64 100644 --- a/code/modules/mob/living/carbon/human/update_icons_vr.dm +++ b/code/modules/mob/living/carbon/human/update_icons_vr.dm @@ -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 diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 375dd0a7559..0b516955ef7 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -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 diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 6478ff999a2..996847b13b7 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -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 diff --git a/code/modules/vore/appearance/sprite_accessories_vr.dm b/code/modules/vore/appearance/sprite_accessories_vr.dm index 67222aab21f..9cc59ec2e22 100644 --- a/code/modules/vore/appearance/sprite_accessories_vr.dm +++ b/code/modules/vore/appearance/sprite_accessories_vr.dm @@ -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 diff --git a/vorestation.dme b/vorestation.dme index 3dcff270138..0d4628499fd 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -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"