Merge pull request #6621 from Citadel-Station-13/upstream-merge-37597

[MIRROR] replaces BANG_PROTECT_2 with a component, also kills OMNITONGUE_2 and flags_2
This commit is contained in:
LetterJay
2018-05-23 06:44:50 -05:00
committed by GitHub
28 changed files with 803 additions and 793 deletions

View File

@@ -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)

View File

@@ -10,36 +10,23 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define DF_USE_TAG (1<<0)
#define DF_VAR_EDITED (1<<1)
//FLAGS BITMASK
#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)
@@ -48,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

View File

@@ -118,13 +118,8 @@ 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
"HOLOGRAM_1" = HOLOGRAM_1,
"TESLA_IGNORE_1" = TESLA_IGNORE_1
),
"clothing_flags" = list(
"LAVAPROTECT" = LAVAPROTECT,

View File

@@ -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]--

View File

@@ -58,7 +58,7 @@
return
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, "<span class='warning'>[parent] won't accept [I]!</span>")
return
. = COMPONENT_NO_AFTERATTACK

View File

@@ -4,6 +4,7 @@
/datum/component/redirect/Initialize(list/signals, datum/callback/_callback, flags=NONE)
//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
if(flags & REDIRECT_TRANSFER_WITH_TURF && isturf(parent))
RegisterSignal(COMSIG_TURF_CHANGE, .proc/turf_change)

View File

@@ -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)

View File

@@ -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 "

View File

@@ -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)
. = ..()

View File

@@ -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.

View File

@@ -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.

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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"

View File

@@ -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
@@ -211,11 +214,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"

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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
@@ -224,7 +220,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
@@ -350,6 +346,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

View File

@@ -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

View File

@@ -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

View File

@@ -252,8 +252,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"])
@@ -312,8 +311,8 @@
if(s == "medical HUD")
dat += "<a href='byond://?src=[REF(src)];software=medicalhud;sub=0'>Medical Analysis Suite</a>[(medHUD) ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
if(s == "universal translator")
var/translator_on = (flags_2 & OMNITONGUE_2)
dat += "<a href='byond://?src=[REF(src)];software=translator;sub=0'>Universal Translator</a>[translator_on ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
var/datum/language_holder/H = get_language_holder()
dat += "<a href='byond://?src=[REF(src)];software=translator;sub=0'>Universal Translator</a>[H.omnitongue ? "<font color=#55FF55> On</font>" : "<font color=#FF5555> Off</font>"] <br>"
if(s == "projection array")
dat += "<a href='byond://?src=[REF(src)];software=projectionarray;sub=0'>Projection Array</a> <br>"
if(s == "camera jack")
@@ -464,10 +463,10 @@
// Universal Translator
/mob/living/silicon/pai/proc/softwareTranslator()
var/translator_on = (flags_2 & OMNITONGUE_2)
var/datum/language_holder/H = get_language_holder()
. = {"<h3>Universal Translator</h3><br>
When enabled, this device will permamently be able to speak and understand all known forms of communication.<br><br>
The device is currently [translator_on ? "<font color=#55FF55>en" : "<font color=#FF5555>dis" ]abled.</font><br>[translator_on ? "" : "<a href='byond://?src=[REF(src)];software=translator;sub=0;toggle=1'>Activate Translation Module</a><br>"]"}
The device is currently [H.omnitongue ? "<font color=#55FF55>en" : "<font color=#FF5555>dis" ]abled.</font><br>[H.omnitongue ? "" : "<a href='byond://?src=[REF(src)];software=translator;sub=0;toggle=1'>Activate Translation Module</a><br>"]"}
return .
// Security HUD

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -679,7 +679,7 @@
SM.sentience_act()
to_chat(SM, "<span class='warning'>All at once it makes sense: you know what you are and who you are! Self awareness is yours!</span>")
to_chat(SM, "<span class='userdanger'>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.</span>")
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, "<span class='userdanger'>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.</span>")
to_chat(user, "<span class='notice'>[SM] accepts [src] and suddenly becomes attentive and aware. It worked!</span>")
SM.copy_known_languages_from(user, FALSE)

View File

@@ -442,7 +442,6 @@
/obj/item/twohanded/hypereutactic/toy/rainbow
name = "\improper Hyper-Euclidean Reciprocating Trigonometric Zweihander"
desc = "A custom-built toy with fancy rainbow lights built-in."
flags_2 = NONE
var/list/rainbow_colors = list("#FF0000", "#FFFF00", "#00FF00", "#00FFFF", "#0000FF","#FF00FF", "#3399ff", "#ff9900", "#fb008b", "#9800ff", "#00ffa3", "#ccff00")
/obj/item/twohanded/hypereutactic/toy/rainbow/process()

View File

@@ -326,6 +326,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"