mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Merge pull request #41711 from coiax/disk-verifier-trait
Added TRAIT_DISK_VERIFIER, refactors how fake disk checks work slightly
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#define TRAIT_PARALYSIS_R_ARM "para-r-arm"
|
||||
#define TRAIT_PARALYSIS_L_LEG "para-l-leg"
|
||||
#define TRAIT_PARALYSIS_R_LEG "para-r-leg"
|
||||
#define TRAIT_DISK_VERIFIER "disk-verifier"
|
||||
#define TRAIT_NOMOBSWAP "no-mob-swap"
|
||||
#define TRAIT_XRAY_VISION "xray_vision"
|
||||
|
||||
@@ -91,6 +92,7 @@
|
||||
#define SPECIES_TRAIT "species"
|
||||
#define ORGAN_TRAIT "organ"
|
||||
#define ROUNDSTART_TRAIT "roundstart" //cannot be removed without admin intervention
|
||||
#define JOB_TRAIT "job"
|
||||
|
||||
// unique trait sources, still defines
|
||||
#define STATUE_MUTE "statue"
|
||||
@@ -104,3 +106,5 @@
|
||||
#define EYES_COVERED "eyes_covered"
|
||||
#define CULT_EYES "cult_eyes"
|
||||
#define SCRYING_ORB "scrying-orb"
|
||||
#define NUKEOP_TRAIT "nuke-op"
|
||||
#define DEATHSQUAD_TRAIT "deathsquad"
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/datum/proc/add_trait(trait, source)
|
||||
LAZYINITLIST(status_traits)
|
||||
|
||||
|
||||
if(!status_traits[trait])
|
||||
status_traits[trait] = list(source)
|
||||
else
|
||||
status_traits[trait] |= list(source)
|
||||
|
||||
|
||||
|
||||
/datum/proc/remove_trait(trait, list/sources, force)
|
||||
if(!status_traits)
|
||||
return //nothing to remove
|
||||
|
||||
|
||||
if(!status_traits[trait])
|
||||
return
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
|
||||
if(!LAZYLEN(status_traits[trait]))
|
||||
status_traits -= trait
|
||||
|
||||
|
||||
/datum/proc/has_trait(trait, list/sources)
|
||||
if(!status_traits)
|
||||
return FALSE //well of course it doesn't have the trait
|
||||
|
||||
|
||||
if(!status_traits[trait])
|
||||
return FALSE
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
return TRUE
|
||||
else if(LAZYLEN(status_traits[trait]))
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/proc/remove_all_traits(remove_species_traits = FALSE, remove_organ_traits = FALSE, remove_quirks = FALSE)
|
||||
if(!status_traits)
|
||||
return //nothing to remove
|
||||
|
||||
|
||||
var/list/blacklisted_sources = list()
|
||||
if(!remove_species_traits)
|
||||
blacklisted_sources += SPECIES_TRAIT
|
||||
@@ -72,4 +72,4 @@
|
||||
break
|
||||
if(!skip)
|
||||
remove_trait(kebab, null, TRUE)
|
||||
CHECK_TICK
|
||||
CHECK_TICK
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
. = ..()
|
||||
name_source = GLOB.commando_names
|
||||
|
||||
/datum/antagonist/ert/deathsquad/apply_innate_effects(mob/living/mob_override)
|
||||
owner.add_trait(TRAIT_DISK_VERIFIER, DEATHSQUAD_TRAIT)
|
||||
|
||||
/datum/antagonist/ert/deathsquad/remove_innate_effects(mob/living/mob_override)
|
||||
owner.remove_trait(TRAIT_DISK_VERIFIER, DEATHSQUAD_TRAIT)
|
||||
|
||||
/datum/antagonist/ert/security // kinda handled by the base template but here for completion
|
||||
|
||||
/datum/antagonist/ert/security/red
|
||||
|
||||
@@ -600,10 +600,7 @@ This is here to make the tiles around the station mininuke change when it's arme
|
||||
if(!fake)
|
||||
return
|
||||
|
||||
var/ghost = isobserver(user)
|
||||
var/captain = user.mind && user.mind.assigned_role == "Captain"
|
||||
var/nukie = user.mind && user.mind.has_antag_datum(/datum/antagonist/nukeop)
|
||||
if(ghost || captain || nukie)
|
||||
if(isobserver(user) || user.has_trait(TRAIT_DISK_VERIFIER) || (user.mind && user.mind.has_trait(TRAIT_DISK_VERIFIER)))
|
||||
to_chat(user, "<span class='warning'>The serial numbers on [src] are incorrect.</span>")
|
||||
|
||||
/obj/item/disk/nuclear/attackby(obj/item/I, mob/living/user, params)
|
||||
@@ -642,3 +639,7 @@ This is here to make the tiles around the station mininuke change when it's arme
|
||||
|
||||
/obj/item/disk/nuclear/fake
|
||||
fake = TRUE
|
||||
|
||||
/obj/item/disk/nuclear/fake/obvious
|
||||
name = "cheap plastic imitation of the nuclear authentication disk"
|
||||
desc = "How anyone could mistake this for the real thing is beyond you."
|
||||
|
||||
@@ -23,10 +23,12 @@
|
||||
/datum/antagonist/nukeop/apply_innate_effects(mob/living/mob_override)
|
||||
var/mob/living/M = mob_override || owner.current
|
||||
update_synd_icons_added(M)
|
||||
owner.add_trait(TRAIT_DISK_VERIFIER, NUKEOP_TRAIT)
|
||||
|
||||
/datum/antagonist/nukeop/remove_innate_effects(mob/living/mob_override)
|
||||
var/mob/living/M = mob_override || owner.current
|
||||
update_synd_icons_removed(M)
|
||||
owner.remove_trait(TRAIT_DISK_VERIFIER, NUKEOP_TRAIT)
|
||||
|
||||
/datum/antagonist/nukeop/proc/equip_op()
|
||||
if(!ishuman(owner.current))
|
||||
@@ -42,7 +44,6 @@
|
||||
owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/ops.ogg',100,0)
|
||||
to_chat(owner, "<span class='notice'>You are a [nuke_team ? nuke_team.syndicate_name : "syndicate"] agent!</span>")
|
||||
owner.announce_objectives()
|
||||
return
|
||||
|
||||
/datum/antagonist/nukeop/on_gain()
|
||||
give_alias()
|
||||
|
||||
@@ -26,6 +26,9 @@ Captain
|
||||
/datum/job/captain/get_access()
|
||||
return get_all_accesses()
|
||||
|
||||
/datum/job/captain/after_spawn(mob/living/H, mob/M, latejoin = FALSE)
|
||||
H.mind.add_trait(TRAIT_DISK_VERIFIER, JOB_TRAIT)
|
||||
|
||||
/datum/job/captain/announce(mob/living/carbon/human/H)
|
||||
..()
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, .proc/minor_announce, "Captain [H.real_name] on deck!"))
|
||||
|
||||
Reference in New Issue
Block a user