Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into globbification
Browse files Browse the repository at this point in the history
  • Loading branch information
hry-gh committed Nov 16, 2023
2 parents d154788 + 0394e18 commit 41297e7
Show file tree
Hide file tree
Showing 113 changed files with 10,927 additions and 5,028 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
#define SHOES_SLOWDOWN -1

#define SLOWDOWN_ARMOR_NONE 0
#define SLOWDOWN_ARMOR_SUPER_LIGHT 0.10
#define SLOWDOWN_ARMOR_VERY_LIGHT 0.20
#define SLOWDOWN_ARMOR_LIGHT 0.35
#define SLOWDOWN_ARMOR_MEDIUM 0.55
Expand Down
4 changes: 1 addition & 3 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@
#define CAN_DIG_SHRAPNEL (1<<11)
/// whether it has an animated icon state of "[icon_state]_on" to be used during surgeries.
#define ANIMATED_SURGICAL_TOOL (1<<12)
/// The item goes on top of tables, instead of into them with the overlay system
#define NOTABLEMERGE (1<<13)
/// Has heat source but isn't 'on fire' and thus can be stored
#define IGNITING_ITEM (1<<14)
#define IGNITING_ITEM (1<<13)
//==========================================================================================


Expand Down
30 changes: 25 additions & 5 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
_L = target._status_traits; \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements){ \
target.AddElement(GLOB.traits_with_elements[trait]); \
} \
} else { \
_L = target._status_traits; \
if (_L[trait]) { \
_L[trait] |= list(source); \
} else { \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements){ \
target.AddElement(GLOB.traits_with_elements[trait]); \
} \
} \
} \
} while (0)
Expand All @@ -38,6 +44,9 @@
if (!length(_L[trait])) { \
_L -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[trait]); \
} \
}; \
if (!length(_L)) { \
target._status_traits = null \
Expand All @@ -62,6 +71,9 @@
if (!length(_traits_list[trait])) { \
_traits_list -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
if(trait in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[trait]); \
} \
}; \
if (!length(_traits_list)) { \
target._status_traits = null \
Expand All @@ -78,8 +90,11 @@
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T), _T); \
if(trait in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[trait]); \
}; \
};\
};\
if (!length(_L)) { \
target._status_traits = null\
};\
Expand All @@ -101,8 +116,11 @@
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T)); \
if(_T in GLOB.traits_with_elements) { \
target.RemoveElement(GLOB.traits_with_elements[_T]); \
}; \
};\
};\
if (!length(_L)) { \
target._status_traits = null\
};\
Expand All @@ -124,10 +142,9 @@
/// Example trait
// #define TRAIT_X "t_x"

/// cannot be removed without admin intervention
#define ROUNDSTART_TRAIT "roundstart"

//-- mob traits --
/// Prevents voluntary movement.
#define TRAIT_IMMOBILIZED "immobilized"
/// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this!
#define TRAIT_UNDENSE "undense"

Expand Down Expand Up @@ -279,6 +296,7 @@ GLOBAL_LIST_INIT(mob_traits, list(
*/
GLOBAL_LIST_INIT(traits_by_type, list(
/mob = list(
"TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED,
"TRAIT_UNDENSE" = TRAIT_UNDENSE,
"TRAIT_YAUTJA_TECH" = TRAIT_YAUTJA_TECH,
"TRAIT_SUPER_STRONG" = TRAIT_SUPER_STRONG,
Expand Down Expand Up @@ -355,6 +373,8 @@ GLOBAL_LIST(trait_name_map)
/// Example trait source
// #define TRAIT_SOURCE_Y "t_s_y"
#define TRAIT_SOURCE_INHERENT "t_s_inherent"
/// cannot be removed without admin intervention
#define ROUNDSTART_TRAIT "roundstart"
//-- mob traits --
///Status trait coming from lying down through update_canmove()
#define LYING_TRAIT "lying"
Expand All @@ -364,8 +384,6 @@ GLOBAL_LIST(trait_name_map)
#define TRAIT_SOURCE_HIVE "t_s_hive"
///Status trait coming from being buckled.
#define TRAIT_SOURCE_BUCKLE "t_s_buckle"
///Status trait coming from roundstart quirks (that don't exist yet). Unremovable by REMOVE_TRAIT
#define TRAIT_SOURCE_QUIRK "t_s_quirk"
///Status trait coming from being assigned as [acting] squad leader.
#define TRAIT_SOURCE_SQUAD_LEADER "t_s_squad_leader"
///Status trait coming from their job
Expand Down Expand Up @@ -396,6 +414,8 @@ GLOBAL_LIST(trait_name_map)
//Status trait coming from clothing.
#define TRAIT_SOURCE_CLOTHING "t_s_clothing"

/// traits associated with actively interacted machinery
#define INTERACTION_TRAIT "interaction"
/// trait effect related to active specialist gear
#define SPECIALIST_GEAR_TRAIT "specialist_gear"
/// traits associated with usage of snowflake dropship double seats
Expand Down
1 change: 0 additions & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ DEFINE_BITFIELD(flags_item, list(
"ITEM_OVERRIDE_NORTHFACE" = ITEM_OVERRIDE_NORTHFACE,
"CAN_DIG_SHRAPNEL" = CAN_DIG_SHRAPNEL,
"ANIMATED_SURGICAL_TOOL" = ANIMATED_SURGICAL_TOOL,
"NOTABLEMERGE" = NOTABLEMERGE,
"IGNITING_ITEM" = IGNITING_ITEM,
))

Expand Down
11 changes: 11 additions & 0 deletions code/_onclick/hud/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
var/mob/dead/observer/G = usr
G.reenter_corpse()

/atom/movable/screen/ghost/toggle_huds
name = "Toggle HUDs"
icon_state = "ghost_hud_toggle"

/atom/movable/screen/ghost/toggle_huds/Click()
var/client/client = usr.client
client.toggle_ghost_hud()

/datum/hud/ghost/New(mob/owner, ui_style='icons/mob/hud/human_white.dmi', ui_color, ui_alpha = 230)
. = ..()
var/atom/movable/screen/using
Expand All @@ -68,6 +76,9 @@
using.screen_loc = ui_ghost_slot4
static_inventory += using

using = new /atom/movable/screen/ghost/toggle_huds()
using.screen_loc = ui_ghost_slot5
static_inventory += using

/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
// don't show this HUD if observing; show the HUD of the observee
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
if(!user.hive.living_xeno_queen)
to_chat(user, SPAN_WARNING("Without a queen your psychic link is broken!"))
return FALSE
if(user.burrow || user.is_mob_incapacitated() || user.buckled)
if(HAS_TRAIT(user, TRAIT_ABILITY_BURROWED) || user.is_mob_incapacitated() || user.buckled)
return FALSE
user.hive.mark_ui.update_all_data()
user.hive.mark_ui.open_mark_menu(user)
Expand Down Expand Up @@ -583,7 +583,7 @@
if(!user.hive.living_xeno_queen)
to_chat(user, SPAN_WARNING("Your hive doesn't have a living queen!"))
return FALSE
if(user.burrow || user.is_mob_incapacitated() || user.buckled)
if(HAS_TRAIT(user, TRAIT_ABILITY_BURROWED) || user.is_mob_incapacitated() || user.buckled)
return FALSE
user.overwatch(user.hive.living_xeno_queen)

Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if(xeno.stat != DEAD) // If the Xeno is alive, fight back
var/mob/living/carbon/carbon_user = user
if(!carbon_user || !carbon_user.ally_of_hivenumber(xeno.hivenumber))
user.KnockDown(rand(xeno.caste.tacklestrength_min, xeno.caste.tacklestrength_max))
carbon_user.KnockDown(rand(xeno.caste.tacklestrength_min, xeno.caste.tacklestrength_max))
playsound(user.loc, 'sound/weapons/pierce.ogg', 25, TRUE)
user.visible_message(SPAN_WARNING("\The [user] tried to unstrap \the [back_item] from [xeno] but instead gets a tail swipe to the head!"))
return
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

/mob/living/carbon/xenomorph/UnarmedAttack(atom/target, proximity, click_parameters, tile_attack = FALSE, ignores_resin = FALSE)
if(lying || burrow) //No attacks while laying down
if(lying || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down
return FALSE
var/mob/alt

Expand Down
4 changes: 2 additions & 2 deletions code/datums/agents/tools/chloroform.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/obj/item/weapon/chloroform/proc/grab_stun(mob/living/M, mob/living/user)
M.anchored = TRUE
M.frozen = TRUE
ADD_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT)
ADD_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT)
M.able_to_speak = FALSE
M.update_canmove()
Expand Down Expand Up @@ -82,7 +82,7 @@
M.density = TRUE
M.able_to_speak = TRUE
M.layer = MOB_LAYER
M.unfreeze()
REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT)
REMOVE_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT)

QDEL_NULL(mask_item)
Expand Down
8 changes: 4 additions & 4 deletions code/datums/ammo/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

neuro_callback = CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(apply_neuro))

/proc/apply_neuro(mob/M, power, insta_neuro)
/proc/apply_neuro(mob/living/M, power, insta_neuro)
if(skillcheck(M, SKILL_ENDURANCE, SKILL_ENDURANCE_MAX) && !insta_neuro)
M.visible_message(SPAN_DANGER("[M] withstands the neurotoxin!"))
return //endurance 5 makes you immune to weak neurotoxin
Expand Down Expand Up @@ -69,7 +69,7 @@
M.adjust_effect(1 * power, WEAKEN) // KD them a bit more
M.visible_message(SPAN_DANGER("[M] falls prone."))

/proc/apply_scatter_neuro(mob/M)
/proc/apply_scatter_neuro(mob/living/M)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(skillcheck(M, SKILL_ENDURANCE, SKILL_ENDURANCE_MAX))
Expand Down Expand Up @@ -317,7 +317,7 @@
shrapnel_type = /obj/item/shard/shrapnel/bone_chips
shrapnel_chance = 60

/datum/ammo/xeno/bone_chips/on_hit_mob(mob/M, obj/projectile/P)
/datum/ammo/xeno/bone_chips/on_hit_mob(mob/living/M, obj/projectile/P)
if(iscarbon(M))
var/mob/living/carbon/C = M
if((HAS_FLAG(C.status_flags, XENO_HOST) && HAS_TRAIT(C, TRAIT_NESTED)) || C.stat == DEAD)
Expand Down Expand Up @@ -347,7 +347,7 @@
damage = 10
shrapnel_chance = 0

/datum/ammo/xeno/bone_chips/spread/runner/on_hit_mob(mob/M, obj/projectile/P)
/datum/ammo/xeno/bone_chips/spread/runner/on_hit_mob(mob/living/M, obj/projectile/P)
if(iscarbon(M))
var/mob/living/carbon/C = M
if((HAS_FLAG(C.status_flags, XENO_HOST) && HAS_TRAIT(C, TRAIT_NESTED)) || C.stat == DEAD)
Expand Down
2 changes: 2 additions & 0 deletions code/datums/components/autofire/autofire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
/datum/component/automatedfire/autofire/proc/initiate_shot()
SIGNAL_HANDLER
if(shooting)//if we are already shooting, it means the shooter is still on cooldown
if(bursting && (world.time > (next_fire + (burstfire_shot_delay * burst_shots_to_fire))))
hard_reset()
return
shooting = TRUE
process_shot()
Expand Down
12 changes: 4 additions & 8 deletions code/datums/effects/xeno_strains/boiler_trap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
effect_name = "boiler trap"
duration = null
flags = INF_DURATION
/// Ghetto flag indicating whether we actually placed the freeze or not, until we have an actual effects system
var/freezer = FALSE

/datum/effects/boiler_trap/New(atom/A, mob/from, last_dmg_source, zone)
. = ..()
if(!QDELETED(src))
var/mob/M = affected_atom
freezer = M.freeze()
ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name))

/datum/effects/boiler_trap/Destroy(force)
if(ismob(affected_atom) && freezer)
if(ismob(affected_atom))
var/mob/M = affected_atom
M.unfreeze()
REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name))
return ..()

/datum/effects/boiler_trap/validate_atom(atom/A)
Expand All @@ -29,7 +27,5 @@
. = ..()
if(!.) return FALSE
var/mob/M = affected_atom
if(M.frozen) return TRUE
if(!freezer)
freezer = M.freeze()
ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name))
return TRUE
Loading

0 comments on commit 41297e7

Please sign in to comment.