mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
[MIRROR] Traits given by Elements now have element trait as their source. [MDB IGNORE] (#9110)
* Traits given by Elements now have element trait as their source. (#62134) Hopefully the code is more organized and consistent this way. * Traits given by Elements now have element trait as their source. Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
co-authored by
John Willard
parent
c9b268a72a
commit
d79a997673
@@ -693,7 +693,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
/// Trait applied to brain mobs when they lack external aid for locomotion, such as being inside a mech.
|
||||
#define BRAIN_UNAIDED "brain-unaided"
|
||||
/// Trait applied by element
|
||||
#define ELEMENT_TRAIT "element_trait"
|
||||
#define ELEMENT_TRAIT(source) "element_trait_[source]"
|
||||
/// Trait granted by [/obj/item/clothing/head/helmet/space/hardsuit/berserker]
|
||||
#define BERSERK_TRAIT "berserk_trait"
|
||||
/// Trait granted by [/obj/item/rod_of_asclepius]
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
||||
RegisterSignal(target, COMSIG_MOUSEDROPPED_ONTO, .proc/mousedrop_receive)
|
||||
RegisterSignal(target, COMSIG_ATOM_BUMPED, .proc/try_speedrun)
|
||||
ADD_TRAIT(target, TRAIT_CLIMBABLE, src)
|
||||
ADD_TRAIT(target, TRAIT_CLIMBABLE, ELEMENT_TRAIT(type))
|
||||
|
||||
/datum/element/climbable/Detach(datum/target)
|
||||
UnregisterSignal(target, list(COMSIG_ATOM_ATTACK_HAND, COMSIG_PARENT_EXAMINE, COMSIG_MOUSEDROPPED_ONTO, COMSIG_ATOM_BUMPED))
|
||||
REMOVE_TRAIT(target, TRAIT_CLIMBABLE, src)
|
||||
REMOVE_TRAIT(target, TRAIT_CLIMBABLE, ELEMENT_TRAIT(type))
|
||||
return ..()
|
||||
|
||||
/datum/element/climbable/proc/on_examine(atom/source, mob/user, list/examine_texts)
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
ai.blackboard[BB_TARGET_SLOT] = slot
|
||||
master.ai_controller = ai
|
||||
master.AddElement(/datum/element/movetype_handler)
|
||||
ADD_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type))
|
||||
|
||||
/datum/element/cursed/Detach(datum/source)
|
||||
. = ..()
|
||||
var/obj/item/master = source
|
||||
QDEL_NULL(master.ai_controller)
|
||||
REMOVE_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT)
|
||||
REMOVE_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type))
|
||||
master.RemoveElement(/datum/element/movetype_handler)
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
src.dry_result = dry_result
|
||||
|
||||
RegisterSignal(target, COMSIG_ITEM_DRIED, .proc/finish_drying)
|
||||
ADD_TRAIT(target, TRAIT_DRYABLE, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(target, TRAIT_DRYABLE, ELEMENT_TRAIT(type))
|
||||
|
||||
|
||||
/datum/element/dryable/Detach(datum/target)
|
||||
. = ..()
|
||||
UnregisterSignal(target, COMSIG_FOOD_CONSUMED)
|
||||
REMOVE_TRAIT(target, TRAIT_DRYABLE, ELEMENT_TRAIT)
|
||||
REMOVE_TRAIT(target, TRAIT_DRYABLE, ELEMENT_TRAIT(type))
|
||||
|
||||
/datum/element/dryable/proc/finish_drying(atom/source)
|
||||
SIGNAL_HANDLER
|
||||
@@ -26,7 +26,7 @@
|
||||
if(dry_result == dried_atom.type)//if the dried type is the same as our currrent state, don't bother creating a whole new item, just re-color it.
|
||||
var/atom/movable/resulting_atom = dried_atom
|
||||
resulting_atom.add_atom_colour("#ad7257", FIXED_COLOUR_PRIORITY)
|
||||
ADD_TRAIT(resulting_atom, TRAIT_DRIED, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(resulting_atom, TRAIT_DRIED, ELEMENT_TRAIT(type))
|
||||
resulting_atom.forceMove(source.drop_location())
|
||||
return
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
var/obj/item/stack/itemstack = dried_atom
|
||||
for(var/i in 1 to itemstack.amount)
|
||||
var/atom/movable/resulting_atom = new dry_result(source.drop_location())
|
||||
ADD_TRAIT(resulting_atom, TRAIT_DRIED, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(resulting_atom, TRAIT_DRIED, ELEMENT_TRAIT(type))
|
||||
qdel(source)
|
||||
return
|
||||
else
|
||||
var/atom/movable/resulting_atom = new dry_result(source.drop_location())
|
||||
ADD_TRAIT(resulting_atom, TRAIT_DRIED, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(resulting_atom, TRAIT_DRIED, ELEMENT_TRAIT(type))
|
||||
qdel(source)
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
master.add_filter("haunt_glow", 2, list("type" = "outline", "color" = "#f8f8ff", "size" = 1))
|
||||
master.ai_controller = new /datum/ai_controller/haunted(master)
|
||||
master.AddElement(/datum/element/movetype_handler)
|
||||
ADD_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type))
|
||||
|
||||
/datum/element/haunted/Detach(datum/source)
|
||||
. = ..()
|
||||
var/atom/movable/master = source
|
||||
master.remove_filter("haunt_glow")
|
||||
QDEL_NULL(master.ai_controller)
|
||||
REMOVE_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT)
|
||||
REMOVE_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type))
|
||||
master.RemoveElement(/datum/element/movetype_handler)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
SIGNAL_HANDLER
|
||||
if(HAS_TRAIT(source, TRAIT_HONKSPAMMING))
|
||||
return
|
||||
ADD_TRAIT(source, TRAIT_HONKSPAMMING, ELEMENT_TRAIT)
|
||||
ADD_TRAIT(source, TRAIT_HONKSPAMMING, ELEMENT_TRAIT(type))
|
||||
playsound(source.loc, 'sound/items/bikehorn.ogg', 50, TRUE)
|
||||
addtimer(TRAIT_CALLBACK_REMOVE(source, TRAIT_HONKSPAMMING, ELEMENT_TRAIT), 2 SECONDS)
|
||||
addtimer(TRAIT_CALLBACK_REMOVE(source, TRAIT_HONKSPAMMING, ELEMENT_TRAIT(type)), 2 SECONDS)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
if(!rust_overlay)
|
||||
rust_overlay = image(rust_icon, rust_icon)
|
||||
ADD_TRAIT(target, TRAIT_RUSTY, src)
|
||||
ADD_TRAIT(target, TRAIT_RUSTY, ELEMENT_TRAIT(type))
|
||||
RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/apply_rust_overlay)
|
||||
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/handle_examine)
|
||||
RegisterSignal(target, list(COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_WELDER), COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_RUSTSCRAPER)), .proc/secondary_tool_act)
|
||||
@@ -26,7 +26,7 @@
|
||||
UnregisterSignal(source, COMSIG_ATOM_UPDATE_OVERLAYS)
|
||||
UnregisterSignal(source, COMSIG_PARENT_EXAMINE)
|
||||
UnregisterSignal(source, list(COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_WELDER), COMSIG_ATOM_SECONDARY_TOOL_ACT(TOOL_RUSTSCRAPER)))
|
||||
REMOVE_TRAIT(source, TRAIT_RUSTY, src)
|
||||
REMOVE_TRAIT(source, TRAIT_RUSTY, ELEMENT_TRAIT(type))
|
||||
source.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/datum/element/rust/proc/handle_examine(datum/source, mob/user, list/examine_text)
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(new_stat == CONSCIOUS)
|
||||
ADD_TRAIT(target, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT)
|
||||
ADD_TRAIT(target, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type))
|
||||
else
|
||||
REMOVE_TRAIT(target, TRAIT_MOVE_FLYING, ROUNDSTART_TRAIT)
|
||||
REMOVE_TRAIT(target, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type))
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
if(surgeryinstance_notonmob.ignore_clothes || get_location_accessible(livingtarget, selected_zone))
|
||||
var/datum/surgery/procedure = new surgeryinstance_notonmob.type(livingtarget, selected_zone, affecting)
|
||||
ADD_TRAIT(livingtarget, TRAIT_ALLOWED_HONORBOUND_ATTACK, TRAIT_GENERIC)
|
||||
ADD_TRAIT(livingtarget, TRAIT_ALLOWED_HONORBOUND_ATTACK, ELEMENT_TRAIT(type))
|
||||
user.visible_message(span_notice("[user] drapes [source] over [livingtarget]'s [parse_zone(selected_zone)] to prepare for surgery."), \
|
||||
span_notice("You drape [source] over [livingtarget]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name]."))
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
if(the_surgery.status == 1)
|
||||
the_patient.surgeries -= the_surgery
|
||||
REMOVE_TRAIT(the_patient, TRAIT_ALLOWED_HONORBOUND_ATTACK, TRAIT_GENERIC)
|
||||
REMOVE_TRAIT(the_patient, TRAIT_ALLOWED_HONORBOUND_ATTACK, ELEMENT_TRAIT(type))
|
||||
user.visible_message(span_notice("[user] removes [the_item] from [the_patient]'s [parse_zone(selected_zone)]."), \
|
||||
span_notice("You remove [the_item] from [the_patient]'s [parse_zone(selected_zone)]."))
|
||||
qdel(the_surgery)
|
||||
@@ -137,7 +137,7 @@
|
||||
the_surgery.operated_bodypart.generic_bleedstacks -= 5
|
||||
|
||||
the_patient.surgeries -= the_surgery
|
||||
REMOVE_TRAIT(the_patient, TRAIT_ALLOWED_HONORBOUND_ATTACK, TRAIT_GENERIC)
|
||||
REMOVE_TRAIT(the_patient, TRAIT_ALLOWED_HONORBOUND_ATTACK, ELEMENT_TRAIT(type))
|
||||
user.visible_message(span_notice("[user] closes [the_patient]'s [parse_zone(selected_zone)] with [close_tool] and removes [the_item]."), \
|
||||
span_notice("You close [the_patient]'s [parse_zone(selected_zone)] with [close_tool] and remove [the_item]."))
|
||||
qdel(the_surgery)
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
var/mob/living/carbon/human/valid_target = target
|
||||
on_stat_change(valid_target, new_stat = valid_target.stat) //immediately try adding movement bonus if they're in soft crit
|
||||
RegisterSignal(target, COMSIG_MOB_STATCHANGE, .proc/on_stat_change)
|
||||
ADD_TRAIT(target, TRAIT_TENACIOUS, INNATE_TRAIT)
|
||||
ADD_TRAIT(target, TRAIT_TENACIOUS, ELEMENT_TRAIT(type))
|
||||
|
||||
/datum/element/tenacious/Detach(datum/target)
|
||||
UnregisterSignal(target, COMSIG_MOB_STATCHANGE)
|
||||
REMOVE_TRAIT(target, TRAIT_TENACIOUS, INNATE_TRAIT)
|
||||
REMOVE_TRAIT(target, TRAIT_TENACIOUS, ELEMENT_TRAIT(type))
|
||||
return ..()
|
||||
|
||||
///signal called by the stat of the target changing
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
RegisterSignal(target, COMSIG_TURF_MULTIZ_DEL, .proc/on_multiz_turf_del)
|
||||
RegisterSignal(target, COMSIG_TURF_MULTIZ_NEW, .proc/on_multiz_turf_new)
|
||||
|
||||
ADD_TRAIT(our_turf, TURF_Z_TRANSPARENT_TRAIT, TURF_TRAIT)
|
||||
ADD_TRAIT(our_turf, TURF_Z_TRANSPARENT_TRAIT, ELEMENT_TRAIT(type))
|
||||
|
||||
update_multiz(our_turf, TRUE, TRUE)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
var/turf/our_turf = source
|
||||
our_turf.vis_contents.len = 0
|
||||
UnregisterSignal(our_turf, list(COMSIG_TURF_MULTIZ_NEW, COMSIG_TURF_MULTIZ_DEL))
|
||||
REMOVE_TRAIT(our_turf, TURF_Z_TRANSPARENT_TRAIT, TURF_TRAIT)
|
||||
REMOVE_TRAIT(our_turf, TURF_Z_TRANSPARENT_TRAIT, ELEMENT_TRAIT(type))
|
||||
|
||||
///Updates the viscontents or underlays below this tile.
|
||||
/datum/element/turf_z_transparency/proc/update_multiz(turf/our_turf, prune_on_fail = FALSE, init = FALSE)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
if(covered)
|
||||
if(invisibility_trait)
|
||||
ADD_TRAIT(source, invisibility_trait, TRAIT_GENERIC)
|
||||
ADD_TRAIT(source, invisibility_trait, ELEMENT_TRAIT(type))
|
||||
if(tile_overlay)
|
||||
T.add_overlay(tile_overlay)
|
||||
if(use_alpha)
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
else
|
||||
if(invisibility_trait)
|
||||
REMOVE_TRAIT(source, invisibility_trait, TRAIT_GENERIC)
|
||||
REMOVE_TRAIT(source, invisibility_trait, ELEMENT_TRAIT(type))
|
||||
if(tile_overlay)
|
||||
T.overlays -= tile_overlay
|
||||
if(use_alpha)
|
||||
|
||||
Reference in New Issue
Block a user