mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
crawling under + no under (lol)
- crawling under tables - no more unders spawn with jumpsuits (?)
This commit is contained in:
@@ -114,6 +114,7 @@ GLOBAL_LIST_INIT(bitflags, list(
|
||||
#define LETPASSTHROW (1<<6)
|
||||
#define PASSMACHINE (1<<7)
|
||||
#define PASSSTRUCTURE (1<<8)
|
||||
#define PASSCRAWL (1<<9) //SPLURT edit
|
||||
|
||||
//Movement Types
|
||||
#define GROUND (1<<0)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
#define TRAIT_HYPNOTIC_GAZE "Hypnotic Gaze"
|
||||
|
||||
#define TRAIT_FLOORED "floored"
|
||||
#define IGNORE_FAKE_Z_AXIS "ignore_fake_z_axis"
|
||||
|
||||
// Hyperstation traits
|
||||
#define TRAIT_PHARMA "hepatic_pharmacokinesis"
|
||||
#define TRAIT_CHOKE_SLUT "choke_slut"
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
|
||||
// receive a mousedrop
|
||||
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
|
||||
SEND_SIGNAL(src, COMSIG_MOUSEDROPPED_ONTO, dropping, user)
|
||||
return
|
||||
return SEND_SIGNAL(src, COMSIG_MOUSEDROPPED_ONTO, dropping, user) //SPLURT edit
|
||||
|
||||
|
||||
/client/MouseDown(object, location, control, params)
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
/atom/movable/MouseDrop_T(mob/living/M, mob/living/user)
|
||||
. = ..()
|
||||
if(. & COMSIG_MOB_CANCEL_CLICKON) //SPLURT edit
|
||||
return
|
||||
if(can_buckle && istype(M) && istype(user))
|
||||
if(user_buckle_mob(M, user))
|
||||
return 1
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
|
||||
/obj/structure/MouseDrop_T(atom/movable/O, mob/user)
|
||||
. = ..()
|
||||
if(. & COMSIG_MOB_CANCEL_CLICKON) //SPLURT edit
|
||||
return
|
||||
if(!climbable)
|
||||
return
|
||||
if(user == O && iscarbon(O))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
/obj/item/clothing/under/color/random/Initialize(mapload)
|
||||
..()
|
||||
var/obj/item/clothing/under/color/C = pick(subtypesof(/obj/item/clothing/under/color) - subtypesof(/obj/item/clothing/under/color/jumpskirt) - /obj/item/clothing/under/color/random - /obj/item/clothing/under/color/grey/glorf - /obj/item/clothing/under/color/black/ghost)
|
||||
var/obj/item/clothing/under/color/C = pick(typesof(/obj/item/clothing/under/color) - subtypesof(/obj/item/clothing/under/color/jumpskirt) - /obj/item/clothing/under/color/random - /obj/item/clothing/under/color/grey/glorf - /obj/item/clothing/under/color/black/ghost)
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
|
||||
@@ -84,7 +84,8 @@
|
||||
var/canstand_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying) && !(combat_flags & COMBAT_FLAG_HARD_STAMCRIT)
|
||||
var/canstand = canstand_involuntary && !resting
|
||||
|
||||
var/should_be_lying = !canstand && !HAS_TRAIT(src, TRAIT_MOBILITY_NOREST)
|
||||
// var/should_be_lying = !canstand && !HAS_TRAIT(src, TRAIT_MOBILITY_NOREST) //SPLURT edit
|
||||
var/should_be_lying = HAS_TRAIT(src, TRAIT_FLOORED) || !(canstand || HAS_TRAIT(src, TRAIT_MOBILITY_NOREST))
|
||||
if(buckled)
|
||||
if(buckled.buckle_lying != -1)
|
||||
should_be_lying = buckled.buckle_lying
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
|
||||
/mob/living/Move(atom/newloc, direct)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(. && !HAS_TRAIT(src, IGNORE_FAKE_Z_AXIS)) //SPLURT edit. don't worry, i hate this too.
|
||||
pseudo_z_axis = newloc.get_fake_z()
|
||||
pixel_z = pseudo_z_axis
|
||||
|
||||
83
modular_splurt/code/datums/elements/crawl_under.dm
Normal file
83
modular_splurt/code/datums/elements/crawl_under.dm
Normal file
@@ -0,0 +1,83 @@
|
||||
#define COMVER_CRAWL_UNDER "comver_crawl_under"
|
||||
#define ELEMENT_CRAWL_UNDER "element_crawl_under"
|
||||
|
||||
//ATTENTION: only handles the crawling-under action and layers.
|
||||
//you need to manually set CanPass() to allow PASSCRAWL for the object you're applying it to.
|
||||
/datum/element/crawl_under
|
||||
element_flags = ELEMENT_DETACH
|
||||
|
||||
/datum/element/crawl_under/Attach(datum/target)
|
||||
. = ..()
|
||||
if(!isstructure(target)) //it would work up to movable but no.
|
||||
return ELEMENT_INCOMPATIBLE //if any machinery comes up feel free to move up to /obj
|
||||
|
||||
RegisterSignal(target, COMSIG_MOUSEDROPPED_ONTO, .proc/check_crawl)
|
||||
RegisterSignal(target, COMVER_CRAWL_UNDER, .proc/Affirm)
|
||||
RegisterSignal(target, COMSIG_MOVABLE_UNCROSSED, .proc/uncrawl_from)
|
||||
|
||||
/datum/element/crawl_under/Detach(datum/source, force)
|
||||
var/obj/object = source //if src somehow changes type fuck you
|
||||
var/turf/src_turf = get_turf(object)
|
||||
for(var/mob/living/living in src_turf)
|
||||
REMOVE_TRAIT(living, IGNORE_FAKE_Z_AXIS, ELEMENT_CRAWL_UNDER)
|
||||
REMOVE_TRAIT(living, TRAIT_FLOORED, ELEMENT_CRAWL_UNDER)
|
||||
living.layer = initial(living.layer)
|
||||
living.pass_flags &= ~PASSCRAWL
|
||||
|
||||
UnregisterSignal(source, list(
|
||||
COMSIG_MOUSEDROPPED_ONTO,
|
||||
COMVER_CRAWL_UNDER,
|
||||
COMSIG_MOVABLE_UNCROSSED
|
||||
))
|
||||
return ..()
|
||||
|
||||
|
||||
/datum/element/crawl_under/proc/check_crawl(obj/structure/source, mob/living/user) //not checking if it's a structure. y'all should know better.
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!istype(user)) //valid user, also checks for if it exists
|
||||
return
|
||||
if(user.mobility_flags & MOBILITY_STAND || user.incapacitated(TRUE, FALSE, TRUE))
|
||||
return
|
||||
if((user.pass_flags & PASSCRAWL) || HAS_TRAIT_FROM(user, TRAIT_FLOORED, ELEMENT_CRAWL_UNDER)) //already under
|
||||
return
|
||||
|
||||
INVOKE_ASYNC(src, .proc/do_crawl, source, user)
|
||||
return COMSIG_MOB_CANCEL_CLICKON
|
||||
|
||||
/datum/element/crawl_under/proc/do_crawl(obj/structure/source, mob/living/user)
|
||||
if(QDELETED(source) || QDELETED(user)) //sanity
|
||||
return
|
||||
|
||||
to_chat(user, span_notice("You start crawling under [source].."))
|
||||
if(!do_after(user, 20, FALSE, source) || (user.mobility_flags & MOBILITY_STAND || user.incapacitated(TRUE, FALSE, TRUE)))
|
||||
to_chat(user, span_warning("You fail to crawl under [source]!"))
|
||||
return
|
||||
|
||||
ADD_TRAIT(user, IGNORE_FAKE_Z_AXIS, ELEMENT_CRAWL_UNDER)
|
||||
ADD_TRAIT(user, TRAIT_FLOORED, ELEMENT_CRAWL_UNDER)
|
||||
user.layer = source.layer - 0.01 //just a lil under it
|
||||
user.pass_flags |= PASSCRAWL
|
||||
step(user, get_dir(user, source))
|
||||
|
||||
/datum/element/crawl_under/proc/uncrawl_from(obj/structure/source, atom/movable/movable)
|
||||
if(QDELETED(source) || QDELETED(movable) || !get_turf(movable)) //sanity
|
||||
return
|
||||
if(!isliving(movable)) //no
|
||||
return
|
||||
|
||||
for(var/obj/structure/structure in get_turf(movable))
|
||||
if(structure.type == source.type || SEND_SIGNAL(structure, COMVER_CRAWL_UNDER))
|
||||
return
|
||||
|
||||
|
||||
REMOVE_TRAIT(movable, IGNORE_FAKE_Z_AXIS, ELEMENT_CRAWL_UNDER)
|
||||
REMOVE_TRAIT(movable, TRAIT_FLOORED, ELEMENT_CRAWL_UNDER)
|
||||
movable.layer = initial(movable.layer)
|
||||
movable.pass_flags &= ~PASSCRAWL
|
||||
|
||||
/datum/element/crawl_under/proc/Affirm() //todo: move to /element and implement for /component ?
|
||||
return TRUE
|
||||
|
||||
#undef COMVER_CRAWL_UNDER
|
||||
#undef ELEMENT_CRAWL_UNDER
|
||||
@@ -1,3 +1,7 @@
|
||||
/obj/structure/bed/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/crawl_under)
|
||||
|
||||
/obj/structure/bed/Destroy()
|
||||
unbuckle_all_mobs()
|
||||
return ..()
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//Main code edits
|
||||
/obj/structure/table/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/crawl_under)
|
||||
|
||||
/obj/structure/table/CanPass(atom/movable/mover, turf/target)
|
||||
if(mover.pass_flags & PASSCRAWL)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/structure/table/glass/check_break(mob/living/M)
|
||||
if(M.pass_flags & PASSCRAWL)
|
||||
return
|
||||
. = ..()
|
||||
|
||||
//Own stuff
|
||||
/obj/structure/table/wood/shadow
|
||||
name = "shadow wood table"
|
||||
icon = 'modular_splurt/icons/obj/smooth_structures/table_shadow.dmi'
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/datum/species/althelp(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
|
||||
if(user == target && istype(user))
|
||||
if(HAS_TRAIT(user, TRAIT_FLOORED))
|
||||
to_chat(user, "<span class='warning'>You can't seem to force yourself up right now!</span>")
|
||||
return
|
||||
. = ..()
|
||||
@@ -0,0 +1,5 @@
|
||||
/mob/living/set_resting(new_resting, silent, updating)
|
||||
if(new_resting && HAS_TRAIT(src, TRAIT_FLOORED))
|
||||
return
|
||||
. = ..()
|
||||
|
||||
10
modular_splurt/code/modules/mob/living/living_movement.dm
Normal file
10
modular_splurt/code/modules/mob/living/living_movement.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
/mob
|
||||
var/layer_priority
|
||||
|
||||
/mob/living/layershift_up()
|
||||
. = ..()
|
||||
src.layer_priority = FLOOR((layer - MOB_LAYER) * 100, 1)
|
||||
|
||||
/mob/living/layershift_down()
|
||||
. = ..()
|
||||
src.layer_priority = FLOOR((layer - MOB_LAYER) * 100, 1)
|
||||
3
modular_splurt/code/modules/mob/living/living_signals.dm
Normal file
3
modular_splurt/code/modules/mob/living/living_signals.dm
Normal file
@@ -0,0 +1,3 @@
|
||||
/mob/living/ComponentInitialize()
|
||||
. = ..()
|
||||
RegisterSignal(src, SIGNAL_TRAIT(TRAIT_FLOORED), .proc/update_mobility)
|
||||
@@ -4212,6 +4212,7 @@
|
||||
#include "modular_splurt\code\datums\components\crafting\recipes\recipes_primal.dm"
|
||||
#include "modular_splurt\code\datums\components\crafting\recipes\recipes_robot.dm"
|
||||
#include "modular_splurt\code\datums\components\storage\concrete\pockets.dm"
|
||||
#include "modular_splurt\code\datums\elements\crawl_under.dm"
|
||||
#include "modular_splurt\code\datums\interactions\cuddling.dm"
|
||||
#include "modular_splurt\code\datums\interactions\lewd\_lewd.dm"
|
||||
#include "modular_splurt\code\datums\interactions\lewd\lewd_datums.dm"
|
||||
@@ -4462,9 +4463,13 @@
|
||||
#include "modular_splurt\code\modules\mob\dead\new_player\sprite_accesories\wings.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\living.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\living_defines.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\living_mobility.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\living_movement.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\living_signals.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\carbon.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\human\human.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\human\human_defines.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\human\species.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\human\simple_animal\hostile\deathclaw\deathclaw.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\human\simple_animal\hostile\deathclaw\funclaw.dm"
|
||||
#include "modular_splurt\code\modules\mob\living\carbon\human\species_types\ashwalker.dm"
|
||||
|
||||
Reference in New Issue
Block a user