From 458f28fd1b45244eb7bb2c51244937db78d34dc2 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:52:28 +0100 Subject: [PATCH] Ports RS 658, 661 --- code/game/area/areas.dm | 19 ++++++ code/modules/mob/dead/observer/observer.dm | 31 ++++++++- .../species/shadekin/shadekin_abilities.dm | 68 +++++++++++-------- .../subtypes/vore/shadekin/ability_procs.dm | 60 +++++++++------- code/modules/mob/mob_movement.dm | 19 +++++- code/modules/multiz/movement.dm | 9 ++- 6 files changed, 149 insertions(+), 57 deletions(-) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 7a0515abfc7..4796dd55c1e 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.canmove) + if(ishuman(ourmob)) + var/mob/living/carbon/human/SK = ourmob + if(SK.ability_flags & AB_PHASE_SHIFTED) + SK.phase_in(SK.canmove) +// RS Port #658 End diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index d0f1f66f9e6..79177d5ebd0 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) @@ -223,7 +244,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp announce_ghost_joinleave(ghostize(1)) else var/response - if(check_rights(R_ADMIN|R_SERVER|R_MOD,FALSE,src)) //No need to sanity check for client and holder here as that is part of check_rights + if(src.client && src.client.holder) response = tgui_alert(src, "You have the ability to Admin-Ghost. The regular Ghost verb will announce your presence to dead chat. Both variants will allow you to return to your body using 'aghost'.\n\nWhat do you wish to do?", "Are you sure you want to ghost?", list("Admin Ghost", "Ghost", "Stay in body")) if(response == "Admin Ghost") if(!src.client) @@ -429,6 +450,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/living/carbon/human/species/shadekin/shadekin_abilities.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm index 3d62d0d033f..528f65169de 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 @@ -31,6 +31,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 @@ -88,6 +95,40 @@ canmove = FALSE //Shifting in + if(ability_flags & AB_PHASE_SHIFTED) + phase_in(original_canmove) + //Shifting out + else + phase_out(original_canmove) + +/mob/living/carbon/human/proc/phase_out(var/original_canmove) + ability_flags |= AB_PHASE_SHIFTED + ability_flags |= AB_PHASE_SHIFTING + mouse_opacity = 0 + custom_emote(1,"phases out!") + name = get_visible_name() + + for(var/obj/belly/B as anything in vore_organs) + B.escapable = FALSE + + var/obj/effect/temp_visual/shadekin/phase_out/phaseanim = new /obj/effect/temp_visual/shadekin/phase_out(src.loc) + phaseanim.dir = dir + alpha = 0 + add_modifier(/datum/modifier/shadekin_phase_vision) + sleep(5) + invisibility = INVISIBILITY_LEVEL_TWO + see_invisible = INVISIBILITY_LEVEL_TWO + //cut_overlays() + update_icon() + alpha = 127 + + canmove = original_canmove + incorporeal_move = TRUE + density = FALSE + force_max_speed = TRUE + ability_flags &= ~AB_PHASE_SHIFTING + +/mob/living/carbon/human/proc/phase_in(var/original_canmove) if(ability_flags & AB_PHASE_SHIFTED) ability_flags &= ~AB_PHASE_SHIFTED ability_flags |= AB_PHASE_SHIFTING @@ -137,33 +178,6 @@ L.broken() else L.flicker(10) - //Shifting out - else - ability_flags |= AB_PHASE_SHIFTED - ability_flags |= AB_PHASE_SHIFTING - mouse_opacity = 0 - custom_emote(1,"phases out!") - name = get_visible_name() - - for(var/obj/belly/B as anything in vore_organs) - B.escapable = FALSE - - var/obj/effect/temp_visual/shadekin/phase_out/phaseanim = new /obj/effect/temp_visual/shadekin/phase_out(src.loc) - phaseanim.dir = dir - alpha = 0 - add_modifier(/datum/modifier/shadekin_phase_vision) - sleep(5) - invisibility = INVISIBILITY_LEVEL_TWO - see_invisible = INVISIBILITY_LEVEL_TWO - //cut_overlays() - update_icon() - alpha = 127 - - canmove = original_canmove - incorporeal_move = TRUE - density = FALSE - force_max_speed = TRUE - ability_flags &= ~AB_PHASE_SHIFTING /datum/modifier/shadekin_phase_vision name = "Shadekin Phase Vision" 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 09bebbd3a48..ddeff3f54eb 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,9 +1,15 @@ // 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 + //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 forceMove(T) var/original_canmove = canmove @@ -17,6 +23,36 @@ canmove = FALSE //Shifting in + if(ability_flags & AB_PHASE_SHIFTED) + phase_in(original_canmove) + //Shifting out + else + phase_out(original_canmove) + +/mob/living/simple_mob/shadekin/proc/phase_out(var/original_canmove) + ability_flags |= AB_PHASE_SHIFTED + mouse_opacity = 0 + custom_emote(1,"phases out!") + real_name = name + name = "Something" + + for(var/obj/belly/B as anything in vore_organs) + B.escapable = FALSE + + cut_overlays() + flick("tp_out",src) + sleep(5) + invisibility = INVISIBILITY_LEVEL_TWO + see_invisible = INVISIBILITY_LEVEL_TWO + update_icon() + alpha = 127 + + canmove = original_canmove + incorporeal_move = TRUE + density = FALSE + force_max_speed = TRUE + +/mob/living/simple_mob/shadekin/proc/phase_in(var/original_canmove) if(ability_flags & AB_PHASE_SHIFTED) ability_flags &= ~AB_PHASE_SHIFTED mouse_opacity = 1 @@ -67,30 +103,6 @@ else L.flicker(10) - //Shifting out - else - ability_flags |= AB_PHASE_SHIFTED - mouse_opacity = 0 - custom_emote(1,"phases out!") - real_name = name - name = "Something" - - for(var/obj/belly/B as anything in vore_organs) - B.escapable = FALSE - - cut_overlays() - flick("tp_out",src) - sleep(5) - invisibility = INVISIBILITY_LEVEL_TWO - see_invisible = INVISIBILITY_LEVEL_TWO - update_icon() - alpha = 127 - - canmove = original_canmove - incorporeal_move = TRUE - density = FALSE - force_max_speed = TRUE - /mob/living/simple_mob/shadekin/UnarmedAttack() if(ability_flags & AB_PHASE_SHIFTED) return FALSE //Nope. diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 5ff11814f6d..a942c558498 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -350,14 +350,27 @@ 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)) to_chat(mob, span_warning("You cannot get past holy grounds while you are in this plane of existence!")) return - 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 98f5b27fa9b..64fc76ae390 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)