From fd4c753a045304a34f83a3f7879374d0a751eb2a Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Wed, 2 May 2018 21:13:41 +0300 Subject: [PATCH] replaces BANG_PROTECT_2 with a component, also kills OMNITONGUE_2 and flags_2 (#37597) * kill BANG_PROTECT_2 * let's put this back in * dirty * kill OMNITONGUE_2 This is a write-only variable, probably leftover from some refactor years ago * kill flags_2 --- code/__DEFINES/components.dm | 3 ++ code/__DEFINES/flags.dm | 34 +++++-------------- code/_globalvars/bitfields.dm | 10 ++---- code/datums/components/earprotection.dm | 11 ++++++ code/datums/components/material_container.dm | 2 +- code/datums/components/signal_redirect.dm | 1 + code/game/atoms.dm | 3 +- .../objects/items/devices/radio/headset.dm | 25 +++++++++++--- .../game/objects/items/devices/radio/radio.dm | 4 +-- code/game/objects/items/grenades/plastic.dm | 7 ++-- .../abductor/equipment/abduction_gear.dm | 5 ++- .../antagonists/wizard/equipment/spellbook.dm | 2 +- code/modules/cargo/exports.dm | 2 +- code/modules/clothing/ears/_ears.dm | 2 +- code/modules/clothing/head/helmet.dm | 10 ++++-- code/modules/crafting/craft.dm | 4 +-- code/modules/events/sentience.dm | 3 +- code/modules/holodeck/area_copy.dm | 2 +- .../mob/living/carbon/carbon_defense.dm | 9 +++-- .../mob/living/carbon/human/human_defense.dm | 2 +- code/modules/mob/living/living_defense.dm | 2 +- .../mob/living/silicon/pai/software.dm | 11 +++--- .../hostile/megafauna/colossus.dm | 2 +- code/modules/power/tesla/energy_ball.dm | 2 +- code/modules/projectiles/projectile/magic.dm | 3 +- .../research/xenobiology/xenobiology.dm | 2 +- tgstation.dme | 1 + 27 files changed, 87 insertions(+), 77 deletions(-) create mode 100644 code/datums/components/earprotection.dm diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 1650fbf0ebf..198b4373716 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -87,6 +87,9 @@ #define COMSIG_MOVABLE_THROW "movable_throw" //from base of atom/movable/throw_at(): (datum/thrownthing, spin) #define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit" //from base of atom/movable/onTransitZ(): (old_z, new_z) +// /mob/living/carbon signals +#define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity)) + // /obj signals #define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 2f4ae3d78fc..5e0669880c7 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -14,34 +14,19 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define NODROP_1 (1<<1) // This flag makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted. #define NOBLUDGEON_1 (1<<2) // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby() - -#define HEAR_1 (1<<4) // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not. -#define CHECK_RICOCHET_1 (1<<5) // Projectiels will check ricochet on things impacted that have this. -#define CONDUCT_1 (1<<6) // conducts electricity (metal etc.) -#define ABSTRACT_1 (1<<7) // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way +#define HEAR_1 (1<<3) // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not. +#define CHECK_RICOCHET_1 (1<<4) // Projectiels will check ricochet on things impacted that have this. +#define CONDUCT_1 (1<<5) // conducts electricity (metal etc.) +#define ABSTRACT_1 (1<<6) // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way #define NODECONSTRUCT_1 (1<<7) // For machines and structures that should not break into parts, eg, holodeck stuff #define OVERLAY_QUEUED_1 (1<<8) // atom queued to SSoverlay #define ON_BORDER_1 (1<<9) // item has priority to check when entering or leaving +#define DROPDEL_1 (1<<10) // When dropped, it calls qdel on itself +#define PREVENT_CLICK_UNDER_1 (1<<11) //Prevent clicking things below it on the same turf eg. doors/ fulltile windows +#define NO_EMP_WIRES_1 (1<<12) +#define HOLOGRAM_1 (1<<13) +#define TESLA_IGNORE_1 (1<<14) // TESLA_IGNORE grants immunity from being targeted by tesla-style electricity -#define DROPDEL_1 (1<<14) // When dropped, it calls qdel on itself -#define PREVENT_CLICK_UNDER_1 (1<<15) //Prevent clicking things below it on the same turf eg. doors/ fulltile windows - -/* Secondary atom flags, for the flags_2 var, denoted with a _2 */ - - -#define NO_EMP_WIRES_2 (1<<1) -#define HOLOGRAM_2 (1<<2) - -#define BANG_PROTECT_2 (1<<6) - -// A mob with OMNITONGUE has no restriction in the ability to speak -// languages that they know. So even if they wouldn't normally be able to -// through mob or tongue restrictions, this flag allows them to ignore -// those restrictions. -#define OMNITONGUE_2 (1<<8) - -// TESLA_IGNORE grants immunity from being targeted by tesla-style electricity -#define TESLA_IGNORE_2 (1<<9) //turf-only flags #define NOJAUNT_1 (1<<0) @@ -50,7 +35,6 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define NO_DEATHRATTLE_1 (1<<4) // Do not notify deadchat about any deaths that occur on this turf. #define NO_RUINS_1 (1<<5) //Blocks ruins spawning on the turf #define NO_LAVA_GEN_1 (1<<6) //Blocks lava rivers being generated on the turf -//#define CHECK_RICOCHET_1 32 //Same thing as atom flag. /* These defines are used specifically with the atom/pass_flags bitmask diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 1e23eef04f3..a5270a8aded 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -118,13 +118,9 @@ GLOBAL_LIST_INIT(bitfields, list( "ABSTRACT_1" = ABSTRACT_1, "NODECONSTRUCT_1" = NODECONSTRUCT_1, "OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1, - ), - "flags_2" = list( - "NO_EMP_WIRES_2" = NO_EMP_WIRES_2, - "HOLOGRAM_2" = HOLOGRAM_2, - "BANG_PROTECT_2" = BANG_PROTECT_2, - "OMNITONGUE_2" = OMNITONGUE_2, - "TESLA_IGNORE_2" = TESLA_IGNORE_2 + "NO_EMP_WIRES_1" = NO_EMP_WIRES_1, + "HOLOGRAM_1" = HOLOGRAM_1, + "TESLA_IGNORE_1" = TESLA_IGNORE_1 ), "clothing_flags" = list( "LAVAPROTECT" = LAVAPROTECT, diff --git a/code/datums/components/earprotection.dm b/code/datums/components/earprotection.dm new file mode 100644 index 00000000000..f00b372218f --- /dev/null +++ b/code/datums/components/earprotection.dm @@ -0,0 +1,11 @@ +/datum/component/wearertargeting/earprotection + signals = list(COMSIG_CARBON_SOUNDBANG) + mobtype = /mob/living/carbon + +/datum/component/wearertargeting/earprotection/Initialize(_valid_slots) + . = ..() + valid_slots = _valid_slots + callback = CALLBACK(src, .proc/reducebang) + +/datum/component/wearertargeting/earprotection/proc/reducebang(list/reflist) + reflist[1]-- diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index 37154e22825..500e51dccb6 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -53,7 +53,7 @@ var/list/tc = allowed_typecache if(user.a_intent != INTENT_HELP) return - if((I.flags_2 & HOLOGRAM_2) || (I.item_flags & NO_MAT_REDEMPTION) || (tc && !is_type_in_typecache(I, tc))) + if((I.flags_1 & HOLOGRAM_1) || (I.item_flags & NO_MAT_REDEMPTION) || (tc && !is_type_in_typecache(I, tc))) to_chat(user, "[parent] won't accept [I]!") return . = COMPONENT_NO_AFTERATTACK diff --git a/code/datums/components/signal_redirect.dm b/code/datums/components/signal_redirect.dm index 764a44e4a95..f259b447fa1 100644 --- a/code/datums/components/signal_redirect.dm +++ b/code/datums/components/signal_redirect.dm @@ -4,5 +4,6 @@ /datum/component/redirect/Initialize(list/signals, datum/callback/_callback) //It's not our job to verify the right signals are registered here, just do it. if(!LAZYLEN(signals) || !istype(_callback)) + warning("signals are [list2params(signals)], callback is [_callback]]") return COMPONENT_INCOMPATIBLE RegisterSignal(signals, _callback) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 6b4e8822359..c308aec45ff 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -4,7 +4,6 @@ var/level = 2 var/flags_1 = NONE - var/flags_2 = NONE var/interaction_flags_atom = NONE var/container_type = NONE var/admin_spawned = 0 //was this spawned by an admin? used for stat tracking stuff. @@ -223,7 +222,7 @@ /atom/proc/emp_act(severity) SendSignal(COMSIG_ATOM_EMP_ACT, severity) - if(istype(wires) && !(flags_2 & NO_EMP_WIRES_2)) + if(istype(wires) && !(flags_1 & NO_EMP_WIRES_1)) wires.emp_pulse() /atom/proc/bullet_act(obj/item/projectile/P, def_zone) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index f7caacf8163..ea9c6fb99e4 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -50,7 +50,10 @@ desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs. \nTo access the syndicate channel, use ; before speaking." icon_state = "syndie_headset" item_state = "syndie_headset" - flags_2 = BANG_PROTECT_2 | NO_EMP_WIRES_2 + +/obj/item/radio/headset/syndicate/alt/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) /obj/item/radio/headset/syndicate/alt/leader name = "team leader headset" @@ -78,7 +81,10 @@ desc = "This is used by your elite security force. Protects ears from flashbangs.\nTo access the security channel, use :s." icon_state = "sec_headset_alt" item_state = "sec_headset_alt" - flags_2 = BANG_PROTECT_2 | NO_EMP_WIRES_2 + +/obj/item/radio/headset/headset_sec/alt/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) /obj/item/radio/headset/headset_eng name = "engineering radio headset" @@ -130,7 +136,10 @@ desc = "The headset of the boss. Protects ears from flashbangs.\nChannels are as follows: :c - command, :s - security, :e - engineering, :u - supply, :v - service, :m - medical, :n - science." icon_state = "com_headset_alt" item_state = "com_headset_alt" - flags_2 = BANG_PROTECT_2 | NO_EMP_WIRES_2 + +/obj/item/radio/headset/heads/captain/alt/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) /obj/item/radio/headset/heads/rd name = "\proper the research director's headset" @@ -149,7 +158,10 @@ desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs.\nTo access the security channel, use :s. For command, use :c." icon_state = "com_headset_alt" item_state = "com_headset_alt" - flags_2 = BANG_PROTECT_2 | NO_EMP_WIRES_2 + +/obj/item/radio/headset/heads/hos/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) /obj/item/radio/headset/heads/ce name = "\proper the chief engineer's headset" @@ -207,7 +219,10 @@ icon_state = "cent_headset_alt" item_state = "cent_headset_alt" keyslot = null - flags_2 = BANG_PROTECT_2 | NO_EMP_WIRES_2 + +/obj/item/radio/headset/headset_cent/alt/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) /obj/item/radio/headset/ai name = "\proper Integrated Subspace Transceiver " diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 010372c5c1e..93f315a972c 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -6,8 +6,7 @@ desc = "A basic handheld radio that communicates with local telecommunication networks." dog_fashion = /datum/dog_fashion/back - flags_1 = CONDUCT_1 | HEAR_1 - flags_2 = NO_EMP_WIRES_2 + flags_1 = CONDUCT_1 | HEAR_1 | NO_EMP_WIRES_1 slot_flags = ITEM_SLOT_BELT throw_speed = 3 throw_range = 7 @@ -365,7 +364,6 @@ name = "cyborg radio" subspace_switchable = TRUE dog_fashion = null - flags_2 = NO_EMP_WIRES_2 /obj/item/radio/borg/Initialize(mapload) . = ..() diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 967d1ce372a..a7d06be284a 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -5,8 +5,7 @@ item_state = "plastic-explosive" lefthand_file = 'icons/mob/inhands/weapons/bombs_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi' - flags_1 = NOBLUDGEON_1 - flags_2 = NO_EMP_WIRES_2 + flags_1 = NOBLUDGEON_1 | NO_EMP_WIRES_1 det_time = 10 display_timer = 0 w_class = WEIGHT_CLASS_SMALL @@ -107,10 +106,10 @@ if(!user.temporarilyRemoveItemFromInventory(src)) return target = AM - + message_admins("[ADMIN_LOOKUPFLW(user)] planted [name] on [target.name] at [ADMIN_COORDJMP(target)] with [det_time] second fuse",0,1) log_game("[key_name(user)] planted [name] on [target.name] at [COORD(src)] with [det_time] second fuse") - + moveToNullspace() //Yep if(istype(AM, /obj/item)) //your crappy throwing star can't fly so good with a giant brick of c4 on it. diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 9ad695aa8b9..c282e48b398 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -620,12 +620,15 @@ Congratulations! You are now trained for invasive xenobiology research!"} icon_state = "abductor_headset" item_state = "abductor_headset" keyslot2 = new /obj/item/encryptionkey/heads/captain - flags_2 = BANG_PROTECT_2 /obj/item/radio/headset/abductor/Initialize(mapload) . = ..() make_syndie() +/obj/item/radio/headset/abductor/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) + /obj/item/radio/headset/abductor/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/screwdriver)) return // Stops humans from disassembling abductor headsets. diff --git a/code/modules/antagonists/wizard/equipment/spellbook.dm b/code/modules/antagonists/wizard/equipment/spellbook.dm index 4c34d9eb0bb..3f94c654371 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook.dm @@ -217,7 +217,7 @@ /datum/spellbook_entry/lightningbolt/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) //return 1 on success . = ..() - user.flags_2 |= TESLA_IGNORE_2 + user.flags_1 |= TESLA_IGNORE_1 /datum/spellbook_entry/infinite_guns name = "Lesser Summon Guns" diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index b4c0aa350df..702abf2a128 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -115,7 +115,7 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they return FALSE if(!get_cost(O, contr, emag)) return FALSE - if(O.flags_2 & HOLOGRAM_2) + if(O.flags_1 & HOLOGRAM_1) return FALSE return TRUE diff --git a/code/modules/clothing/ears/_ears.dm b/code/modules/clothing/ears/_ears.dm index 56797e26bda..1dcaeb35fa4 100644 --- a/code/modules/clothing/ears/_ears.dm +++ b/code/modules/clothing/ears/_ears.dm @@ -15,11 +15,11 @@ strip_delay = 15 equip_delay_other = 25 resistance_flags = FLAMMABLE - flags_2 = BANG_PROTECT_2 /obj/item/clothing/ears/earmuffs/ComponentInitialize() . = ..() AddComponent(/datum/component/earhealing) + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS)) /obj/item/clothing/ears/headphones name = "headphones" diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 6f25c44858b..f68dfd54046 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -13,10 +13,13 @@ resistance_flags = NONE flags_cover = HEADCOVERSEYES flags_inv = HIDEHAIR - flags_2 = BANG_PROTECT_2 dog_fashion = /datum/dog_fashion/head/helmet +/obj/item/clothing/head/helmet/ComponentInitialize() + . = ..() + AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_HEAD)) + /obj/item/clothing/head/helmet/sec can_flashlight = 1 @@ -203,11 +206,12 @@ flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH strip_delay = 80 dog_fashion = null - // old knight helmets do not offer protection against loud noises - flags_2 = NONE + /obj/item/clothing/head/helmet/knight/Initialize(mapload) . = ..() + var/datum/component = GetComponent(/datum/component/wearertargeting/earprotection) + qdel(component) /obj/item/clothing/head/helmet/knight/blue icon_state = "knight_blue" diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index 1fe1f7bac61..7d309bd9c70 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -84,7 +84,7 @@ if(T.Adjacent(user)) for(var/B in T) var/atom/movable/AM = B - if(AM.flags_2 & HOLOGRAM_2) + if(AM.flags_1 & HOLOGRAM_1) continue . += AM @@ -93,7 +93,7 @@ .["tool_behaviour"] = list() .["other"] = list() for(var/obj/item/I in get_environment(user)) - if(I.flags_2 & HOLOGRAM_2) + if(I.flags_1 & HOLOGRAM_1) continue if(istype(I, /obj/item/stack)) var/obj/item/stack/S = I diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm index b4b939fdbac..55d8ce8b142 100644 --- a/code/modules/events/sentience.dm +++ b/code/modules/events/sentience.dm @@ -50,8 +50,7 @@ SA.key = SG.key - SA.grant_language(/datum/language/common) - SA.flags_2 |= OMNITONGUE_2 + SA.grant_all_languages(TRUE) SA.sentience_act() diff --git a/code/modules/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm index fee60605e3e..8edc7090e43 100644 --- a/code/modules/holodeck/area_copy.dm +++ b/code/modules/holodeck/area_copy.dm @@ -36,7 +36,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("tag", "datum_components", "area" M.power_change() if(holoitem) - O.flags_2 |= HOLOGRAM_2 + O.flags_1 |= HOLOGRAM_1 return O diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index ffea08a030d..dd942f1aeb4 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -24,10 +24,6 @@ /mob/living/carbon/get_ear_protection() var/number = ..() - if(ears && (ears.flags_2 & BANG_PROTECT_2)) - number += 1 - if(head && (head.flags_2 & BANG_PROTECT_2)) - number += 1 var/obj/item/organ/ears/E = getorganslot(ORGAN_SLOT_EARS) if(!E) number = INFINITY @@ -213,7 +209,7 @@ ..() /mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - if(tesla_shock && (flags_2 & TESLA_IGNORE_2)) + if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) return FALSE if(has_trait(TRAIT_SHOCKIMMUNE)) return FALSE @@ -327,6 +323,9 @@ /mob/living/carbon/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15) + var/list/reflist = list(intensity) // Need to wrap this in a list so we can pass a reference + SendSignal(COMSIG_CARBON_SOUNDBANG, reflist) + intensity = reflist[1] var/ear_safety = get_ear_protection() var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS) var/effect_amount = intensity - ear_safety diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 050a4f6d098..2e254e03790 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -448,7 +448,7 @@ else if(S.siemens_coefficient == (-1)) total_coeff -= 1 siemens_coeff = total_coeff - if(flags_2 & TESLA_IGNORE_2) + if(flags_1 & TESLA_IGNORE_1) siemens_coeff = 0 else if(!safety) var/gloves_siemens_coeff = 1 diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 2b2e0de0b3a..4a4cb6fc5f5 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -302,7 +302,7 @@ return 1 /mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0, illusion = 0, stun = TRUE) - if(tesla_shock && (flags_2 & TESLA_IGNORE_2)) + if(tesla_shock && (flags_1 & TESLA_IGNORE_1)) return FALSE if(has_trait(TRAIT_SHOCKIMMUNE)) return FALSE diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index b841ae95db7..c98a7b56454 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -251,8 +251,7 @@ med.remove_hud_from(src) if("translator") if(href_list["toggle"]) - if(!(flags_2 & OMNITONGUE_2)) - grant_all_languages(TRUE) + grant_all_languages(TRUE) // this is PERMAMENT. if("doorjack") if(href_list["jack"]) @@ -311,8 +310,8 @@ if(s == "medical HUD") dat += "Medical Analysis Suite[(medHUD) ? " On" : " Off"]
" if(s == "universal translator") - var/translator_on = (flags_2 & OMNITONGUE_2) - dat += "Universal Translator[translator_on ? " On" : " Off"]
" + var/datum/language_holder/H = get_language_holder() + dat += "Universal Translator[H.omnitongue ? " On" : " Off"]
" if(s == "projection array") dat += "Projection Array
" if(s == "camera jack") @@ -463,10 +462,10 @@ // Universal Translator /mob/living/silicon/pai/proc/softwareTranslator() - var/translator_on = (flags_2 & OMNITONGUE_2) + var/datum/language_holder/H = get_language_holder() . = {"

Universal Translator


When enabled, this device will permamently be able to speak and understand all known forms of communication.

- The device is currently [translator_on ? "en" : "dis" ]abled.
[translator_on ? "" : "Activate Translation Module
"]"} + The device is currently [H.omnitongue ? "en" : "dis" ]abled.
[H.omnitongue ? "" : "Activate Translation Module
"]"} return . // Security HUD diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 6e536884703..c9fafe1bc69 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -671,7 +671,7 @@ Difficulty: Very Hard for(var/i in T) if(isitem(i) && !is_type_in_typecache(i, banned_items_typecache)) var/obj/item/W = i - if(!W.admin_spawned && !(W.flags_2 & HOLOGRAM_2) && !(W.flags_1 & ABSTRACT_1)) + if(!W.admin_spawned && !(W.flags_1 & HOLOGRAM_1) && !(W.flags_1 & ABSTRACT_1)) L += W if(L.len) var/obj/item/CHOSEN = pick(L) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 6b50b5e321f..9cdcd088109 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -221,7 +221,7 @@ else if(isliving(A)) var/dist = get_dist(source, A) var/mob/living/L = A - if(dist <= zap_range && (dist < closest_dist || !closest_mob) && L.stat != DEAD && !(L.flags_2 & TESLA_IGNORE_2)) + if(dist <= zap_range && (dist < closest_dist || !closest_mob) && L.stat != DEAD && !(L.flags_1 & TESLA_IGNORE_1)) closest_mob = L closest_atom = A closest_dist = dist diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 803167484c1..d717cbf6804 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -164,7 +164,7 @@ Robot.mmi.transfer_identity(M) //Does not transfer key/client. Robot.clear_inherent_laws(0) Robot.clear_zeroth_law(0) - + if("slime") new_mob = new /mob/living/simple_animal/slime/random(M.loc) @@ -231,7 +231,6 @@ if(!new_mob) return new_mob.grant_language(/datum/language/common) - new_mob.flags_2 |= OMNITONGUE_2 new_mob.logging = M.logging // Some forms can still wear some items diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 5e339077202..a5998400c82 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -679,7 +679,7 @@ SM.sentience_act() to_chat(SM, "All at once it makes sense: you know what you are and who you are! Self awareness is yours!") to_chat(SM, "You are grateful to be self aware and owe [user.real_name] a great debt. Serve [user.real_name], and assist [user.p_them()] in completing [user.p_their()] goals at any cost.") - if(SM.flags_2 & HOLOGRAM_2) //Check to see if it's a holodeck creature + if(SM.flags_1 & HOLOGRAM_1) //Check to see if it's a holodeck creature to_chat(SM, "You also become depressingly aware that you are not a real creature, but instead a holoform. Your existence is limited to the parameters of the holodeck.") to_chat(user, "[SM] accepts [src] and suddenly becomes attentive and aware. It worked!") SM.copy_known_languages_from(user, FALSE) diff --git a/tgstation.dme b/tgstation.dme index 0242d2c56b5..0bc9f2a07f4 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -315,6 +315,7 @@ #include "code\datums\components\construction.dm" #include "code\datums\components\decal.dm" #include "code\datums\components\earhealing.dm" +#include "code\datums\components\earprotection.dm" #include "code\datums\components\forensics.dm" #include "code\datums\components\infective.dm" #include "code\datums\components\jousting.dm"