From 35bf63ec8163c2e58592d26ebdf0f60813d51313 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:31:19 -0700 Subject: [PATCH] [MIRROR] Ports RS 658, 661 and some minor things (#9557) Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/game/area/areas.dm | 19 ++++++ code/modules/mob/dead/observer/observer.dm | 29 +++++++++ code/modules/mob/language/language.dm | 2 +- .../species/shadekin/shadekin_abilities.dm | 58 ++++++++++++++---- .../subtypes/vore/shadekin/ability_procs.dm | 60 ++++++++++++++----- code/modules/mob/mob_movement.dm | 19 +++++- code/modules/multiz/movement.dm | 9 ++- .../species/shadekin/shadekin_abilities.dm | 6 ++ 8 files changed, 169 insertions(+), 33 deletions(-) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 8c8d66da91..fa36417dfa 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -56,6 +56,8 @@ GLOBAL_LIST_EMPTY(areas_by_type) var/forbid_singulo = FALSE // If true singulo will not move in. var/no_spoilers = FALSE // If true, makes it much more difficult to see what is inside an area with things like mesons. var/soundproofed = FALSE // If true, blocks sounds from other areas and prevents hearers on other areas from hearing the sounds within. + var/block_phase_shift = FALSE //Stops phase shifted mobs from entering // RS Port #658 + var/block_ghosts = FALSE //Stops ghosts from entering //RS Port #658 /area/New() // Used by the maploader, this must be done in New, not init @@ -398,6 +400,7 @@ var/list/mob/living/forced_ambiance_list = new play_ambience(L, initial = TRUE) if(no_spoilers) L.disable_spoiler_vision() + check_phase_shift(M) //RS Port #658 /area/proc/play_ambience(var/mob/living/L, initial = TRUE) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch @@ -554,3 +557,19 @@ GLOBAL_DATUM(spoiler_obfuscation_image, /image) add_overlay(GLOB.spoiler_obfuscation_image) else cut_overlay(GLOB.spoiler_obfuscation_image) + +// RS Port #658 Start +/area/proc/check_phase_shift(var/mob/ourmob) + if(!block_phase_shift || !ourmob.incorporeal_move) + return + if(!isliving(ourmob)) + return + if(isanimal(ourmob)) + var/mob/living/simple_mob/shadekin/SK = ourmob + if(SK.ability_flags & AB_PHASE_SHIFTED) + SK.phase_in(SK.loc) + if(ishuman(ourmob)) + var/mob/living/carbon/human/SK = ourmob + if(SK.ability_flags & AB_PHASE_SHIFTED) + SK.phase_in(SK.loc) +// RS Port #658 End diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index bb3b0d0661..a7392c2e94 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -187,6 +187,27 @@ Works together with spawning an observer, noted above. handle_regular_hud_updates() handle_vision() + check_area() //RS Port #658 + +//RS Port #658 Start +/mob/observer/dead/proc/check_area() + if(client?.holder) + return + if(!isturf(loc)) + return + var/area/A = get_area(src) + if(A.block_ghosts) + to_chat(src, span_warning("Ghosts can't enter this location.")) + return_to_spawn() + +/mob/observer/dead/proc/return_to_spawn() + if(following) + stop_following() + var/obj/O = locate("landmark*Observer-Start") + if(istype(O)) + to_chat(src, span_notice("Now teleporting.")) + forceMove(O.loc) +//RS Port #658 End /mob/proc/ghostize(var/can_reenter_corpse = 1) if(key) @@ -431,6 +452,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp stop_following() return + //RS Port #658 Start + var/area/A = get_area(destination) + if(A.block_ghosts) + to_chat(src,span_warning("Sorry, that area does not allow ghosts.")) + if(following) + stop_following() + return + //RS Port #658 End return ..() /mob/observer/dead/Move(atom/newloc, direct = 0, movetime) diff --git a/code/modules/mob/language/language.dm b/code/modules/mob/language/language.dm index 124c06873e..defa8c3853 100644 --- a/code/modules/mob/language/language.dm +++ b/code/modules/mob/language/language.dm @@ -304,7 +304,7 @@ else var/datum/language/L = locate(href_list["default_lang"]) if(L && (L in languages)) - apply_default_language(L) //CHOMPEdit + apply_default_language(L) check_languages() return 1 else if(href_list["set_lang_key"]) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm index 3b422bf58c..6e1ed92b77 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm @@ -47,6 +47,13 @@ set desc = "Shift yourself out of alignment with realspace to travel quickly to different areas." set category = "Abilities.Shadekin" + //RS Port #658 Start + var/area/A = get_area(src) + if(!client?.holder && A.block_phase_shift) + to_chat(src, span_warning("You can't do that here!")) + return + //RS Port #658 End + var/ability_cost = 100 var/darkness = 1 @@ -132,20 +139,31 @@ to_chat(src,span_warning("You can't use that here!")) return FALSE - forceMove(T) - var/original_canmove = canmove - SetStunned(0) - SetWeakened(0) - if(buckled) - buckled.unbuckle_mob() - if(pulledby) - pulledby.stop_pulling() - stop_pulling() - canmove = FALSE - SK.doing_phase = TRUE //CHOMPEdit - Prevent bugs when spamming phase button //Shifting in if(ability_flags & AB_PHASE_SHIFTED) + phase_in(T) + //Shifting out + else + phase_out(T) + + +/mob/living/carbon/human/proc/phase_in(var/turf/T) + if(ability_flags & AB_PHASE_SHIFTED) + + // pre-change + forceMove(T) + var/original_canmove = canmove + SetStunned(0) + SetWeakened(0) + if(buckled) + buckled.unbuckle_mob() + if(pulledby) + pulledby.stop_pulling() + stop_pulling() + + // change + canmove = FALSE ability_flags &= ~AB_PHASE_SHIFTED ability_flags |= AB_PHASE_SHIFTING mouse_opacity = 1 @@ -222,8 +240,22 @@ L.broken() else L.flicker(10) - //Shifting out - else + +/mob/living/carbon/human/proc/phase_out(var/turf/T) + if(!(ability_flags & AB_PHASE_SHIFTED)) + // pre-change + forceMove(T) + var/original_canmove = canmove + SetStunned(0) + SetWeakened(0) + if(buckled) + buckled.unbuckle_mob() + if(pulledby) + pulledby.stop_pulling() + stop_pulling() + canmove = FALSE + + // change ability_flags |= AB_PHASE_SHIFTED ability_flags |= AB_PHASE_SHIFTING mouse_opacity = 0 diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm index da5fc5873d..6f3491f0e4 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/ability_procs.dm @@ -1,26 +1,44 @@ // Phase shifting procs (and related procs) /mob/living/simple_mob/shadekin/proc/phase_shift() var/turf/T = get_turf(src) + var/area/A = T.loc //RS Port #658 if(!T.CanPass(src,T) || loc != T) to_chat(src,span_warning("You can't use that here!")) return FALSE + //CHOMPAdd Start if((get_area(src).flags & PHASE_SHIELDED)) - to_chat(src,"This area is preventing you from phasing!") + to_chat(src,span_warning("This area is preventing you from phasing!")) return FALSE - - forceMove(T) - var/original_canmove = canmove - SetStunned(0) - SetWeakened(0) - if(buckled) - buckled.unbuckle_mob() - if(pulledby) - pulledby.stop_pulling() - stop_pulling() - canmove = FALSE + //CHOMPAdd End + //RS Port #658 Start + if(!client?.holder && A.block_phase_shift) + to_chat(src,span_warning("You can't use that here!")) + return FALSE + //RS Port #658 End //Shifting in if(ability_flags & AB_PHASE_SHIFTED) + phase_in(T) + //Shifting out + else + phase_out(T) + +/mob/living/simple_mob/shadekin/proc/phase_in(var/turf/T) + if(ability_flags & AB_PHASE_SHIFTED) + + // pre-change + forceMove(T) + var/original_canmove = canmove + SetStunned(0) + SetWeakened(0) + if(buckled) + buckled.unbuckle_mob() + if(pulledby) + pulledby.stop_pulling() + stop_pulling() + canmove = FALSE + + // change ability_flags &= ~AB_PHASE_SHIFTED mouse_opacity = 1 name = real_name @@ -73,8 +91,22 @@ */ handle_phasein_flicker() // CHOMPEdit, special handle for phase-in light flicker - //Shifting out - else +/mob/living/simple_mob/shadekin/proc/phase_out(var/turf/T) + if(!(ability_flags & AB_PHASE_SHIFTED)) + + // pre-change + forceMove(T) + var/original_canmove = canmove + SetStunned(0) + SetWeakened(0) + if(buckled) + buckled.unbuckle_mob() + if(pulledby) + pulledby.stop_pulling() + stop_pulling() + canmove = FALSE + + // change ability_flags |= AB_PHASE_SHIFTED mouse_opacity = 0 custom_emote(1,"phases out!") diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 744f2451d1..f9fb13d061 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -395,6 +395,7 @@ switch(mob.incorporeal_move) if(1) var/turf/T = get_step(mob, direct) + var/area/A = T.loc //RS Port #658 if(!T) return if(mob.check_holy(T)) @@ -404,9 +405,21 @@ else if(!istype(mob, /mob/observer/dead) && T.blocks_nonghost_incorporeal) return //CHOMPEdit end - else - mob.forceMove(get_step(mob, direct)) - mob.dir = direct + //RS Port #658 Start + if(!holder) + if(isliving(mob) && A.block_phase_shift) + to_chat(mob, span_warning("Something blocks you from entering this location while phased out.")) + return + if(isobserver(mob) && A.block_ghosts) + to_chat(mob, span_warning("Ghosts can't enter this location.")) + var/area/our_area = mobloc.loc + if(our_area.block_ghosts) + var/mob/observer/dead/D = mob + D.return_to_spawn() + return + mob.forceMove(get_step(mob, direct)) + mob.dir = direct + //RS Port #658 End if(2) if(prob(50)) var/locx diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index c60d52ee4d..16920d6ee9 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -79,7 +79,6 @@ if(direction == UP) var/obj/structure/lattice/lattice = locate() in destination.contents var/obj/structure/catwalk/catwalk = locate() in destination.contents - var/turf/simulated/floor/water/deep/ocean/diving/surface = destination if(lattice) var/pull_up_time = max((5 SECONDS + (src.movement_delay() * 10) * climb_modifier), 1) @@ -91,7 +90,7 @@ to_chat(src, span_warning("You gave up on pulling yourself up.")) return 0 - else if(istype(surface)) + else if(istype(destination, /turf/simulated/floor/water/deep/ocean/diving)) var/pull_up_time = max((5 SECONDS + (src.movement_delay() * 10) * swim_modifier), 1) to_chat(src, span_notice("You start swimming upwards...")) src.audible_message(span_notice("[src] begins to swim towards the surface."), runemessage = "splish splosh") @@ -116,6 +115,12 @@ to_chat(src, span_warning("You gave up on pulling yourself up.")) return 0 + //RS Port #661 Start, Prevents noclipping + else if(!istype(destination, /turf/simulated/open)) + to_chat(src, span_warning("Something solid above stops you from passing.")) + return 0 + //RS Port #661 End + else if(isliving(src)) //VOREStation Edit Start. Are they a mob, and are they currently flying?? var/mob/living/H = src if(H.flying) diff --git a/modular_chomp/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm b/modular_chomp/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm index da6fd97714..8dfb46ad00 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm @@ -13,6 +13,12 @@ if((get_area(src).flags & PHASE_SHIELDED)) //CHOMPAdd - Mapping tools to control phasing to_chat(src,span_warning("This area is preventing you from phasing!")) return FALSE + //RS Port #658 Start + var/area/A = get_area(src) + if(!client?.holder && A.block_phase_shift) + to_chat(src, span_warning("You can't do that here!")) + return FALSE + //RS Port #658 End if(ability_flags & AB_PHASE_SHIFTING) return FALSE