mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Adds the ability to 'army crawl' as a component, also moves cortical borers hide ability to this component. (#29245)
* the whole PR * The whole PR * Update HUD_Glasses.dm * puts it back as a component * Update prone_mob.dm * Update movement.dm * Update mob_movement.dm * Update prone_mob.dm * fixes all the things I was told (I think) --------- Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
This commit is contained in:
@@ -8,3 +8,4 @@
|
||||
#define COMSIG_KB_CLIENT_WHISPER_DOWN "keybinding_client_whisper_down"
|
||||
#define COMSIG_KB_LIVING_COMBAT_INDICATOR "keybinding_living_combat_indicator"
|
||||
#define COMSIG_KB_CARBON_TOGGLE_SAFETY "keybinding_carbon_toggle_safety"
|
||||
#define COMSIG_KB_MOVEMENT_ARMY_CRAWL_DOWN "keybinding_movement_army_crawl_down"
|
||||
|
||||
@@ -110,3 +110,5 @@
|
||||
|
||||
/// Whenever we need the soulcatcher soul to communicate something.
|
||||
#define COMSIG_CARRIER_MOB_SAY "carrier_mob_communicate"
|
||||
//signal sent when a mob tries to de-prone
|
||||
#define COMSIG_MOVABLE_REMOVE_PRONE_STATE "living_remove_prone_state"
|
||||
|
||||
@@ -5,3 +5,5 @@
|
||||
#define SLIPPERY_MAX 9
|
||||
/// Permit hud clothing trait
|
||||
#define TRAIT_PERMIT_HUD "permit_hud"
|
||||
//for if we are army crawling or not
|
||||
#define TRAIT_PRONE "prone"
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/datum/component/prone_mob
|
||||
|
||||
/datum/component/prone_mob/Initialize(mob/living/source)
|
||||
. = ..()
|
||||
if(!isliving(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
source = parent
|
||||
parent.add_traits(list(TRAIT_PRONE, TRAIT_FLOORED, TRAIT_NO_THROWING), type)
|
||||
parent.add_traits(list(TRAIT_PRONE, TRAIT_FLOORED, TRAIT_NO_THROWING), type)
|
||||
passtable_on(parent, type)
|
||||
source.layer = PROJECTILE_HIT_THRESHHOLD_LAYER
|
||||
|
||||
/datum/component/prone_mob/RegisterWithParent()
|
||||
RegisterSignals(parent, list(COMSIG_MOVABLE_REMOVE_PRONE_STATE, COMSIG_LIVING_GET_PULLED), PROC_REF(stop_army_crawl))
|
||||
RegisterSignals(parent, list(COMSIG_MOB_ATTACK_HAND, COMSIG_MOB_ITEM_ATTACK), PROC_REF(check_attack))
|
||||
RegisterSignal(parent, COMSIG_LIVING_TRY_PULL, PROC_REF(check_pull))
|
||||
|
||||
/datum/component/prone_mob/UnregisterFromParent()
|
||||
UnregisterSignal(parent, list(
|
||||
COMSIG_LIVING_GET_PULLED,
|
||||
COMSIG_MOB_ATTACK_HAND,
|
||||
COMSIG_MOB_ITEM_ATTACK,
|
||||
COMSIG_LIVING_GET_PULLED,
|
||||
COMSIG_LIVING_TRY_PULL
|
||||
))
|
||||
return ..()
|
||||
|
||||
/datum/component/prone_mob/proc/check_attack(mob/living/source)
|
||||
SIGNAL_HANDLER
|
||||
return COMPONENT_CANCEL_ATTACK_CHAIN
|
||||
|
||||
/datum/component/prone_mob/proc/check_pull(mob/living/source)
|
||||
SIGNAL_HANDLER
|
||||
return COMSIG_LIVING_CANCEL_PULL
|
||||
|
||||
/datum/component/prone_mob/proc/stop_army_crawl(mob/living/source)
|
||||
SIGNAL_HANDLER
|
||||
source = parent
|
||||
parent.remove_traits(list(TRAIT_PRONE, TRAIT_FLOORED, TRAIT_NO_THROWING), type)
|
||||
passtable_off(parent, type)
|
||||
source.layer = MOB_LAYER
|
||||
qdel(src)
|
||||
@@ -0,0 +1,14 @@
|
||||
/datum/keybinding/movement/army_crawl
|
||||
hotkey_keys = list("K")
|
||||
name = "prone"
|
||||
full_name = "army crawl"
|
||||
description = "lay yourself as close to the ground as possible after a short delay"
|
||||
keybind_signal = COMSIG_KB_MOVEMENT_ARMY_CRAWL_DOWN
|
||||
|
||||
/datum/keybinding/movement/army_crawl/down(client/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
var/mob/living/carbon/crawler = user.mob
|
||||
if(istype(crawler, /mob/living/carbon))
|
||||
crawler.army_crawl()
|
||||
@@ -0,0 +1,5 @@
|
||||
/mob/living/carbon/human/can_use_guns(obj/item/G)
|
||||
. = ..()
|
||||
if(HAS_TRAIT(src, TRAIT_PRONE))
|
||||
to_chat(src, span_warning("You are crawling too low to used a ranged weapon!"))
|
||||
return FALSE
|
||||
@@ -0,0 +1,21 @@
|
||||
/mob/living/carbon/verb/army_crawl()
|
||||
set name = "Army Crawl"
|
||||
set category = "IC"
|
||||
|
||||
var/mob/living/carbon/crawler = src
|
||||
|
||||
if(HAS_TRAIT(crawler, TRAIT_PRONE))
|
||||
visible_message("[crawler] starts to get up")
|
||||
if(!do_after(crawler, 3 SECONDS))
|
||||
return
|
||||
SEND_SIGNAL(crawler, COMSIG_MOVABLE_REMOVE_PRONE_STATE)
|
||||
else
|
||||
visible_message("[crawler] begins to lower themself further")
|
||||
if(!do_after(crawler, 3 SECONDS, extra_checks = CALLBACK(crawler, PROC_REF(can_army_crawl))))
|
||||
if(!crawler.resting)
|
||||
balloon_alert(crawler, "must be laying down!")
|
||||
return
|
||||
crawler.AddComponent(/datum/component/prone_mob)
|
||||
|
||||
/mob/living/carbon/proc/can_army_crawl()
|
||||
return resting
|
||||
@@ -392,15 +392,15 @@
|
||||
if(!.)
|
||||
return FALSE
|
||||
var/mob/living/basic/cortical_borer/cortical_owner = owner
|
||||
if(owner.layer == PROJECTILE_HIT_THRESHHOLD_LAYER)
|
||||
if(HAS_TRAIT(cortical_owner, TRAIT_PRONE))
|
||||
SEND_SIGNAL(cortical_owner, COMSIG_MOVABLE_REMOVE_PRONE_STATE)
|
||||
cortical_owner.upgrade_flags &= ~BORER_HIDING
|
||||
owner.balloon_alert(owner, "stopped hiding")
|
||||
owner.layer = BELOW_MOB_LAYER
|
||||
StartCooldown()
|
||||
return
|
||||
cortical_owner.upgrade_flags |= BORER_HIDING
|
||||
owner.balloon_alert(owner, "started hiding")
|
||||
owner.layer = PROJECTILE_HIT_THRESHHOLD_LAYER
|
||||
cortical_owner.AddComponent(/datum/component/prone_mob)
|
||||
StartCooldown()
|
||||
|
||||
//to paralyze people
|
||||
|
||||
@@ -6494,6 +6494,7 @@
|
||||
#include "modular_skyrat\master_files\code\datums\components\fullauto.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\components\grillable.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\components\leash.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\components\prone_mob.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\components\shielded_suit.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\components\tippable.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\greyscale\config_types\greyscale_configs.dm"
|
||||
@@ -6501,6 +6502,7 @@
|
||||
#include "modular_skyrat\master_files\code\datums\id_trim\solfed.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\id_trim\syndicate.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\keybinding\mob.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\keybinding\movement.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\mind\_mind.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\mood_events\drink_events.dm"
|
||||
#include "modular_skyrat\master_files\code\datums\mood_events\generic_negative_events.dm"
|
||||
@@ -6763,6 +6765,7 @@
|
||||
#include "modular_skyrat\master_files\code\modules\mining\equipment\kinetic_crusher.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mining\equipment\kinetic_gauntlets.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\login.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\mob_movement.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\dead\new_player\latejoin_menu.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\dead\new_player\preferences_setup.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\blood.dm"
|
||||
@@ -6782,6 +6785,7 @@
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\carbon\human\species_type\lizardpeople.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\carbon\human\species_type\podpeople.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\carbon\human\species_type\snail.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\human\human.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\human\species.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\human\species_types\ethereal.dm"
|
||||
#include "modular_skyrat\master_files\code\modules\mob\living\human\species_types\flypeople.dm"
|
||||
|
||||
Reference in New Issue
Block a user