From 7cb9ba1b20b14644d17bff16ed438582458dd03c Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Thu, 23 Jan 2025 02:51:12 +0500 Subject: [PATCH 01/24] stage_one save for branch change --- code/__DEFINES/factions.dm | 33 +++ code/__DEFINES/mode.dm | 2 + code/_globalvars/global_lists.dm | 22 -- code/_onclick/item_attack.dm | 2 +- code/datums/components/iff_fire_prevention.dm | 2 +- code/datums/event_info_text.dm | 72 +++--- code/datums/factions/clf.dm | 1 - code/datums/factions/cmb.dm | 1 - code/datums/factions/contractor.dm | 1 - code/datums/factions/faction.dm | 120 +++++++++- code/datums/factions/faction_modules.dm | 3 + code/datums/factions/helpers.dm | 20 +- code/datums/factions/iff_tag.dm | 207 ++++++++++++++++++ code/datums/factions/nspa.dm | 1 - code/datums/factions/pmc.dm | 1 - code/datums/factions/relations_datum.dm | 61 ++++++ code/datums/factions/royalmarinescommando.dm | 1 - code/datums/factions/upp.dm | 1 - code/datums/factions/uscm.dm | 1 - code/datums/factions/wy.dm | 1 - code/datums/mob_hud.dm | 5 +- code/datums/pain/_pain.dm | 7 +- .../datums/statistics/entities/death_stats.dm | 2 +- code/game/bioscans.dm | 5 +- code/game/gamemodes/cm_initialize.dm | 49 +++-- .../colonialmarines/colonialmarines.dm | 43 ++-- code/game/gamemodes/game_mode.dm | 14 ++ code/game/jobs/job/job.dm | 2 - code/game/jobs/role_authority.dm | 48 ++-- code/game/machinery/telecomms/presets.dm | 4 +- .../antag/antag_guns_snowflake.dm | 18 +- .../vendor_types/antag/antag_guns_sorted.dm | 18 +- .../objects/effects/landmarks/landmarks.dm | 52 +++-- code/modules/admin/admin_verbs.dm | 4 +- .../admin/player_panel/actions/physical.dm | 14 +- code/modules/admin/tabs/event_tab.dm | 32 ++- code/modules/admin/topic/topic.dm | 2 +- code/modules/admin/topic/topic_teleports.dm | 86 +++----- code/modules/admin/verbs/custom_event.dm | 35 +-- code/modules/admin/verbs/debug.dm | 8 +- code/modules/admin/verbs/mob_verbs.dm | 36 ++- code/modules/admin/verbs/select_equipment.dm | 10 +- code/modules/client/client_procs.dm | 16 +- .../modules/gear_presets/_select_equipment.dm | 23 +- code/modules/gear_presets/upp.dm | 1 - .../mob/living/carbon/carbon_defines.dm | 2 +- .../mob/living/carbon/human/species/zombie.dm | 3 - .../living/simple_animal/hostile/hostile.dm | 2 +- code/modules/mob/login.dm | 11 +- code/modules/mob/mob.dm | 9 +- code/modules/mob/mob_defines.dm | 5 +- code/modules/projectiles/gun_helpers.dm | 12 +- code/modules/projectiles/guns/smartgun.dm | 2 +- code/modules/projectiles/projectile.dm | 2 +- code/modules/vehicles/multitile/multitile.dm | 2 + .../vehicles/multitile/multitile_bump.dm | 6 +- .../multitile/multitile_interaction.dm | 8 +- colonialmarines.dme | 5 +- 58 files changed, 756 insertions(+), 400 deletions(-) create mode 100644 code/__DEFINES/factions.dm create mode 100644 code/datums/factions/faction_modules.dm create mode 100644 code/datums/factions/iff_tag.dm create mode 100644 code/datums/factions/relations_datum.dm diff --git a/code/__DEFINES/factions.dm b/code/__DEFINES/factions.dm new file mode 100644 index 000000000000..3af3cfa75ad3 --- /dev/null +++ b/code/__DEFINES/factions.dm @@ -0,0 +1,33 @@ +/* + * Modules, it's a critical parts, as example for hivemind, they contain all information required for them to live + * + * + * + * Factions relations pregen, used to generate relations, so every faction know about each other +*/ + +#define FACTION_MODULE_HIVE_MIND "hm_module" + + +//FACTIONS RELATIONS +#define RELATIONS_FACTION_NEUTRAL list(FACTION_USCM = RELATIONS_NEUTRAL, FACTION_WY = RELATIONS_NEUTRAL, FACTION_UPP = RELATIONS_NEUTRAL, FACTION_CLF = RELATIONS_NEUTRAL, FACTION_COLONIST = RELATIONS_NEUTRAL, FACTION_RESS = RELATIONS_NEUTRAL, FACTION_TWE = RELATIONS_NEUTRAL, FACTION_MERCENARY = RELATIONS_NEUTRAL, FACTION_FREELANCER = RELATIONS_NEUTRAL, FACTION_THREEWE = RELATIONS_NEUTRAL) +#define RELATIONS_FACTION_USCM list(FACTION_WY = RELATIONS_FRIENDLY, FACTION_UPP = RELATIONS_HOSTILE, FACTION_CLF = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_NEUTRAL, FACTION_RESS = RELATIONS_FRIENDLY, FACTION_TWE = RELATIONS_FRIENDLY, FACTION_MERCENARY = RELATIONS_NEUTRAL, FACTION_FREELANCER = RELATIONS_NEUTRAL, FACTION_THREEWE = RELATIONS_TENSE, FACTION_NEUTRAL = RELATIONS_NEUTRAL) +#define RELATIONS_FACTION_WY list(FACTION_USCM = RELATIONS_FRIENDLY, FACTION_UPP = RELATIONS_NEUTRAL, FACTION_CLF = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_NEUTRAL, FACTION_RESS = RELATIONS_FRIENDLY, FACTION_TWE = RELATIONS_HOSTILE, FACTION_MERCENARY = RELATIONS_NEUTRAL, FACTION_FREELANCER = RELATIONS_NEUTRAL, FACTION_THREEWE = RELATIONS_NEUTRAL, FACTION_NEUTRAL = RELATIONS_NEUTRAL) +#define RELATIONS_FACTION_CLF list(FACTION_USCM = RELATIONS_HOSTILE, FACTION_WY = RELATIONS_NEUTRAL, FACTION_UPP = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_NEUTRAL, FACTION_RESS = RELATIONS_HOSTILE, FACTION_TWE = RELATIONS_HOSTILE, FACTION_MERCENARY = RELATIONS_HOSTILE, FACTION_FREELANCER = RELATIONS_HOSTILE, FACTION_THREEWE = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_NEUTRAL) +#define RELATIONS_FACTION_UPP list(FACTION_USCM = RELATIONS_HOSTILE, FACTION_WY = RELATIONS_FRIENDLY, FACTION_CLF = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_NEUTRAL, FACTION_RESS = RELATIONS_HOSTILE, FACTION_TWE = RELATIONS_FRIENDLY, FACTION_MERCENARY = RELATIONS_HOSTILE, FACTION_FREELANCER = RELATIONS_HOSTILE, FACTION_THREEWE = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_NEUTRAL) +#define RELATIONS_FACTION_XENOMORPH list(FACTION_XENOMORPH_NORMAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_CORRUPTED = RELATIONS_HOSTILE, FACTION_XENOMORPH_ALPHA = RELATIONS_HOSTILE, FACTION_XENOMORPH_BRAVO = RELATIONS_HOSTILE, FACTION_XENOMORPH_CHARLIE = RELATIONS_HOSTILE, FACTION_XENOMORPH_DELTA = RELATIONS_HOSTILE, FACTION_XENOMORPH_FERAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_FORSAKEN = RELATIONS_HOSTILE, FACTION_XENOMORPH_TAMED = RELATIONS_HOSTILE, FACTION_XENOMORPH_MUTATED = RELATIONS_HOSTILE, FACTION_XENOMORPH_YAUTJA = RELATIONS_HOSTILE, FACTION_XENOMORPH_RENEGADE = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_NEUTRAL) + +#define RELATIONS_MAP list(FACTION_NEUTRAL = null, FACTION_USCM = null, FACTION_MARINE = null, FACTION_CMB = null, FACTION_MARSOC = null, FACTION_CONTRACTOR = null, FACTION_WY = null, FACTION_PMC = null, FACTION_WY_DEATHSQUAD = null, FACTION_CLF = null, FACTION_UPP = null, FACTION_FREELANCER = null, FACTION_COLONIST = null, FACTION_MERCENARY = null, FACTION_DUTCH = null, FACTION_HEFA = null, FACTION_GLADIATOR = null, FACTION_PIRATE = null, FACTION_PIZZA = null, FACTION_SOUTO = null, FACTION_YAUTJA = null, FACTION_XENOMORPH_NORMAL = null, FACTION_XENOMORPH_CORRUPTED = null, FACTION_XENOMORPH_ALPHA = null, FACTION_XENOMORPH_BRAVO = null, FACTION_XENOMORPH_CHARLIE = null, FACTION_XENOMORPH_DELTA = null, FACTION_XENOMORPH_FERAL = null, FACTION_XENOMORPH_FORSAKEN = null, FACTION_XENOMORPH_TAMED = null, FACTION_XENOMORPH_MUTATED = null, FACTION_XENOMORPH_YAUTJA = null) +#define RELATIONS_MAP_HOSTILE list(FACTION_USCM = RELATIONS_HOSTILE, FACTION_WY = RELATIONS_HOSTILE, FACTION_UPP = RELATIONS_HOSTILE, FACTION_CLF = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_HOSTILE, FACTION_RESS = RELATIONS_HOSTILE, FACTION_TWE = RELATIONS_HOSTILE, FACTION_MERCENARY = RELATIONS_HOSTILE, FACTION_FREELANCER = RELATIONS_HOSTILE, FACTION_THREEWE = RELATIONS_HOSTILE, FACTION_XENOMORPH_NORMAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_CORRUPTED = RELATIONS_HOSTILE, FACTION_XENOMORPH_ALPHA = RELATIONS_HOSTILE, FACTION_XENOMORPH_BRAVO = RELATIONS_HOSTILE, FACTION_XENOMORPH_CHARLIE = RELATIONS_HOSTILE, FACTION_XENOMORPH_DELTA = RELATIONS_HOSTILE, FACTION_XENOMORPH_FERAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_FORSAKEN = RELATIONS_HOSTILE, FACTION_XENOMORPH_TAMED = RELATIONS_HOSTILE, FACTION_XENOMORPH_MUTATED = RELATIONS_HOSTILE, FACTION_XENOMORPH_YAUTJA = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_HOSTILE) + +// For this BATCH, it's predefined, because otherwise this pr will be TOO big +#define RELATIONS_UNKNOWN null +#define RELATIONS_DISABLED list(0, 0) +#define RELATIONS_WAR list(1, 200) +#define RELATIONS_HOSTILE list(201, 400) +#define RELATIONS_TENSE list(401, 500) +#define RELATIONS_NEUTRAL list(501, 700) +#define RELATIONS_FRIENDLY list(701, 900) +#define RELATIONS_VERY_GOOD list(901, 1000) +#define RELATIONS_SELF 1100 +#define RELATIONS_MAX 1000 diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index dd3cbc80cee0..92835b659f56 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -300,6 +300,8 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_LIST_YAUTJA list(FACTION_YAUTJA) #define FACTION_LIST_HUNTED list(FACTION_HUNTED) +#define FACTION_LIST_ALL FACTION_LIST_HUMANOID + FACTION_LIST_XENOMORPH + // Xenomorphs #define FACTION_PREDALIEN "Predalien" diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index a26b5b4a9520..80c29f8d630b 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -230,8 +230,6 @@ GLOBAL_LIST_INIT(xeno_evolve_times, setup_xeno_evolve_times()) else LAZYADDASSOCLIST(., num2text(initial(caste.minimum_evolve_time)), caste) -GLOBAL_LIST_INIT(custom_event_info_list, setup_custom_event_info()) - // Posters GLOBAL_LIST_INIT(poster_designs, subtypesof(/datum/poster)) @@ -473,26 +471,6 @@ GLOBAL_LIST_INIT(uppj_emotes, setup_upp_joe_emotes()) mobtypes["[T]"] = typecacheof(T.target_mobtypes) return mobtypes -/proc/setup_custom_event_info() - //faction event messages - var/list/custom_event_info_list = list() - var/datum/custom_event_info/CEI = new /datum/custom_event_info - CEI.faction = "Global" //the old public one for whole server to see - custom_event_info_list[CEI.faction] = CEI - for(var/T in FACTION_LIST_HUMANOID) - CEI = new /datum/custom_event_info - CEI.faction = T - custom_event_info_list[T] = CEI - - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - CEI = new /datum/custom_event_info - CEI.faction = hive.internal_faction - custom_event_info_list[hive.name] = CEI - - return custom_event_info_list - /proc/setup_taskbar_icons() var/list/png_list = flist("icons/taskbar") for(var/png in png_list) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 818937ff16a0..c5c44afd0216 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -46,7 +46,7 @@ /obj/item/proc/attack(mob/living/M, mob/living/user) - if((flags_item & NOBLUDGEON) || (MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_attacking_corpses) && M.stat == DEAD && !user.get_target_lock(M.faction_group))) + if((flags_item & NOBLUDGEON) || (MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_attacking_corpses) && M.stat == DEAD && !user.ally_mob(mob))) return FALSE if(SEND_SIGNAL(M, COMSIG_ITEM_ATTEMPT_ATTACK, user, src) & COMPONENT_CANCEL_ATTACK) //Sent by target mob. diff --git a/code/datums/components/iff_fire_prevention.dm b/code/datums/components/iff_fire_prevention.dm index 7a40a784d31e..bd9e3a3d06e5 100644 --- a/code/datums/components/iff_fire_prevention.dm +++ b/code/datums/components/iff_fire_prevention.dm @@ -78,7 +78,7 @@ if(checked_living.body_position == LYING_DOWN && projectile_to_fire.original != checked_living) continue - if(checked_living.get_target_lock(user.faction_group)) + if(checked_living.ally_mob(user)) if(HAS_TRAIT(checked_living, TRAIT_CLOAKED)) continue if(COOLDOWN_FINISHED(src, iff_halt_cooldown) && user.client) diff --git a/code/datums/event_info_text.dm b/code/datums/event_info_text.dm index 21469ed379cd..2c947146bfcb 100644 --- a/code/datums/event_info_text.dm +++ b/code/datums/event_info_text.dm @@ -1,24 +1,39 @@ /datum/custom_event_info - var/faction = "default" //here category/faction/hive name stored - var/msg = "" //here is the message itself + var/name = "default" + var/code_identificator + var/datum/faction/faction + var/msg = "" +/datum/custom_event_info/New(datum/faction/_faction, _name, _code_identificator) + if(_faction) + name = _faction.name + faction = _faction -//this shows event info to player. can pass clients and mobs -/datum/custom_event_info/proc/show_player_event_info(user) + if(_name) + name = _name + + code_identificator = _code_identificator + +/datum/custom_event_info/Destroy(force, ...) + if(code_identificator) + GLOB.custom_event_info_list[code_identificator] = null + + if(faction) + faction = null - if(!istype(user, /client)) - if(ismob(user)) - var/mob/M = user - if(!M.client) - return - else - return + . = ..() + +//this shows event info to player. can pass clients and mobs +/datum/custom_event_info/proc/show_player_event_info(client/user) + if(!istype(user)) + return if(msg == "") + to_chat(user, SPAN_WARNING("For [name] not found special event message.")) return var/dat - dat = "

[faction] Event Message

" + dat = "

[name] Event Message

" dat += "

A custom event is in process. OOC Info:

" dat += SPAN_ALERT("[msg]
") to_chat(user, dat) @@ -26,37 +41,20 @@ //this shows changed event info to everyone in the category /datum/custom_event_info/proc/handle_event_info_update() - if(!msg) return - if(faction == "Global") - var/dat = "

[faction] Event Message

" + if(!faction) + var/dat = "

Global Event Message

" dat += "

A custom event is in process. OOC Info:

" dat += SPAN_ALERT("[msg]
") to_world(dat) - return - - else if(faction in FACTION_LIST_HUMANOID) - for(var/mob/M in GLOB.human_mob_list) - if(M && M.faction == faction) - show_player_event_info(M) - return - else - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(hive.name == faction) - for(var/mob/M in hive.totalXenos) - show_player_event_info(M) - return - - message_admins("ERROR, ([faction ? faction : "name lost"]) faction is not found for event info.") - return + for(var/mob/creature in faction.totalM_mobs) + show_player_event_info(creature.client) -/mob/proc/check_event_info(category = "Global") +/proc/check_event_info(category = "glob", client/user) if(GLOB.custom_event_info_list[category]) - var/datum/custom_event_info/CEI = GLOB.custom_event_info_list[category] - if(CEI.msg) - CEI.show_player_event_info(src) + var/datum/custom_event_info/event_info = GLOB.custom_event_info_list[category] + if(event_info.msg) + event_info.show_player_event_info(user) diff --git a/code/datums/factions/clf.dm b/code/datums/factions/clf.dm index ce53b505b352..52cb64ebf0f3 100644 --- a/code/datums/factions/clf.dm +++ b/code/datums/factions/clf.dm @@ -1,6 +1,5 @@ /datum/faction/clf name = "Colonial Liberation Front" - faction_tag = FACTION_CLF /datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/cmb.dm b/code/datums/factions/cmb.dm index 6f6eee638779..db901ac7672a 100644 --- a/code/datums/factions/cmb.dm +++ b/code/datums/factions/cmb.dm @@ -1,6 +1,5 @@ /datum/faction/cmb name = "Colonial Marshal Bureau" - faction_tag = FACTION_MARSHAL /datum/faction/cmb/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state diff --git a/code/datums/factions/contractor.dm b/code/datums/factions/contractor.dm index 5e0f125b06b0..b9b7d56a2cb9 100644 --- a/code/datums/factions/contractor.dm +++ b/code/datums/factions/contractor.dm @@ -1,3 +1,2 @@ /datum/faction/contractor name = "Vanguard's Arrow Incorporated" - faction_tag = FACTION_CONTRACTOR diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index a6201da70467..9c2db52d5799 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -1,9 +1,123 @@ /datum/faction - var/name = "Neutral Faction" - var/faction_tag = FACTION_NEUTRAL + var/name = NAME_FACTION_NEUTRAL + var/desc = "Neutral Faction" + + var/code_identificator = "nfo" + var/faction_flags = NO_FLAGS + var/hud_type = FACTION_HUD -/datum/faction/proc/modify_hud_holder(image/holder, mob/living/carbon/human/H) + var/relations_pregen[] = RELATIONS_NEUTRAL + var/datum/faction_module/relations/relations_datum + + var/organ_faction_iff_tag_type // Our faction have something like zenomoprhs gland? + var/faction_iff_tag_type // Simply ass metal stick in body, those spy chips got so high tech!!! O kurwa! + + var/list/total_mobs = list() // All mobs linked to faction + var/list/total_dead_mobs = list() // All dead mobs linked to faction + var/list/late_join_landmarks = list() // Flexible latejoin landmarks per faction + + var/list/role_mappings = list() + var/list/roles_list = list() + var/list/coefficient_per_role = list() + + var/list/banished_ckeys = list() + + var/spawning_enabled = TRUE + var/latejoin_enabled = TRUE + var/force_spawning = FALSE + +/datum/faction/New() + relations_datum = new(src) + GLOB.custom_event_info_list[code_identificator] = new /datum/custom_event_info(src, null, code_identificator) + +/datum/faction/proc/add_mob(mob/living/carbon/creature) + if(!istype(creature)) + return + + if(creature.faction && creature.faction != src) + creature.faction.remove_mob(creature, TRUE) + + creature.faction = src + + if(creature.hud_list) + creature.hud_update() + + if(!creature.statistic_exempt) + total_mobs |= creature + +/datum/faction/proc/remove_mob(mob/living/carbon/creature, hard = FALSE) + if(!istype(creature)) + return + + if(hard) + creature.faction = null + else + total_dead_mobs |= creature + + total_mobs -= creature + +/datum/faction/proc/can_delay_round_end(mob/living/carbon/creature) + return TRUE + +// Friend or Foe functional +/atom/movable/proc/ally_faction(datum/faction/ally_faction) + return FALSE + +/obj/vehicle/multitile/ally_faction(datum/faction/ally_faction) + if(!ally_faction) + return FALSE + + var/list/factions = list() + factions += ally_faction + for(var/datum/faction/ally in ally_faction.relations_datum.allies) + factions += ally + if(isnull(factions) || !faction) + return FALSE + + return faction in factions + +/mob/ally_faction(datum/faction/ally_faction) + if(!ally_faction) + return FALSE + + if(client in ally_faction.banished_ckeys) + return FALSE + + // Hard times, so basicaly if you organical... domain faction... You can figure it out on your self, without HIGH tech shit. + if(organ_faction_tag || (faction.faction_flags & FACTION_ORGANICAL_DOMAIN && ally_faction.faction_flags & FACTION_ORGANICAL_DOMAIN)) + if(organ_faction_tag) + return ally_faction.organ_faction_tag_is_ally(organ_faction_tag) + else if(faction_tag) + return ally_faction.faction_tag_is_ally(faction_tag) + return FALSE + +/datum/faction/proc/organ_faction_tag_is_ally(obj/item/faction_tag/organ/organ_tag) + if(organ_tag.faction == src) + return TRUE + + for(var/datum/faction/faction in organ_tag.factions + organ_tag.faction) + if(relations_datum.allies[faction.code_identificator]) + return TRUE + return FALSE + +/datum/faction/proc/faction_tag_is_ally(obj/item/faction_tag/obj_tag) + if(obj_tag.faction == src) + return TRUE + + for(var/datum/faction/faction in obj_tag.factions + obj_tag.faction) + if(relations_datum.allies[faction.code_identificator]) + return TRUE + return FALSE + +/datum/faction/proc/faction_is_ally(datum/faction/faction_to_check) + if(relations_datum.allies[faction_to_check.code_identificator]) + return TRUE + + return FALSE + +//Minor functions +/datum/faction/proc/modify_hud_holder(image/holder, mob/living/carbon/human/creature) return /datum/faction/proc/get_antag_guns_snowflake_equipment() diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm new file mode 100644 index 000000000000..ecdfcbb55a06 --- /dev/null +++ b/code/datums/factions/faction_modules.dm @@ -0,0 +1,3 @@ +/datum/faction_module + +/datum/faction_module/hive_mind diff --git a/code/datums/factions/helpers.dm b/code/datums/factions/helpers.dm index 38cd6dd85d58..824ac778db80 100644 --- a/code/datums/factions/helpers.dm +++ b/code/datums/factions/helpers.dm @@ -1,14 +1,14 @@ GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) /proc/setup_faction_list() - var/list/faction_datums_list = list() - for(var/T in typesof(/datum/faction)) - var/datum/faction/F = new T - faction_datums_list[F.faction_tag] = F - return faction_datums_list + . = list() + for(var/path in typesof(/datum/faction)) + var/datum/faction/faction = new path() + .[faction.code_identificator] = faction + faction.relations_datum.generate_relations_helper() -/proc/get_faction(faction = FACTION_MARINE) - var/datum/faction/F = GLOB.faction_datums[faction] - if(F) - return F - return GLOB.faction_datums[FACTION_NEUTRAL] +GLOBAL_LIST_INIT_TYPED(custom_event_info_list, /datum/custom_event_info, setup_custom_event_info()) + +/proc/setup_custom_event_info() + . = list() + .["glob"] = new /datum/custom_event_info(null, "Global", "glob") diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm new file mode 100644 index 000000000000..c0e68ada522f --- /dev/null +++ b/code/datums/factions/iff_tag.dm @@ -0,0 +1,207 @@ +#define INJECTABLE_TAG (1<<0) +#define REPROGRAMMABLE_TAG (1<<1) +#define ORGAN_TAG (1<<2) + +DEFINE_BITFIELD(iff_flag_flags, list( + "INJECTABLE_TAG" = INJECTABLE_TAG, + "REPROGRAMMABLE_TAG" = REPROGRAMMABLE_TAG, + "ORGAN_TAG" = ORGAN_TAG, +)) + +/mob + var/obj/item/faction_tag/organ/organ_faction_tag = null + var/obj/item/faction_tag/faction_tag = null + +/obj/item/faction_tag + name = "Faction IFF tag" + desc = "A tag containing a small IFF computer that gets inserted into the body. You can modify the IFF groups by using an access tuner on it, or on the body of implanted if it's already implanted." + icon = 'icons/obj/items/iff_tag.dmi' + icon_state = "iff_tag" + + var/tag_flags = INJECTABLE_TAG|REPROGRAMMABLE_TAG + var/ally_factions_initialize = TRUE + var/list/datum/faction/factions = list() + + var/faction_to_get = null + var/datum/faction/faction = null + +/obj/item/faction_tag/Initialize(mapload, _faction_to_get) + . = ..() + if(_faction_to_get) + faction_to_get = _faction_to_get + faction = GLOB.faction_datums[_faction_to_get] + if(faction) + factions |= faction + if(ally_factions_initialize) + for(var/datum/faction/faction_ally in faction.relations_datum.allies) + factions |= faction_ally + +/obj/item/faction_tag/attack(mob/living/carbon/mob, mob/living/carbon/injector) + if((isxeno(mob) || ishuman(mob)) && tag_flags & INJECTABLE_TAG) + if(mob.stat == DEAD) + to_chat(injector, SPAN_WARNING("\The [mob] is dead...")) + return + if(mob.faction_tag) + to_chat(injector, SPAN_WARNING("\The [mob] already has a tag inside it.")) + return + injector.visible_message(SPAN_NOTICE("[injector] starts forcing \the [src] into [mob]'s body..."), SPAN_NOTICE("You start forcing \the [src] into [mob]'s body...")) + if(!do_after(injector, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC, mob, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) + return + injector.visible_message(SPAN_NOTICE("[injector] forces \the [src] into [mob]'s body!"), SPAN_NOTICE("You force \the [src] into [mob]'s body!")) + mob.faction_tag = src + injector.drop_inv_item_to_loc(src, mob) + return + return ..() + +/obj/item/faction_tag/attackby(obj/item/W, mob/user) + if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL) && ishuman(user) && tag_flags & REPROGRAMMABLE_TAG) + handle_reprogramming(user) + return + return ..() + +/obj/item/faction_tag/proc/handle_reprogramming(mob/living/carbon/human/programmer, mob/living/carbon/mob) + var/list/datum/faction/id_faction_groups = programmer.faction + var/option = tgui_alert(programmer, "Current Faction IFF reads as: [english_list(factions, "None")]\nYour ID's Faction IFF reads as: [english_list(id_faction_groups, "None")]", "Faction IFF Tag", list("Overwrite", "Add", "Remove")) + if(!option) + return FALSE + if(mob) + if(!mob.faction_tag) + to_chat(programmer, SPAN_WARNING("\The [src]'s tag got removed while you were reprogramming it!")) + return FALSE + if(!programmer.Adjacent(mob)) + to_chat(programmer, SPAN_WARNING("You need to stay close to the tag to reprogram the tag!")) + return FALSE + switch(option) + if("Overwrite") + factions = id_faction_groups + if("Add") + factions |= id_faction_groups + if("Remove") + factions = list() + to_chat(programmer, SPAN_NOTICE("You [option] the Faction IFF data, the Faction IFF on the tag now reads as: [english_list(factions, "None")]")) + return TRUE + +/obj/item/faction_tag/organ + name = "Sticky Gland" + desc = "Strange organic object, that somehow help to be indentificated." + icon_state = "gland_tag" + tag_flags = ORGAN_TAG + +/obj/item/faction_tag/organ/zombie + faction_to_get = FACTION_ZOMBIE + +/obj/item/faction_tag/organ/xenomorph + faction_to_get = FACTION_XENOMORPH + +/obj/item/faction_tag/organ/xenomorph/normal + faction_to_get = FACTION_XENOMORPH_NORMAL + +/obj/item/faction_tag/organ/xenomorph/corrupted + faction_to_get = FACTION_XENOMORPH_CORRUPTED + +/obj/item/faction_tag/organ/xenomorph/alpha + faction_to_get = FACTION_XENOMORPH_ALPHA + +/obj/item/faction_tag/organ/xenomorph/bravo + faction_to_get = FACTION_XENOMORPH_BRAVO + +/obj/item/faction_tag/organ/xenomorph/charlie + faction_to_get = FACTION_XENOMORPH_CHARLIE + +/obj/item/faction_tag/organ/xenomorph/delta + faction_to_get = FACTION_XENOMORPH_DELTA + +/obj/item/faction_tag/organ/xenomorph/feral + faction_to_get = FACTION_XENOMORPH_FERAL + +/obj/item/faction_tag/organ/xenomorph/forsaken + faction_to_get = FACTION_XENOMORPH_FORSAKEN + +/obj/item/faction_tag/organ/xenomorph/tamed + faction_to_get = FACTION_XENOMORPH_TAMED + +/obj/item/faction_tag/organ/xenomorph/mutated + faction_to_get = FACTION_XENOMORPH_MUTATED + +/obj/item/faction_tag/organ/xenomorph/yautja + faction_to_get = FACTION_XENOMORPH_YAUTJA + +/obj/item/faction_tag/organ/xenomorph/renegade + faction_to_get = FACTION_XENOMORPH_RENEGADE + +/obj/item/faction_tag/colonist + faction_to_get = FACTION_COLONIST + +/obj/item/faction_tag/contractor + faction_to_get = FACTION_CONTRACTOR + +/obj/item/faction_tag/uscm + faction_to_get = FACTION_USCM + +/obj/item/faction_tag/uscm/marine + faction_to_get = FACTION_MARINE + +/obj/item/faction_tag/uscm/cmb + faction_to_get = FACTION_CMB + +/obj/item/faction_tag/uscm/marsoc + ally_factions_initialize = FALSE + faction_to_get = FACTION_MARSOC + +/obj/item/faction_tag/wy + faction_to_get = FACTION_WY + +/obj/item/faction_tag/wy/pmc_handler + faction_to_get = FACTION_USCM + +/obj/item/faction_tag/wy/pmc + faction_to_get = FACTION_PMC + +/obj/item/faction_tag/wy/death_sqaud + ally_factions_initialize = FALSE + faction_to_get = FACTION_WY_DEATHSQUAD + +/obj/item/faction_tag/upp + faction_to_get = FACTION_UPP + +/obj/item/faction_tag/clf + faction_to_get = FACTION_CLF + +/obj/item/faction_tag/contractor + faction_to_get = FACTION_CONTRACTOR + +/obj/item/faction_tag/freelancer + faction_to_get = FACTION_FREELANCER + +//CASE FOR TAGS +/obj/item/storage/tag_case + name = "tag case" + desc = "A sturdy case designed to store IFF tags." + icon = 'icons/obj/items/iff_tag.dmi' + icon_state = "tag_box" + use_sound = "toolbox" + storage_slots = 8 + can_hold = list( + /obj/item/faction_tag, + /obj/item/device/multitool + ) + black_market_value = 25 + +/obj/item/storage/tag_case/full/fill_preset_inventory() + for(var/i = 1 to storage_slots - 1) + new /obj/item/faction_tag(src) + new /obj/item/device/multitool(src) + +/obj/item/storage/tag_case/uscm/marine + +/obj/item/storage/tag_case/uscm/marine/full/fill_preset_inventory() + for(var/i = 1 to storage_slots - 1) + new /obj/item/faction_tag/uscm/marine(src) + new /obj/item/device/multitool(src) + +/obj/item/storage/tag_case/wy + +/obj/item/storage/tag_case/wy/full/fill_preset_inventory() + for(var/i = 1 to storage_slots - 1) + new /obj/item/faction_tag/wy(src) + new /obj/item/device/multitool(src) diff --git a/code/datums/factions/nspa.dm b/code/datums/factions/nspa.dm index 776cd5c3bc91..9a88df6a654c 100644 --- a/code/datums/factions/nspa.dm +++ b/code/datums/factions/nspa.dm @@ -1,6 +1,5 @@ /datum/faction/nspa name = "Neroid Sector Policing Authority" - faction_tag = FACTION_NSPA /datum/faction/nspa/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/pmc.dm b/code/datums/factions/pmc.dm index 421b5a22b404..e924eca3b044 100644 --- a/code/datums/factions/pmc.dm +++ b/code/datums/factions/pmc.dm @@ -1,6 +1,5 @@ /datum/faction/pmc name = "Private Military Company" - faction_tag = FACTION_PMC /datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state diff --git a/code/datums/factions/relations_datum.dm b/code/datums/factions/relations_datum.dm new file mode 100644 index 000000000000..27bfc2d64281 --- /dev/null +++ b/code/datums/factions/relations_datum.dm @@ -0,0 +1,61 @@ +/datum/faction_module/relations + var/relations[] = RELATIONS_MAP + var/list/allies = list() + var/list/datum/relations_action/relation_actions = list() + var/datum/faction/faction + var/atom/source + +/datum/faction_module/relations/New(datum/faction/faction_to_set, atom/referenced_source) + faction = faction_to_set + if(referenced_source) + source = referenced_source + else + source = src + +/datum/faction_module/relations/proc/generate_relations_helper() + spawn(30 SECONDS) + for(var/code_identificator in FACTION_LIST_ALL) + if(code_identificator == faction.code_identificator) + relations[code_identificator] = RELATIONS_SELF + continue + if(code_identificator in faction.relations_pregen) + relations[code_identificator] = rand(faction.relations_pregen[code_identificator][1], faction.relations_pregen[code_identificator][2]) + if(RELATIONS_FRIENDLY[2] < faction.relations_pregen[code_identificator]) + allies += GLOB.faction_datums[code_identificator] + continue + relations[code_identificator] = RELATIONS_UNKNOWN + +/datum/faction_module/relations/proc/can_acting(datum/faction/target_faction) + if(isnull(relations[target_faction.code_identificator]) || relations[target_faction.code_identificator] < RELATIONS_WAR[1] || relations[target_faction.code_identificator] > RELATIONS_MAX) + return FALSE + return TRUE + +/datum/faction_module/relations/proc/gain_opinion(datum/faction/target_faction, opinion) + relations[target_faction.code_identificator] = clamp(relations[target_faction.code_identificator] + opinion, RELATIONS_WAR[1], RELATIONS_MAX) + +/datum/faction_module/relations/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, source, ui) + if(!ui) + ui = new(user, source, "FactionRelations", "[faction] Relations") + ui.open() + ui.set_autoupdate(TRUE) + +/datum/faction_module/relations/ui_data(mob/user) + . = list() + var/list/relations_mapping = list() + for(var/code_identificator in relations) + if(relations[code_identificator] == null || relations[code_identificator] > 1000) + continue + var/datum/faction/faction = GLOB.faction_datums[code_identificator] + relations_mapping += list(list("name" = faction.name, "desc" = faction.desc, "color" = faction.ui_color, "value" = relations[code_identificator])) + + .["actions"] = source != src ? TRUE : FALSE + + .["faction_color"] = faction.ui_color + .["faction_relations"] = relations_mapping + +/datum/faction_module/relations/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + +/datum/faction_module/relations/ui_status(mob/user, datum/ui_state/state) + return UI_INTERACTIVE diff --git a/code/datums/factions/royalmarinescommando.dm b/code/datums/factions/royalmarinescommando.dm index 2fab0348bcfa..d03add1147f2 100644 --- a/code/datums/factions/royalmarinescommando.dm +++ b/code/datums/factions/royalmarinescommando.dm @@ -1,6 +1,5 @@ /datum/faction/royal_marines_commando name = "Royal Marines Commando" - faction_tag = FACTION_TWE /datum/faction/royal_marines_commando/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state diff --git a/code/datums/factions/upp.dm b/code/datums/factions/upp.dm index 468969fd99fd..a60106eaa7b0 100644 --- a/code/datums/factions/upp.dm +++ b/code/datums/factions/upp.dm @@ -1,6 +1,5 @@ /datum/faction/upp name = "Union of Progressive Peoples" - faction_tag = FACTION_UPP /datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/uscm.dm b/code/datums/factions/uscm.dm index a107fd24e765..a259000c970e 100644 --- a/code/datums/factions/uscm.dm +++ b/code/datums/factions/uscm.dm @@ -1,6 +1,5 @@ /datum/faction/uscm name = "United States Colonial Marines" - faction_tag = FACTION_MARINE /datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/datum/squad/squad = current_human.assigned_squad diff --git a/code/datums/factions/wy.dm b/code/datums/factions/wy.dm index 162fbb6307c6..82ce1116b3d4 100644 --- a/code/datums/factions/wy.dm +++ b/code/datums/factions/wy.dm @@ -1,6 +1,5 @@ /datum/faction/wy name = "Weyland-Yutani Corporation" - faction_tag = FACTION_WY /datum/faction/wy/modify_hud_holder(image/holder, mob/living/carbon/human/user) var/hud_icon_state diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index fb5dddae496e..d77d770e571e 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -233,6 +233,9 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( /mob/proc/add_to_all_mob_huds() return +/mob/proc/hud_update() + return + /mob/hologram/queen/add_to_all_mob_huds() var/datum/mob_hud/hud = GLOB.huds[MOB_HUD_XENO_STATUS] hud.add_to_hud(src) @@ -603,7 +606,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( holder.icon_state = "xeno_banished" hud_list[XENO_BANISHED_HUD] = holder -/mob/living/carbon/xenomorph/proc/hud_update() +/mob/living/carbon/xenomorph/hud_update() var/image/holder = hud_list[XENO_STATUS_HUD] holder.overlays.Cut() if (stat == DEAD) diff --git a/code/datums/pain/_pain.dm b/code/datums/pain/_pain.dm index 6c494fc65ed2..ca98098888c6 100644 --- a/code/datums/pain/_pain.dm +++ b/code/datums/pain/_pain.dm @@ -285,9 +285,8 @@ /datum/pain/proc/oxyloss_drag(mob/living/source, mob/puller) SIGNAL_HANDLER - if(isxeno(puller) && source.stat == UNCONSCIOUS) - var/mob/living/carbon/xenomorph/xeno_puller = puller - if(source.ally_of_hivenumber(xeno_puller.hivenumber)) + if(source.stat == UNCONSCIOUS) + if(source.ally_faction(puller.faction)) return if(source.get_species()) var/mob/living/carbon/human/H = source @@ -298,7 +297,7 @@ SIGNAL_HANDLER if(source.chestburst) return - if(source.ally_of_hivenumber(devourer.hivenumber)) + if(source.ally_faction(devourer.faction)) return oxy_kill(source) return COMPONENT_CANCEL_DEVOUR diff --git a/code/datums/statistics/entities/death_stats.dm b/code/datums/statistics/entities/death_stats.dm index de2d9cc71526..5d2d9475c66e 100644 --- a/code/datums/statistics/entities/death_stats.dm +++ b/code/datums/statistics/entities/death_stats.dm @@ -100,7 +100,7 @@ new_death.role_name = get_role_name() new_death.mob_name = real_name - new_death.faction_name = faction + new_death.faction_name = faction.code_identificator new_death.is_xeno = FALSE new_death.area_name = area.name diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index edd0b174212d..3f9508124dc6 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -40,8 +40,9 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) /// Count all larva across all hives - for(var/hivenumber in GLOB.hive_datum) - larva += GLOB.hive_datum[hivenumber].stored_larva + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_module(FACTION_MODULE_HIVE_MIND) + larva += faction_module.stored_larva /// Keeping track of peak numbers to determine when a side is "losing" if(GLOB.peak_humans < length(GLOB.alive_human_list)) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 0d4843cd02af..61971957c89f 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -470,27 +470,27 @@ Additional game mode variables. else available_xenos_non_ssd += cur_xeno - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(hive.hardcore) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.hardcore) continue - if(!hive.stored_larva) + if(!faction_module.stored_larva) continue // Only offer buried larva if there is no queue because we are instead relying on the hive cores/larva pops to handle their larva: // Technically this should be after a get_alien_candidates() call to be accurate, but we are intentionally trying to not call that proc as much as possible - if(hive.hive_location && GLOB.xeno_queue_candidate_count > 0) + if(faction_module.hive_location && GLOB.xeno_queue_candidate_count > 0) continue - if(!hive.hive_location && (world.time > XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)) + if(!faction_module.hive_location && (world.time > XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)) continue if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE)) available_xenos |= "any buried larva" - LAZYADD(available_xenos["any buried larva"], hive) + LAZYADD(available_xenos["any buried larva"], faction.name) else - var/larva_option = "buried larva ([hive])" + var/larva_option = "buried larva ([faction.name])" available_xenos += larva_option - available_xenos[larva_option] = list(hive) + available_xenos[larva_option] = list(faction) if(!length(available_xenos) || (instant_join && !length(available_xenos_non_ssd))) var/is_new_player = isnewplayer(xeno_candidate) @@ -556,12 +556,12 @@ Additional game mode variables. to_chat(candidate_observer, SPAN_XENONOTICE(candidate_observer.larva_queue_cached_message)) return FALSE - var/datum/hive_status/cur_hive - for(var/hive_num in GLOB.hive_datum) - cur_hive = GLOB.hive_datum[hive_num] - for(var/mob_name in cur_hive.banished_ckeys) - if(cur_hive.banished_ckeys[mob_name] == candidate_observer.ckey) - candidate_observer.larva_queue_cached_message += "\nNOTE: You are banished from the [cur_hive] and you may not rejoin unless \ + + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + for(var/mob_name in faction.banished_ckeys) + if(faction.banished_ckeys[mob_name] == candidate_observer.ckey) + candidate_observer.larva_queue_cached_message += "\nNOTE: You are banished from the [faction] and you may not rejoin unless \ the Queen re-admits you or dies. Your queue number won't update until there is a hive you aren't banished from." break to_chat(candidate_observer, SPAN_XENONOTICE(candidate_observer.larva_queue_cached_message)) @@ -574,8 +574,9 @@ Additional game mode variables. var/userInput = tgui_input_list(usr, "Available Xenomorphs", "Join as Xeno", available_xenos, theme="hive_status") if(available_xenos[userInput]) //Free xeno mobs have no associated value and skip this. "Pooled larva" strings have a list of hives. - var/datum/hive_status/picked_hive = pick(available_xenos[userInput]) //The list contains all available hives if we are to choose at random, only one element if we already chose a hive by its name. - if(picked_hive.stored_larva) + var/datum/faction/faction = pick(available_xenos[userInput]) //The list contains all available hives if we are to choose at random, only one element if we already chose a hive by its name. + var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.stored_larva) if(!xeno_bypass_timer) var/deathtime = world.time - xeno_candidate.timeofdeath if(isnewplayer(xeno_candidate)) @@ -585,19 +586,19 @@ Additional game mode variables. to_chat(xeno_candidate, SPAN_WARNING("You must wait at least [XENO_JOIN_DEAD_LARVA_TIME / 600] minute\s before rejoining the game as a buried larva!")) return FALSE - for(var/mob_name in picked_hive.banished_ckeys) - if(picked_hive.banished_ckeys[mob_name] == xeno_candidate.ckey) - to_chat(xeno_candidate, SPAN_WARNING("You are banished from the [picked_hive], you may not rejoin unless the Queen re-admits you or dies.")) + for(var/mob_name in faction.banished_ckeys) + if(faction.banished_ckeys[mob_name] == xeno_candidate.ckey) + to_chat(xeno_candidate, SPAN_WARNING("You are banished from the [faction], you may not rejoin unless the Queen re-admits you or dies.")) return FALSE if(isnewplayer(xeno_candidate)) var/mob/new_player/noob = xeno_candidate noob.close_spawn_windows() - if(picked_hive.hive_location) - picked_hive.hive_location.spawn_burrowed_larva(xeno_candidate) + if(faction_module.hive_location) + faction_module.hive_location.spawn_burrowed_larva(xeno_candidate) else if((world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)) - picked_hive.do_buried_larva_spawn(xeno_candidate) + faction_module.do_buried_larva_spawn(xeno_candidate) else to_chat(xeno_candidate, SPAN_WARNING("Seems like something went wrong. Try again?")) return FALSE diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 0f6ea1aeb967..b60f4f1fb177 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -380,14 +380,14 @@ next_research_allocation = world.time + research_allocation_interval if(!round_finished) - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!hive.xeno_queen_timer) + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.xeno_queen_timer) continue - if(!hive.living_xeno_queen && hive.xeno_queen_timer < world.time) - xeno_message("The Hive is ready for a new Queen to evolve.", 3, hive.hivenumber) + if(!faction_module.living_xeno_queen && faction_module.xeno_queen_timer < world.time) + xeno_message("The Hive is ready for a new Queen to evolve.", 3, faction) if(!active_lz && world.time > lz_selection_timer) select_lz(locate(/obj/structure/machinery/computer/shuttle/dropship/flight/lz1)) @@ -419,10 +419,12 @@ round_checkwin = 0 if(!evolution_ovipositor_threshold && world.time >= SSticker.round_start_time + round_time_evolution_ovipositor) - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - hive.evolution_without_ovipositor = FALSE - if(hive.living_xeno_queen && !hive.living_xeno_queen.ovipositor) + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.xeno_queen_timer) + continue + faction_module.evolution_without_ovipositor = FALSE + if(faction_module.living_xeno_queen && !faction_module.living_xeno_queen.ovipositor) to_chat(hive.living_xeno_queen, SPAN_XENODANGER("It is time to settle down and let your children grow.")) evolution_ovipositor_threshold = TRUE msg_admin_niche("Xenomorphs now require the queen's ovipositor for evolution progress.") @@ -539,31 +541,32 @@ .[2]++ return . -/datum/game_mode/colonialmarines/check_queen_status(hivenumber, immediately = FALSE) +/datum/game_mode/colonialmarines/check_queen_status(datum/faction/faction, immediately = FALSE) if(!(flags_round_type & MODE_INFESTATION)) return - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - if(hive.need_round_end_check && !hive.can_delay_round_end()) + if(faction.need_round_end_check && !faction.can_delay_round_end()) return if(!immediately) //We want to make sure that another queen didn't die in the interim. - addtimer(CALLBACK(src, PROC_REF(check_queen_status), hivenumber, TRUE), QUEEN_DEATH_COUNTDOWN, TIMER_UNIQUE|TIMER_OVERRIDE) + addtimer(CALLBACK(src, PROC_REF(check_queen_status), faction, TRUE), QUEEN_DEATH_COUNTDOWN, TIMER_UNIQUE|TIMER_OVERRIDE) return if(round_finished) return - for(var/cur_number in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_number] - if(hive.need_round_end_check && !hive.can_delay_round_end()) + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/current_faction = GLOB.faction_datums[faction_to_get] + if(current_faction.need_round_end_check && !current_faction.can_delay_round_end()) continue - if(hive.living_xeno_queen && !should_block_game_interaction(hive.living_xeno_queen.loc)) - //Some Queen is alive, we shouldn't end the game yet + var/datum/faction_module/hive_mind/faction_module = current_faction.get_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen && !should_block_game_interaction(faction_module.living_xeno_queen.loc)) return - if(length(hive.totalXenos) <= 3) + faction = current_faction + + if(length(faction.total_mobs) <= 3) round_finished = MODE_INFESTATION_M_MAJOR else round_finished = MODE_INFESTATION_M_MINOR diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index d8c306f86de3..e636de70e05d 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -40,6 +40,12 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t var/hardcore = FALSE + var/datum/faction/faction_won = null + + var/list/active_roles_mappings_pool = list() + var/list/active_roles_pool = list() + var/list/factions_pool = list() + ///Whether or not the fax response station has loaded. var/loaded_fax_base = FALSE @@ -48,6 +54,14 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t if(taskbar_icon) GLOB.available_taskbar_icons |= taskbar_icon + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(length(faction.roles_list[name])) + factions_pool[faction.code_identificator] = faction.code_identificator + active_roles_mappings_pool += faction.role_mappings[name] + for(var/i in faction.roles_list[name]) + active_roles_pool += i + /datum/game_mode/proc/announce() //to be calles when round starts to_world("Notice: [src] did not define announce()") diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 08701e0ff425..069bc5e93ac4 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -39,8 +39,6 @@ var/job_options /// If TRUE, this job will spawn w/ a cryo emergency kit during evac/red alert var/gets_emergency_kit = TRUE - /// Under what faction menu the job gets displayed in lobby - var/faction_menu = FACTION_NEUTRAL //neutral to cover uscm jobs for now as loads of them are under civil and stuff mainly ment for other faction /datum/job/New() . = ..() diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 99a08e18365c..5aa5f893661e 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -35,6 +35,7 @@ GLOBAL_VAR_INIT(players_preassigned, 0) var/list/roles_by_path //Master list generated when role aithority is created, listing every role by path, including variable roles. Great for manually equipping with. var/list/roles_by_name //Master list generated when role authority is created, listing every default role by name, including those that may not be regularly selected. + var/list/roles_by_faction var/list/roles_for_mode //Derived list of roles only for the game mode, generated when the round starts. var/list/castes_by_path //Master list generated when role aithority is created, listing every caste by path. var/list/castes_by_name //Master list generated when role authority is created, listing every default caste by name. @@ -93,6 +94,7 @@ GLOBAL_VAR_INIT(players_preassigned, 0) roles_by_path = list() roles_by_name = list() + roles_by_faction = list() roles_for_mode = list() for(var/role in roles_all) //Setting up our roles. var/datum/job/J = new role() @@ -126,11 +128,15 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou var/datum/game_mode/G = SSticker.mode roles_for_mode = list() - for(var/role_name in G.get_roles_list()) - var/datum/job/J = roles_by_name[role_name] - if(!J) - continue - roles_for_mode[role_name] = J + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(length(faction.roles_list[SSticker.mode.name])) + for(var/role_name in faction.roles_list[SSticker.mode.name]) + var/datum/job/job = roles_by_name[role_name] + if(!job) + continue + roles_for_mode[role_name] = job + roles_by_faction[role_name] = faction.code_identificator // Also register game mode specific mappings to standard roles role_mappings = list() @@ -357,29 +363,31 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou var/datum/job/marine_job = GET_MAPPED_ROLE(JOB_SQUAD_MARINE) assign_role(M, marine_job) -/datum/authority/branch/role/proc/assign_role(mob/new_player/M, datum/job/J, latejoin = FALSE) - if(ismob(M) && istype(J)) - if(check_role_entry(M, J, latejoin)) - M.job = J.title - J.current_positions++ +/datum/authority/branch/role/proc/assign_role(mob/new_player/player, datum/job/job, latejoin = FALSE) + if(ismob(player) && istype(job)) + var/datum/faction/faction = GLOB.faction_datums[roles_by_faction[job.title]] + var/check_result = check_role_entry(player, job, faction, latejoin) + if(!check_result) + player.job = job.title + job.current_positions++ return TRUE -/datum/authority/branch/role/proc/check_role_entry(mob/new_player/M, datum/job/J, latejoin = FALSE, faction) - if(jobban_isbanned(M, J.title)) - return FALSE - if(J.role_ban_alternative && jobban_isbanned(M, J.role_ban_alternative)) +/datum/authority/branch/role/proc/check_role_entry(mob/new_player/player, datum/job/job, datum/faction/faction, latejoin = FALSE) + if(jobban_isbanned(player, job.title)) return FALSE - if(!J.can_play_role(M.client)) + if(job.role_ban_alternative && jobban_isbanned(player, job.role_ban_alternative)) return FALSE - if(!J.check_whitelist_status(M)) + if(!job.can_play_role(player.client)) return FALSE - if(J.total_positions != -1 && J.get_total_positions(latejoin) <= J.current_positions) + if(!job.check_whitelist_status(player)) return FALSE - if(latejoin && !J.late_joinable) + if(job.total_positions != -1 && job.get_total_positions(latejoin) <= job.current_positions) return FALSE - if(faction && faction != J.faction_menu) + if(latejoin && !job.late_joinable) return FALSE - +/* PART 2: Limitations in case of gamemode limitations + if(!SSautobalancer.can_join(faction)) + return FALSE */ return TRUE /datum/authority/branch/role/proc/free_role(datum/job/J, latejoin = 1) //Want to make sure it's a job, and nothing like a MODE or special role. diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index 5416d8d610dc..54253f492870 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -270,10 +270,10 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) else if(choice == "Add your faction's frequencies") if(!do_after(user, 10, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) return - switch(user.faction) + switch(user.faction.code_identificator) if(FACTION_SURVIVOR) freq_listening |= COLONY_FREQ - if(FACTION_MARINE in user.faction_group) //FORECON survivors + if(GLOB.faction_datums[FACTION_MARINE] in user.faction.relations_datum.allies) //FORECON survivors freq_listening |= SOF_FREQ if(FACTION_CLF) freq_listening |= CLF_FREQS diff --git a/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm b/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm index 4b61f2740b70..6143210a3af4 100644 --- a/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm +++ b/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm @@ -16,21 +16,19 @@ vend_flags |= VEND_FACTION_THEMES /obj/structure/machinery/cm_vending/gear/antag_guns/get_listed_products(mob/user) - var/list/factions = GLOB.faction_datums if(!user) var/list/all_equipment = list() - for (var/i in 1 to length(factions)) - var/datum/faction/F = get_faction(factions[i]) - var/list/equipment = F.get_antag_guns_snowflake_equipment() - if(LAZYLEN(equipment)) + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/list/equipment = faction.get_antag_guns_snowflake_equipment() + if(length(equipment)) all_equipment += equipment return all_equipment - var/mob/living/carbon/human/H = user - var/faction = H.faction ? H.faction : FACTION_CLF - if(!(faction in listed_products)) - var/datum/faction/F = get_faction(H.faction) - listed_products[faction] = F.get_antag_guns_snowflake_equipment() + var/mob/living/carbon/human/human = user + var/datum/faction/faction = human.faction ? human.faction : GLOB.faction_datums[FACTION_CLF] + if(!(faction.code_identificator in listed_products)) + listed_products[faction.code_identificator] = faction.get_antag_guns_snowflake_equipment() return listed_products[faction] diff --git a/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm b/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm index 052cd6d82b21..e7194ea00e94 100644 --- a/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm +++ b/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm @@ -15,20 +15,18 @@ vend_flags |= VEND_FACTION_THEMES /obj/structure/machinery/cm_vending/sorted/cargo_guns/antag_guns/get_listed_products(mob/user) - var/list/factions = GLOB.faction_datums if(!user) var/list/all_equipment = list() - for (var/i in 1 to length(factions)) - var/datum/faction/F = get_faction(factions[i]) - var/list/equipment = F.get_antag_guns_sorted_equipment() - if(LAZYLEN(equipment)) + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/list/equipment = faction.get_antag_guns_sorted_equipment() + if(length(equipment)) all_equipment += equipment return all_equipment - var/mob/living/carbon/human/H = user - var/faction = H.faction ? H.faction : FACTION_CLF - if(!(faction in listed_products)) - var/datum/faction/F = get_faction(H.faction) - listed_products[faction] = F.get_antag_guns_sorted_equipment() + var/mob/living/carbon/human/human = user + var/datum/faction/faction = human.faction ? human.faction : GLOB.faction_datums[FACTION_CLF] + if(!(faction.code_identificator in listed_products)) + listed_products[faction.code_identificator] = faction.get_antag_guns_sorted_equipment() return listed_products[faction] diff --git a/code/game/objects/effects/landmarks/landmarks.dm b/code/game/objects/effects/landmarks/landmarks.dm index 7815d876b164..78efc47af503 100644 --- a/code/game/objects/effects/landmarks/landmarks.dm +++ b/code/game/objects/effects/landmarks/landmarks.dm @@ -441,6 +441,8 @@ var/job var/job_list + var/faction_to_get + /obj/effect/landmark/late_join/alpha name = "alpha late join" squad = SQUAD_MARINE_1 @@ -501,29 +503,37 @@ /obj/effect/landmark/late_join/Initialize(mapload, ...) . = ..() - if(squad) - LAZYADD(GLOB.latejoin_by_squad[squad], src) - else if(job) - LAZYADD(GLOB.latejoin_by_job[job], src) - else if(job_list) - for(var/job_to_add in job_list) - LAZYADD(GLOB.latejoin_by_job[job_to_add], src) - - else - GLOB.latejoin += src + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(faction) + if(squad) + LAZYADD(faction.late_join_landmarks[squad], src) + return + else if(job) + LAZYADD(faction.late_join_landmarks[job], src) + return + else if(job_list) + for(var/job_to_add in job_list) + LAZYADD(faction.late_join_landmarks[job_to_add], src) + return + + GLOB.latejoin += src /obj/effect/landmark/late_join/Destroy() - if(squad) - LAZYREMOVE(GLOB.latejoin_by_squad[squad], src) - else if(job) - LAZYREMOVE(GLOB.latejoin_by_job[job], src) - else if(job_list) - for(var/job_to_add in job_list) - LAZYREMOVE(GLOB.latejoin_by_job[job_to_add], src) - else - GLOB.latejoin -= src - return ..() - + . = ..() + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(faction) + if(squad) + faction.late_join_landmarks[squad] -= src + return + else if(job) + faction.late_join_landmarks[job] -= src + return + else if(job_list) + for(var/job_to_add in job_list) + faction.late_join_landmarks[job_to_add] -= src + return + + GLOB.latejoin -= src /obj/effect/landmark/late_join/responder/uscm name = "USCM HC Fax Responder late join" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 3bf46ff25c01..b4646f7612c3 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -192,7 +192,7 @@ GLOBAL_LIST_INIT(admin_verbs_debug, list( /client/proc/enable_debug_verbs, /client/proc/toggledebuglogs, /client/proc/togglenichelogs, - /client/proc/cmd_admin_change_hivenumber, + /client/proc/cmd_admin_change_faction, /client/proc/spawn_wave, /client/proc/toggle_log_hrefs, /client/proc/matrix_editor, @@ -258,7 +258,7 @@ GLOBAL_LIST_INIT(admin_mob_event_verbs_hideable, list( /client/proc/cmd_admin_direct_narrate, /client/proc/editappear, /client/proc/cmd_admin_addhud, - /client/proc/cmd_admin_change_their_hivenumber, + /client/proc/cmd_admin_change_their_faction, /client/proc/free_mob_for_ghosts, /client/proc/cmd_admin_grantfullaccess, /client/proc/cmd_admin_grantallskills, diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index 21f5504455d2..cdc60045e8d7 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -202,12 +202,10 @@ name = "Set Faction" permissions_required = R_VAREDIT -/datum/player_action/set_faction/act(client/user, mob/living/carbon/human/target, list/params) - var/new_faction = tgui_input_list(usr, "Select faction.", "Faction Choice", FACTION_LIST_HUMANOID) - if(!new_faction) - new_faction = FACTION_NEUTRAL - target.faction = new_faction - target.faction_group = list(new_faction) - - message_admins("[key_name_admin(user)][new_faction ? "" : " failed to"] set [key_name_admin(target)]'s faction to [new_faction].") +/datum/player_action/set_faction/act(client/user, mob/living/carbon/target, list/params) + var/faction_to_get = tgui_input_list(usr, "Select faction", "Faction Choice", FACTION_LIST_ALL) + if(faction_to_get) + GLOB.faction_datums[faction_to_get].add_mob(target) + + message_admins("[key_name_admin(user)][faction_to_get ? "" : " failed to"] set [key_name_admin(target)]'s faction to [faction_to_get].") return TRUE diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index be2a44e11439..96d0c272fc0d 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -6,41 +6,39 @@ to_chat(usr, "Only administrators may use this command.") return - if(!LAZYLEN(GLOB.custom_event_info_list)) + if(!length(GLOB.custom_event_info_list)) to_chat(usr, "custom_event_info_list is not initialized, tell a dev.") return var/list/temp_list = list() + var/datum/custom_event_info/event_info for(var/T in GLOB.custom_event_info_list) - var/datum/custom_event_info/CEI = GLOB.custom_event_info_list[T] - temp_list["[CEI.msg ? "(x) [CEI.faction]" : CEI.faction]"] = CEI.faction + event_info = GLOB.custom_event_info_list[T] + temp_list["[event_info.msg ? "(x) [event_info.name]" : event_info.name]"] = event_info.name - var/faction = tgui_input_list(usr, "Select faction. Ghosts will see only \"Global\" category message. Factions with event message set are marked with (x).", "Faction Choice", temp_list) - if(!faction) + var/event_info_get = temp_list[tgui_input_list(usr, "Select faction. Ghosts will see only \"Global\" category message. Factions with event message set are marked with (x).", "Faction Choice", temp_list)] + if(!event_info_get) return - faction = temp_list[faction] - - if(!GLOB.custom_event_info_list[faction]) - to_chat(usr, "Error has occurred, [faction] category is not found.") + event_info = GLOB.custom_event_info_list[event_info_get] + if(!event_info) + to_chat(usr, "Error has occurred, [event_info_get] category is not found.") return - var/datum/custom_event_info/CEI = GLOB.custom_event_info_list[faction] - - var/input = input(usr, "Enter the custom event message for \"[faction]\" category. Be descriptive. \nTo remove the event message, remove text and confirm.", "[faction] Event Message", CEI.msg) as message|null + var/input = input(usr, "Enter the custom event message for \"[event_info_get]\" category. Be descriptive. \nTo remove the event message, remove text and confirm.", "[event_info_get] Event Message", event_info.msg) as message|null if(isnull(input)) return if(input == "" || !input) - CEI.msg = "" - message_admins("[key_name_admin(usr)] has removed the event message for \"[faction]\" category.") + event_info.msg = "" + message_admins("[key_name_admin(usr)] has removed the event message for \"[event_info_get]\" category.") return - CEI.msg = html_encode(input) - message_admins("[key_name_admin(usr)] has changed the event message for \"[faction]\" category.") + event_info.msg = html_encode(input) + message_admins("[key_name_admin(usr)] has changed the event message for \"[event_info_get]\" category.") - CEI.handle_event_info_update(faction) + event_info.handle_event_info_update() /client/proc/get_whitelisted_clients() set name = "Find Whitelisted Players" diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 69d60e69cc3a..7601095db43d 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -1044,7 +1044,7 @@ to_chat(usr, "This can only be done to instances of type /mob/living/carbon/") return if(usr.client) - usr.client.cmd_admin_change_their_hivenumber(H) + usr.client.cmd_admin_change_their_faction(H) else if(href_list["makeyautja"]) if(!check_rights(R_SPAWN)) return diff --git a/code/modules/admin/topic/topic_teleports.dm b/code/modules/admin/topic/topic_teleports.dm index d90aa736b9f6..5906eae6202b 100644 --- a/code/modules/admin/topic/topic_teleports.dm +++ b/code/modules/admin/topic/topic_teleports.dm @@ -97,68 +97,36 @@ message_admins(WRAP_STAFF_LOG(owner.mob, "mass-teleported [length(targets)] mobs in [collect_range] tiles range to themselves in [get_area(owner.mob)] ([owner.mob.x],[owner.mob.y],[owner.mob.z])."), owner.mob.x, owner.mob.y, owner.mob.z) if("teleport_mobs_by_faction") - var/faction = tgui_input_list(owner, "Choose between humanoids and xenomorphs.", "Mobs Choice", list("Humanoids", "Xenomorphs")) - if(faction == "Humanoids") - faction = null - faction = tgui_input_list(owner, "Select faction you want to teleport to your location. Mobs in Thunderdome/CentComm areas won't be included.", "Faction Choice", FACTION_LIST_HUMANOID) - if(!faction) - to_chat(owner, SPAN_ALERT("Faction choice error. Aborting.")) - return - var/list/targets = GLOB.alive_human_list.Copy() - for(var/mob/living/carbon/human/H in targets) - var/area/AR = get_area(H) - if(H.faction != faction || AR.statistic_exempt) - targets.Remove(H) - if(length(targets) < 1) - to_chat(owner, SPAN_ALERT("No alive /human mobs of [faction] faction were found. Aborting.")) - return - if(alert(owner, "[length(targets)] humanoids of [faction] faction were marked for teleportation. Pressing \"TELEPORT\" will teleport them to your location at the moment of pressing button.", "Confirmation", "Teleport", "Cancel") == "Cancel") - return - - for(var/mob/M in targets) - if(!M) - continue - M.on_mob_jump() - M.forceMove(get_turf(owner.mob)) - - message_admins(WRAP_STAFF_LOG(owner.mob, "mass-teleported [length(targets)] human mobs of [faction] faction to themselves in [get_area(owner.mob)] ([owner.mob.x],[owner.mob.y],[owner.mob.z])."), owner.mob.x, owner.mob.y, owner.mob.z) - - else if(faction == "Xenomorphs") - faction = null - var/list/hives = list() - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - hives += list("[hive.name]" = hive.hivenumber) - - faction = tgui_input_list(owner, "Select hive you want to teleport to your location. Mobs in Thunderdome/CentComm areas won't be included.", "Hive Choice", hives) - if(!faction) - to_chat(owner, SPAN_ALERT("Hive choice error. Aborting.")) - return - var/datum/hive_status/Hive = GLOB.hive_datum[hives[faction]] - var/list/targets = Hive.totalXenos - for(var/mob/living/carbon/xenomorph/X in targets) - var/area/AR = get_area(X) - if(X.stat == DEAD || AR.statistic_exempt) - targets.Remove(X) - if(length(targets) < 1) - to_chat(owner, SPAN_ALERT("No alive xenomorphs of [faction] Hive were found. Aborting.")) - return - if(alert(owner, "[length(targets)] xenomorphs of [faction] Hive were marked for teleportation. Pressing \"TELEPORT\" will teleport them to your location at the moment of pressing button.", "Confirmation", "Teleport", "Cancel") == "Cancel") - return - - for(var/mob/M in targets) - if(!M) - continue - M.on_mob_jump() - M.forceMove(get_turf(owner.mob)) - - message_admins(WRAP_STAFF_LOG(owner.mob, "mass-teleported [length(targets)] xenomorph mobs of [faction] Hive to themselves in [get_area(owner.mob)] ([owner.mob.x],[owner.mob.y],[owner.mob.z])."), owner.mob.x, owner.mob.y, owner.mob.z) + var/list/datum/faction/factions = list() + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] + LAZYSET(factions, faction_to_set.name, faction_to_set) - else - to_chat(owner, SPAN_ALERT("Mobs choice error. Aborting.")) + var/choice = tgui_input_list(owner, "Select faction you want to teleport to your location. Mobs in Thunderdome/CentComm areas won't be included.", "Faction Choice", factions) + if(!choice) return + var/list/targets = factions[choice].totalMobs + for(var/mob/living/carbon/mob in targets) + var/area/area = get_area(mob) + if(mob.stat == DEAD || area.statistic_exempt) + targets.Remove(mob) + + if(!length(targets)) + to_chat(owner, SPAN_ALERT("No alive mobs of [choice] faction were found. Aborting.")) + return + + if(alert(owner, "[length(targets)] mobs of [choice] faction were marked for teleportation. Pressing \"TELEPORT\" will teleport them to your location at the moment of pressing button.", owner.auto_lang(LANGUAGE_CONFIRM), owner.auto_lang(LANGUAGE_YES), owner.auto_lang(LANGUAGE_NO)) != owner.auto_lang(LANGUAGE_YES)) + return + + for(var/mob/mob in targets) + if(!mob) + continue + mob.on_mob_jump() + mob.forceMove(get_turf(owner.mob)) + + message_admins(WRAP_STAFF_LOG(owner.mob, "mass-teleported [length(targets)] mobs of [choice] faction to themselves in [get_area(owner.mob)] ([owner.mob.x],[owner.mob.y],[owner.mob.z])."), owner.mob.x, owner.mob.y, owner.mob.z) + if("teleport_corpses") if(length(GLOB.dead_mob_list) < 0) to_chat(owner, SPAN_ALERT("No corpses found. Aborting.")) diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index eaba95481d16..c64d3d25ce5f 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -4,35 +4,6 @@ set name = "Custom Event Info" set desc = "Use to show general or faction-related custom event info, provided an admin set one." - var/category = "Global" - - var/datum/custom_event_info/CEI - - if(mob && !isobserver(mob) && !isnewplayer(mob)) - - if(isxeno(mob)) - var/mob/living/carbon/xenomorph/X = mob - if(!X.hive || !GLOB.custom_event_info_list[X.hive.name]) - to_chat(src, SPAN_WARNING("\n\n[X] has none or incorrect hive set or hive message datum was not found, tell a dev!\n\n")) - CEI = GLOB.custom_event_info_list["Global"] - else - category = tgui_input_list(src, "Select category.", "Custom Event Info", list("Global", X.hive.name)) - CEI = GLOB.custom_event_info_list[category] - - CEI.show_player_event_info(src) - return - - else if(!mob.faction || !GLOB.custom_event_info_list[mob.faction]) - to_chat(src, SPAN_WARNING("\n\n[mob] has none or incorrect faction set or faction message datum was not found, tell a dev!\n\n")) - CEI = GLOB.custom_event_info_list["Global"] - else - category = tgui_input_list(src, "Select category.", "Custom Event Info", list("Global", mob.faction)) - CEI = GLOB.custom_event_info_list[category] - - CEI.show_player_event_info(src) - return - - else - CEI = GLOB.custom_event_info_list["Global"] - CEI.show_player_event_info(src) - return + check_event_info("Global", src) + if(mob && !isobserver(mob) && !isnewplayer(mob) && mob.faction) + check_event_info(mob.faction.code_identificator, src) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 380efa3cfdf3..851560f10090 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -54,16 +54,16 @@ else alert("Invalid mob") -/client/proc/cmd_admin_change_hivenumber() +/client/proc/cmd_admin_change_faction() set category = "Debug" - set name = "Change Hivenumber" + set name = "Change faction" - var/mob/living/carbon/X = tgui_input_list(src,"Select a xeno.", "Change Hivenumber", GLOB.living_xeno_list) + var/mob/living/carbon/X = tgui_input_list(src,"Select a xeno.", "Change faction", GLOB.living_xeno_list) if(!istype(X)) to_chat(usr, "This can only be done to instances of type /mob/living/carbon") return - cmd_admin_change_their_hivenumber(X) + cmd_admin_change_their_faction(X) /client/proc/cmd_debug_toggle_should_check_for_win() set category = "Debug" diff --git a/code/modules/admin/verbs/mob_verbs.dm b/code/modules/admin/verbs/mob_verbs.dm index 40c455327e46..ccab298d4750 100644 --- a/code/modules/admin/verbs/mob_verbs.dm +++ b/code/modules/admin/verbs/mob_verbs.dm @@ -330,19 +330,21 @@ message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!") -/client/proc/cmd_admin_change_their_hivenumber(mob/living/carbon/H in GLOB.living_mob_list) - set name = "Change Hivenumber" +/client/proc/cmd_admin_change_their_faction(mob/living/carbon/H) + set name = "Change Faction" set category = null if(!istype(H)) return - var/list/hives = list() - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - hives += list("[hive.name]" = hive.hivenumber) + var/list/datum/faction/factions = list() + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] + LAZYSET(factions, faction_to_set.name, faction_to_set) - var/newhive = tgui_input_list(src,"Select a hive.", "Change Hivenumber", hives, theme="hive_status") + var/choice = tgui_input_list(src, "Select a faction.", "Change Faction", factions) + if(!choice) + return FALSE if(!H) to_chat(usr, "This mob no longer exists") @@ -350,24 +352,20 @@ if(isxeno(H)) var/mob/living/carbon/xenomorph/X = H - X.set_hive_and_update(hives[newhive]) + X.set_hive_and_update(factions[choice]) else var/was_leader = FALSE - if(H.hivenumber) - var/datum/hive_status/hive = GLOB.hive_datum[H.hivenumber] - if(H == hive.leading_cult_sl) + if(H.faction) + if(H == H.faction.leading_cult_sl) was_leader = TRUE - hive.leading_cult_sl = null + H.faction.leading_cult_sl = null - H.hivenumber = hives[newhive] + factions[choice].add_mob(H) - var/datum/hive_status/hive = GLOB.hive_datum[H.hivenumber] - H.faction = hive.internal_faction + if(was_leader && (!H.faction.leading_cult_sl || H.faction.leading_cult_sl.stat == DEAD)) + H.faction.leading_cult_sl = H - if(was_leader && (!hive.leading_cult_sl || hive.leading_cult_sl.stat == DEAD)) - hive.leading_cult_sl = H - - message_admins("[key_name(src)] changed hivenumber of [H] to [H.hivenumber].") + message_admins("[key_name(src)] changed faction of [H] to [choice].") /client/proc/cmd_admin_change_their_name(mob/living/carbon/carbon in GLOB.living_mob_list) diff --git a/code/modules/admin/verbs/select_equipment.dm b/code/modules/admin/verbs/select_equipment.dm index 1597dcb132f0..2ff649c6eeed 100644 --- a/code/modules/admin/verbs/select_equipment.dm +++ b/code/modules/admin/verbs/select_equipment.dm @@ -40,9 +40,7 @@ else switch(newrank) if("Weyland-Yutani") - - H.faction = FACTION_WY - H.faction_group = FACTION_LIST_WY + GLOB.faction_datums[FACTION_WY].add_mob(H) var/newskillset = tgui_input_list(usr, "Select a skillset", "Skill Set", (list("Keep Skillset") +GLOB.RoleAuthority.roles_by_name)) if(!newskillset || newskillset == "Keep Skillset") @@ -165,6 +163,8 @@ CRASH("arm_equipment !gear_path_presets_list[dresscode]") GLOB.gear_name_presets_list[dresscode].load_preset(M, randomise, count_participant, mob_client, show_job_gear) - if(M.faction) - M.check_event_info(M.faction) + if(mob_client) + check_event_info("Global", mob_client) + if(!isobserver(M) && M.faction) + check_event_info(M.faction.code_identificator, mob_client) return diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index dde6695448dc..be00ce5ea859 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -402,19 +402,9 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( tgui_panel.initialize() tgui_say.initialize() - var/datum/custom_event_info/CEI = GLOB.custom_event_info_list["Global"] - CEI.show_player_event_info(src) - - if(mob && !isobserver(mob) && !isnewplayer(mob)) - if(isxeno(mob)) - var/mob/living/carbon/xenomorph/X = mob - if(X.hive && GLOB.custom_event_info_list[X.hive]) - CEI = GLOB.custom_event_info_list[X.hive] - CEI.show_player_event_info(src) - - else if(mob.faction && GLOB.custom_event_info_list[mob.faction]) - CEI = GLOB.custom_event_info_list[mob.faction] - CEI.show_player_event_info(src) + check_event_info("Global", src) + if(mob && !isobserver(mob) && !isnewplayer(mob) && mob.faction) + check_event_info(mob.faction.code_identificator, src) connection_time = world.time winset(src, null, "command=\".configure graphics-hwmode on\"") diff --git a/code/modules/gear_presets/_select_equipment.dm b/code/modules/gear_presets/_select_equipment.dm index 86ad0660fc40..9c7d5fad34b0 100644 --- a/code/modules/gear_presets/_select_equipment.dm +++ b/code/modules/gear_presets/_select_equipment.dm @@ -142,8 +142,6 @@ if(assignment) ID.name += " ([assignment])" ID.access = access.Copy(1, 0) - ID.faction = faction - ID.faction_group = faction_group.Copy() ID.assignment = assignment ID.rank = rank ID.registered_name = new_human.real_name @@ -153,8 +151,6 @@ ID.paygrade = load_rank(new_human, mob_client) || ID.paygrade ID.uniform_sets = uniform_sets new_human.equip_to_slot_or_del(ID, WEAR_ID) - new_human.faction = faction - new_human.faction_group = faction_group.Copy() if(new_human.mind) new_human.mind.name = new_human.real_name // Bank account details handled in generate_money_account() @@ -165,6 +161,25 @@ new_human.set_languages(languages) /datum/equipment_preset/proc/load_preset(mob/living/carbon/human/new_human, randomise = FALSE, count_participant = FALSE, client/mob_client, show_job_gear = TRUE) + if(!istype(new_human, /mob/living/carbon/human/dummy)) + var/datum/faction/mob_faction + if(!faction) + mob_faction = GLOB.faction_datums[FACTION_NEUTRAL] + else + mob_faction = GLOB.faction_datums[faction] + + if(mob_faction && (!new_human.faction || force_update_faction)) + mob_faction.add_mob(new_human) + if(mob_faction.organ_faction_iff_tag_type) + if(new_human.organ_faction_tag) + QDEL_NULL(new_human.organ_faction_tag) + new_human.organ_faction_tag = new mob_faction.organ_faction_iff_tag_type(new_human, mob_faction) + + if(mob_faction.faction_iff_tag_type) + if(new_human.faction_tag) + QDEL_NULL(new_human.faction_tag) + new_human.faction_tag = new mob_faction.faction_iff_tag_type(new_human, mob_faction) + if(!new_human.hud_used) new_human.create_hud() diff --git a/code/modules/gear_presets/upp.dm b/code/modules/gear_presets/upp.dm index c51b9a67e810..b56d187fb2f6 100644 --- a/code/modules/gear_presets/upp.dm +++ b/code/modules/gear_presets/upp.dm @@ -15,7 +15,6 @@ allow_additional = TRUE late_joinable = TRUE scaled = FALSE - faction_menu = FACTION_UPP minimum_playtime_as_job = 0 gear_preset = /datum/equipment_preset/upp/soldier diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 03a8abef22af..c9d7bf285d06 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -40,4 +40,4 @@ if(!check_rights(R_DEBUG|R_ADMIN)) return - usr.client.cmd_admin_change_their_hivenumber(src) + usr.client.cmd_admin_change_their_faction(src) diff --git a/code/modules/mob/living/carbon/human/species/zombie.dm b/code/modules/mob/living/carbon/human/species/zombie.dm index a8b5fe86ae8a..8f837d46574a 100644 --- a/code/modules/mob/living/carbon/human/species/zombie.dm +++ b/code/modules/mob/living/carbon/human/species/zombie.dm @@ -42,9 +42,6 @@ /datum/species/zombie/handle_post_spawn(mob/living/carbon/human/zombie) zombie.set_languages(list("Zombie")) - zombie.faction = FACTION_ZOMBIE - zombie.faction_group = list(FACTION_ZOMBIE) - if(zombie.l_hand) zombie.drop_inv_item_on_ground(zombie.l_hand, FALSE, TRUE) if(zombie.r_hand) zombie.drop_inv_item_on_ground(zombie.r_hand, FALSE, TRUE) if(zombie.wear_id) qdel(zombie.wear_id) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index ed9433f238e3..f3f7e3265a9a 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -56,7 +56,7 @@ /mob/living/simple_animal/hostile/proc/evaluate_target(mob/living/target) if(target.stat) return FALSE - if((target.faction == faction || (target.faction in faction_group)) && !attack_same) + if(target.ally_faction(faction) && !attack_same) return FALSE if(WEAKREF(target) in friends) return FALSE diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index acaf54933ae3..50ead239a39e 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -45,13 +45,10 @@ //updating atom HUD refresh_huds() - if(isnewplayer(src)) - check_event_info() - else if(isxeno(src)) - var/mob/living/carbon/xenomorph/X = src - check_event_info(X.hive.name) - else if(!isobserver(src) && faction) - check_event_info(faction) + if(client) + check_event_info("Global", client) + if(!isobserver(src) && faction) + check_event_info(faction.code_identificator, client) if(client.player_details) for(var/foo in client.player_details.post_login_callbacks) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a8eead2fe629..a725c0dbec5a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -31,12 +31,15 @@ QDEL_NULL(mob_language_menu) QDEL_NULL_LIST(open_uis) + QDEL_NULL(organ_faction_tag) + QDEL_NULL(faction_tag) + faction = null + tgui_open_uis = null buckled = null skincmds = null item_verbs = null interactee = null - faction_group = null lastarea = null langchat_listeners = null langchat_image = null @@ -51,8 +54,8 @@ focus = null /mob/Initialize() - if(!faction_group) - faction_group = list(faction) + if(faction_to_get) + faction = GLOB.faction_datums[faction_to_get] GLOB.last_mob_gid++ gid = GLOB.last_mob_gid diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 80aa7e3cda2f..5b1f5974b051 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -158,8 +158,9 @@ var/job = null // Internal job title used when mob is spawned. Preds are "Predator", Xenos are "Xenomorph", Marines have their actual job title var/comm_title = "" - var/faction = FACTION_NEUTRAL - var/faction_group + + var/faction_to_get = null + var/datum/faction/faction = null var/looc_overhead = FALSE diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index 51a5988f2fd0..5478b2c39738 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -166,7 +166,7 @@ DEFINES in setup.dm, referenced here. "Event", "UPP Armsmaster", //this rank is for the Fun - Ivan preset, it allows him to use the PMC guns randomly generated from his backpack ) return TRUE - switch(user.faction) + switch(user.faction.code_identificator) if( FACTION_WY_DEATHSQUAD, FACTION_PMC, @@ -174,11 +174,7 @@ DEFINES in setup.dm, referenced here. FACTION_FREELANCER, ) return TRUE - for(var/faction in user.faction_group) - if(faction in FACTION_LIST_WY) - return TRUE - - if(user.faction in FACTION_LIST_WY) + if(user.faction.code_identificator in FACTION_LIST_WY) return TRUE to_chat(user, SPAN_WARNING("[src] flashes a warning sign indicating unauthorized use!")) @@ -543,7 +539,7 @@ DEFINES in setup.dm, referenced here. items_in_slot = get_item_by_slot(active_hand.preferred_storage[storage]) else items_in_slot = list(get_item_by_slot(active_hand.preferred_storage[storage])) - + for(var/item_in_slot in items_in_slot) if(istype(item_in_slot, storage)) var/slot = active_hand.preferred_storage[storage] @@ -560,7 +556,7 @@ DEFINES in setup.dm, referenced here. slot = WEAR_IN_HELMET if(WEAR_FEET) slot = WEAR_IN_SHOES - + if(equip_to_slot_if_possible(active_hand, slot, ignore_delay = TRUE, del_on_fail = FALSE, disable_warning = TRUE, redraw_mob = TRUE)) return TRUE if(w_uniform) diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index f58e34ce7c58..5c9549b7f53c 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -560,7 +560,7 @@ for(var/mob/living/M in orange(range, user)) // orange allows sentry to fire through gas and darkness if((M.stat & DEAD)) continue // No dead or non living. - if(M.get_target_lock(user.faction_group)) continue + if(M.ally_faction(user.faction)) continue if(angle > 0) var/opp var/adj diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 1e9f712de958..0eb9fca3169e 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -863,7 +863,7 @@ if(.) var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(SEND_SIGNAL(P, COMSIG_BULLET_CHECK_MOB_SKIPPING, src) & COMPONENT_SKIP_MOB\ - || P.runtime_iff_group && get_target_lock(P.runtime_iff_group)\ + || proj.runtime_iff_group && ally_faction(proj.runtime_iff_group)\ ) return FALSE if(mobility_aura) diff --git a/code/modules/vehicles/multitile/multitile.dm b/code/modules/vehicles/multitile/multitile.dm index 398983035837..4fd242ca01b8 100644 --- a/code/modules/vehicles/multitile/multitile.dm +++ b/code/modules/vehicles/multitile/multitile.dm @@ -66,6 +66,8 @@ // The amount of skill required to drive the vehicle var/required_skill = SKILL_VEHICLE_SMALL + var/faction_to_get = null + var/datum/faction/faction = null req_access = list() //List of accesses you need to enter req_one_access = list() //List of accesses you need one of to enter diff --git a/code/modules/vehicles/multitile/multitile_bump.dm b/code/modules/vehicles/multitile/multitile_bump.dm index f4522004a993..4bc40fe46f48 100644 --- a/code/modules/vehicles/multitile/multitile_bump.dm +++ b/code/modules/vehicles/multitile/multitile_bump.dm @@ -596,13 +596,13 @@ var/dmg = FALSE if(V.vehicle_flags & VEHICLE_CLASS_WEAK) - if(driver && get_target_lock(driver.faction)) + if(driver && ally_faction(driver.faction)) apply_effect(0.5, WEAKEN) else apply_effect(1, WEAKEN) else if(V.vehicle_flags & VEHICLE_CLASS_LIGHT) dmg = TRUE - if(get_target_lock(driver.faction)) + if(ally_faction(driver.faction)) apply_effect(0.5, WEAKEN) apply_damage(5 + rand(0, 5), BRUTE, no_limb_loss = TRUE) to_chat(V.seats[VEHICLE_DRIVER], SPAN_WARNING(SPAN_BOLD("*YOU RAMMED AN ALLY AND HURT THEM!*"))) @@ -625,7 +625,7 @@ playsound(loc, "punch", 25, 1) last_damage_data = create_cause_data("[initial(V.name)] roadkill", driver) log_attack("[key_name(src)] was rammed by [key_name(driver)] with [V].") - if(faction == driver.faction) + if(ally_faction(driver.faction)) msg_admin_ff("[key_name(driver)] rammed and damaged member of allied faction [key_name(src)] with \the [V] in [get_area(src)] [ADMIN_JMP(driver)] [ADMIN_PM(driver)]") else log_attack("[key_name(src)] was friendly pushed by [key_name(driver)] with [V].") //to be able to determine whether vehicle was pushing friendlies diff --git a/code/modules/vehicles/multitile/multitile_interaction.dm b/code/modules/vehicles/multitile/multitile_interaction.dm index b3aa9c67bbb2..152140f776db 100644 --- a/code/modules/vehicles/multitile/multitile_interaction.dm +++ b/code/modules/vehicles/multitile/multitile_interaction.dm @@ -30,7 +30,7 @@ return //only can clamp friendly vehicles - if(!get_target_lock(user.faction_group)) + if(!ally_faction(user.faction)) to_chat(user, SPAN_WARNING("You can attach clamp to vehicles of your faction only.")) return @@ -294,7 +294,7 @@ //IFF bullets magically stop themselves short of hitting friendly vehicles, //because both sentries and smartgun users keep trying to shoot through them - if(P.runtime_iff_group && get_target_lock(P.runtime_iff_group)) + if(P.runtime_iff_group && ally_faction(P.runtime_iff_group)) return if(ammo_flags & (AMMO_ANTISTRUCT|AMMO_ANTIVEHICLE)) @@ -408,7 +408,7 @@ if(door_locked && health > 0) //check if lock on and actually works if(ishuman(M)) var/mob/living/carbon/human/user = M - if(!allowed(user) || !get_target_lock(user.faction_group)) //if we are human, we check access and faction + if(!allowed(user) || !ally_faction(user.faction)) //if we are human, we check access and faction to_chat(user, SPAN_WARNING("\The [src] is locked!")) return else @@ -475,7 +475,7 @@ /obj/vehicle/multitile/proc/handle_fitting_pulled_atom(mob/living/carbon/human/user, atom/dragged_atom) if(!ishuman(user)) return - if(door_locked && health > 0 && (!allowed(user) || !get_target_lock(user.faction_group))) + if(door_locked && health > 0 && (!allowed(user) || !ally_faction(user.faction))) to_chat(user, SPAN_WARNING("\The [src] is locked!")) return diff --git a/colonialmarines.dme b/colonialmarines.dme index b49e016f633e..5226e89b4159 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -58,6 +58,7 @@ #include "code\__DEFINES\emote_panels.dm" #include "code\__DEFINES\equipment.dm" #include "code\__DEFINES\events.dm" +#include "code\__DEFINES\factions.dm" #include "code\__DEFINES\fire.dm" #include "code\__DEFINES\flags.dm" #include "code\__DEFINES\fonts.dm" @@ -584,9 +585,12 @@ #include "code\datums\factions\cmb.dm" #include "code\datums\factions\contractor.dm" #include "code\datums\factions\faction.dm" +#include "code\datums\factions\faction_modules.dm" #include "code\datums\factions\helpers.dm" +#include "code\datums\factions\iff_tag.dm" #include "code\datums\factions\nspa.dm" #include "code\datums\factions\pmc.dm" +#include "code\datums\factions\relations_datum.dm" #include "code\datums\factions\royalmarinescommando.dm" #include "code\datums\factions\upp.dm" #include "code\datums\factions\uscm.dm" @@ -2059,7 +2063,6 @@ #include "code\modules\mob\living\carbon\xenomorph\Evolution.dm" #include "code\modules\mob\living\carbon\xenomorph\Facehuggers.dm" #include "code\modules\mob\living\carbon\xenomorph\hive_faction.dm" -#include "code\modules\mob\living\carbon\xenomorph\hive_status.dm" #include "code\modules\mob\living\carbon\xenomorph\hive_status_ui.dm" #include "code\modules\mob\living\carbon\xenomorph\life.dm" #include "code\modules\mob\living\carbon\xenomorph\login.dm" From 088cadc343d8f91ae19d9fdffa861329c716dd2e Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Thu, 23 Jan 2025 08:01:10 +0500 Subject: [PATCH 02/24] some parts of what I need to dooo... ... ... there only half way tru rn I'm --- code/__DEFINES/ARES.dm | 2 +- code/__DEFINES/mode.dm | 27 +- .../__DEFINES/sentry_laptop_configurations.dm | 5 +- code/__DEFINES/typecheck/xenos.dm | 9 +- code/_globalvars/global_lists.dm | 17 - code/_onclick/human.dm | 2 +- code/_onclick/item_attack.dm | 2 +- code/_onclick/ventcrawl.dm | 2 +- code/_onclick/xeno.dm | 4 +- code/controllers/subsystem/hijack.dm | 33 +- code/controllers/subsystem/x_evolution.dm | 47 +- code/datums/components/iff_fire_prevention.dm | 2 +- code/datums/elements/bullet_trait/iff.dm | 7 +- code/datums/elements/strippable.dm | 2 +- code/datums/emergency_calls/emergency_call.dm | 10 +- code/datums/event_info_text.dm | 2 +- code/datums/factions/faction.dm | 11 +- code/datums/factions/faction_modules.dm | 974 ++++++++++++++++++ code/datums/factions/iff_tag.dm | 117 ++- code/datums/factions/relations_datum.dm | 4 +- code/datums/mob_hud.dm | 40 +- code/defines/procs/announcement.dm | 86 +- code/game/bioscans.dm | 4 +- code/game/gamemodes/cm_initialize.dm | 3 +- code/game/gamemodes/cm_process.dm | 2 +- .../colonialmarines/colonialmarines.dm | 4 +- .../colonialmarines/whiskey_outpost.dm | 10 +- .../whiskey_outpost/equipping.dm | 2 +- code/game/gamemodes/events.dm | 4 +- code/game/gamemodes/events/power_failure.dm | 10 +- code/game/gamemodes/extended/cm_vs_upp.dm | 4 +- code/game/gamemodes/extended/infection.dm | 4 +- code/game/machinery/bots/cprbot.dm | 2 +- .../game/machinery/computer/communications.dm | 2 +- .../computer/groundside_operations.dm | 5 +- code/game/machinery/door_control.dm | 4 +- code/game/machinery/nuclearbomb.dm | 14 +- .../vending/vendor_types/crew/vehicle_crew.dm | 2 +- code/game/objects/items/devices/cictablet.dm | 4 +- .../objects/items/devices/motion_detector.dm | 2 +- code/game/objects/items/explosives/mine.dm | 2 +- .../structures/crates_lockers/closets.dm | 2 +- .../structures/stool_bed_chair_nest/bed.dm | 2 +- code/modules/admin/tabs/event_tab.dm | 75 +- code/modules/admin/topic/topic.dm | 8 +- code/modules/assembly/proximity.dm | 2 +- code/modules/cm_aliens/XenoStructures.dm | 10 +- code/modules/cm_aliens/hivebuffs/hivebuff.dm | 10 +- .../structures/special/pylon_core.dm | 4 +- code/modules/cm_marines/dropship_equipment.dm | 1 - .../cm_tech/droppod/gear_access_point.dm | 4 +- code/modules/cm_tech/tech.dm | 2 +- code/modules/cm_tech/trees/marine.dm | 2 +- code/modules/defenses/bell_tower.dm | 10 +- code/modules/defenses/defenses.dm | 33 +- code/modules/defenses/planted_flag.dm | 18 +- code/modules/defenses/sentry.dm | 41 +- code/modules/defenses/sentry_computer.dm | 1 - code/modules/defenses/sentry_flamer.dm | 12 +- code/modules/defenses/tesla_coil.dm | 10 +- code/modules/events/comms_blackout.dm | 2 +- .../modules/gear_presets/_select_equipment.dm | 7 +- code/modules/gear_presets/agents.dm | 5 +- code/modules/gear_presets/cia.dm | 2 +- code/modules/gear_presets/clf.dm | 5 +- code/modules/gear_presets/cmb.dm | 6 +- code/modules/gear_presets/colonist.dm | 2 +- code/modules/gear_presets/contractor.dm | 16 +- code/modules/gear_presets/corpses.dm | 25 +- code/modules/gear_presets/dust_raider.dm | 2 +- code/modules/gear_presets/dutch.dm | 2 +- code/modules/gear_presets/fax_responders.dm | 11 +- code/modules/gear_presets/fun.dm | 10 +- code/modules/gear_presets/other.dm | 38 +- code/modules/gear_presets/pmc.dm | 6 +- code/modules/gear_presets/royal_marines.dm | 6 +- .../preset_fiorina_sciannex.dm | 2 +- ...ot_in_progress_insert_fiorina_nightmare.dm | 8 +- .../survivors/lv_522/forcon_survivors.dm | 2 - .../survivors/lv_624/clfship_insert_lv624.dm | 3 +- .../lv_624/corporate_dome_insert_lv624.dm | 1 - .../survivors/lv_759/preset_hybrisa.dm | 8 +- code/modules/gear_presets/survivors/misc.dm | 3 +- .../panic_room_insert_shivas.dm | 1 - .../crashlanding-offices_insert_bigred.dm | 9 +- .../gear_presets/survivors/survivors.dm | 11 +- .../crashlanding_upp_bar_insert_trijent.dm | 6 +- code/modules/gear_presets/synth_k9.dm | 2 +- code/modules/gear_presets/synths.dm | 21 +- code/modules/gear_presets/upp.dm | 6 +- code/modules/gear_presets/uscm.dm | 6 +- code/modules/gear_presets/uscm_event.dm | 3 +- code/modules/gear_presets/uscm_forecon.dm | 1 - code/modules/gear_presets/uscm_police.dm | 2 +- code/modules/gear_presets/uscm_ship.dm | 6 +- code/modules/gear_presets/whiteout.dm | 2 +- code/modules/gear_presets/wo.dm | 3 +- code/modules/gear_presets/wy.dm | 3 +- code/modules/gear_presets/wy_goons.dm | 3 +- code/modules/gear_presets/yautja.dm | 6 +- code/modules/mapping/mapping_helpers.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 6 +- .../living/carbon/human/human_abilities.dm | 6 +- .../mob/living/carbon/human/human_defense.dm | 35 - .../mob/living/carbon/human/human_helpers.dm | 2 +- .../living/carbon/human/human_stripping.dm | 8 +- .../mob/living/carbon/xenomorph/Xenomorph.dm | 8 - .../carbon/xenomorph/castes/Predalien.dm | 2 +- .../living/carbon/xenomorph/damage_procs.dm | 44 - .../mob/living/carbon/xenomorph/death.dm | 2 +- .../living/carbon/xenomorph/hive_status.dm | 19 +- .../living/carbon/xenomorph/items/iff_tag.dm | 77 -- .../mob/living/carbon/xenomorph/say.dm | 89 +- code/modules/mob/living/living_defines.dm | 2 - .../hostile/retaliate/giant_lizard.dm | 21 +- code/modules/objectives/mob_objectives.dm | 2 +- .../homing_projectile_component.dm | 2 +- code/modules/projectiles/projectile.dm | 2 +- .../security_levels/keycard_authentication.dm | 2 +- .../security_levels/security_levels.dm | 2 +- .../shuttle/computers/dropship_computer.dm | 2 +- code/modules/shuttle/dropship_hijack.dm | 4 +- code/modules/shuttles/marine_ferry.dm | 4 +- code/modules/shuttles/shuttle_console.dm | 2 +- code/modules/vehicles/apc/apc_command.dm | 4 +- .../vehicles/hardpoints/primary/arc_sentry.dm | 2 +- .../vehicles/multitile/multitile_bump.dm | 4 +- .../multitile/multitile_interaction.dm | 10 - colonialmarines.dme | 2 +- tgui/packages/tgui/interfaces/SentryGunUI.tsx | 1 - 130 files changed, 1512 insertions(+), 857 deletions(-) delete mode 100644 code/modules/mob/living/carbon/xenomorph/items/iff_tag.dm diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index 55aa68f97309..056d84d4acdc 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -30,7 +30,7 @@ #define ARES_RECORD_FLIGHT "Flight Record" #define ARES_RECORD_TECH "Tech Control Record" -/// Not by ARES logged through marine_announcement() +/// Not by ARES logged through faction_announcement() #define ARES_LOG_NONE 0 /// Logged with all announcements #define ARES_LOG_MAIN 1 diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 92835b659f56..72f9d05d6a33 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -274,15 +274,29 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_SOUTO "Souto Man" #define FACTION_COLONIST "Colonist" #define FACTION_YAUTJA "Yautja" -#define FACTION_HUNTED "Hunted" #define FACTION_ZOMBIE "Zombie" #define FACTION_MONKEY "Monkey" // Nanu #define FACTION_FAX "Fax Responder" +//XENOS +#define FACTION_XENOMORPH "xeno" +#define FACTION_XENOMORPH_NORMAL "xenomorph" +#define FACTION_XENOMORPH_CORRUPTED "corrupted_xenomoprh" +#define FACTION_XENOMORPH_ALPHA "alpha_xenomorph" +#define FACTION_XENOMORPH_BRAVO "bravo_xenomorph" +#define FACTION_XENOMORPH_CHARLIE "charlie_xenomorph" +#define FACTION_XENOMORPH_DELTA "delta_xenomorph" +#define FACTION_XENOMORPH_FERAL "feral_xenomorph" +#define FACTION_XENOMORPH_FORSAKEN "forsaken_xenomorph" +#define FACTION_XENOMORPH_TAMED "tamed_xenomorph" +#define FACTION_XENOMORPH_MUTATED "mutated_xenomorph" +#define FACTION_XENOMORPH_YAUTJA "yautja_xenomorph" +#define FACTION_XENOMORPH_RENEGADE "renegade_xenomorph" +#define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE) #define FACTION_LIST_MARINE list(FACTION_MARINE) -#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_HUNTED, FACTION_FAX) +#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_FAX) #define FACTION_LIST_ERT_OTHER list(FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO) -#define FACTION_LIST_ERT_ALL list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY, FACTION_CLF, FACTION_CONTRACTOR, FACTION_UPP, FACTION_FREELANCER, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_MARSHAL, FACTION_TWE, FACTION_HUNTED) +#define FACTION_LIST_ERT_ALL list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY, FACTION_CLF, FACTION_CONTRACTOR, FACTION_UPP, FACTION_FREELANCER, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_MARSHAL, FACTION_TWE) #define FACTION_LIST_WY list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) #define FACTION_LIST_UPP list(FACTION_UPP) #define FACTION_LIST_CLF list(FACTION_CLF) @@ -292,13 +306,6 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_LIST_MERCENARY list(FACTION_MERCENARY) #define FACTION_LIST_MARSHAL list(FACTION_MARSHAL) #define FACTION_LIST_DUTCH list(FACTION_DUTCH) -#define FACTION_LIST_SURVIVOR_WY list(FACTION_SURVIVOR, FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) -#define FACTION_LIST_SURVIVOR_NSPA list(FACTION_SURVIVOR, FACTION_NSPA, FACTION_TWE) -#define FACTION_LIST_MARINE_WY list(FACTION_MARINE, FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) -#define FACTION_LIST_MARINE_UPP list(FACTION_MARINE, FACTION_UPP) -#define FACTION_LIST_MARINE_TWE list(FACTION_MARINE, FACTION_TWE) -#define FACTION_LIST_YAUTJA list(FACTION_YAUTJA) -#define FACTION_LIST_HUNTED list(FACTION_HUNTED) #define FACTION_LIST_ALL FACTION_LIST_HUMANOID + FACTION_LIST_XENOMORPH diff --git a/code/__DEFINES/sentry_laptop_configurations.dm b/code/__DEFINES/sentry_laptop_configurations.dm index 86c7e646c38a..a3be0a383fa8 100644 --- a/code/__DEFINES/sentry_laptop_configurations.dm +++ b/code/__DEFINES/sentry_laptop_configurations.dm @@ -1,6 +1,5 @@ -#define SENTRY_FACTION_WEYLAND "WY" -#define SENTRY_FACTION_HUMAN "HUMAN" -#define SENTRY_FACTION_COLONY "COLONY" +#define SENTRY_FACTION_own "OWN" +#define SENTRY_FACTION_ALLY "ALLY" #define ROF_SINGLE "SINGLE" #define ROF_BURST "BURST" diff --git a/code/__DEFINES/typecheck/xenos.dm b/code/__DEFINES/typecheck/xenos.dm index 34b70ac92f45..b76f6309a2a2 100644 --- a/code/__DEFINES/typecheck/xenos.dm +++ b/code/__DEFINES/typecheck/xenos.dm @@ -31,17 +31,14 @@ if(!istype(attempt_harm_mob)) return FALSE - if(!hive) - hive = GLOB.hive_datum[hivenumber] - - if(!hive) + if(!faction) return FALSE - if(hivenumber == XENO_HIVE_RENEGADE) + if(faction.code_identificator == XENO_HIVE_RENEGADE) var/datum/hive_status/corrupted/renegade/renegade_hive = hive return renegade_hive.iff_protection_check(src, attempt_harm_mob) - return hive.is_ally(attempt_harm_mob) + return attempt_harm_mob.ally_faction(faction) // need this to set the data for walls/eggs/huggers when they are initialized /proc/set_hive_data(atom/focused_atom, hivenumber) diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index 80c29f8d630b..3409b199ec32 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -203,23 +203,6 @@ GLOBAL_LIST_INIT(language_keys, setup_language_keys()) //table of say codes for GLOBAL_REFERENCE_LIST_INDEXED(origins, /datum/origin, name) GLOBAL_LIST_INIT(player_origins, USCM_ORIGINS) -//Xeno hives -GLOBAL_LIST_INIT_TYPED(hive_datum, /datum/hive_status, list( - XENO_HIVE_NORMAL = new /datum/hive_status(), - XENO_HIVE_CORRUPTED = new /datum/hive_status/corrupted(), - XENO_HIVE_ALPHA = new /datum/hive_status/alpha(), - XENO_HIVE_BRAVO = new /datum/hive_status/bravo(), - XENO_HIVE_CHARLIE = new /datum/hive_status/charlie(), - XENO_HIVE_DELTA = new /datum/hive_status/delta(), - XENO_HIVE_FERAL = new /datum/hive_status/feral(), - XENO_HIVE_TAMED = new /datum/hive_status/corrupted/tamed(), - XENO_HIVE_MUTATED = new /datum/hive_status/mutated(), - XENO_HIVE_FORSAKEN = new /datum/hive_status/forsaken(), - XENO_HIVE_YAUTJA = new /datum/hive_status/yautja(), - XENO_HIVE_RENEGADE = new /datum/hive_status/corrupted/renegade(), - XENO_HIVE_TUTORIAL = new /datum/hive_status/tutorial() -)) - GLOBAL_VAR_INIT(king_acquisition_time, 1 HOURS + 30 MINUTES + rand(0, 25) MINUTES) GLOBAL_LIST_INIT(xeno_evolve_times, setup_xeno_evolve_times()) diff --git a/code/_onclick/human.dm b/code/_onclick/human.dm index 2a8cfb88bd99..bbdb952d6b72 100644 --- a/code/_onclick/human.dm +++ b/code/_onclick/human.dm @@ -104,7 +104,7 @@ var/obj/item/back_item = xeno.back 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)) + if(!carbon_user || !carbon_user.ally_faction(xeno.faction)) 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!")) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index c5c44afd0216..808e8469131e 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -46,7 +46,7 @@ /obj/item/proc/attack(mob/living/M, mob/living/user) - if((flags_item & NOBLUDGEON) || (MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_attacking_corpses) && M.stat == DEAD && !user.ally_mob(mob))) + if((flags_item & NOBLUDGEON) || (MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_attacking_corpses) && M.stat == DEAD && !user.ally_faction(M.faction))) return FALSE if(SEND_SIGNAL(M, COMSIG_ITEM_ATTEMPT_ATTACK, user, src) & COMPONENT_CANCEL_ATTACK) //Sent by target mob. diff --git a/code/_onclick/ventcrawl.dm b/code/_onclick/ventcrawl.dm index 72fe31f35cdc..9dbd3ba8a11c 100644 --- a/code/_onclick/ventcrawl.dm +++ b/code/_onclick/ventcrawl.dm @@ -72,7 +72,7 @@ var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in vent_found.loc if(W) var/mob/living/carbon/xenomorph/X = src - if(!istype(X) || X.hivenumber != W.linked_hive.hivenumber) + if(!istype(X) || X.faction != W.linked_hive) to_chat(src, SPAN_WARNING("The weeds are blocking the entrance of this vent")) return diff --git a/code/_onclick/xeno.dm b/code/_onclick/xeno.dm index 2894d9f370d4..0d2bfb332607 100644 --- a/code/_onclick/xeno.dm +++ b/code/_onclick/xeno.dm @@ -38,11 +38,11 @@ if (T && ignores_resin) // Will not target resin walls and doors if this is set to true. This is normally only set to true through a directional attack. if(istype(T, /obj/structure/mineral_door/resin)) var/obj/structure/mineral_door/resin/attacked_door = T - if(hivenumber == attacked_door.hivenumber) + if(faction == attacked_door.faction) return FALSE if(istype(T, /turf/closed/wall/resin)) var/turf/closed/wall/resin/attacked_wall = T - if(hivenumber == attacked_wall.hivenumber) + if(faction == attacked_wall.faction) return FALSE target = target.handle_barriers(src, , (PASS_MOB_THRU_XENO|PASS_TYPE_CRAWLER)) // Checks if target will be attacked by the current alien OR if the blocker will be attacked diff --git a/code/controllers/subsystem/hijack.dm b/code/controllers/subsystem/hijack.dm index 66f2968335fa..eea9e68bf2b7 100644 --- a/code/controllers/subsystem/hijack.dm +++ b/code/controllers/subsystem/hijack.dm @@ -173,13 +173,13 @@ SUBSYSTEM_DEF(hijack) message += "\nDue to low orbit, extra fuel is required for non-surface evacuations.\nMaintain fueling functionality for optimal evacuation conditions." - marine_announcement(message, HIJACK_ANNOUNCE) + faction_announcement(message, HIJACK_ANNOUNCE) ///Called when an area power status is changed to announce that it has been changed /datum/controller/subsystem/hijack/proc/announce_area_power_change(area/changed_area) var/message = "[changed_area] - [changed_area.power_equip ? "Online" : "Offline"]" - marine_announcement(message, HIJACK_ANNOUNCE) + faction_announcement(message, HIJACK_ANNOUNCE) ///Called to announce to xenos the state of evacuation progression /datum/controller/subsystem/hijack/proc/announce_progress() @@ -200,31 +200,30 @@ SUBSYSTEM_DEF(hijack) if(marine_warning_areas) marine_warning_areas = copytext(marine_warning_areas, 1, -2) - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue switch(announce) if(1) - xeno_announcement(SPAN_XENOANNOUNCE("The talls are a quarter of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), hive.hivenumber, XENO_HIJACK_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The talls are a quarter of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), faction, XENO_HIJACK_ANNOUNCE) if(2) - xeno_announcement(SPAN_XENOANNOUNCE("The talls are half way towards their goals. Disable the following areas: [xeno_warning_areas]"), hive.hivenumber, XENO_HIJACK_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The talls are half way towards their goals. Disable the following areas: [xeno_warning_areas]"), faction, XENO_HIJACK_ANNOUNCE) if(3) - xeno_announcement(SPAN_XENOANNOUNCE("The talls are three quarters of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), hive.hivenumber, XENO_HIJACK_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The talls are three quarters of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), faction, XENO_HIJACK_ANNOUNCE) if(4) - xeno_announcement(SPAN_XENOANNOUNCE("The talls have completed their goals!"), hive.hivenumber, XENO_HIJACK_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The talls have completed their goals!"), faction, XENO_HIJACK_ANNOUNCE) switch(announce) if(1) - marine_announcement("Emergency fuel replenishment is at 25 percent. Lifeboat early launch is now available. Recommendation: wait for 100% fuel for safety purposes.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) + faction_announcement("Emergency fuel replenishment is at 25 percent. Lifeboat early launch is now available. Recommendation: wait for 100% fuel for safety purposes.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) if(2) - marine_announcement("Emergency fuel replenishment is at 50 percent.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) + faction_announcement("Emergency fuel replenishment is at 50 percent.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) if(3) - marine_announcement("Emergency fuel replenishment is at 75 percent.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) + faction_announcement("Emergency fuel replenishment is at 75 percent.[marine_warning_areas ? "\nTo increase speed, restore power to the following areas: [marine_warning_areas]" : " All fueling areas operational."]", HIJACK_ANNOUNCE) if(4) - marine_announcement("Emergency fuel replenishment is at 100 percent. Safe utilization of lifeboats and pods is now possible.", HIJACK_ANNOUNCE) + faction_announcement("Emergency fuel replenishment is at 100 percent. Safe utilization of lifeboats and pods is now possible.", HIJACK_ANNOUNCE) if(!admin_sd_blocked) addtimer(CALLBACK(src, PROC_REF(unlock_self_destruct)), 8 SECONDS) @@ -299,7 +298,7 @@ SUBSYSTEM_DEF(hijack) /datum/controller/subsystem/hijack/proc/unlock_self_destruct() sd_time_remaining = sd_max_time sd_unlocked = TRUE - marine_announcement("Fuel reserves full. Manual detonation of fuel reserves by overloading the on-board fusion reactors now possible.", HIJACK_ANNOUNCE) + faction_announcement("Fuel reserves full. Manual detonation of fuel reserves by overloading the on-board fusion reactors now possible.", HIJACK_ANNOUNCE) /datum/controller/subsystem/hijack/proc/on_generator_overload(obj/structure/machinery/power/reactor/source, new_overloading) SIGNAL_HANDLER @@ -347,7 +346,7 @@ SUBSYSTEM_DEF(hijack) /datum/controller/subsystem/hijack/proc/announce_sd_halfway() ares_sd_announced = TRUE - marine_announcement("ALERT: Fusion reactor meltdown has reached fifty percent.", HIJACK_ANNOUNCE) + faction_announcement("ALERT: Fusion reactor meltdown has reached fifty percent.", HIJACK_ANNOUNCE) /datum/controller/subsystem/hijack/proc/detonate_sd() set waitfor = FALSE @@ -364,7 +363,7 @@ SUBSYSTEM_DEF(hijack) sleep(7 SECONDS) shakeship(2, 10, TRUE) - marine_announcement("ALERT: Fusion reactors dangerously overloaded. Runaway meltdown in reactor core imminent.", HIJACK_ANNOUNCE) + faction_announcement("ALERT: Fusion reactors dangerously overloaded. Runaway meltdown in reactor core imminent.", HIJACK_ANNOUNCE) sleep(5 SECONDS) var/sound_picked = pick('sound/theme/nuclear_detonation1.ogg','sound/theme/nuclear_detonation2.ogg') diff --git a/code/controllers/subsystem/x_evolution.dm b/code/controllers/subsystem/x_evolution.dm index 857af8117df2..e8f50b8af983 100644 --- a/code/controllers/subsystem/x_evolution.dm +++ b/code/controllers/subsystem/x_evolution.dm @@ -15,26 +15,21 @@ SUBSYSTEM_DEF(xevolution) var/force_boost_power = FALSE // Debugging only /datum/controller/subsystem/xevolution/Initialize(start_timeofday) - var/datum/hive_status/HS - for(var/hivenumber in GLOB.hive_datum) - HS = GLOB.hive_datum[hivenumber] - boost_power[HS.hivenumber] = 1 - overridden_power[HS.hivenumber] = FALSE + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + boost_power[faction_to_get] = 1 + overridden_power[faction_to_get] = FALSE return SS_INIT_SUCCESS /datum/controller/subsystem/xevolution/fire(resumed = FALSE) - var/datum/hive_status/HS - for(var/hivenumber in GLOB.hive_datum) - HS = GLOB.hive_datum[hivenumber] - if(!HS) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + if(overridden_power[faction_to_get]) continue - if(overridden_power[HS.hivenumber]) - continue - - if(!HS.dynamic_evolution) - boost_power[HS.hivenumber] = HS.evolution_rate + HS.evolution_bonus - HS.hive_ui.update_burrowed_larva() + if(!faction_module.dynamic_evolution) + boost_power[faction_to_get] = faction_module.evolution_rate + faction_module.evolution_bonus + faction_module.update_burrowed_larva() continue var/boost_power_new @@ -45,25 +40,25 @@ SUBSYSTEM_DEF(xevolution) boost_power_new = 1 //Add on any bonuses from thie hivecore after applying upgrade progress - boost_power_new += (0.5 * HS.has_special_structure(XENO_STRUCTURE_CORE)) + boost_power_new += (0.5 * faction_module.has_special_structure(XENO_STRUCTURE_CORE)) boost_power_new = clamp(boost_power_new, BOOST_POWER_MIN, BOOST_POWER_MAX) - boost_power_new += HS.evolution_bonus + boost_power_new += faction_module.evolution_bonus if(!force_boost_power) - boost_power[HS.hivenumber] = boost_power_new + boost_power[faction_to_get] = boost_power_new //Update displayed Evilution, which is under larva apparently - HS.hive_ui.update_burrowed_larva() + faction_module.update_burrowed_larva() -/datum/controller/subsystem/xevolution/proc/get_evolution_boost_power(hivenumber) - return boost_power[hivenumber] +/datum/controller/subsystem/xevolution/proc/get_evolution_boost_power(faction_to_get) + return boost_power[faction_to_get] -/datum/controller/subsystem/xevolution/proc/override_power(hivenumber, power, override) - var/datum/hive_status/hive_status = GLOB.hive_datum[hivenumber] - boost_power[hivenumber] = power - overridden_power[hivenumber] = override - hive_status.hive_ui.update_burrowed_larva() +/datum/controller/subsystem/xevolution/proc/override_power(faction_to_get, power, override) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_module(FACTION_MODULE_HIVE_MIND) + boost_power[faction_to_get] = power + overridden_power[faction_to_get] = override + faction_module.update_burrowed_larva() #undef EVOLUTION_INCREMENT_TIME #undef BOOST_POWER_MIN diff --git a/code/datums/components/iff_fire_prevention.dm b/code/datums/components/iff_fire_prevention.dm index bd9e3a3d06e5..28d8fc58e194 100644 --- a/code/datums/components/iff_fire_prevention.dm +++ b/code/datums/components/iff_fire_prevention.dm @@ -78,7 +78,7 @@ if(checked_living.body_position == LYING_DOWN && projectile_to_fire.original != checked_living) continue - if(checked_living.ally_mob(user)) + if(checked_living.ally_faction(user.faction)) if(HAS_TRAIT(checked_living, TRAIT_CLOAKED)) continue if(COOLDOWN_FINISHED(src, iff_halt_cooldown) && user.client) diff --git a/code/datums/elements/bullet_trait/iff.dm b/code/datums/elements/bullet_trait/iff.dm index cee36acbed80..1c8dade8317c 100644 --- a/code/datums/elements/bullet_trait/iff.dm +++ b/code/datums/elements/bullet_trait/iff.dm @@ -33,7 +33,7 @@ /datum/element/bullet_trait_iff/proc/check_iff(datum/target, mob/living/carbon/human/projectile_target) SIGNAL_HANDLER - if(projectile_target.get_target_lock(iff_group)) + if(projectile_target.ally_faction(iff_group)) return COMPONENT_SKIP_MOB /datum/element/bullet_trait_iff/proc/set_iff(datum/target, mob/living/carbon/human/firer) @@ -45,12 +45,9 @@ // We have a "cache" to avoid getting ID card iff every shot, // The cache is reset when the user drops their ID /datum/element/bullet_trait_iff/proc/get_user_iff_group(mob/living/carbon/human/user) - if(!ishuman(user)) - return user?.faction_group - var/iff_group = LAZYACCESS(iff_group_cache, user) if(isnull(iff_group)) - iff_group = user.get_id_faction_group() + iff_group = user.faction LAZYSET(iff_group_cache, user, iff_group) // Remove them from the cache if they are deleted RegisterSignal(user, COMSIG_HUMAN_EQUIPPED_ITEM, PROC_REF(handle_id_equip)) diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index b43695b84bdc..7ecd321ed680 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -139,7 +139,7 @@ if (ishuman(source)) var/mob/living/carbon/human/sourcehuman = source - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.ally_faction(user.faction)) to_chat(user, SPAN_WARNING("You can't strip items of a crit or dead member of another faction!")) return FALSE diff --git a/code/datums/emergency_calls/emergency_call.dm b/code/datums/emergency_calls/emergency_call.dm index 5aabc8e685f0..ef05e1934912 100644 --- a/code/datums/emergency_calls/emergency_call.dm +++ b/code/datums/emergency_calls/emergency_call.dm @@ -235,7 +235,7 @@ message_admins("Distress beacon: '[name]' activated [hostility? "[SPAN_WARNING("(THEY ARE HOSTILE)")]":"(they are friendly)"]. Looking for candidates.") if(!quiet_launch) - marine_announcement("A distress beacon has been launched from the [MAIN_SHIP_NAME].", "Priority Alert", 'sound/AI/distressbeacon.ogg', logging = ARES_LOG_SECURITY) + faction_announcement("A distress beacon has been launched from the [MAIN_SHIP_NAME].", "Priority Alert", 'sound/AI/distressbeacon.ogg', logging = ARES_LOG_SECURITY) addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/emergency_call, spawn_candidates), quiet_launch, announce_incoming, override_spawn_loc), 30 SECONDS) @@ -255,7 +255,7 @@ candidates = list() if(!quiet_launch) - marine_announcement("The distress signal has not received a response, the launch tubes are now recalibrating.", "Distress Beacon", logging = ARES_LOG_SECURITY) + faction_announcement("The distress signal has not received a response, the launch tubes are now recalibrating.", "Distress Beacon", logging = ARES_LOG_SECURITY) return //We've got enough! @@ -285,7 +285,7 @@ to_chat(I.current, SPAN_WARNING("You didn't get selected to join the distress team. Better luck next time!")) if(announce_incoming) - marine_announcement(dispatch_message, "Distress Beacon", 'sound/AI/distressreceived.ogg', logging = ARES_LOG_SECURITY) //Announcement that the Distress Beacon has been answered, does not hint towards the chosen ERT + faction_announcement(dispatch_message, "Distress Beacon", 'sound/AI/distressreceived.ogg', logging = ARES_LOG_SECURITY) //Announcement that the Distress Beacon has been answered, does not hint towards the chosen ERT message_admins("Distress beacon: [src.name] finalized, setting up candidates. [hostility? "[SPAN_WARNING("(THEY ARE HOSTILE)")]":"(they are friendly)"].") @@ -345,9 +345,9 @@ candidates = list() if(arrival_message && announce_incoming) if(prob(chance_hidden)) - marine_announcement(static_message, "Intercepted Transmission:") + faction_announcement(static_message, "Intercepted Transmission:") else - marine_announcement(arrival_message, "Intercepted Transmission:") + faction_announcement(arrival_message, "Intercepted Transmission:") for(var/datum/mind/spawned as anything in members) if(ishuman(spawned.current)) diff --git a/code/datums/event_info_text.dm b/code/datums/event_info_text.dm index 2c947146bfcb..37bce396bc69 100644 --- a/code/datums/event_info_text.dm +++ b/code/datums/event_info_text.dm @@ -50,7 +50,7 @@ dat += SPAN_ALERT("[msg]
") to_world(dat) else - for(var/mob/creature in faction.totalM_mobs) + for(var/mob/creature in faction.total_mobs) show_player_event_info(creature.client) /proc/check_event_info(category = "glob", client/user) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index 9c2db52d5799..a6bd4c6cfdac 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -6,6 +6,7 @@ var/faction_flags = NO_FLAGS var/hud_type = FACTION_HUD + var/color = "#22888a" var/relations_pregen[] = RELATIONS_NEUTRAL var/datum/faction_module/relations/relations_datum @@ -85,12 +86,10 @@ return FALSE // Hard times, so basicaly if you organical... domain faction... You can figure it out on your self, without HIGH tech shit. - if(organ_faction_tag || (faction.faction_flags & FACTION_ORGANICAL_DOMAIN && ally_faction.faction_flags & FACTION_ORGANICAL_DOMAIN)) - if(organ_faction_tag) - return ally_faction.organ_faction_tag_is_ally(organ_faction_tag) - else if(faction_tag) - return ally_faction.faction_tag_is_ally(faction_tag) - return FALSE + if(organ_faction_tag) + . += ally_faction.organ_faction_tag_is_ally(organ_faction_tag) + if(faction_tag) + . += ally_faction.faction_tag_is_ally(faction_tag) /datum/faction/proc/organ_faction_tag_is_ally(obj/item/faction_tag/organ/organ_tag) if(organ_tag.faction == src) diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index ecdfcbb55a06..0653c394e498 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -1,3 +1,977 @@ /datum/faction_module +/datum/faction_module/proc/add_mob(mob/living/carbon/creature) + /datum/faction_module/hive_mind + /// Short Hive ID as string used in stats reporting + var/reporting_id = "normal" + + var/mob/living/carbon/xenomorph/queen/living_xeno_queen + var/egg_planting_range = 15 + var/slashing_allowed = XENO_SLASH_ALLOWED //This initial var allows the queen to turn on or off slashing. Slashing off means harm intent does much less damage. + var/construction_allowed = NORMAL_XENO //Who can place construction nodes for special structures + var/destruction_allowed = NORMAL_XENO //Who can destroy special structures + var/unnesting_allowed = TRUE + var/hive_orders = "" //What orders should the hive have + var/prefix = "" + var/queen_leader_limit = 2 + var/list/open_xeno_leader_positions = list(1, 2) // Ordered list of xeno leader positions (indexes in xeno_leader_list) that are not occupied + var/list/xeno_leader_list[2] // Ordered list (i.e. index n holds the nth xeno leader) + var/stored_larva = 0 + + ///used by /datum/hive_status/proc/increase_larva_after_burst() to support non-integer increases to larva + var/partial_larva = 0 + /// Assoc list of free slots available to specific castes + var/list/free_slots = list( + /datum/caste_datum/burrower = 1, + /datum/caste_datum/hivelord = 1, + /datum/caste_datum/carrier = 1 + ) + /// Assoc list of slots currently used by specific castes (for calculating free_slot usage) + var/list/used_slots = list() + /// list of living tier2 xenos + var/list/tier_2_xenos = list() + /// list of living tier3 xenos + var/list/tier_3_xenos = list() + /// list of living xenos + var/list/totalXenos = list() + /// list of previously living xenos (hardrefs currently) + var/list/total_dead_xenos = list() + var/xeno_queen_timer + var/isSlotOpen = TRUE //Set true for starting alerts only after the hive has reached its full potential + var/allowed_nest_distance = 15 //How far away do we allow nests from an ovied Queen. Default 15 tiles. + var/obj/effect/alien/resin/special/pylon/core/hive_location = null //Set to ref every time a core is built, for defining the hive location + + var/tier_slot_multiplier = 1 + var/larva_gestation_multiplier = 1 + var/bonus_larva_spawn_chance = 1 + var/hijack_burrowed_surge = FALSE //at hijack, start spawning lots of burrowed + /// how many burrowed is going to spawn during larva surge + var/hijack_burrowed_left = 0 + + var/dynamic_evolution = TRUE + var/evolution_rate = 3 // Only has use if dynamic_evolution is false + var/evolution_bonus = 0 + + var/allow_no_queen_actions = FALSE + var/allow_no_queen_evo = FALSE + var/evolution_without_ovipositor = TRUE //Temporary for the roundstart. + /// Set to false if you want to prevent evolutions into Queens + var/allow_queen_evolve = TRUE + /// Set to true if you want to prevent bursts and spawns of new xenos. Will also prevent healing if the queen no longer exists + var/hardcore = FALSE + /// Set to false if you want to prevent getting burrowed larva from latejoin marines + var/latejoin_burrowed = TRUE + /// If hit limit of larva from pylons + var/hit_larva_pylon_limit = FALSE + + var/see_humans_on_tacmap = FALSE + + var/list/hive_inherant_traits + + // Cultist Info + var/mob/living/carbon/leading_cult_sl + + //List of how many maximum of each special structure you can have + var/list/hive_structures_limit = list( + XENO_STRUCTURE_CORE = 1, + XENO_STRUCTURE_CLUSTER = 8, + XENO_STRUCTURE_EGGMORPH = 6, + XENO_STRUCTURE_RECOVERY = 6, + XENO_STRUCTURE_PYLON = 2, + ) + + var/global/list/hive_structure_types = list( + XENO_STRUCTURE_CORE = /datum/construction_template/xenomorph/core, + XENO_STRUCTURE_CLUSTER = /datum/construction_template/xenomorph/cluster, + XENO_STRUCTURE_EGGMORPH = /datum/construction_template/xenomorph/eggmorph, + XENO_STRUCTURE_RECOVERY = /datum/construction_template/xenomorph/recovery + ) + + var/list/list/hive_structures = list() //Stringref list of structures that have been built + var/list/list/hive_constructions = list() //Stringref list of structures that are being built + + var/datum/hive_status_ui/hive_ui + var/datum/mark_menu_ui/mark_ui + + var/list/tunnels = list() + + var/list/resin_marks = list() + + var/hivecore_cooldown = FALSE + + var/need_round_end_check = FALSE + + //Joining as Facehugger vars + /// When can huggers join the round + var/hugger_timelock = 15 MINUTES + /// How many huggers can the hive support + var/playable_hugger_limit = 0 + /// Minimum number of huggers available at any hive size + var/playable_hugger_minimum = 2 + /// This number divides the total xenos counted for slots to give the max number of facehuggers + var/playable_hugger_max_divisor = 4 + + /// How many lesser drones the hive can support + var/lesser_drone_limit = 0 + /// Slots available for lesser drones will never go below this number + var/lesser_drone_minimum = 2 + /// This number divides the total xenos counted for slots to give the max number of lesser drones + var/playable_lesser_drones_max_divisor = 3 + + var/datum/tacmap/drawing/xeno/tacmap + var/minimap_type = MINIMAP_FLAG_XENO + + var/list/available_nicknumbers = list() + + + /// Hive buffs + var/buff_points = HIVE_STARTING_BUFFPOINTS + var/max_buff_points = HIVE_MAX_BUFFPOINTS + + /// List of references to the currently active hivebuffs + var/list/active_hivebuffs + /// List of references to used hivebuffs + var/list/used_hivebuffs + /// List of references to used hivebuffs currently on cooldown + var/list/cooldown_hivebuffs + + /// List of references to hive pylons active in the game world + var/list/active_endgame_pylons + + /*Stores the image()'s for the xeno evolution radial menu + To add an image for your caste - add an icon to icons/mob/xenos/radial_xenos.dmi + Icon size should be 32x32, to make them fit within the radial menu border size your icon 22x22 and leave 10px transparent border. + The name of the icon should be the same as the XENO_CASTE_ define for that caste eg. #define XENO_CASTE_DRONE "Drone" + */ + var/static/list/evolution_menu_images + + /// Has a King hatchery + var/has_hatchery = FALSE + +/* +/datum/hive_status/New() + hive_ui = new(src) + mark_ui = new(src) + faction_ui = new(src) + minimap_type = get_minimap_flag_for_faction(hivenumber) + tacmap = new(src, minimap_type) + if(!internal_faction) + internal_faction = name + for(var/number in 1 to 999) + available_nicknumbers += number + LAZYINITLIST(active_hivebuffs) + LAZYINITLIST(used_hivebuffs) + LAZYINITLIST(active_endgame_pylons) + + if(hivenumber != XENO_HIVE_NORMAL) + return + + if(!evolution_menu_images) + evolution_menu_images = list() + generate_evo_menu_images() + + RegisterSignal(SSdcs, COMSIG_GLOB_POST_SETUP, PROC_REF(post_setup)) +*/ +///Generate the image()'s requried for the evolution radial menu. +/datum/hive_status/proc/generate_evo_menu_images() + for(var/datum/caste_datum/caste as anything in subtypesof(/datum/caste_datum)) + evolution_menu_images[initial(caste.caste_type)] = image('icons/mob/xenos/radial_xenos.dmi', initial(caste.caste_type)) + +/datum/hive_status/proc/post_setup() + SIGNAL_HANDLER + + setup_evolution_announcements() + setup_pylon_limits() + +/datum/hive_status/proc/setup_evolution_announcements() + for(var/time in GLOB.xeno_evolve_times) + if(time == "0") + continue + + addtimer(CALLBACK(src, PROC_REF(announce_evolve_available), GLOB.xeno_evolve_times[time]), text2num(time)) + +/// Sets up limits on pylons in New() for potential futureproofing with more static comms +/datum/hive_status/proc/setup_pylon_limits() + hive_structures_limit[XENO_STRUCTURE_PYLON] = length(GLOB.all_static_telecomms_towers) || 2 + +/datum/hive_status/proc/announce_evolve_available(list/datum/caste_datum/available_castes) + + var/list/castes_available = list() + for(var/datum/caste_datum/current_caste as anything in available_castes) + castes_available += initial(current_caste.caste_type) + + var/castes = castes_available.Join(", ") + xeno_message(SPAN_XENOANNOUNCE("The Hive is now strong enough to support: [castes]")) + xeno_maptext("The Hive can now support: [castes]", "Hive Strengthening") + + +// Adds a xeno to this hive +/datum/faction_module/hive_mind/add_mob(mob/living/carbon/creature) + if(isqueen(X)) + if(!living_xeno_queen && !should_block_game_interaction(X)) // Don't consider xenos in admin level + set_living_xeno_queen(X) + X.set_faction(internal_faction) + + if(X.hud_list) + X.hud_update() + + var/area/A = get_area(X) + if(!should_block_game_interaction(X) || (A.flags_atom & AREA_ALLOW_XENO_JOIN)) + totalXenos += X + if(X.tier == 2) + tier_2_xenos += X + else if(X.tier == 3) + tier_3_xenos += X + + // Xenos are a fuckfest of cross-dependencies of different datums that are initialized at different times + // So don't even bother trying updating UI here without large refactors + +// Removes the xeno from the hive +/datum/hive_status/proc/remove_xeno(mob/living/carbon/xenomorph/xeno, hard = FALSE, light_mode = FALSE) + if(!xeno || !istype(xeno)) + return + + // Make sure the xeno was in the hive in the first place + if(!(xeno in totalXenos)) + return + + // This might be a redundant check now that Queen/Destroy() checks, but doesn't hurt to double check + if(living_xeno_queen == xeno) + var/mob/living/carbon/xenomorph/queen/next_queen = null + for(var/mob/living/carbon/xenomorph/queen/queen in totalXenos) + if(!should_block_game_interaction(queen) && queen != src && !QDELETED(queen)) + next_queen = queen + break + + set_living_xeno_queen(next_queen) // either null or a queen + + // We allow "soft" removals from the hive (the xeno still retains information about the hive) + // This is so that xenos can add themselves back to the hive if they should die or otherwise go "on leave" from the hive + if(hard) + xeno.hivenumber = 0 + xeno.hive = null +#ifndef UNIT_TESTS // Since this is a hard ref, we shouldn't confuse create_and_destroy + else + total_dead_xenos += xeno +#endif + + totalXenos -= xeno + if(xeno.tier == 2) + tier_2_xenos -= xeno + else if(xeno.tier == 3) + tier_3_xenos -= xeno + + // Only handle free slots if the xeno is not in tdome + if(!should_block_game_interaction(xeno)) + var/selected_caste = GLOB.xeno_datum_list[xeno.caste_type]?.type + if(used_slots[selected_caste]) + used_slots[selected_caste]-- + + if(!light_mode) + hive_ui.update_xeno_counts() + hive_ui.xeno_removed(xeno) + +/datum/hive_status/proc/set_living_xeno_queen(mob/living/carbon/xenomorph/queen/queen) + if(!queen) + SStracking.delete_leader("hive_[hivenumber]") + SStracking.stop_tracking("hive_[hivenumber]", living_xeno_queen) + SShive_status.wait = 10 SECONDS + else + SStracking.set_leader("hive_[hivenumber]", queen) + SShive_status.wait = 2 SECONDS + + SEND_SIGNAL(src, COMSIG_HIVE_NEW_QUEEN, queen) + living_xeno_queen = queen + + recalculate_hive() + +/datum/hive_status/proc/recalculate_hive() + //No leaders for a Hive without a Queen! + queen_leader_limit = living_xeno_queen ? 4 : 0 + + if (length(xeno_leader_list) > queen_leader_limit) + var/diff = 0 + for (var/i in queen_leader_limit + 1 to length(xeno_leader_list)) + if(!open_xeno_leader_positions.Remove(i)) + remove_hive_leader(xeno_leader_list[i]) + diff++ + xeno_leader_list.len -= diff // Changing the size of xeno_leader_list needs to go at the end or else it won't iterate through the list properly + else if (length(xeno_leader_list) < queen_leader_limit) + for (var/i in length(xeno_leader_list) + 1 to queen_leader_limit) + open_xeno_leader_positions += i + xeno_leader_list.len++ + + hive_ui.update_all_data() + +/datum/hive_status/proc/add_hive_leader(mob/living/carbon/xenomorph/xeno) + if(!xeno) + return FALSE //How did this even happen? + if(!length(open_xeno_leader_positions)) + return FALSE //Too many leaders already (no available xeno leader positions) + if(xeno.hive_pos != NORMAL_XENO) + return FALSE //Already on the list + var/leader_num = open_xeno_leader_positions[1] + xeno_leader_list[leader_num] = xeno + xeno.hive_pos = XENO_LEADER_HIVE_POS(leader_num) + xeno.handle_xeno_leader_pheromones() + xeno.hud_update() // To add leader star + open_xeno_leader_positions -= leader_num + + xeno.update_minimap_icon() + + give_action(xeno, /datum/action/xeno_action/activable/info_marker) + + hive_ui.update_xeno_keys() + return TRUE + +/datum/hive_status/proc/remove_hive_leader(mob/living/carbon/xenomorph/xeno, light_mode = FALSE) + if(!istype(xeno) || !IS_XENO_LEADER(xeno)) + return FALSE + + var/leader_num = GET_XENO_LEADER_NUM(xeno) + + xeno_leader_list[leader_num] = null + + if(!light_mode) // Don't run side effects during deletions. Better yet, replace all this by signals someday + xeno.hive_pos = NORMAL_XENO + xeno.handle_xeno_leader_pheromones() + xeno.hud_update() // To remove leader star + + // Need to maintain ascending order of open_xeno_leader_positions + for (var/i in 1 to queen_leader_limit) + if (i > length(open_xeno_leader_positions) || open_xeno_leader_positions[i] > leader_num) + open_xeno_leader_positions.Insert(i, leader_num) + break + + if(!light_mode) + hive_ui.update_xeno_keys() + + for(var/obj/effect/alien/resin/marker/leaderless_mark in resin_marks) //no resin_mark limit abuse + if(leaderless_mark.createdby == xeno.nicknumber) + qdel(leaderless_mark) + + xeno.update_minimap_icon() + + remove_action(xeno, /datum/action/xeno_action/activable/info_marker) + + return TRUE + +/datum/hive_status/proc/replace_hive_leader(mob/living/carbon/xenomorph/original, mob/living/carbon/xenomorph/replacement) + if(!replacement || replacement.hive_pos != NORMAL_XENO) + return remove_hive_leader(original) + + var/leader_num = GET_XENO_LEADER_NUM(original) + + xeno_leader_list[leader_num] = replacement + + original.hive_pos = NORMAL_XENO + original.handle_xeno_leader_pheromones() + original.hud_update() // To remove leader star + remove_action(original, /datum/action/xeno_action/activable/info_marker) + + replacement.hive_pos = XENO_LEADER_HIVE_POS(leader_num) + replacement.handle_xeno_leader_pheromones() + replacement.hud_update() // To add leader star + give_action(replacement, /datum/action/xeno_action/activable/info_marker) + + hive_ui.update_xeno_keys() + +/datum/hive_status/proc/handle_xeno_leader_pheromones() + for(var/mob/living/carbon/xenomorph/L in xeno_leader_list) + L.handle_xeno_leader_pheromones() + +/* + * Helper procs for the Hive Status UI + * These are all called by the hive status UI manager to update its data + */ + +// Returns a list of how many of each caste of xeno there are, sorted by tier +/datum/hive_status/proc/get_xeno_counts() + // Every caste is manually defined here so you get + var/list/xeno_counts = list( + // Yes, Queen is technically considered to be tier 0 + list(XENO_CASTE_LARVA = 0, "Queen" = 0), + list(XENO_CASTE_DRONE = 0, XENO_CASTE_RUNNER = 0, XENO_CASTE_SENTINEL = 0, XENO_CASTE_DEFENDER = 0), + list(XENO_CASTE_HIVELORD = 0, XENO_CASTE_BURROWER = 0, XENO_CASTE_CARRIER = 0, XENO_CASTE_LURKER = 0, XENO_CASTE_SPITTER = 0, XENO_CASTE_WARRIOR = 0), + list(XENO_CASTE_BOILER = 0, XENO_CASTE_CRUSHER = 0, XENO_CASTE_PRAETORIAN = 0, XENO_CASTE_RAVAGER = 0) + ) + + for(var/mob/living/carbon/xenomorph/X in totalXenos) + //don't show xenos in the thunderdome when admins test stuff. + if(should_block_game_interaction(X)) + var/area/A = get_area(X) + if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) + continue + + if(X.caste && X.counts_for_slots) + xeno_counts[X.caste.tier+1][X.caste.caste_type]++ + + return xeno_counts + +// Returns a sorted list of some basic info (stuff that's needed for sorting) about all the xenos in the hive +// The idea is that we sort this list, and use it as a "key" for all the other information (especially the nicknumber) +// in the hive status UI. That way we can minimize the amount of sorts performed by only calling this when xenos are created/disposed +/datum/hive_status/proc/get_xeno_keys() + var/list/xenos = list() + + for(var/mob/living/carbon/xenomorph/X in totalXenos) + if(should_block_game_interaction(X)) + var/area/A = get_area(X) + if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) + continue + + if(!(X in GLOB.living_xeno_list)) + continue + + // This looks weird, but in DM adding List A to List B actually adds each item in List B to List A, not List B itself. + // Having a nested list like this sort of tricks it into adding the list instead. + // In this case this results in an array of different 'xeno' dictionaries, rather than just a dictionary. + xenos += list(list( + "nicknumber" = X.nicknumber, + "tier" = X.tier, // This one is only important for sorting + "is_leader" = (IS_XENO_LEADER(X)), + "is_queen" = istype(X.caste, /datum/caste_datum/queen), + "caste_type" = X.caste_type + )) + + // Make it all nice and fancy by sorting the list before returning it + var/list/sorted_keys = sort_xeno_keys(xenos) + if(length(sorted_keys)) + return sorted_keys + return xenos + +// This sorts the xeno info list by multiple criteria. Prioritized in order: +// 1. Queen +// 2. Leaders +// 3. Tier +// It uses a slightly modified insertion sort to accomplish this +/datum/hive_status/proc/sort_xeno_keys(list/xenos) + if(!length(xenos)) + return + + var/list/sorted_list = xenos.Copy() + + if(!length(sorted_list)) + return + + for(var/index in 2 to length(sorted_list)) + var/j = index + + while(j > 1) + var/current = sorted_list[j] + var/prev = sorted_list[j-1] + + // Queen comes first, always + if(current["is_queen"]) + sorted_list.Swap(j-1, j) + j-- + continue + + // don't muck up queen's slot + if(prev["is_queen"]) + j-- + continue + + // Leaders before normal xenos + if(!prev["is_leader"] && current["is_leader"]) + sorted_list.Swap(j-1, j) + j-- + continue + + // Make sure we're only comparing leaders to leaders and non-leaders to non-leaders when sorting + // This means we get leaders sorted first, then non-leaders sorted + // Sort by tier first, higher tiers over lower tiers, and then by name alphabetically + + // Could not think of an elegant way to write this + if(!(current["is_leader"]^prev["is_leader"])\ + && (prev["tier"] < current["tier"]\ + || prev["tier"] == current["tier"] && prev["caste_type"] > current["caste_type"]\ + )) + sorted_list.Swap(j-1, j) + + j-- + + return sorted_list + +// Returns a list with some more info about all xenos in the hive +/datum/hive_status/proc/get_xeno_info() + var/list/xenos = list() + + for(var/mob/living/carbon/xenomorph/X in totalXenos) + if(should_block_game_interaction(X)) + var/area/A = get_area(X) + if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) + continue + + var/xeno_name = X.name + // goddamn fucking larvas with their weird ass maturing system + // its name updates with its icon, unlike other castes which only update the mature/elder, etc. prefix on evolve + if(istype(X, /mob/living/carbon/xenomorph/larva)) + xeno_name = "Larva ([X.nicknumber])" + xenos["[X.nicknumber]"] = list( + "name" = xeno_name, + "strain" = X.get_strain_name(), + "ref" = "\ref[X]" + ) + + return xenos + +/datum/hive_status/proc/set_hive_location(obj/effect/alien/resin/special/pylon/core/C) + if(!C || C == hive_location) + return + var/area/A = get_area(C) + xeno_message(SPAN_XENOANNOUNCE("The Queen has set the hive location as \the [A]."), 3, hivenumber) + hive_location = C + hive_ui.update_hive_location() + +// Returns a list of xeno healths and locations +/datum/hive_status/proc/get_xeno_vitals() + var/list/xenos = list() + + for(var/mob/living/carbon/xenomorph/X in totalXenos) + if(should_block_game_interaction(X)) + var/area/A = get_area(X) + if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) + continue + + if(!(X in GLOB.living_xeno_list)) + continue + + var/area/A = get_area(X) + var/area_name = "Unknown" + if(A) + area_name = A.name + + xenos["[X.nicknumber]"] = list( + "health" = round((X.health / X.maxHealth) * 100, 1), + "area" = area_name, + "is_ssd" = (!X.client) + ) + + return xenos + +#define TIER_3 "3" +#define TIER_2 "2" +#define OPEN_SLOTS "open_slots" +#define GUARANTEED_SLOTS "guaranteed_slots" + +// Returns an assoc list of open slots and guaranteed slots left +/datum/hive_status/proc/get_tier_slots() + var/list/slots = list( + TIER_3 = list( + OPEN_SLOTS = 0, + GUARANTEED_SLOTS = list(), + ), + TIER_2 = list( + OPEN_SLOTS = 0, + GUARANTEED_SLOTS = list(), + ), + ) + + var/used_tier_2_slots = length(tier_2_xenos) + var/used_tier_3_slots = length(tier_3_xenos) + + for(var/caste_path in free_slots) + var/slots_free = free_slots[caste_path] + var/slots_used = used_slots[caste_path] + var/datum/caste_datum/current_caste = caste_path + if(slots_used) + // Don't count any free slots in use + switch(initial(current_caste.tier)) + if(2) + used_tier_2_slots -= min(slots_used, slots_free) + if(3) + used_tier_3_slots -= min(slots_used, slots_free) + if(slots_free <= slots_used) + continue + // Display any free slots available + switch(initial(current_caste.tier)) + if(2) + slots[TIER_2][GUARANTEED_SLOTS][initial(current_caste.caste_type)] = slots_free - slots_used + if(3) + slots[TIER_3][GUARANTEED_SLOTS][initial(current_caste.caste_type)] = slots_free - slots_used + + var/burrowed_factor = min(stored_larva, sqrt(4*stored_larva)) + var/effective_total = floor(burrowed_factor) + for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) + if(xeno.counts_for_slots) + effective_total++ + + // Tier 3 slots are always 20% of the total xenos in the hive + slots[TIER_3][OPEN_SLOTS] = max(0, ceil(0.20*effective_total/tier_slot_multiplier) - used_tier_3_slots) + // Tier 2 slots are between 30% and 50% of the hive, depending + // on how many T3s there are. + slots[TIER_2][OPEN_SLOTS] = max(0, ceil(0.5*effective_total/tier_slot_multiplier) - used_tier_2_slots - used_tier_3_slots) + + return slots + +#undef TIER_3 +#undef TIER_2 +#undef OPEN_SLOTS +#undef GUARANTEED_SLOTS + +/datum/hive_status/proc/can_build_structure(structure_name) + if(!structure_name || !hive_structures_limit[structure_name]) + return FALSE + if(get_structure_count(structure_name) >= hive_structures_limit[structure_name]) + return FALSE + return TRUE + +/datum/hive_status/proc/get_structure_count(structure_name) + return length(hive_structures[structure_name]) + length(hive_constructions[structure_name]) + +/datum/hive_status/proc/has_structure(structure_name) + if(!structure_name) + return FALSE + if(LAZYLEN(hive_structures[structure_name])) + return TRUE + return FALSE + +/datum/hive_status/proc/add_construction(obj/effect/alien/resin/construction/S) + if(!S || !S.template) + return FALSE + var/name_ref = initial(S.template.name) + if(!hive_constructions[name_ref]) + hive_constructions[name_ref] = list() + if(length(hive_constructions[name_ref]) >= hive_structures_limit[name_ref]) + return FALSE + hive_constructions[name_ref] += src + return TRUE + +/datum/hive_status/proc/remove_construction(obj/effect/alien/resin/construction/S) + if(!S || !S.template) + return FALSE + var/name_ref = initial(S.template.name) + hive_constructions[name_ref] -= src + return TRUE + +/datum/hive_status/proc/add_special_structure(obj/effect/alien/resin/special/S) + if(!S) + return FALSE + var/name_ref = initial(S.name) + if(!hive_structures[name_ref]) + hive_structures[name_ref] = list() + if(length(hive_structures[name_ref]) >= hive_structures_limit[name_ref]) + return FALSE + hive_structures[name_ref] += S + return TRUE + +/datum/hive_status/proc/remove_special_structure(obj/effect/alien/resin/special/S) + if(!S) + return FALSE + var/name_ref = initial(S.name) + hive_structures[name_ref] -= S + return TRUE + +/datum/hive_status/proc/has_special_structure(name_ref) + if(!name_ref || !LAZYLEN(hive_structures[name_ref])) + return 0 + return length(hive_structures[name_ref]) + +/datum/hive_status/proc/abandon_on_hijack() + var/area/hijacked_dropship = get_area(living_xeno_queen) + var/shipside_humans_weighted_count = 0 + var/xenos_count = 0 + for(var/name_ref in hive_structures) + for(var/obj/effect/alien/resin/special/S in hive_structures[name_ref]) + if(get_area(S) == hijacked_dropship) + continue + S.hijack_delete = TRUE + hive_structures[name_ref] -= S + qdel(S) + for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) + if(get_area(xeno) != hijacked_dropship && xeno.loc && is_ground_level(xeno.loc.z)) + if(isfacehugger(xeno) || islesserdrone(xeno)) + to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) + if(length(xeno.stomach_contents)) + xeno.devour_timer = 0 + xeno.handle_stomach_contents() + qdel(xeno) + continue + if(xeno.hunter_data.hunted && !isqueen(xeno)) + to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, seperating you from her hive! You must defend yourself from the headhunter before you can enter hibernation...")) + xeno.set_hive_and_update(XENO_HIVE_FORSAKEN) + else + to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) + if(length(xeno.stomach_contents)) + xeno.devour_timer = 0 + xeno.handle_stomach_contents() + qdel(xeno) + stored_larva++ + continue + if(xeno.tier >= 1) + xenos_count++ + for(var/i in GLOB.alive_mob_list) + var/mob/living/potential_host = i + if(!(potential_host.status_flags & XENO_HOST)) + continue + if(!is_ground_level(potential_host.z) || get_area(potential_host) == hijacked_dropship) + continue + var/obj/item/alien_embryo/A = locate() in potential_host + if(A && A.hivenumber != hivenumber) + continue + for(var/obj/item/alien_embryo/embryo in potential_host) + embryo.hivenumber = XENO_HIVE_FORSAKEN + potential_host.update_med_icon() + for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) + if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) + continue + var/datum/job/job = GLOB.RoleAuthority.roles_for_mode[current_human.job] + if(!job) + continue + var/turf/turf = get_turf(current_human) + if(is_mainship_level(turf?.z)) + shipside_humans_weighted_count += GLOB.RoleAuthority.calculate_role_weight(job) + hijack_burrowed_surge = TRUE + hijack_burrowed_left = max(ceil(shipside_humans_weighted_count * 0.5) - xenos_count, 5) + hivecore_cooldown = FALSE + xeno_message(SPAN_XENOBOLDNOTICE("The weeds have recovered! A new hive core can be built!"),3,hivenumber) + + // No buffs in hijack + for(var/datum/hivebuff/buff in active_hivebuffs) + buff._on_cease() + +/datum/hive_status/proc/free_respawn(client/C) + stored_larva++ + if(!hive_location || !hive_location.spawn_burrowed_larva(C.mob)) + stored_larva-- + else + hive_ui.update_burrowed_larva() + +/datum/hive_status/proc/respawn_on_turf(client/xeno_client, turf/spawning_turf) + var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber) + if(isnull(new_xeno)) + return FALSE + + if(!SSticker.mode.transfer_xeno(xeno_client.mob, new_xeno)) + qdel(new_xeno) + return FALSE + + new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly emerges from a dead husk!"), + SPAN_XENOANNOUNCE("The hive has no core! You manage to emerge from your old husk as a larva!")) + msg_admin_niche("[key_name(new_xeno)] respawned at \a [spawning_turf]. [ADMIN_JMP(spawning_turf)]") + playsound(new_xeno, 'sound/effects/xeno_newlarva.ogg', 50, 1) + if(new_xeno.client?.prefs?.toggles_flashing & FLASH_POOLSPAWN) + window_flash(new_xeno.client) + + hive_ui.update_burrowed_larva() + +/datum/hive_status/proc/do_buried_larva_spawn(mob/xeno_candidate) + var/spawning_area + if(hive_location) + spawning_area = hive_location + else if(living_xeno_queen) + spawning_area = living_xeno_queen + else for(var/mob/living/carbon/xenomorpheus as anything in totalXenos) + if(islarva(xenomorpheus) || isxeno_builder(xenomorpheus)) //next to xenos that should be in a safe spot + spawning_area = xenomorpheus + if(!spawning_area) + spawning_area = pick(totalXenos) // FUCK IT JUST GO ANYWHERE + var/list/turf_list + for(var/turf/open/open_turf in orange(3, spawning_area)) + if(istype(open_turf, /turf/open/space)) + continue + LAZYADD(turf_list, open_turf) + // just on the off-chance + if(!LAZYLEN(turf_list)) + return FALSE + var/turf/open/spawning_turf = pick(turf_list) + + var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber) + if(isnull(new_xeno)) + return FALSE + + if(!SSticker.mode.transfer_xeno(xeno_candidate, new_xeno)) + qdel(new_xeno) + return FALSE + new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly burrows out of \the [spawning_turf]!"), + SPAN_XENODANGER("You burrow out of \the [spawning_turf] and awaken from your slumber. For the Hive!")) + msg_admin_niche("[key_name(new_xeno)] burrowed out from \a [spawning_turf]. [ADMIN_JMP(spawning_turf)]") + playsound(new_xeno, 'sound/effects/xeno_newlarva.ogg', 50, 1) + to_chat(new_xeno, SPAN_XENOANNOUNCE("You are a xenomorph larva awakened from slumber!")) + if(new_xeno.client) + if(new_xeno.client?.prefs?.toggles_flashing & FLASH_POOLSPAWN) + window_flash(new_xeno.client) + + stored_larva-- + hive_ui.update_burrowed_larva() + +/mob/living/proc/ally_of_hivenumber(hivenumber) + var/datum/hive_status/indexed_hive = GLOB.hive_datum[hivenumber] + if(!indexed_hive) + return FALSE + + return indexed_hive.is_ally(src) + +/datum/hive_status/proc/is_ally(mob/living/living_mob) + if(isxeno(living_mob)) + var/mob/living/carbon/xenomorph/zenomorf = living_mob + if(zenomorf.hivenumber == hivenumber) + return !zenomorf.banished + + if(!living_mob.faction) + return FALSE + + return faction_is_ally(living_mob.faction) + +/datum/hive_status/proc/faction_is_ally(faction, ignore_queen_check = FALSE) + if(faction == internal_faction) + return TRUE + if(!ignore_queen_check && !living_xeno_queen) + return FALSE + + return allies[faction] + +/datum/hive_status/proc/can_delay_round_end(mob/living/carbon/xenomorph/xeno) + if(HAS_TRAIT(src, TRAIT_NO_HIVE_DELAY)) + return FALSE + return TRUE + +/datum/hive_status/proc/update_hugger_limit() + var/countable_xeno_iterator = 0 + for(var/mob/living/carbon/xenomorph/cycled_xeno as anything in totalXenos) + if(cycled_xeno.counts_for_slots) + countable_xeno_iterator++ + + playable_hugger_limit = max(floor(countable_xeno_iterator / playable_hugger_max_divisor), playable_hugger_minimum) + +/datum/hive_status/proc/can_spawn_as_hugger(mob/dead/observer/user) + if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) + return FALSE + if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned + to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) + return FALSE + if(world.time < hugger_timelock) + to_chat(user, SPAN_WARNING("The hive cannot support facehuggers yet...")) + return FALSE + if(!user.bypass_time_of_death_checks_hugger && world.time - user.timeofdeath < JOIN_AS_FACEHUGGER_DELAY) + var/time_left = floor((user.timeofdeath + JOIN_AS_FACEHUGGER_DELAY - world.time) / 10) + to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a facehugger until 3 minutes have passed ([time_left] seconds remaining).")) + return FALSE + if(length(totalXenos) <= 0) + //This is to prevent people from joining as Forsaken Huggers on the pred ship + to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!")) + return FALSE + for(var/mob_name in banished_ckeys) + if(banished_ckeys[mob_name] == user.ckey) + to_chat(user, SPAN_WARNING("You are banished from the [name], you may not rejoin unless the Queen re-admits you or dies.")) + return FALSE + + update_hugger_limit() + + var/current_hugger_count = 0 + for(var/mob/mob as anything in totalXenos) + if(isfacehugger(mob)) + current_hugger_count++ + if(playable_hugger_limit <= current_hugger_count) + to_chat(user, SPAN_WARNING("\The [GLOB.hive_datum[hivenumber]] cannot support more facehuggers! Limit: [current_hugger_count]/[playable_hugger_limit]")) + return FALSE + + if(tgui_alert(user, "Are you sure you want to become a facehugger?", "Confirmation", list("Yes", "No")) != "Yes") + return FALSE + + if(!user.client) + return FALSE + + return TRUE + +/datum/hive_status/proc/get_current_playable_facehugger_count() + var/count = 0 + for(var/mob/mob as anything in totalXenos) + if(isfacehugger(mob)) + count++ + return count + +/datum/hive_status/proc/spawn_as_hugger(mob/dead/observer/user, atom/A) + var/mob/living/carbon/xenomorph/facehugger/hugger = new /mob/living/carbon/xenomorph/facehugger(A.loc, null, hivenumber) + user.mind.transfer_to(hugger, TRUE) + hugger.visible_message(SPAN_XENODANGER("A facehugger suddenly emerges out of \the [A]!"), SPAN_XENODANGER("You emerge out of \the [A] and awaken from your slumber. For the Hive!")) + playsound(hugger, 'sound/effects/xeno_newlarva.ogg', 25, TRUE) + hugger.generate_name() + hugger.timeofdeath = user.timeofdeath // Keep old death time + +/datum/hive_status/proc/update_lesser_drone_limit() + var/countable_xeno_iterator = 0 + for(var/mob/living/carbon/xenomorph/cycled_xeno as anything in totalXenos) + if(cycled_xeno.counts_for_slots) + countable_xeno_iterator++ + + lesser_drone_limit = max(floor(countable_xeno_iterator / playable_lesser_drones_max_divisor), lesser_drone_minimum) + +/datum/hive_status/proc/can_spawn_as_lesser_drone(mob/dead/observer/user, obj/effect/alien/resin/special/pylon/spawning_pylon) + if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) + return FALSE + + if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned + to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) + return FALSE + + if(world.time - user.timeofdeath < JOIN_AS_LESSER_DRONE_DELAY) + var/time_left = floor((user.timeofdeath + JOIN_AS_LESSER_DRONE_DELAY - world.time) / 10) + to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a lesser drone until 30 seconds have passed ([time_left] seconds remaining).")) + return FALSE + + if(length(totalXenos) <= 0) + to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!")) + return FALSE + + if(!living_xeno_queen) + to_chat(user, SPAN_WARNING("The selected hive does not have a Queen!")) + return FALSE + + if(spawning_pylon.lesser_drone_spawns < 1) + to_chat(user, SPAN_WARNING("The selected core or pylon does not have enough power for a lesser drone!")) + return FALSE + + update_lesser_drone_limit() + + var/current_lesser_drone_count = 0 + for(var/mob/mob as anything in totalXenos) + if(islesserdrone(mob)) + current_lesser_drone_count++ + + if(lesser_drone_limit <= current_lesser_drone_count) + to_chat(user, SPAN_WARNING("[GLOB.hive_datum[hivenumber]] cannot support more lesser drones! Limit: [current_lesser_drone_count]/[lesser_drone_limit]")) + return FALSE + + if(!user.client) + return FALSE + + return TRUE + +// Get amount of real xenos, don't count lessers/huggers +/datum/hive_status/proc/get_real_total_xeno_count() + var/count = 0 + for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) + if(xeno.counts_for_slots) + count++ + return count + +// Checks if we hit larva limit +/datum/hive_status/proc/check_if_hit_larva_from_pylon_limit() + var/groundside_humans_weighted_count = 0 + for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) + if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) + continue + var/datum/job/job = GLOB.RoleAuthority.roles_for_mode[current_human.job] + if(!job) + continue + var/turf/turf = get_turf(current_human) + if(is_ground_level(turf?.z)) + groundside_humans_weighted_count += GLOB.RoleAuthority.calculate_role_weight(job) + hit_larva_pylon_limit = (get_real_total_xeno_count() + stored_larva) > (groundside_humans_weighted_count * ENDGAME_LARVA_CAP_MULTIPLIER) + hive_ui.update_pylon_status() + return hit_larva_pylon_limit + +///Called by /obj/item/alien_embryo when a host is bursting to determine extra larva per burst +/datum/hive_status/proc/increase_larva_after_burst() + var/extra_per_burst = CONFIG_GET(number/extra_larva_per_burst) + partial_larva += extra_per_burst + convert_partial_larva_to_full_larva() + +///Called after times when partial larva are added to process them to stored larva +/datum/hive_status/proc/convert_partial_larva_to_full_larva() + for(var/i = 1 to partial_larva) + partial_larva-- + stored_larva++ diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index c0e68ada522f..f85cf157c5b8 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -15,7 +15,7 @@ DEFINE_BITFIELD(iff_flag_flags, list( /obj/item/faction_tag name = "Faction IFF tag" desc = "A tag containing a small IFF computer that gets inserted into the body. You can modify the IFF groups by using an access tuner on it, or on the body of implanted if it's already implanted." - icon = 'icons/obj/items/iff_tag.dmi' + icon = 'icons/obj/items/Marine_Research.dmi' icon_state = "iff_tag" var/tag_flags = INJECTABLE_TAG|REPROGRAMMABLE_TAG @@ -177,7 +177,7 @@ DEFINE_BITFIELD(iff_flag_flags, list( /obj/item/storage/tag_case name = "tag case" desc = "A sturdy case designed to store IFF tags." - icon = 'icons/obj/items/iff_tag.dmi' + icon = 'icons/obj/items/Marine_Research.dmi' icon_state = "tag_box" use_sound = "toolbox" storage_slots = 8 @@ -205,3 +205,116 @@ DEFINE_BITFIELD(iff_flag_flags, list( for(var/i = 1 to storage_slots - 1) new /obj/item/faction_tag/wy(src) new /obj/item/device/multitool(src) + +/mob/attackby(obj/item/item, mob/user) + if(ishuman(user)) + if(user.a_intent == INTENT_HELP && HAS_TRAIT(item, TRAIT_TOOL_MULTITOOL)) + var/mob/living/carbon/human/programmer = user + if(!faction_tag) + to_chat(user, SPAN_WARNING("\The [src] doesn't have an Faction IFF tag to reprogram.")) + return + programmer.visible_message(SPAN_NOTICE("[programmer] starts reprogramming \the [src]'s [faction_tag]..."), SPAN_NOTICE("You start reprogramming \the [src]'s [faction_tag]..."), max_distance = 3) + if(!do_after(programmer, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC, src, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) + return + if(!faction_tag) + to_chat(programmer, SPAN_WARNING("\The [src]'s Faction IFF tag got removed while you were reprogramming it!")) + return + if(!faction_tag.handle_reprogramming(programmer, src)) + return + programmer.visible_message(SPAN_NOTICE("[programmer] reprograms \the [src]'s [faction_tag]."), SPAN_NOTICE("You reprogram \the [src]'s [faction_tag]."), max_distance = 3) + return + if(user.a_intent != INTENT_HELP && (item.type in SURGERY_TOOLS_PINCH)) + if(!faction_tag) + to_chat(user, SPAN_WARNING("\The [src] doesn't have an Faction IFF tag to remove.")) + return + user.visible_message(SPAN_NOTICE("[user] starts removing \the [src]'s [faction_tag]..."), SPAN_NOTICE("You start removing \the [src]'s [faction_tag]..."), max_distance = 3) + if(!do_after(user, 5 SECONDS * SURGERY_TOOLS_PINCH[item.type], INTERRUPT_ALL, BUSY_ICON_GENERIC, src, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) + return + if(!faction_tag) + to_chat(user, SPAN_WARNING("\The [src]'s Faction IFF tag got removed while you were removing it!")) + return + user.put_in_hands(faction_tag) + faction_tag = null + user.visible_message(SPAN_NOTICE("[user] removes \the [src]'s Faction IFF tag."), SPAN_NOTICE("You remove \the [src]'s Faction IFF tag."), max_distance = 3) + return + . = ..() + +/* +/obj/item/iff_tag + name = "xenomorph IFF tag" + desc = "A tag containing a small IFF computer that gets inserted into the carapace of a xenomorph. You can modify the IFF groups by using an access tuner on it, or on the xeno if it's already implanted." + icon = 'icons/obj/items/Marine_Research.dmi' + icon_state = "xeno_tag" + var/list/faction_groups = list() + +/obj/item/iff_tag/attack(mob/living/carbon/xenomorph/xeno, mob/living/carbon/human/injector) + if(isxeno(xeno)) + if(xeno.stat == DEAD) + to_chat(injector, SPAN_WARNING("\The [xeno] is dead...")) + return + if(xeno.iff_tag) + to_chat(injector, SPAN_WARNING("\The [xeno] already has a tag inside it.")) + return + injector.visible_message(SPAN_NOTICE("[injector] starts forcing \the [src] into [xeno]'s carapace..."), SPAN_NOTICE("You start forcing \the [src] into [xeno]'s carapace...")) + if(!do_after(injector, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC, xeno, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) + return + injector.visible_message(SPAN_NOTICE("[injector] forces \the [src] into [xeno]'s carapace!"), SPAN_NOTICE("You force \the [src] into [xeno]'s carapace!")) + xeno.iff_tag = src + injector.drop_inv_item_to_loc(src, xeno) + if(xeno.hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade + to_chat(xeno, SPAN_NOTICE("With the insertion of the device into your carapace, your instincts have changed compelling you to protect [english_list(faction_groups, "no one")].")) + return + return ..() + +/obj/item/iff_tag/attackby(obj/item/W, mob/user) + if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL) && ishuman(user)) + handle_reprogramming(user) + return + return ..() + +/obj/item/iff_tag/proc/handle_reprogramming(mob/living/carbon/human/programmer, mob/living/carbon/xenomorph/xeno) + var/list/id_faction_groups = programmer.get_id_faction_group() + var/option = tgui_alert(programmer, "The xeno tag's current IFF groups reads as: [english_list(faction_groups, "None")]\nYour ID's IFF group reads as: [english_list(id_faction_groups, "None")]", "Xenomorph IFF Tag", list("Overwrite", "Add", "Remove")) + if(!option) + return FALSE + if(xeno) + if(!xeno.iff_tag) + to_chat(programmer, SPAN_WARNING("\The [src]'s tag got removed while you were reprogramming it!")) + return FALSE + if(!programmer.Adjacent(xeno)) + to_chat(programmer, SPAN_WARNING("You need to stay close to the xenomorph to reprogram the tag!")) + return FALSE + switch(option) + if("Overwrite") + faction_groups = id_faction_groups + if("Add") + faction_groups |= id_faction_groups + if("Remove") + faction_groups = list() + to_chat(programmer, SPAN_NOTICE("You [option] the IFF group data, the IFF group on the tag now reads as: [english_list(faction_groups, "None")]")) + if(xeno?.hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade + to_chat(xeno, SPAN_NOTICE("Your instincts have changed, you seem compelled to protect [english_list(faction_groups, "no one")].")) + return TRUE + +/obj/item/iff_tag/pmc_handler + faction_groups = FACTION_LIST_MARINE_WY + + +/obj/item/storage/xeno_tag_case + name = "xenomorph tag case" + desc = "A sturdy case designed to store and charge xenomorph IFF tags. Provided by the Wey-Yu Research and Data(TM) Division." + icon = 'icons/obj/items/Marine_Research.dmi' + icon_state = "tag_box" + use_sound = "toolbox" + storage_slots = 8 + can_hold = list( + /obj/item/iff_tag, + /obj/item/device/multitool, + ) + black_market_value = 25 + +/obj/item/storage/xeno_tag_case/full/fill_preset_inventory() + for(var/i = 1 to storage_slots - 1) + new /obj/item/iff_tag(src) + new /obj/item/device/multitool(src) +*/ diff --git a/code/datums/factions/relations_datum.dm b/code/datums/factions/relations_datum.dm index 27bfc2d64281..1f0018a49005 100644 --- a/code/datums/factions/relations_datum.dm +++ b/code/datums/factions/relations_datum.dm @@ -47,11 +47,11 @@ if(relations[code_identificator] == null || relations[code_identificator] > 1000) continue var/datum/faction/faction = GLOB.faction_datums[code_identificator] - relations_mapping += list(list("name" = faction.name, "desc" = faction.desc, "color" = faction.ui_color, "value" = relations[code_identificator])) + relations_mapping += list(list("name" = faction.name, "desc" = faction.desc, "color" = faction.color, "value" = relations[code_identificator])) .["actions"] = source != src ? TRUE : FALSE - .["faction_color"] = faction.ui_color + .["faction_color"] = faction.color .["faction_relations"] = relations_mapping /datum/faction_module/relations/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index d77d770e571e..c040bdf13fc2 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -426,16 +426,14 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( revive_enabled = check_tod() && is_revivable() var/holder2_set = 0 - if(hivenumber) - holder4.icon_state = "hudalien" - - if(GLOB.hive_datum[hivenumber]) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - - if(hive) - if(hive.color) - holder4.color = hive.color - if(hive.leading_cult_sl == src) + if(faction) + if(istype(faction, /datum/faction/xenomorph)) + holder4.icon_state = "hudalien" + + if(faction) + if(faction.color) + holder4.color = faction.color + if(faction.leading_cult_sl == src) holder4.icon_state = "hudalien_leader" if(status_flags & XENO_HOST) @@ -444,10 +442,8 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( var/obj/item/alien_embryo/E = locate(/obj/item/alien_embryo) in src if(E) holder3.icon_state = "infected[E.stage]" - var/datum/hive_status/hive = GLOB.hive_datum[E.hivenumber] - - if(hive && hive.color) - holder3.color = hive.color + if(E.faction && E.faction.color) + holder3.color = E.faction.color if(stat == DEAD || status_flags & FAKEDEATH) holder2.alpha = 100 @@ -591,10 +587,9 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( var/image/holder = hud_list[QUEEN_OVERWATCH_HUD] holder.overlays.Cut() holder.icon_state = "hudblank" - if (stat != DEAD && hivenumber && hivenumber <= GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - var/mob/living/carbon/xenomorph/queen/Q = hive.living_xeno_queen - if (Q && Q.observed_xeno == src) + if(stat != DEAD && faction) + var/mob/living/carbon/xenomorph/queen/xeno_queen = faction.living_xeno_queen + if(xeno_queen && xeno_queen.observed_xeno == src) holder.icon_state = "queen_overwatch" hud_list[QUEEN_OVERWATCH_HUD] = holder @@ -617,9 +612,9 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( if (age) var/image/J = image('icons/mob/hud/hud.dmi',src, "hudxenoupgrade[age]") holder.overlays += J - if(hive && hivenumber != XENO_HIVE_NORMAL) + if(faction && faction.code_identificator != FACTION_XENOMORPH_NORMAL) var/image/J = image('icons/mob/hud/hud.dmi', src, "hudalien_xeno") - J.color = hive.color + J.color = faction.color holder.overlays += J //Sec HUDs @@ -675,8 +670,9 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( return /mob/living/carbon/human/hud_set_squad() - var/datum/faction/F = get_faction(faction) - var/image/holder = hud_list[F.hud_type] + if(!faction || !faction.hud_type) + return + var/image/holder = hud_list[faction.hud_type] holder.icon_state = "hudblank" holder.overlays.Cut() diff --git a/code/defines/procs/announcement.dm b/code/defines/procs/announcement.dm index b6957040304f..ec3b5cfcbc5c 100644 --- a/code/defines/procs/announcement.dm +++ b/code/defines/procs/announcement.dm @@ -9,48 +9,27 @@ #define HIGHER_FORCE_ANNOUNCE SPAN_ANNOUNCEMENT_HEADER_BLUE("Unknown Higher Force") //xenomorph hive announcement -/proc/xeno_announcement(message, hivenumber, title = QUEEN_ANNOUNCE) - var/list/targets = GLOB.living_xeno_list + GLOB.dead_mob_list - if(hivenumber == "everything") - for(var/mob/M in targets) - var/mob/living/carbon/xenomorph/X = M - if(!isobserver(X) && !istype(X)) //filter out any potential non-xenomorphs/observers mobs - targets.Remove(X) - - announcement_helper(message, title, targets, sound(get_sfx("queen"),wait = 0,volume = 50)) +/proc/xeno_announcement(message, datum/faction/faction_to_display = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL], title = QUEEN_ANNOUNCE) + var/list/targets = GLOB.dead_mob_list.Copy() + if(faction_to_display == "Everyone") + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/mob/mob as anything in GLOB.faction_datums[faction_to_get].total_mobs) + if(mob.stat != CONSCIOUS) + continue + targets.Add(mob) else - for(var/mob/M in targets) - if(isobserver(M)) + for(var/mob/mob as anything in faction_to_display.total_mobs) + if(mob.stat != CONSCIOUS) continue - var/mob/living/carbon/X = M - if(!istype(X) || !X.ally_of_hivenumber(hivenumber)) //additionally filter out those of wrong hive - targets.Remove(X) + targets.Add(mob) - announcement_helper(message, title, targets, sound(get_sfx("queen"),wait = 0,volume = 50)) + announcement_helper(message, title, targets, sound(get_sfx("queen"), wait = 0, volume = 50)) //general marine announcement -/proc/marine_announcement(message, title = COMMAND_ANNOUNCE, sound_to_play = sound('sound/misc/notice2.ogg'), faction_to_display = FACTION_MARINE, add_PMCs = FALSE, signature, logging = ARES_LOG_MAIN) - var/list/targets = GLOB.human_mob_list + GLOB.dead_mob_list - if(faction_to_display == FACTION_MARINE) - for(var/mob/M in targets) - if(isobserver(M)) //observers see everything - continue - var/mob/living/carbon/human/H = M - if(!istype(H) || H.stat != CONSCIOUS || isyautja(H)) //base human checks - targets.Remove(H) - continue - if(is_mainship_level(H.z)) // People on ship see everything - continue - - // If they have iff AND a marine headset they will recieve announcements - var/obj/item/card/id/card = H.get_idcard() - if ((FACTION_MARINE in card?.faction_group) && (istype(H.wear_l_ear, /obj/item/device/radio/headset/almayer) || istype(H.wear_r_ear, /obj/item/device/radio/headset/almayer))) - continue - - if((H.faction != faction_to_display && !add_PMCs) || (H.faction != faction_to_display && add_PMCs && !(H.faction in FACTION_LIST_WY)) && !(faction_to_display in H.faction_group)) //faction checks - targets.Remove(H) - +/proc/faction_announcement(message, title = COMMAND_ANNOUNCE, sound_to_play = sound('sound/misc/notice2.ogg'), datum/faction/faction_to_display = GLOB.faction_datums[FACTION_MARINE], signature, logging = ARES_LOG_MAIN) + var/list/targets = GLOB.dead_mob_list.Copy() + if(faction_to_display == GLOB.faction_datums[FACTION_MARINE]) switch(logging) if(ARES_LOG_MAIN) log_ares_announcement(title, message, signature) @@ -58,41 +37,24 @@ log_ares_security(title, message, signature) else if(faction_to_display == "Everyone (-Yautja)") - for(var/mob/M in targets) - if(isobserver(M)) //observers see everything - continue - var/mob/living/carbon/human/H = M - if(!istype(H) || H.stat != CONSCIOUS || isyautja(H)) - targets.Remove(H) + for(var/faction_to_get in FACTION_LIST_HUMANOID - FACTION_YAUTJA) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + for(var/mob/mob as anything in faction.total_mobs) + if(mob.stat != CONSCIOUS) + continue + targets.Add(mob) else - for(var/mob/M in targets) - if(isobserver(M)) //observers see everything - continue - var/mob/living/carbon/human/H = M - if(!istype(H) || H.stat != CONSCIOUS || isyautja(H)) - targets.Remove(H) + for(var/mob/mob as anything in faction_to_display.total_mobs) + if(mob.stat != CONSCIOUS) continue - if(H.faction != faction_to_display) - targets.Remove(H) + targets.Add(mob) if(!isnull(signature)) message += "

Signed by,
[signature]
" announcement_helper(message, title, targets, sound_to_play) -//yautja ship AI announcement -/proc/yautja_announcement(message, title = YAUTJA_ANNOUNCE, sound_to_play = sound('sound/misc/notice1.ogg')) - var/list/targets = GLOB.human_mob_list + GLOB.dead_mob_list - for(var/mob/M in targets) - if(isobserver(M)) //observers see everything - continue - var/mob/living/carbon/human/H = M - if(!isyautja(H) || H.stat != CONSCIOUS) - targets.Remove(H) - - announcement_helper(message, title, targets, sound_to_play) - //AI announcement that uses talking into comms /proc/ai_announcement(message, sound_to_play = sound('sound/misc/interference.ogg'), logging = ARES_LOG_MAIN) for(var/mob/M in (GLOB.human_mob_list + GLOB.dead_mob_list)) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 3f9508124dc6..164e3da6a1ff 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -126,7 +126,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) var/input = "Bioscan failed. \n\nInvestigation into Bioscan subsystem recommended." log_ares_bioscan(name, input, forced) if(ares_can_interface() || forced) - marine_announcement(input, name, 'sound/misc/interference.ogg', logging = ARES_LOG_NONE) + faction_announcement(input, name, 'sound/misc/interference.ogg', logging = ARES_LOG_NONE) return //Adjust the randomness there so everyone gets the same thing var/fake_xenos_on_planet = max(0, xenos_on_planet + rand(-variance, variance)) @@ -137,7 +137,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) log_ares_bioscan(name, input) //if interface is down, bioscan still logged, just have to go read it. if(forced || ares_can_interface()) - marine_announcement(input, name, 'sound/AI/bioscan.ogg', logging = ARES_LOG_NONE) + faction_announcement(input, name, 'sound/AI/bioscan.ogg', logging = ARES_LOG_NONE) else message_admins("An ARES Bioscan has succeeded, but was not announced.") diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 61971957c89f..751e5b828684 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -167,8 +167,7 @@ Additional game mode variables. if(!player.mind) //They have to have a key if they have a client. player.mind_initialize() //Will work on ghosts too, but won't add them to active minds. player.mind.setup_human_stats() - player.faction = FACTION_YAUTJA - player.faction_group = FACTION_LIST_YAUTJA + GLOB.faction_datums[FACTION_YAUTJA].add_mob(player) players += player.mind return players diff --git a/code/game/gamemodes/cm_process.dm b/code/game/gamemodes/cm_process.dm index 7dc31d6e55da..fec7d58e094c 100644 --- a/code/game/gamemodes/cm_process.dm +++ b/code/game/gamemodes/cm_process.dm @@ -158,7 +158,7 @@ GLOBAL_VAR_INIT(next_admin_bioscan, 30 MINUTES) // The announcement to all Humans. var/name = "[MAIN_AI_SYSTEM] Operation Staging Order" var/input = "Command Order Issued.\n\n[active_lz.loc.loc] has been designated as the primary landing zone." - marine_announcement(input, name) + faction_announcement(input, name) /datum/game_mode/proc/announce_bioscans() //Depending on how either side is doing, we speed up the bioscans diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index b60f4f1fb177..032b352b97f7 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -355,7 +355,7 @@ /datum/game_mode/colonialmarines/proc/map_announcement() if(SSmapping.configs[GROUND_MAP].announce_text) var/rendered_announce_text = replacetext(SSmapping.configs[GROUND_MAP].announce_text, "###SHIPNAME###", MAIN_SHIP_NAME) - marine_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]") + faction_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]") /datum/game_mode/colonialmarines/proc/ares_conclude() ai_silent_announcement("Bioscan complete. No unknown lifeform signature detected.", ".V") @@ -406,7 +406,7 @@ var/input = "Security lockdown will be lifting in 30 seconds per automated lockdown protocol." var/name = "Automated Security Authority Announcement" - marine_announcement(input, name, 'sound/AI/commandreport.ogg') + faction_announcement(input, name, 'sound/AI/commandreport.ogg') for(var/i in GLOB.living_xeno_list) var/mob/M = i sound_to(M, sound(get_sfx("queen"), wait = 0, volume = 50)) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm index aa9e56069b63..72880a807177 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm @@ -129,18 +129,18 @@ sleep(10) switch(map_locale) //Switching it up. if(0) - marine_announcement("This is Captain Hans Naiche, commander of the 3rd Battalion 'Dust Raiders' forces here on LV-624. In our attempts to establish a base on this planet, several of our patrols were wiped out by hostile creatures. We're setting up a distress call, but we need you to hold [SSmapping.configs[GROUND_MAP].map_name] in order for our engineers to set up the relay. We're prepping several M402 mortar units to provide fire support. If they overrun your positon, we will be wiped out with no way to call for help. Hold the line or we all die.", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") + faction_announcement("This is Captain Hans Naiche, commander of the 3rd Battalion 'Dust Raiders' forces here on LV-624. In our attempts to establish a base on this planet, several of our patrols were wiped out by hostile creatures. We're setting up a distress call, but we need you to hold [SSmapping.configs[GROUND_MAP].map_name] in order for our engineers to set up the relay. We're prepping several M402 mortar units to provide fire support. If they overrun your positon, we will be wiped out with no way to call for help. Hold the line or we all die.", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") addtimer(CALLBACK(src, PROC_REF(story_announce), 0), 3 MINUTES) return ..() /datum/game_mode/whiskey_outpost/proc/story_announce(time) switch(time) if(0) - marine_announcement("This is Captain Hans Naiche, Commander of the 3rd Bataillion, 'Dust Raiders' forces on LV-624. As you already know, several of our patrols have gone missing and likely wiped out by hostile local creatures as we've attempted to set our base up.", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") + faction_announcement("This is Captain Hans Naiche, Commander of the 3rd Bataillion, 'Dust Raiders' forces on LV-624. As you already know, several of our patrols have gone missing and likely wiped out by hostile local creatures as we've attempted to set our base up.", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") if(1) - marine_announcement("Our scouts report increased activity in the area and given our intel, we're already preparing for the worst. We're setting up a comms relay to send out a distress call, but we're going to need time while our engineers get everything ready. All other stations should prepare accordingly and maximize combat readiness, effective immediately.", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") + faction_announcement("Our scouts report increased activity in the area and given our intel, we're already preparing for the worst. We're setting up a comms relay to send out a distress call, but we're going to need time while our engineers get everything ready. All other stations should prepare accordingly and maximize combat readiness, effective immediately.", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") if(2) - marine_announcement("Captain Naiche here. We've tracked the bulk of enemy forces on the move and [SSmapping.configs[GROUND_MAP].map_name] is likely to be hit before they reach the base. We need you to hold them off while we finish sending the distress call. Expect incoming within a few minutes. Godspeed, [SSmapping.configs[GROUND_MAP].map_name].", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") + faction_announcement("Captain Naiche here. We've tracked the bulk of enemy forces on the move and [SSmapping.configs[GROUND_MAP].map_name] is likely to be hit before they reach the base. We need you to hold them off while we finish sending the distress call. Expect incoming within a few minutes. Godspeed, [SSmapping.configs[GROUND_MAP].map_name].", "Captain Naiche, 3rd Battalion Command, LV-624 Garrison") if(time <= 2) addtimer(CALLBACK(src, PROC_REF(story_announce), time+1), 3 MINUTES) @@ -202,7 +202,7 @@ if(!istype(wave_data)) return if(length(wave_data.command_announcement) > 0) - marine_announcement(wave_data.command_announcement[1], wave_data.command_announcement[2]) + faction_announcement(wave_data.command_announcement[1], wave_data.command_announcement[2]) if(length(wave_data.sound_effect) > 0) playsound_z(SSmapping.levels_by_trait(ZTRAIT_GROUND), pick(wave_data.sound_effect)) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost/equipping.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost/equipping.dm index 617f957f9aec..a2f6c8aaa210 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost/equipping.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost/equipping.dm @@ -19,7 +19,7 @@ Stay alive, and Godspeed, commander!"} return sleep(15) if(H?.loc) - marine_announcement("All forces, Ground Commander [H.real_name] is in command!") + faction_announcement("All forces, Ground Commander [H.real_name] is in command!") diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 1039d495396b..1a9dedeebb55 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -3,11 +3,11 @@ /proc/carp_migration() // -- Darem //sleep(100) spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes. - marine_announcement("Unknown biological entities have been detected near [MAIN_SHIP_NAME], please stand-by.", "Lifesign Alert", 'sound/AI/commandreport.ogg') + faction_announcement("Unknown biological entities have been detected near [MAIN_SHIP_NAME], please stand-by.", "Lifesign Alert", 'sound/AI/commandreport.ogg') /proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights if(isEvent) - marine_announcement("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert") + faction_announcement("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert") if(lightsoutAmount) return diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index c8b80efe9b7f..eebed12236d5 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -22,7 +22,7 @@ sleep(100) if(announce) - marine_announcement("Abnormal activity detected in the ship power system. As a precaution, power must be shut down for an indefinite duration.", "Critical Power Failure", 'sound/AI/poweroff.ogg') + faction_announcement("Abnormal activity detected in the ship power system. As a precaution, power must be shut down for an indefinite duration.", "Critical Power Failure", 'sound/AI/poweroff.ogg') /proc/power_restore(announce = 1) for(var/obj/structure/machinery/power/smes/S in GLOB.machines) @@ -40,7 +40,7 @@ sleep(100) if(announce) - marine_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') + faction_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') /proc/power_restore_quick(announce = 1) @@ -55,7 +55,7 @@ sleep(100) if(announce) - marine_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') + faction_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') /proc/power_restore_everything(announce = 1) @@ -72,7 +72,7 @@ sleep(100) if(announce) - marine_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') + faction_announcement("Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg') /proc/power_restore_ship_reactors(announce = TRUE) for(var/obj/structure/machinery/power/reactor/reactor in GLOB.machines) @@ -85,4 +85,4 @@ reactor.start_functioning(TRUE) if(announce) - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(marine_announcement), "Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg'), 10 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(faction_announcement), "Power has been restored. Reason: Unknown.", "Power Systems Nominal", 'sound/AI/poweron.ogg'), 10 SECONDS) diff --git a/code/game/gamemodes/extended/cm_vs_upp.dm b/code/game/gamemodes/extended/cm_vs_upp.dm index 5ea63ad40917..a778d53299f1 100644 --- a/code/game/gamemodes/extended/cm_vs_upp.dm +++ b/code/game/gamemodes/extended/cm_vs_upp.dm @@ -17,5 +17,5 @@ /datum/game_mode/extended/faction_clash/cm_vs_upp/announce() . = ..() - marine_announcement("An automated distress call has been received from the local colony.\n\nAlert! Sensors have detected a Union of Progressive People's warship in orbit of colony. Enemy Vessel has refused automated hails and is entering lower-planetary orbit. High likelihood enemy vessel is preparing to deploy dropships to local colony. Authorization to interdict and repel hostile force from allied territory has been granted. Automated thawing of cryostasis marine reserves in progress.", "ARES 3.2", 'sound/AI/commandreport.ogg', FACTION_MARINE) - marine_announcement("Alert! Sensors have detected encroaching USCM vessel on an intercept course with local colony.\n\nIntelligence suggests this is the [MAIN_SHIP_NAME]. Confidence is high that USCM force is acting counter to Union interests in this area. Authorization to deploy ground forces to disrupt foreign power attempt to encroach on Union interests has been granted. Emergency awakening of cryostasis troop reserves in progress.", "1VAN/3", 'sound/AI/commandreport.ogg', FACTION_UPP) + faction_announcement("An automated distress call has been received from the local colony.\n\nAlert! Sensors have detected a Union of Progressive People's warship in orbit of colony. Enemy Vessel has refused automated hails and is entering lower-planetary orbit. High likelihood enemy vessel is preparing to deploy dropships to local colony. Authorization to interdict and repel hostile force from allied territory has been granted. Automated thawing of cryostasis marine reserves in progress.", "ARES 3.2", 'sound/AI/commandreport.ogg') + faction_announcement("Alert! Sensors have detected encroaching USCM vessel on an intercept course with local colony.\n\nIntelligence suggests this is the [MAIN_SHIP_NAME]. Confidence is high that USCM force is acting counter to Union interests in this area. Authorization to deploy ground forces to disrupt foreign power attempt to encroach on Union interests has been granted. Emergency awakening of cryostasis troop reserves in progress.", "1VAN/3", 'sound/AI/commandreport.ogg', GLOB.faction_datum[FACTION_UPP]) diff --git a/code/game/gamemodes/extended/infection.dm b/code/game/gamemodes/extended/infection.dm index caef8717898f..e964132a1bfb 100644 --- a/code/game/gamemodes/extended/infection.dm +++ b/code/game/gamemodes/extended/infection.dm @@ -31,10 +31,10 @@ /datum/game_mode/infection/proc/map_announcement() if(SSmapping.configs[GROUND_MAP].infection_announce_text) var/rendered_announce_text = replacetext(SSmapping.configs[GROUND_MAP].infection_announce_text, "###SHIPNAME###", MAIN_SHIP_NAME) - marine_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]") + faction_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]") else if(SSmapping.configs[GROUND_MAP].announce_text) //if we missed a infection text for above, or just don't need a special one, we just use default announcement var/rendered_announce_text = replacetext(SSmapping.configs[GROUND_MAP].announce_text, "###SHIPNAME###", MAIN_SHIP_NAME) - marine_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]") + faction_announcement(rendered_announce_text, "[MAIN_SHIP_NAME]") /datum/game_mode/infection/proc/initialize_post_survivor_list() if(synth_survivor) diff --git a/code/game/machinery/bots/cprbot.dm b/code/game/machinery/bots/cprbot.dm index eb26f82d3daf..68673015c266 100644 --- a/code/game/machinery/bots/cprbot.dm +++ b/code/game/machinery/bots/cprbot.dm @@ -189,7 +189,7 @@ /obj/structure/machinery/bot/cprbot/proc/valid_cpr_target(mob/living/carbon/human/patient) // Check if the patient is a valid target for CPR - return patient.stat == DEAD && patient.check_tod() && patient.is_revivable() && patient.get_target_lock(iff_signal) && ishuman_strict(patient) + return patient.stat == DEAD && patient.check_tod() && patient.is_revivable() && patient.ally_faction(iff_signal) && ishuman_strict(patient) /obj/structure/machinery/bot/cprbot/proc/find_and_move_to_patient() var/list/potential_patients = list() diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 6a1ae83e5154..e2975fea1bf8 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -137,7 +137,7 @@ if(!input || authenticated != 2 || world.time < cooldown_message + COOLDOWN_COMM_MESSAGE_LONG || !(usr in dview(1, src))) return FALSE - marine_announcement(input) + faction_announcement(input) message_admins("[key_name(usr)] has made a command announcement.") log_announcement("[key_name(usr)] has announced the following: [input]") cooldown_message = world.time diff --git a/code/game/machinery/computer/groundside_operations.dm b/code/game/machinery/computer/groundside_operations.dm index 403191066beb..ec25f29b9a28 100644 --- a/code/game/machinery/computer/groundside_operations.dm +++ b/code/game/machinery/computer/groundside_operations.dm @@ -242,7 +242,7 @@ if(!is_announcement_active) to_chat(usr, SPAN_WARNING("Please allow at least [COOLDOWN_COMM_MESSAGE*0.1] second\s to pass between announcements.")) return FALSE - if(announcement_faction != FACTION_MARINE && usr.faction != announcement_faction) + if(announcement_faction != FACTION_MARINE && usr.faction != GLOB.faction_datum[announcement_faction]) to_chat(usr, SPAN_WARNING("Access denied.")) return var/input = stripped_multiline_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement", "") @@ -259,7 +259,8 @@ var/paygrade = get_paygrades(id.paygrade, FALSE, H.gender) signed = "[paygrade] [id.registered_name]" - marine_announcement(input, announcement_title, faction_to_display = announcement_faction, add_PMCs = add_pmcs, signature = signed) + + faction_announcement(input, announcement_title, faction_to_display = GLOB.faction_datum[announcement_faction], signature = signed) addtimer(CALLBACK(src, PROC_REF(reactivate_announcement), usr), COOLDOWN_COMM_MESSAGE) message_admins("[key_name(usr)] has made a command announcement.") log_announcement("[key_name(usr)] has announced the following: [input]") diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index 33c9bff8d4f1..b7390da96f42 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -280,7 +280,7 @@ to_chat(user, SPAN_WARNING("The colony-wide lockdown has already been lifted.")) return . = ..() - marine_announcement("The colony-wide lockdown protocols have been lifted.") + faction_announcement("The colony-wide lockdown protocols have been lifted.") used = TRUE // Research @@ -297,5 +297,5 @@ to_chat(user, SPAN_WARNING("The WY-Research-Facility lockdown has already been lifted.")) return . = ..() - marine_announcement("The WY-Research-Facility lockdown protocols have been lifted.") + faction_announcement("The WY-Research-Facility lockdown protocols have been lifted.") used = TRUE diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 5e3cd4e2c00d..6c80f9c244f6 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -333,7 +333,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("WARNING.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') //preds part var/t_left = duration2text_sec(floor(rand(timeleft - timeleft / 10, timeleft + timeleft / 10))) - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nYou have approximately [t_left] seconds to abandon the hunting grounds before activation of the human purification device.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nYou have approximately [t_left] seconds to abandon the hunting grounds before activation of human Purification Device."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) //xenos part var/warning if(timer_warning & NUKE_SHOW_TIMER_HALF) @@ -355,7 +355,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE ACTIVATED.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE ACTIVATED.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') var/t_left = duration2text_sec(floor(rand(timeleft - timeleft / 10, timeleft + timeleft / 10))) - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [t_left] to abandon the hunting grounds before it activates.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [t_left] to abandon the hunting grounds before it activates."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) for(var/hivenumber in GLOB.hive_datum) hive = GLOB.hive_datum[hivenumber] if(!length(hive.totalXenos)) @@ -364,7 +364,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) else announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DEACTIVATED.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DEACTIVATED.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) for(var/hivenumber in GLOB.hive_datum) hive = GLOB.hive_datum[hivenumber] if(!length(hive.totalXenos)) @@ -569,7 +569,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("DECRYPTION COMPLETE", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("DECRYPTION COMPLETE", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nThe human purification device is able to be activated.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nThe human purification device is able to be activated."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) var/datum/hive_status/hive for(var/hivenumber in GLOB.hive_datum) @@ -584,7 +584,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) //preds part var/time_left = duration2text_sec(floor(rand(decryption_time - decryption_time / 10, decryption_time + decryption_time / 10))) - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nYou have approximately [time_left] seconds to abandon the hunting grounds before the human purification device is able to be activated.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nYou have approximately [time_left] seconds to abandon the hunting grounds before the human purification device is able to be activated."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) //xenos part var/warning = "We are almost out of time, STOP THEM." @@ -604,7 +604,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DECRYPTION STARTED.\n\nDECRYPTION IN [floor(decryption_time/10)] SECONDS.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DECRYPTION STARTED.\n\nDECRYPTION IN [floor(decryption_time/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') var/time_left = duration2text_sec(floor(rand(decryption_time - decryption_time / 10, decryption_time + decryption_time / 10))) - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [time_left] before it finishes its initial phase.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [time_left] before it finishes its initial phase."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) for(var/hivenumber in GLOB.hive_datum) hive = GLOB.hive_datum[hivenumber] if(!length(hive.totalXenos)) @@ -614,7 +614,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE DECRYPTION HALTED.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE DECRYPTION HALTED.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) for(var/hivenumber in GLOB.hive_datum) hive = GLOB.hive_datum[hivenumber] if(!length(hive.totalXenos)) diff --git a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm index 09ae15b3489f..bf19f2b7086d 100644 --- a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm +++ b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm @@ -69,7 +69,7 @@ selected_vehicle = "TANK" // The whole thing seems to be based upon the assumption you unlock tank as an override, defaulting to APC if(selected_vehicle == "TANK") available_categories &= ~(VEHICLE_INTEGRAL_AVAILABLE) //APC lacks these, so we need to remove these flags to be able to access spare parts section - marine_announcement("A tank is being sent up to reinforce this operation.") + faction_announcement("A tank is being sent up to reinforce this operation.") /obj/structure/machinery/cm_vending/gear/vehicle_crew/get_listed_products(mob/user) var/list/display_list = list() diff --git a/code/game/objects/items/devices/cictablet.dm b/code/game/objects/items/devices/cictablet.dm index 34e366c9ef52..dfd24b425d61 100644 --- a/code/game/objects/items/devices/cictablet.dm +++ b/code/game/objects/items/devices/cictablet.dm @@ -55,7 +55,7 @@ /obj/item/device/cotablet/ui_static_data(mob/user) var/list/data = list() - data["faction"] = announcement_faction + data["faction"] = GLOB.faction_datum[announcement_faction].name data["cooldown_message"] = cooldown_between_messages data["distresstimelock"] = DISTRESS_TIME_LOCK @@ -115,7 +115,7 @@ var/paygrade = get_paygrades(id.paygrade, FALSE, human_user.gender) signed = "[paygrade] [id.registered_name]" - marine_announcement(input, announcement_title, faction_to_display = announcement_faction, add_PMCs = add_pmcs, signature = signed) + faction_announcement(input, announcement_title, faction_to_display = GLOB.faction_datum[announcement_faction], signature = signed) message_admins("[key_name(user)] has made a command announcement.") log_announcement("[key_name(user)] has announced the following: [input]") COOLDOWN_START(src, announcement_cooldown, cooldown_between_messages) diff --git a/code/game/objects/items/devices/motion_detector.dm b/code/game/objects/items/devices/motion_detector.dm index 7a1947753ddb..6526e0091803 100644 --- a/code/game/objects/items/devices/motion_detector.dm +++ b/code/game/objects/items/devices/motion_detector.dm @@ -224,7 +224,7 @@ var/mob/living/M = A //do this to skip the unnecessary istype() check; everything in ping_candidate is a mob already if(M == loc) continue //device user isn't detected if(world.time > M.l_move_time + 20) continue //hasn't moved recently - if(M.get_target_lock(iff_signal)) + if(M.ally_faction(iff_signal)) continue apply_debuff(M) diff --git a/code/game/objects/items/explosives/mine.dm b/code/game/objects/items/explosives/mine.dm index bb9f0bd424c3..dd59907441b6 100644 --- a/code/game/objects/items/explosives/mine.dm +++ b/code/game/objects/items/explosives/mine.dm @@ -205,7 +205,7 @@ return if(L.stat == DEAD) return - if(L.get_target_lock(iff_signal)) + if(L.ally_faction(iff_signal)) return if(HAS_TRAIT(L, TRAIT_ABILITY_BURROWED)) return diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 168b0118f101..e965c9be023b 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -71,7 +71,7 @@ return FALSE if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy)) for(var/mob/living/carbon/human/closed_mob in get_turf(src)) - if((closed_mob.stat == DEAD || closed_mob.health < HEALTH_THRESHOLD_CRIT) && !closed_mob.get_target_lock(user.faction_group) && !(closed_mob.status_flags & PERMANENTLY_DEAD)&& !(closed_mob.status_flags & PERMANENTLY_DEAD)) + if((closed_mob.stat == DEAD || closed_mob.health < HEALTH_THRESHOLD_CRIT) && !closed_mob.ally_faction(user.faction) && !(closed_mob.status_flags & PERMANENTLY_DEAD)&& !(closed_mob.status_flags & PERMANENTLY_DEAD)) return FALSE return TRUE diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index a8d50b5bf2fb..1136891ddbab 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -110,7 +110,7 @@ if(buckled_bodybag) return if(ishuman(mob)) - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (mob.stat == DEAD || mob.health < HEALTH_THRESHOLD_CRIT) && !mob.get_target_lock(user.faction_group) && !(mob.status_flags & PERMANENTLY_DEAD)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (mob.stat == DEAD || mob.health < HEALTH_THRESHOLD_CRIT) && !mob.ally_faction(user.faction) && !(mob.status_flags & PERMANENTLY_DEAD)) to_chat(user, SPAN_WARNING("You can't buckle a crit or dead member of another faction! .")) return FALSE ..() diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 96d0c272fc0d..9741b676a6d1 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -516,7 +516,7 @@ new_order.approvedby = MAIN_AI_SYSTEM GLOB.supply_controller.shoppinglist += new_order - marine_announcement("A nuclear device has been supplied and will be delivered to requisitions via ASRS.", "NUCLEAR ARSENAL ACQUIRED", 'sound/misc/notice2.ogg') + faction_announcement("A nuclear device has been supplied and will be delivered to requisitions via ASRS.", "NUCLEAR ARSENAL ACQUIRED", 'sound/misc/notice2.ogg') message_admins("[key_name_admin(usr)] admin-spawned \a [encrypt] nuke.") log_game("[key_name_admin(usr)] admin-spawned \a [encrypt] nuke.") @@ -571,37 +571,44 @@ if(!admin_holder || !(admin_holder.rights & R_MOD)) to_chat(src, "Only administrators may use this command.") return - var/faction = tgui_input_list(usr, "Please choose faction your announcement will be shown to.", "Faction Selection", (FACTION_LIST_HUMANOID - list(FACTION_YAUTJA) + list("Everyone (-Yautja)"))) - if(!faction) + + var/list/datum/faction/factions = list() + LAZYSET(factions, "All Humans", "Everyone (-Yautja)") + for(var/faction_to_get in FACTION_LIST_HUMANOID) + var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] + LAZYSET(factions, faction_to_set.name, faction_to_set) + + var/choice = tgui_input_list(usr, "Please choose faction your announcement will be shown to.", "Faction Selection", factions) + if(!choice) return + var/input = input(usr, "Please enter announcement text. Be advised, this announcement will be heard both on Almayer and planetside by conscious humans of selected faction.", "What?", "") as message|null if(!input) return - var/customname = input(usr, "Pick a title for the announcement. Confirm empty text for \"[faction] Update\" title.", "Title") as text|null + var/customname = input(usr, "Pick a title for the announcement. Confirm empty text for \"[choice] Update\" title.", "Title") as text|null if(isnull(customname)) return if(!customname) - customname = "[faction] Update" - if(faction == FACTION_MARINE) + customname = "[choice] Update" + + if(choice == "Everyone (-Yautja)") + faction_announcement(input, customname, 'sound/AI/commandreport.ogg', choice) + else if(choice == FACTION_MARINE) for(var/obj/structure/machinery/computer/almayer_control/C in GLOB.machines) if(!(C.inoperable())) - var/obj/item/paper/P = new /obj/item/paper( C.loc ) + var/obj/item/paper/P = new /obj/item/paper(C.loc) P.name = "'[customname].'" P.info = input P.update_icon() C.messagetitle.Add("[customname]") C.messagetext.Add(P.info) - if(alert("Press \"Yes\" if you want to announce it to ship crew and marines. Press \"No\" to keep it only as printed report on communication console.",,"Yes","No") == "Yes") - if(alert("Do you want PMCs (not Death Squad) to see this announcement?",,"Yes","No") == "Yes") - marine_announcement(input, customname, 'sound/AI/commandreport.ogg', faction, TRUE) - else - marine_announcement(input, customname, 'sound/AI/commandreport.ogg', faction, FALSE) + faction_announcement(input, customname, 'sound/AI/commandreport.ogg', factions[choice]) else - marine_announcement(input, customname, 'sound/AI/commandreport.ogg', faction) + faction_announcement(input, customname, 'sound/AI/commandreport.ogg', factions[choice]) - message_admins("[key_name_admin(src)] has created \a [faction] command report") - log_admin("[key_name_admin(src)] [faction] command report: [input]") + message_admins("[key_name_admin(src)] has created a [choice] command report") + log_admin("[key_name_admin(src)] [choice] command report: [input]") /client/proc/cmd_admin_xeno_report() set name = "Report: Queen Mother" @@ -612,35 +619,27 @@ to_chat(src, "Only administrators may use this command.") return - var/list/hives = list() - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - hives += list("[hive.name]" = hive.hivenumber) - - hives += list("All Hives" = "everything") - var/hive_choice = tgui_input_list(usr, "Please choose the hive you want to see your announcement. Selecting \"All hives\" option will change title to \"Unknown Higher Force\"", "Hive Selection", hives) - if(!hive_choice) - return FALSE - - var/hivenumber = hives[hive_choice] + var/list/datum/faction/factions = list() + LAZYSET(factions, "All Hives", "Everyone") + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] + LAZYSET(factions, faction_to_set.name, faction_to_set) + var/choice = tgui_input_list(usr, "Please choose the hive you want to see your announcement. Selecting \"All hives\" option will change title to \"Unknown Higher Force\"", "Hive Selection", factions) + if(!choice) + return var/input = input(usr, "This should be a message from the ruler of the Xenomorph race.", "What?", "") as message|null if(!input) - return FALSE - - var/hive_prefix = "" - if(GLOB.hive_datum[hivenumber]) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - hive_prefix = "[hive.prefix] " + return - if(hivenumber == "everything") - xeno_announcement(input, hivenumber, HIGHER_FORCE_ANNOUNCE) + if(choice != "All Hives") + xeno_announcement(input, factions[choice], SPAN_ANNOUNCEMENT_HEADER_BLUE("[factions[choice].prefix][QUEEN_MOTHER_ANNOUNCE]")) else - xeno_announcement(input, hivenumber, SPAN_ANNOUNCEMENT_HEADER_BLUE("[hive_prefix][QUEEN_MOTHER_ANNOUNCE]")) + xeno_announcement(input, choice, HIGHER_FORCE_ANNOUNCE) - message_admins("[key_name_admin(src)] has created a [hive_choice] Queen Mother report") - log_admin("[key_name_admin(src)] Queen Mother ([hive_choice]): [input]") + message_admins("[key_name_admin(src)] has created a [choice] Queen Mother report") + log_admin("[key_name_admin(src)] Queen Mother ([choice]): [input]") /client/proc/cmd_admin_create_AI_report() set name = "Report: ARES Comms" @@ -725,7 +724,7 @@ var/input = input(usr, "This is a message from the predator ship's AI. Check with online staff before you send this.", "What?", "") as message|null if(!input) return FALSE - yautja_announcement(SPAN_YAUTJABOLDBIG(input)) + faction_announcement(SPAN_YAUTJABOLDBIG(input), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) message_admins("[key_name_admin(src)] has created a predator ship AI report") log_admin("[key_name_admin(src)] predator ship AI report: [input]") diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 7601095db43d..5751db80dd30 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -2133,7 +2133,7 @@ if(href_list["ccdeny"]) // CentComm-deny. The distress call is denied, without any further conditions var/mob/ref_person = locate(href_list["ccdeny"]) - marine_announcement("The distress signal has not received a response, the launch tubes are now recalibrating.", "Distress Beacon", logging = ARES_LOG_SECURITY) + faction_announcement("The distress signal has not received a response, the launch tubes are now recalibrating.", "Distress Beacon", logging = ARES_LOG_SECURITY) log_game("[key_name_admin(usr)] has denied a distress beacon, requested by [key_name_admin(ref_person)]") message_admins("[key_name_admin(usr)] has denied a distress beacon, requested by [key_name_admin(ref_person)]", 1) @@ -2202,7 +2202,7 @@ //Can no longer request a nuke GLOB.ares_datacore.nuke_available = FALSE - marine_announcement("A nuclear device has been authorized by High Command and will be delivered to requisitions via ASRS.", "NUCLEAR ORDNANCE AUTHORIZED", 'sound/misc/notice2.ogg', logging = ARES_LOG_MAIN) + faction_announcement("A nuclear device has been authorized by High Command and will be delivered to requisitions via ASRS.", "NUCLEAR ORDNANCE AUTHORIZED", 'sound/misc/notice2.ogg', logging = ARES_LOG_MAIN) log_game("[key_name_admin(usr)] has authorized \a [nuketype], requested by [key_name_admin(ref_person)]") message_admins("[key_name_admin(usr)] has authorized \a [nuketype], requested by [key_name_admin(ref_person)]") @@ -2210,13 +2210,13 @@ var/mob/ref_person = locate(href_list["nukedeny"]) if(!istype(ref_person)) return FALSE - marine_announcement("Your request for nuclear ordnance deployment has been reviewed and denied by USCM High Command for operational security and colonial preservation reasons. Have a good day.", "NUCLEAR ORDNANCE DENIED", 'sound/misc/notice2.ogg', logging = ARES_LOG_MAIN) + faction_announcement("Your request for nuclear ordnance deployment has been reviewed and denied by USCM High Command for operational security and colonial preservation reasons. Have a good day.", "NUCLEAR ORDNANCE DENIED", 'sound/misc/notice2.ogg', logging = ARES_LOG_MAIN) log_game("[key_name_admin(usr)] has denied nuclear ordnance, requested by [key_name_admin(ref_person)]") message_admins("[key_name_admin(usr)] has dnied nuclear ordnance, requested by [key_name_admin(ref_person)]") if(href_list["sddeny"]) // CentComm-deny. The self-destruct is denied, without any further conditions var/mob/ref_person = locate(href_list["sddeny"]) - marine_announcement("The self-destruct request has not received a response, ARES is now recalculating statistics.", "Self-Destruct System", logging = ARES_LOG_SECURITY) + faction_announcement("The self-destruct request has not received a response, ARES is now recalculating statistics.", "Self-Destruct System", logging = ARES_LOG_SECURITY) log_game("[key_name_admin(usr)] has denied self-destruct, requested by [key_name_admin(ref_person)]") message_admins("[key_name_admin(usr)] has denied self-destruct, requested by [key_name_admin(ref_person)]", 1) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index c7658d8b1104..a34098a379dc 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -70,7 +70,7 @@ if(scanning) var/turf/mainloc = get_turf(src) for(var/mob/living/M in range(range,mainloc)) - if(M.get_target_lock(iff_signal)) + if(M.ally_faction(iff_signal)) continue HasProximity(M) diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index aced4363125b..14be0dd2d117 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -893,7 +893,7 @@ /obj/effect/alien/resin/king_cocoon/Destroy() if(!hatched) - marine_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP IN [uppertext(get_area_name(loc))] HAS BEEN STOPPED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') + faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP IN [uppertext(get_area_name(loc))] HAS BEEN STOPPED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') var/datum/hive_status/hive for(var/cur_hive_num in GLOB.hive_datum) hive = GLOB.hive_datum[cur_hive_num] @@ -933,7 +933,7 @@ timer = addtimer(CALLBACK(src, PROC_REF(start_growing)), 10 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) addtimer(CALLBACK(src, PROC_REF(check_pylons)), 10 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME|TIMER_LOOP) - marine_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 10 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') + faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 10 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') var/datum/hive_status/hive for(var/cur_hive_num in GLOB.hive_datum) hive = GLOB.hive_datum[cur_hive_num] @@ -983,7 +983,7 @@ /obj/effect/alien/resin/king_cocoon/proc/announce_halfway() timer = addtimer(CALLBACK(src, PROC_REF(start_vote)), 4 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) - marine_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 5 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') + faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 5 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') var/datum/hive_status/hive for(var/cur_hive_num in GLOB.hive_datum) hive = GLOB.hive_datum[cur_hive_num] @@ -1155,7 +1155,7 @@ animate_hatch_king() return - marine_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [get_area_name(loc)].\n\nESTIMATED TIME UNTIL COMPLETION - ONE MINUTE.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') + faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [get_area_name(loc)].\n\nESTIMATED TIME UNTIL COMPLETION - ONE MINUTE.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') var/datum/hive_status/hive for(var/cur_hive_num in GLOB.hive_datum) hive = GLOB.hive_datum[cur_hive_num] @@ -1173,7 +1173,7 @@ flick("hatching", src) addtimer(CALLBACK(src, PROC_REF(hatch_king)), 2 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE) - marine_announcement("ALERT.\n\nEXTREME ENERGY INFLUX DETECTED IN [get_area_name(loc)].\n\nCAUTION IS ADVISED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') + faction_announcement("ALERT.\n\nEXTREME ENERGY INFLUX DETECTED IN [get_area_name(loc)].\n\nCAUTION IS ADVISED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') var/datum/hive_status/hive for(var/cur_hive_num in GLOB.hive_datum) hive = GLOB.hive_datum[cur_hive_num] diff --git a/code/modules/cm_aliens/hivebuffs/hivebuff.dm b/code/modules/cm_aliens/hivebuffs/hivebuff.dm index 2b140771e946..b8bcaf31dc2a 100644 --- a/code/modules/cm_aliens/hivebuffs/hivebuff.dm +++ b/code/modules/cm_aliens/hivebuffs/hivebuff.dm @@ -102,7 +102,7 @@ if(!_check_num_required_pylons()) to_chat(purchasing_mob, SPAN_XENONOTICE("Our hive does not have the required number of available pylons! We require [number_of_required_pylons]")) return FALSE - + if(!_check_danger()) to_chat(purchasing_mob, SPAN_XENONOTICE("There is not enough danger to warrant hive buffs.")) return FALSE @@ -195,12 +195,12 @@ /datum/hivebuff/proc/_on_cease() if(cease_timer_id) deltimer(cease_timer_id) - + _announce_buff_cease() on_cease() LAZYREMOVE(hive.active_hivebuffs, src) UnregisterSignal(SSdcs, COMSIG_GLOB_XENO_SPAWN) - + for(var/mob/living/carbon/xenomorph/xeno in hive.totalXenos) remove_buff_effects(xeno) @@ -302,7 +302,7 @@ xeno_announcement(SPAN_XENOANNOUNCE(engage_flavourmessage), hive.hivenumber, XENO_GENERAL_ANNOUNCE) if(marine_flavourmessage) - marine_announcement(marine_flavourmessage, COMMAND_ANNOUNCE, 'sound/AI/bioscan.ogg') + faction_announcement(marine_flavourmessage, COMMAND_ANNOUNCE, 'sound/AI/bioscan.ogg') /datum/hivebuff/proc/_announce_buff_cease() if(!duration) @@ -397,7 +397,7 @@ desc = "A huge behemoth of a Xenomorph which can tear its way through defences and flesh alike. Requires open space to grow." tier = HIVEBUFF_TIER_MAJOR radial_icon = "king" - + is_reusable = TRUE cost = 0 special_fail_message = "Only one hatchery may exist at a time." diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index 327b89083147..a31ee6c43bb7 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -164,7 +164,7 @@ if(hijack_delete) return ..() - marine_announcement("ALERT.\n\nEnergy build up around communication relay at [get_area_name(src)] halted.", "[MAIN_AI_SYSTEM] Biological Scanner") + faction_announcement("ALERT.\n\nEnergy build up around communication relay at [get_area_name(src)] halted.", "[MAIN_AI_SYSTEM] Biological Scanner") for(var/hivenumber in GLOB.hive_datum) var/datum/hive_status/checked_hive = GLOB.hive_datum[hivenumber] @@ -180,7 +180,7 @@ /// Checks if all comms towers are connected and then starts end game content on all pylons if they are /obj/effect/alien/resin/special/pylon/endgame/proc/comms_relay_connection() - marine_announcement("ALERT.\n\nIrregular build up of energy around communication relays at [get_area_name(src)], biological hazard detected.\n\nDANGER: Hazard is strengthening xenomorphs, advise urgent termination of hazard by ground forces.", "[MAIN_AI_SYSTEM] Biological Scanner") + faction_announcement("ALERT.\n\nIrregular build up of energy around communication relays at [get_area_name(src)], biological hazard detected.\n\nDANGER: Hazard is strengthening xenomorphs, advise urgent termination of hazard by ground forces.", "[MAIN_AI_SYSTEM] Biological Scanner") for(var/hivenumber in GLOB.hive_datum) var/datum/hive_status/checked_hive = GLOB.hive_datum[hivenumber] diff --git a/code/modules/cm_marines/dropship_equipment.dm b/code/modules/cm_marines/dropship_equipment.dm index 6b2674f7541a..92a56dd30e96 100644 --- a/code/modules/cm_marines/dropship_equipment.dm +++ b/code/modules/cm_marines/dropship_equipment.dm @@ -194,7 +194,6 @@ .["camera_available"] = defense.has_camera && is_deployed .["selection_state"] = list() .["kills"] = defense.kills - .["iff_status"] = defense.faction_group .["health"] = defense.health .["health_max"] = defense.health_max .["deployed"] = is_deployed diff --git a/code/modules/cm_tech/droppod/gear_access_point.dm b/code/modules/cm_tech/droppod/gear_access_point.dm index 608fd33e18f4..341d8f426680 100644 --- a/code/modules/cm_tech/droppod/gear_access_point.dm +++ b/code/modules/cm_tech/droppod/gear_access_point.dm @@ -48,11 +48,11 @@ else if(SSticker.mode == "Distress Signal" || GLOB.master_mode == "Distress Signal") if(access_settings_override) //everyone allowed to grab stuff return TRUE - else if(user.get_target_lock(faction_requirement)) //only it's faction group allowed + else if(user.ally_faction(faction_requirement)) //only it's faction group allowed return TRUE else if(access_settings_override) - if(user.get_target_lock(faction_requirement)) //vica versa for extended and other modes, allowed by default, not allowed with override + if(user.ally_faction(faction_requirement)) //vica versa for extended and other modes, allowed by default, not allowed with override return TRUE else return TRUE diff --git a/code/modules/cm_tech/tech.dm b/code/modules/cm_tech/tech.dm index 1750f7e7dbbf..ff87d256ff20 100644 --- a/code/modules/cm_tech/tech.dm +++ b/code/modules/cm_tech/tech.dm @@ -82,7 +82,7 @@ update_icon(node) if(!(tech_flags & TECH_FLAG_NO_ANNOUNCE) && announce_message && announce_name) - marine_announcement(announce_message, announce_name, 'sound/misc/notice2.ogg', logging = ARES_LOG_NONE) + faction_announcement(announce_message, announce_name, 'sound/misc/notice2.ogg', logging = ARES_LOG_NONE) return TRUE diff --git a/code/modules/cm_tech/trees/marine.dm b/code/modules/cm_tech/trees/marine.dm index 5ab2b7eaa36e..749ea4e82865 100644 --- a/code/modules/cm_tech/trees/marine.dm +++ b/code/modules/cm_tech/trees/marine.dm @@ -152,4 +152,4 @@ GLOBAL_LIST_EMPTY(tech_controls_marine) return //No need to announce tier updates for tier 1 var/name = "ALMAYER DEFCON LEVEL INCREASED" var/input = "THREAT ASSESSMENT LEVEL INCREASED TO LEVEL [tier.tier].\n\nLEVEL [tier.tier] assets have been authorised to handle the situation." - marine_announcement(input, name, 'sound/AI/commandreport.ogg', logging = ARES_LOG_NONE) + faction_announcement(input, name, 'sound/AI/commandreport.ogg', logging = ARES_LOG_NONE) diff --git a/code/modules/defenses/bell_tower.dm b/code/modules/defenses/bell_tower.dm index fa904092c0da..e567f9e8f026 100644 --- a/code/modules/defenses/bell_tower.dm +++ b/code/modules/defenses/bell_tower.dm @@ -17,14 +17,6 @@ can_be_near_defense = TRUE - choice_categories = list( - SENTRY_CATEGORY_IFF = list(FACTION_MARINE, SENTRY_FACTION_WEYLAND, SENTRY_FACTION_HUMAN), - ) - - selected_categories = list( - SENTRY_CATEGORY_IFF = FACTION_MARINE, - ) - /obj/structure/machinery/defenses/bell_tower/Initialize() . = ..() @@ -107,7 +99,7 @@ return var/mob/living/carbon/M = A - if(M.get_target_lock(faction)) + if(M.ally_faction(faction)) return var/list/turf/path = get_line(src, linked_bell) diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index f62b567d6da6..d49d21c56523 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -10,7 +10,6 @@ use_power = USE_POWER_NONE stat = DEFENSE_FUNCTIONAL health = 200 - var/list/faction_group var/health_max = 200 var/turned_on = FALSE var/mob/owner_mob = null @@ -39,9 +38,16 @@ /// laptop which is currently linked to the sentry var/obj/item/device/sentry_computer/linked_laptop = null var/has_camera = FALSE - var/list/choice_categories = list() + var/list/choice_categories = list( + SENTRY_CATEGORY_IFF = list(FACTION_ALLY, SENTRY_FACTION_OWN), + ) - var/list/selected_categories = list() + var/list/selected_categories = list( + SENTRY_CATEGORY_IFF = SENTRY_FACTION_OWN, + ) + + var/faction_to_get + var/datum/faction/faction /obj/structure/machinery/defenses/Initialize() @@ -125,7 +131,7 @@ selected_categories[category] = selection switch(category) if(SENTRY_CATEGORY_IFF) - handle_iff(selection) + sentry_iff_mode = selection return TRUE return FALSE @@ -135,25 +141,6 @@ return TRUE return FALSE -/** - * Update the IFF status of this structure. - * @param selection: faction selection string. - */ -/obj/structure/machinery/defenses/proc/handle_iff(selection) - switch(selection) - if(FACTION_MARINE) - faction_group = FACTION_LIST_MARINE - if(SENTRY_FACTION_HUMAN) - faction_group = FACTION_LIST_HUMANOID - if(SENTRY_FACTION_COLONY) - faction_group = list(FACTION_MARINE, FACTION_COLONIST) - if(SENTRY_FACTION_WEYLAND) - faction_group = FACTION_LIST_MARINE_WY - if(FACTION_WY) - faction_group = FACTION_LIST_WY - if(FACTION_UPP) - faction_group = FACTION_LIST_UPP - /obj/structure/machinery/defenses/start_processing() if(!machine_processing) diff --git a/code/modules/defenses/planted_flag.dm b/code/modules/defenses/planted_flag.dm index 68ebeda8a9d9..e3b7ff3d4067 100644 --- a/code/modules/defenses/planted_flag.dm +++ b/code/modules/defenses/planted_flag.dm @@ -15,14 +15,6 @@ can_be_near_defense = TRUE - choice_categories = list( - SENTRY_CATEGORY_IFF = list(FACTION_MARINE, SENTRY_FACTION_WEYLAND, SENTRY_FACTION_HUMAN), - ) - - selected_categories = list( - SENTRY_CATEGORY_IFF = FACTION_MARINE, - ) - /obj/structure/machinery/defenses/planted_flag/Initialize() . = ..() @@ -77,7 +69,7 @@ return for(var/mob/living/carbon/human/H in targets) - if(!(H.get_target_lock(faction_group))) + if(!(H.ally_faction(faction))) continue apply_buff_to_player(H) @@ -126,9 +118,6 @@ area_range = 11 handheld_type = /obj/item/defenses/handheld/planted_flag/wy defense_type = "WY" - selected_categories = list( - SENTRY_CATEGORY_IFF = SENTRY_FACTION_WEYLAND, - ) /obj/structure/machinery/defenses/planted_flag/wy/apply_buff_to_player(mob/living/carbon/human/H) H.activate_order_buff(COMMAND_ORDER_HOLD, buff_intensity, 2 SECONDS) @@ -145,9 +134,6 @@ area_range = 11 handheld_type = /obj/item/defenses/handheld/planted_flag/upp defense_type = "UPP" - selected_categories = list( - SENTRY_CATEGORY_IFF = FACTION_UPP, - ) /obj/item/storage/backpack/jima name = "JIMA frame mount" @@ -183,7 +169,7 @@ targets |= M for(var/mob/living/carbon/human/H in targets) - if(!(H.get_target_lock(M.faction_group))) + if(!(H.ally_faction(M.faction))) continue H.activate_order_buff(COMMAND_ORDER_MOVE, buff_intensity, 3 SECONDS) diff --git a/code/modules/defenses/sentry.dm b/code/modules/defenses/sentry.dm index 6b2fb7209e3f..601935df0397 100644 --- a/code/modules/defenses/sentry.dm +++ b/code/modules/defenses/sentry.dm @@ -45,12 +45,12 @@ /// action list is configurable for all subtypes, this is just an example choice_categories = list( // SENTRY_CATEGORY_ROF = list(ROF_SINGLE, ROF_BURST, ROF_FULL_AUTO), - SENTRY_CATEGORY_IFF = list(FACTION_MARINE, SENTRY_FACTION_WEYLAND, SENTRY_FACTION_HUMAN, FACTION_UPP), + SENTRY_CATEGORY_IFF = list(FACTION_ALLY, SENTRY_FACTION_OWN), ) selected_categories = list( // SENTRY_CATEGORY_ROF = ROF_SINGLE, - SENTRY_CATEGORY_IFF = FACTION_MARINE, + SENTRY_CATEGORY_IFF = SENTRY_FACTION_OWN, ) /obj/structure/machinery/defenses/sentry/Initialize() @@ -365,7 +365,7 @@ targets.Remove(A) continue - if(M.get_target_lock(faction_group) || M.invisibility || HAS_TRAIT(M, TRAIT_ABILITY_BURROWED) || M.is_ventcrawling) + if(M.ally_faction(faction) || M.invisibility || HAS_TRAIT(M, TRAIT_ABILITY_BURROWED) || M.is_ventcrawling) if(M == target) target = null targets.Remove(M) @@ -475,11 +475,6 @@ faction_group = FACTION_LIST_MARINE static = TRUE -/obj/structure/machinery/defenses/sentry/premade/Initialize() - . = ..() - if(selected_categories[SENTRY_CATEGORY_IFF]) - selected_categories[SENTRY_CATEGORY_IFF] = FACTION_MARINE - /obj/structure/machinery/defenses/sentry/premade/get_examine_text(mob/user) . = ..() . += SPAN_NOTICE("It seems this one's bolts have been securely welded into the floor, and the access panel locked. You can't interact with it.") @@ -521,11 +516,6 @@ /obj/structure/machinery/defenses/sentry/premade/deployable/colony faction_group = list(FACTION_MARINE, FACTION_COLONIST, FACTION_SURVIVOR, FACTION_NSPA) -/obj/structure/machinery/defenses/sentry/premade/deployable/colony/Initialize() - . = ..() - choice_categories[SENTRY_CATEGORY_IFF] = list(SENTRY_FACTION_COLONY, SENTRY_FACTION_WEYLAND) - selected_categories[SENTRY_CATEGORY_IFF] = SENTRY_FACTION_COLONY - /obj/structure/machinery/defenses/sentry/premade/deployable/colony/wy name = "WY 5-GSE3 Static Turret" desc = "A state-of-the-art, high-tech static, semi-automated turret with AI targeting capabilities from Weyland-Yutani." @@ -534,11 +524,6 @@ sentry_type = "wy_sentry" faction_group = list(FACTION_MARINE, FACTION_COLONIST, FACTION_SURVIVOR, FACTION_WY, FACTION_NSPA) -/obj/structure/machinery/defenses/sentry/premade/deployable/colony/wy/Initialize() - . = ..() - choice_categories[SENTRY_CATEGORY_IFF] = list(SENTRY_FACTION_COLONY, SENTRY_FACTION_WEYLAND) - selected_categories[SENTRY_CATEGORY_IFF] = SENTRY_FACTION_COLONY - /obj/structure/machinery/defenses/sentry/premade/deployable/almayer name = "\improper UA-635C Static Gauss Turret" desc = "A fully-automated defence turret with mid-range targeting capabilities. Armed with a modified M32-S Autocannon and an internal belt feed and modified for UA warship use." @@ -653,14 +638,6 @@ damage_mult = 2 handheld_type = /obj/item/defenses/handheld/sentry/dmr - choice_categories = list( - SENTRY_CATEGORY_IFF = list(FACTION_MARINE, SENTRY_FACTION_WEYLAND, SENTRY_FACTION_HUMAN), - ) - - selected_categories = list( - SENTRY_CATEGORY_IFF = FACTION_MARINE, - ) - /obj/structure/machinery/defenses/sentry/dmr/handle_rof(level) return @@ -830,9 +807,6 @@ omni_directional = TRUE handheld_type = /obj/item/defenses/handheld/sentry/wy ammo = new /obj/item/ammo_magazine/sentry/wy - selected_categories = list( - SENTRY_CATEGORY_IFF = SENTRY_FACTION_WEYLAND, - ) /obj/structure/machinery/defenses/sentry/mini/wy name = "WY 14-GRA2 Mini Sentry" @@ -847,9 +821,6 @@ hack_time = 25 SECONDS handheld_type = /obj/item/defenses/handheld/sentry/wy/mini ammo = new /obj/item/ammo_magazine/sentry/wy/mini - selected_categories = list( - SENTRY_CATEGORY_IFF = SENTRY_FACTION_WEYLAND, - ) /obj/structure/machinery/defenses/sentry/dmr/wy name = "WY 2-ADT-A3 Heavy Sentry" @@ -866,9 +837,6 @@ sentry_range = 8 handheld_type = /obj/item/defenses/handheld/sentry/wy ammo = new /obj/item/ammo_magazine/sentry/wy - selected_categories = list( - SENTRY_CATEGORY_IFF = SENTRY_FACTION_WEYLAND, - ) /obj/structure/machinery/defenses/sentry/upp name = "UPP SDS-R3 Sentry Gun" @@ -881,9 +849,6 @@ disassemble_time = 5 SECONDS handheld_type = /obj/item/defenses/handheld/sentry/upp ammo = new /obj/item/ammo_magazine/sentry/upp - selected_categories = list( - SENTRY_CATEGORY_IFF = FACTION_UPP, - ) /obj/structure/machinery/defenses/sentry/upp/light name = "UPP SDS-R8 Light Sentry" diff --git a/code/modules/defenses/sentry_computer.dm b/code/modules/defenses/sentry_computer.dm index 3c278a6c06b2..ed0ad450faf1 100644 --- a/code/modules/defenses/sentry_computer.dm +++ b/code/modules/defenses/sentry_computer.dm @@ -358,7 +358,6 @@ sentry_holder["camera_available"] = defense.has_camera && defense.placed sentry_holder["selection_state"] = list() sentry_holder["kills"] = defense.kills - sentry_holder["iff_status"] = defense.faction_group sentry_holder["health"] = defense.health for(var/category in defense.selected_categories) diff --git a/code/modules/defenses/sentry_flamer.dm b/code/modules/defenses/sentry_flamer.dm index fcdd54708609..8cbd1e440416 100644 --- a/code/modules/defenses/sentry_flamer.dm +++ b/code/modules/defenses/sentry_flamer.dm @@ -11,12 +11,12 @@ choice_categories = list( // SENTRY_CATEGORY_ROF = list(ROF_SINGLE, ROF_FULL_AUTO), - SENTRY_CATEGORY_IFF = list(FACTION_MARINE, SENTRY_FACTION_WEYLAND, SENTRY_FACTION_HUMAN), + SENTRY_CATEGORY_IFF = list(FACTION_ALLY, SENTRY_FACTION_OWN), ) selected_categories = list( SENTRY_CATEGORY_ROF = ROF_SINGLE, - SENTRY_CATEGORY_IFF = FACTION_MARINE, + SENTRY_CATEGORY_IFF = SENTRY_FACTION_OWN, ) /obj/structure/machinery/defenses/sentry/flamer/handle_rof(level) @@ -115,10 +115,6 @@ sentry_range = 6 omni_directional = TRUE handheld_type = /obj/item/defenses/handheld/sentry/flamer/wy - selected_categories = list( - SENTRY_CATEGORY_ROF = ROF_SINGLE, - SENTRY_CATEGORY_IFF = SENTRY_FACTION_WEYLAND, - ) /obj/structure/machinery/defenses/sentry/flamer/wy/destroyed_action() visible_message("[icon2html(src, viewers(src))] [SPAN_WARNING("The [name] starts spitting out sparks and smoke!")]") @@ -146,10 +142,6 @@ ammo = new /obj/item/ammo_magazine/sentry_flamer/upp sentry_type = "upp_flamer" handheld_type = /obj/item/defenses/handheld/sentry/flamer/upp - selected_categories = list( - SENTRY_CATEGORY_ROF = ROF_SINGLE, - SENTRY_CATEGORY_IFF = FACTION_UPP, - ) /obj/structure/machinery/defenses/sentry/flamer/upp/destroyed_action() visible_message("[icon2html(src, viewers(src))] [SPAN_WARNING("The [name] starts spitting out sparks and smoke!")]") diff --git a/code/modules/defenses/tesla_coil.dm b/code/modules/defenses/tesla_coil.dm index bb150acc1e95..f96b5aa31ba8 100644 --- a/code/modules/defenses/tesla_coil.dm +++ b/code/modules/defenses/tesla_coil.dm @@ -20,14 +20,6 @@ has_camera = FALSE - choice_categories = list( - SENTRY_CATEGORY_IFF = list(FACTION_MARINE, SENTRY_FACTION_WEYLAND, SENTRY_FACTION_HUMAN), - ) - - selected_categories = list( - SENTRY_CATEGORY_IFF = FACTION_MARINE, - ) - /obj/structure/machinery/defenses/tesla_coil/Initialize() . = ..() @@ -78,7 +70,7 @@ to_chat(M, SPAN_WARNING("You ignore some weird noises as you charge.")) continue - if(M.get_target_lock(faction_group)) + if(M.ally_faction(faction)) continue targets += M diff --git a/code/modules/events/comms_blackout.dm b/code/modules/events/comms_blackout.dm index ea7ad9c84b78..c15e80d8a76b 100644 --- a/code/modules/events/comms_blackout.dm +++ b/code/modules/events/comms_blackout.dm @@ -1,6 +1,6 @@ /proc/communications_blackout(silent = 1) if(!silent) - marine_announcement("Ionic radiation flare detected from nearby star. Imminent telecommunication failu*3mga;b4;'1v�-BZZZT", "Problem Detected", 'sound/misc/interference.ogg') + faction_announcement("Ionic radiation flare detected from nearby star. Imminent telecommunication failu*3mga;b4;'1v�-BZZZT", "Problem Detected", 'sound/misc/interference.ogg') else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms for(var/mob/living/silicon/ai/A in GLOB.ai_mob_list) to_chat(A, "
") diff --git a/code/modules/gear_presets/_select_equipment.dm b/code/modules/gear_presets/_select_equipment.dm index 9c7d5fad34b0..179ce6435d10 100644 --- a/code/modules/gear_presets/_select_equipment.dm +++ b/code/modules/gear_presets/_select_equipment.dm @@ -18,8 +18,8 @@ var/list/paygrades = list("???") var/role_comm_title var/minimum_age - var/faction = FACTION_NEUTRAL - var/list/faction_group + var/job_faction = FACTION_NEUTRAL + var/force_update_faction = TRUE var/origin_override var/minimap_icon = "private" @@ -76,9 +76,6 @@ UNIFORM_VEND_DRESS_EXTRA = dress_extra ) - if(!faction_group) - faction_group = list(faction) - //load_appearance() /datum/equipment_preset/proc/load_race(mob/living/carbon/human/new_human, client/mob_client) return diff --git a/code/modules/gear_presets/agents.dm b/code/modules/gear_presets/agents.dm index b7c098de6e23..c6386dd7259e 100644 --- a/code/modules/gear_presets/agents.dm +++ b/code/modules/gear_presets/agents.dm @@ -47,8 +47,8 @@ /datum/equipment_preset/upp/representative name = "UPP Representative" - faction_group = FACTION_LIST_MARINE_UPP flags = EQUIPMENT_PRESET_EXTRA + job_faction = FACTION_UPP idtype = /obj/item/card/id/silver/cl access = list( @@ -83,8 +83,7 @@ /datum/equipment_preset/twe/representative name = "TWE Representative" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_TWE - faction_group = FACTION_LIST_MARINE_TWE + job_faction = FACTION_TWE idtype = /obj/item/card/id/silver/cl access = list( diff --git a/code/modules/gear_presets/cia.dm b/code/modules/gear_presets/cia.dm index ec7c71398671..d88628024f70 100644 --- a/code/modules/gear_presets/cia.dm +++ b/code/modules/gear_presets/cia.dm @@ -5,7 +5,7 @@ assignment = JOB_CIA skills = /datum/skills/cia languages = ALL_HUMAN_LANGUAGES - faction = FACTION_MARINE + job_faction = FACTION_MARINE /datum/equipment_preset/cia/New() . = ..() diff --git a/code/modules/gear_presets/clf.dm b/code/modules/gear_presets/clf.dm index d129410642a1..c1ef81699abf 100644 --- a/code/modules/gear_presets/clf.dm +++ b/code/modules/gear_presets/clf.dm @@ -4,7 +4,7 @@ assignment = JOB_CLF rank = FACTION_CLF paygrades = list(PAY_SHORT_REB = JOB_PLAYTIME_TIER_0) - faction = FACTION_CLF + job_faction = FACTION_CLF origin_override = ORIGIN_CIVILIAN minimap_background = "background_clf" idtype = /obj/item/card/id/data @@ -1105,7 +1105,6 @@ /datum/equipment_preset/clf/soldier/hunted name = "CLF Soldier (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/clf/soldier/hunted/load_gear(mob/living/carbon/human/new_human) var/obj/item/clothing/under/colonist/clf/jumpsuit = new() @@ -1129,7 +1128,6 @@ /datum/equipment_preset/clf/leader/hunted name = "CLF Leader (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/clf/leader/hunted/load_gear(mob/living/carbon/human/new_human) @@ -1158,7 +1156,6 @@ /datum/equipment_preset/clf/engineer/hunted name = "CLF Engineer (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/clf/engineer/hunted/load_gear(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/cmb.dm b/code/modules/gear_presets/cmb.dm index a0f929ef1e2e..749536e08b2e 100644 --- a/code/modules/gear_presets/cmb.dm +++ b/code/modules/gear_presets/cmb.dm @@ -1,7 +1,6 @@ /datum/equipment_preset/cmb name = "Colonial Marshal" - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE) + job_faction = FACTION_MARSHAL rank = JOB_CMB idtype = /obj/item/card/id/deputy languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) @@ -806,8 +805,7 @@ paygrades = list(PAY_SHORT_ME2 = JOB_PLAYTIME_TIER_0) role_comm_title = "A-RFN" skills = /datum/skills/pfc/crafty - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE) + job_faction = FACTION_MARSHAL minimap_icon = "private" minimap_background = "background_cmb" diff --git a/code/modules/gear_presets/colonist.dm b/code/modules/gear_presets/colonist.dm index e9eefe2620ab..7331f6412840 100644 --- a/code/modules/gear_presets/colonist.dm +++ b/code/modules/gear_presets/colonist.dm @@ -4,7 +4,7 @@ flags = EQUIPMENT_PRESET_EXTRA assignment = JOB_COLONIST rank = JOB_COLONIST - faction = FACTION_COLONIST + job_faction = FACTION_COLONIST access = list(ACCESS_CIVILIAN_PUBLIC) skills = /datum/skills/civilian diff --git a/code/modules/gear_presets/contractor.dm b/code/modules/gear_presets/contractor.dm index 08bec3515ed0..2d4473c82320 100644 --- a/code/modules/gear_presets/contractor.dm +++ b/code/modules/gear_presets/contractor.dm @@ -1,10 +1,8 @@ /datum/equipment_preset/contractor name = "Military Contractor" - faction = FACTION_CONTRACTOR + job_faction = FACTION_CONTRACTOR rank = JOB_CONTRACTOR idtype = /obj/item/card/id/data - faction = FACTION_CONTRACTOR - faction_group = list(FACTION_CONTRACTOR) languages = list(LANGUAGE_ENGLISH, LANGUAGE_SPANISH, LANGUAGE_RUSSIAN) var/human_versus_human = FALSE var/headset_type = /obj/item/device/radio/headset/distress/contractor @@ -66,7 +64,6 @@ assignment = "VAIPO Mercenary" rank = JOB_CONTRACTOR_ST skills = /datum/skills/contractor - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/duty/standard/load_gear(mob/living/carbon/human/new_human) @@ -175,7 +172,6 @@ assignment = "VAIPO Automatic Rifleman" rank = JOB_CONTRACTOR_MG skills = /datum/skills/contractor/heavy - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/duty/heavy/load_gear(mob/living/carbon/human/new_human) @@ -237,7 +233,6 @@ assignment = "VAIPO Engineering Specialist" rank = JOB_CONTRACTOR_ENGI skills = /datum/skills/contractor/engi - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/duty/engi/load_gear(mob/living/carbon/human/new_human) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/tshirt/w_br, WEAR_BODY) @@ -283,7 +278,6 @@ assignment = "VAIMS Medical Specialist" rank = JOB_CONTRACTOR_MEDIC skills = /datum/skills/contractor/medic - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/duty/medic/load_gear(mob/living/carbon/human/new_human) //clothing @@ -329,7 +323,6 @@ assignment = "VAIPO Team Leader" rank = JOB_CONTRACTOR_TL skills = /datum/skills/contractor/leader - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/duty/leader/load_gear(mob/living/carbon/human/new_human) //clothes @@ -378,7 +371,6 @@ assignment = "VAIPO Support Synthetic" rank = JOB_CONTRACTOR_SYN - faction = FACTION_CONTRACTOR languages = ALL_SYNTH_LANGUAGES /datum/equipment_preset/contractor/duty/synth/load_skills(mob/living/carbon/human/new_human) @@ -470,7 +462,6 @@ assignment = "VAISO Mercenary" rank = JOB_CONTRACTOR_COVST skills = /datum/skills/contractor - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/covert/load_gear(mob/living/carbon/human/new_human) @@ -579,7 +570,6 @@ assignment = "VAISO Automatic Rifleman" rank = JOB_CONTRACTOR_COVMG skills = /datum/skills/contractor/heavy - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/covert/heavy/load_gear(mob/living/carbon/human/new_human) new_human.equip_to_slot_or_del(new headset_type, WEAR_L_EAR) @@ -630,7 +620,6 @@ assignment = "VAISO Engineering Specialist" rank = JOB_CONTRACTOR_COVENG skills = /datum/skills/contractor/engi - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/covert/engi/load_gear(mob/living/carbon/human/new_human) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/rank/utility/brown, WEAR_BODY) @@ -677,7 +666,6 @@ assignment = "VAIMS Medical Specialist" rank = JOB_CONTRACTOR_COVMED skills = /datum/skills/contractor/medic - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/covert/medic/load_gear(mob/living/carbon/human/new_human) //clothing @@ -724,7 +712,6 @@ assignment = "VAISO Team Leader" rank = JOB_CONTRACTOR_COVTL skills = /datum/skills/contractor/leader - faction = FACTION_CONTRACTOR /datum/equipment_preset/contractor/covert/leader/load_gear(mob/living/carbon/human/new_human) //clothes @@ -775,7 +762,6 @@ assignment = "VAISO Support Synthetic" rank = JOB_CONTRACTOR_COVSYN skills = /datum/skills/synthetic - faction = FACTION_CONTRACTOR languages = ALL_SYNTH_LANGUAGES /datum/equipment_preset/contractor/covert/synth/load_skills(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/corpses.dm b/code/modules/gear_presets/corpses.dm index 7b176ee4af4d..c23e9e1d64c5 100644 --- a/code/modules/gear_presets/corpses.dm +++ b/code/modules/gear_presets/corpses.dm @@ -4,7 +4,7 @@ flags = EQUIPMENT_PRESET_EXTRA assignment = JOB_COLONIST rank = JOB_COLONIST - faction = FACTION_COLONIST + job_faction = FACTION_COLONIST languages = list() access = list(ACCESS_CIVILIAN_PUBLIC) paygrades = list(PAY_SHORT_CIV = JOB_PLAYTIME_TIER_0) @@ -273,7 +273,6 @@ name = "Corpse - Corporate Liaison" assignment = JOB_EXECUTIVE rank = JOB_EXECUTIVE - faction_group = FACTION_LIST_WY paygrades = list(PAY_SHORT_WYC3 = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/silver/clearance_badge/cl xenovictim = TRUE @@ -350,7 +349,6 @@ name = "Corpse - Colony Division Manager" assignment = "Colonial Division Manager" rank = JOB_DIVISION_MANAGER - faction_group = FACTION_LIST_WY paygrades = list(PAY_SHORT_WYC8 = JOB_PLAYTIME_TIER_0) access = list( ACCESS_WY_GENERAL, @@ -386,7 +384,6 @@ name = "Corpse - Colony Administrator" assignment = "Colonial Administrator" rank = JOB_DIRECTOR - faction_group = FACTION_LIST_WY paygrades = list(PAY_SHORT_WYC10 = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/silver/cl access = list( @@ -575,7 +572,6 @@ paygrades = list(PAY_SHORT_WYC6 = JOB_PLAYTIME_TIER_0) rank = FACTION_WY idtype = /obj/item/card/id/silver/clearance_badge/manager - faction_group = FACTION_LIST_WY access = list( ACCESS_WY_GENERAL, ACCESS_WY_COLONIAL, @@ -616,7 +612,7 @@ assignment = JOB_CLF idtype = /obj/item/card/id/data rank = JOB_CLF - faction = FACTION_CLF + job_faction = FACTION_CLF paygrades = list(PAY_SHORT_REB = JOB_PLAYTIME_TIER_0) /datum/equipment_preset/corpse/clf/New() @@ -656,7 +652,7 @@ idtype = /obj/item/card/id/dogtag/upp paygrades = list(PAY_SHORT_UE2 = JOB_PLAYTIME_TIER_0) rank = JOB_UPP - faction = FACTION_UPP + job_faction = FACTION_UPP /datum/equipment_preset/corpse/upp/New() . = ..() @@ -688,8 +684,7 @@ name = "Corpse - Weyland-Yutani PMC (Standard)" flags = EQUIPMENT_PRESET_START_OF_ROUND assignment = JOB_PMC_STANDARD - faction = FACTION_PMC - faction_group = FACTION_LIST_WY + job_faction = FACTION_PMC rank = JOB_PMC_STANDARD paygrades = list(PAY_SHORT_PMC_OP = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/pmc @@ -816,7 +811,7 @@ paygrades = list(PAY_SHORT_FL_S = JOB_PLAYTIME_TIER_0) rank = FACTION_FREELANCER idtype = /obj/item/card/id/data - faction = FACTION_FREELANCER + job_faction = FACTION_FREELANCER /datum/equipment_preset/corpse/freelancer/New() . = ..() @@ -918,7 +913,7 @@ name = "Corpse - Dutch Dozen Rifleman" assignment = "Dutch Dozen Rifleman" idtype = /obj/item/card/id/silver - faction = FACTION_DUTCH + job_faction = FACTION_DUTCH xenovictim = FALSE /datum/equipment_preset/corpse/dutchrifle/New() @@ -951,7 +946,7 @@ name = "Corpse - Pizza Deliverer" assignment = "Pizza Deliverer" idtype = /obj/item/card/id/silver - faction = FACTION_PIZZA + job_faction = FACTION_PIZZA xenovictim = FALSE /datum/equipment_preset/corpse/pizza/New() @@ -989,7 +984,7 @@ name = "Corpse - Gladiator" assignment = "Gladiator" idtype = /obj/item/card/id/dogtag - faction = FACTION_GLADIATOR + job_faction = FACTION_GLADIATOR xenovictim = FALSE access = list( ACCESS_CIVILIAN_PUBLIC, @@ -1032,7 +1027,6 @@ paygrades = list(PAY_SHORT_ME5 = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/dogtag role_comm_title = "FORECON" - faction_group = list(FACTION_MARINE, FACTION_SURVIVOR) access = list( ACCESS_CIVILIAN_PUBLIC, ACCESS_CIVILIAN_ENGINEERING, @@ -1351,12 +1345,11 @@ name = "Corpse - NSPA Constable" assignment = "NSPA Constable" - faction_group = FACTION_LIST_SURVIVOR_NSPA paygrades = list(PAY_SHORT_CST = JOB_PLAYTIME_TIER_0, PAY_SHORT_SC = JOB_PLAYTIME_TIER_3, PAY_SHORT_SGT = JOB_PLAYTIME_TIER_4) skills = /datum/skills/civilian/survivor/marshal flags = EQUIPMENT_PRESET_START_OF_ROUND idtype = /obj/item/card/id/nspa_silver - faction = FACTION_NSPA + job_faction = FACTION_NSPA access = list(ACCESS_CIVILIAN_PUBLIC,ACCESS_CIVILIAN_RESEARCH,ACCESS_CIVILIAN_ENGINEERING,ACCESS_CIVILIAN_LOGISTICS,ACCESS_CIVILIAN_BRIG,ACCESS_CIVILIAN_MEDBAY,ACCESS_CIVILIAN_COMMAND,) /datum/equipment_preset/corpse/hybrisa/nspa_constable/load_gear(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/dust_raider.dm b/code/modules/gear_presets/dust_raider.dm index 42f234d6399d..291a2ec133ee 100644 --- a/code/modules/gear_presets/dust_raider.dm +++ b/code/modules/gear_presets/dust_raider.dm @@ -2,7 +2,7 @@ name = "Dust Raider" idtype = /obj/item/card/id/dogtag languages = list(LANGUAGE_ENGLISH) - faction = FACTION_MARINE + job_faction = FACTION_MARINE /datum/equipment_preset/dust_raider/load_name(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/dutch.dm b/code/modules/gear_presets/dutch.dm index 8a51fb9d59e2..d278b57d29ba 100644 --- a/code/modules/gear_presets/dutch.dm +++ b/code/modules/gear_presets/dutch.dm @@ -5,7 +5,7 @@ paygrades = list(PAY_SHORT_DTC = JOB_PLAYTIME_TIER_0) assignment = JOB_DUTCH_RIFLEMAN flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_DUTCH + job_faction = FACTION_DUTCH skills = /datum/skills/dutchmerc diff --git a/code/modules/gear_presets/fax_responders.dm b/code/modules/gear_presets/fax_responders.dm index 636f4964595d..7c7a58e5cd8d 100644 --- a/code/modules/gear_presets/fax_responders.dm +++ b/code/modules/gear_presets/fax_responders.dm @@ -6,8 +6,7 @@ role_comm_title = "Resp." flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_FAX - faction_group = list(FACTION_FAX) + job_faction = FACTION_FAX uses_special_name = TRUE @@ -72,7 +71,6 @@ name = "Fax Responder - USCM HC" assignment = JOB_FAX_RESPONDER_USCM_HC rank = JOB_FAX_RESPONDER_USCM_HC - faction_group = list(FACTION_FAX, FACTION_MARINE) paygrades = list(PAY_SHORT_MO2 = JOB_PLAYTIME_TIER_0, PAY_SHORT_MO3 = JOB_PLAYTIME_TIER_1, PAY_SHORT_MO4 = JOB_PLAYTIME_TIER_3) idtype = /obj/item/card/id/gold @@ -95,7 +93,6 @@ name = "Fax Responder - USCM Provost" assignment = JOB_FAX_RESPONDER_USCM_PVST rank = JOB_FAX_RESPONDER_USCM_PVST - faction_group = list(FACTION_FAX, FACTION_MARINE) idtype = /obj/item/card/id/provost /datum/equipment_preset/fax_responder/uscm/provost/load_gear(mob/living/carbon/human/new_human) @@ -118,7 +115,6 @@ name = "Fax Responder - WY" assignment = JOB_FAX_RESPONDER_WY rank = JOB_FAX_RESPONDER_WY - faction_group = list(FACTION_FAX, FACTION_MARINE, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_PMC) paygrades = list(PAY_SHORT_WYC5 = JOB_PLAYTIME_TIER_0, PAY_SHORT_WYC6 = JOB_PLAYTIME_TIER_1, PAY_SHORT_WYC7 = JOB_PLAYTIME_TIER_3) access = list(ACCESS_MARINE_COMMAND, ACCESS_WY_COLONIAL, ACCESS_WY_EXEC, ACCESS_WY_GENERAL, ACCESS_WY_LEADERSHIP) headset_type = /obj/item/device/radio/headset/distress/pmc/command @@ -139,7 +135,6 @@ name = "Fax Responder - UPP" assignment = JOB_FAX_RESPONDER_UPP rank = JOB_FAX_RESPONDER_UPP - faction_group = list(FACTION_FAX, FACTION_UPP) paygrades = list(PAY_SHORT_UO2 = JOB_PLAYTIME_TIER_0, PAY_SHORT_UO3 = JOB_PLAYTIME_TIER_1, PAY_SHORT_UO4 = JOB_PLAYTIME_TIER_3) headset_type = /obj/item/device/radio/headset/distress/UPP/kdo/command idtype = /obj/item/card/id/gold @@ -170,7 +165,6 @@ name = "Fax Responder - TWE" assignment = JOB_FAX_RESPONDER_TWE rank = JOB_FAX_RESPONDER_TWE - faction_group = list(FACTION_FAX, FACTION_MARINE, FACTION_TWE) headset_type = /obj/item/device/radio/headset/distress/royal_marine idtype = /obj/item/card/id/gold paygrades = list(PAY_SHORT_RNO2 = JOB_PLAYTIME_TIER_0, PAY_SHORT_RNO3 = JOB_PLAYTIME_TIER_1, PAY_SHORT_RNO4 = JOB_PLAYTIME_TIER_3) @@ -192,7 +186,6 @@ name = "Fax Responder - CLF" assignment = JOB_FAX_RESPONDER_CLF rank = JOB_FAX_RESPONDER_CLF - faction_group = list(FACTION_FAX, FACTION_CLF) headset_type = /obj/item/device/radio/headset/distress/CLF/command paygrades = list(PAY_SHORT_REBC = JOB_PLAYTIME_TIER_0) @@ -216,7 +209,6 @@ name = "Fax Responder - CMB" assignment = JOB_FAX_RESPONDER_CMB rank = JOB_FAX_RESPONDER_CMB - faction_group = list(FACTION_FAX, FACTION_MARINE, FACTION_MARSHAL) headset_type = /obj/item/device/radio/headset/distress/CMB idtype = /obj/item/card/id/marshal paygrades = list(PAY_SHORT_CMBM = JOB_PLAYTIME_TIER_0) @@ -245,7 +237,6 @@ name = "Fax Responder - Press" assignment = JOB_FAX_RESPONDER_PRESS rank = JOB_FAX_RESPONDER_PRESS - faction_group = list(FACTION_FAX, FACTION_MARINE, FACTION_COLONIST) headset_type = /obj/item/device/radio/headset/almayer/reporter idtype = /obj/item/card/id/silver/cl paygrades = list(PAY_SHORT_CIV = JOB_PLAYTIME_TIER_0) diff --git a/code/modules/gear_presets/fun.dm b/code/modules/gear_presets/fun.dm index 40316e57ab3b..b4a5ad3abdf4 100644 --- a/code/modules/gear_presets/fun.dm +++ b/code/modules/gear_presets/fun.dm @@ -12,7 +12,7 @@ /datum/equipment_preset/fun/pirate name = "Fun - Pirate" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_PIRATE + job_faction = FACTION_PIRATE skills = /datum/skills/pfc/crafty @@ -75,8 +75,7 @@ flags = EQUIPMENT_PRESET_EXTRA uses_special_name = TRUE - faction = FACTION_HEFA - faction_group = list(FACTION_HEFA, FACTION_MARINE) + job_faction = FACTION_HEFA // Cooperate! idtype = /obj/item/card/id/gold @@ -245,8 +244,7 @@ paygrades = list(PAY_SHORT_CDNM = JOB_PLAYTIME_TIER_0) flags = EQUIPMENT_PRESET_EXTRA skills = /datum/skills/everything - faction = FACTION_MARINE - faction_group = FACTION_LIST_MARINE + job_faction = FACTION_MARINE assignment = "Santa" skills = null @@ -416,7 +414,7 @@ /datum/equipment_preset/fun/monkey name = "Fun - Monkey" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_MONKEY + job_faction = FACTION_MONKEY uses_special_name = TRUE diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index c769e9ff35fa..041407e48224 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -35,7 +35,7 @@ assignment = "Freelancer" rank = FACTION_FREELANCER idtype = /obj/item/card/id/data - faction = FACTION_FREELANCER + job_faction = FACTION_FREELANCER /datum/equipment_preset/other/freelancer/New() . = ..() @@ -239,7 +239,6 @@ /datum/equipment_preset/other/freelancer/standard/hunted name = "Freelancer (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/other/freelancer/standard/hunted/load_gear(mob/living/carbon/human/new_human) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/marine/veteran/freelancer, WEAR_BODY) @@ -262,7 +261,6 @@ /datum/equipment_preset/other/freelancer/leader/hunted name = "Freelancer Leader (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/other/freelancer/leader/hunted/load_gear(mob/living/carbon/human/new_human) @@ -293,7 +291,7 @@ assignment = "Elite Mercenary" rank = "Mercenary" idtype = /obj/item/card/id/centcom - faction = FACTION_MERCENARY + job_faction = FACTION_MERCENARY /datum/equipment_preset/other/elite_merc/New() . = ..() @@ -326,7 +324,6 @@ assignment = "Mercenary Miner" rank = "Mercenary" skills = /datum/skills/mercenary/elite - faction = FACTION_MERCENARY /datum/equipment_preset/other/elite_merc/standard/load_gear(mob/living/carbon/human/new_human) //TODO: add unique backpacks and satchels @@ -363,7 +360,6 @@ assignment = "Mercenary Heavy" rank = "Mercenary" skills = /datum/skills/mercenary/elite/heavy - faction = FACTION_MERCENARY /datum/equipment_preset/other/elite_merc/heavy/load_gear(mob/living/carbon/human/new_human) //TODO: add backpacks and satchels @@ -403,7 +399,6 @@ assignment = "Mercenary Engineer" rank = "Mercenary" skills = /datum/skills/mercenary/elite/engineer - faction = FACTION_MERCENARY /datum/equipment_preset/other/elite_merc/engineer/load_gear(mob/living/carbon/human/new_human) @@ -457,7 +452,6 @@ assignment = "Mercenary Medic" rank = "Mercenary" skills = /datum/skills/mercenary/elite/medic - faction = FACTION_MERCENARY /datum/equipment_preset/other/elite_merc/medic/load_gear(mob/living/carbon/human/new_human) //webbing @@ -503,7 +497,6 @@ assignment = "Mercenary Warlord" rank = "Mercenary" skills = /datum/skills/mercenary/elite/leader - faction = FACTION_MERCENARY /datum/equipment_preset/other/elite_merc/leader/load_gear(mob/living/carbon/human/new_human) //clothes @@ -535,7 +528,7 @@ /datum/equipment_preset/other/business_person name = "Business Person" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_MARINE + job_faction = FACTION_MARINE idtype = /obj/item/card/id/silver/cl assignment = "Corporate Representative" rank = "Corporate Representative" @@ -567,7 +560,7 @@ rank = FACTION_PIZZA skills = /datum/skills/civilian paygrades = list(PAY_SHORT_CIV = JOB_PLAYTIME_TIER_0) - faction = FACTION_PIZZA + job_faction = FACTION_PIZZA /datum/equipment_preset/other/pizza/New() . = ..() @@ -612,7 +605,7 @@ assignment = FACTION_SOUTO rank = "Souto Man" skills = /datum/skills/souto - faction = FACTION_SOUTO + job_faction = FACTION_SOUTO /datum/equipment_preset/other/souto/New() . = ..() @@ -649,10 +642,17 @@ rank = FACTION_ZOMBIE languages = list("Zombie") skills = null //no restrictions - faction = FACTION_ZOMBIE + + job_faction = FACTION_ZOMBIE //Overloading the function to be able to spawn gear first /datum/equipment_preset/other/zombie/load_preset(mob/living/carbon/human/new_human, randomise = FALSE) + GLOB.faction_datums[job_faction].add_mob(new_human) + if(new_human.faction?.organ_faction_iff_tag_type) + if(new_human.organ_faction_tag) + QDEL_NULL(new_human.organ_faction_tag) + new_human.organ_faction_tag = new new_human.faction.organ_faction_iff_tag_type(new_human, new_human.faction) + if(randomise) load_name(new_human) load_skills(new_human) //skills are set before equipment because of skill restrictions on certain clothes. @@ -702,7 +702,8 @@ assignment = "Bestiarius" rank = FACTION_GLADIATOR - faction = FACTION_GLADIATOR + + job_faction = FACTION_GLADIATOR /datum/equipment_preset/other/gladiator/load_name(mob/living/carbon/human/new_human, randomise) new_human.gender = pick(MALE, FEMALE) @@ -785,7 +786,7 @@ /datum/equipment_preset/other/xeno_cultist name = "Cultist - Xeno Cultist" - faction = FACTION_XENOMORPH + job_faction = FACTION_XENOMORPH flags = EQUIPMENT_PRESET_EXTRA idtype = /obj/item/card/id/lanyard skills = /datum/skills/civilian/survivor @@ -921,7 +922,7 @@ minimum_age = 30 skills = /datum/skills/tank_crew - faction = FACTION_NEUTRAL + job_faction = FACTION_NEUTRAL /datum/equipment_preset/other/tank/New() . = ..() @@ -961,8 +962,6 @@ minimum_age = 25 skills = /datum/skills/tank_crew - faction = FACTION_NEUTRAL - /datum/equipment_preset/other/tank/trainee/New() . = ..() access = list( @@ -988,9 +987,8 @@ /datum/equipment_preset/tutorial name = "Tutorial" - faction = FACTION_MARINE + job_faction = FACTION_MARINE flags = EQUIPMENT_PRESET_EXTRA - faction_group = FACTION_LIST_MARINE languages = list(LANGUAGE_ENGLISH) idtype = /obj/item/card/id /// If the player should start out underfed diff --git a/code/modules/gear_presets/pmc.dm b/code/modules/gear_presets/pmc.dm index 328ce93c3bcc..beec99372899 100644 --- a/code/modules/gear_presets/pmc.dm +++ b/code/modules/gear_presets/pmc.dm @@ -1,11 +1,9 @@ /datum/equipment_preset/pmc name = "PMC" - faction = FACTION_PMC + job_faction = FACTION_PMC rank = FACTION_PMC idtype = /obj/item/card/id/pmc - faction = FACTION_PMC - faction_group = FACTION_LIST_WY languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) minimap_background = "background_pmc" var/human_versus_human = FALSE @@ -1352,8 +1350,6 @@ list("POUCHES (CHOOSE 2)", 0, null, null, null), name = "Weyland-Yutani PMC (Xeno Handler)" flags = EQUIPMENT_PRESET_EXTRA - faction_group = FACTION_LIST_MARINE_WY - assignment = JOB_PMC_XENO_HANDLER rank = JOB_PMC_XENO_HANDLER paygrades = list(PAY_SHORT_PMC_XS = JOB_PLAYTIME_TIER_0) diff --git a/code/modules/gear_presets/royal_marines.dm b/code/modules/gear_presets/royal_marines.dm index a62fa5b935eb..3419e8761492 100644 --- a/code/modules/gear_presets/royal_marines.dm +++ b/code/modules/gear_presets/royal_marines.dm @@ -1,7 +1,6 @@ /datum/equipment_preset/twe name = "Three World Empire" - faction = FACTION_TWE - faction_group = list(FACTION_TWE, FACTION_MARINE) + job_faction = FACTION_TWE languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) minimap_background = "background_twe" @@ -355,7 +354,6 @@ /datum/equipment_preset/twe/royal_marine/standard/hunted name = "TWE Royal Marine Commando (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/twe/royal_marine/standard/hunted/load_gear(mob/living/carbon/human/new_human) @@ -391,7 +389,6 @@ /datum/equipment_preset/twe/royal_marine/team_leader/hunted name = "TWE Royal Marine Commando TL (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/twe/royal_marine/team_leader/hunted/load_gear(mob/living/carbon/human/new_human) @@ -431,7 +428,6 @@ /datum/equipment_preset/twe/royal_marine/lieuteant/hunted name = "TWE Royal Marine Commando Officer (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/twe/royal_marine/lieuteant/hunted/load_gear(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/survivors/fiorina_sciannex/preset_fiorina_sciannex.dm b/code/modules/gear_presets/survivors/fiorina_sciannex/preset_fiorina_sciannex.dm index 5c7f3109c4c9..65e24e730040 100644 --- a/code/modules/gear_presets/survivors/fiorina_sciannex/preset_fiorina_sciannex.dm +++ b/code/modules/gear_presets/survivors/fiorina_sciannex/preset_fiorina_sciannex.dm @@ -48,7 +48,7 @@ idtype = /obj/item/card/id/silver rank = JOB_SURVIVOR role_comm_title = "UA RO" - faction = FACTION_SURVIVOR + job_faction = FACTION_SURVIVOR minimap_icon = "mp" minimap_background = "background_ua" diff --git a/code/modules/gear_presets/survivors/fiorina_sciannex/riot_in_progress_insert_fiorina_nightmare.dm b/code/modules/gear_presets/survivors/fiorina_sciannex/riot_in_progress_insert_fiorina_nightmare.dm index cefb2830c451..af281e1e986a 100644 --- a/code/modules/gear_presets/survivors/fiorina_sciannex/riot_in_progress_insert_fiorina_nightmare.dm +++ b/code/modules/gear_presets/survivors/fiorina_sciannex/riot_in_progress_insert_fiorina_nightmare.dm @@ -2,8 +2,7 @@ /datum/equipment_preset/survivor/cmb name = "Survivor - Colonial Marshal" - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE, FACTION_SURVIVOR) + job_faction = FACTION_MARSHAL languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) var/human_versus_human = FALSE minimap_background = "background_cmb" @@ -18,8 +17,6 @@ paygrades = list(PAY_SHORT_CMBR = JOB_PLAYTIME_TIER_0) role_comm_title = "CMB RCO" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE, FACTION_SURVIVOR) assignment = "CMB Riot Control Officer" idtype = /obj/item/card/id/deputy/riot rank = JOB_CMB_RIOT @@ -86,13 +83,12 @@ // cmb synth (of note /datum/equipment_preset/synth/survivor/cmb_synth also exists) /datum/equipment_preset/synth/survivor/cmb flags = EQUIPMENT_PRESET_STUB + job_faction = FACTION_MARSHAL /datum/equipment_preset/synth/survivor/cmb/riotsynth name = "Survivor - Synthetic - CMB Riot Control Synthetic" paygrades = list(PAY_SHORT_CMBRS = JOB_PLAYTIME_TIER_0) role_comm_title = "CMB Syn" - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE, FACTION_SURVIVOR) flags = EQUIPMENT_PRESET_EXTRA assignment = "CMB Riot Control Synthetic" rank = JOB_CMB_RSYN diff --git a/code/modules/gear_presets/survivors/lv_522/forcon_survivors.dm b/code/modules/gear_presets/survivors/lv_522/forcon_survivors.dm index 1c145f4258c0..ab2b1b2d830d 100644 --- a/code/modules/gear_presets/survivors/lv_522/forcon_survivors.dm +++ b/code/modules/gear_presets/survivors/lv_522/forcon_survivors.dm @@ -6,7 +6,6 @@ role_comm_title = "FORECON" minimap_background = "background_forecon" rank = JOB_SURVIVOR - faction_group = list(FACTION_MARINE, FACTION_SURVIVOR) flags = EQUIPMENT_PRESET_START_OF_ROUND access = list( ACCESS_CIVILIAN_PUBLIC, @@ -286,7 +285,6 @@ /datum/equipment_preset/synth/survivor/forecon name = "Survivor - Synthetic - FORECON Synth" assignment = JOB_FORECON_SYN - faction_group = list(FACTION_MARINE, FACTION_SURVIVOR) idtype = /obj/item/card/id/gold /datum/equipment_preset/synth/survivor/forecon/load_gear(mob/living/carbon/human/preset_human) //Bishop from Aliens diff --git a/code/modules/gear_presets/survivors/lv_624/clfship_insert_lv624.dm b/code/modules/gear_presets/survivors/lv_624/clfship_insert_lv624.dm index 4a4b37d4e706..8ae2988ef245 100644 --- a/code/modules/gear_presets/survivors/lv_624/clfship_insert_lv624.dm +++ b/code/modules/gear_presets/survivors/lv_624/clfship_insert_lv624.dm @@ -5,8 +5,7 @@ flags = EQUIPMENT_PRESET_EXTRA skills = /datum/skills/civilian/survivor/clf languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) - faction = FACTION_CLF - faction_group = list(FACTION_CLF, FACTION_SURVIVOR) + job_faction = FACTION_CLF minimap_background = "background_clf" minimap_icon = "clf_mil" access = list(ACCESS_CIVILIAN_PUBLIC) diff --git a/code/modules/gear_presets/survivors/lv_624/corporate_dome_insert_lv624.dm b/code/modules/gear_presets/survivors/lv_624/corporate_dome_insert_lv624.dm index e92b2c40283c..95251f240028 100644 --- a/code/modules/gear_presets/survivors/lv_624/corporate_dome_insert_lv624.dm +++ b/code/modules/gear_presets/survivors/lv_624/corporate_dome_insert_lv624.dm @@ -8,7 +8,6 @@ skills = /datum/skills/civilian/survivor/manager assignment = "LV-624 Corporate Liaison" idtype = /obj/item/card/id/silver/clearance_badge/cl - faction_group = list(FACTION_WY, FACTION_SURVIVOR) access = list( ACCESS_WY_GENERAL, ACCESS_WY_COLONIAL, diff --git a/code/modules/gear_presets/survivors/lv_759/preset_hybrisa.dm b/code/modules/gear_presets/survivors/lv_759/preset_hybrisa.dm index 810ff97de6ff..63af19fcc98b 100644 --- a/code/modules/gear_presets/survivors/lv_759/preset_hybrisa.dm +++ b/code/modules/gear_presets/survivors/lv_759/preset_hybrisa.dm @@ -327,12 +327,11 @@ name = "Survivor - Hybrisa - NSPA Constable" assignment = "NSPA Constable" - faction_group = FACTION_LIST_SURVIVOR_NSPA paygrades = list(PAY_SHORT_CST = JOB_PLAYTIME_TIER_0, PAY_SHORT_SC = JOB_PLAYTIME_TIER_3, PAY_SHORT_SGT = JOB_PLAYTIME_TIER_4) skills = /datum/skills/civilian/survivor/marshal flags = EQUIPMENT_PRESET_START_OF_ROUND idtype = /obj/item/card/id/nspa_silver - faction = FACTION_NSPA + job_faction = FACTION_NSPA access = list(ACCESS_CIVILIAN_PUBLIC,ACCESS_CIVILIAN_RESEARCH,ACCESS_CIVILIAN_ENGINEERING,ACCESS_CIVILIAN_LOGISTICS,ACCESS_CIVILIAN_BRIG,ACCESS_CIVILIAN_MEDBAY,ACCESS_CIVILIAN_COMMAND,) survivor_variant = SECURITY_SURVIVOR @@ -773,7 +772,6 @@ skills = /datum/skills/civilian/survivor flags = EQUIPMENT_PRESET_START_OF_ROUND paygrades = list(PAY_SHORT_WYC2 = JOB_PLAYTIME_TIER_0, PAY_SHORT_WYC3 = JOB_PLAYTIME_TIER_2, PAY_SHORT_WYC4 = JOB_PLAYTIME_TIER_3, PAY_SHORT_WYC5 = JOB_PLAYTIME_TIER_4, PAY_SHORT_WYC6 = JOB_PLAYTIME_TIER_5, PAY_SHORT_WYC7 = JOB_PLAYTIME_TIER_6, PAY_SHORT_WYC8 = JOB_PLAYTIME_TIER_7, PAY_SHORT_WYC9 = JOB_PLAYTIME_TIER_8) - faction_group = FACTION_LIST_SURVIVOR_WY idtype = /obj/item/card/id/silver/clearance_badge/cl access = list(ACCESS_CIVILIAN_PUBLIC,ACCESS_CIVILIAN_COMMAND,ACCESS_WY_GENERAL,ACCESS_WY_COLONIAL,ACCESS_WY_EXEC,) @@ -852,8 +850,7 @@ minimap_icon = "goon_standard" minimap_background = "background_goon" flags = EQUIPMENT_PRESET_START_OF_ROUND - faction = FACTION_WY - faction_group = list(FACTION_WY, FACTION_SURVIVOR) + job_faction = FACTION_WY paygrades = list(PAY_SHORT_CPO = JOB_PLAYTIME_TIER_0, PAY_SHORT_CSPO = JOB_PLAYTIME_TIER_4) skills = /datum/skills/civilian/survivor/goon idtype = /obj/item/card/id/silver/clearance_badge/cl @@ -926,7 +923,6 @@ assignment = "Weyland-Yutani - Commercial Pilot" skills = /datum/skills/civilian/survivor/wy_pilot paygrades = list(PAY_SHORT_WYPO2 = JOB_PLAYTIME_TIER_0) - faction_group = FACTION_LIST_SURVIVOR_WY idtype = /obj/item/card/id/gold flags = EQUIPMENT_PRESET_START_OF_ROUND access = list(ACCESS_CIVILIAN_PUBLIC,ACCESS_CIVILIAN_LOGISTICS,ACCESS_WY_FLIGHT,ACCESS_CIVILIAN_COMMAND,ACCESS_WY_GENERAL,ACCESS_WY_COLONIAL,ACCESS_WY_EXEC) diff --git a/code/modules/gear_presets/survivors/misc.dm b/code/modules/gear_presets/survivors/misc.dm index f80177e3d365..6aaeac1b678a 100644 --- a/code/modules/gear_presets/survivors/misc.dm +++ b/code/modules/gear_presets/survivors/misc.dm @@ -180,8 +180,7 @@ Everything below isn't used or out of place. paygrades = list(PAY_SHORT_CPO = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/silver/cl skills = /datum/skills/civilian/survivor/goon - faction = FACTION_WY - faction_group = list(FACTION_WY, FACTION_SURVIVOR) + job_faction = FACTION_WY languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) access = list(ACCESS_CIVILIAN_PUBLIC, ACCESS_CIVILIAN_COMMAND, ACCESS_CIVILIAN_BRIG, ACCESS_WY_COLONIAL) minimap_icon = "goon_standard" diff --git a/code/modules/gear_presets/survivors/shivas_snowball/panic_room_insert_shivas.dm b/code/modules/gear_presets/survivors/shivas_snowball/panic_room_insert_shivas.dm index a0935de092c5..bdb35e65479c 100644 --- a/code/modules/gear_presets/survivors/shivas_snowball/panic_room_insert_shivas.dm +++ b/code/modules/gear_presets/survivors/shivas_snowball/panic_room_insert_shivas.dm @@ -11,7 +11,6 @@ minimap_icon = "ass_man" rank = JOB_ASSISTANT_MANAGER idtype = /obj/item/card/id/silver/clearance_badge/manager - faction_group = list(FACTION_WY, FACTION_SURVIVOR) access = list( ACCESS_WY_GENERAL, ACCESS_WY_COLONIAL, diff --git a/code/modules/gear_presets/survivors/solaris/crashlanding-offices_insert_bigred.dm b/code/modules/gear_presets/survivors/solaris/crashlanding-offices_insert_bigred.dm index f4f46f9d3d98..1a399d49591d 100644 --- a/code/modules/gear_presets/survivors/solaris/crashlanding-offices_insert_bigred.dm +++ b/code/modules/gear_presets/survivors/solaris/crashlanding-offices_insert_bigred.dm @@ -6,8 +6,7 @@ flags = EQUIPMENT_PRESET_START_OF_ROUND assignment = JOB_PMC_STANDARD rank = JOB_PMC_STANDARD - faction = FACTION_PMC - faction_group = list(FACTION_WY, FACTION_SURVIVOR, FACTION_PMC) + job_faction = FACTION_PMC paygrades = list(PAY_SHORT_PMC_OP = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/pmc skills = /datum/skills/civilian/survivor/pmc @@ -123,8 +122,7 @@ minimap_icon = "exec_super" role_comm_title = "Supervisor" idtype = /obj/item/card/id/silver/clearance_badge/manager - faction = FACTION_WY - faction_group = list(FACTION_WY, FACTION_SURVIVOR, FACTION_PMC) + job_faction = FACTION_WY access = list( ACCESS_WY_GENERAL, ACCESS_WY_COLONIAL, @@ -167,8 +165,7 @@ // only used on the spawner of all of those above... /datum/equipment_preset/synth/survivor/pmc name = "Survivor - Synthetic - PMC Support Synth" - faction = FACTION_PMC - faction_group = list(FACTION_WY, FACTION_SURVIVOR, FACTION_PMC) + job_faction = FACTION_PMC access = list( ACCESS_WY_GENERAL, ACCESS_WY_COLONIAL, diff --git a/code/modules/gear_presets/survivors/survivors.dm b/code/modules/gear_presets/survivors/survivors.dm index 13d01a656bc2..66f8e681a9a6 100644 --- a/code/modules/gear_presets/survivors/survivors.dm +++ b/code/modules/gear_presets/survivors/survivors.dm @@ -7,8 +7,7 @@ languages = list(LANGUAGE_ENGLISH) paygrades = list(PAY_SHORT_CIV = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/lanyard - faction = FACTION_SURVIVOR - faction_group = list(FACTION_SURVIVOR) + job_faction = FACTION_SURVIVOR origin_override = ORIGIN_CIVILIAN access = list(ACCESS_CIVILIAN_PUBLIC) @@ -195,8 +194,7 @@ Standart Survivors : /datum/equipment_preset/survivor/scientist, flags = EQUIPMENT_PRESET_START_OF_ROUND idtype = /obj/item/card/id/deputy rank = JOB_CMB - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE, FACTION_SURVIVOR) + job_faction = FACTION_MARSHAL role_comm_title = "CMB DEP" access = list( ACCESS_CIVILIAN_PUBLIC, @@ -298,10 +296,8 @@ Everything bellow is a parent used as a base for one or multiple maps. skills = /datum/skills/civilian/survivor flags = EQUIPMENT_PRESET_START_OF_ROUND paygrades = list(PAY_SHORT_WYC2 = JOB_PLAYTIME_TIER_0, PAY_SHORT_WYC3 = JOB_PLAYTIME_TIER_2, PAY_SHORT_WYC4 = JOB_PLAYTIME_TIER_3, PAY_SHORT_WYC5 = JOB_PLAYTIME_TIER_4) - faction_group = FACTION_LIST_SURVIVOR_WY rank = JOB_EXECUTIVE - faction = FACTION_WY - faction_group = list(FACTION_WY, FACTION_SURVIVOR) + job_faction = FACTION_WY idtype = /obj/item/card/id/silver/clearance_badge/cl access = list( ACCESS_CIVILIAN_PUBLIC, @@ -432,7 +428,6 @@ Everything bellow is a parent used as a base for one or multiple maps. skills = /datum/skills/civilian/survivor flags = EQUIPMENT_PRESET_START_OF_ROUND paygrades = list(PAY_SHORT_ICCL = JOB_PLAYTIME_TIER_0) - faction_group = FACTION_LIST_SURVIVOR_WY idtype = /obj/item/card/id/silver/cl role_comm_title = "ICC Rep." minimap_icon = "icc" diff --git a/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm b/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm index 5becb407fb0b..8bf4cc8600b9 100644 --- a/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm +++ b/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm @@ -7,8 +7,7 @@ rank = JOB_SURVIVOR skills = /datum/skills/military/survivor/upp_private languages = list(LANGUAGE_RUSSIAN, LANGUAGE_GERMAN, LANGUAGE_CHINESE) - faction = FACTION_UPP - faction_group = list(FACTION_UPP, FACTION_SURVIVOR) + job_faction = FACTION_UPP minimap_icon = "upp_pvt" minimap_background = "background_upp" role_comm_title = "173/RECON" @@ -182,8 +181,7 @@ languages = ALL_SYNTH_LANGUAGES_UPP assignment = JOB_UPP_SUPPORT_SYNTH rank = JOB_UPP_SUPPORT_SYNTH - faction = FACTION_UPP - faction_group = list(FACTION_UPP, FACTION_SURVIVOR) + job_faction = FACTION_UPP skills = /datum/skills/colonial_synthetic paygrades = list(PAY_SHORT_SYN = JOB_PLAYTIME_TIER_0) idtype = /obj/item/card/id/dogtag/upp diff --git a/code/modules/gear_presets/synth_k9.dm b/code/modules/gear_presets/synth_k9.dm index 2059990655db..5e3d4f163ecc 100644 --- a/code/modules/gear_presets/synth_k9.dm +++ b/code/modules/gear_presets/synth_k9.dm @@ -5,7 +5,7 @@ skills = /datum/skills/synth_k9 minimap_icon = "synth_k9" flags = EQUIPMENT_PRESET_START_OF_ROUND|EQUIPMENT_PRESET_MARINE - faction = FACTION_MARINE + job_faction = FACTION_MARINE idtype = /obj/item/card/id/gold assignment = JOB_SYNTH_K9 rank = "Synthetic K9" diff --git a/code/modules/gear_presets/synths.dm b/code/modules/gear_presets/synths.dm index a69aa0e250a3..9f1e39f4fa46 100644 --- a/code/modules/gear_presets/synths.dm +++ b/code/modules/gear_presets/synths.dm @@ -53,7 +53,7 @@ /datum/equipment_preset/synth/uscm name = "USCM Synthetic" flags = EQUIPMENT_PRESET_START_OF_ROUND|EQUIPMENT_PRESET_MARINE - faction = FACTION_MARINE + job_faction = FACTION_MARINE idtype = /obj/item/card/id/gold assignment = JOB_SYNTH rank = "Synthetic" @@ -79,7 +79,6 @@ /datum/equipment_preset/synth/uscm/councillor name = "USCM Synthetic Councillor" flags = EQUIPMENT_PRESET_START_OF_ROUND|EQUIPMENT_PRESET_MARINE - faction = FACTION_MARINE idtype = /obj/item/card/id/gold assignment = JOB_SYNTH rank = "Synthetic" @@ -124,8 +123,7 @@ /datum/equipment_preset/synth/survivor name = "Survivor - Synthetic - Classic Joe" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_SURVIVOR - faction_group = list(FACTION_SURVIVOR) + job_faction = FACTION_SURVIVOR idtype = /obj/item/card/id/lanyard assignment = JOB_SYNTH rank = JOB_SYNTH_SURVIVOR @@ -459,8 +457,7 @@ assignment = JOB_CMB_SYN rank = JOB_CMB_SYN paygrades = list(PAY_SHORT_CMBS = JOB_PLAYTIME_TIER_0) - faction = FACTION_MARSHAL - faction_group = list(FACTION_MARSHAL, FACTION_MARINE, FACTION_SURVIVOR) + job_faction = FACTION_MARSHAL minimap_background = "background_cmb" equipment_to_spawn = list( WEAR_HEAD = /obj/item/clothing/head/CMB, @@ -600,8 +597,7 @@ /datum/equipment_preset/synth/working_joe name = "Synthetic - Working Joe" flags = EQUIPMENT_PRESET_START_OF_ROUND|EQUIPMENT_PRESET_MARINE - faction = FACTION_MARINE - faction_group = list(FACTION_MARINE) + job_faction = FACTION_MARINE assignment = JOB_WORKING_JOE rank = JOB_WORKING_JOE @@ -699,8 +695,7 @@ joe_type = SYNTH_UPP_JOE idtype = /obj/item/card/id/dogtag minimap_background = "background_upp" - faction_group = list(FACTION_UPP) - faction = FACTION_UPP + job_faction = FACTION_UPP languages = list(LANGUAGE_RUSSIAN, LANGUAGE_GERMAN, LANGUAGE_SPANISH, LANGUAGE_CHINESE, LANGUAGE_ENGLISH) /datum/equipment_preset/synth/working_joe/upp/load_gear(mob/living/carbon/human/new_human) @@ -755,7 +750,7 @@ /datum/equipment_preset/synth/survivor/cultist_synth name = "Cultist - Xeno Cultist Synthetic" - faction = FACTION_XENOMORPH + job_faction = FACTION_XENOMORPH minimap_icon = "cult_synth" minimap_background = "background_cultist" @@ -785,7 +780,7 @@ /datum/equipment_preset/synth/survivor/midwife name = "Fun - Xeno Cultist Midwife (Synthetic)" - faction = FACTION_XENOMORPH + job_faction = FACTION_XENOMORPH /datum/equipment_preset/synth/survivor/midwife/load_gear(mob/living/carbon/human/new_human) var/back_item = /obj/item/storage/backpack/marine/satchel/medic @@ -823,7 +818,7 @@ /datum/equipment_preset/synth/infiltrator name = "Infiltrator Synthetic" flags = EQUIPMENT_PRESET_EXTRA - faction = FACTION_NEUTRAL + job_faction = FACTION_NEUTRAL assignment = JOB_COLONIST rank = JOB_COLONIST skills = /datum/skills/infiltrator_synthetic diff --git a/code/modules/gear_presets/upp.dm b/code/modules/gear_presets/upp.dm index b56d187fb2f6..4d985ed235a9 100644 --- a/code/modules/gear_presets/upp.dm +++ b/code/modules/gear_presets/upp.dm @@ -22,7 +22,7 @@ /datum/equipment_preset/upp name = FACTION_UPP languages = list(LANGUAGE_RUSSIAN, LANGUAGE_ENGLISH, LANGUAGE_CHINESE) - faction = FACTION_UPP + job_faction = FACTION_UPP idtype = /obj/item/card/id/dogtag/upp minimap_background = "background_upp" origin_override = ORIGIN_UPP @@ -3976,7 +3976,6 @@ /datum/equipment_preset/upp/soldier/hunted name = "UPP Soldier (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/upp/soldier/hunted/load_gear(mob/living/carbon/human/new_human) //head @@ -4010,7 +4009,6 @@ /datum/equipment_preset/upp/machinegunner/hunted name = "UPP Machinegunner (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/upp/machinegunner/hunted/load_gear(mob/living/carbon/human/new_human) //back @@ -4042,7 +4040,6 @@ /datum/equipment_preset/upp/leader/hunted name = "UPP Squad Leader (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/upp/leader/hunted/load_gear(mob/living/carbon/human/new_human) var/UPPleadsidearm = rand(1,4) @@ -4087,7 +4084,6 @@ /datum/equipment_preset/upp/sapper/hunted name = "UPP Sapper (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/upp/sapper/load_gear(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index c8a9e333570f..9dd31fd259a6 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -1,7 +1,6 @@ /datum/equipment_preset/uscm name = "USCM" - faction = FACTION_MARINE - faction_group = FACTION_LIST_MARINE + job_faction = FACTION_MARINE languages = list(LANGUAGE_ENGLISH) idtype = /obj/item/card/id/dogtag @@ -1272,7 +1271,6 @@ /datum/equipment_preset/uscm/rifleman_pve/hunted name = "USCM Rifleman (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/uscm/rifleman_pve/hunted/load_status(mob/living/carbon/human/new_human) new_human.nutrition = NUTRITION_MAX @@ -1310,7 +1308,6 @@ /datum/equipment_preset/uscm/tl_pve/hunted name = "USCM Team Leader (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/uscm/tl_pve/hunted/load_status(mob/living/carbon/human/new_human) @@ -1345,7 +1342,6 @@ /datum/equipment_preset/uscm/sg_pve/hunted name = "USCM Smartgunner (Hunted)" - faction = FACTION_HUNTED /datum/equipment_preset/uscm/sg_pve/hunted/load_gear(mob/living/carbon/human/new_human) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/marine(new_human), WEAR_BODY) diff --git a/code/modules/gear_presets/uscm_event.dm b/code/modules/gear_presets/uscm_event.dm index 87aa7ea9967f..792a5a393ede 100644 --- a/code/modules/gear_presets/uscm_event.dm +++ b/code/modules/gear_presets/uscm_event.dm @@ -1,7 +1,6 @@ /datum/equipment_preset/uscm_event name = "USCM (Event Roles)" - faction = FACTION_MARINE - faction_group = FACTION_LIST_MARINE + job_faction = FACTION_MARINE minimum_age = 30 languages = list(LANGUAGE_ENGLISH) diff --git a/code/modules/gear_presets/uscm_forecon.dm b/code/modules/gear_presets/uscm_forecon.dm index ff0c3aa6b58d..572e9c8dd4de 100644 --- a/code/modules/gear_presets/uscm_forecon.dm +++ b/code/modules/gear_presets/uscm_forecon.dm @@ -5,7 +5,6 @@ idtype = /obj/item/card/id/dogtag role_comm_title = "FORECON" rank = JOB_MARINE - faction_group = list(FACTION_MARINE) flags = EQUIPMENT_PRESET_START_OF_ROUND auto_squad_name = SQUAD_FORECON ert_squad = TRUE diff --git a/code/modules/gear_presets/uscm_police.dm b/code/modules/gear_presets/uscm_police.dm index 8322b4e808c0..af7906e3e640 100644 --- a/code/modules/gear_presets/uscm_police.dm +++ b/code/modules/gear_presets/uscm_police.dm @@ -1,6 +1,6 @@ /datum/equipment_preset/uscm_ship/uscm_police name = "USCM (police roles)" - faction = FACTION_MARINE + job_faction = FACTION_MARINE minimap_background = "background_mp" minimum_age = 27 diff --git a/code/modules/gear_presets/uscm_ship.dm b/code/modules/gear_presets/uscm_ship.dm index c4bbef01c11a..72536152c48b 100644 --- a/code/modules/gear_presets/uscm_ship.dm +++ b/code/modules/gear_presets/uscm_ship.dm @@ -1,7 +1,6 @@ /datum/equipment_preset/uscm_ship name = "USCM (ship roles)" - faction = FACTION_MARINE - faction_group = FACTION_LIST_MARINE + job_faction = FACTION_MARINE minimum_age = 20 languages = list(LANGUAGE_ENGLISH) @@ -26,8 +25,7 @@ /datum/equipment_preset/uscm_ship/liaison name = "USCM Corporate Liaison (CL)" - faction = FACTION_WY - faction_group = FACTION_LIST_MARINE_WY + job_faction = FACTION_WY flags = EQUIPMENT_PRESET_START_OF_ROUND idtype = /obj/item/card/id/silver/cl diff --git a/code/modules/gear_presets/whiteout.dm b/code/modules/gear_presets/whiteout.dm index 3382f145f04e..a4466aa2d4ec 100644 --- a/code/modules/gear_presets/whiteout.dm +++ b/code/modules/gear_presets/whiteout.dm @@ -2,7 +2,7 @@ name = "Whiteout Team Operative (!DEATHSQUAD!)" flags = EQUIPMENT_PRESET_EXTRA uses_special_name = TRUE //We always use a codename! - faction = FACTION_WY_DEATHSQUAD + job_faction = FACTION_WY_DEATHSQUAD assignment = "Whiteout Team Operative" role_comm_title = "WO" rank = FACTION_WY_DEATHSQUAD diff --git a/code/modules/gear_presets/wo.dm b/code/modules/gear_presets/wo.dm index f3bb5d81ebf2..d16779c23f36 100644 --- a/code/modules/gear_presets/wo.dm +++ b/code/modules/gear_presets/wo.dm @@ -1,7 +1,6 @@ /datum/equipment_preset/wo name = "WO" - faction = FACTION_MARINE - faction_group = FACTION_LIST_MARINE + job_faction = FACTION_MARINE languages = list(LANGUAGE_ENGLISH) idtype = /obj/item/card/id/dogtag diff --git a/code/modules/gear_presets/wy.dm b/code/modules/gear_presets/wy.dm index f95345c23b79..6688b065773c 100644 --- a/code/modules/gear_presets/wy.dm +++ b/code/modules/gear_presets/wy.dm @@ -2,10 +2,9 @@ name = "WY" paygrades = list(PAY_SHORT_WYC1 = JOB_PLAYTIME_TIER_0) - faction = FACTION_WY + job_faction = FACTION_WY rank = FACTION_WY idtype = /obj/item/card/id/silver - faction_group = FACTION_LIST_WY skills = /datum/skills/civilian languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) var/headset_type = /obj/item/device/radio/headset/distress/WY diff --git a/code/modules/gear_presets/wy_goons.dm b/code/modules/gear_presets/wy_goons.dm index 028de19d0b51..9b11f46b7225 100644 --- a/code/modules/gear_presets/wy_goons.dm +++ b/code/modules/gear_presets/wy_goons.dm @@ -1,9 +1,8 @@ /datum/equipment_preset/goon name = "WY Goons" - faction = FACTION_WY + job_faction = FACTION_WY rank = FACTION_WY idtype = /obj/item/card/id/silver/cl - faction_group = list(FACTION_WY) languages = list(LANGUAGE_ENGLISH, LANGUAGE_JAPANESE) minimap_background = "background_goon" diff --git a/code/modules/gear_presets/yautja.dm b/code/modules/gear_presets/yautja.dm index b130fc3dfe35..4aa49f6673a7 100644 --- a/code/modules/gear_presets/yautja.dm +++ b/code/modules/gear_presets/yautja.dm @@ -3,8 +3,7 @@ idtype = null //No IDs for Yautja! languages = list(LANGUAGE_YAUTJA) rank = "Predator" - faction = FACTION_YAUTJA - faction_group = FACTION_LIST_YAUTJA + job_faction = FACTION_YAUTJA uses_special_name = TRUE skills = /datum/skills/yautja/warrior @@ -25,8 +24,7 @@ /datum/equipment_preset/yautja/load_id(mob/living/carbon/human/new_human) new_human.job = rank - new_human.faction = faction - new_human.faction_group = faction_group + GLOB.faction_datums[job_faction].add_mob(new_human) /datum/equipment_preset/yautja/load_vanity(mob/living/carbon/human/new_human) return //No vanity items for Yautja! diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index 388ef7cc3db2..e6b9ce2a639c 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -61,7 +61,7 @@ ? "Structural collapse detected in [announcement_areas]. Be advised that new routes may be accessible." \ : "Geological shifts detected in [announcement_areas]. Be advised that new routes may be accessible." - marine_announcement(marine_announcement_text, "Priority Announcement") + faction_announcement(marine_announcement_text, "Priority Announcement") var/xeno_announcement_text = SSmapping.configs[GROUND_MAP].environment_traits[ZTRAIT_IN_SPACE] \ ? "The shattered metal of this place has collapsed, providing new routes in [announcement_areas]." \ @@ -91,7 +91,7 @@ ? "Structural collapse detected in [announcement_areas], allowing dismantlement. Be advised that new routes may be created." \ : "Geological shifts detected in [announcement_areas], allowing excavation. Be advised that new routes may be created." - marine_announcement(marine_announcement_text, "Priority Announcement") + faction_announcement(marine_announcement_text, "Priority Announcement") var/xeno_announcement_text = SSmapping.configs[GROUND_MAP].environment_traits[ZTRAIT_IN_SPACE] \ ? "The shattered metal of this place has collapsed, and we can create routes through [announcement_areas]." \ diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7235e03c26cb..4dbc924964e0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -399,7 +399,7 @@ if(href_list["item"]) if(!usr.is_mob_incapacitated() && Adjacent(usr)) if(href_list["item"] == "id") - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !ally_faction(usr.faction)) to_chat(usr, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(istype(wear_id, /obj/item/card/id/dogtag) && (undefibbable || !skillcheck(usr, SKILL_POLICE, SKILL_POLICE_SKILLED))) @@ -424,7 +424,7 @@ if(!usr.action_busy || skillcheck(usr, SKILL_POLICE, SKILL_POLICE_SKILLED)) var/slot = href_list["item"] var/obj/item/what = get_item_by_slot(slot) - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !ally_faction(usr.faction)) if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_strip_essentials) || (what in list(head, wear_suit, w_uniform, shoes))) to_chat(usr, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return @@ -436,7 +436,7 @@ if(href_list["sensor"]) if(!usr.action_busy && !usr.is_mob_incapacitated() && Adjacent(usr)) - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !ally_faction(usr.faction)) to_chat(usr, SPAN_WARNING("You can't tweak the sensors of a crit or dead member of another faction!")) return attack_log += text("\[[time_stamp()]\] Has had their sensors toggled by [key_name(usr)]") diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index 7d9c28c0d083..70c9752b952b 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -272,11 +272,11 @@ CULT if(!(copytext(message, -1) in ENDING_PUNCT)) message += "." - var/datum/hive_status/hive = GLOB.hive_datum[H.hivenumber] - if(!istype(hive)) + var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + if(!istype(faction_module)) return - H.hivemind_broadcast(message, hive) + H.hivemind_broadcast(message, faction_module) /datum/action/human_action/activable/cult/obtain_equipment name = "Obtain Equipment" diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 22fa985e06fa..e70c706e31ee 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -353,41 +353,6 @@ Contains most of the procs that are called when a mob is attacked by something if (!isyautja(src) && ((sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))) affecting.embed(I) -/mob/living/carbon/human/proc/get_id_faction_group() - var/obj/item/card/id/C = wear_id - if(!istype(C)) - C = get_active_hand() - if(!istype(C)) - return null - - return C.faction_group - -/mob/living/proc/get_target_lock(access_to_check) - if(isnull(access_to_check)) - return - - var/compare_group = faction_group - - if(!islist(access_to_check)) - return access_to_check in compare_group - - var/list/overlap = compare_group & access_to_check - return length(overlap) - -/mob/living/carbon/human/get_target_lock(access_to_check) - if(isnull(access_to_check)) - return - - var/id_group = get_id_faction_group() - if(!id_group) - return ..() - - if(!islist(access_to_check)) - return access_to_check in id_group - - var/list/overlap = id_group & access_to_check - return length(overlap) - /mob/living/carbon/human/handle_flamer_fire_crossed(obj/flamer_fire/fire) . = ..() switch(fire.fire_variant) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index c29b42be56ae..1f75a48893f9 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -421,7 +421,7 @@ if(ishuman(mob)) var/mob/living/carbon/human/human = mob ignores_stripdrag_flag = human.species.ignores_stripdrag_flag - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && !ignores_stripdrag_flag && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(mob.faction_group) && !(mob.status_flags & PERMANENTLY_DEAD)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && !ignores_stripdrag_flag && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !ally_faction(mob.faction) && !(mob.status_flags & PERMANENTLY_DEAD)) to_chat(mob, SPAN_WARNING("You can't pull a crit or dead member of another faction!")) return FALSE return TRUE diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm index 707df925564e..37bc9fff50c0 100644 --- a/code/modules/mob/living/carbon/human/human_stripping.dm +++ b/code/modules/mob/living/carbon/human/human_stripping.dm @@ -58,7 +58,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcehuman = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.ally_faction(user.faction)) to_chat(user, SPAN_WARNING("You can't toggle internals of a crit or dead member of another faction!")) return @@ -122,7 +122,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcemob = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.ally_faction(user.faction)) to_chat(user, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(!sourcemob.w_uniform || !istype(sourcemob.w_uniform, /obj/item/clothing)) @@ -179,7 +179,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcemob = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.ally_faction(user.faction)) to_chat(user, SPAN_WARNING("You can't remove splints of a crit or dead member of another faction!")) return sourcemob.attack_log += text("\[[time_stamp()]\] Has had their splints removed by [key_name(user)]") @@ -219,7 +219,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcemob = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.ally_faction(user.faction)) to_chat(user, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(!istype(sourcemob.wear_id, /obj/item/card/id/dogtag)) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index ccfef44aa431..c4344adea89b 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -61,8 +61,6 @@ var/obj/item/r_store = null var/obj/item/l_store = null - var/obj/item/iff_tag/iff_tag = null - var/static/list/walking_state_cache = list() var/has_walking_icon_state = FALSE @@ -135,9 +133,6 @@ /// The xeno's strain, if they've taken one. var/datum/xeno_strain/strain = null - // Hive-related vars - var/datum/hive_status/hive - hivenumber = XENO_HIVE_NORMAL var/hive_pos = NORMAL_XENO // The position of the xeno in the hive (0 = normal xeno; 1 = queen; 2+ = hive leader) // Variables that can be mutated @@ -819,9 +814,6 @@ /mob/living/carbon/xenomorph/get_pull_miltiplier() return pull_multiplier -/mob/living/carbon/xenomorph/proc/set_faction(new_faction = FACTION_XENOMORPH) - faction = new_faction - //Call this function to set the hive and do other cleanup /mob/living/carbon/xenomorph/proc/set_hive_and_update(new_hivenumber = XENO_HIVE_NORMAL) var/datum/hive_status/new_hive = GLOB.hive_datum[new_hivenumber] diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm b/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm index d658d2e83195..eefd66f8bf03 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm @@ -94,7 +94,7 @@ if(!loc) return FALSE - yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nAn abomination has been detected at [get_area_name(loc)]. It is a stain upon our purity and is unfit for life. Exterminate it immediately.\n\nHeavy Armory unlocked.")) + faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nAn abomination has been detected at [get_area_name(loc)]. It is a stain upon our purity and is unfit for life. Exterminate it immediately.\n\nHeavy Armory unlocked."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_YAUTJA_ARMORY_OPENED) to_chat(src, {" diff --git a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm index 9d4de90072aa..d34822668965 100644 --- a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm @@ -1,21 +1,6 @@ /mob/living/carbon/xenomorph/attackby(obj/item/item, mob/user) if(user.a_intent != INTENT_HELP) return ..() - if(HAS_TRAIT(item, TRAIT_TOOL_MULTITOOL) && ishuman(user)) - var/mob/living/carbon/human/programmer = user - if(!iff_tag) - to_chat(user, SPAN_WARNING("\The [src] doesn't have an IFF tag to reprogram.")) - return - programmer.visible_message(SPAN_NOTICE("[programmer] starts reprogramming \the [src]'s IFF tag..."), SPAN_NOTICE("You start reprogramming \the [src]'s IFF tag..."), max_distance = 3) - if(!do_after(programmer, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC, src, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) - return - if(!iff_tag) - to_chat(programmer, SPAN_WARNING("\The [src]'s tag got removed while you were reprogramming it!")) - return - if(!iff_tag.handle_reprogramming(programmer, src)) - return - programmer.visible_message(SPAN_NOTICE("[programmer] reprograms \the [src]'s IFF tag."), SPAN_NOTICE("You reprogram \the [src]'s IFF tag."), max_distance = 3) - return if(stat == DEAD) if(!istype(item, /obj/item/reagent_container/syringe)) var/datum/surgery/current_surgery = active_surgeries[user.zone_selected] @@ -26,22 +11,6 @@ if(initiate_surgery_moment(item, src, "head" , user)) return return - if(item.type in SURGERY_TOOLS_PINCH) - if(!iff_tag) - to_chat(user, SPAN_WARNING("\The [src] doesn't have an IFF tag to remove.")) - return - user.visible_message(SPAN_NOTICE("[user] starts removing \the [src]'s IFF tag..."), SPAN_NOTICE("You start removing \the [src]'s IFF tag..."), max_distance = 3) - if(!do_after(user, 5 SECONDS * SURGERY_TOOLS_PINCH[item.type], INTERRUPT_ALL, BUSY_ICON_GENERIC, src, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) - return - if(!iff_tag) - to_chat(user, SPAN_WARNING("\The [src]'s tag got removed while you were removing it!")) - return - user.put_in_hands(iff_tag) - iff_tag = null - user.visible_message(SPAN_NOTICE("[user] removes \the [src]'s IFF tag."), SPAN_NOTICE("You remove \the [src]'s IFF tag."), max_distance = 3) - if(hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade - to_chat(src, SPAN_NOTICE("With the removal of the device, your instincts have returned to normal.")) - return return ..() /mob/living/carbon/xenomorph/ex_act(severity, direction, datum/cause_data/cause_data, pierce=0) @@ -292,19 +261,6 @@ playsound(victim, "acid_sizzle", 25, TRUE) animation_flash_color(victim, "#FF0000") //pain hit flicker -/mob/living/carbon/xenomorph/get_target_lock(access_to_check) - if(isnull(access_to_check)) - return - - if(!iff_tag) - return ..() - - if(!islist(access_to_check)) - return access_to_check in iff_tag.faction_groups - - var/list/overlap = iff_tag.faction_groups & access_to_check - return length(overlap) - /mob/living/carbon/xenomorph/handle_flamer_fire(obj/flamer_fire/fire, damage, delta_time) . = ..() switch(fire.fire_variant) diff --git a/code/modules/mob/living/carbon/xenomorph/death.dm b/code/modules/mob/living/carbon/xenomorph/death.dm index 30025d5a1b4a..925b62be6e99 100644 --- a/code/modules/mob/living/carbon/xenomorph/death.dm +++ b/code/modules/mob/living/carbon/xenomorph/death.dm @@ -126,7 +126,7 @@ var/name = "[MAIN_AI_SYSTEM] Bioscan Status" var/input = "Bioscan complete.\n\nSensors indicate one remaining unknown lifeform signature in [get_area(X)]." log_ares_bioscan(name, input) - marine_announcement(input, name, 'sound/AI/bioscan.ogg', logging = ARES_LOG_NONE) + faction_announcement(input, name, 'sound/AI/bioscan.ogg', logging = ARES_LOG_NONE) // Tell the xeno she is the last one. if(X.client) to_chat(X, SPAN_XENOANNOUNCE("Your carapace rattles with dread. You are all that remains of the hive!")) diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index f254f3d6ca39..2217e24cddaa 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -1013,7 +1013,7 @@ var/list/defectors = list() var/list/datum/weakref/personal_allies = list() - +/* /datum/hive_status/corrupted/add_xeno(mob/living/carbon/xenomorph/xeno) . = ..() xeno.add_language(LANGUAGE_ENGLISH) @@ -1156,6 +1156,7 @@ hive_inherant_traits = list(TRAIT_XENONID, TRAIT_NO_COLOR) latejoin_burrowed = FALSE +*/ /datum/hive_status/corrupted/tamed name = "Tamed Hive" @@ -1243,7 +1244,7 @@ to_chat(user, SPAN_WARNING("The [name] cannot support facehuggers.")) return FALSE -/datum/hive_status/corrupted/renegade/proc/iff_protection_check(mob/living/carbon/xenomorph/xeno, mob/living/carbon/attempt_harm_mob) +/datum/hive_status/corrupted/renegade/proc/iff_protection_check(mob/living/carbon/xenomorph/xeno, mob/living/carbon/attempt_harm_mob)/* if(xeno == attempt_harm_mob) return TRUE //you cannot hurt yourself... if(!xeno.iff_tag) @@ -1260,7 +1261,7 @@ if(faction in attempt_harm_mob.faction_group) return TRUE //cannot attack mob if iff is set to at least one of its factions return FALSE - +*/ /datum/hive_status/corrupted/renegade/faction_is_ally(faction, ignore_queen_check = TRUE) return ..() @@ -1311,7 +1312,7 @@ return if(!(faction in FACTION_LIST_HUMANOID)) return - +/* for(var/mob/living/carbon/xenomorph/xeno in totalXenos) // handle defecting xenos on betrayal if(!xeno.iff_tag) continue @@ -1323,8 +1324,8 @@ continue INVOKE_ASYNC(src, PROC_REF(give_defection_choice), xeno, faction) addtimer(CALLBACK(src, PROC_REF(handle_defectors), faction), 11 SECONDS) - -/datum/hive_status/corrupted/proc/give_defection_choice(mob/living/carbon/xenomorph/xeno, faction) +*/ +/datum/hive_status/corrupted/proc/give_defection_choice(mob/living/carbon/xenomorph/xeno, faction)/* if(tgui_alert(xeno, "Our Queen has broken the alliance with the [faction]. The device inside our carapace begins to suppress our connection with the Hive. Do we remove it and stay loyal to her?", "Alliance broken!", list("Stay loyal", "Obey the talls"), 10 SECONDS) == "Obey the talls") if(!xeno.iff_tag) to_chat(xeno, SPAN_XENOWARNING("It's too late now. The device is gone and our service to the Queen continues.")) @@ -1338,8 +1339,8 @@ xeno.adjustBruteLoss(50) xeno.iff_tag.forceMove(get_turf(xeno)) xeno.iff_tag = null - -/datum/hive_status/corrupted/proc/handle_defectors(faction) +*/ +/datum/hive_status/corrupted/proc/handle_defectors(faction)/* for(var/mob/living/carbon/xenomorph/xeno in totalXenos) if(!xeno.iff_tag) continue @@ -1356,7 +1357,7 @@ xeno_message(SPAN_XENOANNOUNCE("We sense that [english_list(defectors)] turned their backs against their sisters and the Queen in favor of their slavemasters!"), 3, hivenumber) defectors.Cut() - +*/ /datum/hive_status/corrupted/proc/add_personal_ally(mob/living/ally) personal_allies += WEAKREF(ally) ally.status_flags |= CORRUPTED_ALLY diff --git a/code/modules/mob/living/carbon/xenomorph/items/iff_tag.dm b/code/modules/mob/living/carbon/xenomorph/items/iff_tag.dm deleted file mode 100644 index a23fc9dc52f6..000000000000 --- a/code/modules/mob/living/carbon/xenomorph/items/iff_tag.dm +++ /dev/null @@ -1,77 +0,0 @@ -/obj/item/iff_tag - name = "xenomorph IFF tag" - desc = "A tag containing a small IFF computer that gets inserted into the carapace of a xenomorph. You can modify the IFF groups by using an access tuner on it, or on the xeno if it's already implanted." - icon = 'icons/obj/items/Marine_Research.dmi' - icon_state = "xeno_tag" - var/list/faction_groups = list() - -/obj/item/iff_tag/attack(mob/living/carbon/xenomorph/xeno, mob/living/carbon/human/injector) - if(isxeno(xeno)) - if(xeno.stat == DEAD) - to_chat(injector, SPAN_WARNING("\The [xeno] is dead...")) - return - if(xeno.iff_tag) - to_chat(injector, SPAN_WARNING("\The [xeno] already has a tag inside it.")) - return - injector.visible_message(SPAN_NOTICE("[injector] starts forcing \the [src] into [xeno]'s carapace..."), SPAN_NOTICE("You start forcing \the [src] into [xeno]'s carapace...")) - if(!do_after(injector, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC, xeno, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) - return - injector.visible_message(SPAN_NOTICE("[injector] forces \the [src] into [xeno]'s carapace!"), SPAN_NOTICE("You force \the [src] into [xeno]'s carapace!")) - xeno.iff_tag = src - injector.drop_inv_item_to_loc(src, xeno) - if(xeno.hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade - to_chat(xeno, SPAN_NOTICE("With the insertion of the device into your carapace, your instincts have changed compelling you to protect [english_list(faction_groups, "no one")].")) - return - return ..() - -/obj/item/iff_tag/attackby(obj/item/W, mob/user) - if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL) && ishuman(user)) - handle_reprogramming(user) - return - return ..() - -/obj/item/iff_tag/proc/handle_reprogramming(mob/living/carbon/human/programmer, mob/living/carbon/xenomorph/xeno) - var/list/id_faction_groups = programmer.get_id_faction_group() - var/option = tgui_alert(programmer, "The xeno tag's current IFF groups reads as: [english_list(faction_groups, "None")]\nYour ID's IFF group reads as: [english_list(id_faction_groups, "None")]", "Xenomorph IFF Tag", list("Overwrite", "Add", "Remove")) - if(!option) - return FALSE - if(xeno) - if(!xeno.iff_tag) - to_chat(programmer, SPAN_WARNING("\The [src]'s tag got removed while you were reprogramming it!")) - return FALSE - if(!programmer.Adjacent(xeno)) - to_chat(programmer, SPAN_WARNING("You need to stay close to the xenomorph to reprogram the tag!")) - return FALSE - switch(option) - if("Overwrite") - faction_groups = id_faction_groups - if("Add") - faction_groups |= id_faction_groups - if("Remove") - faction_groups = list() - to_chat(programmer, SPAN_NOTICE("You [option] the IFF group data, the IFF group on the tag now reads as: [english_list(faction_groups, "None")]")) - if(xeno?.hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade - to_chat(xeno, SPAN_NOTICE("Your instincts have changed, you seem compelled to protect [english_list(faction_groups, "no one")].")) - return TRUE - -/obj/item/iff_tag/pmc_handler - faction_groups = FACTION_LIST_MARINE_WY - - -/obj/item/storage/xeno_tag_case - name = "xenomorph tag case" - desc = "A sturdy case designed to store and charge xenomorph IFF tags. Provided by the Wey-Yu Research and Data(TM) Division." - icon = 'icons/obj/items/Marine_Research.dmi' - icon_state = "tag_box" - use_sound = "toolbox" - storage_slots = 8 - can_hold = list( - /obj/item/iff_tag, - /obj/item/device/multitool, - ) - black_market_value = 25 - -/obj/item/storage/xeno_tag_case/full/fill_preset_inventory() - for(var/i = 1 to storage_slots - 1) - new /obj/item/iff_tag(src) - new /obj/item/device/multitool(src) diff --git a/code/modules/mob/living/carbon/xenomorph/say.dm b/code/modules/mob/living/carbon/xenomorph/say.dm index 650351c14fd2..d44e531fa63f 100644 --- a/code/modules/mob/living/carbon/xenomorph/say.dm +++ b/code/modules/mob/living/carbon/xenomorph/say.dm @@ -99,11 +99,11 @@ hivemind_broadcast(message, hive) -/mob/living/carbon/proc/hivemind_broadcast(message, datum/hive_status/hive) - if(!message || stat || !hive) +/mob/living/carbon/proc/hivemind_broadcast(message, datum/faction_module/hive_mind/faction_module) + if(!message || stat) return - if(!hive.living_xeno_queen && !SSticker?.mode?.hardcore && !hive.allow_no_queen_actions && ROUND_TIME > SSticker.mode.round_time_evolution_ovipositor) + if(!faction_module.living_xeno_queen && !SSticker?.mode?.hardcore && !faction_module.allow_no_queen_actions && ROUND_TIME > SSticker.mode.round_time_evolution_ovipositor) to_chat(src, SPAN_WARNING("There is no Queen. You are alone.")) return @@ -112,48 +112,43 @@ log_hivemind("[key_name(src)] : [message]") - var/track = "" - var/overwatch_target = XENO_OVERWATCH_TARGET_HREF - var/overwatch_src = XENO_OVERWATCH_SRC_HREF - var/overwatch_insert = "" - var/ghostrend - var/rendered - - for (var/mob/S in GLOB.player_list) - var/hear_hivemind = 0 - if(ishuman(S)) - var/mob/living/carbon/human/Hu = S - if(Hu.hivenumber) - hear_hivemind = Hu.hivenumber - - if(!QDELETED(S) && (isxeno(S) || S.stat == DEAD || hear_hivemind) && !istype(S,/mob/new_player)) - var/mob/living/carbon/xenomorph/X = src - if(istype(S,/mob/dead/observer)) - if(S.client.prefs && S.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) - track = "(F)" - if(isqueen(src)) - var/mob/hologram/queen/queen_eye = client?.eye - if(istype(queen_eye)) - track += " (E)" - ghostrend = SPAN_XENOQUEEN("Hivemind, [src.name][track] hisses, '[message]'") - else if(hive.leading_cult_sl == src) - ghostrend = SPAN_XENOQUEEN("Hivemind, [src.name][track] hisses, '[message]'") - else if(istype(X) && IS_XENO_LEADER(X)) - ghostrend = SPAN_XENOLEADER("Hivemind, Leader [src.name][track] hisses, '[message]'") - else - ghostrend = SPAN_XENO("Hivemind, [src.name][track] hisses, '[message]'") - S.show_message(ghostrend, SHOW_MESSAGE_AUDIBLE) - - else if(hive.hivenumber == xeno_hivenumber(S) || hive.hivenumber == hear_hivemind) - if(isxeno(src) && isxeno(S)) - overwatch_insert = " (watch)" - - if(isqueen(src) || hive.leading_cult_sl == src) - rendered = SPAN_XENOQUEEN("Hivemind, [src.name][overwatch_insert] hisses, '[message]'") - else if(istype(X) && IS_XENO_LEADER(X)) - rendered = SPAN_XENOLEADER("Hivemind, Leader [src.name][overwatch_insert] hisses, '[message]'") - else - rendered = SPAN_XENO("Hivemind, [src.name][overwatch_insert] hisses, '[message]'") - - S.show_message(rendered, SHOW_MESSAGE_AUDIBLE) + for(var/mob/creature in GLOB.dead_mob_list) + if(!creature.client) + continue + if(!creature.client.prefs || !(creature.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND)) + continue + + var/mob/living/carbon/xenomorph/zenomorph = creature + var/track = "(F)" + var/final_message + if(isqueen(src)) + var/mob/hologram/queen/queen_eye = client?.eye + if(istype(queen_eye)) + track += " (E)" + final_message = SPAN_XENOQUEEN("Hivemind, [name][track] hisses, '[message]'") + else if(faction_module.leading_cult_sl == src) + final_message = SPAN_XENOQUEEN("Hivemind, [name][track] hisses, '[message]'") + else if(istype(zenomorph) && IS_XENO_LEADER(zenomorph)) + final_message = SPAN_XENOLEADER("Hivemind, Leader [name][track] hisses, '[message]'") + else + final_message = SPAN_XENO("Hivemind, [name][track] hisses, '[message]'") + creature.show_message(final_message, SHOW_MESSAGE_AUDIBLE) + + for(var/mob/creature in faction.total_mobs) + if(!creature.client) + continue + + var/mob/living/carbon/xenomorph/zenomorph = creature + var/overwatch_insert = "" + var/final_message + if(isxeno(src) && isxeno(creature)) + overwatch_insert = " (watch)" + + if(isqueen(src) || faction.leading_cult_sl == src) + final_message = SPAN_XENOQUEEN("Hivemind, [name][overwatch_insert] hisses, '[message]'") + else if(istype(zenomorph) && IS_XENO_LEADER(zenomorph)) + final_message = SPAN_XENOLEADER("Hivemind, Leader [name][overwatch_insert] hisses, '[message]'") + else + final_message = SPAN_XENO("Hivemind, [name][overwatch_insert] hisses, '[message]'") + creature.show_message(final_message, SHOW_MESSAGE_AUDIBLE) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 0d22616e5f84..fc66a7ab0a08 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -95,8 +95,6 @@ ///How much blood the mob can have var/limit_blood = BLOOD_VOLUME_MAXIMUM - var/hivenumber - var/datum/pain/pain //Pain datum for the mob, set on New() var/datum/stamina/stamina diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_lizard.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_lizard.dm index 95e33bd157f0..35316df5aa91 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_lizard.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_lizard.dm @@ -289,7 +289,7 @@ . += SPAN_NOTICE("\nRest on the ground to restore 5% of your health every second.") . += SPAN_NOTICE("You're able to pounce targets by using [get_ability_mouse_name()].") . += SPAN_NOTICE("You will aggressively maul targets that are prone. Any click on yourself will be passed down to mobs below you, so feel free to click on your sprite in order to attack pounced targets.") - else if((user.faction in faction_group)) + else if(ally_faction(user.faction)) desc = "[initial(desc)] There's a hint of warmth in them." else desc = initial(desc) @@ -330,10 +330,11 @@ if(stat == DEAD) return - if(!(attacking_mob.faction in faction_group) && !is_eating) + var/ally = ally_faction(attacking_mob.faction) + if(!ally && !is_eating) Retaliate() - if(attacking_mob.a_intent == INTENT_HELP && (attacking_mob.faction in faction_group)) + if(attacking_mob.a_intent == INTENT_HELP && ally) if(on_fire) adjust_fire_stacks(-5, min_stacks = 0) playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) @@ -443,7 +444,7 @@ stop_automated_movement = FALSE //if there's a friend on the same tile as us, don't bother getting up (cute!) var/mob/living/carbon/friend = locate(/mob/living/carbon) in get_turf(src) - if((friend?.faction in faction_group) && resting) + if(friend && ally_faction(friend.faction) && resting) chance_to_rest = 0 if(prob(chance_to_rest)) @@ -508,7 +509,7 @@ if(stance <= HOSTILE_STANCE_ALERT && !food_target && COOLDOWN_FINISHED(src, calm_cooldown)) var/intruder_in_sight = FALSE for(var/mob/living/carbon/intruder in view(5, src)) - if((intruder.faction in faction_group) || intruder.stat != CONSCIOUS || ismonkey(intruder) || intruder.alpha <= 200) + if(ally_faction(intruder.faction) || intruder.stat != CONSCIOUS || ismonkey(intruder) || intruder.alpha <= 200) continue intruder_in_sight = TRUE @@ -664,11 +665,11 @@ playsound(loc,'sound/items/eatfood.ogg', 25, 1) for(var/mob/living/carbon/nearest_mob in view(7, src)) - if(nearest_mob != food.last_dropped_by || (nearest_mob.faction in faction_group)) + if(nearest_mob != food.last_dropped_by || ally_faction(nearest_mob.faction)) continue face_atom(nearest_mob) manual_emote("stares curiously at [nearest_mob].") - faction_group += nearest_mob.faction_group + organ_faction_tag.factions |= nearest_mob.faction break health += maxHealth * 0.15 @@ -707,7 +708,7 @@ food_target_ref = null is_eating = FALSE //snagging the food while you're right next to the mob makes it very angry - if(get_dist(src, food_holder) <= 2 && !(food_holder.faction in faction_group)) + if(get_dist(src, food_holder) <= 2 && !ally_faction(food_holder.faction)) Retaliate() return TRUE @@ -807,7 +808,7 @@ return //don't stop retreating if there are non-friendly carbons in view for(var/mob/living/carbon/hostile_mob in view(7, src)) - if(hostile_mob.faction in faction_group) + if(ally_faction(hostile_mob.faction)) continue MoveTo(hostile_mob, 10, TRUE, 2 SECONDS, FALSE) retreat_attempts++ @@ -929,7 +930,7 @@ playsound(loc, "giant_lizard_hiss", 25) pounced_mob.KnockDown(0.5) step_to(src, pounced_mob) - if(!client && !(pounced_mob.faction in faction_group)) + if(!client && !ally_faction(pounced_mob.faction)) ravagingattack(pounced_mob) /mob/living/simple_animal/hostile/retaliate/giant_lizard/proc/pounced_turf(turf/turf_target) diff --git a/code/modules/objectives/mob_objectives.dm b/code/modules/objectives/mob_objectives.dm index 4725f9c20e0d..2a041ccec161 100644 --- a/code/modules/objectives/mob_objectives.dm +++ b/code/modules/objectives/mob_objectives.dm @@ -122,7 +122,7 @@ return OBJECTIVE_LOW_VALUE else if(ishumansynth_strict(target) && length(scored_humansynth_corpses) == 49) - marine_announcement("Maximum intel points for non-xenomorph corpses has been achieved.", "Intel Announcement", 'sound/misc/notice2.ogg') + faction_announcement("Maximum intel points for non-xenomorph corpses has been achieved.", "Intel Announcement", 'sound/misc/notice2.ogg') return OBJECTIVE_LOW_VALUE return value diff --git a/code/modules/projectiles/homing_projectile_component.dm b/code/modules/projectiles/homing_projectile_component.dm index 8fd36fd67f31..00e591235ea9 100644 --- a/code/modules/projectiles/homing_projectile_component.dm +++ b/code/modules/projectiles/homing_projectile_component.dm @@ -15,7 +15,7 @@ var/mob/living/carbon/human/human_target = homing_target var/obj/projectile/projectile = parent if(SEND_SIGNAL(parent, COMSIG_BULLET_CHECK_MOB_SKIPPING, human_target) & COMPONENT_SKIP_MOB\ - || projectile.runtime_iff_group && human_target.get_target_lock(projectile.runtime_iff_group)\ + || projectile.runtime_iff_group && human_target.ally_faction(projectile.runtime_iff_group)\ ) return COMPONENT_INCOMPATIBLE diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 0eb9fca3169e..2d42700624c6 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -884,7 +884,7 @@ if(.) var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(SEND_SIGNAL(P, COMSIG_BULLET_CHECK_MOB_SKIPPING, src) & COMPONENT_SKIP_MOB\ - || P.runtime_iff_group && get_target_lock(P.runtime_iff_group)) + || P.runtime_iff_group && ally_faction(P.runtime_iff_group)) return FALSE if(ammo_flags & AMMO_SKIPS_ALIENS) diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index b934eb86ee76..4ca21268c4ca 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -271,7 +271,7 @@ GLOBAL_VAR_INIT(maint_all_access, TRUE) text_timeleft = "[timeleft] seconds" var/input = "Station shutter locks lifting in [text_timeleft] per manual override." var/title = announce_title - marine_announcement(input, title, 'sound/AI/commandreport.ogg') + faction_announcement(input, title, 'sound/AI/commandreport.ogg') for(var/mob/M in GLOB.player_list) if(isxeno(M)) sound_to(M, sound(get_sfx("queen"), wait = 0, volume = 50)) diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index b6577a2fcbfa..ee662e659bba 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -34,7 +34,7 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN) if(announce) var/name = "SELF-DESTRUCT SYSTEMS ACTIVE" var/input = "DANGER, THE EMERGENCY DESTRUCT SYSTEM IS NOW ACTIVATED. PROCEED TO THE SELF-DESTRUCT CHAMBER FOR CONTROL ROD INSERTION." - marine_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = log) + faction_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = log) GLOB.security_level = SEC_LEVEL_DELTA /proc/get_security_level() diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index 48b867477f65..9149dab684f8 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -357,7 +357,7 @@ hijack.fire() GLOB.alt_ctrl_disabled = TRUE - marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) + faction_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") var/mob/living/carbon/xenomorph/xeno = user diff --git a/code/modules/shuttle/dropship_hijack.dm b/code/modules/shuttle/dropship_hijack.dm index 73150f5bfc08..eff2f1a914ab 100644 --- a/code/modules/shuttle/dropship_hijack.dm +++ b/code/modules/shuttle/dropship_hijack.dm @@ -116,7 +116,7 @@ if(!offset_target) offset_target = target // Welp the offsetting failed so... crash_site.forceMove(offset_target) - marine_announcement("A hostile aircraft on course for the [target_ship_section] has been successfully deterred.", "IX-50 MGAD System", logging = ARES_LOG_SECURITY) + faction_announcement("A hostile aircraft on course for the [target_ship_section] has been successfully deterred.", "IX-50 MGAD System", logging = ARES_LOG_SECURITY) target_ship_section = new_target_ship_section // TODO mobs not alerted for(var/area/internal_area in shuttle.shuttle_areas) @@ -142,7 +142,7 @@ shuttle.crashing = TRUE - marine_announcement("DROPSHIP ON COLLISION COURSE. CRASH IMMINENT." , "EMERGENCY", 'sound/AI/dropship_emergency.ogg', logging = ARES_LOG_SECURITY) + faction_announcement("DROPSHIP ON COLLISION COURSE. CRASH IMMINENT." , "EMERGENCY", 'sound/AI/dropship_emergency.ogg', logging = ARES_LOG_SECURITY) notify_ghosts(header = "Dropship Collision", message = "The dropship is about to impact [get_area_name(crash_site)]!", source = crash_site, extra_large = TRUE) final_announcement = TRUE diff --git a/code/modules/shuttles/marine_ferry.dm b/code/modules/shuttles/marine_ferry.dm index 90e945b135da..301191777e66 100644 --- a/code/modules/shuttles/marine_ferry.dm +++ b/code/modules/shuttles/marine_ferry.dm @@ -402,7 +402,7 @@ // At halftime, we announce whether or not the AA forced the dropship to divert // The rounding is because transit time is decreased by 10 each loop. Travel time, however, might not be a multiple of 10 if(in_transit_time_left == round(travel_time / 2, 10) && true_crash_target_section != crash_target_section) - marine_announcement("A hostile aircraft on course for the [true_crash_target_section] has been successfully deterred.", "IX-50 MGAD System", logging = ARES_LOG_SECURITY) + faction_announcement("A hostile aircraft on course for the [true_crash_target_section] has been successfully deterred.", "IX-50 MGAD System", logging = ARES_LOG_SECURITY) var/area/shuttle_area for(var/turf/T in turfs_int) @@ -423,7 +423,7 @@ //This is where things change and shit gets real - marine_announcement("DROPSHIP ON COLLISION COURSE. CRASH IMMINENT." , "EMERGENCY", 'sound/AI/dropship_emergency.ogg', logging = ARES_LOG_SECURITY) + faction_announcement("DROPSHIP ON COLLISION COURSE. CRASH IMMINENT." , "EMERGENCY", 'sound/AI/dropship_emergency.ogg', logging = ARES_LOG_SECURITY) for(var/mob/dead/observer/observer as anything in GLOB.observer_list) to_chat(observer, SPAN_DEADSAY(FONT_SIZE_LARGE("The dropship is about to impact [get_area_name(T_trg)]" + " [OBSERVER_JMP(observer, T_trg)]"))) diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index 447f4a1bf386..40e62f4dd64d 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -289,7 +289,7 @@ GLOBAL_LIST_EMPTY(shuttle_controls) if(GLOB.round_statistics) GLOB.round_statistics.track_hijack() - marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) + faction_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) shuttle.alerts_allowed-- log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") diff --git a/code/modules/vehicles/apc/apc_command.dm b/code/modules/vehicles/apc/apc_command.dm index 8d056daec2ea..582d5bd7f65f 100644 --- a/code/modules/vehicles/apc/apc_command.dm +++ b/code/modules/vehicles/apc/apc_command.dm @@ -187,11 +187,11 @@ else if(SSticker.mode == "Distress Signal" || GLOB.master_mode == "Distress Signal") if(techpod_access_settings_override) return TRUE - else if(user.get_target_lock(techpod_faction_requirement)) + else if(user.ally_faction(techpod_faction_requirement)) return TRUE else if(techpod_access_settings_override) - if(user.get_target_lock(techpod_faction_requirement)) + if(user.ally_faction(techpod_faction_requirement)) return TRUE else return TRUE diff --git a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm index 30efdbcfd0e9..11871fc36cfd 100644 --- a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm +++ b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm @@ -124,7 +124,7 @@ purge_target(living_mob) continue - if(living_mob.get_target_lock(faction_group) || living_mob.invisibility || HAS_TRAIT(living_mob, TRAIT_ABILITY_BURROWED)) + if(living_mob.ally_faction(faction) || living_mob.invisibility || HAS_TRAIT(living_mob, TRAIT_ABILITY_BURROWED)) purge_target(living_mob) continue diff --git a/code/modules/vehicles/multitile/multitile_bump.dm b/code/modules/vehicles/multitile/multitile_bump.dm index 4bc40fe46f48..75a0603c1bf9 100644 --- a/code/modules/vehicles/multitile/multitile_bump.dm +++ b/code/modules/vehicles/multitile/multitile_bump.dm @@ -543,13 +543,13 @@ V.take_damage_type(TIER_3_RAM_DAMAGE_TAKEN, "blunt", src) playsound(V, 'sound/effects/metal_crash.ogg', 35) return FALSE - else if(driver && get_target_lock(driver.faction)) + else if(driver && ally_faction(driver.faction)) apply_effect(0.5, WEAKEN) else apply_effect(1, WEAKEN) else if(V.vehicle_flags & VEHICLE_CLASS_LIGHT) - if(get_target_lock(driver.faction)) + if(ally_faction(driver.faction)) apply_effect(0.5, WEAKEN) else apply_effect(2, WEAKEN) diff --git a/code/modules/vehicles/multitile/multitile_interaction.dm b/code/modules/vehicles/multitile/multitile_interaction.dm index 152140f776db..0c271a85e64f 100644 --- a/code/modules/vehicles/multitile/multitile_interaction.dm +++ b/code/modules/vehicles/multitile/multitile_interaction.dm @@ -316,16 +316,6 @@ healthcheck() -//to handle IFF bullets -/obj/vehicle/multitile/proc/get_target_lock(access_to_check) - if(isnull(access_to_check) || !vehicle_faction) - return FALSE - - if(!islist(access_to_check)) - return access_to_check == vehicle_faction - - return vehicle_faction in access_to_check - /obj/vehicle/multitile/ex_act(severity) take_damage_type(severity * 0.5, "explosive") take_damage_type(severity * 0.1, "slash") diff --git a/colonialmarines.dme b/colonialmarines.dme index 5226e89b4159..7eae091140df 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -2063,6 +2063,7 @@ #include "code\modules\mob\living\carbon\xenomorph\Evolution.dm" #include "code\modules\mob\living\carbon\xenomorph\Facehuggers.dm" #include "code\modules\mob\living\carbon\xenomorph\hive_faction.dm" +#include "code\modules\mob\living\carbon\xenomorph\hive_status.dm" #include "code\modules\mob\living\carbon\xenomorph\hive_status_ui.dm" #include "code\modules\mob\living\carbon\xenomorph\life.dm" #include "code\modules\mob\living\carbon\xenomorph\login.dm" @@ -2159,7 +2160,6 @@ #include "code\modules\mob\living\carbon\xenomorph\castes\Sentinel.dm" #include "code\modules\mob\living\carbon\xenomorph\castes\Spitter.dm" #include "code\modules\mob\living\carbon\xenomorph\castes\Warrior.dm" -#include "code\modules\mob\living\carbon\xenomorph\items\iff_tag.dm" #include "code\modules\mob\living\carbon\xenomorph\strains\behavior_delegate.dm" #include "code\modules\mob\living\carbon\xenomorph\strains\xeno_strain.dm" #include "code\modules\mob\living\carbon\xenomorph\strains\castes\boiler\trapper.dm" diff --git a/tgui/packages/tgui/interfaces/SentryGunUI.tsx b/tgui/packages/tgui/interfaces/SentryGunUI.tsx index 8dd8fdb0c0d2..9be2129ec0c6 100644 --- a/tgui/packages/tgui/interfaces/SentryGunUI.tsx +++ b/tgui/packages/tgui/interfaces/SentryGunUI.tsx @@ -38,7 +38,6 @@ interface SentrySpec { health: number; health_max: number; kills: number; - iff_status: string[]; camera_available: number; } From 704b1530a33deefa1a38e78c31139024f3c94a19 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Thu, 23 Jan 2025 17:02:28 +0500 Subject: [PATCH 03/24] ONE MORE STEP FORWARD INTO THE HELL OF CODE --- code/__DEFINES/factions.dm | 2 +- code/__DEFINES/mobs.dm | 20 -- code/__DEFINES/mode.dm | 79 +++-- code/__DEFINES/typecheck/xenos.dm | 13 +- code/_onclick/hud/screen_objects.dm | 24 +- code/_onclick/observer.dm | 8 +- code/_onclick/ventcrawl.dm | 2 +- code/_onclick/xeno.dm | 6 +- code/controllers/subsystem/hijack.dm | 9 +- code/controllers/subsystem/influxstats.dm | 17 +- code/controllers/subsystem/minimap.dm | 55 ++-- code/controllers/subsystem/tracking.dm | 6 +- code/controllers/subsystem/who.dm | 20 +- code/controllers/subsystem/x_evolution.dm | 4 +- code/datums/ammo/misc.dm | 2 +- .../components/weed_damage_reduction.dm | 10 +- code/datums/components/weed_food.dm | 2 +- .../construction_template_xenomorph.dm | 2 +- code/datums/emergency_calls/forsaken_xenos.dm | 2 +- code/datums/factions/faction.dm | 10 +- code/datums/factions/faction_modules.dm | 273 +++++++----------- code/datums/factions/iff_tag.dm | 4 +- code/datums/map_config.dm | 2 +- code/datums/medal_awards.dm | 17 +- code/datums/mob_hud.dm | 17 +- .../datums/statistics/entities/round_stats.dm | 6 - code/game/bioscans.dm | 2 +- code/game/gamemodes/cm_initialize.dm | 64 ++-- .../colonialmarines/colonialmarines.dm | 30 +- .../whiskey_outpost/whiskey_output_waves.dm | 2 +- .../gamemodes/colonialmarines/xenovsxeno.dm | 4 +- code/game/jobs/job/antag/xeno/xenomorph.dm | 2 +- code/game/jobs/role_authority.dm | 2 +- code/game/objects/effects/aliens.dm | 4 +- .../objects/effects/effect_system/smoke.dm | 2 +- .../stool_bed_chair_nest/xeno_nest.dm | 21 +- code/game/turfs/walls/wall_types.dm | 30 +- code/modules/admin/tabs/event_tab.dm | 32 +- code/modules/admin/topic/topic.dm | 8 +- code/modules/admin/topic/topic_teleports.dm | 4 +- code/modules/cm_aliens/XenoStructures.dm | 39 +-- code/modules/cm_aliens/structures/egg.dm | 12 +- code/modules/cm_aliens/structures/fruit.dm | 2 +- .../cm_aliens/structures/special_structure.dm | 2 +- code/modules/cm_aliens/structures/trap.dm | 8 +- code/modules/cm_aliens/structures/tunnel.dm | 10 +- .../structures/xeno_structures_boilertrap.dm | 2 +- code/modules/cm_aliens/weeds.dm | 47 ++- code/modules/gear_presets/other.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 6 +- .../living/carbon/human/human_abilities.dm | 2 +- .../mob/living/carbon/xenomorph/Embryo.dm | 48 +-- .../mob/living/carbon/xenomorph/Evolution.dm | 63 ++-- .../living/carbon/xenomorph/Facehuggers.dm | 2 +- .../mob/living/carbon/xenomorph/XenoProcs.dm | 14 +- .../mob/living/carbon/xenomorph/Xenomorph.dm | 2 +- .../xenomorph/abilities/general_powers.dm | 19 +- .../xenomorph/abilities/queen/queen_powers.dm | 2 +- .../living/carbon/xenomorph/castes/Larva.dm | 24 +- .../carbon/xenomorph/castes/Predalien.dm | 1 - .../living/carbon/xenomorph/castes/Queen.dm | 35 ++- .../mob/living/carbon/xenomorph/death.dm | 2 +- .../mob/living/carbon/xenomorph/egg_item.dm | 50 ++-- .../living/carbon/xenomorph/hive_status.dm | 12 +- .../mob/living/simple_animal/hostile/alien.dm | 2 +- code/modules/mob/new_player/new_player.dm | 2 +- .../reagents/chemistry_reagents/other.dm | 2 +- .../shuttle/computers/dropship_computer.dm | 2 +- 69 files changed, 591 insertions(+), 644 deletions(-) diff --git a/code/__DEFINES/factions.dm b/code/__DEFINES/factions.dm index 3af3cfa75ad3..1228befcb879 100644 --- a/code/__DEFINES/factions.dm +++ b/code/__DEFINES/factions.dm @@ -17,7 +17,7 @@ #define RELATIONS_FACTION_UPP list(FACTION_USCM = RELATIONS_HOSTILE, FACTION_WY = RELATIONS_FRIENDLY, FACTION_CLF = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_NEUTRAL, FACTION_RESS = RELATIONS_HOSTILE, FACTION_TWE = RELATIONS_FRIENDLY, FACTION_MERCENARY = RELATIONS_HOSTILE, FACTION_FREELANCER = RELATIONS_HOSTILE, FACTION_THREEWE = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_NEUTRAL) #define RELATIONS_FACTION_XENOMORPH list(FACTION_XENOMORPH_NORMAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_CORRUPTED = RELATIONS_HOSTILE, FACTION_XENOMORPH_ALPHA = RELATIONS_HOSTILE, FACTION_XENOMORPH_BRAVO = RELATIONS_HOSTILE, FACTION_XENOMORPH_CHARLIE = RELATIONS_HOSTILE, FACTION_XENOMORPH_DELTA = RELATIONS_HOSTILE, FACTION_XENOMORPH_FERAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_FORSAKEN = RELATIONS_HOSTILE, FACTION_XENOMORPH_TAMED = RELATIONS_HOSTILE, FACTION_XENOMORPH_MUTATED = RELATIONS_HOSTILE, FACTION_XENOMORPH_YAUTJA = RELATIONS_HOSTILE, FACTION_XENOMORPH_RENEGADE = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_NEUTRAL) -#define RELATIONS_MAP list(FACTION_NEUTRAL = null, FACTION_USCM = null, FACTION_MARINE = null, FACTION_CMB = null, FACTION_MARSOC = null, FACTION_CONTRACTOR = null, FACTION_WY = null, FACTION_PMC = null, FACTION_WY_DEATHSQUAD = null, FACTION_CLF = null, FACTION_UPP = null, FACTION_FREELANCER = null, FACTION_COLONIST = null, FACTION_MERCENARY = null, FACTION_DUTCH = null, FACTION_HEFA = null, FACTION_GLADIATOR = null, FACTION_PIRATE = null, FACTION_PIZZA = null, FACTION_SOUTO = null, FACTION_YAUTJA = null, FACTION_XENOMORPH_NORMAL = null, FACTION_XENOMORPH_CORRUPTED = null, FACTION_XENOMORPH_ALPHA = null, FACTION_XENOMORPH_BRAVO = null, FACTION_XENOMORPH_CHARLIE = null, FACTION_XENOMORPH_DELTA = null, FACTION_XENOMORPH_FERAL = null, FACTION_XENOMORPH_FORSAKEN = null, FACTION_XENOMORPH_TAMED = null, FACTION_XENOMORPH_MUTATED = null, FACTION_XENOMORPH_YAUTJA = null) +#define RELATIONS_MAP list(FACTION_NEUTRAL = null, FACTION_USCM = null, FACTION_MARINE = null, FACTION_MARSHAL = null, FACTION_CONTRACTOR = null, FACTION_CONTRACTOR = null, FACTION_WY = null, FACTION_PMC = null, FACTION_WY_DEATHSQUAD = null, FACTION_CLF = null, FACTION_UPP = null, FACTION_FREELANCER = null, FACTION_COLONIST = null, FACTION_MERCENARY = null, FACTION_DUTCH = null, FACTION_HEFA = null, FACTION_GLADIATOR = null, FACTION_PIRATE = null, FACTION_PIZZA = null, FACTION_SOUTO = null, FACTION_YAUTJA = null, FACTION_XENOMORPH_NORMAL = null, FACTION_XENOMORPH_CORRUPTED = null, FACTION_XENOMORPH_ALPHA = null, FACTION_XENOMORPH_BRAVO = null, FACTION_XENOMORPH_CHARLIE = null, FACTION_XENOMORPH_DELTA = null, FACTION_XENOMORPH_FERAL = null, FACTION_XENOMORPH_FORSAKEN = null, FACTION_XENOMORPH_TAMED = null, FACTION_XENOMORPH_MUTATED = null, FACTION_XENOMORPH_YAUTJA = null) #define RELATIONS_MAP_HOSTILE list(FACTION_USCM = RELATIONS_HOSTILE, FACTION_WY = RELATIONS_HOSTILE, FACTION_UPP = RELATIONS_HOSTILE, FACTION_CLF = RELATIONS_HOSTILE, FACTION_COLONIST = RELATIONS_HOSTILE, FACTION_RESS = RELATIONS_HOSTILE, FACTION_TWE = RELATIONS_HOSTILE, FACTION_MERCENARY = RELATIONS_HOSTILE, FACTION_FREELANCER = RELATIONS_HOSTILE, FACTION_THREEWE = RELATIONS_HOSTILE, FACTION_XENOMORPH_NORMAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_CORRUPTED = RELATIONS_HOSTILE, FACTION_XENOMORPH_ALPHA = RELATIONS_HOSTILE, FACTION_XENOMORPH_BRAVO = RELATIONS_HOSTILE, FACTION_XENOMORPH_CHARLIE = RELATIONS_HOSTILE, FACTION_XENOMORPH_DELTA = RELATIONS_HOSTILE, FACTION_XENOMORPH_FERAL = RELATIONS_HOSTILE, FACTION_XENOMORPH_FORSAKEN = RELATIONS_HOSTILE, FACTION_XENOMORPH_TAMED = RELATIONS_HOSTILE, FACTION_XENOMORPH_MUTATED = RELATIONS_HOSTILE, FACTION_XENOMORPH_YAUTJA = RELATIONS_HOSTILE, FACTION_NEUTRAL = RELATIONS_HOSTILE) // For this BATCH, it's predefined, because otherwise this pr will be TOO big diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index dd3b3c3969a8..7c540c59d51f 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -122,26 +122,6 @@ #define NO_PERMANENT_DAMAGE (1<<20) #define CORRUPTED_ALLY (1<<21) -// ============================= -// hive types - -#define XENO_HIVE_NORMAL "xeno_hive_normal" -#define XENO_HIVE_CORRUPTED "xeno_hive_corrupted" -#define XENO_HIVE_ALPHA "xeno_hive_alpha" -#define XENO_HIVE_BRAVO "xeno_hive_bravo" -#define XENO_HIVE_CHARLIE "xeno_hive_charlie" -#define XENO_HIVE_DELTA "xeno_hive_delta" -#define XENO_HIVE_FERAL "xeno_hive_feral" -#define XENO_HIVE_TAMED "xeno_hive_tamed" -#define XENO_HIVE_MUTATED "xeno_hive_mutated" -#define XENO_HIVE_FORSAKEN "xeno_hive_forsaken" -#define XENO_HIVE_YAUTJA "xeno_hive_yautja" -#define XENO_HIVE_RENEGADE "xeno_hive_renegade" - -#define XENO_HIVE_TUTORIAL "xeno_hive_tutorial" - -#define ALL_XENO_HIVES list(XENO_HIVE_NORMAL, XENO_HIVE_CORRUPTED, XENO_HIVE_ALPHA, XENO_HIVE_BRAVO, XENO_HIVE_CHARLIE, XENO_HIVE_DELTA, XENO_HIVE_FERAL, XENO_HIVE_TAMED, XENO_HIVE_MUTATED, XENO_HIVE_FORSAKEN, XENO_HIVE_YAUTJA, XENO_HIVE_RENEGADE, XENO_HIVE_TUTORIAL) - //================================================= // ============================= diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 72f9d05d6a33..ca4a340583ed 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -252,14 +252,15 @@ DEFINE_BITFIELD(whitelist_status, list( //================================================= // Faction names -#define FACTION_NEUTRAL "Neutral" -#define FACTION_MARINE "USCM" -#define FACTION_SURVIVOR "Survivor" -#define FACTION_UPP "UPP" -#define FACTION_TWE "TWE" -#define FACTION_WY "Wey-Yu" -#define FACTION_CLF "CLF" -#define FACTION_PMC "PMC" +#define FACTION_NEUTRAL "nfo" +#define FACTION_USCM "uscm" +#define FACTION_MARINE "cmf" +#define FACTION_SURVIVOR "surv" +#define FACTION_UPP "upp" +#define FACTION_TWE "twe" +#define FACTION_WY "wy" +#define FACTION_CLF "clf" +#define FACTION_PMC "pmc" #define FACTION_CONTRACTOR "VAI" #define FACTION_MARSHAL "Colonial Marshal" #define FACTION_NSPA "NSPA" @@ -309,18 +310,6 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_LIST_ALL FACTION_LIST_HUMANOID + FACTION_LIST_XENOMORPH -// Xenomorphs -#define FACTION_PREDALIEN "Predalien" - -#define FACTION_XENOMORPH "Xenomorph" -#define FACTION_XENOMORPH_CORRPUTED "Corrupted Xenomoprh" -#define FACTION_XENOMORPH_ALPHA "Alpha Xenomorph" -#define FACTION_XENOMORPH_BRAVO "Bravo Xenomorph" -#define FACTION_XENOMORPH_CHARLIE "Charlie Xenomorph" -#define FACTION_XENOMORPH_DELTA "Delta Xenomorph" - -#define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH, FACTION_XENOMORPH_CORRPUTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA) - // Faction allegiances within a certain faction. #define FACTION_ALLEGIANCE_USCM_COMMANDER list("Doves", "Hawks", "Magpies", "Unaligned") @@ -330,3 +319,53 @@ DEFINE_BITFIELD(whitelist_status, list( GLOBAL_VAR(last_ares_callout) GLOBAL_VAR(last_qm_callout) + +//NAMES +#define NAME_FACTION_NEUTRAL "Neutral Faction" +//USCM +#define NAME_FACTION_USCM "United States Colonial Marines" +#define NAME_FACTION_MARINE "Colonial Marines" +#define NAME_FACTION_CMB "Colonial Marshal Bureau" +#define NAME_FACTION_MARSOC "Marine Special Operations Command" +//CONTRACTOR +#define NAME_FACTION_CONTRACTOR "Vanguard's Arrow Incorporated" +//WY +#define NAME_FACTION_WY "Weyland-Yutani" +#define NAME_FACTION_PMC "Private Military Company" +#define NAME_FACTION_WY_DEATHSQUAD "Corporate Commandos" +//UPP +#define NAME_FACTION_UPP "Union of Progressive Peoples" +//CLF +#define NAME_FACTION_CLF "Colonial Liberation Front" +//COLON +#define NAME_FACTION_COLONIST "Colonists" +//OTHER +#define NAME_FACTION_RESS "Royal Empire of the Shining Sun" +#define NAME_FACTION_TWE "Royal Marines Commando" +#define NAME_FACTION_MERCENARY "Mercenary Group" +#define NAME_FACTION_FREELANCER "Freelancer Mercenaries" +#define NAME_FACTION_HEFA "HEFA Knights" +#define NAME_FACTION_DUTCH "Dutch's Dozen" +#define NAME_FACTION_PIRATE "Pirates of Free Space" +#define NAME_FACTION_GLADIATOR "Gladiators" +#define NAME_FACTION_PIZZA "Pizza Galaxy" +#define NAME_FACTION_SOUTO "Souto Space" +#define NAME_FACTION_THREEWE "Three World Empire" +//ZOMBIE +#define NAME_FACTION_ZOMBIE "Zombie Horde" +//YAUTJA +#define NAME_FACTION_YAUTJA "Yautja Hanting Groop" +//XENOS +#define NAME_FACTION_XENOMORPH "Xenomorphs" +#define NAME_FACTION_XENOMORPH_NORMAL "Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_CORRUPTED "Corrupted Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_ALPHA "Alpha Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_BRAVO "Bravo Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_CHARLIE "Charlie Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_DELTA "Delta Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_FERAL "Feral Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_FORSAKEN "Forsaken Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_TAMED "Tamed Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_MUTATED "Mutated Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_YAUTJA "Yautja Xenomorph Hive" +#define NAME_FACTION_XENOMORPH_RENEGADE "Renegade Xenomorph Hive" diff --git a/code/__DEFINES/typecheck/xenos.dm b/code/__DEFINES/typecheck/xenos.dm index b76f6309a2a2..3a78f73cc9af 100644 --- a/code/__DEFINES/typecheck/xenos.dm +++ b/code/__DEFINES/typecheck/xenos.dm @@ -34,18 +34,17 @@ if(!faction) return FALSE - if(faction.code_identificator == XENO_HIVE_RENEGADE) - var/datum/hive_status/corrupted/renegade/renegade_hive = hive + if(faction.code_identificator == FACTION_XENOMORPH_RENEGADE) + var/datum/hive_status/corrupted/renegade/renegade_hive = faction return renegade_hive.iff_protection_check(src, attempt_harm_mob) return attempt_harm_mob.ally_faction(faction) // need this to set the data for walls/eggs/huggers when they are initialized -/proc/set_hive_data(atom/focused_atom, hivenumber) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - if (hive.color) - focused_atom.color = hive.color - focused_atom.name = "[lowertext(hive.prefix)][focused_atom.name]" +/proc/set_hive_data(atom/focused_atom, datum/hive_status/faction) + if(faction.color) + focused_atom.color = faction.color + focused_atom.name = "[lowertext(faction.prefix)][focused_atom.name]" /proc/get_xeno_stun_duration(mob/stun_mob, duration) if(iscarbonsizexeno(stun_mob)) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index b51a18149a75..ea3eaffe58a1 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -491,16 +491,17 @@ if(mods["alt"] && user.tracked_marker) user.stop_tracking_resin_mark() return - if(!user.hive) + if(!user.faction) to_chat(user, SPAN_WARNING("We don't belong to a hive!")) return FALSE - if(!user.hive.living_xeno_queen) + var/datum/faction_module/hive_mind/faction_module = user.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen) to_chat(user, SPAN_WARNING("Without a queen our psychic link is broken!")) return FALSE 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) + faction_module.mark_ui.update_all_data() + faction_module.mark_ui.open_mark_menu(user) /atom/movable/screen/queen_locator name = "queen locator" @@ -519,22 +520,23 @@ var/area/current_area = get_area(user) to_chat(user, SPAN_NOTICE("We are currently at: [current_area.name].")) return - if(!user.hive) + if(!user.faction) to_chat(user, SPAN_WARNING("We don't belong to a hive!")) return FALSE + var/datum/faction_module/hive_mind/faction_module = user.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(mods["alt"]) var/list/options = list() - if(user.hive.living_xeno_queen) + if(faction_module.living_xeno_queen) // Don't need weakrefs to this or the hive core, since there's only one possible target. options["Queen"] = list(null, TRACKER_QUEEN) - if(user.hive.hive_location) + if(faction_module.hive_location) options["Hive Core"] = list(null, TRACKER_HIVE) - for(var/mob/living/carbon/xenomorph/leader in user.hive.xeno_leader_list) + for(var/mob/living/carbon/xenomorph/leader in faction_module.xeno_leader_list) options["Xeno Leader [leader]"] = list(leader, TRACKER_LEADER) - var/list/sorted_tunnels = sort_list_dist(user.hive.tunnels, get_turf(user)) + var/list/sorted_tunnels = sort_list_dist(faction_module.tunnels, get_turf(user)) for(var/obj/structure/tunnel/tunnel as anything in sorted_tunnels) options["Tunnel [tunnel.tunnel_desc]"] = list(tunnel, TRACKER_TUNNEL) @@ -545,12 +547,12 @@ tracker_type = selected_data[2] // Tracker category return - if(!user.hive.living_xeno_queen) + if(!faction_module.living_xeno_queen) to_chat(user, SPAN_WARNING("Our hive doesn't have a living queen!")) return FALSE if(HAS_TRAIT(user, TRAIT_ABILITY_BURROWED) || user.is_mob_incapacitated() || user.buckled) return FALSE - user.overwatch(user.hive.living_xeno_queen) + user.overwatch(faction_module.living_xeno_queen) // Reset to the defaults /atom/movable/screen/queen_locator/proc/reset_tracking() diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 62026324c594..403ce7ff7573 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -60,10 +60,10 @@ do_observe(target) return FALSE - if(xeno.hive) - for(var/mob_name in xeno.hive.banished_ckeys) - if(xeno.hive.banished_ckeys[mob_name] == ckey) - to_chat(src, SPAN_WARNING("You are banished from the [xeno.hive], you may not rejoin unless the Queen re-admits you or dies.")) + if(xeno.faction) + for(var/mob_name in xeno.faction.banished_ckeys) + if(xeno.faction.banished_ckeys[mob_name] == ckey) + to_chat(src, SPAN_WARNING("You are banished from the [xeno.faction], you may not rejoin unless the Queen re-admits you or dies.")) do_observe(target) return FALSE diff --git a/code/_onclick/ventcrawl.dm b/code/_onclick/ventcrawl.dm index 9dbd3ba8a11c..fce282381312 100644 --- a/code/_onclick/ventcrawl.dm +++ b/code/_onclick/ventcrawl.dm @@ -72,7 +72,7 @@ var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in vent_found.loc if(W) var/mob/living/carbon/xenomorph/X = src - if(!istype(X) || X.faction != W.linked_hive) + if(!istype(X) || X.faction != W.faction) to_chat(src, SPAN_WARNING("The weeds are blocking the entrance of this vent")) return diff --git a/code/_onclick/xeno.dm b/code/_onclick/xeno.dm index 0d2bfb332607..5d3c798d25ff 100644 --- a/code/_onclick/xeno.dm +++ b/code/_onclick/xeno.dm @@ -38,11 +38,11 @@ if (T && ignores_resin) // Will not target resin walls and doors if this is set to true. This is normally only set to true through a directional attack. if(istype(T, /obj/structure/mineral_door/resin)) var/obj/structure/mineral_door/resin/attacked_door = T - if(faction == attacked_door.faction) + if(faction.code_identificator == attacked_door.faction_to_get) return FALSE if(istype(T, /turf/closed/wall/resin)) var/turf/closed/wall/resin/attacked_wall = T - if(faction == attacked_wall.faction) + if(faction.code_identificator == attacked_wall.faction_to_get) return FALSE target = target.handle_barriers(src, , (PASS_MOB_THRU_XENO|PASS_TYPE_CRAWLER)) // Checks if target will be attacked by the current alien OR if the blocker will be attacked @@ -123,7 +123,7 @@ so that it doesn't double up on the delays) so that it applies the delay immedia if(alt_pressed && shift_pressed) if(istype(target, /mob/living/carbon/xenomorph)) var/mob/living/carbon/xenomorph/xeno = target - if(!QDELETED(xeno) && xeno.stat != DEAD && !should_block_game_interaction(xeno) && xeno.check_state(TRUE) && xeno.hivenumber == hivenumber) + if(!QDELETED(xeno) && xeno.stat != DEAD && !should_block_game_interaction(xeno) && xeno.check_state(TRUE) && xeno.faction == faction) overwatch(xeno) next_move = world.time + 3 // Some minimal delay so this isn't crazy spammy return TRUE diff --git a/code/controllers/subsystem/hijack.dm b/code/controllers/subsystem/hijack.dm index eea9e68bf2b7..9c2151a9dee9 100644 --- a/code/controllers/subsystem/hijack.dm +++ b/code/controllers/subsystem/hijack.dm @@ -305,13 +305,12 @@ SUBSYSTEM_DEF(hijack) if(!generator_ever_overloaded) generator_ever_overloaded = TRUE - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - xeno_announcement(SPAN_XENOANNOUNCE("The talls may be attempting to take their ship down with them in Engineering, stop them!"), hive.hivenumber, XENO_HIJACK_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The talls may be attempting to take their ship down with them in Engineering, stop them!"), faction, XENO_HIJACK_ANNOUNCE) adjust_generator_overload_count(new_overloading ? 1 : -1) diff --git a/code/controllers/subsystem/influxstats.dm b/code/controllers/subsystem/influxstats.dm index 066c94cc2593..e82169e7a832 100644 --- a/code/controllers/subsystem/influxstats.dm +++ b/code/controllers/subsystem/influxstats.dm @@ -52,11 +52,12 @@ SUBSYSTEM_DEF(influxstats) return result /datum/controller/subsystem/influxstats/proc/run_special_round_statistics() - for(var/hive_tag in GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hive_tag] - SSinfluxdriver.enqueue_stats("pooled_larva", list("hive" = hive.reporting_id), list("count" = hive.stored_larva)) - var/burst_larvas = GLOB.larva_burst_by_hive[hive] || 0 - SSinfluxdriver.enqueue_stats("burst_larva", list("hive" = hive.reporting_id), list("count" = burst_larvas)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + SSinfluxdriver.enqueue_stats("pooled_larva", list("hive" = faction.code_identificator), list("count" = faction_module.stored_larva)) + var/burst_larvas = GLOB.larva_burst_by_hive[faction.code_identificator] || 0 + SSinfluxdriver.enqueue_stats("burst_larva", list("hive" = faction.code_identificator), list("count" = burst_larvas)) /datum/controller/subsystem/influxstats/proc/run_round_statistics() var/datum/entity/statistic/round/stats = SSticker?.mode?.round_stats @@ -134,12 +135,10 @@ SUBSYSTEM_DEF(influxstats) else if(ishuman(mob)) team = "humans_others" else if(isxeno(mob)) - var/mob/living/xeno_enabled_mob = mob - var/datum/hive_status/hive = GLOB.hive_datum[xeno_enabled_mob.hivenumber] - if(!hive) + if(!mob.faction) team = "xenos_others" else - team = "xenos_[hive.reporting_id]" + team = "xenos_[mob.faction.code_identificator]" else team = "others" LAZYINITLIST(team_job_stats[team]) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 75f1af47e088..6769a8e992d1 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -366,14 +366,14 @@ SUBSYSTEM_DEF(minimaps) * Fetches the datum containing an announced flattend map png reference. * * Arguments: - * * faction: FACTION_MARINE or XENO_HIVE_NORMAL + * * faction: FACTION_MARINE or FACTION_XENOMORPH_NORMAL */ /proc/get_tacmap_data_png(faction) var/list/map_list if(faction == FACTION_MARINE) map_list = GLOB.uscm_flat_tacmap_data - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) map_list = GLOB.xeno_flat_tacmap_data else return null @@ -389,12 +389,12 @@ SUBSYSTEM_DEF(minimaps) * Fetches the datum containing the latest unannounced flattend map png reference. * * Arguments: - * * faction: FACTION_MARINE or XENO_HIVE_NORMAL + * * faction: FACTION_MARINE or FACTION_XENOMORPH_NORMAL */ /proc/get_unannounced_tacmap_data_png(faction) if(faction == FACTION_MARINE) return GLOB.uscm_unannounced_map - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) return GLOB.xeno_unannounced_map return null @@ -403,14 +403,14 @@ SUBSYSTEM_DEF(minimaps) * Fetches the last set of svg coordinates for the tacmap drawing. * * Arguments: - * * faction: which faction get the map for: FACTION_MARINE or XENO_HIVE_NORMAL + * * faction: which faction get the map for: FACTION_MARINE or FACTION_XENOMORPH_NORMAL */ /proc/get_tacmap_data_svg(faction) var/list/map_list if(faction == FACTION_MARINE) map_list = GLOB.uscm_svg_tacmap_data - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) map_list = GLOB.xeno_svg_tacmap_data else return null @@ -443,12 +443,12 @@ SUBSYSTEM_DEF(minimaps) SSassets.transport.send_assets(user.client, unannounced.asset_key) var/mob/living/carbon/xenomorph/xeno = user - if(is_observer || istype(xeno) && xeno.hivenumber == XENO_HIVE_NORMAL) + if(is_observer || istype(xeno) && xeno.faction.code_identificator == FACTION_XENOMORPH_NORMAL) // Send xeno maps - var/datum/flattened_tacmap/latest = get_tacmap_data_png(XENO_HIVE_NORMAL) + var/datum/flattened_tacmap/latest = get_tacmap_data_png(FACTION_XENOMORPH_NORMAL) if(latest) SSassets.transport.send_assets(user.client, latest.asset_key) - var/datum/flattened_tacmap/unannounced = get_unannounced_tacmap_data_png(XENO_HIVE_NORMAL) + var/datum/flattened_tacmap/unannounced = get_unannounced_tacmap_data_png(FACTION_XENOMORPH_NORMAL) if(unannounced && (!latest || latest.asset_key != unannounced.asset_key)) SSassets.transport.send_assets(user.client, unannounced.asset_key) @@ -456,7 +456,7 @@ SUBSYSTEM_DEF(minimaps) * Flattens the current map and then distributes it for the specified faction as an unannounced map. * * Arguments: - * * faction: Which faction to distribute the map to: FACTION_MARINE or XENO_HIVE_NORMAL + * * faction: Which faction to distribute the map to: FACTION_MARINE or FACTION_XENOMORPH_NORMAL * Return: * * Returns a boolean value, TRUE if the operation was successful, FALSE if it was not (on cooldown generally). */ @@ -465,7 +465,7 @@ SUBSYSTEM_DEF(minimaps) if(!COOLDOWN_FINISHED(GLOB, uscm_flatten_map_icon_cooldown)) return FALSE COOLDOWN_START(GLOB, uscm_flatten_map_icon_cooldown, FLATTEN_MAP_COOLDOWN_TIME) - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) if(!COOLDOWN_FINISHED(GLOB, xeno_flatten_map_icon_cooldown)) return FALSE COOLDOWN_START(GLOB, xeno_flatten_map_icon_cooldown, FLATTEN_MAP_COOLDOWN_TIME) @@ -488,8 +488,7 @@ SUBSYSTEM_DEF(minimaps) else if(client_mob.faction == FACTION_NEUTRAL && isobserver(client_mob)) faction_clients += client else if(isxeno(client_mob)) - var/mob/living/carbon/xenomorph/xeno = client_mob - if(xeno.hivenumber == faction) + if(client_mob.faction == faction) faction_clients += client // This may be unnecessary to do this way if the asset url is always the same as the lookup key @@ -502,7 +501,7 @@ SUBSYSTEM_DEF(minimaps) if(faction == FACTION_MARINE) GLOB.uscm_unannounced_map = new_flat - else //if(faction == XENO_HIVE_NORMAL) + else //if(faction == FACTION_XENOMORPH_NORMAL) GLOB.xeno_unannounced_map = new_flat return TRUE @@ -511,7 +510,7 @@ SUBSYSTEM_DEF(minimaps) * Globally stores svg coords for a given faction. * * Arguments: - * * faction: which faction to save the data for: FACTION_MARINE or XENO_HIVE_NORMAL + * * faction: which faction to save the data for: FACTION_MARINE or FACTION_XENOMORPH_NORMAL * * svg_coords: an array of coordinates corresponding to an svg. * * ckey: the ckey of the user who submitted this */ @@ -520,13 +519,13 @@ SUBSYSTEM_DEF(minimaps) if(faction == FACTION_MARINE) GLOB.uscm_svg_tacmap_data += svg_store_overlay - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) GLOB.xeno_svg_tacmap_data += svg_store_overlay else qdel(svg_store_overlay) debug_log("SVG coordinates for [faction] are not implemented!") -#define can_draw(faction, user) ((faction == FACTION_MARINE && skillcheck(user, SKILL_OVERWATCH, SKILL_OVERWATCH_TRAINED)) || (faction == XENO_HIVE_NORMAL && isqueen(user))) +#define can_draw(faction, user) ((faction == FACTION_MARINE && skillcheck(user, SKILL_OVERWATCH, SKILL_OVERWATCH_TRAINED)) || (faction == FACTION_XENOMORPH_NORMAL && isqueen(user))) /datum/controller/subsystem/minimaps/proc/fetch_tacmap_datum(zlevel, flags) var/hash = "[zlevel]-[flags]" @@ -763,11 +762,11 @@ SUBSYSTEM_DEF(minimaps) /datum/tacmap/drawing/tgui_interact(mob/user, datum/tgui/ui) var/mob/living/carbon/xenomorph/xeno = user var/is_xeno = istype(xeno) - var/faction = is_xeno ? xeno.hivenumber : user.faction - if(faction == FACTION_NEUTRAL && isobserver(user)) - faction = allowed_flags == MINIMAP_FLAG_XENO ? XENO_HIVE_NORMAL : FACTION_MARINE + var/datum/faction/faction = user.faction + if(isobserver(user)) + faction = allowed_flags == GLOB.faction_datums[MINIMAP_FLAG_XENO ? FACTION_XENOMORPH_NORMAL : FACTION_MARINE] - if(is_xeno && xeno.hive.see_humans_on_tacmap && targeted_ztrait != ZTRAIT_MARINE_MAIN_SHIP) + if(is_xeno && xeno.faction.see_humans_on_tacmap && targeted_ztrait != ZTRAIT_MARINE_MAIN_SHIP) allowed_flags |= MINIMAP_FLAG_USCM|MINIMAP_FLAG_WY|MINIMAP_FLAG_UPP|MINIMAP_FLAG_CLF targeted_ztrait = ZTRAIT_MARINE_MAIN_SHIP map_holder = null @@ -856,7 +855,7 @@ SUBSYSTEM_DEF(minimaps) data["isxeno"] = is_xeno data["canViewTacmap"] = is_xeno - data["canViewCanvas"] = faction == FACTION_MARINE || faction == XENO_HIVE_NORMAL + data["canViewCanvas"] = faction == FACTION_MARINE || faction == FACTION_XENOMORPH_NORMAL if(can_draw(faction, user)) data["canDraw"] = TRUE @@ -908,7 +907,7 @@ SUBSYSTEM_DEF(minimaps) var/faction = istype(xeno) ? xeno.hivenumber : user.faction var/is_observer = isobserver(user) if(faction == FACTION_NEUTRAL && is_observer) - faction = allowed_flags == MINIMAP_FLAG_XENO ? XENO_HIVE_NORMAL : FACTION_MARINE + faction = allowed_flags == MINIMAP_FLAG_XENO ? FACTION_XENOMORPH_NORMAL : FACTION_MARINE var/drawing_allowed = !is_observer && can_draw(faction, user) switch (action) @@ -965,7 +964,7 @@ SUBSYSTEM_DEF(minimaps) var/cooldown_satisfied = FALSE if(faction == FACTION_MARINE) cooldown_satisfied = COOLDOWN_FINISHED(GLOB, uscm_canvas_cooldown) - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) cooldown_satisfied = COOLDOWN_FINISHED(GLOB, xeno_canvas_cooldown) if(!cooldown_satisfied) msg_admin_niche("[key_name(user)] attempted to 'selectAnnouncement' the [faction] tacmap while it is still on cooldown!") @@ -980,7 +979,7 @@ SUBSYSTEM_DEF(minimaps) human_leader.visible_message(SPAN_BOLDNOTICE("Tactical map update in progress...")) playsound_client(human_leader.client, "sound/effects/data-transmission.ogg") notify_ghosts(header = "Tactical Map", message = "The USCM tactical map has been updated.", ghost_sound = "sound/effects/data-transmission.ogg", notify_volume = 80, action = NOTIFY_USCM_TACMAP, enter_link = "uscm_tacmap=1", enter_text = "View", source = owner) - else if(faction == XENO_HIVE_NORMAL) + else if(faction == FACTION_XENOMORPH_NORMAL) GLOB.xeno_flat_tacmap_data += new_current_map COOLDOWN_START(GLOB, xeno_canvas_cooldown, CANVAS_COOLDOWN_TIME) xeno_maptext("The Queen has updated our hive mind map", "We sense something unusual...", faction) @@ -1069,7 +1068,7 @@ SUBSYSTEM_DEF(minimaps) /// Gets the MINIMAP_FLAG for the provided faction or hivenumber if one exists /proc/get_minimap_flag_for_faction(faction) switch(faction) - if(XENO_HIVE_NORMAL) + if(FACTION_XENOMORPH_NORMAL) return MINIMAP_FLAG_XENO if(FACTION_MARINE) return MINIMAP_FLAG_USCM @@ -1087,7 +1086,7 @@ SUBSYSTEM_DEF(minimaps) return MINIMAP_FLAG_XENO_CORRUPTED if(XENO_HIVE_ALPHA) return MINIMAP_FLAG_XENO_ALPHA - if(XENO_HIVE_BRAVO) + if(FACTION_XENOMORPH_NORMAL) return MINIMAP_FLAG_XENO_BRAVO if(XENO_HIVE_CHARLIE) return MINIMAP_FLAG_XENO_CHARLIE @@ -1099,7 +1098,7 @@ SUBSYSTEM_DEF(minimaps) return MINIMAP_FLAG_XENO_TAMED if(XENO_HIVE_MUTATED) return MINIMAP_FLAG_XENO_MUTATED - if(XENO_HIVE_FORSAKEN) + if(FACTION_XENOMORPH_FORSAKEN) return MINIMAP_FLAG_XENO_FORSAKEN if(XENO_HIVE_YAUTJA) return MINIMAP_FLAG_YAUTJA diff --git a/code/controllers/subsystem/tracking.dm b/code/controllers/subsystem/tracking.dm index 4dcc5d5c4e29..bb43eb329e45 100644 --- a/code/controllers/subsystem/tracking.dm +++ b/code/controllers/subsystem/tracking.dm @@ -107,7 +107,5 @@ SUBSYSTEM_DEF(tracking) /datum/controller/subsystem/tracking/proc/initialize_trackers() setup_trackers(null, "marine_sl") - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - setup_trackers(null, "hive_[hive.hivenumber]") + for(var/tracking_faction in FACTION_LIST_XENOMORPH) + setup_trackers(null, "hive_[tracking_faction]") diff --git a/code/controllers/subsystem/who.dm b/code/controllers/subsystem/who.dm index 5f5510dc6489..61b693390cfc 100644 --- a/code/controllers/subsystem/who.dm +++ b/code/controllers/subsystem/who.dm @@ -122,8 +122,6 @@ SUBSYSTEM_DEF(who) counted_additional["uscm"]++ if(client_mob.job in (GLOB.ROLES_MARINES)) counted_additional["uscm_marines"]++ - else - counted_factions[client_mob.faction]++ //Bulky section with pre writen names and desc for counts factions_additional += list(list("content" = "In Lobby: [counted_additional["lobby"]]", "color" = "#777", "text" = "Player in lobby")) @@ -137,19 +135,17 @@ SUBSYSTEM_DEF(who) factions_additional += list(list("content" = "Infected Predators: [counted_additional["infected_preds"]]", "color" = "#7ABA19", "text" = "Players playing as Infected Yautja")) factions_additional += list(list("content" = "Hunted In Preserve: [counted_additional["hunted"]]", "color" = "#476816", "text" = "Players playing as hunted in preserve")) - for(var/i in 1 to length(counted_factions)) - if(!counted_factions[counted_factions[i]]) + for(var/faction_to_get in FACTION_LIST_HUMANOID - FACTION_YAUTJA - FACTION_MARINE) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - factions_additional += list(list("content" = "[counted_factions[i]]: [counted_factions[counted_factions[i]]]", "color" = "#2C7EFF", "text" = "Other")) + factions_additional += list(list("content" = "[faction]: [length(faction.total_mobs)]", "color" = faction.color, "text" = "[faction.desc]",)) - if(counted_factions[FACTION_NEUTRAL]) - factions_additional += list(list("content" = "[FACTION_NEUTRAL] Humans: [counted_factions[FACTION_NEUTRAL]]", "color" = "#688944", "text" = "Neutrals")) - - for(var/faction_to_get in ALL_XENO_HIVES) - var/datum/hive_status/hive = GLOB.hive_datum[faction_to_get] - if(!hive || !length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!faction || !length(faction.total_mobs)) continue - factions_additional += list(list("content" = "[hive.name]: [length(hive.totalXenos)]", "color" = hive.color ? hive.color : "#8200FF", "text" = "Queen: [hive.living_xeno_queen ? "Alive" : "Dead"]")) + factions_additional += list(list("content" = "[faction]: [length(faction.total_mobs)]", "color" = faction.color, "text" = "Queen: [faction.living_xeno_queen ? "Alive" : "Dead"]")) src.base_data = base_data src.admin_sorted_additional = admin_sorted_additional diff --git a/code/controllers/subsystem/x_evolution.dm b/code/controllers/subsystem/x_evolution.dm index e8f50b8af983..24fc0bf71d10 100644 --- a/code/controllers/subsystem/x_evolution.dm +++ b/code/controllers/subsystem/x_evolution.dm @@ -23,7 +23,7 @@ SUBSYSTEM_DEF(xevolution) /datum/controller/subsystem/xevolution/fire(resumed = FALSE) for(var/faction_to_get in FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(overridden_power[faction_to_get]) continue @@ -55,7 +55,7 @@ SUBSYSTEM_DEF(xevolution) return boost_power[faction_to_get] /datum/controller/subsystem/xevolution/proc/override_power(faction_to_get, power, override) - var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) boost_power[faction_to_get] = power overridden_power[faction_to_get] = override faction_module.update_burrowed_larva() diff --git a/code/datums/ammo/misc.dm b/code/datums/ammo/misc.dm index 2fc285227ef3..42c913835d69 100644 --- a/code/datums/ammo/misc.dm +++ b/code/datums/ammo/misc.dm @@ -297,7 +297,7 @@ name = "hugger shell" ping = null damage_type = BRUTE - var/hugger_hive = XENO_HIVE_NORMAL + var/hugger_hive = FACTION_XENOMORPH_NORMAL icon_state = "smoke_shell" damage = 15 diff --git a/code/datums/components/weed_damage_reduction.dm b/code/datums/components/weed_damage_reduction.dm index 3f05493a63df..8b48b3ffd731 100644 --- a/code/datums/components/weed_damage_reduction.dm +++ b/code/datums/components/weed_damage_reduction.dm @@ -1,7 +1,7 @@ /datum/component/weed_damage_mult dupe_mode = COMPONENT_DUPE_HIGHLANDER - var/hivenumber = XENO_HIVE_NORMAL + var/code_identificator = FACTION_XENOMORPH_NORMAL var/damage_mult = 1 var/static/list/signal_damage_types = list( COMSIG_MOB_TAKE_DAMAGE, @@ -11,12 +11,12 @@ var/glow_color = "#ff14ff" var/base_alpha = 110 -/datum/component/weed_damage_mult/Initialize(hivenumber, damage_mult, glow_color = "#ff14ff") +/datum/component/weed_damage_mult/Initialize(code_identificator, damage_mult, glow_color = "#ff14ff") if(!ismob(parent)) return COMPONENT_INCOMPATIBLE . = ..() - src.hivenumber = hivenumber + src.code_identificator = code_identificator src.damage_mult = damage_mult src.glow_color = glow_color @@ -39,7 +39,7 @@ if(!istype(T)) return - if(!T.weeds || T.weeds.hivenumber != hivenumber) + if(!T.weeds || T.weeds.faction.code_identificator != code_identificator) M.remove_filter("weed_damage_mult") return @@ -59,5 +59,5 @@ if(damages["damage"] <= 0) return - if(T.weeds && T.weeds.hivenumber == hivenumber) + if(T.weeds && T.weeds.faction.code_identificator == code_identificator) damages["damage"] *= damage_mult diff --git a/code/datums/components/weed_food.dm b/code/datums/components/weed_food.dm index 4c8d6112fde2..4fe41438a953 100644 --- a/code/datums/components/weed_food.dm +++ b/code/datums/components/weed_food.dm @@ -193,7 +193,7 @@ if(!is_ground_level(parent_mob.z)) return - var/datum/hive_status/hive = GLOB.hive_datum[XENO_HIVE_FORSAKEN] + var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_FORSAKEN] weed_appearance.color = hive.color /// SIGNAL_HANDLER for COMSIG_LIVING_PREIGNITION of weeds diff --git a/code/datums/construction/xenomorph/construction_template_xenomorph.dm b/code/datums/construction/xenomorph/construction_template_xenomorph.dm index 94914eb1e9ce..fd343f9e9ffd 100644 --- a/code/datums/construction/xenomorph/construction_template_xenomorph.dm +++ b/code/datums/construction/xenomorph/construction_template_xenomorph.dm @@ -106,7 +106,7 @@ if(stepped_turf.density) direction_to_put_nest = get_dir(stepped_turf, owner) return - xeno_message(SPAN_XENOWARNING("This structure needs to be built directly next to an vertical surface."), 7, XENO_HIVE_NORMAL) + xeno_message(SPAN_XENOWARNING("This structure needs to be built directly next to an vertical surface."), 7, FACTION_XENOMORPH_NORMAL) qdel(owner) qdel(src) diff --git a/code/datums/emergency_calls/forsaken_xenos.dm b/code/datums/emergency_calls/forsaken_xenos.dm index 1c876d4d4d44..72924cbbf20f 100644 --- a/code/datums/emergency_calls/forsaken_xenos.dm +++ b/code/datums/emergency_calls/forsaken_xenos.dm @@ -21,7 +21,7 @@ new_member.transfer_to(new_xeno, TRUE) - new_xeno.set_hive_and_update(XENO_HIVE_FORSAKEN) + new_xeno.set_hive_and_update(FACTION_XENOMORPH_FORSAKEN) new_xeno.lock_evolve = TRUE QDEL_NULL(current_mob) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index a6bd4c6cfdac..96edeacdb7d6 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -2,11 +2,13 @@ var/name = NAME_FACTION_NEUTRAL var/desc = "Neutral Faction" - var/code_identificator = "nfo" + var/code_identificator = FACTION_NEUTRAL var/faction_flags = NO_FLAGS var/hud_type = FACTION_HUD var/color = "#22888a" + var/faction_orders = "" + var/prefix = "" var/relations_pregen[] = RELATIONS_NEUTRAL var/datum/faction_module/relations/relations_datum @@ -28,10 +30,16 @@ var/latejoin_enabled = TRUE var/force_spawning = FALSE + var/list/datum/faction_module/faction_modules = list() + /datum/faction/New() relations_datum = new(src) GLOB.custom_event_info_list[code_identificator] = new /datum/custom_event_info(src, null, code_identificator) +/datum/faction/proc/get_faction_module(module_required) + if(module_required in faction_modules) + return faction_modules[module_required] + /datum/faction/proc/add_mob(mob/living/carbon/creature) if(!istype(creature)) return diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index 0653c394e498..a233d27aeb29 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -1,10 +1,12 @@ /datum/faction_module + var/module_code_identificator + + var/datum/faction/faction_owner /datum/faction_module/proc/add_mob(mob/living/carbon/creature) /datum/faction_module/hive_mind - /// Short Hive ID as string used in stats reporting - var/reporting_id = "normal" + var/module_code_identificator = FACTION_MODULE_HIVE_MIND var/mob/living/carbon/xenomorph/queen/living_xeno_queen var/egg_planting_range = 15 @@ -12,14 +14,12 @@ var/construction_allowed = NORMAL_XENO //Who can place construction nodes for special structures var/destruction_allowed = NORMAL_XENO //Who can destroy special structures var/unnesting_allowed = TRUE - var/hive_orders = "" //What orders should the hive have - var/prefix = "" var/queen_leader_limit = 2 var/list/open_xeno_leader_positions = list(1, 2) // Ordered list of xeno leader positions (indexes in xeno_leader_list) that are not occupied var/list/xeno_leader_list[2] // Ordered list (i.e. index n holds the nth xeno leader) var/stored_larva = 0 - ///used by /datum/hive_status/proc/increase_larva_after_burst() to support non-integer increases to larva + ///used by /datum/faction_module/hive_mind/proc/increase_larva_after_burst() to support non-integer increases to larva var/partial_larva = 0 /// Assoc list of free slots available to specific castes var/list/free_slots = list( @@ -33,8 +33,6 @@ var/list/tier_2_xenos = list() /// list of living tier3 xenos var/list/tier_3_xenos = list() - /// list of living xenos - var/list/totalXenos = list() /// list of previously living xenos (hardrefs currently) var/list/total_dead_xenos = list() var/xeno_queen_timer @@ -150,7 +148,7 @@ var/has_hatchery = FALSE /* -/datum/hive_status/New() +/datum/faction_module/hive_mind/New() hive_ui = new(src) mark_ui = new(src) faction_ui = new(src) @@ -164,7 +162,7 @@ LAZYINITLIST(used_hivebuffs) LAZYINITLIST(active_endgame_pylons) - if(hivenumber != XENO_HIVE_NORMAL) + if(hivenumber != FACTION_XENOMORPH_NORMAL) return if(!evolution_menu_images) @@ -174,17 +172,17 @@ RegisterSignal(SSdcs, COMSIG_GLOB_POST_SETUP, PROC_REF(post_setup)) */ ///Generate the image()'s requried for the evolution radial menu. -/datum/hive_status/proc/generate_evo_menu_images() +/datum/faction_module/hive_mind/proc/generate_evo_menu_images() for(var/datum/caste_datum/caste as anything in subtypesof(/datum/caste_datum)) evolution_menu_images[initial(caste.caste_type)] = image('icons/mob/xenos/radial_xenos.dmi', initial(caste.caste_type)) -/datum/hive_status/proc/post_setup() +/datum/faction_module/hive_mind/proc/post_setup() SIGNAL_HANDLER setup_evolution_announcements() setup_pylon_limits() -/datum/hive_status/proc/setup_evolution_announcements() +/datum/faction_module/hive_mind/proc/setup_evolution_announcements() for(var/time in GLOB.xeno_evolve_times) if(time == "0") continue @@ -192,10 +190,10 @@ addtimer(CALLBACK(src, PROC_REF(announce_evolve_available), GLOB.xeno_evolve_times[time]), text2num(time)) /// Sets up limits on pylons in New() for potential futureproofing with more static comms -/datum/hive_status/proc/setup_pylon_limits() +/datum/faction_module/hive_mind/proc/setup_pylon_limits() hive_structures_limit[XENO_STRUCTURE_PYLON] = length(GLOB.all_static_telecomms_towers) || 2 -/datum/hive_status/proc/announce_evolve_available(list/datum/caste_datum/available_castes) +/datum/faction_module/hive_mind/proc/announce_evolve_available(list/datum/caste_datum/available_castes) var/list/castes_available = list() for(var/datum/caste_datum/current_caste as anything in available_castes) @@ -208,77 +206,61 @@ // Adds a xeno to this hive /datum/faction_module/hive_mind/add_mob(mob/living/carbon/creature) - if(isqueen(X)) - if(!living_xeno_queen && !should_block_game_interaction(X)) // Don't consider xenos in admin level - set_living_xeno_queen(X) - X.set_faction(internal_faction) - - if(X.hud_list) - X.hud_update() - - var/area/A = get_area(X) - if(!should_block_game_interaction(X) || (A.flags_atom & AREA_ALLOW_XENO_JOIN)) - totalXenos += X - if(X.tier == 2) - tier_2_xenos += X - else if(X.tier == 3) - tier_3_xenos += X + if(isqueen(creature)) + if(!living_xeno_queen && !should_block_game_interaction(creature)) // Don't consider xenos in admin level + set_living_xeno_queen(creature) + + if(creature.hud_list) + creature.hud_update() + + var/area/creature_area = get_area(creature) + if(!should_block_game_interaction(creature) || (creature_area.flags_atom & AREA_ALLOW_XENO_JOIN)) + var/mob/living/carbon/xenomorph/zenomorph = creature + if(istype(zenomorph)) + if(zenomorph.tier == 2) + tier_2_xenos += creature + else if(zenomorph.tier == 3) + tier_3_xenos += creature // Xenos are a fuckfest of cross-dependencies of different datums that are initialized at different times // So don't even bother trying updating UI here without large refactors // Removes the xeno from the hive -/datum/hive_status/proc/remove_xeno(mob/living/carbon/xenomorph/xeno, hard = FALSE, light_mode = FALSE) - if(!xeno || !istype(xeno)) - return - - // Make sure the xeno was in the hive in the first place - if(!(xeno in totalXenos)) - return - +/datum/faction_module/hive_mind/remove_xeno(mob/living/carbon/creature, hard = FALSE, light_mode = FALSE) // This might be a redundant check now that Queen/Destroy() checks, but doesn't hurt to double check - if(living_xeno_queen == xeno) + if(living_xeno_queen == creature) var/mob/living/carbon/xenomorph/queen/next_queen = null - for(var/mob/living/carbon/xenomorph/queen/queen in totalXenos) + for(var/mob/living/carbon/xenomorph/queen/queen in faction_owner.total_mobs) if(!should_block_game_interaction(queen) && queen != src && !QDELETED(queen)) next_queen = queen break set_living_xeno_queen(next_queen) // either null or a queen - // We allow "soft" removals from the hive (the xeno still retains information about the hive) - // This is so that xenos can add themselves back to the hive if they should die or otherwise go "on leave" from the hive - if(hard) - xeno.hivenumber = 0 - xeno.hive = null -#ifndef UNIT_TESTS // Since this is a hard ref, we shouldn't confuse create_and_destroy - else - total_dead_xenos += xeno -#endif + var/mob/living/carbon/xenomorph/zenomorph = creature + if(istype(zenomorph)) + if(zenomorph.tier == 2) + tier_2_xenos -= creature + else if(zenomorph.tier == 3) + tier_3_xenos -= creature - totalXenos -= xeno - if(xeno.tier == 2) - tier_2_xenos -= xeno - else if(xeno.tier == 3) - tier_3_xenos -= xeno + // Only handle free slots if the xeno is not in tdome + if(!should_block_game_interaction(zenomorph)) + var/selected_caste = GLOB.xeno_datum_list[zenomorph.caste_type]?.type + if(used_slots[selected_caste]) + used_slots[selected_caste]-- - // Only handle free slots if the xeno is not in tdome - if(!should_block_game_interaction(xeno)) - var/selected_caste = GLOB.xeno_datum_list[xeno.caste_type]?.type - if(used_slots[selected_caste]) - used_slots[selected_caste]-- + if(!light_mode) + hive_ui.update_xeno_counts() + hive_ui.xeno_removed(zenomorph) - if(!light_mode) - hive_ui.update_xeno_counts() - hive_ui.xeno_removed(xeno) - -/datum/hive_status/proc/set_living_xeno_queen(mob/living/carbon/xenomorph/queen/queen) +/datum/faction_module/hive_mind/proc/set_living_xeno_queen(mob/living/carbon/xenomorph/queen/queen) if(!queen) - SStracking.delete_leader("hive_[hivenumber]") - SStracking.stop_tracking("hive_[hivenumber]", living_xeno_queen) + SStracking.delete_leader("hive_[faction_owner.code_identificator]") + SStracking.stop_tracking("hive_[faction_owner.code_identificator]", living_xeno_queen) SShive_status.wait = 10 SECONDS else - SStracking.set_leader("hive_[hivenumber]", queen) + SStracking.set_leader("hive_[faction_owner.code_identificator]", queen) SShive_status.wait = 2 SECONDS SEND_SIGNAL(src, COMSIG_HIVE_NEW_QUEEN, queen) @@ -286,7 +268,7 @@ recalculate_hive() -/datum/hive_status/proc/recalculate_hive() +/datum/faction_module/hive_mind/proc/recalculate_hive() //No leaders for a Hive without a Queen! queen_leader_limit = living_xeno_queen ? 4 : 0 @@ -304,7 +286,7 @@ hive_ui.update_all_data() -/datum/hive_status/proc/add_hive_leader(mob/living/carbon/xenomorph/xeno) +/datum/faction_module/hive_mind/proc/add_hive_leader(mob/living/carbon/xenomorph/xeno) if(!xeno) return FALSE //How did this even happen? if(!length(open_xeno_leader_positions)) @@ -325,7 +307,7 @@ hive_ui.update_xeno_keys() return TRUE -/datum/hive_status/proc/remove_hive_leader(mob/living/carbon/xenomorph/xeno, light_mode = FALSE) +/datum/faction_module/hive_mind/proc/remove_hive_leader(mob/living/carbon/xenomorph/xeno, light_mode = FALSE) if(!istype(xeno) || !IS_XENO_LEADER(xeno)) return FALSE @@ -357,7 +339,7 @@ return TRUE -/datum/hive_status/proc/replace_hive_leader(mob/living/carbon/xenomorph/original, mob/living/carbon/xenomorph/replacement) +/datum/faction_module/hive_mind/proc/replace_hive_leader(mob/living/carbon/xenomorph/original, mob/living/carbon/xenomorph/replacement) if(!replacement || replacement.hive_pos != NORMAL_XENO) return remove_hive_leader(original) @@ -377,7 +359,7 @@ hive_ui.update_xeno_keys() -/datum/hive_status/proc/handle_xeno_leader_pheromones() +/datum/faction_module/hive_mind/proc/handle_xeno_leader_pheromones() for(var/mob/living/carbon/xenomorph/L in xeno_leader_list) L.handle_xeno_leader_pheromones() @@ -387,7 +369,7 @@ */ // Returns a list of how many of each caste of xeno there are, sorted by tier -/datum/hive_status/proc/get_xeno_counts() +/datum/faction_module/hive_mind/proc/get_xeno_counts() // Every caste is manually defined here so you get var/list/xeno_counts = list( // Yes, Queen is technically considered to be tier 0 @@ -397,7 +379,7 @@ list(XENO_CASTE_BOILER = 0, XENO_CASTE_CRUSHER = 0, XENO_CASTE_PRAETORIAN = 0, XENO_CASTE_RAVAGER = 0) ) - for(var/mob/living/carbon/xenomorph/X in totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction_owner.total_mobs) //don't show xenos in the thunderdome when admins test stuff. if(should_block_game_interaction(X)) var/area/A = get_area(X) @@ -412,10 +394,10 @@ // Returns a sorted list of some basic info (stuff that's needed for sorting) about all the xenos in the hive // The idea is that we sort this list, and use it as a "key" for all the other information (especially the nicknumber) // in the hive status UI. That way we can minimize the amount of sorts performed by only calling this when xenos are created/disposed -/datum/hive_status/proc/get_xeno_keys() +/datum/faction_module/hive_mind/proc/get_xeno_keys() var/list/xenos = list() - for(var/mob/living/carbon/xenomorph/X in totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction_owner.total_mobs) if(should_block_game_interaction(X)) var/area/A = get_area(X) if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) @@ -446,7 +428,7 @@ // 2. Leaders // 3. Tier // It uses a slightly modified insertion sort to accomplish this -/datum/hive_status/proc/sort_xeno_keys(list/xenos) +/datum/faction_module/hive_mind/proc/sort_xeno_keys(list/xenos) if(!length(xenos)) return @@ -495,10 +477,10 @@ return sorted_list // Returns a list with some more info about all xenos in the hive -/datum/hive_status/proc/get_xeno_info() +/datum/faction_module/hive_mind/proc/get_xeno_info() var/list/xenos = list() - for(var/mob/living/carbon/xenomorph/X in totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction_owner.total_mobs) if(should_block_game_interaction(X)) var/area/A = get_area(X) if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) @@ -517,19 +499,19 @@ return xenos -/datum/hive_status/proc/set_hive_location(obj/effect/alien/resin/special/pylon/core/C) +/datum/faction_module/hive_mind/proc/set_hive_location(obj/effect/alien/resin/special/pylon/core/C) if(!C || C == hive_location) return var/area/A = get_area(C) - xeno_message(SPAN_XENOANNOUNCE("The Queen has set the hive location as \the [A]."), 3, hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The Queen has set the hive location as \the [A]."), 3, faction_owner) hive_location = C hive_ui.update_hive_location() // Returns a list of xeno healths and locations -/datum/hive_status/proc/get_xeno_vitals() +/datum/faction_module/hive_mind/proc/get_xeno_vitals() var/list/xenos = list() - for(var/mob/living/carbon/xenomorph/X in totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction_owner.total_mobs) if(should_block_game_interaction(X)) var/area/A = get_area(X) if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) @@ -557,7 +539,7 @@ #define GUARANTEED_SLOTS "guaranteed_slots" // Returns an assoc list of open slots and guaranteed slots left -/datum/hive_status/proc/get_tier_slots() +/datum/faction_module/hive_mind/proc/get_tier_slots() var/list/slots = list( TIER_3 = list( OPEN_SLOTS = 0, @@ -594,7 +576,7 @@ var/burrowed_factor = min(stored_larva, sqrt(4*stored_larva)) var/effective_total = floor(burrowed_factor) - for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in faction_owner.total_mobs) if(xeno.counts_for_slots) effective_total++ @@ -611,24 +593,24 @@ #undef OPEN_SLOTS #undef GUARANTEED_SLOTS -/datum/hive_status/proc/can_build_structure(structure_name) +/datum/faction_module/hive_mind/proc/can_build_structure(structure_name) if(!structure_name || !hive_structures_limit[structure_name]) return FALSE if(get_structure_count(structure_name) >= hive_structures_limit[structure_name]) return FALSE return TRUE -/datum/hive_status/proc/get_structure_count(structure_name) +/datum/faction_module/hive_mind/proc/get_structure_count(structure_name) return length(hive_structures[structure_name]) + length(hive_constructions[structure_name]) -/datum/hive_status/proc/has_structure(structure_name) +/datum/faction_module/hive_mind/proc/has_structure(structure_name) if(!structure_name) return FALSE if(LAZYLEN(hive_structures[structure_name])) return TRUE return FALSE -/datum/hive_status/proc/add_construction(obj/effect/alien/resin/construction/S) +/datum/faction_module/hive_mind/proc/add_construction(obj/effect/alien/resin/construction/S) if(!S || !S.template) return FALSE var/name_ref = initial(S.template.name) @@ -639,14 +621,14 @@ hive_constructions[name_ref] += src return TRUE -/datum/hive_status/proc/remove_construction(obj/effect/alien/resin/construction/S) +/datum/faction_module/hive_mind/proc/remove_construction(obj/effect/alien/resin/construction/S) if(!S || !S.template) return FALSE var/name_ref = initial(S.template.name) hive_constructions[name_ref] -= src return TRUE -/datum/hive_status/proc/add_special_structure(obj/effect/alien/resin/special/S) +/datum/faction_module/hive_mind/proc/add_special_structure(obj/effect/alien/resin/special/S) if(!S) return FALSE var/name_ref = initial(S.name) @@ -657,19 +639,19 @@ hive_structures[name_ref] += S return TRUE -/datum/hive_status/proc/remove_special_structure(obj/effect/alien/resin/special/S) +/datum/faction_module/hive_mind/proc/remove_special_structure(obj/effect/alien/resin/special/S) if(!S) return FALSE var/name_ref = initial(S.name) hive_structures[name_ref] -= S return TRUE -/datum/hive_status/proc/has_special_structure(name_ref) +/datum/faction_module/hive_mind/proc/has_special_structure(name_ref) if(!name_ref || !LAZYLEN(hive_structures[name_ref])) return 0 return length(hive_structures[name_ref]) -/datum/hive_status/proc/abandon_on_hijack() +/datum/faction_module/hive_mind/proc/abandon_on_hijack() var/area/hijacked_dropship = get_area(living_xeno_queen) var/shipside_humans_weighted_count = 0 var/xenos_count = 0 @@ -680,7 +662,7 @@ S.hijack_delete = TRUE hive_structures[name_ref] -= S qdel(S) - for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in faction_owner.total_mobs) if(get_area(xeno) != hijacked_dropship && xeno.loc && is_ground_level(xeno.loc.z)) if(isfacehugger(xeno) || islesserdrone(xeno)) to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) @@ -691,7 +673,7 @@ continue if(xeno.hunter_data.hunted && !isqueen(xeno)) to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, seperating you from her hive! You must defend yourself from the headhunter before you can enter hibernation...")) - xeno.set_hive_and_update(XENO_HIVE_FORSAKEN) + xeno.set_hive_and_update(FACTION_XENOMORPH_FORSAKEN) else to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) if(length(xeno.stomach_contents)) @@ -709,10 +691,10 @@ if(!is_ground_level(potential_host.z) || get_area(potential_host) == hijacked_dropship) continue var/obj/item/alien_embryo/A = locate() in potential_host - if(A && A.hivenumber != hivenumber) + if(A && A.faction_to_get != faction_owner) continue for(var/obj/item/alien_embryo/embryo in potential_host) - embryo.hivenumber = XENO_HIVE_FORSAKEN + embryo.faction_to_get = FACTION_XENOMORPH_FORSAKEN potential_host.update_med_icon() for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) @@ -726,21 +708,21 @@ hijack_burrowed_surge = TRUE hijack_burrowed_left = max(ceil(shipside_humans_weighted_count * 0.5) - xenos_count, 5) hivecore_cooldown = FALSE - xeno_message(SPAN_XENOBOLDNOTICE("The weeds have recovered! A new hive core can be built!"),3,hivenumber) + xeno_message(SPAN_XENOBOLDNOTICE("The weeds have recovered! A new hive core can be built!"), 3, faction_owner) // No buffs in hijack for(var/datum/hivebuff/buff in active_hivebuffs) buff._on_cease() -/datum/hive_status/proc/free_respawn(client/C) +/datum/faction_module/hive_mind/proc/free_respawn(client/C) stored_larva++ if(!hive_location || !hive_location.spawn_burrowed_larva(C.mob)) stored_larva-- else hive_ui.update_burrowed_larva() -/datum/hive_status/proc/respawn_on_turf(client/xeno_client, turf/spawning_turf) - var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber) +/datum/faction_module/hive_mind/proc/respawn_on_turf(client/xeno_client, turf/spawning_turf) + var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, faction_owner) if(isnull(new_xeno)) return FALSE @@ -757,17 +739,17 @@ hive_ui.update_burrowed_larva() -/datum/hive_status/proc/do_buried_larva_spawn(mob/xeno_candidate) +/datum/faction_module/hive_mind/proc/do_buried_larva_spawn(mob/xeno_candidate) var/spawning_area if(hive_location) spawning_area = hive_location else if(living_xeno_queen) spawning_area = living_xeno_queen - else for(var/mob/living/carbon/xenomorpheus as anything in totalXenos) + else for(var/mob/living/carbon/xenomorpheus in faction_owner.total_mobs) if(islarva(xenomorpheus) || isxeno_builder(xenomorpheus)) //next to xenos that should be in a safe spot spawning_area = xenomorpheus if(!spawning_area) - spawning_area = pick(totalXenos) // FUCK IT JUST GO ANYWHERE + spawning_area = pick(faction_owner.total_mobs) // FUCK IT JUST GO ANYWHERE var/list/turf_list for(var/turf/open/open_turf in orange(3, spawning_area)) if(istype(open_turf, /turf/open/space)) @@ -778,7 +760,7 @@ return FALSE var/turf/open/spawning_turf = pick(turf_list) - var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber) + var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, faction_owner) if(isnull(new_xeno)) return FALSE @@ -797,48 +779,20 @@ stored_larva-- hive_ui.update_burrowed_larva() -/mob/living/proc/ally_of_hivenumber(hivenumber) - var/datum/hive_status/indexed_hive = GLOB.hive_datum[hivenumber] - if(!indexed_hive) - return FALSE - - return indexed_hive.is_ally(src) - -/datum/hive_status/proc/is_ally(mob/living/living_mob) - if(isxeno(living_mob)) - var/mob/living/carbon/xenomorph/zenomorf = living_mob - if(zenomorf.hivenumber == hivenumber) - return !zenomorf.banished - - if(!living_mob.faction) - return FALSE - - return faction_is_ally(living_mob.faction) - -/datum/hive_status/proc/faction_is_ally(faction, ignore_queen_check = FALSE) - if(faction == internal_faction) - return TRUE - if(!ignore_queen_check && !living_xeno_queen) - return FALSE - - return allies[faction] - -/datum/hive_status/proc/can_delay_round_end(mob/living/carbon/xenomorph/xeno) +/datum/faction_module/hive_mind/proc/can_delay_round_end(mob/living/carbon/xenomorph/xeno) if(HAS_TRAIT(src, TRAIT_NO_HIVE_DELAY)) return FALSE return TRUE -/datum/hive_status/proc/update_hugger_limit() +/datum/faction_module/hive_mind/proc/update_hugger_limit() var/countable_xeno_iterator = 0 - for(var/mob/living/carbon/xenomorph/cycled_xeno as anything in totalXenos) + for(var/mob/living/carbon/xenomorph/cycled_xeno in faction_owner.total_mobs) if(cycled_xeno.counts_for_slots) countable_xeno_iterator++ playable_hugger_limit = max(floor(countable_xeno_iterator / playable_hugger_max_divisor), playable_hugger_minimum) -/datum/hive_status/proc/can_spawn_as_hugger(mob/dead/observer/user) - if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) - return FALSE +/datum/faction_module/hive_mind/proc/can_spawn_as_hugger(mob/dead/observer/user) if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) return FALSE @@ -849,23 +803,23 @@ var/time_left = floor((user.timeofdeath + JOIN_AS_FACEHUGGER_DELAY - world.time) / 10) to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a facehugger until 3 minutes have passed ([time_left] seconds remaining).")) return FALSE - if(length(totalXenos) <= 0) + if(!length(faction_owner.total_mobs)) //This is to prevent people from joining as Forsaken Huggers on the pred ship to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!")) return FALSE - for(var/mob_name in banished_ckeys) - if(banished_ckeys[mob_name] == user.ckey) - to_chat(user, SPAN_WARNING("You are banished from the [name], you may not rejoin unless the Queen re-admits you or dies.")) + for(var/mob_name in faction_owner.banished_ckeys) + if(faction_owner.banished_ckeys[mob_name] == user.ckey) + to_chat(user, SPAN_WARNING("You are banished from the [faction_owner], you may not rejoin unless the Queen re-admits you or dies.")) return FALSE update_hugger_limit() var/current_hugger_count = 0 - for(var/mob/mob as anything in totalXenos) + for(var/mob/mob as anything in faction_owner.total_mobs) if(isfacehugger(mob)) current_hugger_count++ if(playable_hugger_limit <= current_hugger_count) - to_chat(user, SPAN_WARNING("\The [GLOB.hive_datum[hivenumber]] cannot support more facehuggers! Limit: [current_hugger_count]/[playable_hugger_limit]")) + to_chat(user, SPAN_WARNING("\The [faction_owner] cannot support more facehuggers! Limit: [current_hugger_count]/[playable_hugger_limit]")) return FALSE if(tgui_alert(user, "Are you sure you want to become a facehugger?", "Confirmation", list("Yes", "No")) != "Yes") @@ -876,33 +830,30 @@ return TRUE -/datum/hive_status/proc/get_current_playable_facehugger_count() +/datum/faction_module/hive_mind/proc/get_current_playable_facehugger_count() var/count = 0 - for(var/mob/mob as anything in totalXenos) + for(var/mob/mob as anything in faction_owner.total_mobs) if(isfacehugger(mob)) count++ return count -/datum/hive_status/proc/spawn_as_hugger(mob/dead/observer/user, atom/A) - var/mob/living/carbon/xenomorph/facehugger/hugger = new /mob/living/carbon/xenomorph/facehugger(A.loc, null, hivenumber) +/datum/faction_module/hive_mind/proc/spawn_as_hugger(mob/dead/observer/user, atom/A) + var/mob/living/carbon/xenomorph/facehugger/hugger = new /mob/living/carbon/xenomorph/facehugger(A.loc, null, faction_owner) user.mind.transfer_to(hugger, TRUE) hugger.visible_message(SPAN_XENODANGER("A facehugger suddenly emerges out of \the [A]!"), SPAN_XENODANGER("You emerge out of \the [A] and awaken from your slumber. For the Hive!")) playsound(hugger, 'sound/effects/xeno_newlarva.ogg', 25, TRUE) hugger.generate_name() hugger.timeofdeath = user.timeofdeath // Keep old death time -/datum/hive_status/proc/update_lesser_drone_limit() +/datum/faction_module/hive_mind/proc/update_lesser_drone_limit() var/countable_xeno_iterator = 0 - for(var/mob/living/carbon/xenomorph/cycled_xeno as anything in totalXenos) + for(var/mob/living/carbon/xenomorph/cycled_xeno in faction_owner.total_mobs) if(cycled_xeno.counts_for_slots) countable_xeno_iterator++ lesser_drone_limit = max(floor(countable_xeno_iterator / playable_lesser_drones_max_divisor), lesser_drone_minimum) -/datum/hive_status/proc/can_spawn_as_lesser_drone(mob/dead/observer/user, obj/effect/alien/resin/special/pylon/spawning_pylon) - if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) - return FALSE - +/datum/faction_module/hive_mind/proc/can_spawn_as_lesser_drone(mob/dead/observer/user, obj/effect/alien/resin/special/pylon/spawning_pylon) if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) return FALSE @@ -912,7 +863,7 @@ to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a lesser drone until 30 seconds have passed ([time_left] seconds remaining).")) return FALSE - if(length(totalXenos) <= 0) + if(!length(faction_owner.total_mobs)) to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!")) return FALSE @@ -927,12 +878,12 @@ update_lesser_drone_limit() var/current_lesser_drone_count = 0 - for(var/mob/mob as anything in totalXenos) + for(var/mob/mob as anything in faction_owner.total_mobs) if(islesserdrone(mob)) current_lesser_drone_count++ if(lesser_drone_limit <= current_lesser_drone_count) - to_chat(user, SPAN_WARNING("[GLOB.hive_datum[hivenumber]] cannot support more lesser drones! Limit: [current_lesser_drone_count]/[lesser_drone_limit]")) + to_chat(user, SPAN_WARNING("[faction_owner] cannot support more lesser drones! Limit: [current_lesser_drone_count]/[lesser_drone_limit]")) return FALSE if(!user.client) @@ -941,15 +892,15 @@ return TRUE // Get amount of real xenos, don't count lessers/huggers -/datum/hive_status/proc/get_real_total_xeno_count() +/datum/faction_module/hive_mind/proc/get_real_total_xeno_count() var/count = 0 - for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in faction_owner.total_mobs) if(xeno.counts_for_slots) count++ return count // Checks if we hit larva limit -/datum/hive_status/proc/check_if_hit_larva_from_pylon_limit() +/datum/faction_module/hive_mind/proc/check_if_hit_larva_from_pylon_limit() var/groundside_humans_weighted_count = 0 for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) @@ -965,13 +916,13 @@ return hit_larva_pylon_limit ///Called by /obj/item/alien_embryo when a host is bursting to determine extra larva per burst -/datum/hive_status/proc/increase_larva_after_burst() +/datum/faction_module/hive_mind/proc/increase_larva_after_burst() var/extra_per_burst = CONFIG_GET(number/extra_larva_per_burst) partial_larva += extra_per_burst convert_partial_larva_to_full_larva() ///Called after times when partial larva are added to process them to stored larva -/datum/hive_status/proc/convert_partial_larva_to_full_larva() +/datum/faction_module/hive_mind/proc/convert_partial_larva_to_full_larva() for(var/i = 1 to partial_larva) partial_larva-- stored_larva++ diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index f85cf157c5b8..7ad35ffa4462 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -142,11 +142,11 @@ DEFINE_BITFIELD(iff_flag_flags, list( faction_to_get = FACTION_MARINE /obj/item/faction_tag/uscm/cmb - faction_to_get = FACTION_CMB + faction_to_get = FACTION_MARSHAL /obj/item/faction_tag/uscm/marsoc ally_factions_initialize = FALSE - faction_to_get = FACTION_MARSOC + faction_to_get = FACTION_CONTRACTOR /obj/item/faction_tag/wy faction_to_get = FACTION_WY diff --git a/code/datums/map_config.dm b/code/datums/map_config.dm index 2880b7b84d43..5e1749730679 100644 --- a/code/datums/map_config.dm +++ b/code/datums/map_config.dm @@ -60,7 +60,7 @@ var/list/monkey_types = list(/mob/living/carbon/human/monkey) - var/list/xvx_hives = list(XENO_HIVE_ALPHA = 0, XENO_HIVE_BRAVO = 0) + var/list/xvx_hives = list(XENO_HIVE_ALPHA = 0, FACTION_XENOMORPH_NORMAL = 0) var/vote_cycle = 1 diff --git a/code/datums/medal_awards.dm b/code/datums/medal_awards.dm index 772bdebbed23..c2be75f482e8 100644 --- a/code/datums/medal_awards.dm +++ b/code/datums/medal_awards.dm @@ -279,7 +279,7 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, XENO_SABOTAGE_MEDAL, XENO_PROLIFERATION_MEDAL, XENO_REJUVENATION_MEDAL)) -/proc/give_jelly_award(datum/hive_status/hive, as_admin = FALSE) +/proc/give_jelly_award(datum/faction/faction, as_admin = FALSE) if(!hive) return FALSE @@ -290,7 +290,7 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, var/list/possible_recipients = list() var/list/recipient_castes = list() var/list/recipient_mobs = list() - for(var/mob/living/carbon/xenomorph/xeno in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in faction.total_mobs + faction.total_dead_mobs) if(xeno.persistent_ckey == usr.persistent_ckey) // Don't award self continue if(xeno.tier == 0) // Don't award larva or facehuggers @@ -300,16 +300,7 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, recipient_castes[recipient_name] = xeno.caste_type recipient_mobs[recipient_name] = xeno possible_recipients += recipient_name - for(var/mob/living/carbon/xenomorph/xeno in hive.total_dead_xenos) - if(xeno.persistent_ckey == usr.persistent_ckey) // Don't award previous selves - continue - if(xeno.tier == 0) // Don't award larva or facehuggers - if(!as_admin || !isqueen(xeno)) // Don't award queens unless admin (She is tier 0 for whatever reason) - continue - var/recipient_name = xeno.real_name - recipient_castes[recipient_name] = xeno.caste_type - recipient_mobs[recipient_name] = xeno - possible_recipients += recipient_name + var/chosen_recipient = tgui_input_list(usr, "Who do you want to award jelly to?", "Jelly Recipient", possible_recipients, theme="hive_status") if(!chosen_recipient) return FALSE @@ -338,7 +329,7 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, var/recipient_ckey = recipient_mob.persistent_ckey var/posthumous = !isliving(recipient_mob) || recipient_mob.stat == DEAD if(!as_admin) // Don't need to check for giver mob in admin mode - for(var/mob/mob in hive.totalXenos) + for(var/mob/mob in hive.total_mobs) if(mob == usr) // Giver: Increment their medals given stat giver_mob = mob diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index c040bdf13fc2..73c0f4092c08 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -426,15 +426,14 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( revive_enabled = check_tod() && is_revivable() var/holder2_set = 0 - if(faction) - if(istype(faction, /datum/faction/xenomorph)) - holder4.icon_state = "hudalien" - - if(faction) - if(faction.color) - holder4.color = faction.color - if(faction.leading_cult_sl == src) - holder4.icon_state = "hudalien_leader" + if(istype(faction, /datum/faction/xenomorph)) + holder4.icon_state = "hudalien" + + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction.color) + holder4.color = faction.color + if(faction_module.leading_cult_sl == src) + holder4.icon_state = "hudalien_leader" if(status_flags & XENO_HOST) holder2.icon_state = "hudxeno"//Observer and admin HUD only diff --git a/code/datums/statistics/entities/round_stats.dm b/code/datums/statistics/entities/round_stats.dm index 79493ca87ef0..0f07de6e1b4d 100644 --- a/code/datums/statistics/entities/round_stats.dm +++ b/code/datums/statistics/entities/round_stats.dm @@ -318,8 +318,6 @@ total_xenos_created += S.value else if(S.name == FACTION_YAUTJA) total_predators_spawned += S.value - else if(S.name == FACTION_PREDALIEN) - total_predators_spawned += S.value else total_humans_created += S.value @@ -330,8 +328,6 @@ var/datum/entity/statistic/S = hijack_participants[statistic] if(S.name in FACTION_LIST_XENOMORPH) xeno_count_during_hijack += S.value - else if(S.name == FACTION_PREDALIEN) - xeno_count_during_hijack += S.value else if(S.name == FACTION_YAUTJA) continue else @@ -344,8 +340,6 @@ var/datum/entity/statistic/S = final_participants[statistic] if(S.name in FACTION_LIST_XENOMORPH) end_of_round_xenos += S.value - else if(S.name == FACTION_PREDALIEN) - end_of_round_xenos += S.value else if(S.name == FACTION_YAUTJA) continue else diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 164e3da6a1ff..22f48d9e58e0 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -41,7 +41,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) /// Count all larva across all hives for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) larva += faction_module.stored_larva /// Keeping track of peak numbers to determine when a side is "losing" diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 751e5b828684..8c9c1a4eb6d6 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -362,7 +362,7 @@ Additional game mode variables. //If we are selecting xenomorphs, we NEED them to play the round. This is the expected behavior. //If this is an optional behavior, just override this proc or make an override here. -/datum/game_mode/proc/initialize_starting_xenomorph_list(list/hives = list(XENO_HIVE_NORMAL), bypass_checks = FALSE) +/datum/game_mode/proc/initialize_starting_xenomorph_list(list/hives = list(FACTION_XENOMORPH_NORMAL), bypass_checks = FALSE) var/list/datum/mind/possible_xenomorphs = get_players_for_role(JOB_XENOMORPH) var/list/datum/mind/possible_queens = get_players_for_role(JOB_XENOMORPH_QUEEN) if(length(possible_xenomorphs) < xeno_required_num && !bypass_checks) //We don't have enough aliens, we don't consider people rolling for only Queen. @@ -471,7 +471,7 @@ Additional game mode variables. for(var/faction_to_get in FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.hardcore) continue if(!faction_module.stored_larva) @@ -574,7 +574,7 @@ Additional game mode variables. if(available_xenos[userInput]) //Free xeno mobs have no associated value and skip this. "Pooled larva" strings have a list of hives. var/datum/faction/faction = pick(available_xenos[userInput]) //The list contains all available hives if we are to choose at random, only one element if we already chose a hive by its name. - var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.stored_larva) if(!xeno_bypass_timer) var/deathtime = world.time - xeno_candidate.timeofdeath @@ -658,34 +658,31 @@ Additional game mode variables. to_chat(xeno_candidate, "JAS01: Something went wrong, tell a coder.") /datum/game_mode/proc/attempt_to_join_as_facehugger(mob/xeno_candidate) - //Step 1 - pick a Hive var/list/active_hives = list() - var/datum/hive_status/hive - var/last_active_hive = 0 - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(length(hive.totalXenos) <= 0) + var/datum/faction/faction + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - active_hives[hive.name] = hive.hivenumber - last_active_hive = hive.hivenumber + active_hives[faction.name] = faction - if(length(active_hives) <= 0) + if(!length(active_hives)) to_chat(xeno_candidate, SPAN_WARNING("There aren't any Hives active at this point for you to join.")) return FALSE if(length(active_hives) > 1) - var/hive_picked = tgui_input_list(xeno_candidate, "Select which Hive to attempt joining.", "Hive Choice", active_hives, theme="hive_status") + var/hive_picked = tgui_input_list(xeno_candidate, "Select which Hive to attempt joining.", "Hive Choice", active_hives, theme = "hive_status") if(!hive_picked) to_chat(xeno_candidate, SPAN_ALERT("Hive choice error. Aborting.")) return - hive = GLOB.hive_datum[active_hives[hive_picked]] + faction = active_hives[hive_picked] else - hive = GLOB.hive_datum[last_active_hive] + faction = active_hives[pick(active_hives)] //We have our Hive picked, time to figure out what we can join via var/list/available_facehugger_sources = list() - for(var/mob/living/carbon/xenomorph/carrier/carrier in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/carrier/carrier in hive.total_mobs) if(carrier.huggers_cur > carrier.huggers_reserved) var/area_name = get_area_name(carrier) var/descriptive_name = "[carrier.name] in [area_name]" @@ -726,16 +723,14 @@ Additional game mode variables. /datum/game_mode/proc/attempt_to_join_as_lesser_drone(mob/xeno_candidate) var/list/active_hives = list() - var/datum/hive_status/hive - var/last_active_hive = 0 - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(length(hive.totalXenos) <= 0) + var/datum/faction/faction + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - active_hives[hive.name] = hive.hivenumber - last_active_hive = hive.hivenumber + active_hives[faction.name] = faction - if(length(active_hives) <= 0) + if(!length(active_hives)) to_chat(xeno_candidate, SPAN_WARNING("There aren't any Hives active at this point for you to join.")) return FALSE @@ -744,23 +739,24 @@ Additional game mode variables. if(!hive_picked) to_chat(xeno_candidate, SPAN_ALERT("Hive choice error. Aborting.")) return FALSE - hive = GLOB.hive_datum[active_hives[hive_picked]] + faction = active_hives[hive_picked] else - hive = GLOB.hive_datum[last_active_hive] + faction = active_hives[pick(active_hives)] - for(var/mob_name in hive.banished_ckeys) - if(hive.banished_ckeys[mob_name] == xeno_candidate.ckey) - to_chat(xeno_candidate, SPAN_WARNING("You are banished from the [hive], you may not rejoin unless the Queen re-admits you or dies.")) + for(var/mob_name in faction.banished_ckeys) + if(faction.banished_ckeys[mob_name] == xeno_candidate.ckey) + to_chat(xeno_candidate, SPAN_WARNING("You are banished from the [faction], you may not rejoin unless the Queen re-admits you or dies.")) return FALSE var/list/selection_list = list() var/list/selection_list_structure = list() - if(hive.hive_location?.lesser_drone_spawns >= 1) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.hive_location?.lesser_drone_spawns >= 1) selection_list += "hive core" - selection_list_structure += hive.hive_location + selection_list_structure += faction_module.hive_location - for(var/obj/effect/alien/resin/special/pylon/cycled_pylon as anything in hive.hive_structures[XENO_STRUCTURE_PYLON]) + for(var/obj/effect/alien/resin/special/pylon/cycled_pylon as anything in faction_module.hive_structures[XENO_STRUCTURE_PYLON]) if(cycled_pylon.lesser_drone_spawns >= 1) var/pylon_number = 1 var/pylon_name = "[cycled_pylon.name] at [get_area(cycled_pylon)]" @@ -831,7 +827,7 @@ Additional game mode variables. return TRUE /// Pick and setup a queen spawn from landmarks, then spawns the player there alongside any required setup -/datum/game_mode/proc/pick_queen_spawn(mob/player, hivenumber = XENO_HIVE_NORMAL) +/datum/game_mode/proc/pick_queen_spawn(mob/player, hivenumber = FACTION_XENOMORPH_NORMAL) RETURN_TYPE(/turf) var/datum/mind/ghost_mind = player.mind var/mob/living/original = ghost_mind.current @@ -879,7 +875,7 @@ Additional game mode variables. transform_queen(ghost_mind, QS, hivenumber) return QS -/datum/game_mode/proc/transform_queen(datum/mind/ghost_mind, turf/xeno_turf, hivenumber = XENO_HIVE_NORMAL) +/datum/game_mode/proc/transform_queen(datum/mind/ghost_mind, turf/xeno_turf, hivenumber = FACTION_XENOMORPH_NORMAL) var/mob/living/original = ghost_mind.current var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] if(hive.living_xeno_queen || !original || !original.client) diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 032b352b97f7..8a6d87707229 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -382,7 +382,7 @@ if(!round_finished) for(var/faction_to_get in FACTION_LIST_ALL) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!faction_module.xeno_queen_timer) continue @@ -420,12 +420,12 @@ if(!evolution_ovipositor_threshold && world.time >= SSticker.round_start_time + round_time_evolution_ovipositor) for(var/faction_to_get in FACTION_LIST_ALL) - var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) if(!faction_module.xeno_queen_timer) continue faction_module.evolution_without_ovipositor = FALSE if(faction_module.living_xeno_queen && !faction_module.living_xeno_queen.ovipositor) - to_chat(hive.living_xeno_queen, SPAN_XENODANGER("It is time to settle down and let your children grow.")) + to_chat(faction_module.living_xeno_queen, SPAN_XENODANGER("It is time to settle down and let your children grow.")) evolution_ovipositor_threshold = TRUE msg_admin_niche("Xenomorphs now require the queen's ovipositor for evolution progress.") @@ -531,12 +531,12 @@ return . // Ensure there is no queen - var/datum/hive_status/hive - for(var/cur_number in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_number] - if(hive.need_round_end_check && !hive.can_delay_round_end()) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(faction.need_round_end_check && !faction.can_delay_round_end()) continue - if(hive.living_xeno_queen && !should_block_game_interaction(hive.living_xeno_queen.loc)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen && !should_block_game_interaction(faction_module.living_xeno_queen.loc)) //Some Queen is alive, we shouldn't end the game yet .[2]++ return . @@ -556,11 +556,11 @@ if(round_finished) return - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) var/datum/faction/current_faction = GLOB.faction_datums[faction_to_get] if(current_faction.need_round_end_check && !current_faction.can_delay_round_end()) continue - var/datum/faction_module/hive_mind/faction_module = current_faction.get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = current_faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.living_xeno_queen && !should_block_game_interaction(faction_module.living_xeno_queen.loc)) return @@ -692,11 +692,11 @@ var/list/counted_xenos = list() //organize our hives and castes in a readable and standard way | don't forget our pooled larva - for(var/hive in ALL_XENO_HIVES) - counted_xenos[hive] = list() + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + counted_xenos[faction_to_get] = list() for(var/caste in ALL_XENO_CASTES) - counted_xenos[hive][caste] = 0 - counted_xenos[hive]["Pooled Larva"] = GLOB.hive_datum[hive].stored_larva + counted_xenos[faction_to_get][caste] = 0 + counted_xenos[faction_to_get]["Pooled Larva"] = GLOB.faction_datums[faction_to_get].stored_larva //Run through all our clients //add up our marines by job type, surv numbers, and non-standard humans we don't care too much about @@ -713,7 +713,7 @@ counted_humans["Non-Standard Humans"][player_client.mob.job]++ else if(isxeno(player_client.mob)) var/mob/living/carbon/xenomorph/xeno = player_client.mob - counted_xenos[xeno.hivenumber][xeno.caste_type]++ + counted_xenos[xeno.faction.code_identificator][xeno.caste_type]++ var/list/total_data = list("special round status" = special_round_status, "round time" = duration2text(), "counted humans" = counted_humans, "counted xenos" = counted_xenos) running_round_stats = running_round_stats + list(total_data) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm index 68b2a51e76e7..6d834cf23f38 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm @@ -7,7 +7,7 @@ if(!istype(wave_data)) return - var/datum/hive_status/hive = GLOB.hive_datum[XENO_HIVE_NORMAL] + var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] if(hive.slashing_allowed != XENO_SLASH_ALLOWED) hive.slashing_allowed = XENO_SLASH_ALLOWED //Allows harm intent for aliens var/xenos_to_spawn diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index 4f9fdac4a4cc..127cbff90e50 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -128,7 +128,7 @@ C.hardcore = TRUE // This'll make losing the hive core more detrimental than losing a Queen hive_cores += C -/datum/game_mode/xenovs/proc/transform_xeno(datum/mind/ghost_mind, turf/xeno_turf, hivenumber = XENO_HIVE_NORMAL, should_spawn_nest = TRUE) +/datum/game_mode/xenovs/proc/transform_xeno(datum/mind/ghost_mind, turf/xeno_turf, hivenumber = FACTION_XENOMORPH_NORMAL, should_spawn_nest = TRUE) if(should_spawn_nest) var/mob/living/carbon/human/original = ghost_mind.current @@ -158,7 +158,7 @@ var/mob/living/carbon/xenomorph/larva/L = new(xeno_turf, null, hivenumber) ghost_mind.transfer_to(L) -/datum/game_mode/xenovs/pick_queen_spawn(mob/player, hivenumber = XENO_HIVE_NORMAL) +/datum/game_mode/xenovs/pick_queen_spawn(mob/player, hivenumber = FACTION_XENOMORPH_NORMAL) . = ..() if(!.) return // Spawn additional hive structures diff --git a/code/game/jobs/job/antag/xeno/xenomorph.dm b/code/game/jobs/job/antag/xeno/xenomorph.dm index eeca16bc7f90..be5d83a6d6ae 100644 --- a/code/game/jobs/job/antag/xeno/xenomorph.dm +++ b/code/game/jobs/job/antag/xeno/xenomorph.dm @@ -23,7 +23,7 @@ . = ..() var/mob/living/carbon/human/H = . - transform_to_xeno(H, XENO_HIVE_NORMAL) + transform_to_xeno(H, FACTION_XENOMORPH_NORMAL) /datum/job/antag/xenos/proc/transform_to_xeno(mob/living/carbon/human/human_to_transform, hive_index) var/datum/mind/new_xeno = human_to_transform.mind diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 5aa5f893661e..228f6df5312f 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -258,7 +258,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou unassigned_players = null // Now we take spare unfilled xeno slots and make them larva NEW - var/datum/hive_status/hive = GLOB.hive_datum[XENO_HIVE_NORMAL] + var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] if(istype(hive) && istype(XJ)) hive.stored_larva += max(0, (XJ.total_positions - XJ.current_positions) \ + (XJ.calculate_extra_spawn_positions(alternate_option_assigned))) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index c845253f480d..ff9e094db147 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -47,7 +47,7 @@ mouse_opacity = MOUSE_OPACITY_TRANSPARENT var/datum/cause_data/cause_data - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/stun_duration = 1 var/damage_amount = 20 @@ -531,7 +531,7 @@ var/damage = 20 var/message = null var/mob/living/carbon/xenomorph/linked_xeno = null - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/empowered = FALSE /obj/effect/xenomorph/acid_damage_delay/New(loc, damage = 20, delay = 10, empowered = FALSE, message = null, mob/living/carbon/xenomorph/linked_xeno = null) diff --git a/code/game/objects/effects/effect_system/smoke.dm b/code/game/objects/effects/effect_system/smoke.dm index c64ff9a087df..b1a23e8645ca 100644 --- a/code/game/objects/effects/effect_system/smoke.dm +++ b/code/game/objects/effects/effect_system/smoke.dm @@ -503,7 +503,7 @@ spread_speed = 6 smokeranking = SMOKE_RANK_BOILER - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/gas_damage = 20 /obj/effect/particle_effect/smoke/xeno_burn/Initialize(mapload, amount, datum/cause_data/cause_data) diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index a38c7a89b56d..dc4dfe574501 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -16,16 +16,17 @@ var/resisting_ready = 0 var/nest_resist_time = 1200 var/mob/dead/observer/ghost_of_buckled_mob = null - var/hivenumber = XENO_HIVE_NORMAL var/force_nest = FALSE -/obj/structure/bed/nest/Initialize(mapload, hive) + var/faction_to_get = FACTION_XENOMORPH_NORMAL + +/obj/structure/bed/nest/Initialize(mapload, _faction_to_get) . = ..() - if (hive) - hivenumber = hive + if(_faction_to_get) + faction_to_get = _faction_to_get - set_hive_data(src, hivenumber) + set_hive_data(src, GLOB.faction_datums[faction_to_get]) buckling_y = list("[NORTH]" = 27, "[SOUTH]" = -19, "[EAST]" = 3, "[WEST]" = 3) buckling_x = list("[NORTH]" = 0, "[SOUTH]" = 0, "[EAST]" = 18, "[WEST]" = -17) @@ -79,11 +80,11 @@ /obj/structure/bed/nest/alpha color = "#ff4040" - hivenumber = XENO_HIVE_ALPHA + faction_to_get = FACTION_XENOMORPH_ALPHA /obj/structure/bed/nest/forsaken color = "#cc8ec4" - hivenumber = XENO_HIVE_FORSAKEN + faction_to_get = FACTION_XENOMORPH_FORSAKEN /obj/structure/bed/nest/attackby(obj/item/W, mob/living/user) if(istype(W, /obj/item/grab)) @@ -97,7 +98,7 @@ return if(iscarbon(user)) var/mob/living/carbon/carbon = user - if(HIVE_ALLIED_TO_HIVE(carbon.hivenumber, hivenumber)) + if(carbon.ally_faction(GLOB.faction_datums[faction_to_get])) to_chat(user, SPAN_XENOWARNING("We shouldn't interfere with the nest, leave that to the drones.")) return if(buckled_mob) @@ -148,12 +149,12 @@ if(isxeno(user)) var/mob/living/carbon/xenomorph/X = user - if(!X.hive.unnesting_allowed && !isxeno_builder(X) && HIVE_ALLIED_TO_HIVE(X.hivenumber, hivenumber)) + if(!X.faction.unnesting_allowed && !isxeno_builder(X) && X.ally_faction(GLOB.faction_datums[faction_to_get])) to_chat(X, SPAN_XENOWARNING("We shouldn't interfere with the nest, leave that to the drones.")) return else if(iscarbon(user)) var/mob/living/carbon/H = user - if(HIVE_ALLIED_TO_HIVE(H.hivenumber, hivenumber)) + if(H.ally_faction(GLOB.faction_datums[faction_to_get])) to_chat(H, SPAN_XENOWARNING("We shouldn't interfere with the nest, leave that to the drones.")) return diff --git a/code/game/turfs/walls/wall_types.dm b/code/game/turfs/walls/wall_types.dm index f88498114ff0..15589c3f408c 100644 --- a/code/game/turfs/walls/wall_types.dm +++ b/code/game/turfs/walls/wall_types.dm @@ -724,7 +724,7 @@ blend_turfs = list(/turf/closed/wall/resin) blend_objects = list(/obj/structure/mineral_door/resin) repair_materials = list() - var/hivenumber = XENO_HIVE_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/should_track_build = FALSE var/datum/cause_data/construction_data turf_flags = TURF_ORGANIC @@ -735,7 +735,7 @@ for(var/obj/effect/alien/weeds/node/weed_node in contents) qdel(weed_node) - if(hivenumber == XENO_HIVE_NORMAL) + if(faction_to_get == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) if(!hull) @@ -755,8 +755,8 @@ /turf/closed/wall/resin/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + faction_to_get = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, faction_to_get) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -791,7 +791,7 @@ /turf/closed/wall/resin/tutorial name = "tutorial resin wall" desc = "Weird slime solidified into a wall. Remarkably resilient." - hivenumber = XENO_HIVE_TUTORIAL + faction_to_get = XENO_HIVE_TUTORIAL /turf/closed/wall/resin/tutorial/attack_alien(mob/living/carbon/xenomorph/xeno) return @@ -809,9 +809,7 @@ if(!istype(X)) return FALSE - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - - return hive.is_ally(X) + return X.ally_faction(GLOB.faction_datums[faction_to_get]) /turf/closed/wall/resin/membrane/initialize_pass_flags(datum/pass_flags_container/PF) ..() @@ -952,13 +950,13 @@ drag_delay = 4 - var/hivenumber = XENO_HIVE_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL -/obj/structure/alien/movable_wall/Initialize(mapload, hive) +/obj/structure/alien/movable_wall/Initialize(mapload, _faction_to_get) . = ..() - if(hive) - hivenumber = hive - set_hive_data(src, hive) + if(_faction_to_get) + faction_to_get = _faction_to_get + set_hive_data(src, faction_to_get) recalculate_structure() update_tied_turf(loc) RegisterSignal(src, COMSIG_ATOM_TURF_CHANGE, PROC_REF(update_tied_turf)) @@ -1024,7 +1022,7 @@ M.visible_message(SPAN_XENONOTICE("\The [M] claws \the [src]!"), \ SPAN_XENONOTICE("You claw \the [src].")) playsound(src, "alien_resin_break", 25) - if (M.hivenumber == hivenumber) + if (M.faction.code_identificator == faction_to_get) take_damage(ceil(HEALTH_WALL_XENO * 0.25)) //Four hits for a regular wall else take_damage(M.melee_damage_lower*RESIN_XENO_DAMAGE_MULTIPLIER) @@ -1095,7 +1093,7 @@ if(isxeno(mover)) var/mob/living/carbon/xenomorph/X = mover - if(X.hivenumber != hivenumber || X.throwing) + if(X.faction.code_identificator != faction_to_get || X.throwing) return if(X.pulling == src) @@ -1240,7 +1238,7 @@ M.visible_message(SPAN_XENONOTICE("\The [M] claws \the [src]!"), \ SPAN_XENONOTICE("We claw \the [src].")) playsound(src, "alien_resin_break", 25) - if (M.hivenumber == hivenumber) + if (M.faction.code_identificator == faction_to_get) take_damage(ceil(HEALTH_WALL_XENO * 0.25)) //Four hits for a regular wall else take_damage(M.melee_damage_lower*RESIN_XENO_DAMAGE_MULTIPLIER) diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 9741b676a6d1..b4bf1055eff9 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -473,28 +473,22 @@ if(!check_rights(R_ADMIN)) return - // Mostly replicated code from observer.dm.hive_status() - var/list/hives = list() - var/datum/hive_status/last_hive_checked - - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(length(hive.totalXenos) > 0 || length(hive.total_dead_xenos) > 0) - hives += list("[hive.name]" = hive.hivenumber) - last_hive_checked = hive - - if(!length(hives)) + var/list/datum/faction/factions = list() + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] + if(!length(faction_to_set.total_mobs) && !length(faction_to_set.total_dead_mobs)) + continue + LAZYSET(factions, faction_to_set.name, faction_to_set) + + if(!length(factions)) to_chat(src, SPAN_ALERT("There seem to be no hives at the moment.")) return - else if(length(hives) > 1) // More than one hive, display an input menu for that - var/faction = tgui_input_list(src, "Select which hive to award", "Hive Choice", hives, theme="hive_status") - if(!faction) - to_chat(src, SPAN_ALERT("Hive choice error. Aborting.")) - return - last_hive_checked = GLOB.hive_datum[hives[faction]] - give_jelly_award(last_hive_checked, as_admin=TRUE) + var/choice = tgui_input_list(src, "Select which hive to award", "Hive Choice", factions, theme = "hive_status") + if(!choice) + return + + give_jelly_award(factions[choice], as_admin = TRUE) /client/proc/give_nuke() if(!check_rights(R_ADMIN)) diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 5751db80dd30..1e81f61144d7 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -172,11 +172,11 @@ message_admins("[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") var/mob/transformed - var/hivenumber = XENO_HIVE_NORMAL + var/datum/faction/faction = GLOG.faction_datums[FACTION_XENOMORPH_NORMAL] if(isxeno(M)) var/mob/living/carbon/xenomorph/X = M - hivenumber = X.hivenumber + faction = X.faction switch(href_list["simplemake"]) if("observer") transformed = M.change_mob_type( /mob/dead/observer , null, null, delmob ) @@ -215,9 +215,9 @@ if("parrot") transformed = M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob ) if("polyparrot") transformed = M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob ) - if(isxeno(transformed) && hivenumber) + if(isxeno(transformed)) var/mob/living/carbon/xenomorph/X = transformed - X.set_hive_and_update(hivenumber) + X.set_hive_and_update(faction) /////////////////////////////////////new ban stuff else if(href_list["unbanf"]) diff --git a/code/modules/admin/topic/topic_teleports.dm b/code/modules/admin/topic/topic_teleports.dm index 5906eae6202b..8a5e3596db7f 100644 --- a/code/modules/admin/topic/topic_teleports.dm +++ b/code/modules/admin/topic/topic_teleports.dm @@ -106,7 +106,7 @@ if(!choice) return - var/list/targets = factions[choice].totalMobs + var/list/targets = factions[choice].total_mobs for(var/mob/living/carbon/mob in targets) var/area/area = get_area(mob) if(mob.stat == DEAD || area.statistic_exempt) @@ -116,7 +116,7 @@ to_chat(owner, SPAN_ALERT("No alive mobs of [choice] faction were found. Aborting.")) return - if(alert(owner, "[length(targets)] mobs of [choice] faction were marked for teleportation. Pressing \"TELEPORT\" will teleport them to your location at the moment of pressing button.", owner.auto_lang(LANGUAGE_CONFIRM), owner.auto_lang(LANGUAGE_YES), owner.auto_lang(LANGUAGE_NO)) != owner.auto_lang(LANGUAGE_YES)) + if(alert(owner, "[length(targets)] mobs of [choice] faction were marked for teleportation. Pressing \"TELEPORT\" will teleport them to your location at the moment of pressing button.", "Confirm", "yes", "No") != "Yes") return for(var/mob/mob in targets) diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index 14be0dd2d117..c013f9716236 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -157,14 +157,14 @@ layer = RESIN_STRUCTURE_LAYER plane = FLOOR_PLANE var/slow_amt = 8 - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL /obj/effect/alien/resin/sticky/Initialize(mapload, hive) . = ..() if (hive) hivenumber = hive set_hive_data(src, hivenumber) - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) /obj/effect/alien/resin/sticky/Crossed(atom/movable/AM) @@ -181,8 +181,8 @@ /obj/effect/alien/resin/sticky/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + hivenumber = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -196,7 +196,7 @@ health = HEALTH_RESIN_XENO_SPIKE layer = RESIN_STRUCTURE_LAYER should_track_build = TRUE - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/damage = 8 var/penetration = 50 @@ -213,7 +213,7 @@ hivenumber = hive set_hive_data(src, hivenumber) setDir(pick(GLOB.alldirs)) - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) /obj/effect/alien/resin/spike/Crossed(atom/movable/AM) @@ -231,8 +231,8 @@ /obj/effect/alien/resin/spike/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + hivenumber = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -359,13 +359,14 @@ hardness = 1.5 health = HEALTH_DOOR_XENO var/close_delay = 100 - var/hivenumber = XENO_HIVE_NORMAL + + var/faction_to_get = FACTION_XENOMORPH_NORMAL flags_obj = OBJ_ORGANIC layer = DOOR_CLOSED_LAYER tiles_with = list(/obj/structure/mineral_door/resin) -/obj/structure/mineral_door/resin/Initialize(mapload, hive) +/obj/structure/mineral_door/resin/Initialize(mapload, _faction_to_get) . = ..() relativewall() relativewall_neighbours() @@ -378,7 +379,7 @@ set_hive_data(src, hivenumber) - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) var/area/area = get_area(src) @@ -540,8 +541,8 @@ /obj/structure/mineral_door/resin/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + hivenumber = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) /obj/structure/mineral_door/resin/thick @@ -558,7 +559,7 @@ icon_state = "acid_pillar_idle" health = HEALTH_RESIN_XENO_ACID_PILLAR - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL should_track_build = TRUE anchored = TRUE @@ -575,7 +576,7 @@ hivenumber = hive set_hive_data(src, hivenumber) START_PROCESSING(SSprocessing, src) - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) @@ -697,7 +698,7 @@ pixel_y = -16 health = HEALTH_RESIN_XENO_SHIELD_PILLAR - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL anchored = TRUE var/decay_rate = AMOUNT_PER_TIME(1, 10 SECONDS) @@ -881,7 +882,7 @@ /// The mob picked as a candidate to be the King var/client/chosen_candidate /// The hive associated with this cocoon - var/hive_number = XENO_HIVE_NORMAL + var/hive_number = FACTION_XENOMORPH_NORMAL /// Whether the cocoon has hatched var/hatched = FALSE /// Current running timer @@ -1238,7 +1239,7 @@ var/can_prime = FALSE - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL /obj/item/explosive/grenade/alien/Initialize(mapload, hivenumber) . = ..() @@ -1310,7 +1311,7 @@ // Which direction is the explosion traveling? // Note that this will be null for the epicenter - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/source var/direction = null var/range = 0 diff --git a/code/modules/cm_aliens/structures/egg.dm b/code/modules/cm_aliens/structures/egg.dm index 698765d4edd0..6f376de2717a 100644 --- a/code/modules/cm_aliens/structures/egg.dm +++ b/code/modules/cm_aliens/structures/egg.dm @@ -14,7 +14,7 @@ var/list/egg_triggers = list() var/status = EGG_GROWING //can be EGG_GROWING, EGG_GROWN, EGG_BURST, EGG_BURSTING, or EGG_DESTROYED; all mutually exclusive var/on_fire = FALSE - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/flags_embryo = NO_FLAGS /// The weed strength that needs to be maintained in order for this egg to not decay; null disables check var/weed_strength_required = WEED_LEVEL_HIVE @@ -27,7 +27,7 @@ if(hive) hivenumber = hive - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) set_hive_data(src, hivenumber) @@ -45,8 +45,8 @@ /obj/effect/alien/egg/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + hivenumber = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -325,7 +325,7 @@ hivenumber = XENO_HIVE_ALPHA /obj/effect/alien/egg/forsaken - hivenumber = XENO_HIVE_FORSAKEN + hivenumber = FACTION_XENOMORPH_FORSAKEN /obj/effect/alien/egg/attack_ghost(mob/dead/observer/user) . = ..() //Do a view printout as needed just in case the observer doesn't want to join as a Hugger but wants info @@ -460,7 +460,7 @@ SPECIAL EGG USED WHEN WEEDS LOST if(isnull(weed_strength_required)) return . - if(hivenumber != XENO_HIVE_FORSAKEN) + if(hivenumber != FACTION_XENOMORPH_FORSAKEN) life_timer = addtimer(CALLBACK(src, PROC_REF(start_unstoppable_decay)), ORPHAN_EGG_MAXIMUM_LIFE, TIMER_STOPPABLE) var/my_turf = get_turf(src) diff --git a/code/modules/cm_aliens/structures/fruit.dm b/code/modules/cm_aliens/structures/fruit.dm index b2a0fd27d65b..3f04ed66b96e 100644 --- a/code/modules/cm_aliens/structures/fruit.dm +++ b/code/modules/cm_aliens/structures/fruit.dm @@ -11,7 +11,7 @@ health = 25 layer = BUSH_LAYER // technically a plant amiright var/picked = FALSE - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/consume_delay = 2 SECONDS var/mature = FALSE var/flags = 0 diff --git a/code/modules/cm_aliens/structures/special_structure.dm b/code/modules/cm_aliens/structures/special_structure.dm index 83ca09547185..8e2761837882 100644 --- a/code/modules/cm_aliens/structures/special_structure.dm +++ b/code/modules/cm_aliens/structures/special_structure.dm @@ -29,7 +29,7 @@ if(hive_ref) linked_hive = hive_ref else - linked_hive = GLOB.hive_datum[XENO_HIVE_NORMAL] + linked_hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] set_hive_data(src, linked_hive.hivenumber) diff --git a/code/modules/cm_aliens/structures/trap.dm b/code/modules/cm_aliens/structures/trap.dm index 482e61184fff..6ac0b19f281d 100644 --- a/code/modules/cm_aliens/structures/trap.dm +++ b/code/modules/cm_aliens/structures/trap.dm @@ -12,7 +12,7 @@ health = 5 layer = RESIN_STRUCTURE_LAYER var/list/tripwires = list() - var/hivenumber = XENO_HIVE_NORMAL //Hivenumber of the xeno that planted it OR the last Facehugger that was placed (essentially taking over the trap) + var/hivenumber = FACTION_XENOMORPH_NORMAL //Hivenumber of the xeno that planted it OR the last Facehugger that was placed (essentially taking over the trap) var/trap_type = RESIN_TRAP_EMPTY var/armed = 0 var/created_by // ckey @@ -29,7 +29,7 @@ cause_data = create_cause_data("resin trap", X) set_hive_data(src, hivenumber) - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) var/obj/effect/alien/weeds/node/weed = locate() in loc @@ -55,8 +55,8 @@ /obj/effect/alien/resin/trap/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + hivenumber = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 15540ddccb2c..30d27ba46d08 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -20,7 +20,7 @@ var/tunnel_desc = "" //description added by the hivelord. - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/datum/hive_status/hive health = 140 @@ -48,7 +48,7 @@ if(resin_trap) qdel(resin_trap) - if(hivenumber == XENO_HIVE_NORMAL) + if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) SSminimaps.add_marker(src, z, get_minimap_flag_for_faction(hivenumber), "xenotunnel") @@ -57,9 +57,9 @@ SIGNAL_HANDLER if(is_ground_level(z)) hive.tunnels -= src - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) - hive = GLOB.hive_datum[XENO_HIVE_FORSAKEN] + hivenumber = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) + hive = GLOB.hive_datum[FACTION_XENOMORPH_FORSAKEN] hive.tunnels += src UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) diff --git a/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm b/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm index 0194ea74d3a6..b1b399d796fa 100644 --- a/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm +++ b/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm @@ -12,7 +12,7 @@ health = 1 layer = RESIN_STRUCTURE_LAYER var/list/tripwires = list() - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/root_duration = 17.5 var/mob/living/carbon/xenomorph/bound_xeno // Boiler linked to this trap diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index 3c649c2c04d2..658623c753cc 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -25,8 +25,9 @@ var/spread_on_semiweedable = FALSE var/block_structures = BLOCK_NOTHING - var/datum/hive_status/linked_hive = null - var/hivenumber = XENO_HIVE_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction + var/turf/weeded_turf // Which node is responsible for keeping this weed patch alive? @@ -36,7 +37,7 @@ . = ..() if(node) - linked_hive = node.linked_hive + faction = node.faction if(use_node_strength) weed_strength = node.weed_strength node_range = node.node_range @@ -44,17 +45,15 @@ name = "hive [name]" health = WEED_HEALTH_HIVE node.add_child(src) - hivenumber = linked_hive.hivenumber + faction_to_get = faction.code_identificator spread_on_semiweedable = node.spread_on_semiweedable if(weed_strength < WEED_LEVEL_HIVE && spread_on_semiweedable) name = "hardy [name]" health = WEED_HEALTH_HARDY block_structures = node.block_structures fruit_growth_multiplier = node.fruit_growth_multiplier - else - linked_hive = GLOB.hive_datum[hivenumber] - set_hive_data(src, hivenumber) + set_hive_data(src, faction) if(spread_on_semiweedable && weed_strength < WEED_LEVEL_HIVE) if(color) var/list/RGB = ReadRGB(color) @@ -83,7 +82,7 @@ COMSIG_ATOM_TURF_CHANGE, COMSIG_MOVABLE_TURF_ENTERED ), PROC_REF(set_turf_weeded)) - if(hivenumber == XENO_HIVE_NORMAL) + if(faction.code_identificator == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) var/area/area = get_area(src) @@ -100,9 +99,9 @@ /obj/effect/alien/weeds/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) - linked_hive = GLOB.hive_datum[XENO_HIVE_FORSAKEN] + faction_to_get = FACTION_XENOMORPH_FORSAKEN + faction = GLOB.faction_datums[faction_to_get] + set_hive_data(src, faction) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -181,8 +180,8 @@ var/weed_slow = weed_strength - if(crossing_mob.ally_of_hivenumber(linked_hive.hivenumber)) - if( (crossing_mob.hivenumber != linked_hive.hivenumber) && prob(7)) // small chance for allied mobs to get a message indicating this + if(crossing_mob.ally_faction(faction)) + if((crossing_mob.faction != faction) && prob(7)) // small chance for allied mobs to get a message indicating this to_chat(crossing_mob, SPAN_NOTICE("The weeds seem to reshape themselves around your feet as you walk on them.")) return @@ -238,7 +237,7 @@ continue else if(W.weed_strength >= WEED_LEVEL_HIVE) continue - else if (W.linked_hive == node.linked_hive && W.weed_strength >= node.weed_strength) + else if (W.faction == node.faction && W.weed_strength >= node.weed_strength) continue old_fruit = locate() in T @@ -361,7 +360,7 @@ take_damage(severity * WEED_EXPLOSION_DAMAGEMULT) /obj/effect/alien/weeds/attack_alien(mob/living/carbon/xenomorph/attacking_xeno) - if(!explo_proof && !HIVE_ALLIED_TO_HIVE(attacking_xeno.hivenumber, hivenumber)) + if(!explo_proof && !attacking_xeno.ally_faction(faction)) attacking_xeno.animation_attack_on(src) attacking_xeno.visible_message(SPAN_DANGER("\The [attacking_xeno] slashes [src]!"), \ SPAN_DANGER("You slash [src]!"), null, 5) @@ -515,13 +514,13 @@ overlay_node = TRUE overlays += staticnode -/obj/effect/alien/weeds/node/Initialize(mapload, obj/effect/alien/weeds/node/node, mob/living/carbon/xenomorph/xeno, datum/hive_status/hive) - if (istype(hive)) - linked_hive = hive - else if (istype(xeno) && xeno.hive) - linked_hive = xeno.hive +/obj/effect/alien/weeds/node/Initialize(mapload, obj/effect/alien/weeds/node/node, mob/living/carbon/xenomorph/xeno, datum/faction/_faction) + if(istype(_faction)) + faction = _faction + else if (istype(xeno) && xeno.faction) + faction = xeno.faction else - linked_hive = GLOB.hive_datum[hivenumber] + faction = GLOB.faction_datums[faction_to_get] for(var/obj/effect/alien/weeds/weed in loc) if(weed != src) @@ -582,13 +581,13 @@ health = NODE_HEALTH_STANDARD /obj/effect/alien/weeds/node/alpha - hivenumber = XENO_HIVE_ALPHA + faction_to_get = FACTION_XENOMORPH_ALPHA /obj/effect/alien/weeds/node/feral - hivenumber = XENO_HIVE_FERAL + faction_to_get = FACTION_XENOMORPH_FERAL /obj/effect/alien/weeds/node/forsaken - hivenumber = XENO_HIVE_FORSAKEN + faction_to_get = FACTION_XENOMORPH_FORSAKEN /obj/effect/alien/weeds/node/pylon health = WEED_HEALTH_HIVE diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index 041407e48224..39eef453f0a9 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -821,7 +821,7 @@ new_human.equip_to_slot_or_del(new /obj/item/clothing/gloves/marine/veteran(new_human), WEAR_HANDS) //*****************************************************************************************************/ -/datum/equipment_preset/other/xeno_cultist/load_status(mob/living/carbon/human/new_human, hivenumber = XENO_HIVE_NORMAL) +/datum/equipment_preset/other/xeno_cultist/load_status(mob/living/carbon/human/new_human, hivenumber = FACTION_XENOMORPH_NORMAL) if(SSticker.mode && new_human.mind) SSticker.mode.xenomorphs += new_human.mind diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index aca28e566c59..0def73513046 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -916,7 +916,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "View Xeno Tacmap" set category = "Ghost.View" - var/datum/hive_status/hive = GLOB.hive_datum[XENO_HIVE_NORMAL] + var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] if(!hive || !length(hive.totalXenos)) to_chat(src, SPAN_ALERT("There seems to be no living normal hive at the moment")) return diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 795de20367d2..30a67ba60a64 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -80,7 +80,7 @@ if(SSticker.mode && SSticker.mode.is_in_endgame && SSticker.current_state != GAME_STATE_FINISHED && is_mainship_level(z)) var/mob/last_living_human var/shipside_humans_count = 0 - var/datum/hive_status/main_hive = GLOB.hive_datum[XENO_HIVE_NORMAL] + var/datum/hive_status/main_hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] var/see_humans_on_tacmap = main_hive.see_humans_on_tacmap for(var/mob/living/carbon/human/cur_human as anything in GLOB.alive_human_list) if(!is_mainship_level(cur_human.z)) @@ -92,12 +92,12 @@ last_living_human = cur_human if(!see_humans_on_tacmap && shipside_humans_count < (main_hive.get_real_total_xeno_count() * HIJACK_RATIO_FOR_TACMAP)) - xeno_announcement("There is only a handful of tallhosts left, they are now visible on our hive mind map.", XENO_HIVE_NORMAL, SPAN_ANNOUNCEMENT_HEADER_BLUE("[QUEEN_MOTHER_ANNOUNCE]")) + xeno_announcement("There is only a handful of tallhosts left, they are now visible on our hive mind map.", FACTION_XENOMORPH_NORMAL, SPAN_ANNOUNCEMENT_HEADER_BLUE("[QUEEN_MOTHER_ANNOUNCE]")) main_hive.see_humans_on_tacmap = TRUE if(last_living_human && shipside_humans_count <= 1 && (GLOB.last_qm_callout + 2 MINUTES) < world.time) GLOB.last_qm_callout = world.time // Tell the xenos where the human is. - xeno_announcement("I sense the last tallhost hiding in [get_area_name(last_living_human)].", XENO_HIVE_NORMAL, SPAN_ANNOUNCEMENT_HEADER_BLUE("[QUEEN_MOTHER_ANNOUNCE]")) + xeno_announcement("I sense the last tallhost hiding in [get_area_name(last_living_human)].", FACTION_XENOMORPH_NORMAL, SPAN_ANNOUNCEMENT_HEADER_BLUE("[QUEEN_MOTHER_ANNOUNCE]")) // Tell the human he is the last guy. if(last_living_human.client) to_chat(last_living_human, SPAN_ANNOUNCEMENT_HEADER_BLUE("Panic creeps up your spine. You realize that you are the last survivor.")) diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index 70c9752b952b..d89e3a6189f6 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -272,7 +272,7 @@ CULT if(!(copytext(message, -1) in ENDING_PUNCT)) message += "." - var/datum/faction_module/hive_mind/faction_module = faction.get_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!istype(faction_module)) return diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index efdaa765bf75..b8394259729c 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -9,8 +9,7 @@ var/stage = 0 var/counter = 0 //How developed the embryo is, if it ages up highly enough it has a chance to burst var/larva_autoburst_countdown = 20 //to kick the larva out - var/hivenumber = XENO_HIVE_NORMAL - var/faction = FACTION_XENOMORPH + var/faction_to_get = FACTION_XENOMORPH var/flags_embryo = FALSE // Used in /ciphering/predator property /// The ckey of any player hugger that made this embryo var/hugger_ckey @@ -79,21 +78,21 @@ /obj/item/alien_embryo/proc/process_growth(delta_time) //Tutorial embryos do not progress. - if(hivenumber == XENO_HIVE_TUTORIAL) + if(!faction_to_get == FACTION_XENOMORPH_TUTORIAL) return - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) //Low temperature seriously hampers larva growth (as in, way below livable), so does stasis - if(!hive.hardcore) // Cannot progress if the hive has entered hardcore mode. + if(!faction_module.hardcore) // Cannot progress if the hive has entered hardcore mode. if(affected_mob.in_stasis || affected_mob.bodytemperature < 170) if(stage < 5) - counter += 0.33 * hive.larva_gestation_multiplier * delta_time + counter += 0.33 * faction_module.larva_gestation_multiplier * delta_time if(stage == 4) // Stasis affects late-stage less - counter += 0.11 * hive.larva_gestation_multiplier * delta_time + counter += 0.11 * faction_module.larva_gestation_multiplier * delta_time else if(HAS_TRAIT(affected_mob, TRAIT_NESTED)) //Hosts who are nested in resin nests provide an ideal setting, larva grows faster - counter += 1.5 * hive.larva_gestation_multiplier * delta_time //Currently twice as much, can be changed + counter += 1.5 * faction_module.larva_gestation_multiplier * delta_time //Currently twice as much, can be changed else if(stage < 5) - counter += 1 * hive.larva_gestation_multiplier * delta_time + counter += 1 * faction_module.larva_gestation_multiplier * delta_time if(stage < 5 && counter >= per_stage_hugged_time) counter = 0 @@ -168,7 +167,8 @@ stage = 6 // Increase the stage value to prevent this proc getting repeated - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) var/mob/picked var/mob/dead/observer/hugger = null var/is_nested = istype(affected_mob.buckled, /obj/structure/bed/nest) @@ -191,7 +191,7 @@ if(!picked) // Get a candidate from observers - var/list/candidates = get_alien_candidates(hive, abomination = (isyautja(affected_mob) || (flags_embryo & FLAG_EMBRYO_PREDATOR))) + var/list/candidates = get_alien_candidates(faction, abomination = (isyautja(affected_mob) || (flags_embryo & FLAG_EMBRYO_PREDATOR))) if(candidates && length(candidates)) // If they were facehugged by a player thats still in queue, they get second dibs on the new larva. if(hugger_ckey) @@ -246,11 +246,10 @@ else new_xeno = new(affected_mob) - if(hive) - hive.add_xeno(new_xeno) - if(!affected_mob.first_xeno && hive.hive_location) - hive.increase_larva_after_burst() - hive.hive_ui.update_burrowed_larva() + faction.add_xeno(new_xeno) + if(!affected_mob.first_xeno && faction_module.hive_location) + faction_module.increase_larva_after_burst() + faction_module.hive_ui.update_burrowed_larva() new_xeno.update_icons() @@ -276,7 +275,7 @@ if(!HAS_TRAIT(affected_mob, TRAIT_NESTED)) var/area/burst_area = get_area(src) var/area_text = burst_area ? " at [burst_area]" : "" - notify_ghosts(header = "Burst Imminent", message = "A [new_xeno.hive.prefix]Larva is about to chestburst out of [affected_mob][area_text]!", source = affected_mob) + notify_ghosts(header = "Burst Imminent", message = "A [new_xeno.faction.prefix]Larva is about to chestburst out of [affected_mob][area_text]!", source = affected_mob) stage = 7 // Begin the autoburst countdown @@ -324,7 +323,8 @@ victim.spawn_gibs() for(var/mob/living/carbon/xenomorph/larva/larva_embryo in victim) - var/datum/hive_status/hive = GLOB.hive_datum[larva_embryo.hivenumber] + var/datum/faction/faction = GLOB.faction_datums[larva_embryo.faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) larva_embryo.forceMove(get_turf(victim)) //moved to the turf directly so we don't get stuck inside a cryopod or another mob container. larva_embryo.grant_spawn_protection(1 SECONDS) playsound(larva_embryo, pick('sound/voice/alien_chestburst.ogg','sound/voice/alien_chestburst2.ogg'), 25) @@ -340,21 +340,21 @@ if(GLOB.round_statistics && (ishuman(victim)) && (SSticker.current_state == GAME_STATE_PLAYING) && (ROUND_TIME > 1 MINUTES)) GLOB.round_statistics.total_larva_burst++ - GLOB.larva_burst_by_hive[hive] = (GLOB.larva_burst_by_hive[hive] || 0) + 1 + GLOB.larva_burst_by_hive[larva_embryo.faction_to_get] = (GLOB.larva_burst_by_hive[larva_embryo.faction_to_get] || 0) + 1 burstcount++ - if(!larva_embryo.ckey && larva_embryo.burrowable && loc && is_ground_level(loc.z) && (locate(/obj/structure/bed/nest) in loc) && hive.living_xeno_queen && hive.living_xeno_queen.z == loc.z) + if(!larva_embryo.ckey && larva_embryo.burrowable && loc && is_ground_level(loc.z) && (locate(/obj/structure/bed/nest) in loc) && faction_module.living_xeno_queen && faction_module.living_xeno_queen.z == loc.z) larva_embryo.visible_message(SPAN_XENODANGER("[larva_embryo] quickly burrows into the ground.")) if(GLOB.round_statistics && !larva_embryo.statistic_exempt) GLOB.round_statistics.track_new_participant(faction, -1) // keep stats sane - hive.stored_larva++ - hive.hive_ui.update_burrowed_larva() + faction_module.stored_larva++ + faction_module.hive_ui.update_burrowed_larva() qdel(larva_embryo) if(!victim.first_xeno) - if(hive.hive_orders) + if(faction.faction_orders) to_chat(larva_embryo, SPAN_XENOHIGHDANGER("The Queen's will overwhelms our instincts...")) - to_chat(larva_embryo, SPAN_XENOHIGHDANGER("\"[hive.hive_orders]\"")) + to_chat(larva_embryo, SPAN_XENOHIGHDANGER("\"[faction.faction_orders]\"")) log_attack("[key_name(victim)] chestbursted in [get_area_name(larva_embryo)] at X[victim.x], Y[victim.y], Z[victim.z]. The larva was [key_name(larva_embryo)].") //this is so that admins are not spammed with los logs for(var/obj/item/alien_embryo/AE in victim) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index bcb61ecc1703..645a75e7a72d 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -27,12 +27,13 @@ to_chat(src, SPAN_WARNING("The Hive is not capable of supporting any castes we can evolve to yet.")) return var/castepick - if((client.prefs && client.prefs.no_radials_preference) || !hive.evolution_menu_images) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if((client.prefs && client.prefs.no_radials_preference) || !faction_module.evolution_menu_images) castepick = tgui_input_list(usr, "You are growing into a beautiful alien! It is time to choose a caste.", "Evolve", castes_available, theme="hive_status") else var/list/fancy_caste_list = list() for(var/caste in castes_available) - fancy_caste_list[caste] = hive.evolution_menu_images[caste] + fancy_caste_list[caste] = faction_module.evolution_menu_images[caste] castepick = show_radial_menu(src, src.client?.eye, fancy_caste_list) if(!castepick) //Changed my mind @@ -49,18 +50,19 @@ if(!evolve_checks()) return - if((!hive.living_xeno_queen) && castepick != XENO_CASTE_QUEEN && !islarva(src) && !hive.allow_no_queen_evo) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if((!faction_module.living_xeno_queen) && castepick != XENO_CASTE_QUEEN && !islarva(src) && !faction_module.allow_no_queen_evo) to_chat(src, SPAN_WARNING("The Hive is shaken by the death of the last Queen. We can't find the strength to evolve.")) return if(castepick == XENO_CASTE_QUEEN) //Special case for dealing with queenae if(!hardcore) - if(SSticker.mode && hive.xeno_queen_timer > world.time) - to_chat(src, SPAN_WARNING("We must wait about [DisplayTimeText(hive.xeno_queen_timer - world.time, 1)] for the hive to recover from the previous Queen's death.")) + if(SSticker.mode && faction_module.xeno_queen_timer > world.time) + to_chat(src, SPAN_WARNING("We must wait about [DisplayTimeText(faction_module.xeno_queen_timer - world.time, 1)] for the hive to recover from the previous Queen's death.")) return if(plasma_stored >= 500) - if(hive.living_xeno_queen) + if(faction_module.living_xeno_queen) to_chat(src, SPAN_WARNING("There already is a living Queen.")) return else @@ -75,10 +77,7 @@ return // Used for restricting benos to evolve to drone/queen when they're the only potential queen - for(var/mob/living/carbon/xenomorph/M in GLOB.living_xeno_list) - if(hivenumber != M.hivenumber) - continue - + for(var/mob/living/carbon/xenomorph/M in faction.total_mobs) switch(M.tier) if(0) if(islarva(M) && !ispredalienlarva(M)) @@ -122,10 +121,11 @@ if(jobban_isbanned(src, XENO_CASTE_QUEEN)) to_chat(src, SPAN_WARNING("You are jobbanned from the Queen role.")) return - if(hive.living_xeno_queen) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen) to_chat(src, SPAN_WARNING("There already is a Queen.")) return - if(!hive.allow_queen_evolve) + if(!faction_module.allow_queen_evolve) to_chat(src, SPAN_WARNING("We can't find the strength to evolve into a Queen")) return else if(!can_evolve(castepick, potential_queens)) @@ -149,11 +149,12 @@ var/area/xeno_area = get_area(new_xeno) if(!should_block_game_interaction(new_xeno) || (xeno_area.flags_atom & AREA_ALLOW_XENO_JOIN)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) switch(new_xeno.tier) //They have evolved, add them to the slot count IF they are in regular game space if(2) - hive.tier_2_xenos |= new_xeno + faction_module.tier_2_xenos |= new_xeno if(3) - hive.tier_3_xenos |= new_xeno + faction_module.tier_3_xenos |= new_xeno log_game("EVOLVE: [key_name(src)] evolved into [new_xeno].") if(mind) @@ -184,8 +185,9 @@ new_xeno.visible_message(SPAN_XENODANGER("A [new_xeno.caste.caste_type] emerges from the husk of \the [src]."), \ SPAN_XENODANGER("We emerge in a greater form from the husk of our old body. For the hive!")) - if(hive.living_xeno_queen && hive.living_xeno_queen.observed_xeno == src) - hive.living_xeno_queen.overwatch(new_xeno) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen && faction_module.living_xeno_queen.observed_xeno == src) + faction_module.living_xeno_queen.overwatch(new_xeno) src.transfer_observers_to(new_xeno) @@ -312,7 +314,7 @@ var/mob/living/carbon/xenomorph/new_xeno = transmute(newcaste) if(new_xeno) log_game("EVOLVE: [key_name(src)] de-evolved into [new_xeno].") - + return /mob/living/carbon/xenomorph/proc/transmute(newcaste) @@ -324,7 +326,7 @@ var/level_to_switch_to = get_vision_level() var/xeno_type = GLOB.RoleAuthority.get_caste_by_text(newcaste) var/mob/living/carbon/xenomorph/new_xeno = new xeno_type(get_turf(src), src) - + if(!istype(new_xeno)) //Something went horribly wrong to_chat(src, SPAN_WARNING("Something went terribly wrong here. Your new xeno is null! Tell a coder immediately!")) @@ -379,17 +381,18 @@ return new_xeno /mob/living/carbon/xenomorph/proc/can_evolve(castepick, potential_queens) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) var/selected_caste = GLOB.xeno_datum_list[castepick]?.type - var/free_slot = LAZYACCESS(hive.free_slots, selected_caste) - var/used_slot = LAZYACCESS(hive.used_slots, selected_caste) + var/free_slot = LAZYACCESS(faction_module.free_slots, selected_caste) + var/used_slot = LAZYACCESS(faction_module.used_slots, selected_caste) if(free_slot > used_slot) return TRUE - var/used_tier_2_slots = length(hive.tier_2_xenos) - var/used_tier_3_slots = length(hive.tier_3_xenos) - for(var/caste_path in hive.free_slots) - var/slots_free = hive.free_slots[caste_path] - var/slots_used = hive.used_slots[caste_path] + var/used_tier_2_slots = length(faction_module.tier_2_xenos) + var/used_tier_3_slots = length(faction_module.tier_3_xenos) + for(var/caste_path in faction_module.free_slots) + var/slots_free = faction_module.free_slots[caste_path] + var/slots_used = faction_module.used_slots[caste_path] if(!slots_used) continue var/datum/caste_datum/current_caste = caste_path @@ -399,19 +402,19 @@ if(3) used_tier_3_slots -= min(slots_used, slots_free) - var/burrowed_factor = min(hive.stored_larva, sqrt(4*hive.stored_larva)) + var/burrowed_factor = min(faction_module.stored_larva, sqrt(4*faction_module.stored_larva)) var/totalXenos = floor(burrowed_factor) - for(var/mob/living/carbon/xenomorph/xeno as anything in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno as anything in hive.total_mobs) if(xeno.counts_for_slots) totalXenos++ - if(tier == 1 && (((used_tier_2_slots + used_tier_3_slots) / totalXenos) * hive.tier_slot_multiplier) >= 0.5 && castepick != XENO_CASTE_QUEEN) + if(tier == 1 && (((used_tier_2_slots + used_tier_3_slots) / totalXenos) * faction_module.tier_slot_multiplier) >= 0.5 && castepick != XENO_CASTE_QUEEN) to_chat(src, SPAN_WARNING("The hive cannot support another Tier 2, wait for either more aliens to be born or someone to die.")) return FALSE - else if(tier == 2 && ((used_tier_3_slots / totalXenos) * hive.tier_slot_multiplier) >= 0.20 && castepick != XENO_CASTE_QUEEN) + else if(tier == 2 && ((used_tier_3_slots / totalXenos) * faction_module.tier_slot_multiplier) >= 0.20 && castepick != XENO_CASTE_QUEEN) to_chat(src, SPAN_WARNING("The hive cannot support another Tier 3, wait for either more aliens to be born or someone to die.")) return FALSE - else if(hive.allow_queen_evolve && !hive.living_xeno_queen && potential_queens == 1 && islarva(src) && castepick != XENO_CASTE_DRONE) + else if(faction_module.allow_queen_evolve && !faction_module.living_xeno_queen && potential_queens == 1 && islarva(src) && castepick != XENO_CASTE_DRONE) to_chat(src, SPAN_XENONOTICE("The hive currently has no sister able to become Queen! The survival of the hive requires you to be a Drone!")) return FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index 97bd4fd40320..22c6665dd38c 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -35,7 +35,7 @@ var/strength = 5 var/attached = FALSE var/leaping = FALSE //Is actually attacking someone? - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/flags_embryo = NO_FLAGS var/impregnated = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index f9646a93eef9..ecf30049c28f 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -2,7 +2,7 @@ //LAST EDIT: APOPHIS 22MAY16 //Send a message to all xenos. Mostly used in the deathgasp display -/proc/xeno_message(message = null, size = 3, hivenumber = XENO_HIVE_NORMAL) +/proc/xeno_message(message = null, size = 3, datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) if(!message) return @@ -18,18 +18,18 @@ if(SSticker.mode && length(SSticker.mode.xenomorphs)) //Send to only xenos in our gamemode list. This is faster than scanning all mobs for(var/datum/mind/L in SSticker.mode.xenomorphs) var/mob/living/carbon/M = L.current - if(M && istype(M) && !M.stat && M.client && (!hivenumber || M.hivenumber == hivenumber)) //Only living and connected xenos + if(M && istype(M) && !M.stat && M.client && (!faction || M.faction == faction)) //Only living and connected xenos to_chat(M, SPAN_XENODANGER(" [message]")) //Sends a maptext alert to xenos. -/proc/xeno_maptext(text = "", title_text = "", hivenumber = XENO_HIVE_NORMAL) - if(text == "" || !hivenumber) +/proc/xeno_maptext(text = "", title_text = "", datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) + if(text == "" || !faction) return //Logic if(SSticker.mode && length(SSticker.mode.xenomorphs)) //Send to only xenos in our gamemode list. This is faster than scanning all mobs for(var/datum/mind/living in SSticker.mode.xenomorphs) var/mob/living/carbon/xenomorph/xeno = living.current - if(istype(xeno) && !xeno.stat && xeno.client && xeno.hivenumber == hivenumber) //Only living and connected xenos + if(istype(xeno) && !xeno.stat && xeno.client && xeno.faction == faction) //Only living and connected xenos playsound_client(xeno.client, 'sound/voice/alien_distantroar_3.ogg', xeno.loc, 25, FALSE) xeno.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, "#b491c8") @@ -140,8 +140,8 @@ else . += "Special Structure Destruction: QUEEN" - if(hive.hive_orders) - . += "Hive Orders: [hive.hive_orders]" + if(hive.faction_orders) + . += "Hive Orders: [hive.faction_orders]" else . += "Hive Orders: -" diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index c4344adea89b..c2187e39c6cc 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -815,7 +815,7 @@ return pull_multiplier //Call this function to set the hive and do other cleanup -/mob/living/carbon/xenomorph/proc/set_hive_and_update(new_hivenumber = XENO_HIVE_NORMAL) +/mob/living/carbon/xenomorph/proc/set_hive_and_update(new_hivenumber = FACTION_XENOMORPH_NORMAL) var/datum/hive_status/new_hive = GLOB.hive_datum[new_hivenumber] if(!new_hive) return FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index cf5732741a1e..cc8260c349f9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -280,13 +280,14 @@ if(target_turf.z != X.z) to_chat(X, SPAN_XENOWARNING("This area is too far away to affect!")) return - if(!X.hive.living_xeno_queen || X.hive.living_xeno_queen.z != X.z) + var/datum/faction_module/hive_mind/faction_module = X.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen || faction_module.living_xeno_queen.z != X.z) to_chat(X, SPAN_XENOWARNING("We have no queen, the psychic link is gone!")) return var/tally = 0 - for(var/obj/effect/alien/resin/marker/MRK in X.hive.resin_marks) + for(var/obj/effect/alien/resin/marker/MRK in faction_module.resin_marks) if(MRK.createdby == X.nicknumber) tally++ if(tally >= max_markers) @@ -294,8 +295,8 @@ var/list/promptlist = list("Yes", "No") var/obj/effect/alien/resin/marker/Goober = null var/promptuser = null - for(var/i=1, i<=length(X.hive.resin_marks)) - Goober = X.hive.resin_marks[i] + for(var/i=1, i<=length(faction_module.resin_marks)) + Goober = faction_module.resin_marks[i] if(Goober.createdby == X.nicknumber) promptuser = tgui_input_list(X, "Remove oldest placed mark: '[Goober.mark_meaning.name]!'?", "Mark limit reached.", promptlist, theme="hive_status") break @@ -372,9 +373,11 @@ SEND_SIGNAL(src, COMSIG_XENO_START_EMIT_PHEROMONES, pheromone) playsound(loc, "alien_drool", 25) - if(isqueen(src) && hive && length(hive.xeno_leader_list) && anchored) - for(var/mob/living/carbon/xenomorph/L in hive.xeno_leader_list) - L.handle_xeno_leader_pheromones() + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(isqueen(src) && length(faction_module.xeno_leader_list) && anchored) + for(var/mob/living/carbon/xenomorph/L in faction_module.xeno_leader_list) + L.handle_xeno_leader_pheromones() /datum/action/xeno_action/activable/pounce/use_ability(atom/A) var/mob/living/carbon/xenomorph/X = owner @@ -550,7 +553,7 @@ if(!T.check_xeno_trap_placement(X)) return var/obj/effect/alien/weeds/the_replacer = new /obj/effect/alien/weeds(T) - the_replacer.hivenumber = X.hivenumber + the_replacer.faction = X.faction the_replacer.linked_hive = X.hive set_hive_data(the_replacer, X.hivenumber) qdel(alien_weeds) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index 5bfe1d7f9575..32c0e66dbf6b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -313,7 +313,7 @@ return if(!xeno.check_plasma(plasma_cost_jelly)) return - if(give_jelly_award(xeno.hive)) + if(give_jelly_award(xeno.faction)) xeno.use_plasma(plasma_cost_jelly) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index 9d2493802972..b0bb8af0c0b9 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -77,32 +77,32 @@ /mob/living/carbon/xenomorph/larva/corrupted AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_CORRUPTED + faction_to_get = FACTION_XENOMORPH_CORRUPTED /mob/living/carbon/xenomorph/larva/alpha AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_ALPHA + faction_to_get = FACTION_XENOMORPH_ALPHA /mob/living/carbon/xenomorph/larva/bravo AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_BRAVO + faction_to_get = FACTION_XENOMORPH_BRAVO /mob/living/carbon/xenomorph/larva/charlie AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_CHARLIE + faction_to_get = FACTION_XENOMORPH_CHARLIE /mob/living/carbon/xenomorph/larva/delta AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_DELTA + faction_to_get = FACTION_XENOMORPH_DELTA /mob/living/carbon/xenomorph/larva/mutated AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_MUTATED + faction_to_get = FACTION_XENOMORPH_MUTATED /mob/living/carbon/xenomorph/larva/predalien AUTOWIKI_SKIP(TRUE) @@ -214,9 +214,9 @@ Also handles the "Mature / Bloody naming convention. Call this to update the nam var/progress = "" //Naming convention, three different names var/name_prefix = "" // Prefix for hive - if(hive) - name_prefix = hive.prefix - color = hive.color + if(faction) + name_prefix = faction.prefix + color = faction.color if(larva_state == LARVA_STATE_MATURE) progress = "Mature " @@ -228,6 +228,6 @@ Also handles the "Mature / Bloody naming convention. Call this to update the nam //Update linked data so they show up properly change_real_name(src, name) //Update the hive status UI - if(hive) - var/datum/hive_status/hive_status = hive - hive_status.hive_ui.update_xeno_info() + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.update_xeno_info() diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm b/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm index eefd66f8bf03..c142c42aec4f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm @@ -41,7 +41,6 @@ icon_state = "Predalien Walking" speaking_noise = 'sound/voice/predalien_click.ogg' plasma_types = list(PLASMA_CATECHOLAMINE) - faction = FACTION_PREDALIEN claw_type = CLAW_TYPE_VERY_SHARP wall_smash = TRUE hardcore = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 83e433b48b90..b6576360ca3e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -76,7 +76,7 @@ hud_possible = list(XENO_STATUS_HUD) var/mob/is_watching - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/next_point = 0 var/point_delay = 1 SECONDS @@ -379,12 +379,12 @@ /mob/living/carbon/xenomorph/queen/forsaken AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_FORSAKEN + hivenumber = FACTION_XENOMORPH_FORSAKEN /mob/living/carbon/xenomorph/queen/forsaken/combat_ready AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_FORSAKEN + hivenumber = FACTION_XENOMORPH_FORSAKEN queen_aged = TRUE /mob/living/carbon/xenomorph/queen/alpha @@ -395,7 +395,7 @@ /mob/living/carbon/xenomorph/queen/bravo AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_BRAVO + hivenumber = FACTION_XENOMORPH_NORMAL /mob/living/carbon/xenomorph/queen/charlie AUTOWIKI_SKIP(TRUE) @@ -452,28 +452,27 @@ /mob/living/carbon/xenomorph/queen/generate_name() if(!nicknumber) generate_and_set_nicknumber() - var/name_prefix = hive.prefix if(queen_aged) age_xeno() switch(age) if(XENO_YOUNG) - name = "[name_prefix]Young Queen" //Young + name = "[faction.prefix]Young Queen" //Young if(XENO_NORMAL) - name = "[name_prefix]Queen" //Regular + name = "[faction.prefix]Queen" //Regular if(XENO_MATURE) - name = "[name_prefix]Elder Queen" //Mature + name = "[faction.prefix]Elder Queen" //Mature if(XENO_ELDER) - name = "[name_prefix]Elder Empress" //Elite + name = "[faction.prefix]Elder Empress" //Elite if(XENO_ANCIENT) - name = "[name_prefix]Ancient Empress" //Ancient + name = "[faction.prefix]Ancient Empress" //Ancient if(XENO_PRIME) - name = "[name_prefix]Prime Empress" //Primordial + name = "[faction.prefix]Prime Empress" //Primordial else age = XENO_NORMAL if(client) hud_update() - name = "[name_prefix]Immature Queen" + name = "[faction.prefix]Immature Queen" var/name_client_prefix = "" var/name_client_postfix = "" @@ -485,7 +484,7 @@ full_designation = "[name_client_prefix][nicknumber][name_client_postfix]" - color = hive.color + color = faction.color //Update linked data so they show up properly change_real_name(src, name) @@ -596,13 +595,13 @@ var/txt = strip_html(input("Set the hive's orders to what? Leave blank to clear it.", "Hive Orders","")) if(txt) - xeno_message("The Queen's will overwhelms your instincts...", 3, hivenumber) - xeno_message("\""+txt+"\"", 3, hivenumber) - xeno_maptext(txt, "Hive Orders Updated", hivenumber) - hive.hive_orders = txt + xeno_message("The Queen's will overwhelms your instincts...", 3, faction) + xeno_message("\""+txt+"\"", 3, faction) + xeno_maptext(txt, "Hive Orders Updated", faction) + faction.faction_orders = txt log_hiveorder("[key_name(usr)] has set the Hive Order to: [txt]") else - hive.hive_orders = "" + faction.faction_orders = "" last_special = world.time + 15 SECONDS diff --git a/code/modules/mob/living/carbon/xenomorph/death.dm b/code/modules/mob/living/carbon/xenomorph/death.dm index 925b62be6e99..f3de3d5205b9 100644 --- a/code/modules/mob/living/carbon/xenomorph/death.dm +++ b/code/modules/mob/living/carbon/xenomorph/death.dm @@ -119,7 +119,7 @@ if(SSticker.mode && SSticker.current_state != GAME_STATE_FINISHED) if((GLOB.last_ares_callout + 2 MINUTES) > world.time) return - if(hive.hivenumber == XENO_HIVE_NORMAL && (LAZYLEN(hive.totalXenos) == 1)) + if(hive.hivenumber == FACTION_XENOMORPH_NORMAL && (LAZYLEN(hive.totalXenos) == 1)) var/mob/living/carbon/xenomorph/X = LAZYACCESS(hive.totalXenos, 1) GLOB.last_ares_callout = world.time // Tell the marines where the last one is. diff --git a/code/modules/mob/living/carbon/xenomorph/egg_item.dm b/code/modules/mob/living/carbon/xenomorph/egg_item.dm index 75b141f9785c..38d6657b632a 100644 --- a/code/modules/mob/living/carbon/xenomorph/egg_item.dm +++ b/code/modules/mob/living/carbon/xenomorph/egg_item.dm @@ -15,31 +15,31 @@ throw_range = 1 layer = MOB_LAYER black_market_value = 35 - var/hivenumber = XENO_HIVE_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/flags_embryo = NO_FLAGS ///The objects in this list will be skipped when checking for obstrucing objects. var/static/list/object_whitelist = list(/obj/structure/machinery/light, /obj/structure/machinery/light_construct) -/obj/item/xeno_egg/Initialize(mapload, hive) +/obj/item/xeno_egg/Initialize(mapload, _faction_to_get) pixel_x = rand(-3,3) pixel_y = rand(-3,3) create_reagents(60) - reagents.add_reagent(PLASMA_EGG, 60, list("hive_number" = hivenumber)) + reagents.add_reagent(PLASMA_EGG, 60, list("hive_number" = faction_to_get)) - if (hive) - hivenumber = hive + if(_faction_to_get) + faction_to_get = _faction_to_get - set_hive_data(src, hivenumber) + set_hive_data(src, GLOB.faction_datums[faction_to_get]) . = ..() - if(hivenumber == XENO_HIVE_NORMAL) + if(faction_to_get == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) /obj/item/xeno_egg/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = XENO_HIVE_FORSAKEN - set_hive_data(src, XENO_HIVE_FORSAKEN) + faction_to_get = FACTION_XENOMORPH_FORSAKEN + set_hive_data(src, GLOB.faction_datums[faction_to_get]) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -47,9 +47,9 @@ . = ..() if(isxeno(user)) . += "A queen egg, it needs to be planted on weeds to start growing." - if(hivenumber != XENO_HIVE_NORMAL) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - . += "This one appears to belong to the [hive.name]" + if(faction_to_get != FACTION_XENOMORPH_NORMAL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + . += "This one appears to belong to the [faction]" /obj/item/xeno_egg/afterattack(atom/target, mob/user, proximity) if(istype(target, /obj/effect/alien/resin/special/eggmorph)) @@ -65,7 +65,7 @@ plant_egg_human(user, T) /obj/item/xeno_egg/proc/plant_egg_human(mob/living/carbon/human/user, turf/T) - if(user.hivenumber != hivenumber) + if(user.faction.code_identificator != faction_to_get) if(!istype(T, /turf/open/floor/almayer/research/containment)) to_chat(user, SPAN_WARNING("Best not to plant this thing outside of a containment cell.")) return @@ -79,12 +79,12 @@ if(!do_after(user, 50, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) return - if(user.hivenumber != hivenumber) + if(user.faction.code_identificator != faction_to_get) for (var/obj/O in T) if (!istype(O,/obj/structure/machinery/light/small)) return - var/obj/effect/alien/egg/newegg = new /obj/effect/alien/egg(T, hivenumber) + var/obj/effect/alien/egg/newegg = new /obj/effect/alien/egg(T, faction_to_get) newegg.flags_embryo = flags_embryo newegg.add_hiddenprint(user) @@ -94,7 +94,7 @@ /obj/item/xeno_egg/proc/plant_egg(mob/living/carbon/xenomorph/user, turf/T, proximity = TRUE) if(!proximity) return // no message because usual behavior is not to show any - if(!user.hive) + if(!user.faction) to_chat(user, SPAN_XENOWARNING("Your hive cannot procreate.")) return if(!user.check_alien_construction(T, ignore_nest = TRUE)) @@ -105,22 +105,22 @@ var/obj/effect/alien/weeds/hive_weeds var/obj/effect/alien/weeds/any_weeds for(var/obj/effect/alien/weeds/weed in T) - if(weed.weed_strength >= WEED_LEVEL_HIVE && weed.linked_hive.hivenumber == hivenumber) + if(weed.weed_strength >= WEED_LEVEL_HIVE && weed.faction.code_identificator == faction_to_get) hive_weeds = weed break - if(weed.weed_strength >= WEED_LEVEL_WEAK && weed.linked_hive.hivenumber == hivenumber) //check for ANY weeds + if(weed.weed_strength >= WEED_LEVEL_WEAK && weed.faction.code_identificator == faction_to_get) //check for ANY weeds any_weeds = weed // If the user isn't an eggsac carrier, then they can only plant eggs on hive weeds. var/needs_hive_weeds = !istype(user.strain, /datum/xeno_strain/eggsac) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!any_weeds && !hive_weeds) //you need at least some weeds to plant on. - to_chat(user, SPAN_XENOWARNING("[src] must be planted on [lowertext(hive.prefix)]weeds.")) + to_chat(user, SPAN_XENOWARNING("[src] must be planted on [lowertext(faction.prefix)]weeds.")) return if(!hive_weeds && needs_hive_weeds) - to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(hive.prefix)]hive weeds.")) + to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(faction.prefix)]hive weeds.")) return if(istype(get_area(T), /area/interior)) @@ -155,9 +155,9 @@ user.use_plasma(30) var/obj/effect/alien/egg/newegg if(weed.weed_strength >= WEED_LEVEL_HIVE) - newegg = new /obj/effect/alien/egg(T, hivenumber) + newegg = new /obj/effect/alien/egg(T, faction_to_get) else if(weed.weed_strength >= WEED_LEVEL_STANDARD) - newegg = new /obj/effect/alien/egg/carrier_egg(T,hivenumber, user) + newegg = new /obj/effect/alien/egg/carrier_egg(T, faction_to_get, user) else to_chat(user, SPAN_XENOWARNING("[src] can't be planted on these weeds.")) return @@ -206,8 +206,8 @@ /obj/item/xeno_egg/alpha color = "#ff4040" - hivenumber = XENO_HIVE_ALPHA + faction_to_get = FACTION_XENOMORPH_ALPHA /obj/item/xeno_egg/forsaken color = "#cc8ec4" - hivenumber = XENO_HIVE_FORSAKEN + faction_to_get = FACTION_XENOMORPH_FORSAKEN diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index 2217e24cddaa..b014312ebad3 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -7,7 +7,7 @@ /// Short Hive ID as string used in stats reporting var/reporting_id = "normal" - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL var/mob/living/carbon/xenomorph/queen/living_xeno_queen var/egg_planting_range = 15 var/slashing_allowed = XENO_SLASH_ALLOWED //This initial var allows the queen to turn on or off slashing. Slashing off means harm intent does much less damage. @@ -172,7 +172,7 @@ LAZYINITLIST(used_hivebuffs) LAZYINITLIST(active_endgame_pylons) - if(hivenumber != XENO_HIVE_NORMAL) + if(hivenumber != FACTION_XENOMORPH_NORMAL) return if(!evolution_menu_images) @@ -715,7 +715,7 @@ continue if(xeno.hunter_data.hunted && !isqueen(xeno)) to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, seperating you from her hive! You must defend yourself from the headhunter before you can enter hibernation...")) - xeno.set_hive_and_update(XENO_HIVE_FORSAKEN) + xeno.set_hive_and_update(FACTION_XENOMORPH_FORSAKEN) else to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) if(length(xeno.stomach_contents)) @@ -736,7 +736,7 @@ if(A && A.hivenumber != hivenumber) continue for(var/obj/item/alien_embryo/embryo in potential_host) - embryo.hivenumber = XENO_HIVE_FORSAKEN + embryo.hivenumber = FACTION_XENOMORPH_FORSAKEN potential_host.update_med_icon() for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) @@ -1041,7 +1041,7 @@ /datum/hive_status/bravo name = "Bravo Hive" reporting_id = "bravo" - hivenumber = XENO_HIVE_BRAVO + hivenumber = FACTION_XENOMORPH_NORMAL prefix = "Bravo " color = "#ffff80" ui_color = "#99994d" @@ -1090,7 +1090,7 @@ /datum/hive_status/forsaken name = "Forsaken Hive" reporting_id = "forsaken" - hivenumber = XENO_HIVE_FORSAKEN + hivenumber = FACTION_XENOMORPH_FORSAKEN prefix = "Forsaken " color = "#cc8ec4" ui_color = "#cc8ec4" diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index bcd3059960ea..4b0114cffd8c 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -29,7 +29,7 @@ unsuitable_atoms_damage = 15 attack_same = TRUE faction = FACTION_XENOMORPH - hivenumber = XENO_HIVE_NORMAL + hivenumber = FACTION_XENOMORPH_NORMAL wall_smash = 1 minbodytemp = 0 heat_damage_per_tick = 20 diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 1add99af6a5f..e3b62a44ed97 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -346,7 +346,7 @@ /datum/hive_leaders/ui_data(mob/user) var/list/data = list() - var/datum/hive_status/main_hive = GLOB.hive_datum[XENO_HIVE_NORMAL] + var/datum/hive_status/main_hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] var/list/queens = list() if(main_hive.living_xeno_queen) queens += list(list("designation" = main_hive.living_xeno_queen.full_designation, "caste_type" = main_hive.living_xeno_queen.name)) diff --git a/code/modules/reagents/chemistry_reagents/other.dm b/code/modules/reagents/chemistry_reagents/other.dm index 4d8829ede882..90b3f753d7cc 100644 --- a/code/modules/reagents/chemistry_reagents/other.dm +++ b/code/modules/reagents/chemistry_reagents/other.dm @@ -1004,7 +1004,7 @@ if(data_properties && data_properties["hive_number"]) embryo.hivenumber = data_properties["hive_number"] else - embryo.hivenumber = XENO_HIVE_NORMAL + embryo.hivenumber = FACTION_XENOMORPH_NORMAL to_chat(H, SPAN_WARNING("Your stomach cramps and you suddenly feel very sick!")) /datum/reagent/plasma/neurotoxin diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index 9149dab684f8..87153a24942c 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -361,7 +361,7 @@ log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") var/mob/living/carbon/xenomorph/xeno = user - var/hivenumber = XENO_HIVE_NORMAL + var/hivenumber = FACTION_XENOMORPH_NORMAL if(istype(xeno)) hivenumber = xeno.hivenumber xeno_message(SPAN_XENOANNOUNCE("The Queen has commanded the metal bird to depart for the metal hive in the sky! Rejoice!"), 3, hivenumber) From f871fc0ef4c4aae73ac07f89d8bccc26ddd420f0 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Thu, 23 Jan 2025 17:47:39 +0500 Subject: [PATCH 04/24] moreeeeeeeee --- code/__DEFINES/mode.dm | 51 +-- code/datums/factions/clf.dm | 6 + code/datums/factions/colonists.dm | 6 + code/datums/factions/contractor.dm | 4 + code/datums/factions/dutchs_dozen.dm | 5 + code/datums/factions/faction.dm | 4 +- code/datums/factions/freelancer.dm | 6 + code/datums/factions/gladiator.dm | 4 + code/datums/factions/hefa_order.dm | 7 + code/datums/factions/mercenary.dm | 4 + code/datums/factions/pirate.dm | 4 + code/datums/factions/pizza_delivery.dm | 6 + code/datums/factions/ress.dm | 4 + code/datums/factions/souto.dm | 4 + .../{ => threewe}/royalmarinescommando.dm | 10 +- code/datums/factions/threewe/threewe.dm | 8 + code/datums/factions/upp.dm | 8 + code/datums/factions/{ => uscm}/cmb.dm | 8 +- code/datums/factions/uscm/marine.dm | 5 + code/datums/factions/uscm/marsoc.dm | 6 + code/datums/factions/{ => uscm}/uscm.dm | 8 + code/datums/factions/wy.dm | 44 -- code/datums/factions/wy/deathsquad.dm | 6 + code/datums/factions/{ => wy}/pmc.dm | 6 +- code/datums/factions/wy/wy.dm | 52 +++ code/datums/factions/xeno/alpha.dm | 9 + code/datums/factions/xeno/bravo.dm | 9 + code/datums/factions/xeno/charlie.dm | 9 + code/datums/factions/xeno/corrupted.dm | 42 ++ code/datums/factions/xeno/delta.dm | 9 + code/datums/factions/xeno/feral.dm | 15 + code/datums/factions/xeno/forsaken.dm | 15 + code/datums/factions/xeno/mutated.dm | 11 + code/datums/factions/xeno/normal.dm | 9 + code/datums/factions/xeno/renegade.dm | 15 + code/datums/factions/xeno/xeno.dm | 385 ++++++++++++++++++ code/datums/factions/xeno/yautja.dm | 15 + code/datums/factions/yautja.dm | 15 + code/datums/factions/zombie.dm | 60 +++ .../carbon/xenomorph/castes/Hellhound.dm | 4 +- colonialmarines.dme | 36 +- 41 files changed, 823 insertions(+), 111 deletions(-) create mode 100644 code/datums/factions/colonists.dm create mode 100644 code/datums/factions/dutchs_dozen.dm create mode 100644 code/datums/factions/freelancer.dm create mode 100644 code/datums/factions/gladiator.dm create mode 100644 code/datums/factions/hefa_order.dm create mode 100644 code/datums/factions/mercenary.dm create mode 100644 code/datums/factions/pirate.dm create mode 100644 code/datums/factions/pizza_delivery.dm create mode 100644 code/datums/factions/ress.dm create mode 100644 code/datums/factions/souto.dm rename code/datums/factions/{ => threewe}/royalmarinescommando.dm (94%) create mode 100644 code/datums/factions/threewe/threewe.dm rename code/datums/factions/{ => uscm}/cmb.dm (78%) create mode 100644 code/datums/factions/uscm/marine.dm create mode 100644 code/datums/factions/uscm/marsoc.dm rename code/datums/factions/{ => uscm}/uscm.dm (78%) delete mode 100644 code/datums/factions/wy.dm create mode 100644 code/datums/factions/wy/deathsquad.dm rename code/datums/factions/{ => wy}/pmc.dm (77%) create mode 100644 code/datums/factions/wy/wy.dm create mode 100644 code/datums/factions/xeno/alpha.dm create mode 100644 code/datums/factions/xeno/bravo.dm create mode 100644 code/datums/factions/xeno/charlie.dm create mode 100644 code/datums/factions/xeno/corrupted.dm create mode 100644 code/datums/factions/xeno/delta.dm create mode 100644 code/datums/factions/xeno/feral.dm create mode 100644 code/datums/factions/xeno/forsaken.dm create mode 100644 code/datums/factions/xeno/mutated.dm create mode 100644 code/datums/factions/xeno/normal.dm create mode 100644 code/datums/factions/xeno/renegade.dm create mode 100644 code/datums/factions/xeno/xeno.dm create mode 100644 code/datums/factions/xeno/yautja.dm create mode 100644 code/datums/factions/yautja.dm create mode 100644 code/datums/factions/zombie.dm diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index ca4a340583ed..5d5ff5b0a63f 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -257,6 +257,7 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_MARINE "cmf" #define FACTION_SURVIVOR "surv" #define FACTION_UPP "upp" +#define FACTION_RESS "ress" #define FACTION_TWE "twe" #define FACTION_WY "wy" #define FACTION_CLF "clf" @@ -319,53 +320,3 @@ DEFINE_BITFIELD(whitelist_status, list( GLOBAL_VAR(last_ares_callout) GLOBAL_VAR(last_qm_callout) - -//NAMES -#define NAME_FACTION_NEUTRAL "Neutral Faction" -//USCM -#define NAME_FACTION_USCM "United States Colonial Marines" -#define NAME_FACTION_MARINE "Colonial Marines" -#define NAME_FACTION_CMB "Colonial Marshal Bureau" -#define NAME_FACTION_MARSOC "Marine Special Operations Command" -//CONTRACTOR -#define NAME_FACTION_CONTRACTOR "Vanguard's Arrow Incorporated" -//WY -#define NAME_FACTION_WY "Weyland-Yutani" -#define NAME_FACTION_PMC "Private Military Company" -#define NAME_FACTION_WY_DEATHSQUAD "Corporate Commandos" -//UPP -#define NAME_FACTION_UPP "Union of Progressive Peoples" -//CLF -#define NAME_FACTION_CLF "Colonial Liberation Front" -//COLON -#define NAME_FACTION_COLONIST "Colonists" -//OTHER -#define NAME_FACTION_RESS "Royal Empire of the Shining Sun" -#define NAME_FACTION_TWE "Royal Marines Commando" -#define NAME_FACTION_MERCENARY "Mercenary Group" -#define NAME_FACTION_FREELANCER "Freelancer Mercenaries" -#define NAME_FACTION_HEFA "HEFA Knights" -#define NAME_FACTION_DUTCH "Dutch's Dozen" -#define NAME_FACTION_PIRATE "Pirates of Free Space" -#define NAME_FACTION_GLADIATOR "Gladiators" -#define NAME_FACTION_PIZZA "Pizza Galaxy" -#define NAME_FACTION_SOUTO "Souto Space" -#define NAME_FACTION_THREEWE "Three World Empire" -//ZOMBIE -#define NAME_FACTION_ZOMBIE "Zombie Horde" -//YAUTJA -#define NAME_FACTION_YAUTJA "Yautja Hanting Groop" -//XENOS -#define NAME_FACTION_XENOMORPH "Xenomorphs" -#define NAME_FACTION_XENOMORPH_NORMAL "Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_CORRUPTED "Corrupted Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_ALPHA "Alpha Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_BRAVO "Bravo Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_CHARLIE "Charlie Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_DELTA "Delta Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_FERAL "Feral Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_FORSAKEN "Forsaken Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_TAMED "Tamed Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_MUTATED "Mutated Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_YAUTJA "Yautja Xenomorph Hive" -#define NAME_FACTION_XENOMORPH_RENEGADE "Renegade Xenomorph Hive" diff --git a/code/datums/factions/clf.dm b/code/datums/factions/clf.dm index 52cb64ebf0f3..7112c04e32e8 100644 --- a/code/datums/factions/clf.dm +++ b/code/datums/factions/clf.dm @@ -1,5 +1,11 @@ /datum/faction/clf name = "Colonial Liberation Front" + desc = "The Colonial Liberation Front is a paramilitary group primarily located in the Neroid sector of United Americas space. Their stated goal is to secure the independence of all of the colonies in the Neroid sector. They are the largest and most active militant group pushing for the independence of the colonies. \ + The United Americas government classifies the CLF as a terrorist organization, with membership in the organization or providing financial or material support for the CLF being prosecutable offenses. The CLF grew organically from several different groups that formed in the wake of the Slaughter of Xibou in 2164. Prior to the slaughter of Xibou the conflicts between the United Americas government and the colonists of the Neroid sector had remained mostly non-violent. \ + The sudden increase in tensions after Xibou, combined with the images of slaughtered fighters and civilians alike, greatly increased the willingness of the colonists to take up arms against the United Americas. Several different militant groups formed in the years following the Slaughter, and as they negotiated with one another and found common cause the CLF was formed from their union." + code_identificator = FACTION_CLF + + relations_pregen = RELATIONS_FACTION_CLF /datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/colonists.dm b/code/datums/factions/colonists.dm new file mode 100644 index 000000000000..90a8b9762caf --- /dev/null +++ b/code/datums/factions/colonists.dm @@ -0,0 +1,6 @@ +/datum/faction/colonist + name = "Colonists" + desc = "Colonists, the most ordinary citizens of the colonies, ADDITIONAL INFORMATION IS CHANGED" + faction_name = FACTION_COLONIST + + faction_iff_tag_type = /obj/item/faction_tag/colonist diff --git a/code/datums/factions/contractor.dm b/code/datums/factions/contractor.dm index b9b7d56a2cb9..787fa1e2a0e3 100644 --- a/code/datums/factions/contractor.dm +++ b/code/datums/factions/contractor.dm @@ -1,2 +1,6 @@ /datum/faction/contractor name = "Vanguard's Arrow Incorporated" + desc = "There is no information" + code_identificator = FACTION_CONTRACTOR + + faction_iff_tag_type = /obj/item/faction_tag/contractor diff --git a/code/datums/factions/dutchs_dozen.dm b/code/datums/factions/dutchs_dozen.dm new file mode 100644 index 000000000000..684fb6b9ab33 --- /dev/null +++ b/code/datums/factions/dutchs_dozen.dm @@ -0,0 +1,5 @@ +/datum/faction/dutchs_dozen + name = "Dutch's Dozen" + desc = "Like the Colonial Liberation Front and the better-equipped Freelancer Mercenaries before them, the Dozens start with non-standard UA weaponry, employing equipment of the United Americas such as the M16A2 assault rifle and the minigun. While the weapons on their own are outdated and cannot take most attachments, their automatic weaponry is equally deadly, meant for hunting their targets. \ + The Dozens will also expect a guerrilla style of gameplay, as unlike most modern forces of this era, the Dozens use special techniques related to survival and can handle themselves on the ground without support. Whether it would take place in a jungle landscape or in urban grounds. One advantage of the Dutch's Mercenary Team is their speed and aggressiveness, which are primarily used to eliminate their target(s), due to the target's equal amount of speed, aggressiveness and robustness." + code_identificator = FACTION_DUTCH diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index 96edeacdb7d6..c509f86f7982 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -1,9 +1,7 @@ /datum/faction - var/name = NAME_FACTION_NEUTRAL + var/name = "Neutral Faction" var/desc = "Neutral Faction" - var/code_identificator = FACTION_NEUTRAL - var/faction_flags = NO_FLAGS var/hud_type = FACTION_HUD var/color = "#22888a" diff --git a/code/datums/factions/freelancer.dm b/code/datums/factions/freelancer.dm new file mode 100644 index 000000000000..925df97c70e2 --- /dev/null +++ b/code/datums/factions/freelancer.dm @@ -0,0 +1,6 @@ +/datum/faction/freelancers + name = "Freelancer Mercenaries" + desc = "The term Freelancers come in various forms. Whether one is an independent entrepreneur selling services or a Freelance worker offering their labour for cash. In the business of killing and protecting, the term Freelancers are usually associated with a group of mercenaries that bare such a moniker. \ + These Freelance Mercenaries have become a small but noticeable security firm that has grown somewhat popular in the outer rim of the galaxy. Yet many sovereign nations view them as a nuisance because of the many questionable activities they've conducted. \ + None the less they're the least hated group in the galaxy as they've usually kept out of any major incidents that would reflect poorly on the Freelancers. Their alignment in the grand scheme of things usually favour those who pay them, with or without ethics." + code_identificator = FACTION_FREELANCER diff --git a/code/datums/factions/gladiator.dm b/code/datums/factions/gladiator.dm new file mode 100644 index 000000000000..fff986257305 --- /dev/null +++ b/code/datums/factions/gladiator.dm @@ -0,0 +1,4 @@ +/datum/faction/gladiator + name = "Gladiators" + desc = "Warning, something corrupted, this is row is not exist. Our story teller is SLEEPING, try again in some weeks." + code_identificator = FACTION_GLADIATOR diff --git a/code/datums/factions/hefa_order.dm b/code/datums/factions/hefa_order.dm new file mode 100644 index 000000000000..2f3c9e6bb491 --- /dev/null +++ b/code/datums/factions/hefa_order.dm @@ -0,0 +1,7 @@ +/datum/faction/hefa + name = "HEFA Knights" + desc = "The Holy Order of the High-Explosive Fragmenting-Antipersonnel hand grenade (also known as the HEFA Knights, the Knights of HEFA, and or the HEFA Order), is a religious cult that is actively opposed to the United Americas and the Union of Progressive Peoples. \ + The Order's operations are loosely coordinated between two cell types, a 'temple' group, acting as a dispatch and administration center, and a 'shard' or more traditionally described splinter that actually carries out the strike. \ + It is believed that all HEFA Knight 'temple' cells operate out of the derelict Kerchner 2155 Horn Nebula mining expedition way-stations due to their proximity to supply lanes leading to the Neroid sector and other frontier sectors. The group is classified as an intergalactic terrorist organization by both the UPP, and UA. \ + HEFA Knight members or Shrapnelsworn, are devoted to the worship of the M40 High-Explosive Fragmenting-Antipersonnel hand grenade, viewing the object as a divine gift from an unknown benefactor that has influenced humanity. Order members are trained to have no regard for their personal safety. To die in battle is to die gloriously, and to solidify one's devotion to the HEFA hand grenade." + code_identificator = FACTION_HEFA diff --git a/code/datums/factions/mercenary.dm b/code/datums/factions/mercenary.dm new file mode 100644 index 000000000000..6cb91cc5bc1c --- /dev/null +++ b/code/datums/factions/mercenary.dm @@ -0,0 +1,4 @@ +/datum/faction/mercenary + name = "Mercenary Group" + desc = "Warning, potential dead story teller." + code_identificator = FACTION_MERCENARY diff --git a/code/datums/factions/pirate.dm b/code/datums/factions/pirate.dm new file mode 100644 index 000000000000..477f3d4c9be7 --- /dev/null +++ b/code/datums/factions/pirate.dm @@ -0,0 +1,4 @@ +/datum/faction/pirate + name = "Pirates of Free Space" + desc = "Pirates, all information encrupted." + code_identificator = FACTION_PIRATE diff --git a/code/datums/factions/pizza_delivery.dm b/code/datums/factions/pizza_delivery.dm new file mode 100644 index 000000000000..338f1d310cb4 --- /dev/null +++ b/code/datums/factions/pizza_delivery.dm @@ -0,0 +1,6 @@ +/datum/faction/pizza + name = "Pizza Galaxy" + desc = "Pizza Galaxy is the galaxy's largest pizza chain, known for its incredible variety in pizzas, and pizza related products. Customers can get anything from a plain cheese pizza, to a pizza stuffed Mr. Pizza Man mascot, with ranch cups for eyes. \ + Most Pizza Galaxy stations also have a play room for kids, called \"Pizza Party\". Pizza Galaxy is a big employer, from 16 year olds trying to pay off space college, to 40 year olds who just got discharged from the USCM for thinking that the MP was a \"red communist\". \ + The current owner and CEO of Pizza Galaxy is Mr. James Kepplinger, a prestigious businessman with a knack for bargaining." + code_identificator = FACTION_PIZZA diff --git a/code/datums/factions/ress.dm b/code/datums/factions/ress.dm new file mode 100644 index 000000000000..b31c96e33aa0 --- /dev/null +++ b/code/datums/factions/ress.dm @@ -0,0 +1,4 @@ +/datum/faction/ress + name = "Royal Empire of the Shining Sun" + desc = "No information given, please update your local data." + code_identificator = FACTION_RESS diff --git a/code/datums/factions/souto.dm b/code/datums/factions/souto.dm new file mode 100644 index 000000000000..980f2bd98efb --- /dev/null +++ b/code/datums/factions/souto.dm @@ -0,0 +1,4 @@ +/datum/faction/souto + name = "Souto Space" + desc = "Souto delivery, information encrypted due to error." + code_identificator = FACTION_SOUTO diff --git a/code/datums/factions/royalmarinescommando.dm b/code/datums/factions/threewe/royalmarinescommando.dm similarity index 94% rename from code/datums/factions/royalmarinescommando.dm rename to code/datums/factions/threewe/royalmarinescommando.dm index d03add1147f2..ab308130c4b5 100644 --- a/code/datums/factions/royalmarinescommando.dm +++ b/code/datums/factions/threewe/royalmarinescommando.dm @@ -1,7 +1,9 @@ -/datum/faction/royal_marines_commando - name = "Royal Marines Commando" +/datum/faction/threewe/royal_commando + name = "Three World Empire Royal Commando" + desc = "No information given, please update your local data." + code_identificator = FACTION_TWE -/datum/faction/royal_marines_commando/modify_hud_holder(image/holder, mob/living/carbon/human/H) +/datum/faction/threewe/royal_commando/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state var/obj/item/card/id/dogtag/ID = H.get_idcard() var/_role @@ -25,7 +27,7 @@ if(hud_icon_state) holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "rmc_[hud_icon_state]") -/datum/faction/royal_marines_commando/get_antag_guns_snowflake_equipment() +/datum/faction/threewe/royal_commando/get_antag_guns_snowflake_equipment() return list( list("PRIMARY FIREARMS", 0, null, null, null), list("F903A1 Rifle", 20, /obj/item/weapon/gun/rifle/rmc_f90, null, VENDOR_ITEM_REGULAR), diff --git a/code/datums/factions/threewe/threewe.dm b/code/datums/factions/threewe/threewe.dm new file mode 100644 index 000000000000..267963c5e683 --- /dev/null +++ b/code/datums/factions/threewe/threewe.dm @@ -0,0 +1,8 @@ +/datum/faction/threewe + name = "Three World Empire" + desc = "Formed in 2088, the Three World Empire (3WE) was a federation of nations created by the joining of the United Kingdom and Japan, as well as allied nations including India, Indonesia, and Australia. Following the formation of this federation, the Japanese Yutani Corporation purchased and merged with the British Weyland Corporation leading to the 3WE’s status as the most significant economic force in Sol. The name, Three World Empire, is drawn from the first three worlds colonized by humanity: Earth, Mars, and Titan. \ + Supported by the technological advances of the Weyland-Yutani Corporation, the Three World Empire quickly amassed the largest and most advanced naval fleet that humanity had ever seen. These advances in Starflight allowed members of the 3WE to be the first humans to leave the cradle of Sol in search of new homes among the stars. As a result, the 3WE has colonized a plurality of all known resource-rich and naturally habitable worlds. \ + These early colonies would come to be known as the Core Systems. Due to their heavy reliance on the navy, the Three World Empire can ill afford to field a large standing army like the United Americas (UA) or the Union of Progressive Peoples (UPP). The safety of its territories outside of Sol is primarily contracted to Weyland-Yutani Private Military Contractors (PMCs) as well as the UA’s United States Colonial Marine Corps (USCMC). \ + While the USCMC is exclusively tasked with patrol and rapid response, Wey-Yu PMCs fill a wide array of roles. While the contractors are primarily hired to patrol and garrison 3WE territory, it is not uncommon to see them filling the role of peacekeepers not dissimilar to beat cops on worlds without a strong Colonial Marshal presence. For its economic influence and role in the Three World Empire’s stability and prosperity, Weyland-Yutani was granted a permanent seat in the Empire’s Parliament. \ + So far, Weyland-Yutani is the only non-governmental entity to be bestowed this honour. While all governmental parties claim that Weyland-Yutani has remained unbiased in its governance, none can deny that since being invited into Parliament, the Corporation’s economic power has increased ten-fold. In contrast, the majority of its competition have floundered under strict economic regulation and bureaucratic red tape." + code_identificator = FACTION_THREEWE diff --git a/code/datums/factions/upp.dm b/code/datums/factions/upp.dm index a60106eaa7b0..82193e826fbd 100644 --- a/code/datums/factions/upp.dm +++ b/code/datums/factions/upp.dm @@ -1,5 +1,13 @@ /datum/faction/upp name = "Union of Progressive Peoples" + desc = "A wide-reaching and powerful socialist authoritarian state. The UPP acts as the political and ideological rival of the United States and the UA. Though they have a relatively large presence on Earth (particularly in the Eastern sphere), the UPP is also largely active in colonizing the frontier. \ + While the United Americas have never engaged the UPP in an official war, hostilities broke out between a USCM Task Force and a UPP Expeditionary Force during Operation Canton in mid 2165. The engagement ended in a ceasefire. The reason was fears that the conflict would spread to the more densely populated Sol System. \ + The incident greatly enraged many senior officials in the UPP, who viewed the battle of Canton as an attempt by the United States to annex UPP sovereign territory. “Such an insult (referring to Canton) can only be repaid in American blood. Mark my words, this will happen”, Kolonel Ganbaatar of the UPP Armed Forces was quoted saying in May 2168." + code_identificator = FACTION_UPP + + relations_pregen = RELATIONS_FACTION_UPP + + faction_iff_tag_type = /obj/item/faction_tag/upp /datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/cmb.dm b/code/datums/factions/uscm/cmb.dm similarity index 78% rename from code/datums/factions/cmb.dm rename to code/datums/factions/uscm/cmb.dm index db901ac7672a..4e86d07c29ae 100644 --- a/code/datums/factions/cmb.dm +++ b/code/datums/factions/uscm/cmb.dm @@ -1,7 +1,10 @@ -/datum/faction/cmb +/datum/faction/uscm/cmb name = "Colonial Marshal Bureau" + code_identificator = FACTION_CMB -/datum/faction/cmb/modify_hud_holder(image/holder, mob/living/carbon/human/H) + faction_iff_tag_type = /obj/item/faction_tag/uscm/cmb + +/datum/faction/uscm/cmb/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state var/obj/item/card/id/ID = H.get_idcard() var/_role @@ -32,3 +35,4 @@ hud_icon_state = "spec" if(hud_icon_state) holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "cmb_[hud_icon_state]") + diff --git a/code/datums/factions/uscm/marine.dm b/code/datums/factions/uscm/marine.dm new file mode 100644 index 000000000000..f3ae292d7903 --- /dev/null +++ b/code/datums/factions/uscm/marine.dm @@ -0,0 +1,5 @@ +/datum/faction/uscm/marine + name = NAME_FACTION_MARINE + code_identificator = FACTION_MARINE + + faction_iff_tag_type = /obj/item/faction_tag/uscm/marine diff --git a/code/datums/factions/uscm/marsoc.dm b/code/datums/factions/uscm/marsoc.dm new file mode 100644 index 000000000000..15eadb26d93a --- /dev/null +++ b/code/datums/factions/uscm/marsoc.dm @@ -0,0 +1,6 @@ +/datum/faction/uscm/marsoc + name = NAME_FACTION_MARSOC + desc = "Decryption required" + code_identificator = FACTION_MARSOC + + faction_iff_tag_type = /obj/item/faction_tag/uscm/marsoc diff --git a/code/datums/factions/uscm.dm b/code/datums/factions/uscm/uscm.dm similarity index 78% rename from code/datums/factions/uscm.dm rename to code/datums/factions/uscm/uscm.dm index a259000c970e..f99e270c9dab 100644 --- a/code/datums/factions/uscm.dm +++ b/code/datums/factions/uscm/uscm.dm @@ -1,5 +1,13 @@ /datum/faction/uscm name = "United States Colonial Marines" + desc = "The USCM is divided into three overarching branches, called the Marine Space Forces: Sol, overseeing the core colonies and earth, the largest of the three; Eridani, operating among the Chinese and American colonised arms; Herculis, going through the Anglo-Japanese arms and the outer fringes. Each branch operates independently, but all are responsible for protecting American space territory and working together in that goal. \ + There is also a fourth group, the Reserves, which is stationed mostly on earth and serves to reinforce the other branches. They have not seen any active use yet, but who knows what the future holds. Marine Space Force, Herculis, Chinook 91 GSO station is a military space station in geosynchronous orbit around the colony world Georgia 525 (70 Ophiuchi A V), and is the headquarters for the Herculis branch of the USCM. Under its control are the 4th Colonial Marine Division, 4th Colonial Marine Brigade, 4th Aerospace Wing, and 1st Colonial Support Group of the USCM. \ + Chinook 91 reports directly to O'Neill station in Earth-Lunar space. The O'Neill station is the main communication base between the three branches. Supervising orders from the homeworld, controlling the First Fleet and rare joint operations. It is an extremely vital station and well guarded by the First Fleet in all its might. Tithonis Mountain on Bernice 378 is another large garrison of USCM troops, such as the 1st Colonial Support Group, and there are more minor garrisons along the Anglo-Japanese arm. The 2nd Company of the 2nd Battalion of the 4th Brigade, the Falling Falcons, and the USS Almayer are stationed in Herculis." + code_identificator = FACTION_USCM + + relations_pregen = RELATIONS_FACTION_USCM + + faction_iff_tag_type = /obj/item/faction_tag/uscm /datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/datum/squad/squad = current_human.assigned_squad diff --git a/code/datums/factions/wy.dm b/code/datums/factions/wy.dm deleted file mode 100644 index 82ce1116b3d4..000000000000 --- a/code/datums/factions/wy.dm +++ /dev/null @@ -1,44 +0,0 @@ -/datum/faction/wy - name = "Weyland-Yutani Corporation" - -/datum/faction/wy/modify_hud_holder(image/holder, mob/living/carbon/human/user) - var/hud_icon_state - var/obj/item/card/id/id_card = user.get_idcard() - var/role - if(user.mind) - role = user.job - else if(id_card) - role = id_card.rank - switch(role) - if(JOB_WY_GOON) - hud_icon_state = "goon_normal" - if(JOB_WY_GOON_LEAD) - hud_icon_state = "goon_leader" - if(JOB_WY_GOON_RESEARCHER) - hud_icon_state = "goon_sci" - if(JOB_WY_GOON_TECH) - hud_icon_state = "goon_engi" - if(JOB_CORPORATE_LIAISON) - hud_icon_state = "liaison" - if(JOB_EXECUTIVE) - hud_icon_state = "liaison" - if(JOB_SENIOR_EXECUTIVE) - hud_icon_state = "senior_exec" - if(JOB_EXECUTIVE_SPECIALIST) - hud_icon_state = "exec_spec" - if(JOB_EXECUTIVE_SUPERVISOR) - hud_icon_state = "exec_super" - if(JOB_ASSISTANT_MANAGER) - hud_icon_state = "ass_man" - if(JOB_DIVISION_MANAGER) - hud_icon_state = "div_man" - if(JOB_CHIEF_EXECUTIVE) - hud_icon_state = "chief_man" - if(JOB_TRAINEE) - hud_icon_state = "trainee" - if(JOB_JUNIOR_EXECUTIVE) - hud_icon_state = "junior_exec" - if(JOB_DIRECTOR) - hud_icon_state = "director" - if(hud_icon_state) - holder.overlays += image('icons/mob/hud/marine_hud.dmi', user, "wy_[hud_icon_state]") diff --git a/code/datums/factions/wy/deathsquad.dm b/code/datums/factions/wy/deathsquad.dm new file mode 100644 index 000000000000..3e11f7ba1d72 --- /dev/null +++ b/code/datums/factions/wy/deathsquad.dm @@ -0,0 +1,6 @@ +/datum/faction/wy/deathsquad + name = "Corporate Commandos" + desc = "Decryption required" + code_identificator = FACTION_WY_DEATHSQUAD + + faction_iff_tag_type = /obj/item/faction_tag/wy/death_sqaud diff --git a/code/datums/factions/pmc.dm b/code/datums/factions/wy/pmc.dm similarity index 77% rename from code/datums/factions/pmc.dm rename to code/datums/factions/wy/pmc.dm index e924eca3b044..c094c23aa7ca 100644 --- a/code/datums/factions/pmc.dm +++ b/code/datums/factions/wy/pmc.dm @@ -1,5 +1,9 @@ -/datum/faction/pmc +/datum/faction/wy/pmc name = "Private Military Company" + desc = "Weyland-Yutani PMCs are military personnel owned and operated by the company. They are equipped with advanced modern military equipment and weaponry akin to the USCM and similar national militaries. The tasks of the PMCs are never limited to one specific job and they are often deployed on 'shadow missions'. Their deployment is often kept secret from the USCM to avoid conflict with the anti-corporate officers in the USCM. The recruitment process largely consists of those who have personal contacts with higher Weyland-Yutani employees, or those who have caught the eye of the superiors and been hand-picked. The superiors value abilities in the field and willingness to obey company directives, for a large sum of money, despite of their moral beliefs. Following the defeat of the Dust Raiders and the withdrawal of the United Americas of the Neroid sector, a group of employees became skilled mercenaries. They are part of Weyland-Yutani's Task Force Oberon that was stationed aboard the USCSS Royce, a powerful Weyland-Yutani cruiser that patrols the outer edges of the Neroid sector. Under the directive of Weyland-Yutani's board member Johan Almric, they act as private security for company science teams. The USCSS Royce contains a crew of roughly two hundred PMCs, and one hundred scientists and support personnel. Rumors say that a Weyland-Yutani Special Task Force known as \"Royal\" of the USCSS Lunalorne are part of a different specialization, designed to capture anomalies associated with alien and supernatural life." + code_identificator = FACTION_PMC + + faction_iff_tag_type = /obj/item/faction_tag/wy/pmc /datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state diff --git a/code/datums/factions/wy/wy.dm b/code/datums/factions/wy/wy.dm new file mode 100644 index 000000000000..7b38d8bef5cf --- /dev/null +++ b/code/datums/factions/wy/wy.dm @@ -0,0 +1,52 @@ +/datum/faction/wy + name = "Weyland-Yutani Corporation" + desc = "Weyland Yutani also known as \"the Company\", has a wide range of business. This includes dealing with high-tech armaments, synthetic humanoids, spaceships, computer parts, terraforming equipment, and household appliances. They also offers shipping and receiving services, among other ventures. Following an aggressive expansion into terraforming new colonial world, Weyland-Yutani secured rights and privileges from the United States government. One of those privileges is the close relationship with the USCM. \ + the Colonial Marines use corporate-supplied equipment in exchange for protecting and monitoring border colonies. This, however, does not mean that the interests of the company are aligned with the USCM. It is more accurate to say that Weyland-Yutani considers the USCM a valuable, but still disposable, asset. This has led to an increasing amount of hostility between the two factions. Weyland-Yutani has enough wealth and influence to hire private military contractors. These are highly trained mercenaries, generally ex-military veterans. \ + They do black site protection detail, undertaking dangerous assignments, and otherwise supply Weyland-Yutani with firepower in the absence of the USCM. They are compensated well for their services, and demand is always there. Rumors speak of even more well-equipped and well-selected military units within Weyland-Yutani's employment, but that is not officially verified. The Company has refused to comment on it." + code_identificator = FACTION_WY + + relations_pregen = RELATIONS_FACTION_WY + + faction_iff_tag_type = /obj/item/faction_tag/wy + +/datum/faction/wy/modify_hud_holder(image/holder, mob/living/carbon/human/user) + var/hud_icon_state + var/obj/item/card/id/id_card = user.get_idcard() + var/role + if(user.mind) + role = user.job + else if(id_card) + role = id_card.rank + switch(role) + if(JOB_WY_GOON) + hud_icon_state = "goon_normal" + if(JOB_WY_GOON_LEAD) + hud_icon_state = "goon_leader" + if(JOB_WY_GOON_RESEARCHER) + hud_icon_state = "goon_sci" + if(JOB_WY_GOON_TECH) + hud_icon_state = "goon_engi" + if(JOB_CORPORATE_LIAISON) + hud_icon_state = "liaison" + if(JOB_EXECUTIVE) + hud_icon_state = "liaison" + if(JOB_SENIOR_EXECUTIVE) + hud_icon_state = "senior_exec" + if(JOB_EXECUTIVE_SPECIALIST) + hud_icon_state = "exec_spec" + if(JOB_EXECUTIVE_SUPERVISOR) + hud_icon_state = "exec_super" + if(JOB_ASSISTANT_MANAGER) + hud_icon_state = "ass_man" + if(JOB_DIVISION_MANAGER) + hud_icon_state = "div_man" + if(JOB_CHIEF_EXECUTIVE) + hud_icon_state = "chief_man" + if(JOB_TRAINEE) + hud_icon_state = "trainee" + if(JOB_JUNIOR_EXECUTIVE) + hud_icon_state = "junior_exec" + if(JOB_DIRECTOR) + hud_icon_state = "director" + if(hud_icon_state) + holder.overlays += image('icons/mob/hud/marine_hud.dmi', user, "wy_[hud_icon_state]") diff --git a/code/datums/factions/xeno/alpha.dm b/code/datums/factions/xeno/alpha.dm new file mode 100644 index 000000000000..bc54124b6134 --- /dev/null +++ b/code/datums/factions/xeno/alpha.dm @@ -0,0 +1,9 @@ +/datum/faction/xenomorph/alpha + name = "Alpha Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_ALPHA + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/alpha + + prefix = "Alpha " + color = "#ff4040" + ui_color = "#992626" diff --git a/code/datums/factions/xeno/bravo.dm b/code/datums/factions/xeno/bravo.dm new file mode 100644 index 000000000000..234d5b9ab796 --- /dev/null +++ b/code/datums/factions/xeno/bravo.dm @@ -0,0 +1,9 @@ +/datum/faction/xenomorph/bravo + name = "Bravo Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_BRAVO + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/bravo + + prefix = "Bravo " + color = "#ffff80" + ui_color = "#99994d" diff --git a/code/datums/factions/xeno/charlie.dm b/code/datums/factions/xeno/charlie.dm new file mode 100644 index 000000000000..d2a07fc3b8e8 --- /dev/null +++ b/code/datums/factions/xeno/charlie.dm @@ -0,0 +1,9 @@ +/datum/faction/xenomorph/charlie + name = "Charlie Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_CHARLIE + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/charlie + + prefix = "Charlie " + color = "#bb40ff" + ui_color = "#702699" diff --git a/code/datums/factions/xeno/corrupted.dm b/code/datums/factions/xeno/corrupted.dm new file mode 100644 index 000000000000..cc9190ca28b7 --- /dev/null +++ b/code/datums/factions/xeno/corrupted.dm @@ -0,0 +1,42 @@ +/datum/faction/xenomorph/corrupted + name = "Corrupted Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_CORRUPTED + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/corrupted + + prefix = "Corrupted " + color = "#80ff80" + ui_color ="#4d994d" + +/datum/faction/xenomorph/corrupted/add_mob(mob/living/carbon/xenomorph/X) + . = ..() + X.add_language(LANGUAGE_ENGLISH) + +/datum/faction/xenomorph/corrupted/remove_mob(mob/living/carbon/xenomorph/X, hard) + . = ..() + X.remove_language(LANGUAGE_ENGLISH) + + +/datum/faction/xenomorph/corrupted/tamed + name = "Tamed Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_TAMED + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/tamed + + prefix = "Tamed " + color = "#80ff80" + + dynamic_evolution = FALSE + allow_no_queen_actions = TRUE + allow_queen_evolve = FALSE + ignore_slots = TRUE + +/datum/faction/xenomorph/corrupted/tamed/New() + . = ..() + faction_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0 + faction_structures_limit[XENO_STRUCTURE_EVOPOD] = 0 + +/datum/faction/xenomorph/corrupted/tamed/add_mob(mob/living/carbon/xenomorph/xenomorph) + . = ..() + if(faction_leader) + xenomorph.faction = faction_leader.faction diff --git a/code/datums/factions/xeno/delta.dm b/code/datums/factions/xeno/delta.dm new file mode 100644 index 000000000000..7b59be6900bb --- /dev/null +++ b/code/datums/factions/xeno/delta.dm @@ -0,0 +1,9 @@ +/datum/faction/xenomorph/delta + name = "Delta Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_DELTA + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/delta + + prefix = "Delta " + color = "#8080ff" + ui_color = "#4d4d99" diff --git a/code/datums/factions/xeno/feral.dm b/code/datums/factions/xeno/feral.dm new file mode 100644 index 000000000000..7833a68d308e --- /dev/null +++ b/code/datums/factions/xeno/feral.dm @@ -0,0 +1,15 @@ +/datum/faction/xenomorph/feral + name = "Feral Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_FERAL + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/feral + + prefix = "Feral " + color = "#828296" + ui_color = "#828296" + + construction_allowed = XENO_QUEEN + dynamic_evolution = FALSE + allow_no_queen_actions = TRUE + allow_queen_evolve = FALSE + ignore_slots = TRUE diff --git a/code/datums/factions/xeno/forsaken.dm b/code/datums/factions/xeno/forsaken.dm new file mode 100644 index 000000000000..64e0f3f62257 --- /dev/null +++ b/code/datums/factions/xeno/forsaken.dm @@ -0,0 +1,15 @@ +/datum/faction/xenomorph/forsaken + name = "Forsaken Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_FORSAKEN + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/forsaken + + prefix = "Feral " + color = "#828296" + ui_color = "#828296" + + construction_allowed = XENO_QUEEN + dynamic_evolution = FALSE + allow_no_queen_actions = TRUE + allow_queen_evolve = FALSE + ignore_slots = TRUE diff --git a/code/datums/factions/xeno/mutated.dm b/code/datums/factions/xeno/mutated.dm new file mode 100644 index 000000000000..90a38136704f --- /dev/null +++ b/code/datums/factions/xeno/mutated.dm @@ -0,0 +1,11 @@ +/datum/faction/xenomorph/mutated + name = "Mutated Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_MUTATED + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/mutated + + prefix = "Mutated " + color = "#6abd99" + ui_color = "#6abd99" + + hive_inherant_traits = list(TRAIT_XENONID) diff --git a/code/datums/factions/xeno/normal.dm b/code/datums/factions/xeno/normal.dm new file mode 100644 index 000000000000..131e48a40960 --- /dev/null +++ b/code/datums/factions/xeno/normal.dm @@ -0,0 +1,9 @@ +/datum/faction/xenomorph/normal + name = "Mutated Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_NORMAL + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/normal + + evolution_without_ovipositor = FALSE + color = null + ui_color = null diff --git a/code/datums/factions/xeno/renegade.dm b/code/datums/factions/xeno/renegade.dm new file mode 100644 index 000000000000..1a9004eb61da --- /dev/null +++ b/code/datums/factions/xeno/renegade.dm @@ -0,0 +1,15 @@ +/datum/faction/xenomorph/renegade + name = "Renegade Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_RENEGADE + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/renegade + + dynamic_evolution = FALSE + allow_no_queen_actions = TRUE + allow_queen_evolve = FALSE + ignore_slots = TRUE + + need_round_end_check = TRUE + +/datum/faction/xenomorph/renegade/can_delay_round_end(mob/living/carbon/C) + return FALSE diff --git a/code/datums/factions/xeno/xeno.dm b/code/datums/factions/xeno/xeno.dm new file mode 100644 index 000000000000..6264822b2141 --- /dev/null +++ b/code/datums/factions/xeno/xeno.dm @@ -0,0 +1,385 @@ +/datum/faction/xenomorph + name = "Xenomorphs" + desc = "Xenomorph hive among the all other hives." + code_identificator = FACTION_XENOMORPH + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph + relations_pregen = RELATIONS_FACTION_XENOMORPH + +/datum/faction/xenomorph/faction_is_ally(datum/faction/faction) + if(!living_xeno_queen) + return FALSE + . = ..() + +/datum/faction/xenomorph/New() + . = ..() + mutators = new(src) + mark_ui = new(src) + faction_ui = new(src) + +/datum/faction/xenomorph/can_delay_round_end(mob/living/carbon/carbon) + if(!faction_is_ally(GLOB.faction_datums[FACTION_MARINE])) + return TRUE + return FALSE + +// Adds a xeno to this hive +/datum/faction/xenomorph/add_mob(mob/living/carbon/xenomorph/xenomorph) + if(!xenomorph || !istype(xenomorph)) + return + + // If the xeno is part of another hive, they should be removed from that one first + if(xenomorph.faction && xenomorph.faction != src) + xenomorph.faction.remove_mob(xenomorph, TRUE) + + // Already in the hive + if(xenomorph in totalMobs) + return + + // Can only have one queen. + if(isqueen(xenomorph)) + if(!living_xeno_queen && !xenomorph.statistic_exempt) // Don't consider xenos in admin level + set_living_xeno_queen(xenomorph) + + xenomorph.faction = src + + if(xenomorph.hud_list) + xenomorph.hud_update() + + if(!xenomorph.statistic_exempt) + totalMobs += xenomorph + if(xenomorph.tier == 2) + tier_2_xenos += xenomorph + else if(xenomorph.tier == 3) + tier_3_xenos += xenomorph + + // Xenos are a fuckfest of cross-dependencies of different datums that are initialized at different times + // So don't even bother trying updating UI here without large refactors + +// Removes the xeno from the hive +/datum/faction/xenomorph/remove_mob(mob/living/carbon/xenomorph/xenomorph, hard = FALSE, light_mode = FALSE) + if(!xenomorph || !istype(xenomorph)) + return + + // Make sure the xeno was in the hive in the first place + if(!(xenomorph in totalMobs)) + return + + if(isqueen(xenomorph)) + if(living_xeno_queen == xenomorph) + var/mob/living/carbon/xenomorph/queen/next_queen + for(var/mob/living/carbon/xenomorph/queen/Q in totalMobs) + if(!Q.statistic_exempt) + continue + next_queen = Q + break + + set_living_xeno_queen(next_queen) // either null or a queen + + // We allow "soft" removals from the hive (the xeno still retains information about the hive) + // This is so that xenos can add themselves back to the hive if they should die or otherwise go "on leave" from the hive + if(hard) + xenomorph.faction = null + + totalMobs -= xenomorph + if(xenomorph.tier == 2) + tier_2_xenos -= xenomorph + else if(xenomorph.tier == 3) + tier_3_xenos -= xenomorph + + if(!light_mode) + faction_ui.update_xeno_counts() + faction_ui.xeno_removed(xenomorph) + +/datum/faction/xenomorph/get_faction_info(mob/user) + if(!user || !faction_ui) + return + + if(!faction_ui.data_initialized) + faction_ui.update_all_data() + + faction_ui.tgui_interact(user) + return TRUE + +/datum/faction/xenomorph/get_join_status(mob/new_player/user, dat) + if(SSticker.current_state != GAME_STATE_PLAYING || !SSticker.mode) + to_chat(user, SPAN_WARNING(user.client.auto_lang(LANGUAGE_LOBBY_ROUND_NO_JOIN))) + return + + if(alert(user, user.client.auto_lang(LANGUAGE_LOBBY_JOIN_XENOMORPH), user.client.auto_lang(LANGUAGE_CONFIRM), user.client.auto_lang(LANGUAGE_YES), user.client.auto_lang(LANGUAGE_NO)) == user.client.auto_lang(LANGUAGE_YES)) + if(SSticker.mode.check_xeno_late_join(user)) + var/mob/new_xeno = SSticker.mode.attempt_to_join_as_xeno(user, 0) + if(new_xeno && !istype(new_xeno, /mob/living/carbon/xenomorph/larva)) + SSticker.mode.transfer_xenomorph(user, new_xeno) + user.close_spawn_windows() + + +//LANDMARKS +/datum/xeno_mark_define + var/name = "xeno_declare" + var/icon_state = "empty" + var/desc = "Xenos make psychic markers with this meaning as positional lasting communication to eachother" + +/datum/xeno_mark_define/fortify + name = "Fortify" + desc = "Fortify this area!" + icon_state = "fortify" + +/datum/xeno_mark_define/weeds + name = "Need Weeds" + desc = "Need weeds here!" + icon_state = "weed" + +/datum/xeno_mark_define/nest + name = "Nest" + desc = "Nest enemies here!" + icon_state = "nest" + +/datum/xeno_mark_define/hosts + name = "Hosts" + desc = "Hosts here!" + icon_state = "hosts" + +/datum/xeno_mark_define/aide + name = "Aide" + desc = "Aide here!" + icon_state = "aide" + +/datum/xeno_mark_define/defend + name = "Defend" + desc = "Defend the hive here!" + icon_state = "defend" + +/datum/xeno_mark_define/danger + name = "Danger Warning" + desc = "Caution, danger here!" + icon_state = "danger" + +/datum/xeno_mark_define/rally + name = "Rally" + desc = "Group up here!" + icon_state = "rally" + +/datum/xeno_mark_define/hold + name = "Hold" + desc = "Hold this area!" + icon_state = "hold" + +/datum/xeno_mark_define/ambush + name = "Ambush" + desc = "Ambush the enemy here!" + icon_state = "ambush" + +/datum/xeno_mark_define/attack + name = "Attack" + desc = "Attack the enemy here!" + icon_state = "attack" + + +//HIVE STATUS +/datum/hive_status_ui + var/name = "Hive Status" + + // Data to pass when rendering the UI (not static) + var/total_xenos + var/list/xeno_counts + var/list/tier_slots + var/list/xeno_vitals + var/list/xeno_keys + var/list/xeno_info + var/faction_location + var/burrowed_larva + var/evolution_level + + var/data_initialized = FALSE + + var/datum/faction/assoc_hive = null + +/datum/hive_status_ui/New(datum/faction/faction) + assoc_hive = faction + update_all_data() + START_PROCESSING(SShive_status, src) + +/datum/hive_status_ui/process() + update_xeno_vitals() + update_xeno_info(FALSE) + SStgui.update_uis(src) + +// Updates the list tracking how many xenos there are in each tier, and how many there are in total +/datum/hive_status_ui/proc/update_xeno_counts(send_update = TRUE) + xeno_counts = assoc_hive.get_xeno_counts() + + total_xenos = 0 + for(var/counts in xeno_counts) + for(var/caste in counts) + total_xenos += counts[caste] + + if(send_update) + SStgui.update_uis(src) + + xeno_counts[1] -= "Queen" // don't show queen in the amount of xenos + + // Also update the amount of T2/T3 slots + tier_slots = assoc_hive.get_tier_slots() + +// Updates the hive location using the area name of the defined hive location turf +/datum/hive_status_ui/proc/update_faction_location(send_update = TRUE) + if(!assoc_hive.faction_location) + return + + faction_location = strip_improper(get_area_name(assoc_hive.faction_location)) + + if(send_update) + SStgui.update_uis(src) + +// Updates the sorted list of all xenos that we use as a key for all other information +/datum/hive_status_ui/proc/update_xeno_keys(send_update = TRUE) + xeno_keys = assoc_hive.get_xeno_keys() + + if(send_update) + SStgui.update_uis(src) + +// Mildly related to the above, but only for when xenos are removed from the hive +// If a xeno dies, we don't have to regenerate all xeno info and sort it again, just remove them from the data list +/datum/hive_status_ui/proc/xeno_removed(mob/living/carbon/xenomorph/xenomorph) + if(!xeno_keys) + return + + for(var/index in 1 to length(xeno_keys)) + var/list/info = xeno_keys[index] + if(info["nicknumber"] == xenomorph.nicknumber) + + // tried Remove(), didn't work. *shrug* + xeno_keys[index] = null + xeno_keys -= null + return + + SStgui.update_uis(src) + +// Updates the list of xeno names, strains and references +/datum/hive_status_ui/proc/update_xeno_info(send_update = TRUE) + xeno_info = assoc_hive.get_xeno_info() + + if(send_update) + SStgui.update_uis(src) + +// Updates vital information about xenos such as health and location. Only info that should be updated regularly +/datum/hive_status_ui/proc/update_xeno_vitals() + xeno_vitals = assoc_hive.get_xeno_vitals() + +// Updates how many buried larva there are +/datum/hive_status_ui/proc/update_burrowed_larva(send_update = TRUE) + burrowed_larva = assoc_hive.stored_larva + if(SSxevolution) + evolution_level = SSxevolution.get_evolution_boost_power(assoc_hive) + else + evolution_level = 1 + + if(send_update) + SStgui.update_uis(src) + +// Updates all data except pooled larva +/datum/hive_status_ui/proc/update_all_xeno_data(send_update = TRUE) + update_xeno_counts(FALSE) + update_xeno_vitals() + update_xeno_keys(FALSE) + update_xeno_info(FALSE) + + if(send_update) + SStgui.update_uis(src) + +// Updates all data, including pooled larva +/datum/hive_status_ui/proc/update_all_data() + data_initialized = TRUE + update_all_xeno_data(FALSE) + update_burrowed_larva(FALSE) + SStgui.update_uis(src) + +/datum/hive_status_ui/ui_state(mob/user) + return GLOB.hive_state[assoc_hive.faction_name] + +/datum/hive_status_ui/ui_status(mob/user, datum/ui_state/state) + . = ..() + if(isobserver(user)) + return UI_INTERACTIVE + +/datum/hive_status_ui/ui_data(mob/user) + . = list() + .["total_xenos"] = total_xenos + .["xeno_counts"] = xeno_counts + .["tier_slots"] = tier_slots + .["xeno_keys"] = xeno_keys + .["xeno_info"] = xeno_info + .["xeno_vitals"] = xeno_vitals + .["queen_location"] = get_area_name(assoc_hive.living_xeno_queen) + .["faction_location"] = faction_location + .["burrowed_larva"] = burrowed_larva + .["evolution_level"] = evolution_level + + var/mob/living/carbon/xenomorph/queen/Q = user + .["is_in_ovi"] = istype(Q) && Q.ovipositor + +/datum/hive_status_ui/ui_static_data(mob/user) + . = list() + .["user_ref"] = REF(user) + .["hive_color"] = assoc_hive.ui_color + .["hive_name"] = assoc_hive.name + +/datum/hive_status_ui/tgui_interact(mob/user, datum/tgui/ui) + if(!assoc_hive) + return + + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "HiveStatus", "[assoc_hive.name] Status") + ui.set_autoupdate(FALSE) + ui.open() + +/datum/hive_status_ui/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + + switch(action) + if("give_plasma") + var/mob/living/carbon/xenomorph/target_xenomorph = locate(params["target_ref"]) in GLOB.living_xeno_list + var/mob/living/carbon/xenomorph/xenomorph = ui.user + + if(QDELETED(target_xenomorph) || target_xenomorph.stat == DEAD || target_xenomorph.statistic_exempt) + return + + if(xenomorph.stat == DEAD) + return + + var/datum/action/xeno_action/A = get_xeno_action_by_type(xenomorph, /datum/action/xeno_action/activable/queen_give_plasma) + A?.use_ability_wrapper(target_xenomorph) + + if("heal") + var/mob/living/carbon/xenomorph/target_xenomorph = locate(params["target_ref"]) in GLOB.living_xeno_list + var/mob/living/carbon/xenomorph/xenomorph = ui.user + + if(QDELETED(target_xenomorph) || target_xenomorph.stat == DEAD || target_xenomorph.statistic_exempt) + return + + if(xenomorph.stat == DEAD) + return + + var/datum/action/xeno_action/A = get_xeno_action_by_type(xenomorph, /datum/action/xeno_action/activable/queen_heal) + A?.use_ability_wrapper(target_xenomorph, TRUE) + + if("overwatch") + var/mob/living/carbon/xenomorph/target_xenomorph = locate(params["target_ref"]) in GLOB.living_xeno_list + var/mob/living/carbon/xenomorph/xenomorph = ui.user + + if(QDELETED(target_xenomorph) || target_xenomorph.stat == DEAD || target_xenomorph.statistic_exempt) + return + + if(xenomorph.stat == DEAD) + if(isobserver(xenomorph)) + var/mob/dead/observer/O = xenomorph + O.ManualFollow(target_xenomorph) + return + + if(!xenomorph.check_state(TRUE)) + return + + xenomorph.overwatch(target_xenomorph) diff --git a/code/datums/factions/xeno/yautja.dm b/code/datums/factions/xeno/yautja.dm new file mode 100644 index 000000000000..3f90bcf04b29 --- /dev/null +++ b/code/datums/factions/xeno/yautja.dm @@ -0,0 +1,15 @@ +/datum/faction/xenomorph/yautja + name = "Yautja Xenomorph Hive" + code_identificator = FACTION_XENOMORPH_YAUTJA + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/yautja + + dynamic_evolution = FALSE + allow_no_queen_actions = TRUE + allow_queen_evolve = FALSE + ignore_slots = TRUE + + need_round_end_check = TRUE + +/datum/faction/xenomorph/yautja/can_delay_round_end(mob/living/carbon/C) + return FALSE diff --git a/code/datums/factions/yautja.dm b/code/datums/factions/yautja.dm new file mode 100644 index 000000000000..f7a582bc6892 --- /dev/null +++ b/code/datums/factions/yautja.dm @@ -0,0 +1,15 @@ +/datum/faction/yautja + name = "Yautja Hanting Groop" + desc = "Unable to extract addition information." + code_identificator = FACTION_YAUTJA + + relations_pregen = RELATIONS_HOSTILE + +/datum/faction/yautja/get_join_status(mob/new_player/user, dat) + if(alert(user, user.client.auto_lang(LANGUAGE_LOBBY_JOIN_HUNT), user.client.auto_lang(LANGUAGE_CONFIRM), user.client.auto_lang(LANGUAGE_YES), user.client.auto_lang(LANGUAGE_NO)) == user.client.auto_lang(LANGUAGE_YES)) + if(SSticker.mode.check_predator_late_join(user, 0)) + user.close_spawn_windows() + SSticker.mode.attempt_to_join_as_predator(user) + else + to_chat(user, SPAN_WARNING(user.client.auto_lang(LANGUAGE_LOBBY_NO_JOIN_HUNT))) + user.new_player_panel() diff --git a/code/datums/factions/zombie.dm b/code/datums/factions/zombie.dm new file mode 100644 index 000000000000..d8e1b37108ca --- /dev/null +++ b/code/datums/factions/zombie.dm @@ -0,0 +1,60 @@ +/datum/faction/zombie + name = "Zombie Horde" + desc = "Unknow virus that makes all dead rise back and fight, for additional information required access 6X-X / XC-X or higher..." + code_identificator = FACTION_ZOMBIE + + relations_pregen = RELATIONS_MAP_HOSTILE + + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/zombie + +/datum/faction/zombie/get_join_status(mob/user, dat) + if(!user.client) + return + + if(SSticker.current_state < GAME_STATE_PLAYING || !SSticker.mode) + to_chat(src, SPAN_WARNING("The game hasn't started yet!")) + return + + var/list/zombie_list = list() + if(length(GLOB.zombie_landmarks)) + zombie_list += list("Underground Zombie" = "Underground Zombie") + + for(var/mob/living/carbon/human/A in GLOB.zombie_list) + if(!A.client && A.stat != DEAD) // Only living zombies + zombie_list += list(A.real_name = A) + + if(!length(zombie_list)) + to_chat(src, SPAN_DANGER("There are no available zombies.")) + return + + var/choice = tgui_input_list(usr, "Pick a Zombie:", "Join as Zombie", zombie_list) + if(!choice) + return + + if(!user.client || !user.mind) + return + + if(choice == "Underground Zombie") + if(!length(GLOB.zombie_landmarks)) + to_chat(src, SPAN_WARNING("Sorry, the last underground zombie just got taken.")) + return + + var/obj/effect/landmark/zombie/spawn_point = pick(GLOB.zombie_landmarks) + spawn_point.spawn_zombie(src) + return + + var/mob/living/carbon/human/Z = zombie_list[choice] + + if(!Z || QDELETED(Z)) + return + + if(Z.stat == DEAD) + to_chat(src, SPAN_WARNING("This zombie is dead!")) + return + + if(Z.client) + to_chat(src, SPAN_WARNING("That player is still connected.")) + return + + user.mind.transfer_to(Z, TRUE) + msg_admin_niche("[key_name(usr)] has joined as a [Z].") diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm index 19afb901868f..cd4a8e25f949 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm @@ -74,8 +74,8 @@ weed_food_states = list("Hellhound_1","Hellhound_2","Hellhound_3") weed_food_states_flipped = list("Hellhound_1","Hellhound_2","Hellhound_3") -/mob/living/carbon/xenomorph/hellhound/Initialize(mapload, mob/living/carbon/xenomorph/oldXeno, h_number) - . = ..(mapload, oldXeno, h_number || XENO_HIVE_YAUTJA) +/mob/living/carbon/xenomorph/hellhound/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, datum/faction/_faction) + . = ..(mapload, old_xeno, faction || FACTION_XENOMORPH_YAUTJA) set_languages(list(LANGUAGE_HELLHOUND, LANGUAGE_YAUTJA)) diff --git a/colonialmarines.dme b/colonialmarines.dme index 7eae091140df..ead86081a51e 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -582,19 +582,45 @@ #include "code\datums\entities\ticket.dm" #include "code\datums\entities\logs\player_times_log.dm" #include "code\datums\factions\clf.dm" -#include "code\datums\factions\cmb.dm" +#include "code\datums\factions\colonists.dm" #include "code\datums\factions\contractor.dm" +#include "code\datums\factions\dutchs_dozen.dm" #include "code\datums\factions\faction.dm" #include "code\datums\factions\faction_modules.dm" +#include "code\datums\factions\freelancer.dm" +#include "code\datums\factions\gladiator.dm" +#include "code\datums\factions\hefa_order.dm" #include "code\datums\factions\helpers.dm" #include "code\datums\factions\iff_tag.dm" +#include "code\datums\factions\mercenary.dm" #include "code\datums\factions\nspa.dm" -#include "code\datums\factions\pmc.dm" +#include "code\datums\factions\pirate.dm" #include "code\datums\factions\relations_datum.dm" -#include "code\datums\factions\royalmarinescommando.dm" +#include "code\datums\factions\ress.dm" +#include "code\datums\factions\souto.dm" #include "code\datums\factions\upp.dm" -#include "code\datums\factions\uscm.dm" -#include "code\datums\factions\wy.dm" +#include "code\datums\factions\yautja.dm" +#include "code\datums\factions\zombie.dm" +#include "code\datums\factions\threewe\royalmarinescommando.dm" +#include "code\datums\factions\threewe\threewe.dm" +#include "code\datums\factions\uscm\cmb.dm" +#include "code\datums\factions\uscm\marine.dm" +#include "code\datums\factions\uscm\uscm.dm" +#include "code\datums\factions\wy\deathsquad.dm" +#include "code\datums\factions\wy\pmc.dm" +#include "code\datums\factions\wy\wy.dm" +#include "code\datums\factions\xeno\alpha.dm" +#include "code\datums\factions\xeno\bravo.dm" +#include "code\datums\factions\xeno\charlie.dm" +#include "code\datums\factions\xeno\corrupted.dm" +#include "code\datums\factions\xeno\delta.dm" +#include "code\datums\factions\xeno\feral.dm" +#include "code\datums\factions\xeno\forsaken.dm" +#include "code\datums\factions\xeno\mutated.dm" +#include "code\datums\factions\xeno\normal.dm" +#include "code\datums\factions\xeno\renegade.dm" +#include "code\datums\factions\xeno\xeno.dm" +#include "code\datums\factions\xeno\yautja.dm" #include "code\datums\helper_datums\getrev.dm" #include "code\datums\helper_datums\stack_end_detector.dm" #include "code\datums\helper_datums\teleport.dm" From 4bbaf17d839bba4167c8ceb4ed122bec8b7bf8fd Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:41:53 +0500 Subject: [PATCH 05/24] what a hell, another keypoint, just 515 more untouched lines of code! just 515 more!!! --- code/controllers/subsystem/minimap.dm | 48 +--- code/controllers/subsystem/who.dm | 3 +- code/controllers/subsystem/x_evolution.dm | 6 +- code/datums/ammo/misc.dm | 2 +- .../construction_template_xenomorph.dm | 9 +- code/datums/emergency_calls/feral_xenos.dm | 2 +- .../pred_hunt/hunting_calls.dm | 6 +- code/datums/factions/clf.dm | 2 + code/datums/factions/colonists.dm | 2 +- code/datums/factions/faction.dm | 42 ++- code/datums/factions/faction_modules.dm | 18 +- code/datums/factions/upp.dm | 2 + code/datums/factions/uscm/marine.dm | 2 +- code/datums/factions/uscm/uscm.dm | 2 + code/datums/factions/wy/pmc.dm | 2 + code/datums/factions/wy/wy.dm | 2 + code/datums/factions/xeno/alpha.dm | 8 + code/datums/factions/xeno/bravo.dm | 8 + code/datums/factions/xeno/charlie.dm | 8 + code/datums/factions/xeno/corrupted.dm | 27 +- code/datums/factions/xeno/delta.dm | 8 + code/datums/factions/xeno/feral.dm | 17 +- code/datums/factions/xeno/forsaken.dm | 15 +- code/datums/factions/xeno/mutated.dm | 7 + code/datums/factions/xeno/normal.dm | 5 +- code/datums/factions/xeno/renegade.dm | 15 +- code/datums/factions/xeno/xeno.dm | 101 +------ code/datums/factions/xeno/yautja.dm | 16 +- code/datums/factions/yautja.dm | 9 +- code/game/gamemodes/cm_initialize.dm | 51 ++-- code/game/gamemodes/cm_process.dm | 5 +- code/game/jobs/job/antag/xeno/queen.dm | 4 +- code/game/jobs/job/antag/xeno/xenomorph.dm | 7 +- code/game/jobs/role_authority.dm | 4 +- code/game/machinery/nuclearbomb.dm | 65 +++-- code/game/machinery/telecomms/presets.dm | 4 +- code/game/objects/effects/aliens.dm | 22 +- code/game/objects/structures/pipes/pipes.dm | 2 +- code/game/turfs/walls/wall_types.dm | 23 +- .../admin/player_panel/actions/transform.dm | 2 +- code/modules/clothing/glasses/night.dm | 2 +- code/modules/cm_aliens/XenoStructures.dm | 251 +++++++++--------- code/modules/cm_aliens/hivebuffs/hivebuff.dm | 3 - .../cm_aliens/structures/construction_node.dm | 25 +- code/modules/cm_aliens/structures/egg.dm | 21 +- code/modules/cm_aliens/structures/fruit.dm | 2 +- .../structures/special/egg_morpher.dm | 36 +-- .../structures/special/hive_cluster.dm | 4 +- .../cm_aliens/structures/special/pred_nest.dm | 2 +- .../structures/special/pylon_core.dm | 159 ++++++----- .../structures/special/recovery_node.dm | 4 +- .../cm_aliens/structures/special_structure.dm | 26 +- code/modules/cm_aliens/structures/trap.dm | 44 ++- code/modules/cm_aliens/structures/tunnel.dm | 18 +- .../structures/xeno_structures_boilertrap.dm | 2 +- code/modules/cm_aliens/weeds.dm | 24 +- .../desert_dam/motion_sensor/sensortower.dm | 2 +- .../mob/living/carbon/xenomorph/Embryo.dm | 2 +- .../living/carbon/xenomorph/Facehuggers.dm | 57 ++-- .../mob/living/carbon/xenomorph/Powers.dm | 6 +- .../mob/living/carbon/xenomorph/XenoProcs.dm | 59 ++-- .../mob/living/carbon/xenomorph/Xenomorph.dm | 2 +- .../xenomorph/abilities/general_powers.dm | 40 ++- .../xenomorph/abilities/queen/queen_powers.dm | 74 +++--- .../living/carbon/xenomorph/castes/Carrier.dm | 26 +- .../carbon/xenomorph/castes/Facehugger.dm | 10 +- .../carbon/xenomorph/castes/Hellhound.dm | 4 +- .../carbon/xenomorph/castes/Hivelord.dm | 2 +- .../living/carbon/xenomorph/castes/Queen.dm | 150 ++++++----- .../living/carbon/xenomorph/hive_status.dm | 32 +-- .../mob/living/carbon/xenomorph/life.dm | 8 +- .../carbon/xenomorph/resin_constructions.dm | 4 +- .../strains/castes/drone/gardener.dm | 18 +- .../mob/living/simple_animal/hostile/alien.dm | 17 +- code/modules/mob/new_player/new_player.dm | 18 +- code/modules/projectiles/projectile.dm | 2 +- .../shuttle/computers/dropship_computer.dm | 26 +- code/modules/shuttles/shuttle_console.dm | 11 +- code/modules/tgui/states/xeno.dm | 15 +- code/modules/vehicles/apc/apc_command.dm | 2 +- 80 files changed, 878 insertions(+), 915 deletions(-) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 6769a8e992d1..8a8d2f29885e 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -851,13 +851,12 @@ SUBSYSTEM_DEF(minimaps) var/mob/living/carbon/xenomorph/xeno = user var/is_xeno = istype(xeno) - var/faction = is_xeno ? xeno.hivenumber : user.faction data["isxeno"] = is_xeno data["canViewTacmap"] = is_xeno - data["canViewCanvas"] = faction == FACTION_MARINE || faction == FACTION_XENOMORPH_NORMAL + data["canViewCanvas"] = user.faction.code_identificator == FACTION_MARINE || user.faction.code_identificator == FACTION_XENOMORPH_NORMAL - if(can_draw(faction, user)) + if(can_draw(user.faction.code_identificator, user)) data["canDraw"] = TRUE data["canViewTacmap"] = TRUE @@ -904,7 +903,7 @@ SUBSYSTEM_DEF(minimaps) var/mob/user = ui.user var/mob/living/carbon/xenomorph/xeno = user - var/faction = istype(xeno) ? xeno.hivenumber : user.faction + var/faction = user.faction var/is_observer = isobserver(user) if(faction == FACTION_NEUTRAL && is_observer) faction = allowed_flags == MINIMAP_FLAG_XENO ? FACTION_XENOMORPH_NORMAL : FACTION_MARINE @@ -1065,47 +1064,6 @@ SUBSYSTEM_DEF(minimaps) distribute_current_map_png(faction) last_update_time = world.time -/// Gets the MINIMAP_FLAG for the provided faction or hivenumber if one exists -/proc/get_minimap_flag_for_faction(faction) - switch(faction) - if(FACTION_XENOMORPH_NORMAL) - return MINIMAP_FLAG_XENO - if(FACTION_MARINE) - return MINIMAP_FLAG_USCM - if(FACTION_UPP) - return MINIMAP_FLAG_UPP - if(FACTION_WY) - return MINIMAP_FLAG_USCM - if(FACTION_CLF) - return MINIMAP_FLAG_CLF - if(FACTION_PMC) - return MINIMAP_FLAG_WY - if(FACTION_YAUTJA) - return MINIMAP_FLAG_YAUTJA - if(XENO_HIVE_CORRUPTED) - return MINIMAP_FLAG_XENO_CORRUPTED - if(XENO_HIVE_ALPHA) - return MINIMAP_FLAG_XENO_ALPHA - if(FACTION_XENOMORPH_NORMAL) - return MINIMAP_FLAG_XENO_BRAVO - if(XENO_HIVE_CHARLIE) - return MINIMAP_FLAG_XENO_CHARLIE - if(XENO_HIVE_DELTA) - return MINIMAP_FLAG_XENO_DELTA - if(XENO_HIVE_FERAL) - return MINIMAP_FLAG_XENO_FERAL - if(XENO_HIVE_TAMED) - return MINIMAP_FLAG_XENO_TAMED - if(XENO_HIVE_MUTATED) - return MINIMAP_FLAG_XENO_MUTATED - if(FACTION_XENOMORPH_FORSAKEN) - return MINIMAP_FLAG_XENO_FORSAKEN - if(XENO_HIVE_YAUTJA) - return MINIMAP_FLAG_YAUTJA - if(XENO_HIVE_RENEGADE) - return MINIMAP_FLAG_XENO_RENEGADE - return 0 - #undef CANVAS_COOLDOWN_TIME #undef FLATTEN_MAP_COOLDOWN_TIME #undef can_draw diff --git a/code/controllers/subsystem/who.dm b/code/controllers/subsystem/who.dm index 61b693390cfc..fc568dd83083 100644 --- a/code/controllers/subsystem/who.dm +++ b/code/controllers/subsystem/who.dm @@ -143,9 +143,10 @@ SUBSYSTEM_DEF(who) for(var/faction_to_get in FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!faction || !length(faction.total_mobs)) continue - factions_additional += list(list("content" = "[faction]: [length(faction.total_mobs)]", "color" = faction.color, "text" = "Queen: [faction.living_xeno_queen ? "Alive" : "Dead"]")) + factions_additional += list(list("content" = "[faction]: [length(faction.total_mobs)]", "color" = faction.color, "text" = "Queen: [faction_module.living_xeno_queen ? "Alive" : "Dead"]")) src.base_data = base_data src.admin_sorted_additional = admin_sorted_additional diff --git a/code/controllers/subsystem/x_evolution.dm b/code/controllers/subsystem/x_evolution.dm index 24fc0bf71d10..10c95b531f7a 100644 --- a/code/controllers/subsystem/x_evolution.dm +++ b/code/controllers/subsystem/x_evolution.dm @@ -29,7 +29,7 @@ SUBSYSTEM_DEF(xevolution) if(!faction_module.dynamic_evolution) boost_power[faction_to_get] = faction_module.evolution_rate + faction_module.evolution_bonus - faction_module.update_burrowed_larva() + faction_module.hive_ui.update_burrowed_larva() continue var/boost_power_new @@ -49,7 +49,7 @@ SUBSYSTEM_DEF(xevolution) boost_power[faction_to_get] = boost_power_new //Update displayed Evilution, which is under larva apparently - faction_module.update_burrowed_larva() + faction_module.hive_ui.update_burrowed_larva() /datum/controller/subsystem/xevolution/proc/get_evolution_boost_power(faction_to_get) return boost_power[faction_to_get] @@ -58,7 +58,7 @@ SUBSYSTEM_DEF(xevolution) var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) boost_power[faction_to_get] = power overridden_power[faction_to_get] = override - faction_module.update_burrowed_larva() + faction_module.hive_ui.update_burrowed_larva() #undef EVOLUTION_INCREMENT_TIME #undef BOOST_POWER_MIN diff --git a/code/datums/ammo/misc.dm b/code/datums/ammo/misc.dm index 42c913835d69..b41e61012368 100644 --- a/code/datums/ammo/misc.dm +++ b/code/datums/ammo/misc.dm @@ -318,5 +318,5 @@ /datum/ammo/hugger_container/proc/spawn_hugger(turf/T) var/obj/item/clothing/mask/facehugger/child = new(T) - child.hivenumber = hugger_hive + child.faction_to_get = hugger_hive INVOKE_ASYNC(child, TYPE_PROC_REF(/obj/item/clothing/mask/facehugger, leap_at_nearest_target)) diff --git a/code/datums/construction/xenomorph/construction_template_xenomorph.dm b/code/datums/construction/xenomorph/construction_template_xenomorph.dm index fd343f9e9ffd..5cf8214f5df3 100644 --- a/code/datums/construction/xenomorph/construction_template_xenomorph.dm +++ b/code/datums/construction/xenomorph/construction_template_xenomorph.dm @@ -5,7 +5,7 @@ build_type = /obj/effect/alien/resin/special plasma_required = 45 * XENO_STRUCTURE_PLASMA_MULTIPLIER /// The hive that this structure belongs to. - var/datum/hive_status/hive_ref + var/datum/faction/faction /// The range around this structure which needs to be clear for it to be constructed. var/block_range = 1 @@ -16,10 +16,11 @@ if(!owner || !get_turf(owner)) log_debug("Constuction template ([name]) completed construction without a build location") return - if(hive_ref) - hive_ref.remove_construction(owner) + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.remove_construction(owner) build_loc = get_turf(owner) - new build_type(build_loc, hive_ref) + new build_type(build_loc, faction) playsound(build_loc, "alien_resin_build", 25) qdel(owner) qdel(src) diff --git a/code/datums/emergency_calls/feral_xenos.dm b/code/datums/emergency_calls/feral_xenos.dm index ad1935ccefb9..14c6de513466 100644 --- a/code/datums/emergency_calls/feral_xenos.dm +++ b/code/datums/emergency_calls/feral_xenos.dm @@ -52,7 +52,7 @@ new_xeno = new picked(spawn_loc) M.transfer_to(new_xeno, TRUE) - new_xeno.set_hive_and_update(XENO_HIVE_FERAL) + new_xeno.set_hive_and_update(FACTION_XENOMORPH_FERAL) if(hive_leader) new_xeno.hive.add_hive_leader(new_xeno) diff --git a/code/datums/emergency_calls/pred_hunt/hunting_calls.dm b/code/datums/emergency_calls/pred_hunt/hunting_calls.dm index 7e0f97074315..0fc344365365 100644 --- a/code/datums/emergency_calls/pred_hunt/hunting_calls.dm +++ b/code/datums/emergency_calls/pred_hunt/hunting_calls.dm @@ -113,7 +113,7 @@ xeno_t3++ var/list/xeno_types = list(/mob/living/carbon/xenomorph/praetorian, /mob/living/carbon/xenomorph/ravager) var/xeno_type = pick(xeno_types) - new_xeno = new xeno_type(spawn_loc, null, XENO_HIVE_FERAL) + new_xeno = new xeno_type(spawn_loc, null, FACTION_XENOMORPH_FERAL) player.transfer_to(new_xeno, TRUE) QDEL_NULL(current_mob) to_chat(new_xeno, SPAN_BOLD("You are a xeno")) @@ -121,14 +121,14 @@ xeno_t2++ var/list/xeno_types = list(/mob/living/carbon/xenomorph/lurker, /mob/living/carbon/xenomorph/warrior) var/xeno_type = pick(xeno_types) - new_xeno = new xeno_type(spawn_loc, null, XENO_HIVE_FERAL) + new_xeno = new xeno_type(spawn_loc, null, FACTION_XENOMORPH_FERAL) player.transfer_to(new_xeno, TRUE) QDEL_NULL(current_mob) to_chat(new_xeno, SPAN_BOLD("You are a xeno let loose on a strang ")) else var/list/xeno_types = list(/mob/living/carbon/xenomorph/drone) var/xeno_type = pick(xeno_types) - new_xeno = new xeno_type(spawn_loc, null, XENO_HIVE_FERAL) + new_xeno = new xeno_type(spawn_loc, null, FACTION_XENOMORPH_FERAL) player.transfer_to(new_xeno, TRUE) to_chat(new_xeno, SPAN_BOLD("You are a xeno")) diff --git a/code/datums/factions/clf.dm b/code/datums/factions/clf.dm index 7112c04e32e8..9e371f3a49ce 100644 --- a/code/datums/factions/clf.dm +++ b/code/datums/factions/clf.dm @@ -7,6 +7,8 @@ relations_pregen = RELATIONS_FACTION_CLF + minimap_flag = MINIMAP_FLAG_CLF + /datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state var/obj/item/card/id/ID = human.get_idcard() diff --git a/code/datums/factions/colonists.dm b/code/datums/factions/colonists.dm index 90a8b9762caf..f3d1fa0636d9 100644 --- a/code/datums/factions/colonists.dm +++ b/code/datums/factions/colonists.dm @@ -1,6 +1,6 @@ /datum/faction/colonist name = "Colonists" desc = "Colonists, the most ordinary citizens of the colonies, ADDITIONAL INFORMATION IS CHANGED" - faction_name = FACTION_COLONIST + code_identificator = FACTION_COLONIST faction_iff_tag_type = /obj/item/faction_tag/colonist diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index c509f86f7982..38be5ffae223 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -5,6 +5,7 @@ var/hud_type = FACTION_HUD var/color = "#22888a" + var/ui_color = "#22888a" var/faction_orders = "" var/prefix = "" @@ -28,6 +29,9 @@ var/latejoin_enabled = TRUE var/force_spawning = FALSE + var/need_round_end_check = TRUE + var/minimap_flag = NO_FLAGS + var/list/datum/faction_module/faction_modules = list() /datum/faction/New() @@ -42,6 +46,9 @@ if(!istype(creature)) return + for(var/datum/faction_module/faction_module in faction_modules) + faction_module.add_mob(creature) + if(creature.faction && creature.faction != src) creature.faction.remove_mob(creature, TRUE) @@ -53,10 +60,13 @@ if(!creature.statistic_exempt) total_mobs |= creature -/datum/faction/proc/remove_mob(mob/living/carbon/creature, hard = FALSE) +/datum/faction/proc/remove_mob(mob/living/carbon/creature, hard = FALSE, light_mode = FALSE) if(!istype(creature)) return + for(var/datum/faction_module/faction_module in faction_modules) + faction_module.remove_mob(creature, hard, light_mode) + if(hard) creature.faction = null else @@ -64,6 +74,36 @@ total_mobs -= creature +/datum/faction/proc/get_join_status(mob/new_player/user, dat)/* + dat = "
" + dat += "[user.client.auto_lang(LANGUAGE_LOBBY_ROUND_TIME)]: [DisplayTimeText(world.time, language = user.client.language)]
" + dat += "[user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_CHOSE)]:
" + dat += additional_join_status(user) + + if(!latejoin_enabled) + dat = "[user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_CLOSED)]:
" + + else if(!SSautobalancer.can_join(src)) + dat = "[user.client.auto_lang(LANGUAGE_JS_BALANCE_ISSUE)]:
" + + else + var/list/roles = roles_list[SSticker.mode.name] + for(var/i in roles) + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[i] + var/check_result = GLOB.RoleAuthority.check_role_entry(user, job, src, TRUE) + var/active = 0 + for(var/mob/mob in GLOB.player_list) + if(mob.client && mob.job == job.title) + active++ + + if(check_result) + dat += "[job.disp_title] ([job.current_positions]): [check_result] ([user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_ACTIVE)]: [active])
" + else + dat += "[job.disp_title] ([job.current_positions]) ([user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_ACTIVE)]: [active])
" + + dat += "
" + show_browser(user, dat, user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN), "latechoices", "size=420x700") +*/ /datum/faction/proc/can_delay_round_end(mob/living/carbon/creature) return TRUE diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index a233d27aeb29..8c8373ffbf49 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -3,10 +3,22 @@ var/datum/faction/faction_owner +/datum/faction_module/New(datum/faction/faction_ref) + faction_owner = faction_ref + /datum/faction_module/proc/add_mob(mob/living/carbon/creature) + return + +/datum/faction_module/proc/remove_mob(mob/living/carbon/creature, hard = FALSE, light_mode = FALSE) + return + + + +#define HIVE_STARTING_BUFFPOINTS 0 +#define HIVE_MAX_BUFFPOINTS 10 /datum/faction_module/hive_mind - var/module_code_identificator = FACTION_MODULE_HIVE_MIND + module_code_identificator = FACTION_MODULE_HIVE_MIND var/mob/living/carbon/xenomorph/queen/living_xeno_queen var/egg_planting_range = 15 @@ -152,7 +164,7 @@ hive_ui = new(src) mark_ui = new(src) faction_ui = new(src) - minimap_type = get_minimap_flag_for_faction(hivenumber) + minimap_type = faction.minimap_flag tacmap = new(src, minimap_type) if(!internal_faction) internal_faction = name @@ -226,7 +238,7 @@ // So don't even bother trying updating UI here without large refactors // Removes the xeno from the hive -/datum/faction_module/hive_mind/remove_xeno(mob/living/carbon/creature, hard = FALSE, light_mode = FALSE) +/datum/faction_module/hive_mind/remove_mob(mob/living/carbon/creature, hard = FALSE, light_mode = FALSE) // This might be a redundant check now that Queen/Destroy() checks, but doesn't hurt to double check if(living_xeno_queen == creature) var/mob/living/carbon/xenomorph/queen/next_queen = null diff --git a/code/datums/factions/upp.dm b/code/datums/factions/upp.dm index 82193e826fbd..e9eb5b0cfa1a 100644 --- a/code/datums/factions/upp.dm +++ b/code/datums/factions/upp.dm @@ -9,6 +9,8 @@ faction_iff_tag_type = /obj/item/faction_tag/upp + minimap_flag = MINIMAP_FLAG_UPP + /datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state var/obj/item/card/id/ID = human.get_idcard() diff --git a/code/datums/factions/uscm/marine.dm b/code/datums/factions/uscm/marine.dm index f3ae292d7903..796caed0db38 100644 --- a/code/datums/factions/uscm/marine.dm +++ b/code/datums/factions/uscm/marine.dm @@ -1,5 +1,5 @@ /datum/faction/uscm/marine - name = NAME_FACTION_MARINE + name = "Colonial Marines" code_identificator = FACTION_MARINE faction_iff_tag_type = /obj/item/faction_tag/uscm/marine diff --git a/code/datums/factions/uscm/uscm.dm b/code/datums/factions/uscm/uscm.dm index f99e270c9dab..dc7e1bcbbe68 100644 --- a/code/datums/factions/uscm/uscm.dm +++ b/code/datums/factions/uscm/uscm.dm @@ -9,6 +9,8 @@ faction_iff_tag_type = /obj/item/faction_tag/uscm + minimap_flag = MINIMAP_FLAG_USCM + /datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/current_human) var/datum/squad/squad = current_human.assigned_squad if(istype(squad)) diff --git a/code/datums/factions/wy/pmc.dm b/code/datums/factions/wy/pmc.dm index c094c23aa7ca..5d8d79548f08 100644 --- a/code/datums/factions/wy/pmc.dm +++ b/code/datums/factions/wy/pmc.dm @@ -5,6 +5,8 @@ faction_iff_tag_type = /obj/item/faction_tag/wy/pmc + minimap_flag = MINIMAP_FLAG_WY + /datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/H) var/hud_icon_state var/obj/item/card/id/ID = H.get_idcard() diff --git a/code/datums/factions/wy/wy.dm b/code/datums/factions/wy/wy.dm index 7b38d8bef5cf..a5a35ce7e643 100644 --- a/code/datums/factions/wy/wy.dm +++ b/code/datums/factions/wy/wy.dm @@ -9,6 +9,8 @@ faction_iff_tag_type = /obj/item/faction_tag/wy + minimap_flag = MINIMAP_FLAG_USCM + /datum/faction/wy/modify_hud_holder(image/holder, mob/living/carbon/human/user) var/hud_icon_state var/obj/item/card/id/id_card = user.get_idcard() diff --git a/code/datums/factions/xeno/alpha.dm b/code/datums/factions/xeno/alpha.dm index bc54124b6134..39ed44ce0ad9 100644 --- a/code/datums/factions/xeno/alpha.dm +++ b/code/datums/factions/xeno/alpha.dm @@ -7,3 +7,11 @@ prefix = "Alpha " color = "#ff4040" ui_color = "#992626" + + minimap_flag = MINIMAP_FLAG_XENO_ALPHA + +/datum/faction/xenomorph/alpha/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.latejoin_burrowed = FALSE + faction_module.dynamic_evolution = FALSE diff --git a/code/datums/factions/xeno/bravo.dm b/code/datums/factions/xeno/bravo.dm index 234d5b9ab796..e26f5bab63e5 100644 --- a/code/datums/factions/xeno/bravo.dm +++ b/code/datums/factions/xeno/bravo.dm @@ -7,3 +7,11 @@ prefix = "Bravo " color = "#ffff80" ui_color = "#99994d" + + minimap_flag = MINIMAP_FLAG_XENO_BRAVO + +/datum/faction/xenomorph/bravo/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.latejoin_burrowed = FALSE + faction_module.dynamic_evolution = FALSE diff --git a/code/datums/factions/xeno/charlie.dm b/code/datums/factions/xeno/charlie.dm index d2a07fc3b8e8..50a6b4f6435c 100644 --- a/code/datums/factions/xeno/charlie.dm +++ b/code/datums/factions/xeno/charlie.dm @@ -7,3 +7,11 @@ prefix = "Charlie " color = "#bb40ff" ui_color = "#702699" + + minimap_flag = MINIMAP_FLAG_XENO_CHARLIE + +/datum/faction/xenomorph/charlie/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.latejoin_burrowed = FALSE + faction_module.dynamic_evolution = FALSE diff --git a/code/datums/factions/xeno/corrupted.dm b/code/datums/factions/xeno/corrupted.dm index cc9190ca28b7..6822ebd8a02b 100644 --- a/code/datums/factions/xeno/corrupted.dm +++ b/code/datums/factions/xeno/corrupted.dm @@ -8,6 +8,14 @@ color = "#80ff80" ui_color ="#4d994d" + minimap_flag = MINIMAP_FLAG_XENO_CORRUPTED + +/datum/faction/xenomorph/corrupted/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.latejoin_burrowed = FALSE + faction_module.dynamic_evolution = FALSE + /datum/faction/xenomorph/corrupted/add_mob(mob/living/carbon/xenomorph/X) . = ..() X.add_language(LANGUAGE_ENGLISH) @@ -26,17 +34,14 @@ prefix = "Tamed " color = "#80ff80" - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_queen_evolve = FALSE - ignore_slots = TRUE + minimap_flag = MINIMAP_FLAG_XENO_TAMED /datum/faction/xenomorph/corrupted/tamed/New() . = ..() - faction_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0 - faction_structures_limit[XENO_STRUCTURE_EVOPOD] = 0 - -/datum/faction/xenomorph/corrupted/tamed/add_mob(mob/living/carbon/xenomorph/xenomorph) - . = ..() - if(faction_leader) - xenomorph.faction = faction_leader.faction + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.dynamic_evolution = FALSE + faction_module.allow_no_queen_actions = TRUE + faction_module.allow_no_queen_evo = TRUE + faction_module.allow_queen_evolve = FALSE + faction_module.latejoin_burrowed = FALSE + faction_module.hive_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0 diff --git a/code/datums/factions/xeno/delta.dm b/code/datums/factions/xeno/delta.dm index 7b59be6900bb..447bef18e530 100644 --- a/code/datums/factions/xeno/delta.dm +++ b/code/datums/factions/xeno/delta.dm @@ -7,3 +7,11 @@ prefix = "Delta " color = "#8080ff" ui_color = "#4d4d99" + + minimap_flag = MINIMAP_FLAG_XENO_DELTA + +/datum/faction/xenomorph/delta/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.latejoin_burrowed = FALSE + faction_module.dynamic_evolution = FALSE diff --git a/code/datums/factions/xeno/feral.dm b/code/datums/factions/xeno/feral.dm index 7833a68d308e..8a11ef82e4a1 100644 --- a/code/datums/factions/xeno/feral.dm +++ b/code/datums/factions/xeno/feral.dm @@ -8,8 +8,15 @@ color = "#828296" ui_color = "#828296" - construction_allowed = XENO_QUEEN - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_queen_evolve = FALSE - ignore_slots = TRUE + minimap_flag = MINIMAP_FLAG_XENO_FERAL + +/datum/faction/xenomorph/feral/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.construction_allowed = XENO_NOBODY + faction_module.destruction_allowed = XENO_NOBODY + faction_module.dynamic_evolution = FALSE + faction_module.allow_no_queen_actions = TRUE + faction_module.allow_no_queen_evo = TRUE + faction_module.allow_queen_evolve = FALSE + faction_module.latejoin_burrowed = FALSE diff --git a/code/datums/factions/xeno/forsaken.dm b/code/datums/factions/xeno/forsaken.dm index 64e0f3f62257..3db5ac19d42d 100644 --- a/code/datums/factions/xeno/forsaken.dm +++ b/code/datums/factions/xeno/forsaken.dm @@ -8,8 +8,13 @@ color = "#828296" ui_color = "#828296" - construction_allowed = XENO_QUEEN - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_queen_evolve = FALSE - ignore_slots = TRUE + minimap_flag = MINIMAP_FLAG_XENO_FORSAKEN + +/datum/faction/xenomorph/forsaken/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.dynamic_evolution = FALSE + faction_module.allow_no_queen_actions = TRUE + faction_module.allow_no_queen_evo = TRUE + faction_module.allow_queen_evolve = FALSE + faction_module.latejoin_burrowed = FALSE diff --git a/code/datums/factions/xeno/mutated.dm b/code/datums/factions/xeno/mutated.dm index 90a38136704f..bc226fd46199 100644 --- a/code/datums/factions/xeno/mutated.dm +++ b/code/datums/factions/xeno/mutated.dm @@ -9,3 +9,10 @@ ui_color = "#6abd99" hive_inherant_traits = list(TRAIT_XENONID) + + minimap_flag = MINIMAP_FLAG_XENO_MUTATED + +/datum/faction/xenomorph/mutated/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.latejoin_burrowed = FALSE diff --git a/code/datums/factions/xeno/normal.dm b/code/datums/factions/xeno/normal.dm index 131e48a40960..4fa4b77db127 100644 --- a/code/datums/factions/xeno/normal.dm +++ b/code/datums/factions/xeno/normal.dm @@ -4,6 +4,7 @@ organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/normal - evolution_without_ovipositor = FALSE color = null - ui_color = null + ui_color = "#8200FF" + + minimap_flag = MINIMAP_FLAG_XENO diff --git a/code/datums/factions/xeno/renegade.dm b/code/datums/factions/xeno/renegade.dm index 1a9004eb61da..6fd752f6dee9 100644 --- a/code/datums/factions/xeno/renegade.dm +++ b/code/datums/factions/xeno/renegade.dm @@ -4,12 +4,17 @@ organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/renegade - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_queen_evolve = FALSE - ignore_slots = TRUE - need_round_end_check = TRUE + minimap_flag = MINIMAP_FLAG_XENO_RENEGADE + +/datum/faction/xenomorph/renegade/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.dynamic_evolution = FALSE + faction_module.allow_queen_evolve = FALSE + faction_module.allow_no_queen_evo = TRUE + faction_module.latejoin_burrowed = FALSE + /datum/faction/xenomorph/renegade/can_delay_round_end(mob/living/carbon/C) return FALSE diff --git a/code/datums/factions/xeno/xeno.dm b/code/datums/factions/xeno/xeno.dm index 6264822b2141..e4ebd108a736 100644 --- a/code/datums/factions/xeno/xeno.dm +++ b/code/datums/factions/xeno/xeno.dm @@ -3,103 +3,27 @@ desc = "Xenomorph hive among the all other hives." code_identificator = FACTION_XENOMORPH + color = null + ui_color = null + organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph relations_pregen = RELATIONS_FACTION_XENOMORPH -/datum/faction/xenomorph/faction_is_ally(datum/faction/faction) - if(!living_xeno_queen) - return FALSE +/datum/faction/xenomorph/New() . = ..() + faction_modules += new /datum/faction_module/hive_mind(src) -/datum/faction/xenomorph/New() +/datum/faction/xenomorph/faction_is_ally(datum/faction/faction) + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen) + return FALSE . = ..() - mutators = new(src) - mark_ui = new(src) - faction_ui = new(src) /datum/faction/xenomorph/can_delay_round_end(mob/living/carbon/carbon) if(!faction_is_ally(GLOB.faction_datums[FACTION_MARINE])) return TRUE return FALSE - -// Adds a xeno to this hive -/datum/faction/xenomorph/add_mob(mob/living/carbon/xenomorph/xenomorph) - if(!xenomorph || !istype(xenomorph)) - return - - // If the xeno is part of another hive, they should be removed from that one first - if(xenomorph.faction && xenomorph.faction != src) - xenomorph.faction.remove_mob(xenomorph, TRUE) - - // Already in the hive - if(xenomorph in totalMobs) - return - - // Can only have one queen. - if(isqueen(xenomorph)) - if(!living_xeno_queen && !xenomorph.statistic_exempt) // Don't consider xenos in admin level - set_living_xeno_queen(xenomorph) - - xenomorph.faction = src - - if(xenomorph.hud_list) - xenomorph.hud_update() - - if(!xenomorph.statistic_exempt) - totalMobs += xenomorph - if(xenomorph.tier == 2) - tier_2_xenos += xenomorph - else if(xenomorph.tier == 3) - tier_3_xenos += xenomorph - - // Xenos are a fuckfest of cross-dependencies of different datums that are initialized at different times - // So don't even bother trying updating UI here without large refactors - -// Removes the xeno from the hive -/datum/faction/xenomorph/remove_mob(mob/living/carbon/xenomorph/xenomorph, hard = FALSE, light_mode = FALSE) - if(!xenomorph || !istype(xenomorph)) - return - - // Make sure the xeno was in the hive in the first place - if(!(xenomorph in totalMobs)) - return - - if(isqueen(xenomorph)) - if(living_xeno_queen == xenomorph) - var/mob/living/carbon/xenomorph/queen/next_queen - for(var/mob/living/carbon/xenomorph/queen/Q in totalMobs) - if(!Q.statistic_exempt) - continue - next_queen = Q - break - - set_living_xeno_queen(next_queen) // either null or a queen - - // We allow "soft" removals from the hive (the xeno still retains information about the hive) - // This is so that xenos can add themselves back to the hive if they should die or otherwise go "on leave" from the hive - if(hard) - xenomorph.faction = null - - totalMobs -= xenomorph - if(xenomorph.tier == 2) - tier_2_xenos -= xenomorph - else if(xenomorph.tier == 3) - tier_3_xenos -= xenomorph - - if(!light_mode) - faction_ui.update_xeno_counts() - faction_ui.xeno_removed(xenomorph) - -/datum/faction/xenomorph/get_faction_info(mob/user) - if(!user || !faction_ui) - return - - if(!faction_ui.data_initialized) - faction_ui.update_all_data() - - faction_ui.tgui_interact(user) - return TRUE - +/* /datum/faction/xenomorph/get_join_status(mob/new_player/user, dat) if(SSticker.current_state != GAME_STATE_PLAYING || !SSticker.mode) to_chat(user, SPAN_WARNING(user.client.auto_lang(LANGUAGE_LOBBY_ROUND_NO_JOIN))) @@ -111,8 +35,8 @@ if(new_xeno && !istype(new_xeno, /mob/living/carbon/xenomorph/larva)) SSticker.mode.transfer_xenomorph(user, new_xeno) user.close_spawn_windows() - - +*/ +/* //LANDMARKS /datum/xeno_mark_define var/name = "xeno_declare" @@ -383,3 +307,4 @@ return xenomorph.overwatch(target_xenomorph) +*/ diff --git a/code/datums/factions/xeno/yautja.dm b/code/datums/factions/xeno/yautja.dm index 3f90bcf04b29..00cfc6209ef0 100644 --- a/code/datums/factions/xeno/yautja.dm +++ b/code/datums/factions/xeno/yautja.dm @@ -4,12 +4,18 @@ organ_faction_iff_tag_type = /obj/item/faction_tag/organ/xenomorph/yautja - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_queen_evolve = FALSE - ignore_slots = TRUE - need_round_end_check = TRUE + minimap_flag = MINIMAP_FLAG_YAUTJA + +/datum/faction/xenomorph/yautja/New() + . = ..() + var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.dynamic_evolution = FALSE + faction_module.allow_no_queen_actions = TRUE + faction_module.allow_no_queen_evo = TRUE + faction_module.allow_queen_evolve = FALSE + faction_module.latejoin_burrowed = FALSE + /datum/faction/xenomorph/yautja/can_delay_round_end(mob/living/carbon/C) return FALSE diff --git a/code/datums/factions/yautja.dm b/code/datums/factions/yautja.dm index f7a582bc6892..94967e849e9c 100644 --- a/code/datums/factions/yautja.dm +++ b/code/datums/factions/yautja.dm @@ -5,11 +5,4 @@ relations_pregen = RELATIONS_HOSTILE -/datum/faction/yautja/get_join_status(mob/new_player/user, dat) - if(alert(user, user.client.auto_lang(LANGUAGE_LOBBY_JOIN_HUNT), user.client.auto_lang(LANGUAGE_CONFIRM), user.client.auto_lang(LANGUAGE_YES), user.client.auto_lang(LANGUAGE_NO)) == user.client.auto_lang(LANGUAGE_YES)) - if(SSticker.mode.check_predator_late_join(user, 0)) - user.close_spawn_windows() - SSticker.mode.attempt_to_join_as_predator(user) - else - to_chat(user, SPAN_WARNING(user.client.auto_lang(LANGUAGE_LOBBY_NO_JOIN_HUNT))) - user.new_player_panel() + minimap_flag = MINIMAP_FLAG_YAUTJA diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 8c9c1a4eb6d6..aaa9dc7ada48 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -381,7 +381,7 @@ Additional game mode variables. var/new_queen = pick(possible_queens) if(new_queen) setup_new_xeno(new_queen) - picked_queens += list(GLOB.hive_datum[hive] = new_queen) + picked_queens += list(GLOB.faction_datums[hive] = new_queen) LAZYREMOVE(possible_xenomorphs, new_queen) for(var/datum/mind/A in possible_xenomorphs) @@ -389,7 +389,7 @@ Additional game mode variables. LAZYREMOVE(possible_xenomorphs, A) for(var/hive in hives) - xenomorphs[GLOB.hive_datum[hive]] = list() + xenomorphs[hive] = list() var/datum/mind/new_xeno var/current_index = 1 @@ -398,19 +398,20 @@ Additional game mode variables. if(current_index > LAZYLEN(hives)) current_index = 1 - var/datum/hive_status/hive = GLOB.hive_datum[hives[current_index]] + var/datum/faction/faction = GLOB.faction_datums[hives[current_index]] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(LAZYLEN(possible_xenomorphs)) //We still have candidates new_xeno = pick(possible_xenomorphs) LAZYREMOVE(possible_xenomorphs, new_xeno) if(!new_xeno) - hive.stored_larva++ - hive.hive_ui.update_burrowed_larva() + faction_module.stored_larva++ + faction_module.hive_ui.update_burrowed_larva() continue //Looks like we didn't get anyone. Keep going. setup_new_xeno(new_xeno) - xenomorphs[hive] += new_xeno + xenomorphs[hives[current_index]] += new_xeno else //Out of candidates, fill the xeno hive with burrowed larva remaining_slots = floor((xeno_starting_num - i)) break @@ -419,10 +420,11 @@ Additional game mode variables. if(remaining_slots) - var/larva_per_hive = floor(remaining_slots / LAZYLEN(hives)) + var/larva_per_hive = round(remaining_slots / length(hives)) for(var/hivenumb in hives) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumb] - hive.stored_larva = larva_per_hive + var/datum/faction/faction = GLOB.faction_datums[hivenumb] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.stored_larva = larva_per_hive /* Our list is empty. This can happen if we had someone ready as alien and predator, and predators are picked first. @@ -649,8 +651,8 @@ Additional game mode variables. if(isnewplayer(xeno_candidate)) var/mob/new_player/noob = xeno_candidate noob.close_spawn_windows() - for(var/mob_name in new_xeno.hive.banished_ckeys) - if(new_xeno.hive.banished_ckeys[mob_name] == xeno_candidate.ckey) + for(var/mob_name in new_xeno.faction.banished_ckeys) + if(new_xeno.faction.banished_ckeys[mob_name] == xeno_candidate.ckey) to_chat(xeno_candidate, SPAN_WARNING("You are banished from this hive, You may not rejoin unless the Queen re-admits you or dies.")) return FALSE if(transfer_xeno(xeno_candidate, new_xeno)) @@ -682,13 +684,14 @@ Additional game mode variables. //We have our Hive picked, time to figure out what we can join via var/list/available_facehugger_sources = list() - for(var/mob/living/carbon/xenomorph/carrier/carrier in hive.total_mobs) + for(var/mob/living/carbon/xenomorph/carrier/carrier in faction.total_mobs) if(carrier.huggers_cur > carrier.huggers_reserved) var/area_name = get_area_name(carrier) var/descriptive_name = "[carrier.name] in [area_name]" available_facehugger_sources[descriptive_name] = carrier - for(var/obj/effect/alien/resin/special/eggmorph/morpher in hive.hive_structures[XENO_STRUCTURE_EGGMORPH]) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/obj/effect/alien/resin/special/eggmorph/morpher in faction_module.hive_structures[XENO_STRUCTURE_EGGMORPH]) if(morpher) if(morpher.stored_huggers) var/area_name = get_area_name(morpher) @@ -827,16 +830,16 @@ Additional game mode variables. return TRUE /// Pick and setup a queen spawn from landmarks, then spawns the player there alongside any required setup -/datum/game_mode/proc/pick_queen_spawn(mob/player, hivenumber = FACTION_XENOMORPH_NORMAL) +/datum/game_mode/proc/pick_queen_spawn(mob/player, datum/faction/faction_to_set = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) RETURN_TYPE(/turf) var/datum/mind/ghost_mind = player.mind var/mob/living/original = ghost_mind.current - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - if(hive.living_xeno_queen || !original || !original.client) + var/datum/faction_module/hive_mind/faction_module = faction_to_set.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen || !original || !original.client) return if(!length(GLOB.queen_spawns)) - transform_queen(ghost_mind, get_turf(pick(GLOB.xeno_spawns)), hivenumber) + transform_queen(ghost_mind, get_turf(pick(GLOB.xeno_spawns)), faction_to_set) return // Make the list pretty @@ -851,8 +854,8 @@ Additional game mode variables. original.sight = BLIND - var/selected_spawn = tgui_input_list(original, "Where do you want you and your hive to spawn?", "Queen Spawn", spawn_list_map, QUEEN_SPAWN_TIMEOUT, theme="hive_status") - if(hive.living_xeno_queen) + var/selected_spawn = tgui_input_list(original, "Where do you want you and your hive to spawn?", "Queen Spawn", spawn_list_map, QUEEN_SPAWN_TIMEOUT, theme = "hive_status") + if(faction_module.living_xeno_queen) to_chat(original, SPAN_XENOANNOUNCE("You have taken too long to pick a spawn location, a queen has already evolved before you.")) player.send_to_lobby() if(!selected_spawn) @@ -872,16 +875,16 @@ Additional game mode variables. // Support maps without queen spawns if(isnull(QS)) QS = get_turf(pick(GLOB.xeno_spawns)) - transform_queen(ghost_mind, QS, hivenumber) + transform_queen(ghost_mind, QS, faction_to_set) return QS -/datum/game_mode/proc/transform_queen(datum/mind/ghost_mind, turf/xeno_turf, hivenumber = FACTION_XENOMORPH_NORMAL) +/datum/game_mode/proc/transform_queen(datum/mind/ghost_mind, turf/xeno_turf, datum/faction/faction_to_set = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) var/mob/living/original = ghost_mind.current - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - if(hive.living_xeno_queen || !original || !original.client) + var/datum/faction_module/hive_mind/faction_module = faction_to_set.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen || !original || !original.client) return - var/mob/living/carbon/xenomorph/new_queen = new /mob/living/carbon/xenomorph/queen(xeno_turf, null, hivenumber) + var/mob/living/carbon/xenomorph/new_queen = new /mob/living/carbon/xenomorph/queen(xeno_turf, null, faction_to_set) ghost_mind.transfer_to(new_queen) //The mind is fine, since we already labeled them as a xeno. Away they go. ghost_mind.name = ghost_mind.current.name diff --git a/code/game/gamemodes/cm_process.dm b/code/game/gamemodes/cm_process.dm index fec7d58e094c..283084ae1e1a 100644 --- a/code/game/gamemodes/cm_process.dm +++ b/code/game/gamemodes/cm_process.dm @@ -198,7 +198,7 @@ GLOBAL_VAR_INIT(next_admin_bioscan, 30 MINUTES) if(M.z && (M.z in z_levels) && M.stat != DEAD && !istype(M.loc, /turf/open/space) && !istype(M.loc, /area/adminlevel/ert_station/fax_response_station)) //If they have a z var, they are on a turf. if(ishuman(M) && !isyautja(M) && !(M.status_flags & XENO_HOST) && !iszombie(M)) var/mob/living/carbon/human/H = M - if(((H.species && H.species.name == "Human") || (H.is_important)) && !H.hivenumber) //only real humans count, or those we have set to also be included + if(((H.species && H.species.name == "Human") || (H.is_important)) && !H.faction) //only real humans count, or those we have set to also be included num_humans++ else var/area/A = get_area(M) @@ -206,8 +206,7 @@ GLOBAL_VAR_INIT(next_admin_bioscan, 30 MINUTES) var/mob/living/carbon/xenomorph/xeno = M if(!xeno.counts_for_roundend) continue - var/datum/hive_status/xeno_hive = GLOB.hive_datum[xeno.hivenumber] - if(!xeno_hive || (xeno_hive.need_round_end_check && !xeno_hive.can_delay_round_end(xeno))) + if(!M.faction || (M.faction.need_round_end_check && !M.faction.can_delay_round_end(xeno))) continue if (A.flags_area & AREA_AVOID_BIOSCAN) continue diff --git a/code/game/jobs/job/antag/xeno/queen.dm b/code/game/jobs/job/antag/xeno/queen.dm index 144f8e42e6ad..d1bd3ea35c87 100644 --- a/code/game/jobs/job/antag/xeno/queen.dm +++ b/code/game/jobs/job/antag/xeno/queen.dm @@ -9,8 +9,8 @@ /datum/job/antag/xenos/queen/set_spawn_positions(count) return spawn_positions -/datum/job/antag/xenos/queen/transform_to_xeno(mob/living/carbon/human/human_to_transform, hive_index) - SSticker.mode.pick_queen_spawn(human_to_transform, hive_index) +/datum/job/antag/xenos/queen/transform_to_xeno(mob/living/carbon/human/human_to_transform, datum/faction/faction_to_set) + SSticker.mode.pick_queen_spawn(human_to_transform, faction_to_set) /datum/job/antag/xenos/queen/announce_entry_message(mob/new_queen, account, whitelist_status) to_chat(new_queen, "You are now the alien queen!") diff --git a/code/game/jobs/job/antag/xeno/xenomorph.dm b/code/game/jobs/job/antag/xeno/xenomorph.dm index be5d83a6d6ae..8ae3ed7ea891 100644 --- a/code/game/jobs/job/antag/xeno/xenomorph.dm +++ b/code/game/jobs/job/antag/xeno/xenomorph.dm @@ -23,12 +23,11 @@ . = ..() var/mob/living/carbon/human/H = . - transform_to_xeno(H, FACTION_XENOMORPH_NORMAL) + transform_to_xeno(H, GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) -/datum/job/antag/xenos/proc/transform_to_xeno(mob/living/carbon/human/human_to_transform, hive_index) +/datum/job/antag/xenos/proc/transform_to_xeno(mob/living/carbon/human/human_to_transform, datum/faction/faction_to_set) var/datum/mind/new_xeno = human_to_transform.mind new_xeno.setup_xeno_stats() - var/datum/hive_status/hive = GLOB.hive_datum[hive_index] human_to_transform.first_xeno = TRUE human_to_transform.set_stat(UNCONSCIOUS) @@ -95,7 +94,7 @@ var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(human_to_transform) //Put the initial larva in a host embryo.stage = 5 //Give the embryo a head-start (make the larva burst instantly) - embryo.hivenumber = hive.hivenumber + embryo.faction_to_get = faction_to_set.code_identificator /datum/job/antag/xenos/equip_job(mob/living/M) diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 228f6df5312f..2ebbe3d24f2e 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -372,7 +372,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou job.current_positions++ return TRUE -/datum/authority/branch/role/proc/check_role_entry(mob/new_player/player, datum/job/job, datum/faction/faction, latejoin = FALSE) +/datum/authority/branch/role/proc/check_role_entry(mob/new_player/player, datum/job/job, datum/faction/faction_to_set, latejoin = FALSE) if(jobban_isbanned(player, job.title)) return FALSE if(job.role_ban_alternative && jobban_isbanned(player, job.role_ban_alternative)) @@ -386,7 +386,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou if(latejoin && !job.late_joinable) return FALSE /* PART 2: Limitations in case of gamemode limitations - if(!SSautobalancer.can_join(faction)) + if(!SSautobalancer.can_join(faction_to_set)) return FALSE */ return TRUE diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 6c80f9c244f6..123f323bbeab 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -342,12 +342,11 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) warning = "Every sense in our form is screaming... the hive killer is almost ready to trigger!" else warning = "DISABLE IT! NOW!" - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) - return - xeno_announcement(SPAN_XENOANNOUNCE(warning), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) + continue + xeno_announcement(SPAN_XENOANNOUNCE(warning), faction, XENO_GENERAL_ANNOUNCE) return var/datum/hive_status/hive @@ -356,20 +355,20 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE ACTIVATED.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') var/t_left = duration2text_sec(floor(rand(timeleft - timeleft / 10, timeleft + timeleft / 10))) faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [t_left] to abandon the hunting grounds before it activates."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - xeno_announcement(SPAN_XENOANNOUNCE("The tallhosts have deployed a hive killer at [get_area_name(loc)]! Stop it at all costs!"), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The tallhosts have deployed a hive killer at [get_area_name(loc)]! Stop it at all costs!"), faction, XENO_GENERAL_ANNOUNCE) else announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DEACTIVATED.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DEACTIVATED.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - xeno_announcement(SPAN_XENOANNOUNCE("The hive killer has been disabled! Rejoice!"), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The hive killer has been disabled! Rejoice!"), faction, XENO_GENERAL_ANNOUNCE) return /obj/structure/machinery/nuclearbomb/ex_act(severity) @@ -571,12 +570,11 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nThe human purification device is able to be activated."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) - return - xeno_announcement(SPAN_XENOANNOUNCE("We get a sense of impending doom... the hive killer is ready to be activated. Our only chance now is to disable the device itself."), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) + continue + xeno_announcement(SPAN_XENOANNOUNCE("We get a sense of impending doom... the hive killer is ready to be activated. Our only chance now is to disable the device itself."), faction, XENO_GENERAL_ANNOUNCE) return announcement_helper("DECRYPTION IN [floor(decryption_time/10)] SECONDS.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') @@ -591,12 +589,11 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) if(timer_warning & NUKE_DECRYPT_SHOW_TIMER_HALF) warning = "The Hive grows restless! it's halfway done..." - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) - return - xeno_announcement(SPAN_XENOANNOUNCE(warning), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) + continue + xeno_announcement(SPAN_XENOANNOUNCE(warning), faction, XENO_GENERAL_ANNOUNCE) return var/datum/hive_status/hive @@ -605,21 +602,21 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DECRYPTION STARTED.\n\nDECRYPTION IN [floor(decryption_time/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') var/time_left = duration2text_sec(floor(rand(decryption_time - decryption_time / 10, decryption_time + decryption_time / 10))) faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [time_left] before it finishes its initial phase."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - xeno_announcement(SPAN_XENOANNOUNCE("The tallhosts have started the initial phase of a hive killer at [get_area_name(loc)]! You have about [time_left] to destroy at least one of their communications relays!"), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The tallhosts have started the initial phase of a hive killer at [get_area_name(loc)]! You have about [time_left] to destroy at least one of their communications relays!"), faction, XENO_GENERAL_ANNOUNCE) return announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE DECRYPTION HALTED.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE DECRYPTION HALTED.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) continue - xeno_announcement(SPAN_XENOANNOUNCE("The hive killer's initial phase has been halted! Rejoice!"), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("The hive killer's initial phase has been halted! Rejoice!"), faction, XENO_GENERAL_ANNOUNCE) /obj/structure/machinery/nuclearbomb/tech/proc/connected_comm_shutdown(obj/structure/machinery/telecomms/relay/preset/tower/telecomm_unit) SIGNAL_HANDLER diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index 54253f492870..a4506dccbf82 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -344,13 +344,13 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) var/list/held_children_weeds = parent_node.children var/cluster_loc = cluster_parent.loc - var/linked_hive = cluster_parent.linked_hive + var/faction = cluster_parent.faction parent_node.children = list() qdel(cluster_parent) - var/obj/effect/alien/resin/special/pylon/endgame/new_pylon = new(cluster_loc, linked_hive) + var/obj/effect/alien/resin/special/pylon/endgame/new_pylon = new(cluster_loc, faction) new_pylon.node.children = held_children_weeds for(var/obj/effect/alien/weeds/weed in new_pylon.node.children) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index ff9e094db147..49e78b6af3dc 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -47,7 +47,7 @@ mouse_opacity = MOUSE_OPACITY_TRANSPARENT var/datum/cause_data/cause_data - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/stun_duration = 1 var/damage_amount = 20 @@ -58,14 +58,14 @@ /obj/effect/xenomorph/spray/no_stun stun_duration = 0 -/obj/effect/xenomorph/spray/Initialize(mapload, new_cause_data, hive) //Self-deletes +/obj/effect/xenomorph/spray/Initialize(mapload, new_cause_data, _faction_to_get) //Self-deletes . = ..() // Stats tracking cause_data = new_cause_data - if(hive) - hivenumber = hive + if(_faction_to_get) + faction_to_get = _faction_to_get // check what's in our turf for(var/atom/atm in loc) @@ -99,7 +99,7 @@ if(istype(atm, /obj/effect/alien/weeds/)) var/obj/effect/alien/weeds/W = atm - if( !W.linked_hive || W.linked_hive.hivenumber != hivenumber ) + if(W.faction.code_identificator != faction_to_get) W.acid_spray_act() continue @@ -114,7 +114,7 @@ continue if (iscarbon(M)) var/mob/living/carbon/C = M - if (C.ally_of_hivenumber(hivenumber)) + if(C.ally_faction(GLOB.faction_datums[faction_to_get])) continue apply_spray(M) M.apply_armoured_damage(get_xeno_damage_acid(M, damage_amount), ARMOR_BIO, BURN) // Deal extra damage when first placing ourselves down. @@ -155,7 +155,7 @@ if(isliving(AM)) var/mob/living/living_mob = AM - if(living_mob.ally_of_hivenumber(hivenumber)) + if(living_mob.ally_faction(GLOB.faction_datums[faction_to_get])) living_mob.ExtinguishMob() else apply_spray(living_mob) @@ -531,7 +531,7 @@ var/damage = 20 var/message = null var/mob/living/carbon/xenomorph/linked_xeno = null - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/empowered = FALSE /obj/effect/xenomorph/acid_damage_delay/New(loc, damage = 20, delay = 10, empowered = FALSE, message = null, mob/living/carbon/xenomorph/linked_xeno = null) @@ -542,7 +542,7 @@ src.message = message src.linked_xeno = linked_xeno if(src.linked_xeno) - hivenumber = src.linked_xeno.hivenumber + faction_to_get = linked_xeno.faction.code_identificator if(empowered) icon_state = "boiler_bombard_danger" src.empowered = empowered @@ -556,7 +556,7 @@ if (H.stat == DEAD) continue - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(GLOB.faction_datums[faction_to_get])) continue animation_flash_color(H) @@ -596,7 +596,7 @@ if (H.stat == DEAD) continue - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(GLOB.faction_datums[faction_to_get])) continue total_hits++ diff --git a/code/game/objects/structures/pipes/pipes.dm b/code/game/objects/structures/pipes/pipes.dm index 6d6cb2265596..4c6b8e853904 100644 --- a/code/game/objects/structures/pipes/pipes.dm +++ b/code/game/objects/structures/pipes/pipes.dm @@ -122,7 +122,7 @@ var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in V.loc if(W) var/mob/living/carbon/xenomorph/X = user - if(!istype(X) || X.hivenumber != W.linked_hive.hivenumber) + if(!istype(X) || X.faction != W.faction) to_chat(user, SPAN_WARNING("The weeds are blocking the exit of this vent")) return diff --git a/code/game/turfs/walls/wall_types.dm b/code/game/turfs/walls/wall_types.dm index 15589c3f408c..5783142ed29e 100644 --- a/code/game/turfs/walls/wall_types.dm +++ b/code/game/turfs/walls/wall_types.dm @@ -724,14 +724,24 @@ blend_turfs = list(/turf/closed/wall/resin) blend_objects = list(/obj/structure/mineral_door/resin) repair_materials = list() - var/faction_to_get = FACTION_XENOMORPH_NORMAL var/should_track_build = FALSE var/datum/cause_data/construction_data turf_flags = TURF_ORGANIC -/turf/closed/wall/resin/Initialize(mapload) + var/faction_to_get = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction + +/turf/closed/wall/resin/Initialize(mapload, mob/builder) . = ..() + if(istype(builder)) + faction = builder.faction + + if(!faction) + faction = GLOB.faction_datums[faction_to_get] + else + faction_to_get = faction.code_identificator + for(var/obj/effect/alien/weeds/node/weed_node in contents) qdel(weed_node) @@ -756,7 +766,8 @@ SIGNAL_HANDLER if(is_ground_level(z)) faction_to_get = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, faction_to_get) + faction = GLOB.faction_datums[faction_to_get] + set_hive_data(src, faction) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -1274,7 +1285,7 @@ return attack_hand(user) /turf/closed/wall/resin/ChangeTurf(newtype, ...) - var/hive = hivenumber + var/datum/faction/transfer_ref = faction . = ..() if(.) var/turf/T @@ -1286,8 +1297,8 @@ var/turf/closed/wall/resin/W = . if (istype(W)) - W.hivenumber = hive - set_hive_data(W, W.hivenumber) + W.faction = transfer_ref + set_hive_data(W, W.faction) /turf/closed/wall/resin/weak name = "weak resin wall" diff --git a/code/modules/admin/player_panel/actions/transform.dm b/code/modules/admin/player_panel/actions/transform.dm index 2fc52dbd1b9a..f4746ed504fc 100644 --- a/code/modules/admin/player_panel/actions/transform.dm +++ b/code/modules/admin/player_panel/actions/transform.dm @@ -194,7 +194,7 @@ GLOBAL_LIST_INIT(pp_transformables, list( var/mob/living/carbon/xenomorph/newXeno = M if(isxeno(target)) var/mob/living/carbon/xenomorph/X = target - newXeno.set_hive_and_update(X.hivenumber) + newXeno.set_hive_and_update(X.faction) QDEL_IN(target, 0.3 SECONDS) diff --git a/code/modules/clothing/glasses/night.dm b/code/modules/clothing/glasses/night.dm index e41a7c77b592..f0abcd0d226f 100644 --- a/code/modules/clothing/glasses/night.dm +++ b/code/modules/clothing/glasses/night.dm @@ -228,7 +228,7 @@ if(slot == WEAR_EYES) if(iscarbon(user)) var/mob/living/carbon/H = user - if(!H.hivenumber) + if(H.faction.get_faction_module(FACTION_MODULE_HIVE_MIND)) to_chat(user, SPAN_WARNING("You do not want to put these on, they're making you nauseous.")) return FALSE return ..() diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index c013f9716236..2428b6422621 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -9,6 +9,39 @@ health = 1 flags_obj = OBJ_ORGANIC + var/faction_to_get = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction + +/obj/effect/alien/Initialize(mapload, mob/builder) + if(istype(builder)) + faction = builder.faction + + if(!faction) + faction = GLOB.faction_datums[faction_to_get] + else + faction_to_get = faction.code_identificator + + set_hive_data(src, faction) + + if(faction_to_get == FACTION_XENOMORPH_NORMAL) + RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) + + . = ..() + +/obj/effect/alien/Destroy(force) + faction = null + + . = ..() + +/obj/effect/alien/proc/forsaken_handling() + SIGNAL_HANDLER + if(is_ground_level(z)) + faction_to_get = FACTION_XENOMORPH_FORSAKEN + faction = GLOB.faction_datums[faction_to_get] + set_hive_data(src, faction) + + UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) + /* * Resin */ @@ -157,35 +190,18 @@ layer = RESIN_STRUCTURE_LAYER plane = FLOOR_PLANE var/slow_amt = 8 - var/hivenumber = FACTION_XENOMORPH_NORMAL - -/obj/effect/alien/resin/sticky/Initialize(mapload, hive) - . = ..() - if (hive) - hivenumber = hive - set_hive_data(src, hivenumber) - if(hivenumber == FACTION_XENOMORPH_NORMAL) - RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) /obj/effect/alien/resin/sticky/Crossed(atom/movable/AM) . = ..() var/mob/living/carbon/human/H = AM - if(istype(H) && !H.ally_of_hivenumber(hivenumber)) + if(istype(H) && !H.ally_faction(faction)) H.next_move_slowdown = max(H.next_move_slowdown, slow_amt) return . var/mob/living/carbon/xenomorph/X = AM - if(istype(X) && !X.ally_of_hivenumber(hivenumber)) + if(istype(X) && !X.ally_faction(faction)) X.next_move_slowdown = max(X.next_move_slowdown, slow_amt) return . -/obj/effect/alien/resin/sticky/proc/forsaken_handling() - SIGNAL_HANDLER - if(is_ground_level(z)) - hivenumber = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) - - UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) - /obj/effect/alien/resin/spike name = "resin spike" desc = "A small cluster of bone spikes. Ouch." @@ -196,7 +212,6 @@ health = HEALTH_RESIN_XENO_SPIKE layer = RESIN_STRUCTURE_LAYER should_track_build = TRUE - var/hivenumber = FACTION_XENOMORPH_NORMAL var/damage = 8 var/penetration = 50 @@ -209,12 +224,7 @@ /obj/effect/alien/resin/spike/Initialize(mapload, hive) . = ..() - if (hive) - hivenumber = hive - set_hive_data(src, hivenumber) setDir(pick(GLOB.alldirs)) - if(hivenumber == FACTION_XENOMORPH_NORMAL) - RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) /obj/effect/alien/resin/spike/Crossed(atom/movable/AM) . = ..() @@ -222,20 +232,12 @@ if(!istype(H)) return - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(faction)) return H.apply_armoured_damage(damage, penetration = penetration, def_zone = pick(target_limbs)) H.last_damage_data = construction_data -/obj/effect/alien/resin/spike/proc/forsaken_handling() - SIGNAL_HANDLER - if(is_ground_level(z)) - hivenumber = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) - - UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) - // Praetorian Sticky Resin spit uses this. /obj/effect/alien/resin/sticky/thin name = "thin sticky resin" @@ -294,29 +296,28 @@ mark_meaning = new X.selected_mark seenMeaning = image(icon, src.loc, mark_meaning.icon_state, ABOVE_HUD_LAYER, "pixel_y" = 5) seenMeaning.plane = ABOVE_HUD_PLANE - hivenumber = X.hivenumber createdTime = worldtime2text() - X.hive.resin_marks += src + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.resin_marks += src - X.hive.mark_ui.update_all_data() + faction_module.mark_ui.update_all_data() - for(var/mob/living/carbon/xenomorph/XX in X.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/XX in faction.total_mobs) XX.hud_set_marks() //this should be a hud thing, but that code is too confusing so I am doing it here addtimer(CALLBACK(src, PROC_REF(check_for_weeds)), 30 SECONDS, TIMER_UNIQUE) /obj/effect/alien/resin/marker/Destroy() - var/datum/hive_status/builder_hive = GLOB.hive_datum[hivenumber] - - if(builder_hive) - builder_hive.resin_marks -= src + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.resin_marks -= src - for(var/mob/living/carbon/xenomorph/XX in builder_hive.totalXenos) + for(var/mob/living/carbon/xenomorph/XX in faction.total_mobs) XX.built_structures -= src if(!XX.client) continue XX.client.images -= seenMeaning //this should be a hud thing, but that code is too confusing so I am doing it here - XX.hive.mark_ui.update_all_data() + faction_module.mark_ui.update_all_data() for(var/mob/living/carbon/xenomorph/X in xenos_tracking) //no floating references :0) X.stop_tracking_resin_mark(TRUE) @@ -333,8 +334,7 @@ /obj/effect/alien/resin/marker/get_examine_text(mob/user) . = ..() var/mob/living/carbon/xenomorph/xeno_createdby - var/datum/hive_status/builder_hive = GLOB.hive_datum[hivenumber] - for(var/mob/living/carbon/xenomorph/X in builder_hive.totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction.total_mobs) if(X.nicknumber == createdby) xeno_createdby = X if(isxeno(user) || isobserver(user)) @@ -361,12 +361,13 @@ var/close_delay = 100 var/faction_to_get = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction flags_obj = OBJ_ORGANIC layer = DOOR_CLOSED_LAYER tiles_with = list(/obj/structure/mineral_door/resin) -/obj/structure/mineral_door/resin/Initialize(mapload, _faction_to_get) +/obj/structure/mineral_door/resin/Initialize(mapload, mob/builder) . = ..() relativewall() relativewall_neighbours() @@ -374,12 +375,17 @@ W.update_connections() W.update_icon() - if(hive) - hivenumber = hive + if(istype(builder)) + faction = builder.faction - set_hive_data(src, hivenumber) + if(!faction) + faction = GLOB.faction_datums[faction_to_get] + else + faction_to_get = faction.code_identificator + + set_hive_data(src, faction) - if(hivenumber == FACTION_XENOMORPH_NORMAL) + if(faction_to_get == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) var/area/area = get_area(src) @@ -414,14 +420,14 @@ /obj/structure/mineral_door/resin/TryToSwitchState(atom/user) if(isxeno(user)) var/mob/living/carbon/xenomorph/xeno_user = user - if (xeno_user.hivenumber != hivenumber && !xeno_user.ally_of_hivenumber(hivenumber)) + if(!xeno_user.ally_faction(faction)) return if(xeno_user.scuttle(src)) return return ..() if(iscarbon(user)) var/mob/living/carbon/C = user - if (C.ally_of_hivenumber(hivenumber)) + if(!C.ally_faction(faction)) return ..() /obj/structure/mineral_door/resin/open() @@ -485,6 +491,7 @@ /obj/structure/mineral_door/resin/Destroy() relativewall_neighbours() + faction = null var/area/area = get_area(src) area?.current_resin_count-- var/turf/base_turf = loc @@ -545,6 +552,7 @@ set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) + /obj/structure/mineral_door/resin/thick name = "thick resin door" icon_state = "thick resin" @@ -559,7 +567,6 @@ icon_state = "acid_pillar_idle" health = HEALTH_RESIN_XENO_ACID_PILLAR - var/hivenumber = FACTION_XENOMORPH_NORMAL should_track_build = TRUE anchored = TRUE @@ -572,12 +579,7 @@ /obj/effect/alien/resin/acid_pillar/Initialize(mapload, hive) . = ..() - if (hive) - hivenumber = hive - set_hive_data(src, hivenumber) START_PROCESSING(SSprocessing, src) - if(hivenumber == FACTION_XENOMORPH_NORMAL) - RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) /obj/effect/alien/resin/acid_pillar/proc/can_target(mob/living/carbon/current_mob, position_to_get = 0) @@ -670,7 +672,7 @@ /obj/effect/alien/resin/acid_pillar/get_projectile_hit_boolean(obj/projectile/P) return TRUE -/obj/effect/alien/resin/acid_pillar/proc/forsaken_handling() +/obj/effect/alien/resin/acid_pillar/forsaken_handling() SIGNAL_HANDLER UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) if(is_ground_level(z)) @@ -698,7 +700,6 @@ pixel_y = -16 health = HEALTH_RESIN_XENO_SHIELD_PILLAR - var/hivenumber = FACTION_XENOMORPH_NORMAL anchored = TRUE var/decay_rate = AMOUNT_PER_TIME(1, 10 SECONDS) @@ -707,14 +708,11 @@ /obj/effect/alien/resin/shield_pillar/Initialize(mapload, hive) . = ..() - if (hive) - hivenumber = hive - set_hive_data(src, hivenumber) START_PROCESSING(SSshield_pillar, src) /obj/effect/alien/resin/shield_pillar/process() for(var/mob/living/carbon/xenomorph/X in urange(range, src)) - if((X.hivenumber != hivenumber) || X.stat == DEAD) + if((X.faction != faction) || X.stat == DEAD) continue X.add_xeno_shield(shield_to_give, XENO_SHIELD_SOURCE_SHIELD_PILLAR, decay_amount_per_second = 1, add_shield_on = TRUE, duration = 1 SECONDS) X.flick_heal_overlay(1 SECONDS, "#ffa800") @@ -881,8 +879,6 @@ /// The mob picked as a candidate to be the King var/client/chosen_candidate - /// The hive associated with this cocoon - var/hive_number = FACTION_XENOMORPH_NORMAL /// Whether the cocoon has hatched var/hatched = FALSE /// Current running timer @@ -895,19 +891,18 @@ /obj/effect/alien/resin/king_cocoon/Destroy() if(!hatched) faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP IN [uppertext(get_area_name(loc))] HAS BEEN STOPPED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - var/datum/hive_status/hive - for(var/cur_hive_num in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_hive_num] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] + if(!length(cur_faction.total_mobs)) continue - if(cur_hive_num == hive_number) - xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED! VENGEANCE!"), cur_hive_num, XENO_GENERAL_ANNOUNCE) + if(cur_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED! VENGEANCE!"), cur_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED!"), cur_hive_num, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED!"), cur_faction, XENO_GENERAL_ANNOUNCE) - var/datum/hive_status/hive = GLOB.hive_datum[hive_number] - hive.has_hatchery = FALSE - for(var/obj/effect/alien/resin/special/pylon/pylon as anything in hive.active_endgame_pylons) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.has_hatchery = FALSE + for(var/obj/effect/alien/resin/special/pylon/pylon as anything in faction_module.active_endgame_pylons) pylon.protection_level = initial(pylon.protection_level) pylon.update_icon() @@ -921,9 +916,9 @@ if(hivenumber) hive_number = hivenumber - var/datum/hive_status/hatchery_hive = GLOB.hive_datum[hive_number] - hatchery_hive.has_hatchery = TRUE - color = hatchery_hive.color + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.has_hatchery = TRUE + color = faction.color for(var/x_offset in -1 to 1) for(var/y_offset in -1 to 1) @@ -935,21 +930,19 @@ addtimer(CALLBACK(src, PROC_REF(check_pylons)), 10 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME|TIMER_LOOP) faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 10 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - var/datum/hive_status/hive - for(var/cur_hive_num in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_hive_num] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] + if(!length(cur_faction.total_mobs)) continue - if(cur_hive_num == hive_number) - xeno_announcement(SPAN_XENOANNOUNCE("The King is growing at [get_area_name(loc)]. Protect it at all costs!"), cur_hive_num, XENO_GENERAL_ANNOUNCE) + if(cur_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("The King is growing at [get_area_name(loc)]. Protect it at all costs!"), cur_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King is growing at [get_area_name(loc)]."), cur_hive_num, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King is growing at [get_area_name(loc)]."), cur_faction, XENO_GENERAL_ANNOUNCE) /// Callback for a repeating 10s timer to ensure both pylons are active (otherwise delete) and counts the number of marines groundside (would cause hatching to expedite). /obj/effect/alien/resin/king_cocoon/proc/check_pylons() - var/datum/hive_status/hive = GLOB.hive_datum[hive_number] - - if(length(hive.active_endgame_pylons) < 2) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(length(faction_module.active_endgame_pylons) < 2) qdel(src) return @@ -985,15 +978,14 @@ timer = addtimer(CALLBACK(src, PROC_REF(start_vote)), 4 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 5 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - var/datum/hive_status/hive - for(var/cur_hive_num in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_hive_num] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] + if(!length(cur_faction.total_mobs)) continue - if(cur_hive_num == hive_number) - xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately 5 minutes."), cur_hive_num, XENO_GENERAL_ANNOUNCE) + if(cur_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately 5 minutes."), cur_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately 5 minutes."), cur_hive_num, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately 5 minutes."), cur_faction, XENO_GENERAL_ANNOUNCE) #define KING_PLAYTIME_HOURS (50 HOURS) @@ -1084,8 +1076,6 @@ * * expedite: Whether hatching should begin in a minute or immediately after a candidate is found. */ /obj/effect/alien/resin/king_cocoon/proc/roll_candidates(list/mob/living/carbon/xenomorph/voting_candidates, expedite = FALSE) - var/datum/hive_status/hive = GLOB.hive_datum[hive_number] - var/primary_votes = 0 var/mob/living/carbon/xenomorph/primary_candidate var/secondary_votes = 0 @@ -1101,7 +1091,7 @@ votes.Cut() - if(prob(50) && try_roll_candidate(hive, primary_candidate, playtime_restricted = TRUE)) + if(prob(50) && try_roll_candidate(faction, primary_candidate, playtime_restricted = TRUE)) chosen_candidate = primary_candidate.client rolling_candidates = FALSE start_hatching(expedite) @@ -1110,7 +1100,7 @@ voting_candidates -= primary_candidate - if(try_roll_candidate(hive, secondary_candidate, playtime_restricted = TRUE)) + if(try_roll_candidate(faction, secondary_candidate, playtime_restricted = TRUE)) chosen_candidate = secondary_candidate.client rolling_candidates = FALSE start_hatching(expedite) @@ -1120,29 +1110,30 @@ // Otherwise ask all the living xenos (minus the player(s) who got voted on earlier) for(var/mob/living/carbon/xenomorph/candidate in shuffle(voting_candidates)) - if(try_roll_candidate(hive, candidate, playtime_restricted = TRUE)) + if(try_roll_candidate(faction, candidate, playtime_restricted = TRUE)) chosen_candidate = candidate.client rolling_candidates = FALSE start_hatching(expedite) return // Then observers - var/list/observer_list_copy = shuffle(get_alien_candidates(hive)) + var/list/observer_list_copy = shuffle(get_alien_candidates(faction)) for(var/mob/candidate in observer_list_copy) - if(try_roll_candidate(hive, candidate, playtime_restricted = TRUE)) + if(try_roll_candidate(faction, candidate, playtime_restricted = TRUE)) chosen_candidate = candidate.client rolling_candidates = FALSE start_hatching(expedite) return // Lastly all of the above again, without playtime requirements - for(var/mob/living/carbon/xenomorph/candidate in shuffle(hive.totalXenos.Copy() - hive.living_xeno_queen)) - if(try_roll_candidate(hive, candidate, playtime_restricted = FALSE)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/mob/living/carbon/xenomorph/candidate in shuffle(faction.total_mobs.Copy() - faction_module.living_xeno_queen)) + if(try_roll_candidate(faction, candidate, playtime_restricted = FALSE)) chosen_candidate = candidate.client rolling_candidates = FALSE start_hatching(expedite) return for(var/mob/candidate in observer_list_copy) - if(try_roll_candidate(hive, candidate, playtime_restricted = FALSE)) + if(try_roll_candidate(faction, candidate, playtime_restricted = FALSE)) chosen_candidate = candidate.client rolling_candidates = FALSE start_hatching(expedite) @@ -1157,15 +1148,14 @@ return faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [get_area_name(loc)].\n\nESTIMATED TIME UNTIL COMPLETION - ONE MINUTE.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - var/datum/hive_status/hive - for(var/cur_hive_num in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_hive_num] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] + if(!length(cur_faction.total_mobs)) continue - if(cur_hive_num == hive_number) - xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately one minute."), cur_hive_num, XENO_GENERAL_ANNOUNCE) + if(cur_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately one minute."), cur_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately one minute."), cur_hive_num, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately one minute."), cur_faction, XENO_GENERAL_ANNOUNCE) timer = addtimer(CALLBACK(src, PROC_REF(animate_hatch_king)), 1 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) @@ -1175,15 +1165,14 @@ addtimer(CALLBACK(src, PROC_REF(hatch_king)), 2 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE) faction_announcement("ALERT.\n\nEXTREME ENERGY INFLUX DETECTED IN [get_area_name(loc)].\n\nCAUTION IS ADVISED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - var/datum/hive_status/hive - for(var/cur_hive_num in GLOB.hive_datum) - hive = GLOB.hive_datum[cur_hive_num] - if(!length(hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] + if(!length(cur_faction.total_mobs)) continue - if(cur_hive_num == hive_number) - xeno_announcement(SPAN_XENOANNOUNCE("All hail the King."), cur_hive_num, XENO_GENERAL_ANNOUNCE) + if(cur_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("All hail the King."), cur_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King has hatched!"), cur_hive_num, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King has hatched!"), cur_faction, XENO_GENERAL_ANNOUNCE) /// Actually hatches the King transferring the candidate into the spawned mob and initiates the next timer. /obj/effect/alien/resin/king_cocoon/proc/hatch_king() @@ -1192,7 +1181,7 @@ QDEL_LIST(blockers) - var/mob/living/carbon/xenomorph/king/king = new(get_turf(src), null, hive_number) + var/mob/living/carbon/xenomorph/king/king = new(get_turf(src), null, faction) if(chosen_candidate?.mob) var/mob/old_mob = chosen_candidate.mob old_mob.mind.transfer_to(king) @@ -1210,8 +1199,8 @@ /// The final step in the cocoon sequence: Resets pylon protection levels /obj/effect/alien/resin/king_cocoon/proc/remove_ob_protection() - var/datum/hive_status/hive = GLOB.hive_datum[hive_number] - for(var/obj/effect/alien/resin/special/pylon/pylon as anything in hive.active_endgame_pylons) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/obj/effect/alien/resin/special/pylon/pylon as anything in faction_module.active_endgame_pylons) pylon.protection_level = initial(pylon.protection_level) pylon.update_icon() @@ -1239,11 +1228,11 @@ var/can_prime = FALSE - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL -/obj/item/explosive/grenade/alien/Initialize(mapload, hivenumber) +/obj/item/explosive/grenade/alien/Initialize(mapload, faction_to_get) . = ..() - src.hivenumber = hivenumber + src.faction_to_get = faction_to_get /obj/item/explosive/grenade/alien/try_to_throw(mob/living/user) if(isxeno(user)) @@ -1299,7 +1288,7 @@ return E.range = range - E.hivenumber = hivenumber + E.faction_to_get = faction_to_get E.source = initial(name) qdel(src) @@ -1311,7 +1300,7 @@ // Which direction is the explosion traveling? // Note that this will be null for the epicenter - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/source var/direction = null var/range = 0 @@ -1344,7 +1333,7 @@ return QDEL_NULL(temp) - new acid_type(in_turf, create_cause_data(source), hivenumber) + new acid_type(in_turf, create_cause_data(source), faction_to_get) // Range has been reached if(range <= 0) @@ -1371,7 +1360,7 @@ if(2 to INFINITY) E.acid_type = /obj/effect/xenomorph/spray/strong/no_stun - E.hivenumber = hivenumber + E.faction_to_get = faction_to_get E.source = source // We've done our duty, now die pls diff --git a/code/modules/cm_aliens/hivebuffs/hivebuff.dm b/code/modules/cm_aliens/hivebuffs/hivebuff.dm index b8bcaf31dc2a..cf8019835ebe 100644 --- a/code/modules/cm_aliens/hivebuffs/hivebuff.dm +++ b/code/modules/cm_aliens/hivebuffs/hivebuff.dm @@ -1,7 +1,4 @@ //GLOBAL DEFINES// - -#define HIVE_STARTING_BUFFPOINTS 0 -#define HIVE_MAX_BUFFPOINTS 10 #define BUFF_POINTS_NAME "Royal resin" //LOCAL DEFINES// diff --git a/code/modules/cm_aliens/structures/construction_node.dm b/code/modules/cm_aliens/structures/construction_node.dm index dbc4fcb0d9bf..b364e49caa1b 100644 --- a/code/modules/cm_aliens/structures/construction_node.dm +++ b/code/modules/cm_aliens/structures/construction_node.dm @@ -13,19 +13,20 @@ block_range = 1 var/datum/construction_template/xenomorph/template //What we're building - var/datum/hive_status/linked_hive //Who gets what we build + var/datum/faction/faction //Who gets what we build -/obj/effect/alien/resin/construction/Initialize(mapload, hive_ref) +/obj/effect/alien/resin/construction/Initialize(mapload, faction_ref) . = ..() - linked_hive = hive_ref - if (linked_hive?.color) - color = linked_hive.color + faction = faction_ref + if(faction?.color) + color = faction.color /obj/effect/alien/resin/construction/Destroy() - if(template && linked_hive && (template.plasma_stored < template.plasma_required)) - linked_hive.remove_construction(src) + if(template && faction && (template.plasma_stored < template.plasma_required)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.remove_construction(src) template = null - linked_hive = null + faction = null return ..() /obj/effect/alien/resin/construction/update_icon() @@ -40,12 +41,12 @@ /obj/effect/alien/resin/construction/get_examine_text(mob/user) . = ..() - if((isxeno(user) || isobserver(user)) && linked_hive) + if((isxeno(user) || isobserver(user)) && faction) var/message = "A [template.name] construction is designated here. It requires [template.plasma_required - template.plasma_stored] more plasma." . += message /obj/effect/alien/resin/construction/attack_alien(mob/living/carbon/xenomorph/M) - if(!linked_hive || (linked_hive && (M.hivenumber != linked_hive.hivenumber)) || (M.a_intent == INTENT_HARM && M.can_destroy_special())) + if(!faction || (faction && (M.faction != faction)) || (M.a_intent == INTENT_HARM && M.can_destroy_special())) return ..() if(!template) to_chat(M, SPAN_XENOWARNING("There is no template!")) @@ -54,11 +55,11 @@ return XENO_NO_DELAY_ACTION /obj/effect/alien/resin/construction/proc/set_template(datum/construction_template/xenomorph/new_template) - if(!istype(new_template) || !linked_hive) + if(!istype(new_template) || !faction) return template = new_template template.owner = src template.build_loc = get_turf(src) - template.hive_ref = linked_hive + template.faction = faction template.on_template_creation() update_icon() diff --git a/code/modules/cm_aliens/structures/egg.dm b/code/modules/cm_aliens/structures/egg.dm index 6f376de2717a..0e03b71f34b9 100644 --- a/code/modules/cm_aliens/structures/egg.dm +++ b/code/modules/cm_aliens/structures/egg.dm @@ -14,7 +14,6 @@ var/list/egg_triggers = list() var/status = EGG_GROWING //can be EGG_GROWING, EGG_GROWN, EGG_BURST, EGG_BURSTING, or EGG_DESTROYED; all mutually exclusive var/on_fire = FALSE - var/hivenumber = FACTION_XENOMORPH_NORMAL var/flags_embryo = NO_FLAGS /// The weed strength that needs to be maintained in order for this egg to not decay; null disables check var/weed_strength_required = WEED_LEVEL_HIVE @@ -24,13 +23,7 @@ /obj/effect/alien/egg/Initialize(mapload, hive) . = ..() create_egg_triggers() - if(hive) - hivenumber = hive - if(hivenumber == FACTION_XENOMORPH_NORMAL) - RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) - - set_hive_data(src, hivenumber) update_icon() addtimer(CALLBACK(src, PROC_REF(Grow)), rand(EGG_MIN_GROWTH_TIME, EGG_MAX_GROWTH_TIME)) @@ -42,14 +35,6 @@ if(area && area.linked_lz) AddComponent(/datum/component/resin_cleanup) -/obj/effect/alien/egg/proc/forsaken_handling() - SIGNAL_HANDLER - if(is_ground_level(z)) - hivenumber = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) - - UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) - /// SIGNAL_HANDLER for COMSIG_PARENT_QDELETING of weeds to potentially orphan this egg /obj/effect/alien/egg/proc/on_weed_deletion() SIGNAL_HANDLER @@ -124,7 +109,7 @@ qdel(src) return XENO_NONCOMBAT_ACTION - if(M.hivenumber != hivenumber) + if(M.faction != faction) M.animation_attack_on(src) M.visible_message(SPAN_XENOWARNING("[M] crushes \the [src]"), SPAN_XENOWARNING("We crush \the [src]")) @@ -322,10 +307,10 @@ Burst(TRUE) /obj/effect/alien/egg/alpha - hivenumber = XENO_HIVE_ALPHA + faction_to_get = XENO_HIVE_ALPHA /obj/effect/alien/egg/forsaken - hivenumber = FACTION_XENOMORPH_FORSAKEN + faction_to_get = FACTION_XENOMORPH_FORSAKEN /obj/effect/alien/egg/attack_ghost(mob/dead/observer/user) . = ..() //Do a view printout as needed just in case the observer doesn't want to join as a Hugger but wants info diff --git a/code/modules/cm_aliens/structures/fruit.dm b/code/modules/cm_aliens/structures/fruit.dm index 3f04ed66b96e..3c22f6a5fae0 100644 --- a/code/modules/cm_aliens/structures/fruit.dm +++ b/code/modules/cm_aliens/structures/fruit.dm @@ -162,7 +162,7 @@ else to_chat(affected_xeno, SPAN_XENOWARNING("[name] isn't ripe yet. We need to wait a little longer.")) - if(affected_xeno.a_intent == INTENT_HARM && isxeno_builder(affected_xeno) || (!affected_xeno.can_not_harm(bound_xeno) && affected_xeno.hivenumber != hivenumber)) + if(affected_xeno.a_intent == INTENT_HARM && isxeno_builder(affected_xeno) || (!affected_xeno.can_not_harm(bound_xeno) && affected_xeno.faction != faction)) affected_xeno.animation_attack_on(src) affected_xeno.visible_message(SPAN_XENODANGER("[affected_xeno] removes [name]!"), SPAN_XENODANGER("You remove [name]!")) diff --git a/code/modules/cm_aliens/structures/special/egg_morpher.dm b/code/modules/cm_aliens/structures/special/egg_morpher.dm index e0691b0d4d28..e7d44824c728 100644 --- a/code/modules/cm_aliens/structures/special/egg_morpher.dm +++ b/code/modules/cm_aliens/structures/special/egg_morpher.dm @@ -32,14 +32,14 @@ range_bounds = SQUARE(x, y, EGGMORPG_RANGE) /obj/effect/alien/resin/special/eggmorph/Destroy() - if (stored_huggers && linked_hive) + if (stored_huggers && faction) //Hugger explosion, like a carrier var/obj/item/clothing/mask/facehugger/F var/chance = 60 visible_message(SPAN_XENOWARNING("The chittering mass of tiny aliens is trying to escape [src]!")) for(var/i in 1 to stored_huggers) if(prob(chance)) - F = new(loc, linked_hive.hivenumber) + F = new(loc, faction) step_away(F,src,1) range_bounds = null @@ -50,8 +50,9 @@ if(isxeno(user) || isobserver(user)) . += SPAN_NOTICE("\nIt has [stored_huggers] facehuggers within, with [max(0, huggers_to_grow_max - stored_huggers)] more to grow and a total capacity of [huggers_max_amount] facehuggers (reserved: [huggers_reserved]).") - var/current_hugger_count = linked_hive.get_current_playable_facehugger_count(); - . += SPAN_NOTICE("There are currently [current_hugger_count] facehuggers in the hive. The hive can support a total of [linked_hive.playable_hugger_limit] facehuggers at present.") + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/current_hugger_count = faction_module.get_current_playable_facehugger_count(); + . += SPAN_NOTICE("There are currently [current_hugger_count] facehuggers in the hive. The hive can support a total of [faction_module.playable_hugger_limit] facehuggers at present.") if(stored_huggers < huggers_to_grow_max) . += SPAN_NOTICE("It'll grow another facehugger in [COOLDOWN_SECONDSLEFT(src, spawn_cooldown)] seconds.") if(isxeno(user)) @@ -107,7 +108,7 @@ /obj/effect/alien/resin/special/eggmorph/process() check_facehugger_target() - if(!linked_hive || !COOLDOWN_FINISHED(src, spawn_cooldown) || stored_huggers == huggers_to_grow_max) + if(!faction || !COOLDOWN_FINISHED(src, spawn_cooldown) || stored_huggers == huggers_to_grow_max) return COOLDOWN_START(src, spawn_cooldown, get_egg_cooldown()) if(stored_huggers < huggers_to_grow_max) @@ -131,21 +132,21 @@ if(!stored_huggers || issynth(AM)) return - if (!linked_hive) + if(!faction) return - if(!can_hug(AM, linked_hive.hivenumber)) + if(!can_hug(AM, faction.code_identificator)) return stored_huggers = max(0, stored_huggers - 1) - var/obj/item/clothing/mask/facehugger/child = new(loc, linked_hive.hivenumber) + var/obj/item/clothing/mask/facehugger/child = new(loc, faction) child.leap_at_nearest_target() /obj/effect/alien/resin/special/eggmorph/attack_alien(mob/living/carbon/xenomorph/M) if(!istype(M)) return attack_hand(M) - if(!linked_hive || (M.hivenumber != linked_hive.hivenumber)) + if(!faction || (M.faction != faction)) return ..(M) if(stored_huggers) //this way another hugger doesn't immediately spawn after we pick one up @@ -154,7 +155,7 @@ to_chat(M, SPAN_XENONOTICE("You retrieve a child.")) stored_huggers = max(0, stored_huggers - 1) - var/obj/item/clothing/mask/facehugger/hugger = new(loc, linked_hive.hivenumber) + var/obj/item/clothing/mask/facehugger/hugger = new(loc, faction) SEND_SIGNAL(M, COMSIG_XENO_TAKE_HUGGER_FROM_MORPHER, hugger) return XENO_NONCOMBAT_ACTION ..() @@ -164,21 +165,24 @@ join_as_facehugger_from_this(user) /obj/effect/alien/resin/special/eggmorph/proc/get_egg_cooldown() - if(linked_hive?.living_xeno_queen?.ovipositor) - return spawn_cooldown_length_ovi + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen?.ovipositor) + return spawn_cooldown_length_ovi return spawn_cooldown_length /obj/effect/alien/resin/special/eggmorph/proc/join_as_facehugger_from_this(mob/dead/observer/user) if(stored_huggers <= huggers_reserved) to_chat(user, SPAN_WARNING("\The [src] doesn't have any facehuggers to inhabit.")) return - if(!linked_hive.can_spawn_as_hugger(user)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.can_spawn_as_hugger(user)) return //Need to check again because time passed due to the confirmation window if(stored_huggers <= huggers_reserved) to_chat(user, SPAN_WARNING("\The [src] doesn't have any facehuggers to inhabit.")) return - linked_hive.spawn_as_hugger(user, src) + faction_module.spawn_as_hugger(user, src) stored_huggers-- /mob/living/carbon/xenomorph/proc/set_hugger_reserve_for_morpher(obj/effect/alien/resin/special/eggmorph/morpher in oview(1)) @@ -189,8 +193,8 @@ if(!istype(morpher)) return - if(morpher.linked_hive) - if(hivenumber != morpher.linked_hive.hivenumber) + if(morpher.faction) + if(faction != morpher.faction) to_chat(usr, SPAN_WARNING("This belongs to another Hive! Yuck!")) return diff --git a/code/modules/cm_aliens/structures/special/hive_cluster.dm b/code/modules/cm_aliens/structures/special/hive_cluster.dm index 266748a96c80..6bb50c12840d 100644 --- a/code/modules/cm_aliens/structures/special/hive_cluster.dm +++ b/code/modules/cm_aliens/structures/special/hive_cluster.dm @@ -35,7 +35,7 @@ return ..() /obj/effect/alien/resin/special/cluster/attack_alien(mob/living/carbon/xenomorph/M) - if(isxeno_builder(M) && M.a_intent == INTENT_HELP && M.hivenumber == linked_hive.hivenumber) + if(isxeno_builder(M) && M.a_intent == INTENT_HELP && M.faction == faction) do_repair(M) //This handles the delay itself. return XENO_NO_DELAY_ACTION else @@ -81,7 +81,7 @@ playsound(loc, "alien_resin_build", 25) /obj/effect/alien/resin/special/cluster/proc/place_node() - var/obj/effect/alien/weeds/node/pylon/cluster/W = new node_type(loc, null, null, linked_hive) + var/obj/effect/alien/weeds/node/pylon/cluster/W = new node_type(loc, null, null, faction) W.resin_parent = src return W diff --git a/code/modules/cm_aliens/structures/special/pred_nest.dm b/code/modules/cm_aliens/structures/special/pred_nest.dm index 2d84ced8db61..b7821a0bb2aa 100644 --- a/code/modules/cm_aliens/structures/special/pred_nest.dm +++ b/code/modules/cm_aliens/structures/special/pred_nest.dm @@ -15,7 +15,7 @@ /obj/effect/alien/resin/special/nest/get_examine_text(mob/user) . = ..() - if((isxeno(user) || isobserver(user)) && linked_hive) + if((isxeno(user) || isobserver(user)) && faction) . += "Used to secure formidable hosts." /obj/effect/alien/resin/special/nest/Initialize(mapload, datum/hive_status/hive_ref) diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index a31ee6c43bb7..6e5b38a3dedb 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -57,10 +57,11 @@ /obj/effect/alien/resin/special/pylon/process(delta_time) if(lesser_drone_spawns < lesser_drone_spawn_limit) // One every 10 seconds while on ovi, one every 120-ish seconds while off ovi - lesser_drone_spawns = min(lesser_drone_spawns + ((linked_hive.living_xeno_queen?.ovipositor ? 0.1 : 0.008) * delta_time), lesser_drone_spawn_limit) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + lesser_drone_spawns = min(lesser_drone_spawns + ((faction_module.living_xeno_queen?.ovipositor ? 0.1 : 0.008) * delta_time), lesser_drone_spawn_limit) /obj/effect/alien/resin/special/pylon/attack_alien(mob/living/carbon/xenomorph/M) - if(isxeno_builder(M) && M.a_intent == INTENT_HELP && M.hivenumber == linked_hive.hivenumber) + if(isxeno_builder(M) && M.a_intent == INTENT_HELP && M.faction == faction) do_repair(M) //This handles the delay itself. return XENO_NO_DELAY_ACTION else @@ -73,11 +74,12 @@ return var/lesser_count = 0 - for(var/mob/living/carbon/xenomorph/lesser_drone/lesser in linked_hive.totalXenos) + for(var/mob/living/carbon/xenomorph/lesser_drone/lesser in faction.total_mobs) lesser_count++ . += "Currently holding [SPAN_NOTICE("[floor(lesser_drone_spawns)]")]/[SPAN_NOTICE("[lesser_drone_spawn_limit]")] lesser drones." - . += "There are currently [SPAN_NOTICE("[lesser_count]")] lesser drones in the hive. The hive can support a total of [SPAN_NOTICE("[linked_hive.lesser_drone_limit]")] lesser drones at present." + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + . += "There are currently [SPAN_NOTICE("[lesser_count]")] lesser drones in the hive. The hive can support a total of [SPAN_NOTICE("[faction_module.lesser_drone_limit]")] lesser drones at present." /obj/effect/alien/resin/special/pylon/attack_ghost(mob/dead/observer/user) . = ..() @@ -124,21 +126,22 @@ playsound(loc, "alien_resin_build", 25) /obj/effect/alien/resin/special/pylon/proc/place_node() - var/obj/effect/alien/weeds/node/pylon/pylon_node = new node_type(loc, null, null, linked_hive) + var/obj/effect/alien/weeds/node/pylon/pylon_node = new node_type(loc, null, null, faction) pylon_node.resin_parent = src return pylon_node /obj/effect/alien/resin/special/pylon/proc/spawn_lesser_drone(mob/xeno_candidate) - if(!linked_hive.can_spawn_as_lesser_drone(xeno_candidate, src)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.can_spawn_as_lesser_drone(xeno_candidate, src)) return FALSE if(tgui_alert(xeno_candidate, "Are you sure you want to become a lesser drone?", "Confirmation", list("Yes", "No")) != "Yes") return FALSE - if(!linked_hive.can_spawn_as_lesser_drone(xeno_candidate, src)) + if(!faction_module.can_spawn_as_lesser_drone(xeno_candidate, src)) return FALSE - var/mob/living/carbon/xenomorph/lesser_drone/new_drone = new(loc, null, linked_hive.hivenumber) + var/mob/living/carbon/xenomorph/lesser_drone/new_drone = new(loc, null, faction) xeno_candidate.mind.transfer_to(new_drone, TRUE) lesser_drone_spawns -= 1 new_drone.visible_message(SPAN_XENODANGER("A lesser drone emerges out of [src]!"), SPAN_XENODANGER("You emerge out of [src] and awaken from your slumber. For the Hive!")) @@ -154,10 +157,12 @@ /obj/effect/alien/resin/special/pylon/endgame/Initialize(mapload, mob/builder) . = ..() - LAZYADD(linked_hive.active_endgame_pylons, src) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.active_endgame_pylons += src /obj/effect/alien/resin/special/pylon/endgame/Destroy() - LAZYREMOVE(linked_hive.active_endgame_pylons, src) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.active_endgame_pylons -= src if(activated) activated = FALSE @@ -166,34 +171,36 @@ faction_announcement("ALERT.\n\nEnergy build up around communication relay at [get_area_name(src)] halted.", "[MAIN_AI_SYSTEM] Biological Scanner") - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/checked_hive = GLOB.hive_datum[hivenumber] - if(!length(checked_hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(checked_hive == linked_hive) - xeno_announcement(SPAN_XENOANNOUNCE("We have lost our control of the tall's communication relay at [get_area_name(src)]."), hivenumber, XENO_GENERAL_ANNOUNCE) + if(check_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("We have lost our control of the tall's communication relay at [get_area_name(src)]."), faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive has lost control of the tall's communication relay at [get_area_name(src)]."), hivenumber, XENO_GENERAL_ANNOUNCE) - linked_hive.hive_ui.update_pylon_status() + xeno_announcement(SPAN_XENOANNOUNCE("Another hive has lost control of the tall's communication relay at [get_area_name(src)]."), faction, XENO_GENERAL_ANNOUNCE) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.update_pylon_status() return ..() /// Checks if all comms towers are connected and then starts end game content on all pylons if they are /obj/effect/alien/resin/special/pylon/endgame/proc/comms_relay_connection() faction_announcement("ALERT.\n\nIrregular build up of energy around communication relays at [get_area_name(src)], biological hazard detected.\n\nDANGER: Hazard is strengthening xenomorphs, advise urgent termination of hazard by ground forces.", "[MAIN_AI_SYSTEM] Biological Scanner") - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/checked_hive = GLOB.hive_datum[hivenumber] - if(!length(checked_hive.totalXenos)) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(checked_hive == linked_hive) - xeno_announcement(SPAN_XENOANNOUNCE("We have harnessed the tall's communication relay at [get_area_name(src)].\n\nWe will now grow royal resin from this pylon. Hold it!"), hivenumber, XENO_GENERAL_ANNOUNCE) + if(checked_hive == faction) + xeno_announcement(SPAN_XENOANNOUNCE("We have harnessed the tall's communication relay at [get_area_name(src)].\n\nWe will now grow royal resin from this pylon. Hold it!"), faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive has harnessed the tall's communication relay at [get_area_name(src)].[linked_hive.faction_is_ally(checked_hive.name) ? "" : " Stop them!"]"), hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive has harnessed the tall's communication relay at [get_area_name(src)].[faction.faction_is_ally(checked_hive) ? "" : " Stop them!"]"), faction, XENO_GENERAL_ANNOUNCE) activated = TRUE - linked_hive.check_if_hit_larva_from_pylon_limit() + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.check_if_hit_larva_from_pylon_limit() addtimer(CALLBACK(src, PROC_REF(give_royal_resin)), XENO_PYLON_ACTIVATION_COOLDOWN, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_LOOP|TIMER_DELETE_ME) /// Looped proc via timer to give larva after time @@ -201,13 +208,14 @@ if(!activated) return - if(!linked_hive.hive_location || !linked_hive.living_xeno_queen) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.hive_location || !faction_module.living_xeno_queen) return - if(linked_hive.buff_points < linked_hive.max_buff_points) - linked_hive.buff_points += 1 + if(faction_module.buff_points < faction_module.max_buff_points) + faction_module.buff_points += 1 - linked_hive.check_if_hit_larva_from_pylon_limit() + faction_module.check_if_hit_larva_from_pylon_limit() //Hive Core - Generates strong weeds, supports other buildings /obj/effect/alien/resin/special/pylon/core @@ -237,33 +245,34 @@ lesser_drone_spawn_limit = 10 -/obj/effect/alien/resin/special/pylon/core/Initialize(mapload, datum/hive_status/hive_ref) +/obj/effect/alien/resin/special/pylon/core/Initialize(mapload, datum/faction/faction_to_set) . = ..() // Pick the closest xeno resource activator update_minimap_icon() - if(hive_ref) - hive_ref.set_hive_location(src, linked_hive.hivenumber) + if(faction_to_set) + faction_to_set.set_hive_location(src, faction) /obj/effect/alien/resin/special/pylon/core/proc/update_minimap_icon() SSminimaps.remove_marker(src) - SSminimaps.add_marker(src, z, get_minimap_flag_for_faction(linked_hive?.hivenumber), "core") + SSminimaps.add_marker(src, z, faction.minimap_flag, "core") /obj/effect/alien/resin/special/pylon/core/process() . = ..() update_minimap_icon() // Handle spawning larva if core is connected to a hive - if(linked_hive) + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) for(var/mob/living/carbon/xenomorph/larva/worm in range(2, src)) - if((!worm.ckey || worm.stat == DEAD) && worm.burrowable && (worm.hivenumber == linked_hive.hivenumber) && !QDELETED(worm)) + if((!worm.ckey || worm.stat == DEAD) && worm.burrowable && (worm.faction == faction) && !QDELETED(worm)) visible_message(SPAN_XENODANGER("[worm] quickly burrows into \the [src].")) if(!worm.banished) // Goob job bringing her back home, but no doubling please - linked_hive.stored_larva++ - linked_hive.hive_ui.update_burrowed_larva() + faction_module.stored_larva++ + faction_module.hive_ui.update_burrowed_larva() qdel(worm) var/count_spawned = 0 @@ -272,7 +281,7 @@ last_larva_time = world.time if(spawning_larva || (last_larva_queue_time + spawn_cooldown * 4) < world.time) last_larva_queue_time = world.time - var/list/players_with_xeno_pref = get_alien_candidates(linked_hive) + var/list/players_with_xeno_pref = get_alien_candidates(faction) if(spawning_larva) var/i = 0 while(i < length(players_with_xeno_pref) && can_spawn_larva()) @@ -282,17 +291,17 @@ // Update everyone's queue status message_alien_candidates(players_with_xeno_pref, dequeued = count_spawned) - if(linked_hive.hijack_burrowed_surge && (last_surge_time + surge_cooldown) < world.time) + if(faction_module.hijack_burrowed_surge && (last_surge_time + surge_cooldown) < world.time) last_surge_time = world.time - linked_hive.stored_larva++ - linked_hive.hijack_burrowed_left-- + faction_module.stored_larva++ + faction_module.hijack_burrowed_left-- if(GLOB.xeno_queue_candidate_count < 1 + count_spawned) notify_ghosts(header = "Claim Xeno", message = "The Hive has gained another burrowed larva! Click to take it.", source = src, action = NOTIFY_JOIN_XENO, enter_link = "join_xeno=1") if(surge_cooldown > 30 SECONDS) //mostly for sanity purposes surge_cooldown = surge_cooldown - surge_incremental_reduction //ramps up over time - if(linked_hive.hijack_burrowed_left < 1) - linked_hive.hijack_burrowed_surge = FALSE - xeno_message(SPAN_XENOANNOUNCE("The hive's power wanes. We will no longer gain pooled larva over time."), 3, linked_hive.hivenumber) + if(faction_module.hijack_burrowed_left < 1) + faction_module.hijack_burrowed_surge = FALSE + xeno_message(SPAN_XENOANNOUNCE("The hive's power wanes. We will no longer gain pooled larva over time."), 3, faction) // Hive core can repair itself over time if(health < maxhealth && last_healed <= world.time) @@ -300,14 +309,16 @@ last_healed = world.time + heal_interval /obj/effect/alien/resin/special/pylon/core/proc/can_spawn_larva() - if(linked_hive.hardcore) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.hardcore) return FALSE - return linked_hive.stored_larva + return faction_module.stored_larva /obj/effect/alien/resin/special/pylon/core/proc/spawn_burrowed_larva(mob/xeno_candidate) if(can_spawn_larva() && xeno_candidate) - var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(loc, linked_hive.hivenumber) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(loc, faction) if(isnull(new_xeno)) return FALSE @@ -324,8 +335,8 @@ if(new_xeno.client.prefs.toggles_flashing & FLASH_POOLSPAWN) window_flash(new_xeno.client) - linked_hive.stored_larva-- - linked_hive.hive_ui.update_burrowed_larva() + faction_module.stored_larva-- + faction_module.hive_ui.update_burrowed_larva() return TRUE return FALSE @@ -343,7 +354,7 @@ if(carbon_mob.buckled) to_chat(user, SPAN_XENOWARNING("Unbuckle first!")) return - if(!linked_hive || carbon_mob.stat != DEAD) + if(!faction || carbon_mob.stat != DEAD) return if(SSticker.mode && !(SSticker.mode.flags_round_type & MODE_XVX)) @@ -354,7 +365,7 @@ // Makes attacking hives very profitable if they can successfully wipe them out without suffering any significant losses var/mob/living/carbon/xenomorph/xeno = carbon_mob - if(xeno.hivenumber != linked_hive.hivenumber) + if(xeno.faction != faction) if(isqueen(xeno)) larva_amount = 5 else @@ -369,11 +380,12 @@ playsound(src, "alien_resin_build", 25, 1) qdel(xeno) - linked_hive.stored_larva += larva_amount - linked_hive.hive_ui.update_burrowed_larva() + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.stored_larva += larva_amount + faction_module.hive_ui.update_burrowed_larva() /obj/effect/alien/resin/special/pylon/core/attack_alien(mob/living/carbon/xenomorph/M) - if(M.a_intent != INTENT_HELP && M.can_destroy_special() && M.hivenumber == linked_hive.hivenumber) + if(M.a_intent != INTENT_HELP && M.can_destroy_special() && M.faction == faction) if(!hardcore && last_attempt + 6 SECONDS > world.time) to_chat(M,SPAN_WARNING("We have attempted to destroy \the [src] too recently! Wait a bit!")) // no spammy return XENO_NO_DELAY_ACTION @@ -392,44 +404,45 @@ INVOKE_ASYNC(src, PROC_REF(startDestroying),M) return XENO_NO_DELAY_ACTION - if(linked_hive) + if(faction) var/current_health = health - if(hardcore && HIVE_ALLIED_TO_HIVE(M.hivenumber, linked_hive.hivenumber)) + if(hardcore && M.ally_faction(faction)) return XENO_NO_DELAY_ACTION . = ..() if(hardcore && last_attacked_message < world.time && current_health > health) - xeno_message(SPAN_XENOANNOUNCE("The hive core is under attack!"), 2, linked_hive.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The hive core is under attack!"), 2, faction) last_attacked_message = world.time + next_attacked_message else . = ..() /obj/effect/alien/resin/special/pylon/core/Destroy() - if(linked_hive) + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) visible_message(SPAN_XENOHIGHDANGER("The resin roof withers away as \the [src] dies!"), max_distance = WEED_RANGE_CORE) - linked_hive.hive_location = null + faction_module.hive_location = null if(world.time < XENOMORPH_PRE_SETUP_CUTOFF && !hardcore) . = ..() return - linked_hive.hivecore_cooldown = TRUE - INVOKE_ASYNC(src, PROC_REF(cooldownFinish),linked_hive) // start cooldown + faction_module.hivecore_cooldown = TRUE + INVOKE_ASYNC(src, PROC_REF(cooldownFinish), faction) // start cooldown if(hardcore) - xeno_message(SPAN_XENOANNOUNCE("We can no longer gain new sisters or another Queen. Additionally, we are unable to heal if our Queen is dead"), 2, linked_hive.hivenumber) - linked_hive.hardcore = TRUE - linked_hive.allow_queen_evolve = FALSE - linked_hive.hive_structures_limit[XENO_STRUCTURE_CORE] = 0 - xeno_announcement("\The [linked_hive.name] has lost their hive core!", "everything", HIGHER_FORCE_ANNOUNCE) + xeno_message(SPAN_XENOANNOUNCE("We can no longer gain new sisters or another Queen. Additionally, we are unable to heal if our Queen is dead"), 2, faction) + faction_module.hardcore = TRUE + faction_module.allow_queen_evolve = FALSE + faction_module.hive_structures_limit[XENO_STRUCTURE_CORE] = 0 + xeno_announcement("\The [faction] has lost their hive core!", "everything", HIGHER_FORCE_ANNOUNCE) - if(linked_hive.hijack_burrowed_surge) + if(faction_module.hijack_burrowed_surge) visible_message(SPAN_XENODANGER("We hear something resembling a scream from [src] as it's destroyed!")) - xeno_message(SPAN_XENOANNOUNCE("Psychic pain storms throughout the hive as [src] is destroyed! We will no longer gain burrowed larva over time."), 3, linked_hive.hivenumber) - linked_hive.hijack_burrowed_surge = FALSE + xeno_message(SPAN_XENOANNOUNCE("Psychic pain storms throughout the hive as [src] is destroyed! We will no longer gain burrowed larva over time."), 3, faction) + faction_module.hijack_burrowed_surge = FALSE SSminimaps.remove_marker(src) . = ..() /obj/effect/alien/resin/special/pylon/core/proc/startDestroying(mob/living/carbon/xenomorph/M) - xeno_message(SPAN_XENOANNOUNCE("[M] is destroying \the [src]!"), 3, linked_hive.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("[M] is destroying \the [src]!"), 3, faction) visible_message(SPAN_DANGER("[M] starts destroying \the [src]!")) last_attempt = world.time //spamcheck if(!do_after(M, 5 SECONDS , INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) @@ -439,11 +452,11 @@ return XENO_NO_DELAY_ACTION qdel(src) -/obj/effect/alien/resin/special/pylon/core/proc/cooldownFinish(datum/hive_status/linked_hive) +/obj/effect/alien/resin/special/pylon/core/proc/cooldownFinish(datum/faction/faction) sleep(HIVECORE_COOLDOWN) - if(linked_hive.hivecore_cooldown) // check if its true so we don't double set it. - linked_hive.hivecore_cooldown = FALSE - xeno_message(SPAN_XENOANNOUNCE("The weeds have recovered! A new hive core can be built!"), 3, linked_hive.hivenumber) + if(faction.hivecore_cooldown) // check if its true so we don't double set it. + faction.hivecore_cooldown = FALSE + xeno_message(SPAN_XENOANNOUNCE("The weeds have recovered! A new hive core can be built!"), 3, faction) else log_admin("Hivecore cooldown reset proc aborted due to hivecore cooldown var being set to false before the cooldown has finished!") // Tell admins that this condition is reached so they know what has happened if it fails somehow diff --git a/code/modules/cm_aliens/structures/special/recovery_node.dm b/code/modules/cm_aliens/structures/special/recovery_node.dm index a2af2c41acc1..de086cb38b45 100644 --- a/code/modules/cm_aliens/structures/special/recovery_node.dm +++ b/code/modules/cm_aliens/structures/special/recovery_node.dm @@ -11,7 +11,7 @@ /obj/effect/alien/resin/special/recovery/get_examine_text(mob/user) . = ..() - if((isxeno(user) || isobserver(user)) && linked_hive) + if((isxeno(user) || isobserver(user)) && faction) . += "Recovers the health of adjacent Xenomorphs." /obj/effect/alien/resin/special/recovery/process() @@ -19,7 +19,7 @@ return var/list/heal_candidates = list() for(var/mob/living/carbon/xenomorph/X in orange(src, 1)) - if(X.health >= X.maxHealth || !X.resting || X.hivenumber != linked_hive.hivenumber) + if(X.health >= X.maxHealth || !X.resting || X.faction != faction) continue heal_candidates += X last_healed = world.time diff --git a/code/modules/cm_aliens/structures/special_structure.dm b/code/modules/cm_aliens/structures/special_structure.dm index 8e2761837882..b192fafb6794 100644 --- a/code/modules/cm_aliens/structures/special_structure.dm +++ b/code/modules/cm_aliens/structures/special_structure.dm @@ -15,42 +15,34 @@ anchored = TRUE block_range = 1 - var/datum/hive_status/linked_hive - plane = FLOOR_PLANE /// Tells the structure if they are being deleted because of hijack var/hijack_delete = FALSE -/obj/effect/alien/resin/special/Initialize(mapload, hive_ref) +/obj/effect/alien/resin/special/Initialize(mapload, mob/builder) . = ..() maxhealth = health - if(hive_ref) - linked_hive = hive_ref - else - linked_hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] - - set_hive_data(src, linked_hive.hivenumber) - - if(!linked_hive.add_special_structure(src)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.add_special_structure(src)) return INITIALIZE_HINT_QDEL START_PROCESSING(SSfastobj, src) update_icon() /obj/effect/alien/resin/special/Destroy() - if(linked_hive) - linked_hive.remove_special_structure(src) - if(linked_hive.living_xeno_queen) - xeno_message("Hive: \A [name] has been destroyed at [sanitize_area(get_area_name(src))]!", 3, linked_hive.hivenumber) - linked_hive = null + if(faction) + faction.remove_special_structure(src) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen) + xeno_message("Hive: \A [name] has been destroyed at [sanitize_area(get_area_name(src))]!", 3, faction) STOP_PROCESSING(SSfastobj, src) . = ..() /obj/effect/alien/resin/special/attack_alien(mob/living/carbon/xenomorph/M) - if(M.can_destroy_special() || M.hivenumber != linked_hive.hivenumber) + if(M.can_destroy_special() || M.faction != faction) return ..() /obj/effect/alien/resin/special/get_projectile_hit_boolean(obj/projectile/firing_projectile) diff --git a/code/modules/cm_aliens/structures/trap.dm b/code/modules/cm_aliens/structures/trap.dm index 6ac0b19f281d..0001097b296a 100644 --- a/code/modules/cm_aliens/structures/trap.dm +++ b/code/modules/cm_aliens/structures/trap.dm @@ -12,7 +12,6 @@ health = 5 layer = RESIN_STRUCTURE_LAYER var/list/tripwires = list() - var/hivenumber = FACTION_XENOMORPH_NORMAL //Hivenumber of the xeno that planted it OR the last Facehugger that was placed (essentially taking over the trap) var/trap_type = RESIN_TRAP_EMPTY var/armed = 0 var/created_by // ckey @@ -25,12 +24,9 @@ . = ..() if(X) created_by = X.ckey - hivenumber = X.hivenumber + faction_to_get = X.faction.code_identificator cause_data = create_cause_data("resin trap", X) - set_hive_data(src, hivenumber) - if(hivenumber == FACTION_XENOMORPH_NORMAL) - RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) var/obj/effect/alien/weeds/node/weed = locate() in loc if(weed) @@ -52,14 +48,6 @@ if(RESIN_TRAP_ACID1, RESIN_TRAP_ACID2, RESIN_TRAP_ACID3) . += "It's filled with pressurised acid." -/obj/effect/alien/resin/trap/proc/forsaken_handling() - SIGNAL_HANDLER - if(is_ground_level(z)) - hivenumber = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) - - UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) - /obj/effect/alien/resin/trap/proc/facehugger_die() var/obj/item/clothing/mask/facehugger/FH = new (loc) FH.die() @@ -84,7 +72,7 @@ /obj/effect/alien/resin/trap/bullet_act(obj/projectile/P) var/mob/living/carbon/xenomorph/X = P.firer - if(istype(X) && HIVE_ALLIED_TO_HIVE(X.hivenumber, hivenumber)) + if(istype(X) && X.ally_faction(GLOB.faction_datums[faction_to_get])) return . = ..() @@ -92,7 +80,7 @@ /obj/effect/alien/resin/trap/HasProximity(atom/movable/AM) switch(trap_type) if(RESIN_TRAP_HUGGER) - if(can_hug(AM, hivenumber) && !isyautja(AM) && !issynth(AM)) + if(can_hug(AM, faction_to_get) && !isyautja(AM) && !issynth(AM)) var/mob/living/L = AM L.visible_message(SPAN_WARNING("[L] trips on [src]!"),\ SPAN_DANGER("You trip on [src]!")) @@ -105,12 +93,12 @@ return if(H.stat == DEAD || H.body_position == LYING_DOWN) return - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(GLOB.faction_datums[faction_to_get])) return trigger_trap() if(isxeno(AM)) var/mob/living/carbon/xenomorph/X = AM - if(X.hivenumber != hivenumber) + if(X.faction.code_identificator != faction_to_get) trigger_trap() if(isVehicleMultitile(AM) && trap_type != RESIN_TRAP_GAS) trigger_trap() @@ -141,7 +129,7 @@ facehugger_die() clear_tripwires() for(var/mob/living/carbon/xenomorph/X in GLOB.living_xeno_list) - if(X.hivenumber == hivenumber) + if(X.faction.code_identificator == faction_to_get) to_chat(X, SPAN_XENOMINORWARNING("We sense one of our Hive's facehugger traps at [A.name] has been burnt!")) /obj/effect/alien/resin/trap/proc/get_spray_type(level) @@ -165,8 +153,8 @@ if(RESIN_TRAP_HUGGER) trap_type_name = "hugger" var/obj/item/clothing/mask/facehugger/FH = new (loc) - FH.hivenumber = hivenumber - set_hive_data(FH, hivenumber) + FH.faction_to_get = faction_to_get + set_hive_data(FH, GLOB.faction_datums[faction_to_get]) set_state() visible_message(SPAN_WARNING("[FH] gets out of [src]!")) sleep(15) @@ -182,11 +170,11 @@ trap_type_name = "acid" var/spray_type = get_spray_type(trap_type) - new spray_type(loc, cause_data, hivenumber) + new spray_type(loc, cause_data, faction_to_get) for(var/turf/T in range(1,loc)) - var/obj/effect/xenomorph/spray/SP = new spray_type(T, cause_data, hivenumber) + var/obj/effect/xenomorph/spray/SP = new spray_type(T, cause_data, faction_to_get) for(var/mob/living/carbon/H in T) - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(GLOB.faction_datums[faction_to_get])) continue SP.apply_spray(H) set_state() @@ -194,7 +182,7 @@ if(!A) return for(var/mob/living/carbon/xenomorph/X in GLOB.living_xeno_list) - if(X.hivenumber == hivenumber) + if(X.faction.code_identificator == faction_to_get) if(destroyed) to_chat(X, SPAN_XENOMINORWARNING("We sense one of our Hive's [trap_type_name] traps at [A.name] has been destroyed!")) else @@ -205,7 +193,7 @@ tripwires = list() /obj/effect/alien/resin/trap/attack_alien(mob/living/carbon/xenomorph/X) - if(X.hivenumber != hivenumber) + if(X.faction.code_identificator != faction_to_get) return ..() var/trap_acid_level = 0 @@ -217,7 +205,7 @@ if(trap_type == RESIN_TRAP_HUGGER) if(X.caste.can_hold_facehuggers) set_state() - var/obj/item/clothing/mask/facehugger/F = new (loc, hivenumber) + var/obj/item/clothing/mask/facehugger/F = new (loc, GLOB.faction_datums[faction_to_get]) X.put_in_active_hand(F) to_chat(X, SPAN_XENONOTICE("You remove the facehugger from [src].")) return XENO_NONCOMBAT_ACTION @@ -325,11 +313,11 @@ if (!istype(X)) return - if (X.hivenumber != hivenumber) + if (X.faction.code_identificator != faction_to_get) to_chat(user, SPAN_XENOWARNING("This resin trap doesn't belong to your hive!")) return - if (FH.hivenumber != hivenumber) + if (FH.faction_to_get != faction_to_get) to_chat(user, SPAN_XENOWARNING("This facehugger is tainted.")) return diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 30d27ba46d08..227de0f594ac 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -20,8 +20,8 @@ var/tunnel_desc = "" //description added by the hivelord. - var/hivenumber = FACTION_XENOMORPH_NORMAL - var/datum/hive_status/hive + var/faction_to_get = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction health = 140 var/id = null //For mapping @@ -51,16 +51,18 @@ if(hivenumber == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) - SSminimaps.add_marker(src, z, get_minimap_flag_for_faction(hivenumber), "xenotunnel") + SSminimaps.add_marker(src, z, faction.minimap_flag, "xenotunnel") /obj/structure/tunnel/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hive.tunnels -= src - hivenumber = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) - hive = GLOB.hive_datum[FACTION_XENOMORPH_FORSAKEN] - hive.tunnels += src + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.tunnels -= src + faction_to_get = FACTION_XENOMORPH_FORSAKEN + faction = GLOB.faction_datums[faction_to_get] + faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.tunnels += src + set_hive_data(src, faction) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) diff --git a/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm b/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm index b1b399d796fa..428626717908 100644 --- a/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm +++ b/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm @@ -65,7 +65,7 @@ /obj/effect/alien/resin/boilertrap/Crossed(atom/A) if (isxeno(A)) var/mob/living/carbon/xenomorph/X = A - if (X.hivenumber != hivenumber) + if (X.faction != faction) trigger_trap(A) else if(ishuman(A)) trigger_trap(A) diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index 658623c753cc..d053727e6aec 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -25,15 +25,20 @@ var/spread_on_semiweedable = FALSE var/block_structures = BLOCK_NOTHING - var/faction_to_get = FACTION_XENOMORPH_NORMAL - var/datum/faction/faction - var/turf/weeded_turf // Which node is responsible for keeping this weed patch alive? var/obj/effect/alien/weeds/node/parent = null -/obj/effect/alien/weeds/Initialize(mapload, obj/effect/alien/weeds/node/node, use_node_strength=TRUE, do_spread=TRUE) +/obj/effect/alien/weeds/Initialize(mapload, obj/effect/alien/weeds/node/node, datum/faction/_faction, use_node_strength=TRUE, do_spread=TRUE) + if(_faction) + faction = _faction + else if(node) + faction = node.faction + + if(faction) + faction_to_get = faction.code_identificator + . = ..() if(node) @@ -82,8 +87,6 @@ COMSIG_ATOM_TURF_CHANGE, COMSIG_MOVABLE_TURF_ENTERED ), PROC_REF(set_turf_weeded)) - if(faction.code_identificator == FACTION_XENOMORPH_NORMAL) - RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) var/area/area = get_area(src) if(area && area.linked_lz) @@ -96,15 +99,6 @@ T.weeds = src -/obj/effect/alien/weeds/proc/forsaken_handling() - SIGNAL_HANDLER - if(is_ground_level(z)) - faction_to_get = FACTION_XENOMORPH_FORSAKEN - faction = GLOB.faction_datums[faction_to_get] - set_hive_data(src, faction) - - UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) - /obj/effect/alien/weeds/initialize_pass_flags(datum/pass_flags_container/PF) . = ..() if (PF) diff --git a/code/modules/desert_dam/motion_sensor/sensortower.dm b/code/modules/desert_dam/motion_sensor/sensortower.dm index 373dd2692963..e854d1ff58d2 100644 --- a/code/modules/desert_dam/motion_sensor/sensortower.dm +++ b/code/modules/desert_dam/motion_sensor/sensortower.dm @@ -72,7 +72,7 @@ continue SSminimaps.remove_marker(current_xeno) - current_xeno.add_minimap_marker(MINIMAP_FLAG_USCM|get_minimap_flag_for_faction(current_xeno.hivenumber)) + current_xeno.add_minimap_marker(MINIMAP_FLAG_USCM|current_xeno.faction.minimap_flag) minimap_added += WEAKREF(current_xeno) /obj/structure/machinery/sensortower/proc/checkfailure() diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index b8394259729c..56cac8cff420 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -246,7 +246,7 @@ else new_xeno = new(affected_mob) - faction.add_xeno(new_xeno) + faction.add_mob(new_xeno) if(!affected_mob.first_xeno && faction_module.hive_location) faction_module.increase_larva_after_burst() faction_module.hive_ui.update_burrowed_larva() diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index 22c6665dd38c..1300dc23159e 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -35,7 +35,7 @@ var/strength = 5 var/attached = FALSE var/leaping = FALSE //Is actually attacking someone? - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/flags_embryo = NO_FLAGS var/impregnated = FALSE @@ -55,21 +55,20 @@ var/icon_xeno = 'icons/mob/xenos/effects.dmi' var/icon_xenonid = 'icons/mob/xenonids/castes/tier_0/xenonid_crab.dmi' -/obj/item/clothing/mask/facehugger/Initialize(mapload, hive) +/obj/item/clothing/mask/facehugger/Initialize(mapload, datum/faction/faction_to_set) . = ..() var/new_icon = icon_xeno - if (hive) - hivenumber = hive + if(faction_to_set) + faction_to_get = faction_to_set.code_identificator - var/datum/hive_status/hive_s = GLOB.hive_datum[hivenumber] - if(HAS_TRAIT(hive_s, TRAIT_XENONID)) + if(HAS_TRAIT(faction_to_set, TRAIT_XENONID)) new_icon = icon_xenonid icon = new_icon - set_hive_data(src, hivenumber) + set_hive_data(src, GLOB.faction_datums[faction_to_get]) go_active() - if (hivenumber != XENO_HIVE_TUTORIAL) + if(faction_to_get != XENO_HIVE_TUTORIAL) death_timer = addtimer(CALLBACK(src, PROC_REF(end_lifecycle)), time_to_live, TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_UNIQUE) @@ -93,7 +92,7 @@ return addtimer(CALLBACK(src, PROC_REF(check_turf)), 0.2 SECONDS) - if(!death_timer && hivenumber != XENO_HIVE_TUTORIAL && stat != DEAD) + if(!death_timer && faction_to_get != XENO_HIVE_TUTORIAL && stat != DEAD) death_timer = addtimer(CALLBACK(src, PROC_REF(end_lifecycle)), time_to_live, TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_UNIQUE) if(stat == CONSCIOUS && loc) //Make sure we're conscious and not idle or dead. @@ -114,7 +113,7 @@ /obj/item/clothing/mask/facehugger/attack_hand(mob/user) if(stat != DEAD) - if(!sterile && can_hug(user, hivenumber)) + if(!sterile && can_hug(user, faction_to_get)) attach(user) //If we're alive, don't let them pick us up, even if attach fails. Just return. if(!isxeno(user)) @@ -123,7 +122,7 @@ //Deal with picking up facehuggers. "attack_alien" is the universal 'xenos click something while unarmed' proc. /obj/item/clothing/mask/facehugger/attack_alien(mob/living/carbon/xenomorph/user) - if(user.hivenumber != hivenumber) + if(user.faction.code_identificator != faction_to_get) user.animation_attack_on(src) user.visible_message(SPAN_XENOWARNING("[user] crushes \the [src]"), SPAN_XENOWARNING("You crush \the [src]")) die() @@ -138,7 +137,7 @@ return XENO_NO_DELAY_ACTION /obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user) - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled && !isyautja(M))) + if(!can_hug(M, faction_to_get) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled && !isyautja(M))) to_chat(user, SPAN_WARNING("The facehugger refuses to attach.")) ..() return @@ -151,7 +150,7 @@ if(!do_after(user, 2 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE, M, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled)) + if(!can_hug(M, faction_to_get) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled)) return attach(M) @@ -202,7 +201,7 @@ var/mob/living/carbon/xenomorph/xeno = holder - if ((xeno.caste.hugger_nurturing || hivenumber == XENO_HIVE_TUTORIAL) && death_timer) + if ((xeno.caste.hugger_nurturing || faction_to_get == XENO_HIVE_TUTORIAL) && death_timer) deltimer(death_timer) death_timer = null @@ -215,7 +214,7 @@ return has_proximity(finder) /obj/item/clothing/mask/facehugger/proc/has_proximity(atom/movable/AM) - if(stat == CONSCIOUS && can_hug(AM, hivenumber)) + if(stat == CONSCIOUS && can_hug(AM, faction_to_get)) attach(AM) return TRUE return FALSE @@ -245,7 +244,7 @@ throwing = FALSE rebounding = FALSE - if(leaping && can_hug(L, hivenumber)) + if(leaping && can_hug(L, faction_to_get)) attach(L) else if(L.density) step(src, turn(dir, 180)) //We want the hugger to bounce off if it hits a mob. @@ -258,13 +257,13 @@ return FALSE for(var/mob/living/M in loc) - if(can_hug(M, hivenumber)) + if(can_hug(M, faction_to_get)) attach(M) return TRUE var/mob/living/target for(var/mob/living/M in view(3, src)) - if(!can_hug(M, hivenumber)) + if(!can_hug(M, faction_to_get)) continue target = M break @@ -278,7 +277,7 @@ return TRUE /obj/item/clothing/mask/facehugger/proc/attach(mob/living/living_mob, silent = FALSE, knockout_mod = 1, mob/living/carbon/xenomorph/facehugger/hugger) - if(attached || !can_hug(living_mob, hivenumber)) + if(attached || !can_hug(living_mob, faction_to_get)) return FALSE // This is always going to be valid because of the can_hug check above @@ -314,7 +313,7 @@ var/area/hug_area = get_area(src) var/name = hugger ? "[hugger]" : "\a [src]" - if(hivenumber != XENO_HIVE_TUTORIAL) // prevent hugs from any tutorial huggers from showing up in dchat + if(faction_to_get != XENO_HIVE_TUTORIAL) // prevent hugs from any tutorial huggers from showing up in dchat if(hug_area) notify_ghosts(header = "Hugged", message = "[human] has been hugged by [name] at [hug_area]!", source = human, action = NOTIFY_ORBIT) to_chat(src, SPAN_DEADSAY("[human] has been facehugged by [name] at \the [hug_area]")) @@ -323,9 +322,9 @@ to_chat(src, SPAN_DEADSAY("[human] has been facehugged by [name]")) if(hug_area) - xeno_message(SPAN_XENOMINORWARNING("We sense that [name] has facehugged a host at \the [hug_area]!"), 1, hivenumber) + xeno_message(SPAN_XENOMINORWARNING("We sense that [name] has facehugged a host at \the [hug_area]!"), 1, GLOB.faction_datums[faction_to_get]) else - xeno_message(SPAN_XENOMINORWARNING("We sense that [name] has facehugged a host!"), 1, hivenumber) + xeno_message(SPAN_XENOMINORWARNING("We sense that [name] has facehugged a host!"), 1, GLOB.faction_datums[faction_to_get]) addtimer(CALLBACK(src, PROC_REF(impregnate), human, hugger?.client?.ckey), rand(MIN_IMPREGNATION_TIME, MAX_IMPREGNATION_TIME)) @@ -339,13 +338,13 @@ if(!sterile) var/embryos = 0 for(var/obj/item/alien_embryo/embryo in target) // already got one, stops doubling up - if(embryo.hivenumber == hivenumber) + if(embryo.faction_to_get == faction_to_get) embryos++ else qdel(embryo) if(!embryos) var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(target) - embryo.hivenumber = hivenumber + embryo.faction_to_get = faction_to_get embryo.hugger_ckey = hugger_ckey GLOB.player_embryo_list += embryo @@ -418,7 +417,7 @@ var/obj/effect/alien/resin/trap/T = locate() in loc if(T && T.trap_type == RESIN_TRAP_EMPTY) visible_message(SPAN_XENOWARNING("[src] crawls into [T]!")) - T.hivenumber = hivenumber + T.faction_to_get = faction_to_get T.set_state(RESIN_TRAP_HUGGER) qdel(src) return @@ -459,7 +458,7 @@ layer = TURF_LAYER //so dead hugger appears below live hugger if stacked on same tile. (and below nested hosts) - if(hivenumber == XENO_HIVE_TUTORIAL) + if(faction_to_get == XENO_HIVE_TUTORIAL) addtimer(CALLBACK(src, PROC_REF(decay)), 5 SECONDS) else addtimer(CALLBACK(src, PROC_REF(decay)), 3 MINUTES) @@ -468,16 +467,16 @@ visible_message("[icon2html(src, viewers(src))] \The [src] decays into a mass of acid and chitin.") qdel(src) -/proc/can_hug(mob/living/carbon/M, hivenumber) +/proc/can_hug(mob/living/carbon/M, faction_to_get) if(!istype(M) || isxeno(M) || issynth(M) || iszombie(M) || isHellhound(M) || M.stat == DEAD || !M.huggable) return FALSE - if(M.ally_of_hivenumber(hivenumber)) + if(M.ally_faction(GLOB.faction_datums[faction_to_get])) return FALSE if(M.status_flags & XENO_HOST) for(var/obj/item/alien_embryo/embryo in M) - if(embryo.hivenumber == hivenumber) + if(embryo.faction_to_get == faction_to_get) return FALSE //Already have a hugger? NOPE diff --git a/code/modules/mob/living/carbon/xenomorph/Powers.dm b/code/modules/mob/living/carbon/xenomorph/Powers.dm index 687853c211a8..7ac8170bec4b 100644 --- a/code/modules/mob/living/carbon/xenomorph/Powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Powers.dm @@ -49,7 +49,7 @@ to_chat(src, SPAN_XENOWARNING("The extra resin is preventing us from reinforcing [wall]. Wait until it elapse.")) return SECRETE_RESIN_FAIL - if (wall.hivenumber != hivenumber) + if (wall.faction != faction) to_chat(src, SPAN_XENOWARNING("[wall] doesn't belong to your hive!")) return SECRETE_RESIN_FAIL @@ -66,7 +66,7 @@ else if(istype(target, /obj/structure/mineral_door/resin)) var/obj/structure/mineral_door/resin/door = target - if (door.hivenumber != hivenumber) + if (door.faction != faction) to_chat(src, SPAN_XENOWARNING("[door] doesn't belong to your hive!")) return SECRETE_RESIN_FAIL @@ -144,7 +144,7 @@ SPAN_XENONOTICE("We regurgitate some resin and shape it into \a [resin_construct.construction_name][use_plasma ? " at the cost of a total [total_resin_cost] plasma" : ""]."), null, 5) playsound(loc, "alien_resin_build", 25) - var/atom/new_resin = resin_construct.build(current_turf, hivenumber, src) + var/atom/new_resin = resin_construct.build(current_turf, src) if(resin_construct.max_per_xeno != RESIN_CONSTRUCTION_NO_MAX) LAZYADD(built_structures[resin_construct.build_path], new_resin) RegisterSignal(new_resin, COMSIG_PARENT_QDELETING, PROC_REF(remove_built_structure)) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index ecf30049c28f..cc9485f6549e 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -2,7 +2,7 @@ //LAST EDIT: APOPHIS 22MAY16 //Send a message to all xenos. Mostly used in the deathgasp display -/proc/xeno_message(message = null, size = 3, datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) +/proc/xeno_message(message = null, size = 3, datum/faction/faction_to_display = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) if(!message) return @@ -18,18 +18,18 @@ if(SSticker.mode && length(SSticker.mode.xenomorphs)) //Send to only xenos in our gamemode list. This is faster than scanning all mobs for(var/datum/mind/L in SSticker.mode.xenomorphs) var/mob/living/carbon/M = L.current - if(M && istype(M) && !M.stat && M.client && (!faction || M.faction == faction)) //Only living and connected xenos + if(M && istype(M) && !M.stat && M.client && (!faction_to_display || M.faction_to_display == faction_to_display)) //Only living and connected xenos to_chat(M, SPAN_XENODANGER(" [message]")) //Sends a maptext alert to xenos. -/proc/xeno_maptext(text = "", title_text = "", datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) - if(text == "" || !faction) +/proc/xeno_maptext(text = "", title_text = "", datum/faction/faction_to_display = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) + if(text == "" || !faction_to_display) return //Logic if(SSticker.mode && length(SSticker.mode.xenomorphs)) //Send to only xenos in our gamemode list. This is faster than scanning all mobs for(var/datum/mind/living in SSticker.mode.xenomorphs) var/mob/living/carbon/xenomorph/xeno = living.current - if(istype(xeno) && !xeno.stat && xeno.client && xeno.faction == faction) //Only living and connected xenos + if(istype(xeno) && !xeno.stat && xeno.client && xeno.faction == faction_to_display) //Only living and connected xenos playsound_client(xeno.client, 'sound/voice/alien_distantroar_3.ogg', xeno.loc, 25, FALSE) xeno.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, "#b491c8") @@ -72,11 +72,13 @@ if(caste && caste.evolution_allowed) evolve_progress = "[min(stored_evolution, evolution_threshold)]/[evolution_threshold]" - if(hive && !hive.allow_no_queen_evo && !caste?.evolve_without_queen) - if(!hive.living_xeno_queen) - evolve_progress += " (NO QUEEN)" - else if(!(hive.living_xeno_queen.ovipositor || hive.evolution_without_ovipositor)) - evolve_progress += " (NO OVIPOSITOR)" + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.allow_no_queen_evo && !caste?.evolve_without_queen) + if(!faction_module.living_xeno_queen) + evolve_progress += " (NO QUEEN)" + else if(!(faction_module.living_xeno_queen.ovipositor || faction_module.evolution_without_ovipositor)) + evolve_progress += " (NO OVIPOSITOR)" if(evolve_progress) . += "Evolve Progress: [evolve_progress]" @@ -111,37 +113,38 @@ . += "Recovery: [msg_holder]" . += "" - if(hive) - if(!hive.living_xeno_queen) + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen) . += "Queen's Location: NO QUEEN" else if(!(caste_type == XENO_CASTE_QUEEN)) - . += "Queen's Location: [hive.living_xeno_queen.loc.loc.name]" + . += "Queen's Location: [faction_module.living_xeno_queen.loc.loc.name]" - if(hive.slashing_allowed == XENO_SLASH_ALLOWED) + if(faction_module.slashing_allowed == XENO_SLASH_ALLOWED) . += "Slashing: PERMITTED" else . += "Slashing: FORBIDDEN" - if(hive.construction_allowed == XENO_LEADER) + if(faction_module.construction_allowed == XENO_LEADER) . += "Construction Placement: LEADERS" - else if(hive.construction_allowed == NORMAL_XENO) + else if(faction_module.construction_allowed == NORMAL_XENO) . += "Construction Placement: ANYONE" - else if(hive.construction_allowed == XENO_NOBODY) + else if(faction_module.construction_allowed == XENO_NOBODY) . += "Construction Placement: NOBODY" else . += "Construction Placement: QUEEN" - if(hive.destruction_allowed == XENO_LEADER) + if(faction_module.destruction_allowed == XENO_LEADER) . += "Special Structure Destruction: LEADERS" - else if(hive.destruction_allowed == NORMAL_XENO) + else if(faction_module.destruction_allowed == NORMAL_XENO) . += "Special Structure Destruction: BUILDERS and LEADERS" - else if(hive.construction_allowed == XENO_NOBODY) + else if(faction_module.construction_allowed == XENO_NOBODY) . += "Construction Placement: NOBODY" else . += "Special Structure Destruction: QUEEN" - if(hive.faction_orders) - . += "Hive Orders: [hive.faction_orders]" + if(faction.faction_orders) + . += "Hive Orders: [faction.faction_orders]" else . += "Hive Orders: -" @@ -241,12 +244,11 @@ . += caste.agility_speed_increase var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in loc - if (W) - if (W.linked_hive.hivenumber == hivenumber) - . *= 0.95 + if(W && ally_faction(W.faction)) + . *= 0.95 var/obj/effect/alien/resin/sticky/fast/FR = locate(/obj/effect/alien/resin/sticky/fast) in loc - if (FR && FR.hivenumber == hivenumber) + if(FR && ally_faction(FR.faction)) . *= 0.8 if(superslowed) @@ -501,9 +503,10 @@ //When the Queen's pheromones are updated, or we add/remove a leader, update leader pheromones /mob/living/carbon/xenomorph/proc/handle_xeno_leader_pheromones() - if(!hive) + if(!faction) return - var/mob/living/carbon/xenomorph/queen/Q = hive.living_xeno_queen + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/mob/living/carbon/xenomorph/queen/Q = faction_module.living_xeno_queen if(!Q || !Q.ovipositor || hive_pos == NORMAL_XENO || !Q.current_aura || Q.loc.z != loc.z) //We are no longer a leader, or the Queen attached to us has dropped from her ovi, disabled her pheromones or even died leader_aura_strength = 0 leader_current_aura = "" diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index c2187e39c6cc..3c6be5c5d539 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -513,7 +513,7 @@ /// If flags is 0, it will use get_minimap_flag_for_faction for this xeno /mob/living/carbon/xenomorph/proc/add_minimap_marker(flags) if(!flags) - flags = get_minimap_flag_for_faction(hivenumber) + flags = faction.minimap_flag if(IS_XENO_LEADER(src)) SSminimaps.add_marker(src, z, hud_flags = flags, given_image = caste.get_minimap_icon(), overlay_iconstates = list(caste.minimap_leadered_overlay)) return diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index cc8260c349f9..d72d569bd3b2 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -552,10 +552,7 @@ return if(!T.check_xeno_trap_placement(X)) return - var/obj/effect/alien/weeds/the_replacer = new /obj/effect/alien/weeds(T) - the_replacer.faction = X.faction - the_replacer.linked_hive = X.hive - set_hive_data(the_replacer, X.hivenumber) + var/obj/effect/alien/weeds/the_replacer = new /obj/effect/alien/weeds(T, null, X.faction) qdel(alien_weeds) if(!X.check_plasma(plasma_cost)) @@ -583,7 +580,7 @@ to_chat(X, SPAN_XENOWARNING("We cannot make a hole beneath a staircase!")) return FALSE - if(alien_weeds.linked_hive.hivenumber != X.hivenumber) + if(alien_weeds.faction != X.faction) to_chat(X, SPAN_XENOWARNING("These weeds don't belong to our hive!")) return FALSE @@ -608,13 +605,14 @@ if(isstorage(A.loc) || X.contains(A) || istype(A, /atom/movable/screen)) return FALSE //Make sure construction is unrestricted - if(X.hive && X.hive.construction_allowed == XENO_LEADER && X.hive_pos == NORMAL_XENO) + var/datum/faction_module/hive_mind/faction_module = X.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.construction_allowed == XENO_LEADER && X.hive_pos == NORMAL_XENO) to_chat(X, SPAN_WARNING("Construction is currently restricted to Leaders only!")) return FALSE - else if(X.hive && X.hive.construction_allowed == XENO_QUEEN && !istype(X.caste, /datum/caste_datum/queen)) + else if(faction_module.construction_allowed == XENO_QUEEN && !istype(X.caste, /datum/caste_datum/queen)) to_chat(X, SPAN_WARNING("Construction is currently restricted to Queen only!")) return FALSE - else if(X.hive && X.hive.construction_allowed == XENO_NOBODY) + else if(faction_module.construction_allowed == XENO_NOBODY) to_chat(X, SPAN_WARNING("The hive is too weak and fragile to have the strength to design constructions.")) return FALSE @@ -640,23 +638,23 @@ return FALSE var/choice = XENO_STRUCTURE_CORE - if(X.hive.hivecore_cooldown) + if(faction_module.hivecore_cooldown) to_chat(X, SPAN_WARNING("The weeds are still recovering from the death of the hive core, wait until the weeds have recovered!")) return FALSE - if(X.hive.has_structure(XENO_STRUCTURE_CORE) || !X.hive.can_build_structure(XENO_STRUCTURE_CORE)) - choice = tgui_input_list(X, "Choose a structure to build", "Build structure", X.hive.hive_structure_types + "help", theme = "hive_status") + if(faction_module.has_structure(XENO_STRUCTURE_CORE) || !faction_module.can_build_structure(XENO_STRUCTURE_CORE)) + choice = tgui_input_list(X, "Choose a structure to build", "Build structure", faction_module.hive_structure_types + "help", theme = "hive_status") if(!choice) return if(choice == "help") var/message = "Placing a construction node creates a template for special structures that can benefit the hive, which require the insertion of plasma to construct the following:
" - for(var/structure_name in X.hive.hive_structure_types) - var/datum/construction_template/xenomorph/structure_type = X.hive.hive_structure_types[structure_name] + for(var/structure_name in faction_module.hive_structure_types) + var/datum/construction_template/xenomorph/structure_type = faction_module.hive_structure_types[structure_name] message += "[capitalize_first_letters(structure_name)] - [initial(structure_type.description)]
" to_chat(X, SPAN_NOTICE(message)) return TRUE if(!X.check_state(TRUE) || !X.check_plasma(400)) return FALSE - var/structure_type = X.hive.hive_structure_types[choice] + var/structure_type = faction_module.hive_structure_types[choice] var/datum/construction_template/xenomorph/structure_template = new structure_type() if(!spacecheck(X, T, structure_template)) @@ -680,16 +678,16 @@ qdel(structure_template) return FALSE - if((choice == XENO_STRUCTURE_CORE) && isqueen(X) && X.hive.has_structure(XENO_STRUCTURE_CORE)) - if(X.hive.hive_location.hardcore || world.time > XENOMORPH_PRE_SETUP_CUTOFF) + if((choice == XENO_STRUCTURE_CORE) && isqueen(X) && faction_module.has_structure(XENO_STRUCTURE_CORE)) + if(faction_module.hive_location.hardcore || world.time > XENOMORPH_PRE_SETUP_CUTOFF) to_chat(X, SPAN_WARNING("We can't rebuild this structure!")) qdel(structure_template) return FALSE if(alert(X, "Are we sure that we want to move the hive and destroy the old hive core?", , "Yes", "No") != "Yes") qdel(structure_template) return FALSE - qdel(X.hive.hive_location) - else if(!X.hive.can_build_structure(choice)) + qdel(faction_module.hive_location) + else if(!faction_module.can_build_structure(choice)) to_chat(X, SPAN_WARNING("We can't build any more [choice]s for the hive.")) qdel(structure_template) return FALSE @@ -699,7 +697,7 @@ qdel(structure_template) return FALSE - var/queen_on_zlevel = !X.hive.living_xeno_queen || X.hive.living_xeno_queen.z == T.z + var/queen_on_zlevel = !faction_module.living_xeno_queen || faction_module.living_xeno_queen.z == T.z if(!queen_on_zlevel) to_chat(X, SPAN_WARNING("Our link to the Queen is too weak here. She is on another world.")) qdel(structure_template) @@ -740,8 +738,8 @@ qdel(tem) return FALSE var/obj/effect/alien/weeds/alien_weeds = locate() in T - if(!alien_weeds || alien_weeds.weed_strength < WEED_LEVEL_HIVE || alien_weeds.linked_hive.hivenumber != X.hivenumber) - to_chat(X, SPAN_WARNING("We can only shape on [lowertext(GLOB.hive_datum[X.hivenumber].prefix)]hive weeds. We must find a hive node or core before we start building!")) + if(!alien_weeds || alien_weeds.weed_strength < WEED_LEVEL_HIVE || alien_weeds.faction != X.faction) + to_chat(X, SPAN_WARNING("We can only shape on [lowertext(X.faction.prefix)]hive weeds. We must find a hive node or core before we start building!")) qdel(tem) return FALSE if(T.density) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index 32c0e66dbf6b..628c98913426 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -12,7 +12,7 @@ if(!user_xeno.check_plasma(plasma_cost_devolve)) return - if(target_xeno.hivenumber != user_xeno.hivenumber) + if(target_xeno.faction != user_xeno.faction) to_chat(user_xeno, SPAN_XENOWARNING("[target_xeno] doesn't belong to your hive!")) return if(target_xeno.is_ventcrawling) @@ -69,8 +69,9 @@ message_admins("[key_name_admin(user_xeno)] has deevolved [key_name_admin(target_xeno)]. Reason: [reason]") log_admin("[key_name_admin(user_xeno)] has deevolved [key_name_admin(target_xeno)]. Reason: [reason]") - if(user_xeno.hive.living_xeno_queen && user_xeno.hive.living_xeno_queen.observed_xeno == target_xeno) - user_xeno.hive.living_xeno_queen.overwatch(new_xeno) + var/datum/faction_module/hive_mind/faction_module = user_xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen && faction_module.living_xeno_queen.observed_xeno == target_xeno) + faction_module.living_xeno_queen.overwatch(new_xeno) return @@ -120,7 +121,7 @@ to_chat(xeno, SPAN_XENOWARNING("It's too tight in here to grow an ovipositor.")) return - if(alien_weeds.linked_hive.hivenumber != xeno.hivenumber) + if(alien_weeds.faction != xeno.faction) to_chat(xeno, SPAN_XENOWARNING("These weeds don't belong to your hive! You can't grow an ovipositor here.")) return @@ -158,10 +159,10 @@ if(!action_cooldown_check()) return - var/datum/hive_status/hive = X.hive + var/datum/faction_module/hive_mind/faction_module = X.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(X.observed_xeno) - if(!length(hive.open_xeno_leader_positions) && X.observed_xeno.hive_pos == NORMAL_XENO) - to_chat(X, SPAN_XENOWARNING("You currently have [length(hive.xeno_leader_list)] promoted leaders. You may not maintain additional leaders until your power grows.")) + if(!length(faction_module.open_xeno_leader_positions) && X.observed_xeno.hive_pos == NORMAL_XENO) + to_chat(X, SPAN_XENOWARNING("You currently have [length(faction_module.xeno_leader_list)] promoted leaders. You may not maintain additional leaders until your power grows.")) return var/mob/living/carbon/xenomorph/T = X.observed_xeno if(T == X) @@ -169,18 +170,18 @@ return apply_cooldown() if(T.hive_pos == NORMAL_XENO) - if(!hive.add_hive_leader(T)) + if(!faction_module.add_hive_leader(T)) to_chat(X, SPAN_XENOWARNING("Unable to add the leader.")) return to_chat(X, SPAN_XENONOTICE("You've selected [T] as a Hive Leader.")) to_chat(T, SPAN_XENOANNOUNCE("[X] has selected you as a Hive Leader. The other Xenomorphs must listen to you. You will also act as a beacon for the Queen's pheromones.")) else - hive.remove_hive_leader(T) + faction_module.remove_hive_leader(T) to_chat(X, SPAN_XENONOTICE("You've demoted [T] from Hive Leader.")) to_chat(T, SPAN_XENOANNOUNCE("[X] has demoted you from Hive Leader. Your leadership rights and abilities have waned.")) else var/list/possible_xenos = list() - for(var/mob/living/carbon/xenomorph/T in hive.xeno_leader_list) + for(var/mob/living/carbon/xenomorph/T in faction_module.xeno_leader_list) possible_xenos += T if(length(possible_xenos) > 1) @@ -254,7 +255,7 @@ to_chat(usr, SPAN_XENOWARNING("You must give some time for larva to spawn before sacrificing them. Please wait another [floor((SSticker.mode.round_time_lobby + SHUTTLE_TIME_LOCK - world.time) / 600)] minutes.")) return - var/choice = tgui_input_list(user_xeno, "Choose a xenomorph to give evolution points for a burrowed larva:", "Give Evolution Points", user_xeno.hive.totalXenos, theme="hive_status") + var/choice = tgui_input_list(user_xeno, "Choose a xenomorph to give evolution points for a burrowed larva:", "Give Evolution Points", user_xeno.faction.total_mobs, theme="hive_status") if(!choice) return @@ -262,7 +263,7 @@ var/required_larva = 1 var/mob/living/carbon/xenomorph/target_xeno - for(var/mob/living/carbon/xenomorph/xeno in user_xeno.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in user_xeno.faction.total_mobs) if(html_encode(xeno.name) == html_encode(choice)) target_xeno = xeno break @@ -275,7 +276,7 @@ to_chat(user_xeno, SPAN_XENOWARNING("This xenomorph is already ready to evolve!")) return - if(target_xeno.hivenumber != user_xeno.hivenumber) + if(target_xeno.faction != user_xeno.faction) to_chat(user_xeno, SPAN_XENOWARNING("This xenomorph doesn't belong to your hive!")) return @@ -283,14 +284,15 @@ to_chat(user_xeno, SPAN_XENOWARNING("What's the point? They're about to die.")) return - if(user_xeno.hive.stored_larva < required_larva) + var/datum/faction_module/hive_mind/faction_module = user_xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.stored_larva < required_larva) to_chat(user_xeno, SPAN_XENOWARNING("You need at least [required_larva] burrowed larva to sacrifice one for evolution points.")) return if(tgui_alert(user_xeno, "Are you sure you want to sacrifice a larva to give [target_xeno] [evo_points_per_larva] evolution points?", "Give Evolution Points", list("Yes", "No")) != "Yes") return - if(!user_xeno.check_state() || !check_and_use_plasma_owner(plasma_cost) || target_xeno.health < 0 || user_xeno.hive.stored_larva < required_larva) + if(!user_xeno.check_state() || !check_and_use_plasma_owner(plasma_cost) || target_xeno.health < 0 || faction_module.stored_larva < required_larva) return to_chat(target_xeno, SPAN_XENOWARNING("\The [user_xeno] has given you evolution points! Use them well.")) @@ -301,7 +303,7 @@ else target_xeno.evolution_stored += evo_points_per_larva - user_xeno.hive.stored_larva-- + faction_module.stored_larva-- return @@ -348,10 +350,9 @@ var/mob/living/carbon/xenomorph/queen/queen_manager = owner plasma_cost = 0 var/list/options = list("Banish (500)", "Re-Admit (100)", "De-evolve (500)", "Reward Jelly (500)", "Exchange larva for evolution (100)", "Purchase Buffs") - if(queen_manager.hive.hivenumber == XENO_HIVE_CORRUPTED) - var/datum/hive_status/corrupted/hive = queen_manager.hive + if(queen_manager.faction.code_identificator == XENO_HIVE_CORRUPTED) options += "Add Personal Ally" - if(length(hive.personal_allies)) + if(length(queen_manager.faction.personal_allies)) options += "Remove Personal Ally" options += "Clear Personal Allies" @@ -364,7 +365,7 @@ if("De-evolve (500)") de_evolve_other() if("Reward Jelly (500)") - give_jelly_reward(queen_manager.hive) + give_jelly_reward(queen_manager.faction) if("Exchange larva for evolution (100)") give_evo_points() if("Add Personal Ally") @@ -384,7 +385,8 @@ var/list/names = list() var/list/radial_images = list() var/major_available = FALSE - for(var/datum/hivebuff/buff as anything in xeno.hive.get_available_hivebuffs()) + var/datum/faction_module/hive_mind/faction_module = xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/datum/hivebuff/buff as anything in faction_module.get_available_hivebuffs()) var/buffname = initial(buff.name) names += buffname buffs[buffname] = buff @@ -428,7 +430,7 @@ if(buffs[selection].must_select_pylon) var/list/pylon_to_area_dictionary = list() - for(var/obj/effect/alien/resin/special/pylon/endgame/pylon as anything in xeno.hive.active_endgame_pylons) + for(var/obj/effect/alien/resin/special/pylon/endgame/pylon as anything in faction_module.active_endgame_pylons) pylon_to_area_dictionary[get_area_name(pylon.loc)] = pylon var/choice = tgui_input_list(xeno, "Select a pylon for the buff:", "Choice", pylon_to_area_dictionary, 1 MINUTES) @@ -437,10 +439,10 @@ to_chat(xeno, "You must choose a pylon.") return FALSE - xeno.hive.attempt_apply_hivebuff(buffs[selection], xeno, pylon_to_area_dictionary[choice]) + faction_module.attempt_apply_hivebuff(buffs[selection], xeno, pylon_to_area_dictionary[choice]) return TRUE - xeno.hive.attempt_apply_hivebuff(buffs[selection], xeno, pick(xeno.hive.active_endgame_pylons)) + faction_module.attempt_apply_hivebuff(buffs[selection], xeno, pick(faction_module.active_endgame_pylons)) return TRUE /datum/action/xeno_action/onclick/manage_hive/proc/add_personal_ally() @@ -556,14 +558,14 @@ if(!user_xeno.check_plasma(plasma_cost_banish)) return - var/choice = tgui_input_list(user_xeno, "Choose a xenomorph to banish:", "Banish", user_xeno.hive.totalXenos, theme="hive_status") + var/choice = tgui_input_list(user_xeno, "Choose a xenomorph to banish:", "Banish", user_xeno.faction.total_mobs, theme="hive_status") if(!choice) return var/mob/living/carbon/xenomorph/target_xeno - for(var/mob/living/carbon/xenomorph/xeno in user_xeno.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in user_xeno.faction.total_mobs) if(html_encode(xeno.name) == html_encode(choice)) target_xeno = xeno break @@ -576,7 +578,7 @@ to_chat(user_xeno, SPAN_XENOWARNING("This xenomorph is already banished!")) return - if(target_xeno.hivenumber != user_xeno.hivenumber) + if(target_xeno.faction != user_xeno.faction) to_chat(user_xeno, SPAN_XENOWARNING("This xenomorph doesn't belong to your hive!")) return @@ -598,13 +600,13 @@ return // Let everyone know they were banished - xeno_announcement("By [user_xeno]'s will, [target_xeno] has been banished from the hive!\n\n[reason]", user_xeno.hivenumber, title=SPAN_ANNOUNCEMENT_HEADER_BLUE("Banishment")) + xeno_announcement("By [user_xeno]'s will, [target_xeno] has been banished from the hive!\n\n[reason]", user_xeno.faction, title=SPAN_ANNOUNCEMENT_HEADER_BLUE("Banishment")) to_chat(target_xeno, FONT_SIZE_LARGE(SPAN_XENOWARNING("The [user_xeno] has banished you from the hive! Other xenomorphs may now attack you freely, but your link to the hivemind remains, preventing you from harming other sisters."))) target_xeno.banished = TRUE target_xeno.hud_update_banished() target_xeno.lock_evolve = TRUE - user_xeno.hive.banished_ckeys[target_xeno.name] = target_xeno.ckey + user_xeno.faction.banished_ckeys[target_xeno.name] = target_xeno.ckey addtimer(CALLBACK(src, PROC_REF(remove_banish), user_xeno.hive, target_xeno.name), 30 MINUTES) message_admins("[key_name_admin(user_xeno)] has banished [key_name_admin(target_xeno)]. Reason: [reason]") @@ -625,7 +627,7 @@ if(!user_xeno.check_plasma(plasma_cost_readmit)) return - var/choice = tgui_input_list(user_xeno, "Choose a xenomorph to readmit:", "Re-admit", user_xeno.hive.banished_ckeys, theme="hive_status") + var/choice = tgui_input_list(user_xeno, "Choose a xenomorph to readmit:", "Re-admit", user_xeno.faction.banished_ckeys, theme="hive_status") if(!choice) return @@ -633,16 +635,16 @@ var/banished_ckey var/banished_name - for(var/mob_name in user_xeno.hive.banished_ckeys) - if(user_xeno.hive.banished_ckeys[mob_name] == user_xeno.hive.banished_ckeys[choice]) - banished_ckey = user_xeno.hive.banished_ckeys[mob_name] + for(var/mob_name in user_xeno.faction.banished_ckeys) + if(user_xeno.faction.banished_ckeys[mob_name] == user_xeno.faction.banished_ckeys[choice]) + banished_ckey = user_xeno.faction.banished_ckeys[mob_name] banished_name = mob_name break var/banished_living = FALSE var/mob/living/carbon/xenomorph/target_xeno - for(var/mob/living/carbon/xenomorph/xeno in user_xeno.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in user_xeno.faction.total_mobs) if(xeno.ckey == banished_ckey) target_xeno = xeno banished_living = TRUE @@ -665,7 +667,7 @@ target_xeno.hud_update_banished() target_xeno.lock_evolve = FALSE - user_xeno.hive.banished_ckeys.Remove(banished_name) + user_xeno.faction.banished_ckeys.Remove(banished_name) return /datum/action/xeno_action/onclick/eye @@ -736,7 +738,7 @@ for(var/direction in GLOB.cardinals) var/turf/weed_turf = get_step(T, direction) var/obj/effect/alien/weeds/W = locate() in weed_turf - if(W && W.hivenumber == X.hivenumber && W.parent && !W.hibernate && !LinkBlocked(W, weed_turf, T)) + if(W && W.faction == X.faction && W.parent && !W.hibernate && !LinkBlocked(W, weed_turf, T)) node = W.parent break diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index a6847d010fd2..947c64f5931c 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -183,18 +183,18 @@ visible_message(SPAN_XENOWARNING("The chittering mass of tiny aliens is trying to escape [src]!")) for(var/i in 1 to huggers_cur) if(prob(chance)) - hugger = new(loc, hivenumber) + hugger = new(loc, faction) step_away(hugger, src, 1) var/eggs_dropped = FALSE for(var/i in 1 to eggs_cur) if(prob(chance)) - new /obj/item/xeno_egg(loc, hivenumber) + new /obj/item/xeno_egg(loc, faction.code_identificator) eggs_dropped = TRUE eggs_cur = 0 if(eggs_dropped) //Checks whether or not to announce egg drop. - xeno_message(SPAN_XENOANNOUNCE("[src] has dropped some precious eggs!"), 2, hive.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("[src] has dropped some precious eggs!"), 2, faction) /mob/living/carbon/xenomorph/carrier/recalculate_actions() . = ..() @@ -208,7 +208,7 @@ . += "Stored Eggs: [eggs_cur] / [eggs_max]" /mob/living/carbon/xenomorph/carrier/proc/store_hugger(obj/item/clothing/mask/facehugger/F) - if(F.hivenumber != hivenumber) + if(F.faction_to_get != faction.code_identificator) to_chat(src, SPAN_WARNING("This hugger is tainted!")) return @@ -224,7 +224,7 @@ to_chat(src, SPAN_WARNING("We can't carry more facehuggers on us.")) /mob/living/carbon/xenomorph/carrier/proc/store_huggers_from_egg_morpher(obj/effect/alien/resin/special/eggmorph/morpher) - if(morpher.linked_hive && (morpher.linked_hive.hivenumber != hivenumber)) + if(morpher.faction != faction) to_chat(src, SPAN_WARNING("That egg morpher is tainted!")) return @@ -256,7 +256,7 @@ if(istype(T, /obj/item/clothing/mask/facehugger)) var/obj/item/clothing/mask/facehugger/F = T if(isturf(F.loc) && Adjacent(F)) - if(F.hivenumber != hivenumber) + if(F.faction_to_get != faction.code_identificator) to_chat(src, SPAN_WARNING("That facehugger is tainted!")) drop_inv_item_on_ground(F) return @@ -270,7 +270,7 @@ if(istype(T, /obj/effect/alien/resin/special/eggmorph)) var/obj/effect/alien/resin/special/eggmorph/morpher = T if(Adjacent(morpher)) - if(morpher.linked_hive && (morpher.linked_hive.hivenumber != hivenumber)) + if(morpher.faction != faction) to_chat(src, SPAN_WARNING("That egg morpher is tainted!")) return if(on_fire) @@ -290,7 +290,7 @@ to_chat(src, SPAN_WARNING("Retrieving a stored facehugger while we're on fire would burn it!")) return - F = new(src, hivenumber) + F = new(src, faction.code_identificator) huggers_cur-- put_in_active_hand(F) to_chat(src, SPAN_XENONOTICE("We grab one of the facehugger in our storage. Now sheltering: [huggers_cur] / [huggers_max].")) @@ -317,7 +317,7 @@ A.update_button_icon() /mob/living/carbon/xenomorph/carrier/proc/store_egg(obj/item/xeno_egg/E) - if(E.hivenumber != hivenumber) + if(E.faction_to_get != faction.code_identificator) to_chat(src, SPAN_WARNING("That egg is tainted!")) return if(eggs_cur < eggs_max) @@ -360,7 +360,7 @@ if(eggs_cur <= 0) to_chat(src, SPAN_WARNING("We don't have any eggs to use!")) return - E = new(src, hivenumber) + E = new(src, faction.code_identificator) eggs_cur-- update_icons() put_in_active_hand(E) @@ -393,7 +393,7 @@ to_chat(src, SPAN_XENONOTICE("We slide one of the children out of an egg and place them into [morpher]. Now sheltering: [eggs_cur] / [eggs_max].")) /mob/living/carbon/xenomorph/carrier/proc/morpher_safety_checks(obj/effect/alien/resin/special/eggmorph/morpher) - if(morpher.linked_hive && (morpher.linked_hive.hivenumber != hivenumber)) + if(morpher.faction != faction) to_chat(src, SPAN_WARNING("That egg morpher is tainted!")) return FALSE @@ -423,13 +423,13 @@ if(huggers_cur <= huggers_reserved) to_chat(user, SPAN_WARNING("\The [src] has reserved the remaining facehuggers for themselves.")) return - if(!GLOB.hive_datum[hivenumber].can_spawn_as_hugger(user)) + if(!faction.can_spawn_as_hugger(user)) return //Need to check again because time passed due to the confirmation window if(!huggers_cur) to_chat(user, SPAN_WARNING("\The [src] doesn't have any facehuggers to inhabit.")) return - GLOB.hive_datum[hivenumber].spawn_as_hugger(user, src) + faction.spawn_as_hugger(user, src) huggers_cur-- /datum/behavior_delegate/carrier_base diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index 8de39dc98548..276ade15ce63 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -98,7 +98,7 @@ if(!client && !aghosted && away_timer > XENO_FACEHUGGER_LEAVE_TIMER) // Become a npc once again - new /obj/item/clothing/mask/facehugger(loc, hivenumber) + new /obj/item/clothing/mask/facehugger(loc, faction) qdel(src) return ..() @@ -125,7 +125,7 @@ var/obj/effect/alien/resin/special/eggmorph/morpher = A if(time_of_birth + 3 SECONDS > world.time) return - if(morpher.linked_hive.hivenumber != hivenumber) + if(morpher.faction != faction) to_chat(src, SPAN_XENOWARNING("This isn't your hive's eggmorpher!")) return if(morpher.stored_huggers >= morpher.huggers_max_amount) @@ -141,7 +141,7 @@ if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return - if(!can_hug(human, hivenumber)) + if(!can_hug(human, faction.code_identificator)) to_chat(src, SPAN_WARNING("You can't infect \the [human]...")) return visible_message(SPAN_WARNING("\The [src] starts climbing onto \the [human]'s face..."), SPAN_XENONOTICE("You start climbing onto \the [human]'s face...")) @@ -150,7 +150,7 @@ if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return - if(!can_hug(human, hivenumber)) + if(!can_hug(human, faction.code_identificator)) to_chat(src, SPAN_WARNING("You can't infect \the [human]...")) return handle_hug(human) @@ -160,7 +160,7 @@ xeno_attack_delay(src) //Adds some lag to the 'attack' /mob/living/carbon/xenomorph/facehugger/proc/handle_hug(mob/living/carbon/human/human) - var/obj/item/clothing/mask/facehugger/hugger = new /obj/item/clothing/mask/facehugger(loc, hivenumber) + var/obj/item/clothing/mask/facehugger/hugger = new /obj/item/clothing/mask/facehugger(loc, faction) var/did_hug = hugger.attach(human, TRUE, 1, src) if(!did_hug) qdel(hugger) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm index cd4a8e25f949..e2ce5159bd01 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm @@ -74,8 +74,8 @@ weed_food_states = list("Hellhound_1","Hellhound_2","Hellhound_3") weed_food_states_flipped = list("Hellhound_1","Hellhound_2","Hellhound_3") -/mob/living/carbon/xenomorph/hellhound/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, datum/faction/_faction) - . = ..(mapload, old_xeno, faction || FACTION_XENOMORPH_YAUTJA) +/mob/living/carbon/xenomorph/hellhound/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, datum/faction/faction_to_set) + . = ..(mapload, old_xeno, faction_to_set || FACTION_XENOMORPH_YAUTJA) set_languages(list(LANGUAGE_HELLHOUND, LANGUAGE_YAUTJA)) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm index e2687c8379f5..381fa87531eb 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm @@ -111,7 +111,7 @@ if(!turf_weeds) return - if(turf_weeds.linked_hive.hivenumber == bound_xeno.hivenumber) + if(turf_weeds.faction == bound_xeno.faction) speed_data["speed"] += weed_speed_increase /datum/behavior_delegate/hivelord_base/on_life() diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index b6576360ca3e..18b5378a1661 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -53,18 +53,18 @@ /proc/update_living_queens() // needed to update when you change a queen to a different hive outer_loop: - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(hive.living_xeno_queen) - if(hive.living_xeno_queen.hivenumber == hive.hivenumber) + for(var/faction_to_get in FACTION_LIST_ALL) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen) + if(faction_module.living_xeno_queen.faction == faction) continue for(var/mob/living/carbon/xenomorph/queen/Q in GLOB.living_xeno_list) - if(Q.hivenumber == hive.hivenumber && !should_block_game_interaction(Q)) - hive.living_xeno_queen = Q - xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"),3,hive.hivenumber) + if(Q.faction == faction && !should_block_game_interaction(Q)) + faction_module.living_xeno_queen = Q + xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"), 3, faction) continue outer_loop - hive.living_xeno_queen = null + faction_module.living_xeno_queen = null /mob/hologram/queen name = "Queen Eye" @@ -108,10 +108,10 @@ RegisterSignal(src, COMSIG_MOVABLE_TURF_ENTER, PROC_REF(turf_weed_only)) // Default color - if(Q.hive.color) - color = Q.hive.color + if(Q.faction.color) + color = Q.faction.color - hivenumber = Q.hivenumber + hivenumber = Q.faction.code_identificator med_hud_set_status() add_to_all_mob_huds() @@ -178,7 +178,7 @@ var/list/turf_area = range(3, crossing_turf) var/obj/effect/alien/weeds/nearby_weeds = locate() in turf_area - if(nearby_weeds && HIVE_ALLIED_TO_HIVE(nearby_weeds.hivenumber, hivenumber)) + if(nearby_weeds && nearby_weeds.faction.faction_is_ally(GLOB.faction_datums[hivenumber])) var/obj/effect/alien/crossing_turf_weeds = locate() in crossing_turf if(crossing_turf_weeds) crossing_turf_weeds.update_icon() //randomizes the icon of the turf when crossed over*/ @@ -216,7 +216,7 @@ if(isxeno(A)) var/mob/living/carbon/xenomorph/X = A - if(X.ally_of_hivenumber(hivenumber)) + if(X.ally_faction(GLOB.faction_datums[hivenumber])) Q.overwatch(A) return COMPONENT_INTERRUPT_CLICK @@ -374,43 +374,43 @@ /mob/living/carbon/xenomorph/queen/corrupted AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_CORRUPTED + faction_to_get = FACTION_XENOMORPH_CORRUPTED /mob/living/carbon/xenomorph/queen/forsaken AUTOWIKI_SKIP(TRUE) - hivenumber = FACTION_XENOMORPH_FORSAKEN + faction_to_get = FACTION_XENOMORPH_FORSAKEN /mob/living/carbon/xenomorph/queen/forsaken/combat_ready AUTOWIKI_SKIP(TRUE) - hivenumber = FACTION_XENOMORPH_FORSAKEN + faction_to_get = FACTION_XENOMORPH_FORSAKEN queen_aged = TRUE /mob/living/carbon/xenomorph/queen/alpha AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_ALPHA + faction_to_get = FACTION_XENOMORPH_ALPHA /mob/living/carbon/xenomorph/queen/bravo AUTOWIKI_SKIP(TRUE) - hivenumber = FACTION_XENOMORPH_NORMAL + faction_to_get = FACTION_XENOMORPH_NORMAL /mob/living/carbon/xenomorph/queen/charlie AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_CHARLIE + faction_to_get = FACTION_XENOMORPH_CHARLIE /mob/living/carbon/xenomorph/queen/delta AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_DELTA + faction_to_get = FACTION_XENOMORPH_DELTA /mob/living/carbon/xenomorph/queen/mutated AUTOWIKI_SKIP(TRUE) - hivenumber = XENO_HIVE_MUTATED + faction_to_get = FACTION_XENOMORPH_MUTATED /mob/living/carbon/xenomorph/queen/combat_ready AUTOWIKI_SKIP(FALSE) @@ -418,9 +418,9 @@ /mob/living/carbon/xenomorph/queen/Initialize() . = ..() - SStracking.set_leader("hive_[hivenumber]", src) + SStracking.set_leader("hive_[faction.code_identificator]", src) if(!should_block_game_interaction(src))//so admins can safely spawn Queens in Thunderdome for tests. - xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"),3,hivenumber) + xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"), 3, faction) notify_ghosts(header = "New Queen", message = "A new Queen has risen.", source = src, action = NOTIFY_ORBIT) playsound(loc, 'sound/voice/alien_queen_command.ogg', 75, 0) set_resin_build_order(GLOB.resin_build_order_drone) @@ -432,7 +432,8 @@ choose_resin_ability.update_button_icon(selected_resin) break // Don't need to keep looking - if(hive.dynamic_evolution && !queen_aged) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.dynamic_evolution && !queen_aged) queen_age_timer_id = addtimer(CALLBACK(src, PROC_REF(make_combat_effective)), XENO_QUEEN_AGE_TIME, TIMER_UNIQUE|TIMER_STOPPABLE) else make_combat_effective() @@ -445,7 +446,7 @@ for(var/mob/living/carbon/xenomorph/xeno in new_loc.contents) if(xeno.pass_flags.flags_pass & (PASS_MOB_THRU_XENO|PASS_MOB_THRU) && !(xeno.flags_pass_temp & PASS_MOB_THRU)) continue - if(xeno.hivenumber == hivenumber && !(queen.client?.prefs?.toggle_prefs & TOGGLE_AUTO_SHOVE_OFF)) + if(xeno.faction == faction && !(queen.client?.prefs?.toggle_prefs & TOGGLE_AUTO_SHOVE_OFF)) xeno.KnockDown((5 DECISECONDS) / GLOBAL_STATUS_MULTIPLIER) playsound(src, 'sound/weapons/alien_knockdown.ogg', 25, 1) @@ -538,13 +539,14 @@ if(observed_xeno) overwatch(observed_xeno, TRUE) - if(hive && hive.living_xeno_queen == src) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen == src) var/mob/living/carbon/xenomorph/queen/next_queen = null - for(var/mob/living/carbon/xenomorph/queen/queen in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/queen/queen in faction.total_mobs) if(!should_block_game_interaction(queen) && queen != src && !QDELETED(queen)) next_queen = queen break - hive.set_living_xeno_queen(next_queen) // either null or a queen + faction_module.set_living_xeno_queen(next_queen) // either null or a queen return ..() @@ -567,16 +569,14 @@ var/turf/T = loc if(length(T.contents) <= 25) //so we don't end up with a million object on that turf. egg_amount-- - new /obj/item/xeno_egg(loc, hivenumber) + new /obj/item/xeno_egg(loc, faction.code_identificator) /mob/living/carbon/xenomorph/queen/get_status_tab_items() . = ..() - var/stored_larvae = GLOB.hive_datum[hivenumber].stored_larva - var/xeno_leader_num = hive?.queen_leader_limit - length(hive?.open_xeno_leader_positions) - - . += "Pooled Larvae: [stored_larvae]" - . += "Leaders: [xeno_leader_num] / [hive?.queen_leader_limit]" - . += "Royal Resin: [hive?.buff_points]" + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + . += "Pooled Larvae: [faction_module.stored_larva]" + . += "Leaders: [faction_module.queen_leader_limit - length(faction_module.open_xeno_leader_positions)] / [faction_module.queen_leader_limit]" + . += "Royal Resin: [faction_module.buff_points]" if(!queen_aged && queen_age_timer_id != TIMER_ID_NULL) . += "Maturity: [time2text(timeleft(queen_age_timer_id), "mm:ss")] remaining" @@ -635,7 +635,7 @@ if(word_ability) word_ability.apply_cooldown() - xeno_announcement(input, hivenumber, "The words of the [name] reverberate in our head...") + xeno_announcement(input, faction, "The words of the [name] reverberate in our head...") message_admins("[key_name_admin(src)] has created a Word of the Queen report:") log_admin("[key_name_admin(src)] Word of the Queen: [input]") @@ -650,7 +650,7 @@ to_chat(src, SPAN_WARNING("You can't do that now.")) return - if(!hive) + if(!faction) to_chat(src, SPAN_WARNING("You can't do that now.")) CRASH("[src] attempted to toggle slashing without a linked hive") @@ -663,14 +663,15 @@ var/choice = tgui_input_list(usr, "Choose which level of slashing hosts to permit to your hive.","Harming", list("Allowed", "Restricted - Hosts of Interest", "Forbidden"), theme="hive_status") + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(choice == "Allowed") to_chat(src, SPAN_XENONOTICE("You allow slashing.")) - xeno_message(SPAN_XENOANNOUNCE("The Queen has permitted the harming of hosts! Go hog wild!"), 2, hivenumber) - hive.slashing_allowed = XENO_SLASH_ALLOWED + xeno_message(SPAN_XENOANNOUNCE("The Queen has permitted the harming of hosts! Go hog wild!"), 2, faction) + faction_module.slashing_allowed = XENO_SLASH_ALLOWED else if(choice == "Forbidden") to_chat(src, SPAN_XENONOTICE("You forbid slashing entirely.")) - xeno_message(SPAN_XENOANNOUNCE("The Queen has forbidden the harming of hosts. You can no longer slash your enemies."), 2, hivenumber) - hive.slashing_allowed = XENO_SLASH_FORBIDDEN + xeno_message(SPAN_XENOANNOUNCE("The Queen has forbidden the harming of hosts. You can no longer slash your enemies."), 2, faction) + faction_module.slashing_allowed = XENO_SLASH_FORBIDDEN /mob/living/carbon/xenomorph/proc/do_claw_toggle_cooldown() pslash_delay = FALSE @@ -686,18 +687,19 @@ var/choice = tgui_input_list(usr, "Choose which level of construction placement freedom to permit to your hive.","Harming", list("Queen", "Leaders", "Anyone"), theme="hive_status") + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(choice == "Anyone") to_chat(src, SPAN_XENONOTICE("You allow construction placement to all builder castes.")) - xeno_message("The Queen has permitted the placement of construction nodes to all builder castes!", hivenumber = src.hivenumber) - hive.construction_allowed = NORMAL_XENO + xeno_message("The Queen has permitted the placement of construction nodes to all builder castes!", faction_to_display = faction) + faction_module.construction_allowed = NORMAL_XENO else if(choice == "Leaders") to_chat(src, SPAN_XENONOTICE("You restrict construction placement to leaders only.")) - xeno_message("The Queen has restricted the placement of construction nodes to leading builder castes only.", hivenumber = src.hivenumber) - hive.construction_allowed = XENO_LEADER + xeno_message("The Queen has restricted the placement of construction nodes to leading builder castes only.", faction_to_display = faction) + faction_module.construction_allowed = XENO_LEADER else if(choice == "Queen") to_chat(src, SPAN_XENONOTICE("You forbid construction placement entirely.")) - xeno_message("The Queen has forbidden the placement of construction nodes to herself.", hivenumber = src.hivenumber) - hive.construction_allowed = XENO_QUEEN + xeno_message("The Queen has forbidden the placement of construction nodes to herself.", faction_to_display = faction) + faction_module.construction_allowed = XENO_QUEEN /mob/living/carbon/xenomorph/proc/destruction_toggle() set name = "Permit/Disallow Special Structure Destruction" @@ -710,18 +712,19 @@ var/choice = tgui_input_list(usr, "Choose which level of destruction freedom to permit to your hive.","Harming", list("Queen", "Leaders", "Anyone"), theme="hive_status") + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(choice == "Anyone") to_chat(src, SPAN_XENONOTICE("You allow special structure destruction to all builder castes and leaders.")) - xeno_message("The Queen has permitted the special structure destruction to all builder castes and leaders!", hivenumber = src.hivenumber) - hive.destruction_allowed = NORMAL_XENO + xeno_message("The Queen has permitted the special structure destruction to all builder castes and leaders!", faction_to_display = faction) + faction_module.destruction_allowed = NORMAL_XENO else if(choice == "Leaders") to_chat(src, SPAN_XENONOTICE("You restrict special structure destruction to leaders only.")) - xeno_message("The Queen has restricted the special structure destruction to leaders only.", hivenumber = src.hivenumber) - hive.destruction_allowed = XENO_LEADER + xeno_message("The Queen has restricted the special structure destruction to leaders only.", faction_to_display = faction) + faction_module.destruction_allowed = XENO_LEADER else if(choice == "Queen") to_chat(src, SPAN_XENONOTICE("You forbid special structure destruction entirely.")) - xeno_message("The Queen has forbidden the special structure destruction to anyone but herself.", hivenumber = src.hivenumber) - hive.destruction_allowed = XENO_QUEEN + xeno_message("The Queen has forbidden the special structure destruction to anyone but herself.", faction_to_display = faction) + faction_module.destruction_allowed = XENO_QUEEN /mob/living/carbon/xenomorph/proc/toggle_unnesting() set name = "Permit/Disallow Unnesting" @@ -732,14 +735,14 @@ to_chat(src, SPAN_WARNING("You can't do that now.")) return - hive.unnesting_allowed = !hive.unnesting_allowed - - if(hive.unnesting_allowed) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.unnesting_allowed = !faction_module.unnesting_allowed + if(faction_module.unnesting_allowed) to_chat(src, SPAN_XENONOTICE("You have allowed everyone to unnest hosts.")) - xeno_message("The Queen has allowed everyone to unnest hosts.", hivenumber = src.hivenumber) + xeno_message("The Queen has allowed everyone to unnest hosts.", faction_to_display = faction) else to_chat(src, SPAN_XENONOTICE("You have forbidden anyone to unnest hosts, except for the drone caste.")) - xeno_message("The Queen has forbidden anyone to unnest hosts, except for the drone caste.", hivenumber = src.hivenumber) + xeno_message("The Queen has forbidden anyone to unnest hosts, except for the drone caste.", faction_to_display = faction) /mob/living/carbon/xenomorph/queen/handle_screech_act(mob/self, mob/living/carbon/xenomorph/queen/queen) return COMPONENT_SCREECH_ACT_CANCEL @@ -779,7 +782,7 @@ if(isxeno(victim)) var/mob/living/carbon/xenomorph/xeno = victim - if(hivenumber == xeno.hivenumber) + if(faction == xeno.faction) to_chat(src, SPAN_WARNING("You can't bring yourself to harm a fellow sister to this magnitude.")) return FALSE @@ -817,21 +820,22 @@ return TRUE /mob/living/carbon/xenomorph/queen/death(cause, gibbed) - if(src == hive?.living_xeno_queen) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(src == faction_module.living_xeno_queen) UnregisterSignal(src, COMSIG_MOVABLE_PRE_MOVE) - hive.xeno_queen_timer = world.time + XENO_QUEEN_DEATH_DELAY + faction_module.xeno_queen_timer = world.time + XENO_QUEEN_DEATH_DELAY // Reset the banished ckey list - if(length(hive.banished_ckeys)) - for(var/mob/living/carbon/xenomorph/target_xeno in hive.totalXenos) + if(length(faction.banished_ckeys)) + for(var/mob/living/carbon/xenomorph/target_xeno in faction.total_mobs) if(!target_xeno.ckey) continue - for(var/mob_name in hive.banished_ckeys) - if(target_xeno.ckey == hive.banished_ckeys[mob_name]) + for(var/mob_name in faction.banished_ckeys) + if(target_xeno.ckey == faction.banished_ckeys[mob_name]) target_xeno.banished = FALSE target_xeno.hud_update_banished() target_xeno.lock_evolve = FALSE - hive.banished_ckeys = list() + faction.banished_ckeys = list() icon = queen_standing_icon return ..() @@ -893,12 +897,13 @@ bubble_icon_x_offset = 32 bubble_icon_y_offset = 32 - for(var/mob/living/carbon/xenomorph/leader in hive.xeno_leader_list) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/mob/living/carbon/xenomorph/leader in faction_module.xeno_leader_list) leader.handle_xeno_leader_pheromones() - xeno_message(SPAN_XENOANNOUNCE("The Queen has grown an ovipositor, evolution progress resumed."), 3, hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The Queen has grown an ovipositor, evolution progress resumed."), 3, faction) - START_PROCESSING(SShive_status, hive.hive_ui) + START_PROCESSING(SShive_status, faction_module.hive_ui) SEND_SIGNAL(src, COMSIG_QUEEN_MOUNT_OVIPOSITOR) @@ -946,11 +951,12 @@ break anchored = FALSE - for(var/mob/living/carbon/xenomorph/L in hive.xeno_leader_list) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/mob/living/carbon/xenomorph/L in faction_module.xeno_leader_list) L.handle_xeno_leader_pheromones() if(!instant_dismount) - xeno_message(SPAN_XENOANNOUNCE("The Queen has shed her ovipositor, evolution progress paused."), 3, hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The Queen has shed her ovipositor, evolution progress paused."), 3, faction) SEND_SIGNAL(src, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, instant_dismount) diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index b014312ebad3..2501e72d1f4f 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -162,7 +162,7 @@ hive_ui = new(src) mark_ui = new(src) faction_ui = new(src) - minimap_type = get_minimap_flag_for_faction(hivenumber) + minimap_type = faction.minimap_flag tacmap = new(src, minimap_type) if(!internal_faction) internal_faction = name @@ -733,7 +733,7 @@ if(!is_ground_level(potential_host.z) || get_area(potential_host) == hijacked_dropship) continue var/obj/item/alien_embryo/A = locate() in potential_host - if(A && A.hivenumber != hivenumber) + if(A && A.faction != faction) continue for(var/obj/item/alien_embryo/embryo in potential_host) embryo.hivenumber = FACTION_XENOMORPH_FORSAKEN @@ -821,32 +821,6 @@ stored_larva-- hive_ui.update_burrowed_larva() -/mob/living/proc/ally_of_hivenumber(hivenumber) - var/datum/hive_status/indexed_hive = GLOB.hive_datum[hivenumber] - if(!indexed_hive) - return FALSE - - return indexed_hive.is_ally(src) - -/datum/hive_status/proc/is_ally(mob/living/living_mob) - if(isxeno(living_mob)) - var/mob/living/carbon/xenomorph/zenomorf = living_mob - if(zenomorf.hivenumber == hivenumber) - return !zenomorf.banished - - if(!living_mob.faction) - return FALSE - - return faction_is_ally(living_mob.faction) - -/datum/hive_status/proc/faction_is_ally(faction, ignore_queen_check = FALSE) - if(faction == internal_faction) - return TRUE - if(!ignore_queen_check && !living_xeno_queen) - return FALSE - - return allies[faction] - /datum/hive_status/proc/can_delay_round_end(mob/living/carbon/xenomorph/xeno) if(HAS_TRAIT(src, TRAIT_NO_HIVE_DELAY)) return FALSE @@ -1074,7 +1048,7 @@ /datum/hive_status/feral name = "Feral Hive" reporting_id = "feral" - hivenumber = XENO_HIVE_FERAL + hivenumber = FACTION_XENOMORPH_FERAL prefix = "Feral " color = "#828296" ui_color = "#828296" diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index a70a0ea1b3b4..843f5d19d3bb 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -575,10 +575,12 @@ Make sure their actual health updates immediately.*/ var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in T - if(W && W.linked_hive.is_ally(src)) + if(W && ally_faction(W.faction)) return TRUE //weeds, yes! if(need_weeds) return FALSE //needs weeds, doesn't have any - if(hive && hive.living_xeno_queen && !is_mainship_level(hive.living_xeno_queen.loc.z) && is_mainship_level(loc.z)) - return FALSE //We are on the ship, but the Queen isn't + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen && !is_mainship_level(faction_module.living_xeno_queen.loc.z) && is_mainship_level(loc.z)) + return FALSE //We are on the ship, but the Queen isn't return TRUE //we have off-weed healing, and either we're on Almayer with the Queen, or we're on non-Almayer, or the Queen is dead, good enough! diff --git a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm index 1bf817392ab9..55452706da4e 100644 --- a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm +++ b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm @@ -56,7 +56,7 @@ to_chat(X, SPAN_WARNING("You cannot build under \the [V]!")) return FALSE - if(alien_weeds.linked_hive.hivenumber != X.hivenumber) + if(alien_weeds.faction != X.faction) to_chat(X, SPAN_WARNING("These weeds do not belong to your hive!")) return FALSE @@ -83,7 +83,7 @@ var/can_build_thick = TRUE if(thick_hiveweed) var/obj/effect/alien/weeds/weeds = locate() in build_turf - if(!weeds || weeds.hivenumber != hivenumber || weeds.weed_strength < WEED_LEVEL_HIVE) + if(!weeds || weeds.faction != faction || weeds.weed_strength < WEED_LEVEL_HIVE) can_build_thick = FALSE if(build_path_thick && (can_build_thick || (SEND_SIGNAL(builder, COMSIG_XENO_THICK_RESIN_BYPASS) & COMPONENT_THICK_BYPASS))) diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/gardener.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/gardener.dm index 87b8aeafc49e..24f8eab51cbd 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/gardener.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/gardener.dm @@ -80,7 +80,7 @@ to_chat(xeno, SPAN_WARNING("The are no weeds to plant a fruit within!")) return - if(target_weeds.hivenumber != xeno.hivenumber) + if(target_weeds.faction != xeno.faction) to_chat(xeno, SPAN_WARNING("These weeds do not belong to our hive; they reject our fruit.")) return @@ -263,8 +263,8 @@ var/obj/structure/mineral_door/resin/door = target_atom var/turf/closed/wall/resin/wall = target_turf - var/wall_present = istype(wall) && wall.hivenumber == xeno.hivenumber - var/door_present = istype(door) && door.hivenumber == xeno.hivenumber + var/wall_present = istype(wall) && wall.faction == xeno.faction + var/door_present = istype(door) && door.faction == xeno.faction // Is my tile either a wall or a door if(door_present || wall_present) var/structure_to_buff = door || wall @@ -286,7 +286,7 @@ to_chat(xeno, SPAN_XENONOTICE("We haplessly try to surge resin around [structure_to_buff], but it's already reinforced. It'll take a moment for us to recover.")) xeno_cooldown = xeno_cooldown * 0.5 - else if(F && F.hivenumber == xeno.hivenumber) + else if(F && F.faction == xeno.faction) if(F.mature) to_chat(xeno, SPAN_XENONOTICE("The [F] is already mature. The [src.name] does nothing.")) xeno_cooldown = xeno_cooldown * 0.5 @@ -294,13 +294,13 @@ to_chat(xeno, SPAN_XENONOTICE("We surge the resin around the [F], speeding its growth somewhat!")) F.reduce_timer(5 SECONDS) - else if(target_weeds && istype(target_turf, /turf/open) && target_weeds.hivenumber == xeno.hivenumber) + else if(target_weeds && istype(target_turf, /turf/open) && target_weeds.faction == xeno.faction) xeno.visible_message(SPAN_XENODANGER("\The [xeno] surges the resin, creating an unstable wall!"), \ SPAN_XENONOTICE("We surge the resin, creating an unstable wall!"), null, 5) target_turf.PlaceOnTop(/turf/closed/wall/resin/weak) var/turf/closed/wall/resin/weak_wall = target_turf - weak_wall.hivenumber = xeno.hivenumber - set_hive_data(weak_wall, xeno.hivenumber) + weak_wall.faction = xeno.faction + set_hive_data(weak_wall, xeno.faction) else if(target_turf) if(channel_in_progress) @@ -314,9 +314,9 @@ SPAN_XENONOTICE("We surge the deep resin, creating an unstable sticky resin patch!"), null, 5) for (var/turf/targetTurf in orange(1, target_turf)) if(!locate(/obj/effect/alien/resin/sticky) in targetTurf) - new /obj/effect/alien/resin/sticky/thin/weak(targetTurf, xeno.hivenumber) + new /obj/effect/alien/resin/sticky/thin/weak(targetTurf, xeno) if(!locate(/obj/effect/alien/resin/sticky) in target_turf) - new /obj/effect/alien/resin/sticky/thin/weak(target_turf, xeno.hivenumber) + new /obj/effect/alien/resin/sticky/thin/weak(target_turf, xeno) else xeno_cooldown = xeno_cooldown * 0.5 diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 4b0114cffd8c..b7f103cdae05 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -28,8 +28,7 @@ max_n2 = 0 unsuitable_atoms_damage = 15 attack_same = TRUE - faction = FACTION_XENOMORPH - hivenumber = FACTION_XENOMORPH_NORMAL + faction_to_get = FACTION_XENOMORPH_NORMAL wall_smash = 1 minbodytemp = 0 heat_damage_per_tick = 20 @@ -48,9 +47,8 @@ handle_icon() generate_name() . = ..() - if(hivenumber) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - color = hive.color + if(faction) + color = faction.color wound_icon_holder = new(null, src) vis_contents += wound_icon_holder @@ -79,20 +77,19 @@ /mob/living/simple_animal/hostile/alien/evaluate_target(mob/living/carbon/target) . = ..() - if(!. || !hivenumber) + if(!. || !faction) return if(istype(target, /mob/living/simple_animal/hostile/alien)) var/mob/living/simple_animal/hostile/alien/alien_target = target - if(alien_target.hivenumber == hivenumber) + if(alien_target.faction == faction) return FALSE - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - if(hive.is_ally(target)) + if(target.ally_faction(faction)) return FALSE /mob/living/simple_animal/hostile/alien/pull_response(mob/puller) if(stat != DEAD && has_species(puller, "Human")) // If the Xeno is alive, fight back against a grab/pull var/mob/living/carbon/human/H = puller - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(faction)) return TRUE puller.apply_effect(2, WEAKEN) playsound(puller.loc, 'sound/weapons/pierce.ogg', 25, 1) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index e3b62a44ed97..b06b47cb2f9d 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -153,13 +153,13 @@ if(latejoin_larva_drop && SSticker.mode.latejoin_tally - SSticker.mode.latejoin_larva_used >= latejoin_larva_drop) SSticker.mode.latejoin_larva_used += latejoin_larva_drop - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(hive.latejoin_burrowed == TRUE) - if(length(hive.totalXenos) && (hive.hive_location || ROUND_TIME < XENO_ROUNDSTART_PROGRESS_TIME_2)) - hive.stored_larva++ - hive.hive_ui.update_burrowed_larva() + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.latejoin_burrowed == TRUE) + if(length(faction.total_mobs) && (faction_module.hive_location || ROUND_TIME < XENO_ROUNDSTART_PROGRESS_TIME_2)) + faction_module.stored_larva++ + faction_module.hive_ui.update_burrowed_larva() if(character.mind && character.mind.player_entity) var/datum/entity/player_entity/player = character.mind.player_entity @@ -195,7 +195,7 @@ for(var/i in GLOB.RoleAuthority.roles_for_mode) var/datum/job/J = GLOB.RoleAuthority.roles_for_mode[i] - if(!GLOB.RoleAuthority.check_role_entry(src, J, latejoin = TRUE, faction = FACTION_NEUTRAL)) + if(!GLOB.RoleAuthority.check_role_entry(src, J, latejoin = TRUE, faction_to_set = GLOB.faction_datums[FACTION_NEUTRAL])) continue var/active = 0 // Only players with the job assigned and AFK for less than 10 minutes count as active @@ -258,7 +258,7 @@ for(var/i in GLOB.RoleAuthority.roles_for_mode) var/datum/job/J = GLOB.RoleAuthority.roles_for_mode[i] - if(!GLOB.RoleAuthority.check_role_entry(src, J, latejoin = TRUE, faction = FACTION_UPP)) + if(!GLOB.RoleAuthority.check_role_entry(src, J, latejoin = TRUE, faction_to_set = GLOB.faction_datums[FACTION_UPP])) continue var/active = 0 // Only players with the job assigned and AFK for less than 10 minutes count as active diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 2d42700624c6..75464ee04548 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -891,7 +891,7 @@ var/mob/living/carbon/xenomorph/X = P.firer if(!istype(X)) return FALSE - if(X.hivenumber == hivenumber) + if(X.faction == faction) return FALSE if(mob_size == MOB_SIZE_SMALL) diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index 87153a24942c..3402afe50d7b 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -247,7 +247,7 @@ to_chat(xeno, SPAN_WARNING("The metal bird can not land here. It might be currently occupied!")) return to_chat(xeno, SPAN_NOTICE("You command the metal bird to come down. Clever girl.")) - xeno_announcement(SPAN_XENOANNOUNCE("Our Queen has commanded the metal bird to the hive at [linked_lz]."), xeno.hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Our Queen has commanded the metal bird to the hive at [linked_lz]."), xeno.faction, XENO_GENERAL_ANNOUNCE) log_ares_flight("Unknown", "Remote launch signal for [shuttle.name] received. Authentication garbled.") log_ares_security("Security Alert", "Remote launch signal for [shuttle.name] received. Authentication garbled.") return @@ -312,7 +312,7 @@ stop_playing_launch_announcement_alarm() to_chat(xeno, SPAN_XENONOTICE("You override the doors.")) - xeno_message(SPAN_XENOANNOUNCE("The doors of the metal bird have been overridden! Rejoice!"), 3, xeno.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The doors of the metal bird have been overridden! Rejoice!"), 3, xeno.faction) message_admins("[key_name(xeno)] has locked the dropship '[dropship]'", xeno.x, xeno.y, xeno.z) notify_ghosts(header = "Dropship Locked", message = "[xeno] has locked [dropship]!", source = xeno, action = NOTIFY_ORBIT) return @@ -361,19 +361,19 @@ log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") var/mob/living/carbon/xenomorph/xeno = user - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL] if(istype(xeno)) - hivenumber = xeno.hivenumber - xeno_message(SPAN_XENOANNOUNCE("The Queen has commanded the metal bird to depart for the metal hive in the sky! Rejoice!"), 3, hivenumber) - xeno_message(SPAN_XENOANNOUNCE("The hive swells with power! You will now steadily gain pooled larva over time."), 2, hivenumber) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - hive.abandon_on_hijack() - var/original_evilution = hive.evolution_bonus - hive.override_evilution(XENO_HIJACK_EVILUTION_BUFF, TRUE) - if(hive.living_xeno_queen) - var/datum/action/xeno_action/onclick/grow_ovipositor/ovi_ability = get_action(hive.living_xeno_queen, /datum/action/xeno_action/onclick/grow_ovipositor) + faction = xeno.faction + xeno_message(SPAN_XENOANNOUNCE("The Queen has commanded the metal bird to depart for the metal hive in the sky! Rejoice!"), 3, faction) + xeno_message(SPAN_XENOANNOUNCE("The hive swells with power! You will now steadily gain pooled larva over time."), 2, faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.abandon_on_hijack() + var/original_evilution = faction_module.evolution_bonus + faction_module.override_evilution(XENO_HIJACK_EVILUTION_BUFF, TRUE) + if(faction_module.living_xeno_queen) + var/datum/action/xeno_action/onclick/grow_ovipositor/ovi_ability = get_action(faction_module.living_xeno_queen, /datum/action/xeno_action/onclick/grow_ovipositor) ovi_ability.reduce_cooldown(ovi_ability.xeno_cooldown) - addtimer(CALLBACK(hive, TYPE_PROC_REF(/datum/hive_status, override_evilution), original_evilution, FALSE), XENO_HIJACK_EVILUTION_TIME) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/hive_status, override_evilution), original_evilution, FALSE), XENO_HIJACK_EVILUTION_TIME) // Notify the yautja too so they stop the hunt message_all_yautja("The serpent Queen has commanded the landing shuttle to depart.") diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index 40e62f4dd64d..8305b3649daa 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -255,7 +255,7 @@ GLOBAL_LIST_EMPTY(shuttle_controls) var/count = Q.count_hivemember_same_area() // Check if at least half of the hive is onboard. If not, we don't launch. - if(count < length(Q.hive.totalXenos) * 0.5) + if(count < length(Q.faction.total_mobs) * 0.5) to_chat(Q, SPAN_WARNING("More than half of your hive is not on board. Don't leave without them!")) return @@ -294,8 +294,8 @@ GLOBAL_LIST_EMPTY(shuttle_controls) log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") to_chat(Q, SPAN_DANGER("A loud alarm erupts from [src]! The fleshy hosts must know that you can access it!")) - xeno_message(SPAN_XENOANNOUNCE("The Queen has commanded the metal bird to depart for the metal hive in the sky! Rejoice!"),3,Q.hivenumber) - xeno_message(SPAN_XENOANNOUNCE("The hive swells with power! You will now steadily gain burrowed larva over time."),2,Q.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The Queen has commanded the metal bird to depart for the metal hive in the sky! Rejoice!"), 3, Q.faction) + xeno_message(SPAN_XENOANNOUNCE("The hive swells with power! You will now steadily gain burrowed larva over time."), 2, Q.faction) // Notify the yautja too so they stop the hunt message_all_yautja("The serpent Queen has commanded the landing shuttle to depart.") @@ -303,8 +303,9 @@ GLOBAL_LIST_EMPTY(shuttle_controls) Q.count_niche_stat(STATISTICS_NICHE_FLIGHT) - if(Q.hive) - addtimer(CALLBACK(Q.hive, TYPE_PROC_REF(/datum/hive_status, abandon_on_hijack)), DROPSHIP_WARMUP_TIME + 5 SECONDS, TIMER_UNIQUE) //+ 5 seconds catch standing in doorways + if(Q.faction) + var/datum/faction_module/hive_mind/faction_module = Q.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/hive_status, abandon_on_hijack)), DROPSHIP_WARMUP_TIME + 5 SECONDS, TIMER_UNIQUE) //+ 5 seconds catch standing in doorways if(GLOB.bomb_set) for(var/obj/structure/machinery/nuclearbomb/bomb in world) diff --git a/code/modules/tgui/states/xeno.dm b/code/modules/tgui/states/xeno.dm index fbe63caa27dc..50a770ea329e 100644 --- a/code/modules/tgui/states/xeno.dm +++ b/code/modules/tgui/states/xeno.dm @@ -9,18 +9,17 @@ GLOBAL_LIST_INIT(hive_state, setup_hive_states()) /proc/setup_hive_states() . = list() - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - .[hive.internal_faction] = new/datum/ui_state/hive_state(hive.hivenumber) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + .[faction.code_identificator] = new/datum/ui_state/hive_state(faction) /datum/ui_state/hive_state - var/hivenumber - var/datum/hive_status/hive + var/datum/faction/faction -/datum/ui_state/hive_state/New(hive_to_assign) +/datum/ui_state/hive_state/New(datum/faction/faction_to_set) . = ..() - hivenumber = hive_to_assign - hive = GLOB.hive_datum[hive_to_assign] + + faction = faction_to_set /datum/ui_state/hive_state/can_use_topic(src_object, mob/user) if(hive.is_ally(user)) diff --git a/code/modules/vehicles/apc/apc_command.dm b/code/modules/vehicles/apc/apc_command.dm index 582d5bd7f65f..a9f8d844b2d3 100644 --- a/code/modules/vehicles/apc/apc_command.dm +++ b/code/modules/vehicles/apc/apc_command.dm @@ -57,7 +57,7 @@ continue SSminimaps.remove_marker(current_xeno) - current_xeno.add_minimap_marker(MINIMAP_FLAG_USCM|get_minimap_flag_for_faction(current_xeno.hivenumber)) + current_xeno.add_minimap_marker(MINIMAP_FLAG_USCM|current_xeno.faction.minimap_flag) minimap_added += WEAKREF(current_xeno) else if(WEAKREF(current_xeno) in minimap_added) From f412c9f4c9ff119b5486dbb49817272447033889 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:09:06 +0500 Subject: [PATCH 06/24] almost done, two more step and I can find out 99999999 runtimes... --- code/__DEFINES/mode.dm | 1 + code/datums/ammo/bullet/sniper.dm | 4 +- code/datums/components/weed_food.dm | 4 +- .../construction_template_xenomorph.dm | 7 +- code/datums/emergency_calls/feral_xenos.dm | 3 +- code/datums/factions/faction.dm | 4 +- code/datums/factions/faction_modules.dm | 18 +++ code/datums/factions/iff_tag.dm | 21 ++- code/datums/factions/uscm/cmb.dm | 2 +- code/datums/medal_awards.dm | 4 +- code/datums/mob_hud.dm | 12 +- code/datums/statistics/entities/xeno_stats.dm | 2 +- .../whiskey_outpost/whiskey_output_waves.dm | 8 +- .../gamemodes/colonialmarines/xenovsxeno.dm | 58 ++++---- code/game/gamemodes/extended/cm_vs_upp.dm | 2 +- code/game/jobs/role_authority.dm | 6 +- .../computer/groundside_operations.dm | 4 +- code/game/objects/items/devices/cictablet.dm | 4 +- code/game/objects/items/storage/backpack.dm | 3 +- .../stool_bed_chair_nest/xeno_nest.dm | 3 +- .../admin/player_panel/player_panel.dm | 6 +- code/modules/admin/tabs/event_tab.dm | 2 +- code/modules/admin/topic/topic.dm | 10 +- code/modules/admin/topic/topic_events.dm | 6 +- code/modules/admin/verbs/mob_verbs.dm | 11 +- .../cm_tech/implements/xeno_handler.dm | 14 +- code/modules/gear_presets/other.dm | 2 +- code/modules/gear_presets/synths.dm | 4 +- code/modules/mob/death.dm | 2 + code/modules/mob/language/languages.dm | 5 +- .../mob/living/carbon/xenomorph/Embryo.dm | 2 +- .../mob/living/carbon/xenomorph/Evolution.dm | 6 +- .../mob/living/carbon/xenomorph/Powers.dm | 20 +-- .../living/carbon/xenomorph/XenoAttacks.dm | 6 +- .../mob/living/carbon/xenomorph/Xenomorph.dm | 128 +++++++++--------- .../living/carbon/xenomorph/castes/Larva.dm | 6 +- .../mob/living/carbon/xenomorph/death.dm | 87 ++++++------ .../living/carbon/xenomorph/hive_faction.dm | 9 +- .../living/carbon/xenomorph/hive_status.dm | 50 +++---- .../mob/living/carbon/xenomorph/life.dm | 26 ++-- .../mob/living/carbon/xenomorph/mark_menu.dm | 11 +- .../mob/living/carbon/xenomorph/say.dm | 2 +- .../strains/castes/crusher/charger.dm | 2 +- .../xenomorph/strains/castes/drone/healer.dm | 12 +- .../xenomorph/strains/castes/runner/acid.dm | 10 +- .../carbon/xenomorph/strains/xeno_strain.dm | 5 +- .../living/carbon/xenomorph/xeno_helpers.dm | 9 +- .../mob/living/carbon/xenomorph/xeno_verbs.dm | 20 +-- code/modules/mob/mob.dm | 4 +- code/modules/shuttle/shuttles/dropship.dm | 2 +- code/modules/shuttles/marine_ferry.dm | 2 +- 51 files changed, 345 insertions(+), 306 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 5d5ff5b0a63f..abc915a015eb 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -259,6 +259,7 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_UPP "upp" #define FACTION_RESS "ress" #define FACTION_TWE "twe" +#define FACTION_THREEWE "threewe" #define FACTION_WY "wy" #define FACTION_CLF "clf" #define FACTION_PMC "pmc" diff --git a/code/datums/ammo/bullet/sniper.dm b/code/datums/ammo/bullet/sniper.dm index eceea9f36fd3..af929282a391 100644 --- a/code/datums/ammo/bullet/sniper.dm +++ b/code/datums/ammo/bullet/sniper.dm @@ -251,8 +251,8 @@ if(isxeno(target_mob) && isxeno(old_target?.resolve())) var/mob/living/carbon/xenomorph/old_xeno = old_target.resolve() var/mob/living/carbon/xenomorph/new_xeno = target_mob - if((old_xeno.hive == new_xeno.hive) && !(old_xeno.stat)) // Must be in same hive and conscious - to_chat(old_xeno,SPAN_XENOLEADER("The feeling of looming danger fades as we sense that another sister has been targeted instead.")) + if((old_xeno.faction == new_xeno.faction) && !(old_xeno.stat)) // Must be in same hive and conscious + to_chat(old_xeno, SPAN_XENOLEADER("The feeling of looming danger fades as we sense that another sister has been targeted instead.")) if(2) to_chat(aimed_projectile.firer, SPAN_WARNING("Two hits! You're starting to get a good read on the target's patterns.")) if(3) diff --git a/code/datums/components/weed_food.dm b/code/datums/components/weed_food.dm index 4fe41438a953..6b0c11bbcf4b 100644 --- a/code/datums/components/weed_food.dm +++ b/code/datums/components/weed_food.dm @@ -193,8 +193,8 @@ if(!is_ground_level(parent_mob.z)) return - var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_FORSAKEN] - weed_appearance.color = hive.color + var/datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_FORSAKEN] + weed_appearance.color = faction.color /// SIGNAL_HANDLER for COMSIG_LIVING_PREIGNITION of weeds /datum/component/weed_food/proc/on_preignition() diff --git a/code/datums/construction/xenomorph/construction_template_xenomorph.dm b/code/datums/construction/xenomorph/construction_template_xenomorph.dm index 5cf8214f5df3..bde1765f1b36 100644 --- a/code/datums/construction/xenomorph/construction_template_xenomorph.dm +++ b/code/datums/construction/xenomorph/construction_template_xenomorph.dm @@ -84,10 +84,11 @@ if(!owner || !get_turf(owner)) log_debug("Constuction template ([name]) completed construction without a build location") return - if(hive_ref) - hive_ref.remove_construction(owner) + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.remove_construction(owner) build_loc = get_turf(owner) - var/obj/effect/alien/resin/special/nest/newly_builtor = new build_type(build_loc, hive_ref) + var/obj/effect/alien/resin/special/nest/newly_builtor = new build_type(build_loc, faction) playsound(build_loc, "alien_resin_build", 25) if(newly_builtor) newly_builtor.pred_nest.dir = direction_to_put_nest diff --git a/code/datums/emergency_calls/feral_xenos.dm b/code/datums/emergency_calls/feral_xenos.dm index 14c6de513466..60d58c73bf8c 100644 --- a/code/datums/emergency_calls/feral_xenos.dm +++ b/code/datums/emergency_calls/feral_xenos.dm @@ -54,7 +54,8 @@ M.transfer_to(new_xeno, TRUE) new_xeno.set_hive_and_update(FACTION_XENOMORPH_FERAL) if(hive_leader) - new_xeno.hive.add_hive_leader(new_xeno) + var/datum/faction_module/hive_mind/faction_module = new_xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.add_hive_leader(new_xeno) QDEL_NULL(current_mob) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index 38be5ffae223..597feda69878 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -141,7 +141,7 @@ if(organ_tag.faction == src) return TRUE - for(var/datum/faction/faction in organ_tag.factions + organ_tag.faction) + for(var/datum/faction/faction in organ_tag.factions) if(relations_datum.allies[faction.code_identificator]) return TRUE return FALSE @@ -150,7 +150,7 @@ if(obj_tag.faction == src) return TRUE - for(var/datum/faction/faction in obj_tag.factions + obj_tag.faction) + for(var/datum/faction/faction in obj_tag.factions) if(relations_datum.allies[faction.code_identificator]) return TRUE return FALSE diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index 8c8373ffbf49..7fc0865b2cb1 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -159,6 +159,8 @@ /// Has a King hatchery var/has_hatchery = FALSE + var/mob/living/carbon/human/leader + /* /datum/faction_module/hive_mind/New() hive_ui = new(src) @@ -938,3 +940,19 @@ for(var/i = 1 to partial_larva) partial_larva-- stored_larva++ + +/datum/faction_module/hive_mind/proc/make_leader(mob/living/carbon/human/H) + if(!istype(H)) + return + + if(leader) + UnregisterSignal(leader, COMSIG_PARENT_QDELETING) + + leader = H + RegisterSignal(leader, COMSIG_PARENT_QDELETING, PROC_REF(handle_qdelete)) + +/datum/faction_module/hive_mind/proc/handle_qdelete(mob/living/carbon/human/H) + SIGNAL_HANDLER + + if(H == leader) + leader = null diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index 7ad35ffa4462..476c102ba9c2 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -28,13 +28,20 @@ DEFINE_BITFIELD(iff_flag_flags, list( /obj/item/faction_tag/Initialize(mapload, _faction_to_get) . = ..() if(_faction_to_get) - faction_to_get = _faction_to_get - faction = GLOB.faction_datums[_faction_to_get] - if(faction) - factions |= faction - if(ally_factions_initialize) - for(var/datum/faction/faction_ally in faction.relations_datum.allies) - factions |= faction_ally + if(istype(_faction_to_get, /datum/faction)) + faction = _faction_to_get + faction_to_get = faction.code_identificator + else + faction_to_get = _faction_to_get + faction = GLOB.faction_datums[_faction_to_get] + else if(faction_to_get) + faction = GLOB.faction_datums[faction_to_get] + + if(faction) + factions |= faction + if(ally_factions_initialize) + for(var/datum/faction/faction_ally in faction.relations_datum.allies) + factions |= faction_ally /obj/item/faction_tag/attack(mob/living/carbon/mob, mob/living/carbon/injector) if((isxeno(mob) || ishuman(mob)) && tag_flags & INJECTABLE_TAG) diff --git a/code/datums/factions/uscm/cmb.dm b/code/datums/factions/uscm/cmb.dm index 4e86d07c29ae..2ecc3a9327a2 100644 --- a/code/datums/factions/uscm/cmb.dm +++ b/code/datums/factions/uscm/cmb.dm @@ -1,6 +1,6 @@ /datum/faction/uscm/cmb name = "Colonial Marshal Bureau" - code_identificator = FACTION_CMB + code_identificator = FACTION_MARSHAL faction_iff_tag_type = /obj/item/faction_tag/uscm/cmb diff --git a/code/datums/medal_awards.dm b/code/datums/medal_awards.dm index c2be75f482e8..8bfb9772d10f 100644 --- a/code/datums/medal_awards.dm +++ b/code/datums/medal_awards.dm @@ -280,7 +280,7 @@ GLOBAL_LIST_INIT(human_medals, list(MARINE_CONDUCT_MEDAL, MARINE_BRONZE_HEART_ME GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, XENO_SABOTAGE_MEDAL, XENO_PROLIFERATION_MEDAL, XENO_REJUVENATION_MEDAL)) /proc/give_jelly_award(datum/faction/faction, as_admin = FALSE) - if(!hive) + if(!faction) return FALSE if(as_admin && !check_rights(R_ADMIN)) @@ -329,7 +329,7 @@ GLOBAL_LIST_INIT(xeno_medals, list(XENO_SLAUGHTER_MEDAL, XENO_RESILIENCE_MEDAL, var/recipient_ckey = recipient_mob.persistent_ckey var/posthumous = !isliving(recipient_mob) || recipient_mob.stat == DEAD if(!as_admin) // Don't need to check for giver mob in admin mode - for(var/mob/mob in hive.total_mobs) + for(var/mob/mob in faction.total_mobs) if(mob == usr) // Giver: Increment their medals given stat giver_mob = mob diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 73c0f4092c08..b9fd538ae3b3 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -441,8 +441,8 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( var/obj/item/alien_embryo/E = locate(/obj/item/alien_embryo) in src if(E) holder3.icon_state = "infected[E.stage]" - if(E.faction && E.faction.color) - holder3.color = E.faction.color + var/datum/faction/embryo_faction = GLOB.faction_datums[E.faction_to_get] + holder3.color = embryo_faction.color if(stat == DEAD || status_flags & FAKEDEATH) holder2.alpha = 100 @@ -519,7 +519,8 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( /mob/living/carbon/xenomorph/proc/hud_set_marks() if(!client) return - for(var/obj/effect/alien/resin/marker/i in hive.resin_marks) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/obj/effect/alien/resin/marker/i in faction_module.resin_marks) client.images |= i.seenMeaning /mob/living/carbon/xenomorph/proc/hud_set_plasma() @@ -587,7 +588,8 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( holder.overlays.Cut() holder.icon_state = "hudblank" if(stat != DEAD && faction) - var/mob/living/carbon/xenomorph/queen/xeno_queen = faction.living_xeno_queen + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/mob/living/carbon/xenomorph/queen/xeno_queen = faction_module.living_xeno_queen if(xeno_queen && xeno_queen.observed_xeno == src) holder.icon_state = "queen_overwatch" hud_list[QUEEN_OVERWATCH_HUD] = holder @@ -680,7 +682,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( return hud_set_new_player() - F.modify_hud_holder(holder, src) + faction.modify_hud_holder(holder, src) /mob/living/carbon/human/yautja/hud_set_squad() set waitfor = FALSE diff --git a/code/datums/statistics/entities/xeno_stats.dm b/code/datums/statistics/entities/xeno_stats.dm index 9703c8c5e397..50cfe202c55c 100644 --- a/code/datums/statistics/entities/xeno_stats.dm +++ b/code/datums/statistics/entities/xeno_stats.dm @@ -11,7 +11,7 @@ QDEL_LIST(medal_list) /datum/entity/player_stats/xeno/get_playtime(type) - if(!type || type == FACTION_XENOMORPH) + if(!type || type == FACTION_XENOMORPH_NORMAL) return ..() if(!caste_stats_list["[type]"]) return 0 diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm index 6d834cf23f38..8166d5fb4e4b 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost/whiskey_output_waves.dm @@ -7,9 +7,9 @@ if(!istype(wave_data)) return - var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] - if(hive.slashing_allowed != XENO_SLASH_ALLOWED) - hive.slashing_allowed = XENO_SLASH_ALLOWED //Allows harm intent for aliens + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL].get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.slashing_allowed = XENO_SLASH_ALLOWED //Allows harm intent for aliens + faction_module.construction_allowed = XENO_QUEEN var/xenos_to_spawn if(wave_data.wave_type == WO_SCALED_WAVE) xenos_to_spawn = max(count_marines(SSmapping.levels_by_trait(ZTRAIT_GROUND)),5) * wave_data.scaling_factor * WO_SPAWN_MULTIPLIER @@ -59,8 +59,6 @@ var/spawn_loc = pick(xeno_spawns) var/xeno_type = GLOB.RoleAuthority.get_caste_by_text(userInput) var/mob/living/carbon/xenomorph/new_xeno = new xeno_type(spawn_loc) - if(new_xeno.hive.construction_allowed == NORMAL_XENO) - new_xeno.hive.construction_allowed = XENO_QUEEN new_xeno.nocrit(xeno_wave) xeno_pool -= userInput if(isnewplayer(xeno_candidate)) diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index 127cbff90e50..6e337b68640c 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -107,28 +107,28 @@ var/list/hive_spots = list() for(var/hive in hives) var/turf/spot = get_turf(pick(hive_spawns)) - hive_spots[GLOB.hive_datum[hive]] = spot + hive_spots[hive] = spot hive_spawns -= spot - current_hives += GLOB.hive_datum[hive].name + current_hives += GLOB.faction_datums[hive].name - for(var/datum/hive_status/hive in xenomorphs) //Build and move the xenos. - for(var/datum/mind/ghost_mind in xenomorphs[hive]) - transform_xeno(ghost_mind, hive_spots[hive], hive.hivenumber, FALSE) + for(var/faction_to_get in xenomorphs) //Build and move the xenos. + for(var/datum/mind/ghost_mind in xenomorphs[faction_to_get]) + transform_xeno(ghost_mind, hive_spots[faction_to_get], faction_to_get, FALSE) ghost_mind.current.close_spawn_windows() // Have to spawn the queen last or the mind will be added to xenomorphs and double spawned - for(var/datum/hive_status/hive in picked_queens) - transform_queen(picked_queens[hive], hive_spots[hive], hive.hivenumber) - var/datum/mind/M = picked_queens[hive] + for(var/faction_to_get in picked_queens) + transform_queen(picked_queens[faction_to_get], hive_spots[faction_to_get], faction_to_get) + var/datum/mind/M = picked_queens[faction_to_get] M.current.close_spawn_windows() - for(var/datum/hive_status/hive in hive_spots) - var/obj/effect/alien/resin/special/pylon/core/C = new(hive_spots[hive], hive) + for(var/faction_to_get in hive_spots) + var/obj/effect/alien/resin/special/pylon/core/C = new(hive_spots[faction_to_get], GLOB.faction_datums[faction_to_get]) C.hardcore = TRUE // This'll make losing the hive core more detrimental than losing a Queen hive_cores += C -/datum/game_mode/xenovs/proc/transform_xeno(datum/mind/ghost_mind, turf/xeno_turf, hivenumber = FACTION_XENOMORPH_NORMAL, should_spawn_nest = TRUE) +/datum/game_mode/xenovs/proc/transform_xeno(datum/mind/ghost_mind, turf/xeno_turf, faction_to_get = FACTION_XENOMORPH_NORMAL, should_spawn_nest = TRUE) if(should_spawn_nest) var/mob/living/carbon/human/original = ghost_mind.current @@ -150,12 +150,12 @@ var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(original) //Put the initial larva in a host embryo.stage = 5 //Give the embryo a head-start (make the larva burst instantly) - embryo.hivenumber = hivenumber + embryo.faction_to_get = faction_to_get if(original && !original.first_xeno) qdel(original) else - var/mob/living/carbon/xenomorph/larva/L = new(xeno_turf, null, hivenumber) + var/mob/living/carbon/xenomorph/larva/L = new(xeno_turf, null, GLOB.faction_datums[faction_to_get]) ghost_mind.transfer_to(L) /datum/game_mode/xenovs/pick_queen_spawn(mob/player, hivenumber = FACTION_XENOMORPH_NORMAL) @@ -184,8 +184,9 @@ if(++round_checkwin >= 5) //Only check win conditions every 5 ticks. if(world.time > round_time_larva_interval) for(var/hive in hives) - GLOB.hive_datum[hive].stored_larva++ - GLOB.hive_datum[hive].hive_ui.update_burrowed_larva() + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[hive].get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.stored_larva++ + faction_module.hive_ui.update_burrowed_larva() round_time_larva_interval = world.time + hive_larva_interval_gain @@ -202,24 +203,17 @@ /datum/game_mode/xenovs/proc/get_xenos_hive(list/z_levels = SSmapping.levels_by_any_trait(list(ZTRAIT_GROUND, ZTRAIT_RESERVED, ZTRAIT_MARINE_MAIN_SHIP))) - var/list/list/hivenumbers = list() - var/datum/hive_status/HS - for(var/hivenumber in GLOB.hive_datum) - HS = GLOB.hive_datum[hivenumber] - hivenumbers += list(HS.name = list()) - - for(var/mob/M in GLOB.player_list) - if(M.z && (M.z in z_levels) && M.stat != DEAD && !istype(M.loc, /turf/open/space) && !istype(M.loc, /area/adminlevel/ert_station/fax_response_station)) //If they have a z var, they are on a turf. - var/mob/living/carbon/xenomorph/X = M - var/datum/hive_status/hive = GLOB.hive_datum[X.hivenumber] - if(!hive) - continue - - if(istype(X) && is_hive_living(hive)) - hivenumbers[hive.name].Add(X) - + var/list/list/xenos_factions = list() + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!is_hive_living(action.get_faction_module(FACTION_MODULE_HIVE_MIND))) + continue + xenos_factions += list(faction.code_identificator = list()) + for(var/mob/living/carbon/xenomorph/zenomorph in faction.total_mobs) + if(zenomorph.z && (zenomorph.z in z_levels) && !istype(zenomorph.loc, /turf/open/space) && !istype(zenomorph.loc, /area/adminlevel/ert_station/fax_response_station)) + xenos_factions[faction.code_identificator] += zenomorph - return hivenumbers + return xenos_factions /////////////////////////// //Checks to see who won/// diff --git a/code/game/gamemodes/extended/cm_vs_upp.dm b/code/game/gamemodes/extended/cm_vs_upp.dm index a778d53299f1..a1b163518687 100644 --- a/code/game/gamemodes/extended/cm_vs_upp.dm +++ b/code/game/gamemodes/extended/cm_vs_upp.dm @@ -18,4 +18,4 @@ /datum/game_mode/extended/faction_clash/cm_vs_upp/announce() . = ..() faction_announcement("An automated distress call has been received from the local colony.\n\nAlert! Sensors have detected a Union of Progressive People's warship in orbit of colony. Enemy Vessel has refused automated hails and is entering lower-planetary orbit. High likelihood enemy vessel is preparing to deploy dropships to local colony. Authorization to interdict and repel hostile force from allied territory has been granted. Automated thawing of cryostasis marine reserves in progress.", "ARES 3.2", 'sound/AI/commandreport.ogg') - faction_announcement("Alert! Sensors have detected encroaching USCM vessel on an intercept course with local colony.\n\nIntelligence suggests this is the [MAIN_SHIP_NAME]. Confidence is high that USCM force is acting counter to Union interests in this area. Authorization to deploy ground forces to disrupt foreign power attempt to encroach on Union interests has been granted. Emergency awakening of cryostasis troop reserves in progress.", "1VAN/3", 'sound/AI/commandreport.ogg', GLOB.faction_datum[FACTION_UPP]) + faction_announcement("Alert! Sensors have detected encroaching USCM vessel on an intercept course with local colony.\n\nIntelligence suggests this is the [MAIN_SHIP_NAME]. Confidence is high that USCM force is acting counter to Union interests in this area. Authorization to deploy ground forces to disrupt foreign power attempt to encroach on Union interests has been granted. Emergency awakening of cryostasis troop reserves in progress.", "1VAN/3", 'sound/AI/commandreport.ogg', GLOB.faction_datums[FACTION_UPP]) diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 2ebbe3d24f2e..f71529278eb5 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -258,9 +258,9 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou unassigned_players = null // Now we take spare unfilled xeno slots and make them larva NEW - var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] - if(istype(hive) && istype(XJ)) - hive.stored_larva += max(0, (XJ.total_positions - XJ.current_positions) \ + if(istype(XJ)) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL].get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.stored_larva += max(0, (XJ.total_positions - XJ.current_positions) \ + (XJ.calculate_extra_spawn_positions(alternate_option_assigned))) /*===============================================================*/ diff --git a/code/game/machinery/computer/groundside_operations.dm b/code/game/machinery/computer/groundside_operations.dm index ec25f29b9a28..c4017a7e0673 100644 --- a/code/game/machinery/computer/groundside_operations.dm +++ b/code/game/machinery/computer/groundside_operations.dm @@ -242,7 +242,7 @@ if(!is_announcement_active) to_chat(usr, SPAN_WARNING("Please allow at least [COOLDOWN_COMM_MESSAGE*0.1] second\s to pass between announcements.")) return FALSE - if(announcement_faction != FACTION_MARINE && usr.faction != GLOB.faction_datum[announcement_faction]) + if(announcement_faction != FACTION_MARINE && usr.faction != GLOB.faction_datums[announcement_faction]) to_chat(usr, SPAN_WARNING("Access denied.")) return var/input = stripped_multiline_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement", "") @@ -260,7 +260,7 @@ signed = "[paygrade] [id.registered_name]" - faction_announcement(input, announcement_title, faction_to_display = GLOB.faction_datum[announcement_faction], signature = signed) + faction_announcement(input, announcement_title, faction_to_display = GLOB.faction_datums[announcement_faction], signature = signed) addtimer(CALLBACK(src, PROC_REF(reactivate_announcement), usr), COOLDOWN_COMM_MESSAGE) message_admins("[key_name(usr)] has made a command announcement.") log_announcement("[key_name(usr)] has announced the following: [input]") diff --git a/code/game/objects/items/devices/cictablet.dm b/code/game/objects/items/devices/cictablet.dm index dfd24b425d61..59cbf6635fef 100644 --- a/code/game/objects/items/devices/cictablet.dm +++ b/code/game/objects/items/devices/cictablet.dm @@ -55,7 +55,7 @@ /obj/item/device/cotablet/ui_static_data(mob/user) var/list/data = list() - data["faction"] = GLOB.faction_datum[announcement_faction].name + data["faction"] = GLOB.faction_datums[announcement_faction].name data["cooldown_message"] = cooldown_between_messages data["distresstimelock"] = DISTRESS_TIME_LOCK @@ -115,7 +115,7 @@ var/paygrade = get_paygrades(id.paygrade, FALSE, human_user.gender) signed = "[paygrade] [id.registered_name]" - faction_announcement(input, announcement_title, faction_to_display = GLOB.faction_datum[announcement_faction], signature = signed) + faction_announcement(input, announcement_title, faction_to_display = GLOB.faction_datums[announcement_faction], signature = signed) message_admins("[key_name(user)] has made a command announcement.") log_announcement("[key_name(user)] has announced the following: [input]") COOLDOWN_START(src, announcement_cooldown, cooldown_between_messages) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 36f4776e4c66..d86e5a017f2f 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -55,8 +55,7 @@ return ..() // We don't have backpack sprites for xenoids (yet?) var/mob/living/carbon/xenomorph/xeno = target_mob if(target_mob.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)) + if(!xeno.ally_faction(user.faction)) 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 strap \the [src] onto [target_mob] but instead gets a tail swipe to the head!")) diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index dc4dfe574501..f8be8916080b 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -149,7 +149,8 @@ if(isxeno(user)) var/mob/living/carbon/xenomorph/X = user - if(!X.faction.unnesting_allowed && !isxeno_builder(X) && X.ally_faction(GLOB.faction_datums[faction_to_get])) + var/datum/faction_module/hive_mind/faction_module = X.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.unnesting_allowed && !isxeno_builder(X) && X.ally_faction(GLOB.faction_datums[faction_to_get])) to_chat(X, SPAN_XENOWARNING("We shouldn't interfere with the nest, leave that to the drones.")) return else if(iscarbon(user)) diff --git a/code/modules/admin/player_panel/player_panel.dm b/code/modules/admin/player_panel/player_panel.dm index dd970f87112d..c33b9d385b63 100644 --- a/code/modules/admin/player_panel/player_panel.dm +++ b/code/modules/admin/player_panel/player_panel.dm @@ -515,9 +515,9 @@ GLOBAL_LIST_INIT(pp_hives, pp_generate_hives()) /proc/pp_generate_hives() . = list() - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/H = GLOB.hive_datum[hivenumber] - .[H.name] = H.hivenumber + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + .[faction.name] = faction.faction_name GLOBAL_LIST_INIT(pp_limbs, list( "Head" = "head", diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index b4bf1055eff9..01c215745910 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -878,7 +878,7 @@ /datum/admins/var/create_xenos_html = null /datum/admins/proc/create_xenos(mob/user) if(!create_xenos_html) - var/hive_types = jointext(ALL_XENO_HIVES, ";") + var/hive_types = jointext(FACTION_LIST_XENOMORPH, ";") var/xeno_types = jointext(ALL_XENO_CASTES, ";") create_xenos_html = file2text('html/create_xenos.html') create_xenos_html = replacetext(create_xenos_html, "null /* hive paths */", "\"[hive_types]\"") diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 1e81f61144d7..c379ab58f3b1 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -823,10 +823,9 @@ return var/list/hives = list() - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - hives += list("[hive.name]" = hive.hivenumber) + for(var/hivenumber in GLOB.faction_datums) + var/datum/faction/hive = GLOB.faction_datums[hivenumber] + hives += list("[hive.name]" = hive.code_identificator) var/newhive = tgui_input_list(usr,"Select a hive.", "Infect Larva", hives) @@ -835,8 +834,7 @@ return var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(H) - embryo.hivenumber = hives[newhive] - embryo.faction = newhive + embryo.faction_to_get = hives[newhive] message_admins("[key_name_admin(usr)] infected [key_name_admin(H)] with a xeno ([newhive]) larva.") diff --git a/code/modules/admin/topic/topic_events.dm b/code/modules/admin/topic/topic_events.dm index b03d76069962..ae927c898e3a 100644 --- a/code/modules/admin/topic/topic_events.dm +++ b/code/modules/admin/topic/topic_events.dm @@ -108,14 +108,14 @@ if(isnull(permit_recipients[1])) //Cancel button. return if("Hive") - permit_hives += GLOB.hive_datum[tgui_input_list(usr, "Select recipient hive:", "Armed Hive", GLOB.hive_datum)] + permit_hives += GLOB.faction_datums[tgui_input_list(usr, "Select recipient hive:", "Armed Hive", GLOB.faction_datums)] if(isnull(permit_hives[1])) //Cancel button. return permit_recipients = permit_hives[1].totalXenos.Copy() if("All Xenos") permit_recipients = GLOB.living_xeno_list.Copy() - for(var/H in GLOB.hive_datum) - permit_hives += GLOB.hive_datum[H] + for(var/H in GLOB.faction_datums) + permit_hives += GLOB.faction_datums[H] var/list/handled_xenos = list() diff --git a/code/modules/admin/verbs/mob_verbs.dm b/code/modules/admin/verbs/mob_verbs.dm index ccab298d4750..3ec2d299f06d 100644 --- a/code/modules/admin/verbs/mob_verbs.dm +++ b/code/modules/admin/verbs/mob_verbs.dm @@ -355,15 +355,18 @@ X.set_hive_and_update(factions[choice]) else var/was_leader = FALSE + var/datum/faction_module/hive_mind/faction_module if(H.faction) - if(H == H.faction.leading_cult_sl) + faction_module = H.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(H == faction_module.leading_cult_sl) was_leader = TRUE - H.faction.leading_cult_sl = null + faction_module.leading_cult_sl = null factions[choice].add_mob(H) - if(was_leader && (!H.faction.leading_cult_sl || H.faction.leading_cult_sl.stat == DEAD)) - H.faction.leading_cult_sl = H + faction_module = H.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(was_leader && (!faction_module.leading_cult_sl || faction_module.leading_cult_sl.stat == DEAD)) + faction_module.leading_cult_sl = H message_admins("[key_name(src)] changed faction of [H] to [choice].") diff --git a/code/modules/cm_tech/implements/xeno_handler.dm b/code/modules/cm_tech/implements/xeno_handler.dm index d3340ffcdff8..24f994d6a7b0 100644 --- a/code/modules/cm_tech/implements/xeno_handler.dm +++ b/code/modules/cm_tech/implements/xeno_handler.dm @@ -16,7 +16,7 @@ /datum/emergency_call/xeno_handler/spawn_items() var/turf/drop_spawn = get_spawn_point(TRUE) if(istype(drop_spawn)) - new /obj/effect/alien/weeds/node(drop_spawn, null, null, GLOB.hive_datum[XENO_HIVE_TAMED]) //drop some weeds for xeno plasma regen. + new /obj/effect/alien/weeds/node(drop_spawn, null, null, GLOB.faction_datums[FACTION_XENOMORPH_TAMED]) //drop some weeds for xeno plasma regen. /datum/emergency_call/xeno_handler/create_member(datum/mind/M, turf/override_spawn_loc) var/turf/spawn_loc = override_spawn_loc ? override_spawn_loc : get_spawn_point() @@ -24,23 +24,21 @@ if(!istype(spawn_loc)) return //Didn't find a useable spawn point. - var/datum/hive_status/corrupted/tamed/hive = GLOB.hive_datum[XENO_HIVE_TAMED] - + var/datum/faction/tamed_hive = GLOB.faction_datums[FACTION_XENOMORPH_TAMED] var/mob/living/carbon/new_mob if(!leader) new_mob = new/mob/living/carbon/human(spawn_loc) new_mob.create_hud() arm_equipment(new_mob, /datum/equipment_preset/pmc/xeno_handler, TRUE, TRUE) - hive.make_leader(new_mob) + var/datum/faction_module/hive_mind/faction_module = tamed_hive.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.make_leader(new_mob) leader = new_mob - - else var/picked = pick(/mob/living/carbon/xenomorph/drone, /mob/living/carbon/xenomorph/spitter, /mob/living/carbon/xenomorph/lurker) - new_mob = new picked(spawn_loc, null, XENO_HIVE_TAMED) + new_mob = new picked(spawn_loc, null, tamed_hive) var/mob/living/carbon/xenomorph/X = new_mob - X.iff_tag = new /obj/item/iff_tag/pmc_handler(X) + X.faction_tag = new /obj/item/faction_tag/wy/pmc_handler(X, GLOB.faction_datums[FACTION_USCM]) if(M) M.transfer_to(new_mob, TRUE) else diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index 39eef453f0a9..f7a526bbb20a 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -786,7 +786,7 @@ /datum/equipment_preset/other/xeno_cultist name = "Cultist - Xeno Cultist" - job_faction = FACTION_XENOMORPH + job_faction = FACTION_XENOMORPH_NORMAL flags = EQUIPMENT_PRESET_EXTRA idtype = /obj/item/card/id/lanyard skills = /datum/skills/civilian/survivor diff --git a/code/modules/gear_presets/synths.dm b/code/modules/gear_presets/synths.dm index 9f1e39f4fa46..ec75226da877 100644 --- a/code/modules/gear_presets/synths.dm +++ b/code/modules/gear_presets/synths.dm @@ -750,7 +750,7 @@ /datum/equipment_preset/synth/survivor/cultist_synth name = "Cultist - Xeno Cultist Synthetic" - job_faction = FACTION_XENOMORPH + job_faction = FACTION_XENOMORPH_NORMAL minimap_icon = "cult_synth" minimap_background = "background_cultist" @@ -780,7 +780,7 @@ /datum/equipment_preset/synth/survivor/midwife name = "Fun - Xeno Cultist Midwife (Synthetic)" - job_faction = FACTION_XENOMORPH + job_faction = FACTION_XENOMORPH_NORMAL /datum/equipment_preset/synth/survivor/midwife/load_gear(mob/living/carbon/human/new_human) var/back_item = /obj/item/storage/backpack/marine/satchel/medic diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 2ca56fa43004..50de241c57e7 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -48,6 +48,8 @@ if(stat == DEAD) return 0 + faction.remove_mob(src) + if(!gibbed) visible_message("[src.name] [deathmessage]") diff --git a/code/modules/mob/language/languages.dm b/code/modules/mob/language/languages.dm index 9af698daa511..4142dfb9ec8f 100644 --- a/code/modules/mob/language/languages.dm +++ b/code/modules/mob/language/languages.dm @@ -151,10 +151,11 @@ if(iscarbon(speaker)) var/mob/living/carbon/C = speaker - if(!(C.hivenumber in GLOB.hive_datum)) + var/datum/faction_module/hive_mind/faction_module = speaker.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!istype(faction_module)) return - C.hivemind_broadcast(message, GLOB.hive_datum[C.hivenumber]) + C.hivemind_broadcast(message, faction_module) /datum/language/apollo name = LANGUAGE_APOLLO diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index 56cac8cff420..81cdaba67c67 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -9,7 +9,7 @@ var/stage = 0 var/counter = 0 //How developed the embryo is, if it ages up highly enough it has a chance to burst var/larva_autoburst_countdown = 20 //to kick the larva out - var/faction_to_get = FACTION_XENOMORPH + var/faction_to_get = FACTION_XENOMORPH_NORMAL var/flags_embryo = FALSE // Used in /ciphering/predator property /// The ckey of any player hugger that made this embryo var/hugger_ckey diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index 645a75e7a72d..41cede46d5cd 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -121,7 +121,6 @@ if(jobban_isbanned(src, XENO_CASTE_QUEEN)) to_chat(src, SPAN_WARNING("You are jobbanned from the Queen role.")) return - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.living_xeno_queen) to_chat(src, SPAN_WARNING("There already is a Queen.")) return @@ -149,7 +148,6 @@ var/area/xeno_area = get_area(new_xeno) if(!should_block_game_interaction(new_xeno) || (xeno_area.flags_atom & AREA_ALLOW_XENO_JOIN)) - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) switch(new_xeno.tier) //They have evolved, add them to the slot count IF they are in regular game space if(2) faction_module.tier_2_xenos |= new_xeno @@ -184,8 +182,6 @@ new_xeno.visible_message(SPAN_XENODANGER("A [new_xeno.caste.caste_type] emerges from the husk of \the [src]."), \ SPAN_XENODANGER("We emerge in a greater form from the husk of our old body. For the hive!")) - - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.living_xeno_queen && faction_module.living_xeno_queen.observed_xeno == src) faction_module.living_xeno_queen.overwatch(new_xeno) @@ -404,7 +400,7 @@ var/burrowed_factor = min(faction_module.stored_larva, sqrt(4*faction_module.stored_larva)) var/totalXenos = floor(burrowed_factor) - for(var/mob/living/carbon/xenomorph/xeno as anything in hive.total_mobs) + for(var/mob/living/carbon/xenomorph/xeno as anything in faction.total_mobs) if(xeno.counts_for_slots) totalXenos++ diff --git a/code/modules/mob/living/carbon/xenomorph/Powers.dm b/code/modules/mob/living/carbon/xenomorph/Powers.dm index 7ac8170bec4b..60edb2dad917 100644 --- a/code/modules/mob/living/carbon/xenomorph/Powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Powers.dm @@ -173,26 +173,28 @@ return var/current_area_name = get_area_name(current_turf) - var/obj/effect/alien/resin/construction/new_structure = new(current_turf, hive) + var/obj/effect/alien/resin/construction/new_structure = new(current_turf, faction) new_structure.set_template(structure_template) - hive.add_construction(new_structure) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.add_construction(new_structure) - var/max_constructions = hive.hive_structures_limit[structure_template.name] - var/remaining_constructions = max_constructions - hive.get_structure_count(structure_template.name) + var/max_constructions = faction_module.hive_structures_limit[structure_template.name] + var/remaining_constructions = max_constructions - faction_module.get_structure_count(structure_template.name) visible_message(SPAN_XENONOTICE("A thick substance emerges from the ground and shapes into \a [new_structure]."), \ SPAN_XENONOTICE("We designate a new [structure_template] construction. ([remaining_constructions]/[max_constructions] remaining)"), null, 5) playsound(new_structure, "alien_resin_build", 25) - if(hive.living_xeno_queen) - xeno_message("Hive: A new [structure_template] construction has been designated at [sanitize_area(current_area_name)]!", 3, hivenumber) + if(faction_module.living_xeno_queen) + xeno_message("Hive: A new [structure_template] construction has been designated at [sanitize_area(current_area_name)]!", 3, faction) /mob/living/carbon/xenomorph/proc/make_marker(turf/target_turf) if(!target_turf) return FALSE var/found_weeds = FALSE + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!selected_mark) to_chat(src, SPAN_NOTICE("We must have a meaning for the mark before you can make it.")) - hive.mark_ui.open_mark_menu(src) + faction_module.mark_ui.open_mark_menu(src) return FALSE if(target_turf.z != src.z) to_chat(src, SPAN_NOTICE("We have no psychic presence on that world.")) @@ -216,10 +218,10 @@ NM.color = "#7a21c4" else NM.color = "#db6af1" - if(hive.living_xeno_queen) + if(faction_module.living_xeno_queen) var/current_area_name = get_area_name(target_turf) - for(var/mob/living/carbon/xenomorph/X in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction.total_mobs) to_chat(X, SPAN_XENOANNOUNCE("[src.name] has declared: [NM.mark_meaning.desc] in [sanitize_area(current_area_name)]! (Watch) (Track)")) //this is killing the tgui chat and I dont know why return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm b/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm index 3694c2a0357d..4494e3d1d9fd 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm @@ -32,7 +32,7 @@ var/obj/item/storage/backpack = back if(backpack && !M.action_busy) if(stat != DEAD) // If the Xeno is alive, fight back - if(!M.ally_of_hivenumber(hivenumber)) + if(!M.ally_faction(faction)) M.KnockDown(rand(caste.tacklestrength_min, caste.tacklestrength_max)) playsound(M.loc, 'sound/weapons/pierce.ogg', 25, TRUE) M.visible_message(SPAN_WARNING("\The [M] tried to open \the [backpack] on [src] but instead gets a tail swipe to the head!")) @@ -68,7 +68,7 @@ M.animation_attack_on(src) M.flick_attack_overlay(src, "disarm") //friendly lessers, huggers and larva can be pushed around - if(M.ally_of_hivenumber(hivenumber) && mob_size < MOB_SIZE_XENO_SMALL && prob(85)) + if(M.ally_faction(faction) && mob_size < MOB_SIZE_XENO_SMALL && prob(85)) playsound(loc, 'sound/weapons/alien_knockdown.ogg', 25, 1) M.visible_message(SPAN_DANGER("[M] shoves [src]!"), null, null, 5, CHAT_TYPE_COMBAT_ACTION) apply_effect(1, WEAKEN) @@ -201,7 +201,7 @@ M.animation_attack_on(src) M.flick_attack_overlay(src, "disarm") var/is_shover_queen = isqueen(M) - var/can_resist_shove = M.hivenumber != src.hivenumber || ((isqueen(src) || IS_XENO_LEADER(src)) && !is_shover_queen) + var/can_resist_shove = M.faction != faction || ((isqueen(src) || IS_XENO_LEADER(src)) && !is_shover_queen) var/can_mega_shove = is_shover_queen || IS_XENO_LEADER(M) if(can_mega_shove && !can_resist_shove || (mob_size < MOB_SIZE_XENO_SMALL && M.mob_size >= MOB_SIZE_XENO_SMALL)) playsound(loc, 'sound/weapons/alien_knockdown.ogg', 25, 1) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 3c6be5c5d539..450316a2a723 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -48,7 +48,7 @@ hud_possible = list(HEALTH_HUD_XENO, PLASMA_HUD, PHEROMONE_HUD, QUEEN_OVERWATCH_HUD, ARMOR_HUD_XENO, XENO_STATUS_HUD, XENO_BANISHED_HUD, XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE, HUNTER_HUD, NEW_PLAYER_HUD) unacidable = TRUE rebounds = TRUE - faction = FACTION_XENOMORPH + faction = FACTION_XENOMORPH_NORMAL gender = NEUTER icon_size = 48 black_market_value = KILL_MENDOZA @@ -342,12 +342,7 @@ /// If TRUE, the xeno cannot slash anything var/cannot_slash = FALSE -/mob/living/carbon/xenomorph/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, hivenumber) - if(old_xeno && old_xeno.hivenumber) - src.hivenumber = old_xeno.hivenumber - else if(hivenumber) - src.hivenumber = hivenumber - +/mob/living/carbon/xenomorph/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, datum/faction/faction_to_set) //putting the organ in for research if(organ_value != 0) var/obj/item/organ/xeno/organ = new() //give @@ -358,10 +353,6 @@ set_languages(list(LANGUAGE_XENOMORPH, LANGUAGE_HIVEMIND)) // The hive may alter this list - var/datum/hive_status/hive = GLOB.hive_datum[src.hivenumber] - if(hive) - hive.add_xeno(src) - wound_icon_holder = new(null, src) vis_contents += wound_icon_holder @@ -391,14 +382,19 @@ old_xeno.drop_inv_item_on_ground(item) old_xeno.empty_gut() - if(old_xeno.iff_tag) - iff_tag = old_xeno.iff_tag - iff_tag.forceMove(src) - old_xeno.iff_tag = null + old_xeno.faction.add_mob(src) + if(old_xeno.organ_faction_tag) + organ_faction_tag = old_xeno.organ_faction_tag + organ_faction_tag.forceMove(src) + old_xeno.faction_tag = null - if(hive) - for(var/trait in hive.hive_inherant_traits) - ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) + if(old_xeno.faction_tag) + faction_tag = old_xeno.faction_tag + faction_tag.forceMove(src) + old_xeno.faction_tag = null + + else if(faction_to_set) + faction = faction_to_set //Set caste stuff if(caste_type && GLOB.xeno_datum_list[caste_type]) @@ -457,12 +453,21 @@ . = ..() - //Set leader to the new mob - if(old_xeno && hive && IS_XENO_LEADER(old_xeno)) - hive.replace_hive_leader(old_xeno, src) + faction.add_mob(src) + if(!organ_faction_tag && faction.organ_faction_iff_tag_type) + organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) + + for(var/trait in faction.hive_inherant_traits) + ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) + + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + + //Set leader to the new mob + if(IS_XENO_LEADER(old_xeno)) + faction_module.replace_hive_leader(old_xeno, src) //Begin SStracking - SStracking.start_tracking("hive_[src.hivenumber]", src) + SStracking.start_tracking("hive_[faction.code_identificator]", src) //WO GAMEMODE if(SSticker?.mode?.hardcore) @@ -470,7 +475,7 @@ time_of_birth = world.time //Minimap - if(z && hivenumber != XENO_HIVE_TUTORIAL) + if(z && faction.code_identificator != XENO_HIVE_TUTORIAL) INVOKE_NEXT_TICK(src, PROC_REF(add_minimap_marker)) //Sight @@ -484,9 +489,9 @@ lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE // Only handle free slots if the xeno is not in tdome - if(hive && !should_block_game_interaction(src)) + if(!should_block_game_interaction(src)) var/selected_caste = GLOB.xeno_datum_list[caste_type]?.type - hive.used_slots[selected_caste]++ + faction_module.used_slots[selected_caste]++ //Statistics var/area/current_area = get_area(src) @@ -496,8 +501,8 @@ GLOB.round_statistics.track_new_participant(faction, 1) // This can happen if a xeno gets made before the game starts - if (hive && hive.hive_ui) - hive.hive_ui.update_all_xeno_data() + if(faction_module.hive_ui) + faction_module.hive_ui.update_all_xeno_data() Decorate() @@ -562,15 +567,10 @@ //We don't have a nicknumber yet, assign one to stick with us if(!nicknumber) generate_and_set_nicknumber() - // Even if we don't have the hive datum we usually still have the hive number - var/datum/hive_status/in_hive = hive - if(!in_hive) - in_hive = GLOB.hive_datum[hivenumber] - //Im putting this in here, because this proc gets called when a player inhabits a SSD xeno and it needs to go somewhere (sorry) hud_set_marks() - var/name_prefix = in_hive.prefix + var/name_prefix = faction.prefix var/name_client_prefix = "" var/name_client_postfix = "" var/number_decorator = "" @@ -580,7 +580,7 @@ age_xeno() full_designation = "[name_client_prefix][nicknumber][name_client_postfix]" if(!HAS_TRAIT(src, TRAIT_NO_COLOR)) - color = in_hive.color + color = faction.color var/age_display = show_age_prefix ? age_prefix : "" var/name_display = "" @@ -595,7 +595,8 @@ change_real_name(src, name) // Since we updated our name we should update the info in the UI - in_hive.hive_ui.update_xeno_info() + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.update_xeno_info() /mob/living/carbon/xenomorph/proc/set_lighting_alpha_from_prefs(client/xeno_client) var/vision_level = xeno_client?.prefs?.xeno_vision_level_pref @@ -666,15 +667,16 @@ if(isxeno(user)) var/mob/living/carbon/xenomorph/xeno = user - if(hivenumber != xeno.hivenumber) - . += "It appears to belong to [hive?.name ? "the [hive.name]" : "a different hive"]." + if(faction != xeno.faction) + . += "It appears to belong to [organ_faction_tag ? "the [organ_faction_tag.faction]" : "a different hive"]." if(isxeno(user) || isobserver(user)) if(strain) . += "It has specialized into a [strain.name]." - if(iff_tag) + if(faction_tag) . += SPAN_NOTICE("It has an IFF tag sticking out of its carapace.") + if(organ_removed) . += "It seems to have its carapace cut open." @@ -689,10 +691,11 @@ if(mind) mind.name = name //Grabs the name when the xeno is getting deleted, to reference through hive status later. if(IS_XENO_LEADER(src)) //Strip them from the Xeno leader list, if they are indexed in here - hive.remove_hive_leader(src, light_mode = TRUE) - SStracking.stop_tracking("hive_[hivenumber]", src) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.remove_hive_leader(src, light_mode = TRUE) + + SStracking.stop_tracking("hive_[faction.code_identificator]", src) - hive?.remove_xeno(src) remove_from_all_mob_huds() observed_xeno = null @@ -715,8 +718,6 @@ vis_contents -= backpack_icon_holder QDEL_NULL(backpack_icon_holder) - QDEL_NULL(iff_tag) - if(hardcore) attack_log?.Cut() // Completely clear out attack_log to limit mem usage if we fail to delete @@ -750,7 +751,7 @@ return TRUE if(has_species(puller,"Human")) // If the Xeno is alive, fight back against a grab/pull var/mob/living/carbon/human/H = puller - if(H.ally_of_hivenumber(hivenumber)) + if(H.ally_faction(faction)) return TRUE puller.apply_effect(rand(caste.tacklestrength_min,caste.tacklestrength_max), WEAKEN) playsound(puller.loc, 'sound/weapons/pierce.ogg', 25, 1) @@ -758,7 +759,7 @@ return FALSE if(issynth(puller) && (mob_size >= 4 || istype(src, /mob/living/carbon/xenomorph/warrior))) var/mob/living/carbon/human/synthetic/puller_synth = puller - if(puller_synth.ally_of_hivenumber(hivenumber)) + if(puller_synth.ally_faction(faction)) return TRUE puller.apply_effect(1, DAZE) shake_camera(puller, 2, 1) @@ -815,17 +816,19 @@ return pull_multiplier //Call this function to set the hive and do other cleanup -/mob/living/carbon/xenomorph/proc/set_hive_and_update(new_hivenumber = FACTION_XENOMORPH_NORMAL) - var/datum/hive_status/new_hive = GLOB.hive_datum[new_hivenumber] - if(!new_hive) - return FALSE +/mob/living/carbon/xenomorph/proc/set_hive_and_update(new_faction_code = FACTION_XENOMORPH_NORMAL) + var/datum/faction/new_faction + if(istype(new_faction_code, /datum/faction)) + new_faction = new_faction_code + else + new_faction = GLOB.faction_datums[new_faction_code] for(var/trait in _status_traits) // They can't keep getting away with this!!! REMOVE_TRAIT(src, trait, TRAIT_SOURCE_HIVE) - new_hive.add_xeno(src) + new_faction.add_mob(src) - for(var/trait in new_hive.hive_inherant_traits) + for(var/trait in new_faction.hive_inherant_traits) ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) generate_name() @@ -837,7 +840,8 @@ recalculate_everything() // Update the hive status UI - new_hive.hive_ui.update_all_xeno_data() + var/datum/faction_module/hive_mind/faction_module = new_faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.update_all_xeno_data() return TRUE @@ -853,8 +857,9 @@ recalculate_pheromones() recalculate_maturation() update_icon_source() - if(hive && hive.living_xeno_queen && hive.living_xeno_queen == src) - hive.recalculate_hive() //Recalculating stuff around Queen maturing + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen && faction_module.living_xeno_queen == src) + faction_module.recalculate_hive() //Recalculating stuff around Queen maturing /mob/living/carbon/xenomorph/proc/recalculate_stats() @@ -980,9 +985,10 @@ if(stat == DEAD && !QDELETED(src)) GLOB.living_xeno_list += src - if(hive) - hive.add_xeno(src) - hive.hive_ui.update_all_xeno_data() + if(faction) + faction.add_mob(src) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.update_all_xeno_data() armor_integrity = 100 UnregisterSignal(src, COMSIG_XENO_PRE_HEAL) @@ -1098,13 +1104,13 @@ ///Generate a new unused nicknumber for the current hive, if hive doesn't exist return 0 /mob/living/carbon/xenomorph/proc/generate_and_set_nicknumber() - if(!hive) + if(!faction) //If hive doesn't exist make it 0 nicknumber = 0 return - var/datum/hive_status/hive_status = hive - if(length(hive_status.available_nicknumbers)) - nicknumber = pick_n_take(hive_status.available_nicknumbers) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(length(faction_module.available_nicknumbers)) + nicknumber = pick_n_take(faction_module.available_nicknumbers) else //If we somehow use all 999 numbers fallback on 0 nicknumber = 0 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index b0bb8af0c0b9..44d596057bff 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -167,13 +167,13 @@ atom.attack_larva(src) xeno_attack_delay(src) //Adds some lag to the 'attack' -/proc/spawn_hivenumber_larva(atom/atom, hivenumber) - if(!GLOB.hive_datum[hivenumber] || isnull(atom)) +/proc/spawn_hivenumber_larva(atom/atom, datum/faction/faction) + if(!faction || isnull(atom)) return var/mob/living/carbon/xenomorph/larva/larva = new /mob/living/carbon/xenomorph/larva(atom) - larva.set_hive_and_update(hivenumber) + larva.set_hive_and_update(faction) return larva diff --git a/code/modules/mob/living/carbon/xenomorph/death.dm b/code/modules/mob/living/carbon/xenomorph/death.dm index f3de3d5205b9..683332d2069c 100644 --- a/code/modules/mob/living/carbon/xenomorph/death.dm +++ b/code/modules/mob/living/carbon/xenomorph/death.dm @@ -26,6 +26,7 @@ hud_used.alien_plasma_display.icon_state = "power_display_empty" update_icons() + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!should_block_game_interaction(src)) //so xeno players don't get death messages from admin tests if(isqueen(src)) var/mob/living/carbon/xenomorph/queen/XQ = src @@ -35,17 +36,17 @@ if(XQ.ovipositor) XQ.dismount_ovipositor(TRUE) - if(GLOB.hive_datum[hivenumber].stored_larva) - GLOB.hive_datum[hivenumber].stored_larva = floor(GLOB.hive_datum[hivenumber].stored_larva * 0.5) //Lose half on dead queen + if(faction_module.stored_larva) + faction_module.stored_larva = floor(faction_module.stored_larva * 0.5) //Lose half on dead queen - var/list/players_with_xeno_pref = get_alien_candidates(GLOB.hive_datum[hivenumber]) - if(players_with_xeno_pref && istype(GLOB.hive_datum[hivenumber].hive_location, /obj/effect/alien/resin/special/pylon/core)) - var/turf/larva_spawn = get_turf(GLOB.hive_datum[hivenumber].hive_location) + var/list/players_with_xeno_pref = get_alien_candidates(faction) + if(players_with_xeno_pref && istype(faction_module.hive_location, /obj/effect/alien/resin/special/pylon/core)) + var/turf/larva_spawn = get_turf(faction_module.hive_location) var/count = 0 - while(GLOB.hive_datum[hivenumber].stored_larva > 0 && count < length(players_with_xeno_pref)) // still some left + while(faction_module.stored_larva > 0 && count < length(players_with_xeno_pref)) // still some left var/mob/xeno_candidate = players_with_xeno_pref[++count] var/mob/living/carbon/xenomorph/larva/new_xeno = new /mob/living/carbon/xenomorph/larva(larva_spawn) - new_xeno.set_hive_and_update(hivenumber) + new_xeno.set_hive_and_update(faction) new_xeno.generate_name() if(!SSticker.mode.transfer_xeno(xeno_candidate, new_xeno)) @@ -55,25 +56,25 @@ new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly burrows out of the ground!"), SPAN_XENODANGER("You burrow out of the ground after feeling an immense tremor through the hive, which quickly fades into complete silence...")) - GLOB.hive_datum[hivenumber].stored_larva-- - GLOB.hive_datum[hivenumber].hive_ui.update_burrowed_larva() + faction_module.stored_larva-- + faction_module.hive_ui.update_burrowed_larva() if(count) message_alien_candidates(players_with_xeno_pref, dequeued = count) - if(hive && hive.living_xeno_queen == src) + if(faction_module.living_xeno_queen == src) notify_ghosts(header = "Queen Death", message = "The Queen has been slain!", source = src, action = NOTIFY_ORBIT) - xeno_message(SPAN_XENOANNOUNCE("A sudden tremor ripples through the hive... the Queen has been slain! Vengeance!"),3, hivenumber) - hive.slashing_allowed = XENO_SLASH_ALLOWED - hive.set_living_xeno_queen(null) + xeno_message(SPAN_XENOANNOUNCE("A sudden tremor ripples through the hive... the Queen has been slain! Vengeance!"), 3, faction) + faction_module.slashing_allowed = XENO_SLASH_ALLOWED + faction_module.set_living_xeno_queen(null) //on the off chance there was somehow two queen alive for(var/mob/living/carbon/xenomorph/queen/Q in GLOB.living_xeno_list) - if(!QDELETED(Q) && Q != src && Q.hivenumber == hivenumber) - hive.set_living_xeno_queen(Q) + if(!QDELETED(Q) && Q != src && Q.faction == faction) + faction_module.set_living_xeno_queen(Q) break - hive.on_queen_death() - hive.handle_xeno_leader_pheromones() + faction_module.on_queen_death() + faction_module.handle_xeno_leader_pheromones() if(SSticker.mode) - INVOKE_ASYNC(SSticker.mode, TYPE_PROC_REF(/datum/game_mode, check_queen_status), hivenumber) + INVOKE_ASYNC(SSticker.mode, TYPE_PROC_REF(/datum/game_mode, check_queen_status), faction) LAZYADD(SSticker.mode.dead_queens, "
[!isnull(full_designation) ? full_designation : "?"] was [src] [SPAN_BOLDNOTICE("(DIED)")]") else if(ispredalien(src)) @@ -83,14 +84,14 @@ else playsound(loc, prob(50) == 1 ? 'sound/voice/alien_death.ogg' : 'sound/voice/alien_death2.ogg', 25, 1) var/area/A = get_area(src) - if(hive && hive.living_xeno_queen) + if(faction_module.living_xeno_queen) if(!HAS_TRAIT(src, TRAIT_TEMPORARILY_MUTED)) - xeno_message("Hive: [src] has died[A? " at [sanitize_area(A.name)]":""]! [banished ? "They were banished from the hive." : ""]", death_fontsize, hivenumber) + xeno_message("Hive: [src] has died[A? " at [sanitize_area(A.name)]":""]! [banished ? "They were banished from the hive." : ""]", death_fontsize, faction) - if(hive && IS_XENO_LEADER(src)) //Strip them from the Xeno leader list, if they are indexed in here - hive.remove_hive_leader(src) - if(hive.living_xeno_queen) - to_chat(hive.living_xeno_queen, SPAN_XENONOTICE("A leader has fallen!")) //alert queens so they can choose another leader + if(IS_XENO_LEADER(src)) //Strip them from the Xeno leader list, if they are indexed in here + faction_module.remove_hive_leader(src) + if(faction_module.living_xeno_queen) + to_chat(faction_module.living_xeno_queen, SPAN_XENONOTICE("A leader has fallen!")) //alert queens so they can choose another leader hud_update() //updates the overwatch hud to remove the upgrade chevrons, gold star, etc SSminimaps.remove_marker(src) @@ -105,32 +106,30 @@ // Banished xeno provide a burrowed larva on death to compensate if(banished && refunds_larva_if_banished) - GLOB.hive_datum[hivenumber].stored_larva++ - GLOB.hive_datum[hivenumber].hive_ui.update_burrowed_larva() + faction_module.stored_larva++ + faction_module.hive_ui.update_burrowed_larva() if(hardcore) QDEL_IN(src, 3 SECONDS) else if(!gibbed) AddComponent(/datum/component/weed_food) - if(hive) - hive.remove_xeno(src) - // Finding the last xeno for anti-delay. - if(SSticker.mode && SSticker.current_state != GAME_STATE_FINISHED) - if((GLOB.last_ares_callout + 2 MINUTES) > world.time) - return - if(hive.hivenumber == FACTION_XENOMORPH_NORMAL && (LAZYLEN(hive.totalXenos) == 1)) - var/mob/living/carbon/xenomorph/X = LAZYACCESS(hive.totalXenos, 1) - GLOB.last_ares_callout = world.time - // Tell the marines where the last one is. - var/name = "[MAIN_AI_SYSTEM] Bioscan Status" - var/input = "Bioscan complete.\n\nSensors indicate one remaining unknown lifeform signature in [get_area(X)]." - log_ares_bioscan(name, input) - faction_announcement(input, name, 'sound/AI/bioscan.ogg', logging = ARES_LOG_NONE) - // Tell the xeno she is the last one. - if(X.client) - to_chat(X, SPAN_XENOANNOUNCE("Your carapace rattles with dread. You are all that remains of the hive!")) - notify_ghosts(header = "Last Xenomorph", message = "There is only one Xenomorph left: [X.name].", source = X, action = NOTIFY_ORBIT) + // Finding the last xeno for anti-delay. + if(SSticker.mode && SSticker.current_state != GAME_STATE_FINISHED) + if((GLOB.last_ares_callout + 2 MINUTES) > world.time) + return + if(faction.code_identificator == FACTION_XENOMORPH_NORMAL && (length(faction.total_mobs) == 1)) + var/mob/living/carbon/xenomorph/X = faction.total_mobs[1] + GLOB.last_ares_callout = world.time + // Tell the marines where the last one is. + var/name = "[MAIN_AI_SYSTEM] Bioscan Status" + var/input = "Bioscan complete.\n\nSensors indicate one remaining unknown lifeform signature in [get_area(X)]." + log_ares_bioscan(name, input) + faction_announcement(input, name, 'sound/AI/bioscan.ogg', logging = ARES_LOG_NONE) + // Tell the xeno she is the last one. + if(X.client) + to_chat(X, SPAN_XENOANNOUNCE("Your carapace rattles with dread. You are all that remains of the hive!")) + notify_ghosts(header = "Last Xenomorph", message = "There is only one Xenomorph left: [X.name].", source = X, action = NOTIFY_ORBIT) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_XENO_DEATH, src, gibbed) give_action(src, /datum/action/ghost/xeno) diff --git a/code/modules/mob/living/carbon/xenomorph/hive_faction.dm b/code/modules/mob/living/carbon/xenomorph/hive_faction.dm index e16a5cccd915..ad685f6d7703 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_faction.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_faction.dm @@ -1,3 +1,4 @@ +/* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) /proc/generate_alliable_factions() @@ -11,7 +12,7 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) .["Human"] = FACTION_LIST_HUMANOID .["Raw"] = .["Human"] + .["Xenomorph"] - +*/ /datum/hive_faction_ui var/name = "Hive Faction" @@ -40,7 +41,7 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) /datum/hive_faction_ui/ui_static_data(mob/user) . = list() - .["glob_factions"] = GLOB.hive_alliable_factions + .["glob_factions"] = list()//GLOB.hive_alliable_factions /datum/hive_faction_ui/ui_act(action, list/params, datum/tgui/ui) . = ..() @@ -52,8 +53,8 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) if(isnull(params["should_ally"]) || isnull(params["target_faction"])) return - if(!(params["target_faction"] in GLOB.hive_alliable_factions["Raw"])) - return +// if(!(params["target_faction"] in GLOB.hive_alliable_factions["Raw"])) +// return var/should_ally = text2num(params["should_ally"]) assoc_hive.change_stance(params["target_faction"], should_ally) diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index 2501e72d1f4f..c542ca2c4c52 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -162,7 +162,7 @@ hive_ui = new(src) mark_ui = new(src) faction_ui = new(src) - minimap_type = faction.minimap_flag +// minimap_type = faction.minimap_flag tacmap = new(src, minimap_type) if(!internal_faction) internal_faction = name @@ -212,7 +212,7 @@ var/castes = castes_available.Join(", ") xeno_message(SPAN_XENOANNOUNCE("The Hive is now strong enough to support: [castes]")) xeno_maptext("The Hive can now support: [castes]", "Hive Strengthening") - +/* // Adds a xeno to this hive /datum/hive_status/proc/add_xeno(mob/living/carbon/xenomorph/X) @@ -295,7 +295,7 @@ if(!light_mode) hive_ui.update_xeno_counts() hive_ui.xeno_removed(xeno) - +*/ /datum/hive_status/proc/set_living_xeno_queen(mob/living/carbon/xenomorph/queen/queen) if(!queen) SStracking.delete_leader("hive_[hivenumber]") @@ -733,10 +733,10 @@ if(!is_ground_level(potential_host.z) || get_area(potential_host) == hijacked_dropship) continue var/obj/item/alien_embryo/A = locate() in potential_host - if(A && A.faction != faction) - continue - for(var/obj/item/alien_embryo/embryo in potential_host) - embryo.hivenumber = FACTION_XENOMORPH_FORSAKEN +// if(A && A.faction != faction) +// continue +// for(var/obj/item/alien_embryo/embryo in potential_host) +// embryo.hivenumber = FACTION_XENOMORPH_FORSAKEN potential_host.update_med_icon() for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) @@ -835,8 +835,8 @@ playable_hugger_limit = max(floor(countable_xeno_iterator / playable_hugger_max_divisor), playable_hugger_minimum) /datum/hive_status/proc/can_spawn_as_hugger(mob/dead/observer/user) - if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) - return FALSE +// if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) +// return FALSE if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) return FALSE @@ -863,8 +863,8 @@ if(isfacehugger(mob)) current_hugger_count++ if(playable_hugger_limit <= current_hugger_count) - to_chat(user, SPAN_WARNING("\The [GLOB.hive_datum[hivenumber]] cannot support more facehuggers! Limit: [current_hugger_count]/[playable_hugger_limit]")) - return FALSE +// to_chat(user, SPAN_WARNING("\The [GLOB.hive_datum[hivenumber]] cannot support more facehuggers! Limit: [current_hugger_count]/[playable_hugger_limit]")) +// return FALSE if(tgui_alert(user, "Are you sure you want to become a facehugger?", "Confirmation", list("Yes", "No")) != "Yes") return FALSE @@ -898,8 +898,8 @@ lesser_drone_limit = max(floor(countable_xeno_iterator / playable_lesser_drones_max_divisor), lesser_drone_minimum) /datum/hive_status/proc/can_spawn_as_lesser_drone(mob/dead/observer/user, obj/effect/alien/resin/special/pylon/spawning_pylon) - if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) - return FALSE +// if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) +// return FALSE if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) @@ -930,7 +930,7 @@ current_lesser_drone_count++ if(lesser_drone_limit <= current_lesser_drone_count) - to_chat(user, SPAN_WARNING("[GLOB.hive_datum[hivenumber]] cannot support more lesser drones! Limit: [current_lesser_drone_count]/[lesser_drone_limit]")) + to_chat(user, SPAN_WARNING("[faction] cannot support more lesser drones! Limit: [current_lesser_drone_count]/[lesser_drone_limit]")) return FALSE if(!user.client) @@ -977,7 +977,7 @@ /datum/hive_status/corrupted name = "Corrupted Hive" reporting_id = "corrupted" - hivenumber = XENO_HIVE_CORRUPTED +// hivenumber = XENO_HIVE_CORRUPTED prefix = "Corrupted " color = "#80ff80" ui_color ="#4d994d" @@ -1135,7 +1135,7 @@ /datum/hive_status/corrupted/tamed name = "Tamed Hive" reporting_id = "tamed" - hivenumber = XENO_HIVE_TAMED +// hivenumber = XENO_HIVE_TAMED prefix = "Tamed " color = "#80ff80" @@ -1167,7 +1167,7 @@ if(H == leader) leader = null - +/* var/list/faction_groups = H.faction_group if(faction_groups) allied_factions = faction_groups.Copy() @@ -1194,11 +1194,11 @@ return TRUE return ..() - +*/ /datum/hive_status/corrupted/renegade name = "Renegade Hive" reporting_id = "renegade" - hivenumber = XENO_HIVE_RENEGADE +// hivenumber = XENO_HIVE_RENEGADE prefix = "Renegade " color = "#ffae00" ui_color ="#ad732c" @@ -1236,8 +1236,8 @@ return TRUE //cannot attack mob if iff is set to at least one of its factions return FALSE */ -/datum/hive_status/corrupted/renegade/faction_is_ally(faction, ignore_queen_check = TRUE) - return ..() +//datum/hive_status/corrupted/renegade/faction_is_ally(faction, ignore_queen_check = TRUE) +// return ..() /datum/hive_status/proc/on_queen_death() //break alliances on queen's death if(allow_no_queen_actions || living_xeno_queen) @@ -1265,7 +1265,7 @@ xeno_message(SPAN_XENOANNOUNCE("Our Queen set up an alliance with [faction]!"), 3, hivenumber) else xeno_message(SPAN_XENOANNOUNCE("Our Queen broke the alliance with [faction]!"), 3, hivenumber) - +/* for(var/number in GLOB.hive_datum) var/datum/hive_status/target_hive = GLOB.hive_datum[number] if(target_hive.name != faction) @@ -1279,7 +1279,7 @@ xeno_message(SPAN_XENOANNOUNCE("We sense that [name] [living_xeno_queen ? "Queen " : ""]broke the alliance with us!"), 3, target_hive.hivenumber) if(target_hive.allies[name]) //autobreak alliance on betrayal target_hive.change_stance(name, FALSE) - +*/ /datum/hive_status/corrupted/change_stance(faction, should_ally) . = ..() if(allies[faction]) @@ -1358,12 +1358,12 @@ xeno_message(SPAN_XENOANNOUNCE("Our Queen has broken all personal alliances with the talls! Favoritism is no more."), 3, hivenumber) return xeno_message(SPAN_XENOWARNING("With the death of the Queen, her friends no longer matter to us."), 3, hivenumber) - +/* /datum/hive_status/corrupted/is_ally(mob/living/living_mob) if(living_mob.status_flags & CORRUPTED_ALLY) return TRUE return ..() - +*/ /datum/hive_status/proc/override_evilution(evil, override) if(SSxevolution) SSxevolution.override_power(hivenumber, evil, override) diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 843f5d19d3bb..9d2e778e7e31 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -37,12 +37,13 @@ handle_regular_hud_updates() /mob/living/carbon/xenomorph/proc/update_progression() - if(isnull(hive)) + if(!faction) return var/progress_amount = 1 if(SSxevolution) - progress_amount = SSxevolution.get_evolution_boost_power(hive.hivenumber) - var/ovipositor_check = (hive.allow_no_queen_evo || hive.evolution_without_ovipositor || (hive.living_xeno_queen && hive.living_xeno_queen.ovipositor)) + progress_amount = SSxevolution.get_evolution_boost_power(faction.code_identificator) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/ovipositor_check = (faction_module.allow_no_queen_evo || faction_module.evolution_without_ovipositor || (faction_module.living_xeno_queen && faction_module.living_xeno_queen.ovipositor)) if(caste && caste.evolution_allowed && (ovipositor_check || caste?.evolve_without_queen)) if(evolution_stored >= evolution_threshold) if(!got_evolution_message) @@ -116,12 +117,13 @@ else use_current_aura = TRUE - if(leader_current_aura && hive && hive.living_xeno_queen && hive.living_xeno_queen.loc.z == loc.z) //Same Z-level as the Queen! + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(leader_current_aura && faction_module.living_xeno_queen && faction_module.living_xeno_queen.loc.z == loc.z) //Same Z-level as the Queen! use_leader_aura = TRUE if(use_current_aura || use_leader_aura) for(var/mob/living/carbon/xenomorph/Z as anything in GLOB.living_xeno_list) - if(Z.ignores_pheromones || Z.ignore_aura == current_aura || Z.ignore_aura == leader_current_aura || Z.z != z || get_dist(aura_center, Z) > floor(6 + aura_strength * 2) || !HIVE_ALLIED_TO_HIVE(Z.hivenumber, hivenumber)) + if(Z.ignores_pheromones || Z.ignore_aura == current_aura || Z.ignore_aura == leader_current_aura || Z.z != z || get_dist(aura_center, Z) > floor(6 + aura_strength * 2) || !Z.ally_faction(faction)) continue if(use_leader_aura) Z.affected_by_pheromones(leader_current_aura, leader_aura_strength) @@ -338,11 +340,12 @@ Make sure their actual health updates immediately.*/ if(caste) if(caste.innate_healing || check_weeds_for_healing()) - if(!hive) return // can't heal if you have no hive, sorry bud + if(!faction) return // can't heal if you have no hive, sorry bud plasma_stored += plasma_gain * plasma_max / 100 if(recovery_aura) plasma_stored += floor(plasma_gain * plasma_max / 100 * recovery_aura/4) //Divided by four because it gets massive fast. 1 is equivalent to weed regen! Only the strongest pheromones should bypass weeds - if(health < maxHealth && !hardcore && is_hive_living(hive) && last_hit_time + caste.heal_delay_time <= world.time) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(health < maxHealth && !hardcore && is_hive_living(faction_module) && last_hit_time + caste.heal_delay_time <= world.time) if(body_position == LYING_DOWN || resting) if(health < 0) //Unconscious heal_wounds(caste.heal_knocked_out * regeneration_multiplier, recoveryActual) //Healing is much slower. Warding pheromones make up for the rest if you're curious @@ -395,20 +398,21 @@ Make sure their actual health updates immediately.*/ return var/atom/movable/screen/queen_locator/locator = hud_used.locate_leader - if(!loc || !hive) + if(!loc || !faction) locator.reset_tracking() return + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) var/atom/tracking_atom switch(locator.tracker_type) if(TRACKER_QUEEN) - tracking_atom = hive.living_xeno_queen + tracking_atom = faction_module.living_xeno_queen if(TRACKER_HIVE) - tracking_atom = hive.hive_location + tracking_atom = faction_module.hive_location if(TRACKER_LEADER) var/atom/leader = locator.tracking_ref?.resolve() // If the leader exists, and is actually in the leader list. - if(leader && (leader in hive.xeno_leader_list)) + if(leader && (leader in faction_module.xeno_leader_list)) tracking_atom = leader if(TRACKER_TUNNEL) tracking_atom = locator.tracking_ref?.resolve() diff --git a/code/modules/mob/living/carbon/xenomorph/mark_menu.dm b/code/modules/mob/living/carbon/xenomorph/mark_menu.dm index b0b159923b15..cc76865335e0 100644 --- a/code/modules/mob/living/carbon/xenomorph/mark_menu.dm +++ b/code/modules/mob/living/carbon/xenomorph/mark_menu.dm @@ -59,12 +59,13 @@ .["user_nicknumber"] = X.nicknumber var/list/mark_list_infos = list() - for(var/type in X.hive.resin_marks) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/type in faction_module.resin_marks) var/list/entry = list() var/obj/effect/alien/resin/marker/RM = type var/mark_owner = null var/mark_owner_name = null - for(var/mob/living/carbon/xenomorph/XX in X.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/XX in X.faction.total_mobs) if(XX.nicknumber == RM.createdby) mark_owner = XX.nicknumber mark_owner_name = XX.name @@ -159,7 +160,7 @@ else if(isqueen(X)) var/mob/living/carbon/xenomorph/mark_to_destroy_owner to_chat(X, SPAN_XENONOTICE("You psychically command the [mark_to_destroy.mark_meaning.name] resin mark to be destroyed.")) - for(var/mob/living/carbon/xenomorph/XX in X.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/XX in X.faction.total_mobs) if(XX.nicknumber == mark_to_destroy.createdby) mark_to_destroy_owner = XX to_chat(mark_to_destroy_owner, SPAN_XENONOTICE("Your [mark_to_destroy.mark_meaning.name] resin mark was commanded to be destroyed by [X.name].")) @@ -180,13 +181,13 @@ var/list/possible_xenos = list() possible_xenos |= FunkTownOhyea for(var/mob/living/carbon/xenomorph/T in GLOB.living_xeno_list) - if (T != X && !should_block_game_interaction(T) && X.hivenumber == T.hivenumber) + if (T != X && !should_block_game_interaction(T) && X.faction == T.faction) possible_xenos += T var/mob/living/carbon/xenomorph/selected_xeno = tgui_input_list(X, "Target", "Watch which xenomorph?", possible_xenos, theme="hive_status") if(selected_xeno == FunkTownOhyea) - for(var/mob/living/carbon/xenomorph/forced_xeno in X.hive.totalXenos) + for(var/mob/living/carbon/xenomorph/forced_xeno in X.faction.total_mobs) forced_xeno.stop_tracking_resin_mark(FALSE, TRUE) to_chat(forced_xeno, SPAN_XENOANNOUNCE("Hive! Your queen commands: [mark_to_force.mark_meaning.desc] in [get_area_name(mark_to_force)]. (Watch) (Track)")) forced_xeno.start_tracking_resin_mark(mark_to_force) diff --git a/code/modules/mob/living/carbon/xenomorph/say.dm b/code/modules/mob/living/carbon/xenomorph/say.dm index d44e531fa63f..4d26134225ea 100644 --- a/code/modules/mob/living/carbon/xenomorph/say.dm +++ b/code/modules/mob/living/carbon/xenomorph/say.dm @@ -97,7 +97,7 @@ if(SEND_SIGNAL(src, COMSIG_XENO_TRY_HIVEMIND_TALK, message) & COMPONENT_OVERRIDE_HIVEMIND_TALK) return - hivemind_broadcast(message, hive) + hivemind_broadcast(message, faction.get_faction_module(FACTION_MODULE_HIVE_MIND)) /mob/living/carbon/proc/hivemind_broadcast(message, datum/faction_module/hive_mind/faction_module) if(!message || stat) diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/crusher/charger.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/crusher/charger.dm index 1c99fd93fe9a..b5fd1252e057 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/crusher/charger.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/crusher/charger.dm @@ -370,7 +370,7 @@ /mob/living/carbon/xenomorph/handle_charge_collision(mob/living/carbon/xenomorph/xeno, datum/action/xeno_action/onclick/charger_charge/charger_ability) if(charger_ability.momentum) playsound(loc, "punch", 25, TRUE) - if(!xeno.ally_of_hivenumber(hivenumber)) + if(!xeno.ally_faction(faction)) attack_log += text("\[[time_stamp()]\] was xeno charged by [xeno] ([xeno.ckey])") xeno.attack_log += text("\[[time_stamp()]\] xeno charged [src] ([ckey])") log_attack("[xeno] ([xeno.ckey]) xeno charged [src] ([ckey])") diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm index 2f383d6e3c3a..47881b16b3e1 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm @@ -271,16 +271,16 @@ target.flick_heal_overlay(3 SECONDS, "#44253d") target.visible_message(SPAN_XENONOTICE("[xeno] explodes in a deluge of regenerative resin salve, covering [target] in it!")) - xeno_message(SPAN_XENOANNOUNCE("[xeno] sacrifices itself to heal [target]!"), 2, target.hive.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("[xeno] sacrifices itself to heal [target]!"), 2, target.faction) var/datum/behavior_delegate/drone_healer/behavior_delegate = xeno.behavior_delegate - if(istype(behavior_delegate) && behavior_delegate.transferred_amount >= behavior_delegate.required_transferred_amount && xeno.client && xeno.hive) - var/datum/hive_status/hive_status = xeno.hive + if(istype(behavior_delegate) && behavior_delegate.transferred_amount >= behavior_delegate.required_transferred_amount && xeno.client && xeno.faction) + var/datum/faction_module/hive_mind/faction_module = xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) var/turf/spawning_turf = get_turf(xeno) - if(!hive_status.hive_location) - addtimer(CALLBACK(xeno.hive, TYPE_PROC_REF(/datum/hive_status, respawn_on_turf), xeno.client, spawning_turf), 0.5 SECONDS) + if(!faction_module.hive_location) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/faction_module/hive_mind, respawn_on_turf), xeno.client, spawning_turf), 0.5 SECONDS) else - addtimer(CALLBACK(xeno.hive, TYPE_PROC_REF(/datum/hive_status, free_respawn), xeno.client), 5 SECONDS) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/faction_module/hive_mind, free_respawn), xeno.client), 5 SECONDS) xeno.gib(create_cause_data("sacrificing itself", src)) return ..() diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/runner/acid.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/runner/acid.dm index 0fb4a17190a1..453fa367bd76 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/runner/acid.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/runner/acid.dm @@ -150,13 +150,13 @@ new /obj/effect/particle_effect/smoke/acid_runner_harmless(T) FOR_DVIEW_END playsound(bound_xeno, 'sound/effects/blobattack.ogg', 75) - if(bound_xeno.client && bound_xeno.hive) - var/datum/hive_status/hive_status = bound_xeno.hive + if(bound_xeno.client && bound_xeno.faction) + var/datum/faction_module/hive_mind/faction_module = bound_xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) var/turf/spawning_turf = get_turf(bound_xeno) - if(!hive_status.hive_location) - addtimer(CALLBACK(bound_xeno.hive, TYPE_PROC_REF(/datum/hive_status, respawn_on_turf), bound_xeno.client, spawning_turf), 0.5 SECONDS) + if(!faction_module.hive_location) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/faction_module/hive_mind, respawn_on_turf), bound_xeno.client, spawning_turf), 0.5 SECONDS) else - addtimer(CALLBACK(bound_xeno.hive, TYPE_PROC_REF(/datum/hive_status, free_respawn), bound_xeno.client), 5 SECONDS) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/faction_module/hive_mind, free_respawn), bound_xeno.client), 5 SECONDS) bound_xeno.gib() /mob/living/carbon/xenomorph/runner/ventcrawl_carry() diff --git a/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm b/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm index 99f9e2db30cf..90f312833a13 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm @@ -44,7 +44,8 @@ apply_strain(xeno) xeno.update_icons() - xeno.hive.hive_ui.update_xeno_info() + var/datum/faction_module/hive_mind/faction_module = xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.update_xeno_info() // Give them all of the info about the strain. to_chat(xeno, SPAN_XENOANNOUNCE(description)) @@ -110,7 +111,7 @@ if(!COOLDOWN_FINISHED(src, next_strain_reset)) to_chat(src, SPAN_WARNING("We lack the strength to reset our strain. We will be able to reset it in [round((next_strain_reset - world.time) / 600, 1)] minutes")) return - + // Show the user the strain's description, and double check that they want it. if(tgui_alert(src, "Are you sure?", "Reset Strain", list("Yes", "No")) != "Yes") return diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_helpers.dm b/code/modules/mob/living/carbon/xenomorph/xeno_helpers.dm index 2414d077b1c0..60b63e34de32 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_helpers.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_helpers.dm @@ -13,11 +13,12 @@ return FALSE /mob/living/carbon/xenomorph/proc/can_destroy_special() - if(hive) + if(faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(IS_XENO_LEADER(src)) - if(hive.destruction_allowed == NORMAL_XENO || hive.destruction_allowed == XENO_LEADER) + if(faction_module.destruction_allowed == NORMAL_XENO || faction_module.destruction_allowed == XENO_LEADER) return TRUE - if(hive.destruction_allowed == NORMAL_XENO && isxeno_builder(src)) + if(faction_module.destruction_allowed == NORMAL_XENO && isxeno_builder(src)) return TRUE if(isqueen(src)) return TRUE @@ -61,7 +62,7 @@ var/count = 0 // Compare the areas. - for(var/mob/living/carbon/xenomorph/X in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/X in faction.total_mobs) if(!(X in GLOB.living_xeno_list)) continue diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm b/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm index b8b6d7895b00..a1e45ca11d1d 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_verbs.dm @@ -4,10 +4,11 @@ set desc = "Check the status of our current hive." set category = "Alien" - if(!hive) + if(!faction) return - if((!hive.living_xeno_queen || SSmapping.configs[GROUND_MAP].map_name == MAP_WHISKEY_OUTPOST) && !hive.allow_no_queen_actions) //No Hive status on WO + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if((!faction_module.living_xeno_queen || SSmapping.configs[GROUND_MAP].map_name == MAP_WHISKEY_OUTPOST) && !faction_module.allow_no_queen_actions) //No Hive status on WO to_chat(src, SPAN_WARNING("There is no Queen. We are alone.")) return @@ -15,24 +16,25 @@ to_chat(src, SPAN_WARNING("Our psychic connection has been temporarily disabled!")) return - hive.hive_ui.open_hive_status(src) + faction_module.hive_ui.open_hive_status(src) /mob/living/carbon/xenomorph/verb/hive_alliance_status() set name = "Hive Alliance Status" set desc = "Check the status of your alliances." set category = "Alien" - if(!hive) + if(!faction) return - if(hive.hivenumber == XENO_HIVE_RENEGADE) //Renegade's ability to attack someone depends on IFF settings, not on alliance - if(!iff_tag) + if(faction.code_identificator == FACTION_XENOMORPH_RENEGADE) //Renegade's ability to attack someone depends on IFF settings, not on alliance + if(!faction_tag) to_chat(src, SPAN_NOTICE("You are not obligated to protect anyone.")) return - to_chat(src, SPAN_NOTICE("You seem compelled to protect [english_list(iff_tag.faction_groups, "no one")].")) + to_chat(src, SPAN_NOTICE("You seem compelled to protect [english_list(faction_tag.factions, "no one")].")) return - if((!hive.living_xeno_queen || Check_WO()) && !hive.allow_no_queen_actions) //No Hive status on WO + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if((!faction_module.living_xeno_queen || Check_WO()) && !faction_module.allow_no_queen_actions) //No Hive status on WO to_chat(src, SPAN_WARNING("There is no Queen. You are alone.")) return @@ -40,7 +42,7 @@ to_chat(src, SPAN_WARNING("Our psychic connection has been temporarily disabled!")) return - hive.faction_ui.tgui_interact(src) + faction_module.hive_ui.tgui_interact(src) /mob/living/carbon/xenomorph/verb/clear_built_structures() set name = "Clear Built Structures" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a725c0dbec5a..cc163bc7387a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -33,7 +33,9 @@ QDEL_NULL(organ_faction_tag) QDEL_NULL(faction_tag) - faction = null + if(faction) + faction.remove_mob(src, TRUE) + faction = null tgui_open_uis = null buckled = null diff --git a/code/modules/shuttle/shuttles/dropship.dm b/code/modules/shuttle/shuttles/dropship.dm index 6a4053ce5464..6a986cc765d4 100644 --- a/code/modules/shuttle/shuttles/dropship.dm +++ b/code/modules/shuttle/shuttles/dropship.dm @@ -99,7 +99,7 @@ for(var/area/checked_area in shuttle_areas) for(var/mob/living/carbon/xenomorph/checked_xeno in checked_area) - if(checked_xeno.stat == DEAD || (FACTION_MARINE in checked_xeno.iff_tag?.faction_groups)) + if(checked_xeno.stat == DEAD || (GLOB.faction_datums[FACTION_MARINE].faction_tag_is_ally(checked_xeno.faction_tag))) continue var/name = "Unidentified Lifesigns" var/input = "Unidentified lifesigns detected onboard. Recommendation: lockdown of exterior access ports, including ducting and ventilation." diff --git a/code/modules/shuttles/marine_ferry.dm b/code/modules/shuttles/marine_ferry.dm index 301191777e66..eb303a15ee40 100644 --- a/code/modules/shuttles/marine_ferry.dm +++ b/code/modules/shuttles/marine_ferry.dm @@ -219,7 +219,7 @@ if(!queen_locked) for(var/turf/T in turfs_src) var/mob/living/carbon/xenomorph/xeno = locate(/mob/living/carbon/xenomorph) in T - if((xeno && xeno.stat != DEAD) && !(FACTION_MARINE in xeno.iff_tag?.faction_groups)) + if((xeno && xeno.stat != DEAD) && !(GLOB.faction_datums[FACTION_MARINE].faction_tag_is_ally(xeno.faction_tag))) var/name = "Unidentified Lifesigns" var/input = "Unidentified lifesigns detected onboard. Recommendation: lockdown of exterior access ports, including ducting and ventilation." shipwide_ai_announcement(input, name, 'sound/AI/unidentified_lifesigns.ogg', ares_logging = ARES_LOG_SECURITY) From ca41e39698bad0d4269edf5b1c83a4b89bcad3eb Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 15:24:37 +0500 Subject: [PATCH 07/24] green text, final it's OVER --- code/__DEFINES/mode.dm | 1 + .../__DEFINES/sentry_laptop_configurations.dm | 4 +- code/__DEFINES/traits.dm | 2 +- code/__DEFINES/typecheck/xenos.dm | 7 +- code/__HELPERS/game.dm | 2 +- code/controllers/subsystem/minimap.dm | 8 +- code/datums/event_info_text.dm | 8 +- code/datums/factions/faction_modules.dm | 89 +++++++++++-- code/datums/factions/relations_datum.dm | 16 +++ code/datums/factions/xeno/mutated.dm | 3 +- code/datums/supply_packs/research.dm | 2 +- code/datums/tutorial/xenomorph/_xenomorph.dm | 2 +- .../tutorial/xenomorph/xenomorph_basic.dm | 4 +- code/defines/procs/announcement.dm | 8 +- code/game/area/admin_level.dm | 2 +- .../colonialmarines/colonialmarines.dm | 3 +- .../gamemodes/colonialmarines/xenovsxeno.dm | 3 +- code/game/machinery/nuclearbomb.dm | 2 - code/game/objects/effects/aliens.dm | 6 +- .../objects/effects/effect_system/smoke.dm | 28 ++-- .../stool_bed_chair_nest/xeno_nest.dm | 2 +- code/game/turfs/walls/wall_types.dm | 25 ++-- .../admin/player_panel/actions/antag.dm | 2 +- .../admin/player_panel/player_panel.dm | 2 +- code/modules/admin/topic/topic.dm | 26 ++-- code/modules/admin/topic/topic_events.dm | 17 +-- code/modules/admin/verbs/xooc.dm | 2 +- code/modules/cm_aliens/XenoStructures.dm | 50 ++++--- code/modules/cm_aliens/hivebuffs/hivebuff.dm | 24 ++-- .../cm_aliens/structures/construction_node.dm | 7 - code/modules/cm_aliens/structures/egg.dm | 27 ++-- code/modules/cm_aliens/structures/fruit.dm | 7 +- .../structures/special/egg_morpher.dm | 3 +- .../structures/special/hive_cluster.dm | 3 +- .../cm_aliens/structures/special/pred_nest.dm | 7 +- .../structures/special/pylon_core.dm | 16 +-- .../cm_aliens/structures/special_structure.dm | 5 +- code/modules/cm_aliens/structures/tunnel.dm | 40 +++--- .../structures/xeno_structures_boilertrap.dm | 12 +- code/modules/cm_aliens/weeds.dm | 16 +-- code/modules/defenses/bell_tower.dm | 18 +-- code/modules/defenses/defenses.dm | 26 ++-- code/modules/defenses/handheld.dm | 8 +- code/modules/defenses/sentry.dm | 18 +-- code/modules/defenses/sentry_flamer.dm | 4 +- .../modules/gear_presets/_select_equipment.dm | 6 +- code/modules/gear_presets/other.dm | 25 ++-- code/modules/gear_presets/synths.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 29 ++-- code/modules/mob/dead/observer/orbit.dm | 6 +- code/modules/mob/living/blood.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 8 +- code/modules/mob/living/carbon/human/human.dm | 2 +- .../living/carbon/human/human_abilities.dm | 25 ++-- .../carbon/human/species/yautja/_species.dm | 22 ++- .../mob/living/carbon/xenomorph/Evolution.dm | 1 - .../living/carbon/xenomorph/Facehuggers.dm | 10 +- .../mob/living/carbon/xenomorph/Powers.dm | 2 +- .../living/carbon/xenomorph/XenoOverwatch.dm | 10 +- .../mob/living/carbon/xenomorph/XenoProcs.dm | 9 +- .../mob/living/carbon/xenomorph/Xenomorph.dm | 11 +- .../abilities/ability_helper_procs.dm | 8 +- .../abilities/burrower/burrower_powers.dm | 7 +- .../abilities/facehugger/facehugger_powers.dm | 4 +- .../xenomorph/abilities/general_abilities.dm | 16 ++- .../xenomorph/abilities/general_powers.dm | 2 +- .../xenomorph/abilities/king/king_powers.dm | 2 +- .../abilities/lurker/lurker_powers.dm | 2 +- .../abilities/queen/queen_abilities.dm | 6 +- .../xenomorph/abilities/queen/queen_powers.dm | 125 +----------------- .../living/carbon/xenomorph/attack_alien.dm | 10 +- .../living/carbon/xenomorph/castes/Carrier.dm | 5 +- .../living/carbon/xenomorph/castes/King.dm | 4 +- .../living/carbon/xenomorph/hive_faction.dm | 7 +- .../living/carbon/xenomorph/hive_status.dm | 2 +- .../living/carbon/xenomorph/hive_status_ui.dm | 14 +- .../mob/living/carbon/xenomorph/mark_menu.dm | 63 ++++++++- .../carbon/xenomorph/resin_constructions.dm | 26 ++-- .../mob/living/carbon/xenomorph/say.dm | 2 +- code/modules/mob/new_player/new_player.dm | 8 +- code/modules/projectiles/projectile.dm | 2 +- .../chemistry_properties/prop_special.dm | 19 +-- .../reagents/chemistry_reagents/other.dm | 4 +- .../modules/round_recording/round_recorder.dm | 2 +- code/modules/shuttle/computer.dm | 2 +- .../shuttle/computers/dropship_computer.dm | 2 +- code/modules/shuttles/shuttle_console.dm | 2 +- code/modules/tgui/states/xeno.dm | 11 +- .../vehicles/hardpoints/primary/arc_sentry.dm | 2 +- colonialmarines.dme | 1 - 90 files changed, 554 insertions(+), 543 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index abc915a015eb..536db65abab3 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -294,6 +294,7 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_XENOMORPH_MUTATED "mutated_xenomorph" #define FACTION_XENOMORPH_YAUTJA "yautja_xenomorph" #define FACTION_XENOMORPH_RENEGADE "renegade_xenomorph" +#define FACTION_XENOMORPH_TUTORIAL "tutorial_xenomorph" #define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE) #define FACTION_LIST_MARINE list(FACTION_MARINE) diff --git a/code/__DEFINES/sentry_laptop_configurations.dm b/code/__DEFINES/sentry_laptop_configurations.dm index a3be0a383fa8..1677ce4f0245 100644 --- a/code/__DEFINES/sentry_laptop_configurations.dm +++ b/code/__DEFINES/sentry_laptop_configurations.dm @@ -1,5 +1,5 @@ -#define SENTRY_FACTION_own "OWN" -#define SENTRY_FACTION_ALLY "ALLY" +#define SENTRY_FACTION_OWN "INTERNAL ONLY SIGNALS" +#define SENTRY_FACTION_ALLY "OTHER ALLIES SIGNALS" #define ROF_SINGLE "SINGLE" #define ROF_BURST "BURST" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index adc76b727914..2c6d6c6bb6e1 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -376,7 +376,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_OPPOSABLE_THUMBS" = TRAIT_OPPOSABLE_THUMBS, "TRAIT_INTERFERENCE" = TRAIT_HIVEMIND_INTERFERENCE, ), - /datum/hive_status = list( + /datum/faction_module/hive_mind = list( "TRAIT_XENONID" = TRAIT_XENONID, "TRAIT_NO_HIVE_DELAY" = TRAIT_NO_HIVE_DELAY, "TRAIT_NO_COLOR" = TRAIT_NO_COLOR, diff --git a/code/__DEFINES/typecheck/xenos.dm b/code/__DEFINES/typecheck/xenos.dm index 3a78f73cc9af..ecbac4bcb982 100644 --- a/code/__DEFINES/typecheck/xenos.dm +++ b/code/__DEFINES/typecheck/xenos.dm @@ -33,15 +33,10 @@ if(!faction) return FALSE - - if(faction.code_identificator == FACTION_XENOMORPH_RENEGADE) - var/datum/hive_status/corrupted/renegade/renegade_hive = faction - return renegade_hive.iff_protection_check(src, attempt_harm_mob) - return attempt_harm_mob.ally_faction(faction) // need this to set the data for walls/eggs/huggers when they are initialized -/proc/set_hive_data(atom/focused_atom, datum/hive_status/faction) +/proc/set_hive_data(atom/focused_atom, datum/faction/faction) if(faction.color) focused_atom.color = faction.color focused_atom.name = "[lowertext(faction.prefix)][focused_atom.name]" diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index aef434cf99d0..d4a82055fc93 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -236,7 +236,7 @@ * * sorted - Whether to sort by larva_queue_time (default TRUE) or leave unsorted * * abomination - Whether the potential larva is for an abomination */ -/proc/get_alien_candidates(datum/hive_status/hive = null, sorted = TRUE, abomination = FALSE) +/proc/get_alien_candidates(datum/faction/hive = null, sorted = TRUE, abomination = FALSE) var/list/candidates = list() for(var/mob/dead/observer/cur_obs as anything in GLOB.observer_list) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 8a8d2f29885e..4825758cb125 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -766,7 +766,8 @@ SUBSYSTEM_DEF(minimaps) if(isobserver(user)) faction = allowed_flags == GLOB.faction_datums[MINIMAP_FLAG_XENO ? FACTION_XENOMORPH_NORMAL : FACTION_MARINE] - if(is_xeno && xeno.faction.see_humans_on_tacmap && targeted_ztrait != ZTRAIT_MARINE_MAIN_SHIP) + var/datum/faction_module/hive_mind/faction_module = user.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(is_xeno && faction_module && faction_module.see_humans_on_tacmap && targeted_ztrait != ZTRAIT_MARINE_MAIN_SHIP) allowed_flags |= MINIMAP_FLAG_USCM|MINIMAP_FLAG_WY|MINIMAP_FLAG_UPP|MINIMAP_FLAG_CLF targeted_ztrait = ZTRAIT_MARINE_MAIN_SHIP map_holder = null @@ -902,7 +903,6 @@ SUBSYSTEM_DEF(minimaps) return var/mob/user = ui.user - var/mob/living/carbon/xenomorph/xeno = user var/faction = user.faction var/is_observer = isobserver(user) if(faction == FACTION_NEUTRAL && is_observer) @@ -1011,8 +1011,8 @@ SUBSYSTEM_DEF(minimaps) if(!isxeno(user)) return UI_CLOSE - var/mob/living/carbon/xenomorph/xeno = user - if(!xeno.hive?.living_xeno_queen?.ovipositor) + var/datum/faction_module/hive_mind/faction_module = user.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen?.ovipositor) return UI_CLOSE return UI_INTERACTIVE diff --git a/code/datums/event_info_text.dm b/code/datums/event_info_text.dm index 37bce396bc69..283c4043f4c0 100644 --- a/code/datums/event_info_text.dm +++ b/code/datums/event_info_text.dm @@ -4,10 +4,10 @@ var/datum/faction/faction var/msg = "" -/datum/custom_event_info/New(datum/faction/_faction, _name, _code_identificator) - if(_faction) - name = _faction.name - faction = _faction +/datum/custom_event_info/New(datum/faction/faction_to_set, _name, _code_identificator) + if(faction_to_set) + name = faction_to_set.name + faction = faction_to_set if(_name) name = _name diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index 7fc0865b2cb1..7a580c6b0089 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -140,11 +140,11 @@ var/max_buff_points = HIVE_MAX_BUFFPOINTS /// List of references to the currently active hivebuffs - var/list/active_hivebuffs + var/list/active_hivebuffs = list() /// List of references to used hivebuffs - var/list/used_hivebuffs + var/list/used_hivebuffs = list() /// List of references to used hivebuffs currently on cooldown - var/list/cooldown_hivebuffs + var/list/cooldown_hivebuffs = list() /// List of references to hive pylons active in the game world var/list/active_endgame_pylons @@ -161,22 +161,17 @@ var/mob/living/carbon/human/leader -/* /datum/faction_module/hive_mind/New() + . = ..() + hive_ui = new(src) mark_ui = new(src) - faction_ui = new(src) - minimap_type = faction.minimap_flag + minimap_type = faction_owner.minimap_flag tacmap = new(src, minimap_type) - if(!internal_faction) - internal_faction = name for(var/number in 1 to 999) available_nicknumbers += number - LAZYINITLIST(active_hivebuffs) - LAZYINITLIST(used_hivebuffs) - LAZYINITLIST(active_endgame_pylons) - if(hivenumber != FACTION_XENOMORPH_NORMAL) + if(faction_owner.code_identificator != FACTION_XENOMORPH_NORMAL) return if(!evolution_menu_images) @@ -184,7 +179,7 @@ generate_evo_menu_images() RegisterSignal(SSdcs, COMSIG_GLOB_POST_SETUP, PROC_REF(post_setup)) -*/ + ///Generate the image()'s requried for the evolution radial menu. /datum/faction_module/hive_mind/proc/generate_evo_menu_images() for(var/datum/caste_datum/caste as anything in subtypesof(/datum/caste_datum)) @@ -956,3 +951,71 @@ if(H == leader) leader = null + +/// Get a list of hivebuffs which can be bought now. +/datum/faction_module/hive_mind/proc/get_available_hivebuffs() + var/list/potential_hivebuffs = subtypesof(/datum/hivebuff) + + // First check if we any pylons which are capable of supporting hivebuffs + if(!LAZYLEN(active_endgame_pylons)) + return + + for(var/datum/hivebuff/possible_hivebuff as anything in potential_hivebuffs) + // Round isn't old enough yet + if(ROUND_TIME < initial(possible_hivebuff.roundtime_to_enable)) + potential_hivebuffs -= possible_hivebuff + continue + + if(initial(possible_hivebuff.number_of_required_pylons) > LAZYLEN(active_endgame_pylons)) + potential_hivebuffs -= possible_hivebuff + continue + + // Prevent the same lineage of buff in active hivebuffs (e.g. no minor and major health allowed) + var/already_active = FALSE + for(var/datum/hivebuff/buff as anything in active_hivebuffs) + if(istype(buff, possible_hivebuff)) + already_active = TRUE + break + if(ispath(possible_hivebuff, buff.type)) + already_active = TRUE + break + if(already_active) + potential_hivebuffs -= possible_hivebuff + continue + + //If this buff isn't combineable, check if any other active hivebuffs aren't combineable + if(!initial(possible_hivebuff.is_combineable)) + var/found_conflict = FALSE + for(var/datum/hivebuff/active_hivebuff in active_hivebuffs) + if(!active_hivebuff.is_combineable) + found_conflict = TRUE + break + if(found_conflict) + potential_hivebuffs -= possible_hivebuff + continue + + // If the buff is not reusable check against used hivebuffs. + if(!initial(possible_hivebuff.is_reusable)) + if(locate(possible_hivebuff) in used_hivebuffs) + potential_hivebuffs -= possible_hivebuff + continue + + return potential_hivebuffs + +/datum/faction_module/hive_mind/proc/attempt_apply_hivebuff(datum/hivebuff/hivebuff, mob/living/purchasing_player, obj/effect/alien/resin/special/pylon/endgame/purchased_pylon) + var/datum/hivebuff/new_buff = new hivebuff(src) + if(!new_buff._on_engage(purchasing_player, purchased_pylon)) + qdel(new_buff) + return FALSE + return TRUE + +/datum/faction_module/hive_mind/proc/on_queen_death() //break alliances on queen's death + if(allow_no_queen_actions || living_xeno_queen) + return + + if(faction_owner.relations_datum.break_alliances()) + xeno_message(SPAN_XENOANNOUNCE("With the death of the Queen, all alliances have been broken."), 3, faction_owner) + +/datum/faction_module/hive_mind/proc/override_evilution(evil, override) + if(SSxevolution) + SSxevolution.override_power(faction_owner.code_identificator, evil, override) diff --git a/code/datums/factions/relations_datum.dm b/code/datums/factions/relations_datum.dm index 1f0018a49005..15ddfd794779 100644 --- a/code/datums/factions/relations_datum.dm +++ b/code/datums/factions/relations_datum.dm @@ -33,6 +33,22 @@ /datum/faction_module/relations/proc/gain_opinion(datum/faction/target_faction, opinion) relations[target_faction.code_identificator] = clamp(relations[target_faction.code_identificator] + opinion, RELATIONS_WAR[1], RELATIONS_MAX) +/datum/faction_module/relations/proc/break_alliances() + if(!length(allies)) + return FALSE + + for(var/datum/faction/ally in allies) + breake_alliance(ally, TRUE) + return TRUE + +/datum/faction_module/relations/proc/breake_alliance(datum/faction/ally, force = FALSE) + allies -= ally + var/opinion_before = relations[ally.code_identificator] + relations[ally.code_identificator] = RELATIONS_FRIENDLY[1] + var/opinion_difference = opinion_before - relations[ally.code_identificator] + faction_announcement("Alliance with [faction] broken, opinion degrade for [opinion_difference] positions", "Relations", faction_to_display = ally) + faction_announcement("We broke alliance with [ally], opinion degrade for [opinion_difference] positions", "Relations", faction_to_display = faction) + /datum/faction_module/relations/tgui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, source, ui) if(!ui) diff --git a/code/datums/factions/xeno/mutated.dm b/code/datums/factions/xeno/mutated.dm index bc226fd46199..7868582eaed5 100644 --- a/code/datums/factions/xeno/mutated.dm +++ b/code/datums/factions/xeno/mutated.dm @@ -8,11 +8,10 @@ color = "#6abd99" ui_color = "#6abd99" - hive_inherant_traits = list(TRAIT_XENONID) - minimap_flag = MINIMAP_FLAG_XENO_MUTATED /datum/faction/xenomorph/mutated/New() . = ..() var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_inherant_traits = list(TRAIT_XENONID, TRAIT_NO_COLOR) faction_module.latejoin_burrowed = FALSE diff --git a/code/datums/supply_packs/research.dm b/code/datums/supply_packs/research.dm index e81617357fb2..6e3497724d44 100644 --- a/code/datums/supply_packs/research.dm +++ b/code/datums/supply_packs/research.dm @@ -116,7 +116,7 @@ /datum/supply_packs/xeno_tags name = "Xenomorph IFF Tag Case (x7 tags)" contains = list( - /obj/item/storage/xeno_tag_case/full, + /obj/item/storage/tag_case/uscm/marine, ) cost = 60 containertype = /obj/structure/closet/crate/secure/weyland diff --git a/code/datums/tutorial/xenomorph/_xenomorph.dm b/code/datums/tutorial/xenomorph/_xenomorph.dm index caa33d8eed43..7e454cadfce8 100644 --- a/code/datums/tutorial/xenomorph/_xenomorph.dm +++ b/code/datums/tutorial/xenomorph/_xenomorph.dm @@ -10,7 +10,7 @@ var/remove_all_actions = TRUE /datum/tutorial/xenomorph/init_mob() - var/mob/living/carbon/xenomorph/new_character = new starting_xenomorph_type(bottom_left_corner, null, XENO_HIVE_TUTORIAL) + var/mob/living/carbon/xenomorph/new_character = new starting_xenomorph_type(bottom_left_corner, null, FACTION_XENOMORPH_TUTORIAL) new_character.lastarea = get_area(bottom_left_corner) //Remove all actions from the tutorial xenomorph if remove_all_actions is TRUE diff --git a/code/datums/tutorial/xenomorph/xenomorph_basic.dm b/code/datums/tutorial/xenomorph/xenomorph_basic.dm index ed9a9b810b45..cdbc65bfa2f0 100644 --- a/code/datums/tutorial/xenomorph/xenomorph_basic.dm +++ b/code/datums/tutorial/xenomorph/xenomorph_basic.dm @@ -145,7 +145,7 @@ addtimer(CALLBACK(src, PROC_REF(cap_phase)), 10 SECONDS) /datum/tutorial/xenomorph/basic/proc/cap_phase() - var/obj/effect/alien/resin/special/eggmorph/morpher = new(loc_from_corner(2,2), GLOB.hive_datum[XENO_HIVE_TUTORIAL]) + var/obj/effect/alien/resin/special/eggmorph/morpher = new(loc_from_corner(2,2), null, GLOB.faction_datums[FACTION_XENOMORPH_TUTORIAL]) morpher.stored_huggers = 1 add_to_tracking_atoms(morpher) add_highlight(morpher, COLOR_YELLOW) @@ -233,7 +233,7 @@ update_objective("Nest the captive human!") message_to_player("Drag the human next to the wall so both you and human are directly adjacent to the wall.") message_to_player("With the grab selected in your hand. Click on the wall. Or click and drag the mouse from the human onto the wall. You must not move during this process.") - new /obj/effect/alien/resin/special/cluster(loc_from_corner(9,0), GLOB.hive_datum[XENO_HIVE_TUTORIAL]) + new /obj/effect/alien/resin/special/cluster(loc_from_corner(9,0), null, GLOB.faction_datums[FACTION_XENOMORPH_TUTORIAL]) /datum/tutorial/xenomorph/basic/proc/on_mob_nested() SIGNAL_HANDLER diff --git a/code/defines/procs/announcement.dm b/code/defines/procs/announcement.dm index ec3b5cfcbc5c..cb4a43aed57f 100644 --- a/code/defines/procs/announcement.dm +++ b/code/defines/procs/announcement.dm @@ -14,12 +14,12 @@ if(faction_to_display == "Everyone") for(var/faction_to_get in FACTION_LIST_XENOMORPH) for(var/mob/mob as anything in GLOB.faction_datums[faction_to_get].total_mobs) - if(mob.stat != CONSCIOUS) + if(!mob.stat || !mob.client) continue targets.Add(mob) else for(var/mob/mob as anything in faction_to_display.total_mobs) - if(mob.stat != CONSCIOUS) + if(!mob.stat || !mob.client) continue targets.Add(mob) @@ -40,13 +40,13 @@ for(var/faction_to_get in FACTION_LIST_HUMANOID - FACTION_YAUTJA) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] for(var/mob/mob as anything in faction.total_mobs) - if(mob.stat != CONSCIOUS) + if(!mob.stat || !mob.client) continue targets.Add(mob) else for(var/mob/mob as anything in faction_to_display.total_mobs) - if(mob.stat != CONSCIOUS) + if(!mob.stat || !mob.client) continue targets.Add(mob) diff --git a/code/game/area/admin_level.dm b/code/game/area/admin_level.dm index a4d70860d823..12fe28cbb585 100644 --- a/code/game/area/admin_level.dm +++ b/code/game/area/admin_level.dm @@ -92,7 +92,7 @@ ceiling = CEILING_UNDERGROUND_ALLOW_CAS flags_area = AREA_NOTUNNEL|AREA_ALLOW_XENO_JOIN - var/hivenumber = XENO_HIVE_ALPHA + var/hivenumber = FACTION_XENOMORPH_ALPHA /area/adminlevel/bunker01/caves/xeno/Entered(A, atom/OldLoc) . = ..() diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 8a6d87707229..2638e4c070cf 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -696,7 +696,8 @@ counted_xenos[faction_to_get] = list() for(var/caste in ALL_XENO_CASTES) counted_xenos[faction_to_get][caste] = 0 - counted_xenos[faction_to_get]["Pooled Larva"] = GLOB.faction_datums[faction_to_get].stored_larva + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) + counted_xenos[faction_to_get]["Pooled Larva"] = faction_module.stored_larva //Run through all our clients //add up our marines by job type, surv numbers, and non-standard humans we don't care too much about diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index 6e337b68640c..b15728a3c865 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -206,7 +206,8 @@ var/list/list/xenos_factions = list() for(var/faction_to_get in FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - if(!is_hive_living(action.get_faction_module(FACTION_MODULE_HIVE_MIND))) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!is_hive_living(faction_module)) continue xenos_factions += list(faction.code_identificator = list()) for(var/mob/living/carbon/xenomorph/zenomorph in faction.total_mobs) diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 123f323bbeab..1989f9aaee79 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -349,7 +349,6 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) xeno_announcement(SPAN_XENOANNOUNCE(warning), faction, XENO_GENERAL_ANNOUNCE) return - var/datum/hive_status/hive if(timing) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE ACTIVATED.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE ACTIVATED.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') @@ -596,7 +595,6 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) xeno_announcement(SPAN_XENOANNOUNCE(warning), faction, XENO_GENERAL_ANNOUNCE) return - var/datum/hive_status/hive if(decrypting) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DECRYPTION STARTED.\n\nDECRYPTION IN [floor(decryption_time/10)] SECONDS.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DECRYPTION STARTED.\n\nDECRYPTION IN [floor(decryption_time/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 49e78b6af3dc..687547551326 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -58,14 +58,14 @@ /obj/effect/xenomorph/spray/no_stun stun_duration = 0 -/obj/effect/xenomorph/spray/Initialize(mapload, new_cause_data, _faction_to_get) //Self-deletes +/obj/effect/xenomorph/spray/Initialize(mapload, new_cause_data, faction_to_set) //Self-deletes . = ..() // Stats tracking cause_data = new_cause_data - if(_faction_to_get) - faction_to_get = _faction_to_get + if(faction_to_set) + faction_to_get = faction_to_set // check what's in our turf for(var/atom/atm in loc) diff --git a/code/game/objects/effects/effect_system/smoke.dm b/code/game/objects/effects/effect_system/smoke.dm index b1a23e8645ca..7a306e012f4b 100644 --- a/code/game/objects/effects/effect_system/smoke.dm +++ b/code/game/objects/effects/effect_system/smoke.dm @@ -503,18 +503,26 @@ spread_speed = 6 smokeranking = SMOKE_RANK_BOILER - var/hivenumber = FACTION_XENOMORPH_NORMAL + var/faction_to_get = FACTION_XENOMORPH_NORMAL + var/datum/faction/faction + var/gas_damage = 20 -/obj/effect/particle_effect/smoke/xeno_burn/Initialize(mapload, amount, datum/cause_data/cause_data) - if(istype(cause_data)) - var/datum/ui_state/hive_state/cause_data_hive_state = GLOB.hive_state[cause_data.faction] - var/new_hive_number = cause_data_hive_state?.hivenumber - if(new_hive_number) - hivenumber = new_hive_number - set_hive_data(src, new_hive_number) +/obj/effect/particle_effect/smoke/xeno_burn/Initialize(mapload, amount, datum/cause_data/cause_data, mob/source_mob) + if(source_mob) + faction = source_mob.faction + faction_to_get = faction.code_identificator + else + faction = GLOB.faction_datums[faction_to_get] + + set_hive_data(src, faction) - return ..() + . = ..() + +/obj/effect/particle_effect/smoke/xeno_burn/Destroy() + faction = null + + . = ..() /obj/effect/particle_effect/smoke/xeno_burn/apply_smoke_effect(turf/cur_turf) ..() @@ -539,7 +547,7 @@ return FALSE if(affected_mob.stat == DEAD) return FALSE - if(affected_mob.ally_of_hivenumber(hivenumber)) + if(affected_mob.ally_faction(faction)) return FALSE if(isyautja(affected_mob) && prob(75)) return FALSE diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index f8be8916080b..ddff3de10cd0 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -355,7 +355,7 @@ force_nest = TRUE var/obj/effect/alien/resin/special/nest/linked_structure -/obj/structure/bed/nest/structure/Initialize(mapload, hive, obj/effect/alien/resin/special/nest/to_link) +/obj/structure/bed/nest/structure/Initialize(mapload, _faction_to_get, obj/effect/alien/resin/special/nest/to_link) . = ..() buckling_y = list("[NORTH]" = -19, "[SOUTH]" = 27, "[EAST]" = 3, "[WEST]" = 3) buckling_x = list("[NORTH]" = 0, "[SOUTH]" = 0, "[EAST]" = -17, "[WEST]" = 18) diff --git a/code/game/turfs/walls/wall_types.dm b/code/game/turfs/walls/wall_types.dm index 5783142ed29e..f47cb1a0bf35 100644 --- a/code/game/turfs/walls/wall_types.dm +++ b/code/game/turfs/walls/wall_types.dm @@ -731,17 +731,20 @@ var/faction_to_get = FACTION_XENOMORPH_NORMAL var/datum/faction/faction -/turf/closed/wall/resin/Initialize(mapload, mob/builder) +/turf/closed/wall/resin/Initialize(mapload, mob/builder, datum/faction/faction_to_set) . = ..() - - if(istype(builder)) + if(builder) faction = builder.faction + else if(faction_to_set) + faction = faction_to_set if(!faction) faction = GLOB.faction_datums[faction_to_get] else faction_to_get = faction.code_identificator + set_hive_data(src, faction) + for(var/obj/effect/alien/weeds/node/weed_node in contents) qdel(weed_node) @@ -802,7 +805,7 @@ /turf/closed/wall/resin/tutorial name = "tutorial resin wall" desc = "Weird slime solidified into a wall. Remarkably resilient." - faction_to_get = XENO_HIVE_TUTORIAL + faction_to_get = FACTION_XENOMORPH_TUTORIAL /turf/closed/wall/resin/tutorial/attack_alien(mob/living/carbon/xenomorph/xeno) return @@ -963,11 +966,15 @@ var/faction_to_get = FACTION_XENOMORPH_NORMAL -/obj/structure/alien/movable_wall/Initialize(mapload, _faction_to_get) +/obj/structure/alien/movable_wall/Initialize(mapload, mob/builder, datum/faction/faction_to_set) . = ..() - if(_faction_to_get) - faction_to_get = _faction_to_get - set_hive_data(src, faction_to_get) + if(builder) + faction_to_get = builder.faction.code_identificator + else if(faction_to_set) + faction_to_get = faction_to_set.code_identificator + + set_hive_data(src, GLOB.faction_datums[faction_to_get]) + recalculate_structure() update_tied_turf(loc) RegisterSignal(src, COMSIG_ATOM_TURF_CHANGE, PROC_REF(update_tied_turf)) @@ -1296,7 +1303,7 @@ R.check_resin_support() var/turf/closed/wall/resin/W = . - if (istype(W)) + if(istype(W)) W.faction = transfer_ref set_hive_data(W, W.faction) diff --git a/code/modules/admin/player_panel/actions/antag.dm b/code/modules/admin/player_panel/actions/antag.dm index b1c2da6be123..851304bcfda2 100644 --- a/code/modules/admin/player_panel/actions/antag.dm +++ b/code/modules/admin/player_panel/actions/antag.dm @@ -57,7 +57,7 @@ preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/xeno_cultist/leader] preset.load_race(H) - preset.load_status(H, params["hivenumber"]) + preset.load_status(H, GLOB.faction_datums[params["hivenumber"]]) var/title = params["leader"]? "xeno cultist leader" : "cultist" diff --git a/code/modules/admin/player_panel/player_panel.dm b/code/modules/admin/player_panel/player_panel.dm index c33b9d385b63..c59ac2c72bdb 100644 --- a/code/modules/admin/player_panel/player_panel.dm +++ b/code/modules/admin/player_panel/player_panel.dm @@ -517,7 +517,7 @@ GLOBAL_LIST_INIT(pp_hives, pp_generate_hives()) . = list() for(var/faction_to_get in FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - .[faction.name] = faction.faction_name + .[faction.name] = faction.code_identificator GLOBAL_LIST_INIT(pp_limbs, list( "Head" = "head", diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index c379ab58f3b1..75e6186755d4 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -172,7 +172,7 @@ message_admins("[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") var/mob/transformed - var/datum/faction/faction = GLOG.faction_datums[FACTION_XENOMORPH_NORMAL] + var/datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL] if(isxeno(M)) var/mob/living/carbon/xenomorph/X = M @@ -823,8 +823,8 @@ return var/list/hives = list() - for(var/hivenumber in GLOB.faction_datums) - var/datum/faction/hive = GLOB.faction_datums[hivenumber] + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/hive = GLOB.faction_datums[faction_to_get] hives += list("[hive.name]" = hive.code_identificator) var/newhive = tgui_input_list(usr,"Select a hive.", "Infect Larva", hives) @@ -866,30 +866,28 @@ return var/list/hives = list() - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - LAZYSET(hives, hive.name, hive) - LAZYSET(hives, "CANCEL", null) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + hives[faction.name] = faction + hives["CANCEL"] = null var/hive_name = tgui_input_list(usr, "Which Hive will he belongs to", "Make Cultist", hives) if(!hive_name || hive_name == "CANCEL") to_chat(usr, SPAN_ALERT("Hive choice error. Aborting.")) - var/datum/hive_status/hive = hives[hive_name] + var/datum/faction/hive = hives[hive_name] if(href_list["makecultist"]) var/datum/equipment_preset/preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/xeno_cultist] preset.load_race(H) - preset.load_status(H, hive.hivenumber) - message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist for [hive.name].") + preset.load_status(H, hive) + message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist for [hive].") else if(href_list["makecultistleader"]) var/datum/equipment_preset/preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/xeno_cultist/leader] preset.load_race(H) - preset.load_status(H, hive.hivenumber) - message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist leader for [hive.name].") - - H.faction = hive.internal_faction + preset.load_status(H, hive) + message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist leader for [hive].") else if(href_list["forceemote"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/topic/topic_events.dm b/code/modules/admin/topic/topic_events.dm index ae927c898e3a..f91052d49475 100644 --- a/code/modules/admin/topic/topic_events.dm +++ b/code/modules/admin/topic/topic_events.dm @@ -101,21 +101,21 @@ return var/list/mob/living/carbon/xenomorph/permit_recipients = list() - var/list/datum/hive_status/permit_hives = list() + var/list/datum/faction/permit_hives = list() switch(alert(usr, "Do you wish to do this for one Xeno or an entire hive?", "Recipients", "Xeno", "Hive", "All Xenos")) if("Xeno") permit_recipients += tgui_input_list(usr, "Select recipient Xenomorph:", "Armed Xenomorph", GLOB.living_xeno_list) if(isnull(permit_recipients[1])) //Cancel button. return if("Hive") - permit_hives += GLOB.faction_datums[tgui_input_list(usr, "Select recipient hive:", "Armed Hive", GLOB.faction_datums)] + permit_hives += GLOB.faction_datums[tgui_input_list(usr, "Select recipient hive:", "Armed Hive", FACTION_LIST_XENOMORPH)] if(isnull(permit_hives[1])) //Cancel button. return - permit_recipients = permit_hives[1].totalXenos.Copy() + permit_recipients = permit_hives[1].total_mobs.Copy() if("All Xenos") permit_recipients = GLOB.living_xeno_list.Copy() - for(var/H in GLOB.faction_datums) - permit_hives += GLOB.faction_datums[H] + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + permit_hives += GLOB.faction_datums[faction_to_get] var/list/handled_xenos = list() @@ -133,12 +133,13 @@ to_chat(xeno, SPAN_XENOANNOUNCE("You suddenly comprehend the magic of opposable thumbs along with surprising kinesthetic intelligence. You could do... so much with this knowledge.")) handled_xenos += xeno - for(var/datum/hive_status/permit_hive as anything in permit_hives) + for(var/datum/faction/permit_hive as anything in permit_hives) //Give or remove the trait from newly-born xenos in this hive. + var/datum/faction_module/hive_mind/faction_module = permit_hive.get_faction_module(FACTION_MODULE_HIVE_MIND) if(grant == "Grant") - LAZYADD(permit_hive.hive_inherant_traits, TRAIT_OPPOSABLE_THUMBS) + faction_module.hive_inherant_traits |= TRAIT_OPPOSABLE_THUMBS else - LAZYREMOVE(permit_hive.hive_inherant_traits, TRAIT_OPPOSABLE_THUMBS) + faction_module.hive_inherant_traits -= TRAIT_OPPOSABLE_THUMBS if(!length(handled_xenos) && !length(permit_hives)) return diff --git a/code/modules/admin/verbs/xooc.dm b/code/modules/admin/verbs/xooc.dm index c4f42c9e75d5..ea28c1b70c03 100644 --- a/code/modules/admin/verbs/xooc.dm +++ b/code/modules/admin/verbs/xooc.dm @@ -16,7 +16,7 @@ msg = process_chat_markup(msg, list("*")) for(var/mob/living/carbon/M in GLOB.alive_mob_list) - if(M.client && M.hivenumber && (!M.client.admin_holder || !(M.client.admin_holder.rights & R_MOD))) // Send to xenos who are non-staff + if(M.client && M.faction && (!M.client.admin_holder || !(M.client.admin_holder.rights & R_MOD))) // Send to xenos who are non-staff to_chat(M, SPAN_XOOC("XOOC: [src.key]([src.admin_holder.rank]): [msg]")) for(var/mob/dead/observer/M in GLOB.observer_list) diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index 2428b6422621..44830827ea2b 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -12,9 +12,11 @@ var/faction_to_get = FACTION_XENOMORPH_NORMAL var/datum/faction/faction -/obj/effect/alien/Initialize(mapload, mob/builder) - if(istype(builder)) +/obj/effect/alien/Initialize(mapload, mob/builder, datum/faction/faction_to_set) + if(builder) faction = builder.faction + else if(faction_to_set) + faction = faction_to_set if(!faction) faction = GLOB.faction_datums[faction_to_get] @@ -222,7 +224,7 @@ "r_foot" ) -/obj/effect/alien/resin/spike/Initialize(mapload, hive) +/obj/effect/alien/resin/spike/Initialize(mapload) . = ..() setDir(pick(GLOB.alldirs)) @@ -510,7 +512,6 @@ src.Dismantle(1) /obj/structure/mineral_door/resin/ex_act(severity) - if(!density) severity *= EXPLOSION_DAMAGE_MODIFIER_DOOR_OPEN @@ -548,8 +549,9 @@ /obj/structure/mineral_door/resin/proc/forsaken_handling() SIGNAL_HANDLER if(is_ground_level(z)) - hivenumber = FACTION_XENOMORPH_FORSAKEN - set_hive_data(src, FACTION_XENOMORPH_FORSAKEN) + faction_to_get = FACTION_XENOMORPH_FORSAKEN + faction = GLOB.faction_datums[faction_to_get] + set_hive_data(src, faction) UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) @@ -577,7 +579,7 @@ var/currently_firing = FALSE -/obj/effect/alien/resin/acid_pillar/Initialize(mapload, hive) +/obj/effect/alien/resin/acid_pillar/Initialize(mapload) . = ..() START_PROCESSING(SSprocessing, src) @@ -589,7 +591,7 @@ if(get_dist(src, current_mob) > range) return FALSE - if(current_mob.ally_of_hivenumber(hivenumber)) + if(current_mob.ally_faction(faction)) if(!isxeno(current_mob)) return FALSE if(!current_mob.on_fire) @@ -662,7 +664,7 @@ info.distance_travelled++ info.current_turf = next_turf - new acid_type(next_turf, create_cause_data(initial(name)), hivenumber) + new acid_type(next_turf, create_cause_data(initial(name)), faction) return TRUE /obj/effect/alien/resin/acid_pillar/Destroy() @@ -673,7 +675,6 @@ return TRUE /obj/effect/alien/resin/acid_pillar/forsaken_handling() - SIGNAL_HANDLER UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) if(is_ground_level(z)) qdel(src) @@ -706,8 +707,9 @@ var/shield_to_give = 50 var/range = 2 -/obj/effect/alien/resin/shield_pillar/Initialize(mapload, hive) +/obj/effect/alien/resin/shield_pillar/Initialize(mapload) . = ..() + START_PROCESSING(SSshield_pillar, src) /obj/effect/alien/resin/shield_pillar/process() @@ -911,14 +913,11 @@ . = ..() -/obj/effect/alien/resin/king_cocoon/Initialize(mapload, hivenumber) +/obj/effect/alien/resin/king_cocoon/Initialize(mapload) . = ..() - if(hivenumber) - hive_number = hivenumber var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.has_hatchery = TRUE - color = faction.color for(var/x_offset in -1 to 1) for(var/y_offset in -1 to 1) @@ -998,7 +997,7 @@ * * playtime_restricted: Determines whether being below KING_PLAYTIME_HOURS makes the candidate invalid * * skip_playtime: Determines whether being above KING_PLAYTIME_HOURS makes the candidate invalid (does nothing unless playtime_restricted is FALSE) */ -/obj/effect/alien/resin/king_cocoon/proc/is_candidate_valid(datum/hive_status/hive, mob/candidate, playtime_restricted = TRUE, skip_playtime = TRUE) +/obj/effect/alien/resin/king_cocoon/proc/is_candidate_valid(datum/faction/faction_check, mob/candidate, playtime_restricted = TRUE, skip_playtime = TRUE) if(!candidate?.client) return FALSE if(isfacehugger(candidate) || islesserdrone(candidate)) @@ -1008,8 +1007,8 @@ return FALSE else if(candidate.client.get_total_xeno_playtime() >= KING_PLAYTIME_HOURS && skip_playtime) return FALSE // We do this under the assumption we tried it the other way already so don't ask twice - for(var/mob_name in hive.banished_ckeys) - if(hive.banished_ckeys[mob_name] == candidate.ckey) + for(var/mob_name in faction_check.banished_ckeys) + if(faction_check.banished_ckeys[mob_name] == candidate.ckey) return FALSE return TRUE @@ -1021,8 +1020,8 @@ * * candidate: The mob that we want to ask * * playtime_restricted: Determines whether being below KING_PLAYTIME_HOURS makes the candidate invalid (otherwise above) */ -/obj/effect/alien/resin/king_cocoon/proc/try_roll_candidate(datum/hive_status/hive, mob/candidate, playtime_restricted = TRUE) - if(!is_candidate_valid(hive, candidate, playtime_restricted)) +/obj/effect/alien/resin/king_cocoon/proc/try_roll_candidate(datum/faction/faction_check, mob/candidate, playtime_restricted = TRUE) + if(!is_candidate_valid(faction_check, candidate, playtime_restricted)) return FALSE return tgui_alert(candidate, "Would you like to become the King?", "Choice", list("Yes", "No"), 10 SECONDS) == "Yes" @@ -1047,16 +1046,15 @@ /// Initiates a vote that will end in 20 seconds to vote for the King. Hatching will then begin in 1 minute unless expedited. /obj/effect/alien/resin/king_cocoon/proc/start_vote(expedite = FALSE) rolling_candidates = TRUE - var/datum/hive_status/hive = GLOB.hive_datum[hive_number] - - var/list/mob/living/carbon/xenomorph/voting_candidates = hive.totalXenos.Copy() - hive.living_xeno_queen + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/list/mob/living/carbon/xenomorph/voting_candidates = faction.total_mobs.Copy() - faction_module.living_xeno_queen for(var/mob/living/carbon/xenomorph/voting_candidate in voting_candidates) - if(!is_candidate_valid(hive, voting_candidate)) + if(!is_candidate_valid(faction, voting_candidate)) voting_candidates -= voting_candidate - for(var/mob/living/carbon/xenomorph/candidate in hive.totalXenos) - if(is_candidate_valid(hive, candidate, playtime_restricted = FALSE, skip_playtime = FALSE)) + for(var/mob/living/carbon/xenomorph/candidate in faction.total_mobs) + if(is_candidate_valid(faction, candidate, playtime_restricted = FALSE, skip_playtime = FALSE)) INVOKE_ASYNC(src, PROC_REF(cast_vote), candidate, voting_candidates) addtimer(CALLBACK(src, PROC_REF(roll_candidates), voting_candidates, expedite), 20 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) diff --git a/code/modules/cm_aliens/hivebuffs/hivebuff.dm b/code/modules/cm_aliens/hivebuffs/hivebuff.dm index cf8019835ebe..1f0921e0ac75 100644 --- a/code/modules/cm_aliens/hivebuffs/hivebuff.dm +++ b/code/modules/cm_aliens/hivebuffs/hivebuff.dm @@ -19,7 +19,7 @@ /// Timer id for cooldown duration var/_timer_id_cooldown = TIMER_ID_NULL /// The hive that this buff is applied to. - var/datum/hive_status/hive + var/datum/faction_module/hive_mind/hive ///Name of the buff, short and to the point var/name = "Hivebuff" /// Description of what the buff does. @@ -69,7 +69,7 @@ /// _on_cease timer id var/cease_timer_id -/datum/hivebuff/New(datum/hive_status/xenohive) +/datum/hivebuff/New(datum/faction_module/hive_mind/xenohive) . = ..() if(!xenohive || !istype(xenohive)) stack_trace("Hivebuff created without correct hive_status passed.") @@ -133,7 +133,7 @@ to_chat(purchasing_mob, SPAN_XENONOTICE(special_fail_message)) return FALSE - log_admin("[key_name(purchasing_mob)] of [hive.hivenumber] is attempting to purchase a hive buff: [name].") + log_admin("[key_name(purchasing_mob)] of [hive.faction_owner] is attempting to purchase a hive buff: [name].") if(!_seek_queen_approval(purchasing_mob)) return FALSE @@ -158,14 +158,14 @@ if(!_purchase_and_deduct(purchasing_mob)) return - for(var/mob/living/carbon/xenomorph/xeno in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in hive.faction_owner.total_mobs) apply_buff_effects(xeno) if(apply_on_new_xeno) RegisterSignal(SSdcs, COMSIG_GLOB_XENO_SPAWN, PROC_REF(_handle_xenomorph_new)) var/involved = purchasing_mob == hive.living_xeno_queen ? "[key_name_admin(purchasing_mob)]" : "[key_name_admin(purchasing_mob)] and [key_name_admin(hive.living_xeno_queen)]" - message_admins("[involved] of [hive.hivenumber] has purchased a hive buff: [name].") + message_admins("[involved] of [hive.faction_owner] has purchased a hive buff: [name].") // Add to the relevant hive lists. LAZYADD(hive.used_hivebuffs, src) @@ -198,7 +198,7 @@ LAZYREMOVE(hive.active_hivebuffs, src) UnregisterSignal(SSdcs, COMSIG_GLOB_XENO_SPAWN) - for(var/mob/living/carbon/xenomorph/xeno in hive.totalXenos) + for(var/mob/living/carbon/xenomorph/xeno in hive.faction_owner.total_mobs) remove_buff_effects(xeno) if(cooldown_duration) @@ -296,7 +296,7 @@ /datum/hivebuff/proc/_announce_buff_engage() if(engage_flavourmessage) - xeno_announcement(SPAN_XENOANNOUNCE(engage_flavourmessage), hive.hivenumber, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE(engage_flavourmessage), hive.faction_owner, XENO_GENERAL_ANNOUNCE) if(marine_flavourmessage) faction_announcement(marine_flavourmessage, COMMAND_ANNOUNCE, 'sound/AI/bioscan.ogg') @@ -305,7 +305,7 @@ if(!duration) return - for(var/mob/living/xenomorph as anything in hive.totalXenos) + for(var/mob/living/xenomorph as anything in hive.faction_owner.total_mobs) if(!xenomorph.client) continue xenomorph.play_screen_text(cease_flavourmessage, override_color = "#740064") @@ -320,7 +320,7 @@ if(!(src in hive.active_hivebuffs)) return // If we're the same hive as the buff - if(new_xeno.hive == hive) + if(new_xeno.faction == hive) apply_buff_effects(new_xeno) ///The actual effects of the buff to apply @@ -361,7 +361,7 @@ var/value_before_buff /datum/hivebuff/evo_buff/on_engage(obj/effect/alien/resin/special/pylon/purchased_pylon) - value_before_buff = SSxevolution.get_evolution_boost_power(hive.hivenumber) + value_before_buff = SSxevolution.get_evolution_boost_power(hive.faction_owner.code_identificator) hive.override_evilution(value_before_buff * 2, TRUE) return TRUE @@ -408,7 +408,7 @@ return ..() /datum/hivebuff/game_ender_caste/handle_special_checks() - if(locate(/mob/living/carbon/xenomorph/king) in hive.totalXenos) + if(locate(/mob/living/carbon/xenomorph/king) in hive.faction_owner.total_mobs) special_fail_message = "Only one King may exist at a time." return FALSE @@ -447,7 +447,7 @@ pylon.protection_level = TURF_PROTECTION_OB pylon.update_icon() - new /obj/effect/alien/resin/king_cocoon(spawn_turf, hive.hivenumber) + new /obj/effect/alien/resin/king_cocoon(spawn_turf, hive) return TRUE diff --git a/code/modules/cm_aliens/structures/construction_node.dm b/code/modules/cm_aliens/structures/construction_node.dm index b364e49caa1b..5267cd8ab081 100644 --- a/code/modules/cm_aliens/structures/construction_node.dm +++ b/code/modules/cm_aliens/structures/construction_node.dm @@ -13,13 +13,6 @@ block_range = 1 var/datum/construction_template/xenomorph/template //What we're building - var/datum/faction/faction //Who gets what we build - -/obj/effect/alien/resin/construction/Initialize(mapload, faction_ref) - . = ..() - faction = faction_ref - if(faction?.color) - color = faction.color /obj/effect/alien/resin/construction/Destroy() if(template && faction && (template.plasma_stored < template.plasma_required)) diff --git a/code/modules/cm_aliens/structures/egg.dm b/code/modules/cm_aliens/structures/egg.dm index 0e03b71f34b9..1931eb2aac0c 100644 --- a/code/modules/cm_aliens/structures/egg.dm +++ b/code/modules/cm_aliens/structures/egg.dm @@ -20,7 +20,7 @@ /// Whether to convert/orphan once EGG_BURSTING is complete var/convert_on_release = FALSE -/obj/effect/alien/egg/Initialize(mapload, hive) +/obj/effect/alien/egg/Initialize(mapload) . = ..() create_egg_triggers() @@ -64,7 +64,7 @@ return var/turf/my_turf = get_turf(src) - var/obj/effect/alien/egg/carrier_egg/orphan/newegg = new(my_turf, hivenumber, weed_strength_required) + var/obj/effect/alien/egg/carrier_egg/orphan/newegg = new(my_turf, null, faction, weed_strength_required) newegg.flags_embryo = flags_embryo newegg.fingerprintshidden = fingerprintshidden newegg.fingerprintslast = fingerprintslast @@ -96,9 +96,9 @@ if(isxeno(user) && status == EGG_GROWN) . += "Ctrl + Click egg to retrieve child into your empty hand if you can carry it." if(isobserver(user) || isxeno(user) && status == EGG_GROWN) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - var/current_hugger_count = hive.get_current_playable_facehugger_count(); - . += "There are currently [SPAN_NOTICE("[current_hugger_count]")] facehuggers in the hive. The hive can support a total of [SPAN_NOTICE("[hive.playable_hugger_limit]")] facehuggers at present." + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/current_hugger_count = faction_module.get_current_playable_facehugger_count(); + . += "There are currently [SPAN_NOTICE("[current_hugger_count]")] facehuggers in the hive. The hive can support a total of [SPAN_NOTICE("[faction_module.playable_hugger_limit]")] facehuggers at present." /obj/effect/alien/egg/attack_alien(mob/living/carbon/xenomorph/M) if(status == EGG_BURST || status == EGG_DESTROYED) @@ -195,7 +195,7 @@ if(convert_on_release) convert() return //Don't need to spawn a hugger, a player controls it already! - var/obj/item/clothing/mask/facehugger/child = new(loc, hivenumber) + var/obj/item/clothing/mask/facehugger/child = new(loc, faction) child.flags_embryo = flags_embryo flags_embryo = NO_FLAGS // Lose the embryo flags when passed on @@ -299,7 +299,7 @@ /obj/effect/alien/egg/HasProximity(atom/movable/AM) if(status == EGG_GROWN) - if(!can_hug(AM, hivenumber) || isyautja(AM) || issynth(AM)) //Predators are too stealthy to trigger eggs to burst. Maybe the huggers are afraid of them. + if(!can_hug(AM, faction.code_identificator) || isyautja(AM) || issynth(AM)) //Predators are too stealthy to trigger eggs to burst. Maybe the huggers are afraid of them. return Burst(FALSE, TRUE, null) @@ -307,7 +307,7 @@ Burst(TRUE) /obj/effect/alien/egg/alpha - faction_to_get = XENO_HIVE_ALPHA + faction_to_get = FACTION_XENOMORPH_ALPHA /obj/effect/alien/egg/forsaken faction_to_get = FACTION_XENOMORPH_FORSAKEN @@ -324,13 +324,14 @@ to_chat(user, SPAN_WARNING("\The [src] doesn't have any facehuggers to inhabit.")) return - if(!GLOB.hive_datum[hivenumber].can_spawn_as_hugger(user)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.can_spawn_as_hugger(user)) return //Need to check again because time passed due to the confirmation window if(status != EGG_GROWN) to_chat(user, SPAN_WARNING("\The [src] doesn't have any facehuggers to inhabit.")) return - GLOB.hive_datum[hivenumber].spawn_as_hugger(user, src) + faction_module.spawn_as_hugger(user, src) Burst(FALSE, FALSE, null, TRUE) //The invisible traps around the egg to tell it there's a mob right next to it. @@ -437,7 +438,7 @@ SPECIAL EGG USED WHEN WEEDS LOST #define ORPHAN_EGG_MAXIMUM_LIFE 6 MINUTES // Should be longer than HIVECORE_COOLDOWN -/obj/effect/alien/egg/carrier_egg/orphan/Initialize(mapload, hivenumber, weed_strength_required) +/obj/effect/alien/egg/carrier_egg/orphan/Initialize(mapload, mob/builder, datum/faction/faction_to_set, weed_strength_required) src.weed_strength_required = weed_strength_required . = ..() @@ -445,7 +446,7 @@ SPECIAL EGG USED WHEN WEEDS LOST if(isnull(weed_strength_required)) return . - if(hivenumber != FACTION_XENOMORPH_FORSAKEN) + if(faction_to_get != FACTION_XENOMORPH_FORSAKEN) life_timer = addtimer(CALLBACK(src, PROC_REF(start_unstoppable_decay)), ORPHAN_EGG_MAXIMUM_LIFE, TIMER_STOPPABLE) var/my_turf = get_turf(src) @@ -492,7 +493,7 @@ SPECIAL EGG USED WHEN WEEDS LOST return var/turf/my_turf = get_turf(src) - var/obj/effect/alien/egg/newegg = new(my_turf, hivenumber) + var/obj/effect/alien/egg/newegg = new(my_turf, null, faction) newegg.flags_embryo = flags_embryo newegg.fingerprintshidden = fingerprintshidden newegg.fingerprintslast = fingerprintslast diff --git a/code/modules/cm_aliens/structures/fruit.dm b/code/modules/cm_aliens/structures/fruit.dm index 3c22f6a5fae0..a51bfb2a11f1 100644 --- a/code/modules/cm_aliens/structures/fruit.dm +++ b/code/modules/cm_aliens/structures/fruit.dm @@ -11,7 +11,6 @@ health = 25 layer = BUSH_LAYER // technically a plant amiright var/picked = FALSE - var/hivenumber = FACTION_XENOMORPH_NORMAL var/consume_delay = 2 SECONDS var/mature = FALSE var/flags = 0 @@ -52,10 +51,8 @@ bound_xeno = X bound_weed = W - hivenumber = X.hivenumber RegisterSignal(W, COMSIG_PARENT_QDELETING, PROC_REF(on_weed_expire)) RegisterSignal(X, COMSIG_PARENT_QDELETING, PROC_REF(handle_xeno_qdel)) - set_hive_data(src, hivenumber) //Keep timer value here timer_id = addtimer(CALLBACK(src, PROC_REF(mature)), time_to_mature * W.fruit_growth_multiplier, TIMER_UNIQUE | TIMER_STOPPABLE) . = ..() @@ -143,7 +140,7 @@ to_chat(affected_xeno, SPAN_XENODANGER("This fruit is already being picked!")) return - if(affected_xeno.a_intent != INTENT_HARM && (affected_xeno.can_not_harm(bound_xeno) || affected_xeno.hivenumber == hivenumber)) + if(affected_xeno.a_intent != INTENT_HARM && (affected_xeno.can_not_harm(bound_xeno) || affected_xeno.faction == faction)) var/cant_consume = prevent_consume(affected_xeno) if(cant_consume) return cant_consume @@ -287,7 +284,7 @@ for(var/mob/living/carbon/xenomorph/Z in range(pheromone_range, loc)) if(Z.ignores_pheromones) continue - if(aura_strength > Z.recovery_new && hivenumber == Z.hivenumber) + if(aura_strength > Z.recovery_new && faction == Z.faction) Z.recovery_new = aura_strength /obj/effect/alien/resin/fruit/speed diff --git a/code/modules/cm_aliens/structures/special/egg_morpher.dm b/code/modules/cm_aliens/structures/special/egg_morpher.dm index e7d44824c728..fa84bdaff2b8 100644 --- a/code/modules/cm_aliens/structures/special/egg_morpher.dm +++ b/code/modules/cm_aliens/structures/special/egg_morpher.dm @@ -26,8 +26,9 @@ COOLDOWN_DECLARE(spawn_cooldown) -/obj/effect/alien/resin/special/eggmorph/Initialize(mapload, hive_ref) +/obj/effect/alien/resin/special/eggmorph/Initialize(mapload) . = ..() + COOLDOWN_START(src, spawn_cooldown, get_egg_cooldown()) range_bounds = SQUARE(x, y, EGGMORPG_RANGE) diff --git a/code/modules/cm_aliens/structures/special/hive_cluster.dm b/code/modules/cm_aliens/structures/special/hive_cluster.dm index 6bb50c12840d..8e1dd6270883 100644 --- a/code/modules/cm_aliens/structures/special/hive_cluster.dm +++ b/code/modules/cm_aliens/structures/special/hive_cluster.dm @@ -20,8 +20,9 @@ var/plasma_stored = 0 var/plasma_required_to_repair = 300 -/obj/effect/alien/resin/special/cluster/Initialize(mapload, hive_ref) +/obj/effect/alien/resin/special/cluster/Initialize(mapload) . = ..() + node = place_node() update_minimap_icon() diff --git a/code/modules/cm_aliens/structures/special/pred_nest.dm b/code/modules/cm_aliens/structures/special/pred_nest.dm index b7821a0bb2aa..e6eb7137a514 100644 --- a/code/modules/cm_aliens/structures/special/pred_nest.dm +++ b/code/modules/cm_aliens/structures/special/pred_nest.dm @@ -18,13 +18,10 @@ if((isxeno(user) || isobserver(user)) && faction) . += "Used to secure formidable hosts." -/obj/effect/alien/resin/special/nest/Initialize(mapload, datum/hive_status/hive_ref) +/obj/effect/alien/resin/special/nest/Initialize(mapload) . = ..() - var/hive = 0 - if(hive_ref) - hive = hive_ref.hivenumber - pred_nest = new /obj/structure/bed/nest/structure(loc, hive, src) // Nest cannot be destroyed unless the structure itself is destroyed + pred_nest = new /obj/structure/bed/nest/structure(loc, faction.code_identificator, src) // Nest cannot be destroyed unless the structure itself is destroyed /obj/effect/alien/resin/special/nest/Destroy() diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index 6e5b38a3dedb..c8b5a1964bed 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -180,7 +180,6 @@ xeno_announcement(SPAN_XENOANNOUNCE("We have lost our control of the tall's communication relay at [get_area_name(src)]."), faction, XENO_GENERAL_ANNOUNCE) else xeno_announcement(SPAN_XENOANNOUNCE("Another hive has lost control of the tall's communication relay at [get_area_name(src)]."), faction, XENO_GENERAL_ANNOUNCE) - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.hive_ui.update_pylon_status() return ..() @@ -193,10 +192,10 @@ if(!length(check_faction.total_mobs)) continue - if(checked_hive == faction) + if(check_faction == faction) xeno_announcement(SPAN_XENOANNOUNCE("We have harnessed the tall's communication relay at [get_area_name(src)].\n\nWe will now grow royal resin from this pylon. Hold it!"), faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive has harnessed the tall's communication relay at [get_area_name(src)].[faction.faction_is_ally(checked_hive) ? "" : " Stop them!"]"), faction, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive has harnessed the tall's communication relay at [get_area_name(src)].[faction.faction_is_ally(check_faction) ? "" : " Stop them!"]"), faction, XENO_GENERAL_ANNOUNCE) activated = TRUE var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) @@ -245,15 +244,15 @@ lesser_drone_spawn_limit = 10 -/obj/effect/alien/resin/special/pylon/core/Initialize(mapload, datum/faction/faction_to_set) +/obj/effect/alien/resin/special/pylon/core/Initialize(mapload) . = ..() // Pick the closest xeno resource activator update_minimap_icon() - if(faction_to_set) - faction_to_set.set_hive_location(src, faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.set_hive_location(src, faction) /obj/effect/alien/resin/special/pylon/core/proc/update_minimap_icon() SSminimaps.remove_marker(src) @@ -454,8 +453,9 @@ /obj/effect/alien/resin/special/pylon/core/proc/cooldownFinish(datum/faction/faction) sleep(HIVECORE_COOLDOWN) - if(faction.hivecore_cooldown) // check if its true so we don't double set it. - faction.hivecore_cooldown = FALSE + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.hivecore_cooldown) // check if its true so we don't double set it. + faction_module.hivecore_cooldown = FALSE xeno_message(SPAN_XENOANNOUNCE("The weeds have recovered! A new hive core can be built!"), 3, faction) else log_admin("Hivecore cooldown reset proc aborted due to hivecore cooldown var being set to false before the cooldown has finished!") diff --git a/code/modules/cm_aliens/structures/special_structure.dm b/code/modules/cm_aliens/structures/special_structure.dm index b192fafb6794..b13925c33c3b 100644 --- a/code/modules/cm_aliens/structures/special_structure.dm +++ b/code/modules/cm_aliens/structures/special_structure.dm @@ -20,8 +20,9 @@ /// Tells the structure if they are being deleted because of hijack var/hijack_delete = FALSE -/obj/effect/alien/resin/special/Initialize(mapload, mob/builder) +/obj/effect/alien/resin/special/Initialize(mapload) . = ..() + maxhealth = health var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) @@ -33,8 +34,8 @@ /obj/effect/alien/resin/special/Destroy() if(faction) - faction.remove_special_structure(src) var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.remove_special_structure(src) if(faction_module.living_xeno_queen) xeno_message("Hive: \A [name] has been destroyed at [sanitize_area(get_area_name(src))]!", 3, faction) STOP_PROCESSING(SSfastobj, src) diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 227de0f594ac..7a42833460d6 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -26,29 +26,26 @@ health = 140 var/id = null //For mapping -/obj/structure/tunnel/Initialize(mapload, h_number) +/obj/structure/tunnel/Initialize(mapload, datum/faction/faction) . = ..() var/turf/L = get_turf(src) tunnel_desc = L.loc.name + " ([loc.x], [loc.y]) [pick(GLOB.greek_letters)]"//Default tunnel desc is the (x, y) - if(h_number && GLOB.hive_datum[h_number]) - hivenumber = h_number - hive = GLOB.hive_datum[h_number] - - set_hive_data(src, h_number) - - hive.tunnels += src - - if(!hive) - hive = GLOB.hive_datum[hivenumber] + if(faction) + src.faction = faction + faction_to_get = faction.code_identificator + else + src.faction = GLOB.faction_datums[faction_to_get] - hive.tunnels += src + set_hive_data(src, faction) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.tunnels += src var/obj/effect/alien/resin/trap/resin_trap = locate() in L if(resin_trap) qdel(resin_trap) - if(hivenumber == FACTION_XENOMORPH_NORMAL) + if(faction_to_get == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) SSminimaps.add_marker(src, z, faction.minimap_flag, "xenotunnel") @@ -67,8 +64,9 @@ UnregisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING) /obj/structure/tunnel/Destroy() - if(hive) - hive.tunnels -= src + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.tunnels -= src + faction = null for(var/mob/living/carbon/xenomorph/X in contents) X.forceMove(loc) @@ -77,7 +75,7 @@ /obj/structure/tunnel/proc/isfriendly(mob/target) var/mob/living/carbon/C = target - if(istype(C) && C.ally_of_hivenumber(hivenumber)) + if(istype(C) && C.ally_faction(faction)) return TRUE return FALSE @@ -143,12 +141,13 @@ /obj/structure/tunnel/proc/pick_tunnel(mob/living/carbon/xenomorph/X) . = FALSE //For peace of mind when it comes to dealing with unintended proc failures - if(!istype(X) || X.is_mob_incapacitated(TRUE) || !isfriendly(X) || !hive) + if(!istype(X) || X.is_mob_incapacitated(TRUE) || !isfriendly(X)) return FALSE if(X in contents) var/list/input_tunnels = list() - var/list/sorted_tunnels = sort_list_dist(hive.tunnels, get_turf(X)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/list/sorted_tunnels = sort_list_dist(faction_module.tunnels, get_turf(X)) for(var/obj/structure/tunnel/T in sorted_tunnels) if(T == src) continue @@ -238,7 +237,8 @@ to_chat(M, SPAN_XENOWARNING("We can't climb through a tunnel while immobile.")) return XENO_NO_DELAY_ACTION - if(!length(hive.tunnels)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!length(faction_module.tunnels)) to_chat(M, SPAN_WARNING("[src] doesn't seem to lead anywhere.")) return XENO_NO_DELAY_ACTION @@ -265,7 +265,7 @@ to_chat(M, SPAN_WARNING("Our crawling was interrupted!")) return XENO_NO_DELAY_ACTION - if(length(hive.tunnels)) //Make sure other tunnels exist + if(length(faction_module.tunnels)) //Make sure other tunnels exist M.forceMove(src) //become one with the tunnel to_chat(M, SPAN_HIGHDANGER("Alt + Click the tunnel to exit, Ctrl + Click to choose a destination.")) pick_tunnel(M) diff --git a/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm b/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm index 428626717908..0141a82970af 100644 --- a/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm +++ b/code/modules/cm_aliens/structures/xeno_structures_boilertrap.dm @@ -20,13 +20,13 @@ /obj/effect/alien/resin/boilertrap/empowered root_duration = 30 -/obj/effect/alien/resin/boilertrap/Initialize(mapload, mob/living/carbon/xenomorph/X) - if(mapload || !istype(X)) +/obj/effect/alien/resin/boilertrap/Initialize(mapload, mob/living/carbon/xenomorph/builder) + if(mapload || !istype(builder)) return INITIALIZE_HINT_QDEL - bound_xeno = X - hivenumber = X.hivenumber - set_hive_data(src, hivenumber) - return ..() + + . = ..() + + bound_xeno = builder /obj/effect/alien/resin/boilertrap/Destroy(force) bound_xeno = null diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index d053727e6aec..a5b4aad5012f 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -30,9 +30,9 @@ // Which node is responsible for keeping this weed patch alive? var/obj/effect/alien/weeds/node/parent = null -/obj/effect/alien/weeds/Initialize(mapload, obj/effect/alien/weeds/node/node, datum/faction/_faction, use_node_strength=TRUE, do_spread=TRUE) - if(_faction) - faction = _faction +/obj/effect/alien/weeds/Initialize(mapload, obj/effect/alien/weeds/node/node, datum/faction/faction_to_set, use_node_strength=TRUE, do_spread=TRUE) + if(faction_to_set) + faction = faction_to_set else if(node) faction = node.faction @@ -124,7 +124,7 @@ health = WEED_HEALTH_STANDARD alpha = 127 -/obj/effect/alien/weeds/node/weak/Initialize(mapload, obj/effect/alien/weeds/node/node, mob/living/carbon/xenomorph/X, datum/hive_status/hive) +/obj/effect/alien/weeds/node/weak/Initialize(mapload, obj/effect/alien/weeds/node/node, mob/living/carbon/xenomorph/X, datum/faction/faction_to_set) . = ..() name = initial(name) weed_strength = WEED_LEVEL_WEAK @@ -246,7 +246,7 @@ weeds.Add(new /obj/effect/alien/weeds/weedwall(T, node)) continue else if( istype(T, /turf/closed)) - weeds.Add(new /obj/effect/alien/weeds(T, node, TRUE, FALSE)) + weeds.Add(new /obj/effect/alien/weeds(T, node, faction, TRUE, FALSE)) continue if(!weed_expand_objects(T, dirn)) @@ -508,9 +508,9 @@ overlay_node = TRUE overlays += staticnode -/obj/effect/alien/weeds/node/Initialize(mapload, obj/effect/alien/weeds/node/node, mob/living/carbon/xenomorph/xeno, datum/faction/_faction) - if(istype(_faction)) - faction = _faction +/obj/effect/alien/weeds/node/Initialize(mapload, obj/effect/alien/weeds/node/node, mob/living/carbon/xenomorph/xeno, datum/faction/faction_to_set) + if(istype(faction_to_set)) + faction = faction_to_set else if (istype(xeno) && xeno.faction) faction = xeno.faction else diff --git a/code/modules/defenses/bell_tower.dm b/code/modules/defenses/bell_tower.dm index e567f9e8f026..a22de7491a2f 100644 --- a/code/modules/defenses/bell_tower.dm +++ b/code/modules/defenses/bell_tower.dm @@ -51,7 +51,7 @@ /obj/structure/machinery/defenses/bell_tower/proc/setup_tripwires() clear_tripwires() for(var/turf/T in orange(BELL_TOWER_RANGE, loc)) - var/obj/effect/bell_tripwire/FE = new /obj/effect/bell_tripwire(T, faction_group) + var/obj/effect/bell_tripwire/FE = new /obj/effect/bell_tripwire(T, faction) FE.linked_bell = src tripwires_placed += FE @@ -77,17 +77,19 @@ invisibility = 101 unacidable = TRUE var/obj/structure/machinery/defenses/bell_tower/linked_bell - var/faction = FACTION_LIST_MARINE + var/datum/faction/faction -/obj/effect/bell_tripwire/New(turf/T, faction = null) - ..(T) - if(faction) - src.faction = faction +/obj/effect/bell_tripwire/Initialize(mapload, datum/faction/faction_to_set) + . = ..() + + if(faction_to_set) + faction = faction_to_set /obj/effect/bell_tripwire/Destroy() if(linked_bell) linked_bell.tripwires_placed -= src linked_bell = null + faction = null . = ..() /obj/effect/bell_tripwire/Crossed(atom/movable/A) @@ -160,11 +162,11 @@ /obj/structure/machinery/defenses/bell_tower/md/setup_tripwires() md = new(src) md.linked_tower = src - md.iff_signal = LAZYACCESS(faction_group, 1) + md.iff_signal = faction md.toggle_active(null, FALSE) if(!md.iff_signal) - md.iff_signal = FACTION_MARINE + md.iff_signal = GLOB.faction_datums[FACTION_MARINE] /obj/structure/machinery/defenses/bell_tower/md/clear_tripwires() if(md) diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index d49d21c56523..8a525be908fd 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -39,17 +39,17 @@ var/obj/item/device/sentry_computer/linked_laptop = null var/has_camera = FALSE var/list/choice_categories = list( - SENTRY_CATEGORY_IFF = list(FACTION_ALLY, SENTRY_FACTION_OWN), + SENTRY_CATEGORY_IFF = list(SENTRY_FACTION_ALLY, SENTRY_FACTION_OWN), ) var/list/selected_categories = list( SENTRY_CATEGORY_IFF = SENTRY_FACTION_OWN, ) + var/sentry_iff_mode = SENTRY_FACTION_ALLY var/faction_to_get var/datum/faction/faction - /obj/structure/machinery/defenses/Initialize() . = ..() update_icon() @@ -141,7 +141,6 @@ return TRUE return FALSE - /obj/structure/machinery/defenses/start_processing() if(!machine_processing) machine_processing = TRUE @@ -160,8 +159,10 @@ if(owner_mob && owner_mob != src) owner_mob.track_shot(initial(name)) -/obj/structure/machinery/defenses/proc/friendly_faction(factions) - if(factions in faction_group) +/obj/structure/machinery/defenses/proc/friendly_faction(mob/user) + if(sentry_iff_mode == SENTRY_FACTION_ALLY) + return user.ally_faction(faction) + if(user.faction == faction) return TRUE return FALSE @@ -190,9 +191,8 @@ return if(additional_shock >= 2) return - LAZYCLEARLIST(faction_group) - for(var/i in user.faction_group) - LAZYADD(faction_group, i) + faction = user.faction + faction_to_get = faction.code_identificator to_chat(user, SPAN_WARNING("You've hacked \the [src], it's now ours!")) return @@ -271,9 +271,9 @@ playsound(loc, 'sound/mecha/mechmove04.ogg', 30, 1) var/turf/T = get_turf(src) - if(!faction_group) //Littly trolling for stealing marines turrets, bad boys! - for(var/i in user.faction_group) - LAZYADD(faction_group, i) + if(!faction) + faction = user.faction + faction_to_get = faction.code_identificator power_off() HD.forceMove(T) transfer_label_component(HD) @@ -353,7 +353,7 @@ add_fingerprint(user) - if(!friendly_faction(user.faction)) + if(!friendly_faction(user)) return if(!anchored) @@ -471,7 +471,7 @@ return if(!ishuman(usr)) return - if(!friendly_faction(usr.faction)) + if(!friendly_faction(usr)) return if(!skillcheck(usr, SKILL_ENGINEER, SKILL_ENGINEER_TRAINED)) to_chat(usr, SPAN_WARNING("You don't have the training to do this.")) diff --git a/code/modules/defenses/handheld.dm b/code/modules/defenses/handheld.dm index 8b36514a88de..61162454a56b 100644 --- a/code/modules/defenses/handheld.dm +++ b/code/modules/defenses/handheld.dm @@ -83,10 +83,10 @@ playsound(T, 'sound/mecha/mechmove01.ogg', 30, 1) - if(!TR.faction_group) //Littly trolling for stealing marines turrets, bad boys! - for(var/i in user.faction_group) - LAZYADD(TR.faction_group, i) - TR.forceMove(get_turf(T)) + if(!TR.faction) + TR.faction = user.faction + TR.faction_to_get = TR.faction.code_identificator + forceMove(get_turf(T)) TR.placed = 1 TR.update_icon() TR.setDir(direction) diff --git a/code/modules/defenses/sentry.dm b/code/modules/defenses/sentry.dm index 601935df0397..964aef108415 100644 --- a/code/modules/defenses/sentry.dm +++ b/code/modules/defenses/sentry.dm @@ -45,7 +45,7 @@ /// action list is configurable for all subtypes, this is just an example choice_categories = list( // SENTRY_CATEGORY_ROF = list(ROF_SINGLE, ROF_BURST, ROF_FULL_AUTO), - SENTRY_CATEGORY_IFF = list(FACTION_ALLY, SENTRY_FACTION_OWN), + SENTRY_CATEGORY_IFF = list(SENTRY_FACTION_ALLY, SENTRY_FACTION_OWN), ) selected_categories = list( @@ -312,7 +312,7 @@ new_projectile.generate_bullet(new ammo.default_ammo) new_projectile.damage *= damage_mult new_projectile.accuracy *= accuracy_mult - GIVE_BULLET_TRAIT(new_projectile, /datum/element/bullet_trait_iff, faction_group) + GIVE_BULLET_TRAIT(new_projectile, /datum/element/bullet_trait_iff, faction) new_projectile.fire_at(target, owner_mob, src, new_projectile.ammo.max_range, new_projectile.ammo.shell_speed, null, FALSE) muzzle_flash(Get_Angle(get_turf(src), target)) ammo.current_rounds-- @@ -472,7 +472,7 @@ immobile = TRUE turned_on = TRUE icon_state = "premade" //for the map editor only - faction_group = FACTION_LIST_MARINE + faction_to_get = FACTION_MARINE static = TRUE /obj/structure/machinery/defenses/sentry/premade/get_examine_text(mob/user) @@ -494,7 +494,7 @@ /obj/structure/machinery/defenses/sentry/premade/dumb name = "modified UA-577 Gauss Turret" desc = "A deployable, semi-automated turret with AI targeting capabilities. Armed with an M30 Autocannon and a high-capacity drum magazine. This one's IFF system has been disabled, and it will open fire on any targets within range." - faction_group = null + faction_to_get = null ammo = new /obj/item/ammo_magazine/sentry/premade/dumb //the turret inside a static sentry deployment system @@ -502,7 +502,7 @@ name = "\improper UA-633 Static Gauss Turret" desc = "A fully-automated defence turret with mid-range targeting capabilities. Armed with a modified M32-S Autocannon and an internal belt feed." density = TRUE - faction_group = FACTION_LIST_MARINE + faction_to_get = FACTION_MARINE fire_delay = 1 ammo = new /obj/item/ammo_magazine/sentry/premade var/obj/structure/machinery/sentry_holder/deployment_system @@ -514,7 +514,7 @@ . = ..() /obj/structure/machinery/defenses/sentry/premade/deployable/colony - faction_group = list(FACTION_MARINE, FACTION_COLONIST, FACTION_SURVIVOR, FACTION_NSPA) + faction_to_get = FACTION_COLONIST /obj/structure/machinery/defenses/sentry/premade/deployable/colony/wy name = "WY 5-GSE3 Static Turret" @@ -522,7 +522,7 @@ icon = 'icons/obj/structures/machinery/defenses/wy_static.dmi' defense_type = "Static" sentry_type = "wy_sentry" - faction_group = list(FACTION_MARINE, FACTION_COLONIST, FACTION_SURVIVOR, FACTION_WY, FACTION_NSPA) + faction_to_get = FACTION_WY /obj/structure/machinery/defenses/sentry/premade/deployable/almayer name = "\improper UA-635C Static Gauss Turret" @@ -610,7 +610,7 @@ //the turret inside the shuttle sentry deployment system /obj/structure/machinery/defenses/sentry/premade/dropship density = TRUE - faction_group = FACTION_LIST_MARINE + faction_to_get = FACTION_MARINE omni_directional = TRUE choice_categories = list() selected_categories = list() @@ -701,7 +701,7 @@ name = "\improper UA 571-O sentry post" desc = "A deployable, omni-directional automated turret with AI targeting capabilities. Armed with an M30 Autocannon and a 100-round drum magazine with 500 rounds stored internally. Due to the deployment method it is incapable of being moved." ammo = new /obj/item/ammo_magazine/sentry/dropped - faction_group = FACTION_LIST_MARINE + faction_to_get = FACTION_MARINE omni_directional = TRUE additional_rounds_stored = TRUE immobile = TRUE diff --git a/code/modules/defenses/sentry_flamer.dm b/code/modules/defenses/sentry_flamer.dm index 8cbd1e440416..a3c7c2431d01 100644 --- a/code/modules/defenses/sentry_flamer.dm +++ b/code/modules/defenses/sentry_flamer.dm @@ -11,7 +11,7 @@ choice_categories = list( // SENTRY_CATEGORY_ROF = list(ROF_SINGLE, ROF_FULL_AUTO), - SENTRY_CATEGORY_IFF = list(FACTION_ALLY, SENTRY_FACTION_OWN), + SENTRY_CATEGORY_IFF = list(SENTRY_FACTION_ALLY, SENTRY_FACTION_OWN), ) selected_categories = list( @@ -31,7 +31,7 @@ /obj/structure/machinery/defenses/sentry/flamer/actual_fire(atom/target) var/obj/projectile/new_projectile = new(src, create_cause_data(initial(name), owner_mob, src)) new_projectile.generate_bullet(new ammo.default_ammo) - GIVE_BULLET_TRAIT(new_projectile, /datum/element/bullet_trait_iff, faction_group) + GIVE_BULLET_TRAIT(new_projectile, /datum/element/bullet_trait_iff, faction) new_projectile.fire_at(target, owner_mob, src, new_projectile.ammo.max_range, new_projectile.ammo.shell_speed, null, FALSE) ammo.current_rounds-- track_shot() diff --git a/code/modules/gear_presets/_select_equipment.dm b/code/modules/gear_presets/_select_equipment.dm index 179ce6435d10..e11c1e6f31ce 100644 --- a/code/modules/gear_presets/_select_equipment.dm +++ b/code/modules/gear_presets/_select_equipment.dm @@ -160,10 +160,10 @@ /datum/equipment_preset/proc/load_preset(mob/living/carbon/human/new_human, randomise = FALSE, count_participant = FALSE, client/mob_client, show_job_gear = TRUE) if(!istype(new_human, /mob/living/carbon/human/dummy)) var/datum/faction/mob_faction - if(!faction) + if(!job_faction) mob_faction = GLOB.faction_datums[FACTION_NEUTRAL] else - mob_faction = GLOB.faction_datums[faction] + mob_faction = GLOB.faction_datums[job_faction] if(mob_faction && (!new_human.faction || force_update_faction)) mob_faction.add_mob(new_human) @@ -198,7 +198,7 @@ load_vanity(new_human, mob_client) load_traits(new_human, mob_client) if(GLOB.round_statistics && count_participant) - GLOB.round_statistics.track_new_participant(faction) + GLOB.round_statistics.track_new_participant(job_faction) new_human.assigned_equipment_preset = src diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index f7a526bbb20a..f738b7932926 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -678,7 +678,6 @@ if(istype(uniform)) uniform.has_sensor = UNIFORM_HAS_SENSORS new_human.job = "Zombie" - new_human.faction = faction return ..() /datum/equipment_preset/other/zombie/load_race(mob/living/carbon/human/new_human) @@ -821,16 +820,20 @@ new_human.equip_to_slot_or_del(new /obj/item/clothing/gloves/marine/veteran(new_human), WEAR_HANDS) //*****************************************************************************************************/ -/datum/equipment_preset/other/xeno_cultist/load_status(mob/living/carbon/human/new_human, hivenumber = FACTION_XENOMORPH_NORMAL) +/datum/equipment_preset/other/xeno_cultist/load_status(mob/living/carbon/human/new_human, datum/faction/faction = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) if(SSticker.mode && new_human.mind) SSticker.mode.xenomorphs += new_human.mind - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - if(hive) - new_human.faction = hive.internal_faction - if(hive.leading_cult_sl == new_human) - hive.leading_cult_sl = null - new_human.hivenumber = hivenumber + if(faction) + var/datum/faction_module/hive_mind/faction_module = new_human.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module && faction_module.leading_cult_sl == new_human) + faction_module.leading_cult_sl = null + + faction.add_mob(new_human) + if(faction.organ_faction_iff_tag_type) + if(new_human.organ_faction_tag) + QDEL_NULL(new_human.organ_faction_tag) + new_human.organ_faction_tag = new faction.organ_faction_iff_tag_type(new_human, faction) GLOB.xeno_cultists += new_human @@ -866,11 +869,11 @@ . = ..() new_human.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/cultist(new_human), WEAR_EYES) -/datum/equipment_preset/other/xeno_cultist/leader/load_status(mob/living/carbon/human/new_human) +/datum/equipment_preset/other/xeno_cultist/leader/load_status(mob/living/carbon/human/new_human, datum/faction/faction) . = ..() - var/datum/hive_status/hive = GLOB.hive_datum[new_human.hivenumber] - hive.leading_cult_sl = new_human + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.leading_cult_sl = new_human var/list/types = subtypesof(/datum/action/human_action/activable/cult_leader) for(var/type in types) diff --git a/code/modules/gear_presets/synths.dm b/code/modules/gear_presets/synths.dm index ec75226da877..cc1733ca8fcc 100644 --- a/code/modules/gear_presets/synths.dm +++ b/code/modules/gear_presets/synths.dm @@ -741,7 +741,7 @@ new_human.b_facial = 255 /datum/equipment_preset/synth/working_joe/load_name(mob/living/carbon/human/new_human, randomise) - if(src.faction == FACTION_UPP) + if(job_faction == FACTION_UPP) new_human.change_real_name(new_human, "Dzho Automaton №[rand(9)][rand(9)][ascii2text(rand(65, 90))][ascii2text(rand(65, 90))]") else new_human.change_real_name(new_human, "Working Joe #[rand(100)][rand(100)]") diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 0def73513046..7468878faf19 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -883,28 +883,27 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc = "Check the status of the hive." set category = "Ghost.View" - var/list/hives = list() - var/datum/hive_status/last_hive_checked - - var/datum/hive_status/hive - for(var/hivenumber in GLOB.hive_datum) - hive = GLOB.hive_datum[hivenumber] - if(length(hive.totalXenos) > 0) - hives += list("[hive.name]" = hive.hivenumber) - last_hive_checked = hive + var/list/datum/faction/hives = list() + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs)) + continue + hives[faction.name] = faction if(!length(hives)) to_chat(src, SPAN_ALERT("There seem to be no living hives at the moment")) return else if(length(hives) == 1) // Only one hive, don't need an input menu for that - last_hive_checked.hive_ui.open_hive_status(src) + var/datum/faction_module/hive_mind/faction_module = hives[1].get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.open_hive_status(src) else - faction = tgui_input_list(src, "Select which hive status menu to open up", "Hive Choice", hives, theme="hive_status") - if(!faction) + var/selected_hive = tgui_input_list(src, "Select which hive status menu to open up", "Hive Choice", hives, theme="hive_status") + if(!selected_hive) to_chat(src, SPAN_ALERT("Hive choice error. Aborting.")) return - GLOB.hive_datum[hives[faction]].hive_ui.open_hive_status(src) + var/datum/faction_module/hive_mind/faction_module = hives[selected_hive].get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.hive_ui.open_hive_status(src) /mob/dead/observer/verb/view_uscm_tacmap() set name = "View USCM Tacmap" @@ -916,8 +915,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "View Xeno Tacmap" set category = "Ghost.View" - var/datum/hive_status/hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] - if(!hive || !length(hive.totalXenos)) + var/datum/faction/hive = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL] + if(!length(hive.total_mobs)) to_chat(src, SPAN_ALERT("There seems to be no living normal hive at the moment")) return diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index 7871c7bbee75..3500f76e2b8a 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -122,7 +122,7 @@ serialized["caste"] = caste.caste_type serialized["icon"] = caste.minimap_icon serialized["background_icon"] = caste.minimap_background - serialized["hivenumber"] = xeno.hivenumber + serialized["hivenumber"] = xeno.faction.code_identificator serialized["area_name"] = get_area_name(xeno) xenos += list(serialized) continue @@ -163,8 +163,8 @@ predators += list(serialized) else if(human.faction in FACTION_LIST_ERT_OTHER) ert_members += list(serialized) - else if(human.faction in FACTION_LIST_HUNTED) - hunted += list(serialized) +// else if(human.faction in FACTION_LIST_HUNTED) TODO FACTION +// hunted += list(serialized) else if(human.faction in FACTION_LIST_UPP) upp += list(serialized) else if(human.faction in FACTION_LIST_CLF) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index c2d0c63e3307..1f38bf728be8 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -110,7 +110,7 @@ //An even amount of each plasma and blood type if(plasma == PLASMA_EGG) //Preserve hive_number for the possible larva - O.reagents.add_reagent(plasma, amount / length(plasmas), list("hive_number" = hivenumber)) + O.reagents.add_reagent(plasma, amount / length(plasmas), list("hive_number" = faction.code_identificator)) else O.reagents.add_reagent(plasma, amount / length(plasmas)) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 30a67ba60a64..1840ce54081f 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -80,8 +80,8 @@ if(SSticker.mode && SSticker.mode.is_in_endgame && SSticker.current_state != GAME_STATE_FINISHED && is_mainship_level(z)) var/mob/last_living_human var/shipside_humans_count = 0 - var/datum/hive_status/main_hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] - var/see_humans_on_tacmap = main_hive.see_humans_on_tacmap + var/datum/faction_module/hive_mind/hive_module = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL].get_faction_module(FACTION_MODULE_HIVE_MIND) + var/see_humans_on_tacmap = hive_module.see_humans_on_tacmap for(var/mob/living/carbon/human/cur_human as anything in GLOB.alive_human_list) if(!is_mainship_level(cur_human.z)) continue @@ -91,9 +91,9 @@ break last_living_human = cur_human - if(!see_humans_on_tacmap && shipside_humans_count < (main_hive.get_real_total_xeno_count() * HIJACK_RATIO_FOR_TACMAP)) + if(!see_humans_on_tacmap && shipside_humans_count < (hive_module.get_real_total_xeno_count() * HIJACK_RATIO_FOR_TACMAP)) xeno_announcement("There is only a handful of tallhosts left, they are now visible on our hive mind map.", FACTION_XENOMORPH_NORMAL, SPAN_ANNOUNCEMENT_HEADER_BLUE("[QUEEN_MOTHER_ANNOUNCE]")) - main_hive.see_humans_on_tacmap = TRUE + hive_module.see_humans_on_tacmap = TRUE if(last_living_human && shipside_humans_count <= 1 && (GLOB.last_qm_callout + 2 MINUTES) < world.time) GLOB.last_qm_callout = world.time // Tell the xenos where the human is. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4dbc924964e0..81226436fe72 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1078,7 +1078,7 @@ to_chat(src, "The game appears to have misplaced your mind datum.") return - if(!skillcheck(usr, SKILL_RESEARCH, SKILL_RESEARCH_TRAINED) || !(FACTION_MARINE in get_id_faction_group())) + if(!skillcheck(usr, SKILL_RESEARCH, SKILL_RESEARCH_TRAINED) || !ally_faction(GLOB.faction_datums[FACTION_MARINE])) to_chat(usr, SPAN_WARNING("You have no access to the [MAIN_SHIP_NAME] research network.")) return diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index d89e3a6189f6..016b52403770 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -272,7 +272,7 @@ CULT if(!(copytext(message, -1) in ENDING_PUNCT)) message += "." - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = owner.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!istype(faction_module)) return @@ -338,29 +338,28 @@ CULT to_chat(Hu, SPAN_WARNING("This target is too far away!")) return - return H.stat != DEAD && istype(H) && ishuman_strict(H) && H.hivenumber != Hu.hivenumber && !isnull(get_hive()) + return H.stat != DEAD && istype(H) && ishuman_strict(H) && H.faction != Hu.faction && !isnull(get_hive()) /datum/action/human_action/activable/cult_leader/proc/get_hive() if(!ishuman(owner)) return - var/mob/living/carbon/human/H = owner - var/datum/hive_status/hive = GLOB.hive_datum[H.hivenumber] - if(!hive) + if(!owner.faction) return - if(!hive.living_xeno_queen && !hive.allow_no_queen_actions) + var/datum/faction_module/hive_mind/faction_module = owner.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen && !faction_module.allow_no_queen_actions) return - return hive + return owner.faction /datum/action/human_action/activable/cult_leader/convert name = "Convert" action_icon_state = "cultist_channel_convert" /datum/action/human_action/activable/cult_leader/convert/use_ability(mob/M) - var/datum/hive_status/hive = get_hive() + var/datum/faction/faction = get_hive() - if(!istype(hive)) + if(!istype(faction)) to_chat(owner, SPAN_DANGER("There is no Queen. You are alone.")) return @@ -384,12 +383,12 @@ CULT var/datum/equipment_preset/preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/xeno_cultist] preset.load_race(chosen) - preset.load_status(chosen, H.hivenumber) + preset.load_status(chosen, H.faction) to_chat(chosen, SPAN_ROLE_HEADER("You are now a Xeno Cultist!")) to_chat(chosen, SPAN_ROLE_BODY("Worship the Xenomorphs and listen to the Cult Leader for orders. The Cult Leader is typically the person who transformed you. Do not kill anyone unless you are wearing your black robes, you may defend yourself.")) - xeno_message("[chosen] has been converted into a cultist!", 2, hive.hivenumber) + xeno_message("[chosen] has been converted into a cultist!", 2, H.faction) chosen.apply_effect(5, PARALYZE) chosen.make_jittery(105) @@ -407,9 +406,7 @@ CULT if(!action_cooldown_check()) return - var/datum/hive_status/hive = get_hive() - - if(!istype(hive)) + if(!get_hive()) to_chat(owner, SPAN_DANGER("There is no Queen. You are alone.")) return diff --git a/code/modules/mob/living/carbon/human/species/yautja/_species.dm b/code/modules/mob/living/carbon/human/species/yautja/_species.dm index ea260d6f88a7..d74859343ac0 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/_species.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/_species.dm @@ -96,22 +96,18 @@ ignores_stripdrag_flag = TRUE /datum/species/yautja/larva_impregnated(obj/item/alien_embryo/embryo) - var/datum/hive_status/hive = GLOB.hive_datum[embryo.hivenumber] + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[embryo.faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!(XENO_STRUCTURE_NEST in faction_module.hive_structure_types)) + faction_module.hive_structure_types.Add(XENO_STRUCTURE_NEST) - if(!istype(hive)) - return - - if(!(XENO_STRUCTURE_NEST in hive.hive_structure_types)) - hive.hive_structure_types.Add(XENO_STRUCTURE_NEST) - - if(!(XENO_STRUCTURE_NEST in hive.hive_structures_limit)) - hive.hive_structures_limit.Add(XENO_STRUCTURE_NEST) - hive.hive_structures_limit[XENO_STRUCTURE_NEST] = 0 + if(!(XENO_STRUCTURE_NEST in faction_module.hive_structures_limit)) + faction_module.hive_structures_limit.Add(XENO_STRUCTURE_NEST) + faction_module.hive_structures_limit[XENO_STRUCTURE_NEST] = 0 - hive.hive_structure_types[XENO_STRUCTURE_NEST] = /datum/construction_template/xenomorph/nest - hive.hive_structures_limit[XENO_STRUCTURE_NEST]++ + faction_module.hive_structure_types[XENO_STRUCTURE_NEST] = /datum/construction_template/xenomorph/nest + faction_module.hive_structures_limit[XENO_STRUCTURE_NEST]++ - xeno_message(SPAN_XENOANNOUNCE("The hive senses that a headhunter has been infected! The thick resin nest is now available in the special structures list!"),hivenumber = hive.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The hive senses that a headhunter has been infected! The thick resin nest is now available in the special structures list!"), faction_to_display = faction_module) /datum/species/yautja/handle_death(mob/living/carbon/human/H, gibbed) if(gibbed) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index 41cede46d5cd..2bcb9edf62e9 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -50,7 +50,6 @@ if(!evolve_checks()) return - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if((!faction_module.living_xeno_queen) && castepick != XENO_CASTE_QUEEN && !islarva(src) && !faction_module.allow_no_queen_evo) to_chat(src, SPAN_WARNING("The Hive is shaken by the death of the last Queen. We can't find the strength to evolve.")) return diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index 1300dc23159e..37a2ea1368b3 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -68,7 +68,7 @@ set_hive_data(src, GLOB.faction_datums[faction_to_get]) go_active() - if(faction_to_get != XENO_HIVE_TUTORIAL) + if(faction_to_get != FACTION_XENOMORPH_TUTORIAL) death_timer = addtimer(CALLBACK(src, PROC_REF(end_lifecycle)), time_to_live, TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_UNIQUE) @@ -92,7 +92,7 @@ return addtimer(CALLBACK(src, PROC_REF(check_turf)), 0.2 SECONDS) - if(!death_timer && faction_to_get != XENO_HIVE_TUTORIAL && stat != DEAD) + if(!death_timer && faction_to_get != FACTION_XENOMORPH_TUTORIAL && stat != DEAD) death_timer = addtimer(CALLBACK(src, PROC_REF(end_lifecycle)), time_to_live, TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_UNIQUE) if(stat == CONSCIOUS && loc) //Make sure we're conscious and not idle or dead. @@ -201,7 +201,7 @@ var/mob/living/carbon/xenomorph/xeno = holder - if ((xeno.caste.hugger_nurturing || faction_to_get == XENO_HIVE_TUTORIAL) && death_timer) + if ((xeno.caste.hugger_nurturing || faction_to_get == FACTION_XENOMORPH_TUTORIAL) && death_timer) deltimer(death_timer) death_timer = null @@ -313,7 +313,7 @@ var/area/hug_area = get_area(src) var/name = hugger ? "[hugger]" : "\a [src]" - if(faction_to_get != XENO_HIVE_TUTORIAL) // prevent hugs from any tutorial huggers from showing up in dchat + if(faction_to_get != FACTION_XENOMORPH_TUTORIAL) // prevent hugs from any tutorial huggers from showing up in dchat if(hug_area) notify_ghosts(header = "Hugged", message = "[human] has been hugged by [name] at [hug_area]!", source = human, action = NOTIFY_ORBIT) to_chat(src, SPAN_DEADSAY("[human] has been facehugged by [name] at \the [hug_area]")) @@ -458,7 +458,7 @@ layer = TURF_LAYER //so dead hugger appears below live hugger if stacked on same tile. (and below nested hosts) - if(faction_to_get == XENO_HIVE_TUTORIAL) + if(faction_to_get == FACTION_XENOMORPH_TUTORIAL) addtimer(CALLBACK(src, PROC_REF(decay)), 5 SECONDS) else addtimer(CALLBACK(src, PROC_REF(decay)), 3 MINUTES) diff --git a/code/modules/mob/living/carbon/xenomorph/Powers.dm b/code/modules/mob/living/carbon/xenomorph/Powers.dm index 60edb2dad917..3d805a877ded 100644 --- a/code/modules/mob/living/carbon/xenomorph/Powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Powers.dm @@ -77,7 +77,7 @@ if(door.hardness == 1.5) //non thickened var/oldloc = door.loc qdel(door) - new /obj/structure/mineral_door/resin/thick (oldloc, door.hivenumber) + new /obj/structure/mineral_door/resin/thick (oldloc, door.faction) total_resin_cost = XENO_THICKEN_DOOR_COST else to_chat(src, SPAN_XENOWARNING("[door] can't be made thicker.")) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoOverwatch.dm b/code/modules/mob/living/carbon/xenomorph/XenoOverwatch.dm index 3f37845380f0..1cd7eb7d5bba 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoOverwatch.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoOverwatch.dm @@ -27,7 +27,8 @@ if (X.caste_type == XENO_CASTE_QUEEN) isQueen = TRUE - if(!X.hive.living_xeno_queen && !X.hive.allow_no_queen_actions) + var/datum/faction_module/hive_mind/faction_module = X.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen && !faction_module.allow_no_queen_actions) to_chat(X, SPAN_WARNING("There is no Queen. We are alone.")) return @@ -44,7 +45,7 @@ var/list/possible_xenos = list() for(var/mob/living/carbon/xenomorph/T in GLOB.living_xeno_list) - if (T != X && !should_block_game_interaction(T) && X.hivenumber == T.hivenumber) // Can't overwatch yourself, Xenos in Thunderdome, or Xenos in other hives + if (T != X && !should_block_game_interaction(T) && X.faction == T.faction) // Can't overwatch yourself, Xenos in Thunderdome, or Xenos in other hives possible_xenos += T var/mob/living/carbon/xenomorph/selected_xeno = tgui_input_list(X, "Target", "Watch which xenomorph?", possible_xenos, theme="hive_status") @@ -79,10 +80,11 @@ if(!QDELETED(oldXeno)) oldXeno.hud_set_queen_overwatch() else - if(!hive) + if(!faction) return - if(!hive.living_xeno_queen && !hive.allow_no_queen_actions) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.living_xeno_queen && !faction_module.allow_no_queen_actions) to_chat(src, SPAN_WARNING("There is no Queen. We are alone.")) return diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index cc9485f6549e..cf18b654c1e8 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -15,11 +15,10 @@ if(3) fontsize_style = "large" - if(SSticker.mode && length(SSticker.mode.xenomorphs)) //Send to only xenos in our gamemode list. This is faster than scanning all mobs - for(var/datum/mind/L in SSticker.mode.xenomorphs) - var/mob/living/carbon/M = L.current - if(M && istype(M) && !M.stat && M.client && (!faction_to_display || M.faction_to_display == faction_to_display)) //Only living and connected xenos - to_chat(M, SPAN_XENODANGER(" [message]")) + for(var/mob/mob as anything in faction_to_display.total_mobs) + if(!mob.stat || !mob.client) + continue + to_chat(mob, SPAN_XENODANGER(" [message]")) //Sends a maptext alert to xenos. /proc/xeno_maptext(text = "", title_text = "", datum/faction/faction_to_display = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 450316a2a723..f77a075f21d8 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -457,10 +457,9 @@ if(!organ_faction_tag && faction.organ_faction_iff_tag_type) organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) - for(var/trait in faction.hive_inherant_traits) - ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/trait in faction_module.hive_inherant_traits) + ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) //Set leader to the new mob if(IS_XENO_LEADER(old_xeno)) @@ -475,7 +474,7 @@ time_of_birth = world.time //Minimap - if(z && faction.code_identificator != XENO_HIVE_TUTORIAL) + if(z && faction.code_identificator != FACTION_XENOMORPH_TUTORIAL) INVOKE_NEXT_TICK(src, PROC_REF(add_minimap_marker)) //Sight @@ -828,7 +827,8 @@ new_faction.add_mob(src) - for(var/trait in new_faction.hive_inherant_traits) + var/datum/faction_module/hive_mind/faction_module = new_faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/trait in faction_module.hive_inherant_traits) ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) generate_name() @@ -840,7 +840,6 @@ recalculate_everything() // Update the hive status UI - var/datum/faction_module/hive_mind/faction_module = new_faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.hive_ui.update_all_xeno_data() return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 772bf99aa7b5..2dbcadb1ddfd 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm @@ -231,7 +231,7 @@ AM.acid_spray_act(src) return turf = next_turf - var/obj/effect/xenomorph/spray/S = new spray_type(turf, create_cause_data(initial( caste_type), src), hivenumber) + var/obj/effect/xenomorph/spray/S = new spray_type(turf, create_cause_data(initial(caste_type), src), faction) do_acid_spray_cone_normal(turf, i, facing, S, spray_type) sleep(2) @@ -265,7 +265,7 @@ normal_density_flag = TRUE else normal_turf = next_normal_turf - left_S = new spray_type(normal_turf, create_cause_data(initial(caste_type), src), hivenumber) + left_S = new spray_type(normal_turf, create_cause_data(initial(caste_type), src), faction) if(!inverse_normal_density_flag) @@ -277,7 +277,7 @@ inverse_normal_density_flag = TRUE else inverse_normal_turf = next_inverse_normal_turf - right_S = new spray_type(inverse_normal_turf, create_cause_data(initial(caste_type), src), hivenumber) + right_S = new spray_type(inverse_normal_turf, create_cause_data(initial(caste_type), src), faction) /mob/living/carbon/xenomorph/proc/do_acid_spray_line(list/turflist, spray_path = /obj/effect/xenomorph/spray, distance_max = 5) @@ -305,7 +305,7 @@ break prev_turf = turf - new spray_path(turf, create_cause_data(initial(caste_type), src), hivenumber) + new spray_path(turf, create_cause_data(initial(caste_type), src), faction) sleep(2) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm index aef98fe7a60e..83a1cf5d49fc 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm @@ -281,7 +281,7 @@ xenomorph.visible_message(SPAN_XENONOTICE("\The [xenomorph] digs out a tunnel entrance."), \ SPAN_XENONOTICE("We dig out an entrance to the tunnel network."), null, 5) - var/obj/structure/tunnel/tunnelobj = new(turf, xenomorph.hivenumber) + var/obj/structure/tunnel/tunnelobj = new(turf, xenomorph.faction) xenomorph.tunnel_delay = 1 addtimer(CALLBACK(src, PROC_REF(cooldown_end)), 4 MINUTES) var/msg = strip_html(input("Add a description to the tunnel:", "Tunnel Description") as text|null) @@ -294,8 +294,9 @@ msg_admin_niche("[xenomorph]/([key_name(xenomorph)]) has named a new tunnel \"[msg]\".") tunnelobj.tunnel_desc = "[msg]" - if(xenomorph.hive.living_xeno_queen || xenomorph.hive.allow_no_queen_actions) - for(var/mob/living/carbon/xenomorph/target_for_message as anything in xenomorph.hive.totalXenos) + var/datum/faction_module/hive_mind/faction_module = xenomorph.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen || faction_module.allow_no_queen_actions) + for(var/mob/living/carbon/xenomorph/target_for_message as anything in xenomorph.faction.total_mobs) var/overwatch_target = XENO_OVERWATCH_TARGET_HREF var/overwatch_src = XENO_OVERWATCH_SRC_HREF to_chat(target_for_message, SPAN_XENOANNOUNCE("Hive: A new tunnel[description ? " ([description])" : ""] has been created by [xenomorph] (watch) at [get_area_name(tunnelobj)].")) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/facehugger/facehugger_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/facehugger/facehugger_powers.dm index 6eef21c6d5af..a0c95b4cdc59 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/facehugger/facehugger_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/facehugger/facehugger_powers.dm @@ -16,7 +16,7 @@ var/key_name = key_name(facehugger) var/did_hug = FALSE - if(facehugger.pounce_distance <= 1 && can_hug(L, facehugger.hivenumber)) + if(facehugger.pounce_distance <= 1 && can_hug(L, facehugger.faction.code_identificator)) did_hug = facehugger.handle_hug(L) log_attack("[key_name] [did_hug ? "successfully hugged" : "tried to hug"] [key_name(L)] (Pounce Distance: [facehugger.pounce_distance]) at [get_location_in_text(L)]") @@ -29,7 +29,7 @@ if(HAS_TRAIT(owner, TRAIT_IMMOBILIZED)) to_chat(owner, SPAN_WARNING("We cannot do that while immobilized!")) return FALSE - + return ..() /datum/action/xeno_action/onclick/toggle_long_range/facehugger/on_zoom_out() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index 7485cfe0015a..05df75880afb 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -513,24 +513,26 @@ /datum/action/xeno_action/onclick/tacmap/give_to(mob/living/carbon/xenomorph/xeno) . = ..() - hivenumber = xeno.hive.hivenumber - RegisterSignal(xeno.hive, COMSIG_HIVE_NEW_QUEEN, PROC_REF(handle_new_queen)) + hivenumber = xeno.faction.code_identificator + var/datum/faction_module/hive_mind/faction_module = xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + RegisterSignal(faction_module, COMSIG_HIVE_NEW_QUEEN, PROC_REF(handle_new_queen)) - if(!xeno.hive.living_xeno_queen) + if(!faction_module.living_xeno_queen) hide_from(xeno) return - if(!xeno.hive.living_xeno_queen.ovipositor) + if(!faction_module.living_xeno_queen.ovipositor) hide_from(xeno) - handle_new_queen(new_queen = xeno.hive.living_xeno_queen) + handle_new_queen(new_queen = faction_module.living_xeno_queen) /datum/action/xeno_action/onclick/tacmap/remove_from(mob/living/carbon/xenomorph/xeno) . = ..() - UnregisterSignal(GLOB.hive_datum[hivenumber], COMSIG_HIVE_NEW_QUEEN) + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[hivenumber].get_faction_module(FACTION_MODULE_HIVE_MIND) + UnregisterSignal(faction_module, COMSIG_HIVE_NEW_QUEEN) /// handles the addition of a new queen, hiding if appropriate -/datum/action/xeno_action/onclick/tacmap/proc/handle_new_queen(datum/hive_status/hive, mob/living/carbon/xenomorph/queen/new_queen) +/datum/action/xeno_action/onclick/tacmap/proc/handle_new_queen(datum/faction/hive, mob/living/carbon/xenomorph/queen/new_queen) SIGNAL_HANDLER if(tracked_queen) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index d72d569bd3b2..722bd1e25941 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -552,7 +552,7 @@ return if(!T.check_xeno_trap_placement(X)) return - var/obj/effect/alien/weeds/the_replacer = new /obj/effect/alien/weeds(T, null, X.faction) + new /obj/effect/alien/weeds(T, null, X.faction) qdel(alien_weeds) if(!X.check_plasma(plasma_cost)) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/king/king_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/king/king_powers.dm index b423517cb636..325252204f7e 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/king/king_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/king/king_powers.dm @@ -126,7 +126,7 @@ continue if(xeno_in_aoe.stat == DEAD) continue - if(xeno_in_aoe.hivenumber != xeno.hivenumber) + if(xeno_in_aoe.faction != xeno.faction) continue start_shield(xeno_in_aoe) xeno.beam(xeno_in_aoe, "purple_lightning", time = 4 SECONDS) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm index 3c1d3a04543d..691bc097fdfa 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm @@ -348,7 +348,7 @@ if(target_carbon.status_flags & XENO_HOST) for(var/obj/item/alien_embryo/embryo in target_carbon) - if(HIVE_ALLIED_TO_HIVE(xeno.hivenumber, embryo.hivenumber)) + if(xeno.ally_faction(GLOB.faction_datums[embryo.faction_to_get])) to_chat(xeno, SPAN_WARNING("We should not harm this host! It has a sister inside.")) return diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_abilities.dm index cbc75a0ef548..f3bb0500a51a 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_abilities.dm @@ -191,12 +191,12 @@ charges = 0 - var/datum/hive_status/hive + var/datum/faction/faction var/list/transported_xenos /datum/action/xeno_action/activable/place_queen_beacon/give_to(mob/living/carbon/xenomorph/queen/Q) . = ..() - hive = Q.hive + faction = Q.faction if(!Q.ovipositor) hide_from(Q) RegisterSignal(Q, COMSIG_QUEEN_MOUNT_OVIPOSITOR, PROC_REF(handle_mount_ovipositor)) @@ -204,7 +204,7 @@ /datum/action/xeno_action/activable/place_queen_beacon/remove_from(mob/living/carbon/xenomorph/X) . = ..() - hive = null + faction = null UnregisterSignal(X, list( COMSIG_QUEEN_MOUNT_OVIPOSITOR, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index 628c98913426..0ad1cc84a8c6 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -350,11 +350,6 @@ var/mob/living/carbon/xenomorph/queen/queen_manager = owner plasma_cost = 0 var/list/options = list("Banish (500)", "Re-Admit (100)", "De-evolve (500)", "Reward Jelly (500)", "Exchange larva for evolution (100)", "Purchase Buffs") - if(queen_manager.faction.code_identificator == XENO_HIVE_CORRUPTED) - options += "Add Personal Ally" - if(length(queen_manager.faction.personal_allies)) - options += "Remove Personal Ally" - options += "Clear Personal Allies" var/choice = tgui_input_list(queen_manager, "Manage The Hive", "Hive Management", options, theme="hive_status") switch(choice) @@ -368,12 +363,6 @@ give_jelly_reward(queen_manager.faction) if("Exchange larva for evolution (100)") give_evo_points() - if("Add Personal Ally") - add_personal_ally() - if("Remove Personal Ally") - remove_personal_ally() - if("Clear Personal Allies") - clear_personal_allies() if("Purchase Buffs") purchase_buffs() return ..() @@ -445,110 +434,6 @@ faction_module.attempt_apply_hivebuff(buffs[selection], xeno, pick(faction_module.active_endgame_pylons)) return TRUE -/datum/action/xeno_action/onclick/manage_hive/proc/add_personal_ally() - var/mob/living/carbon/xenomorph/queen/user_xeno = owner - if(user_xeno.hive.hivenumber != XENO_HIVE_CORRUPTED) - return - - if(!user_xeno.check_state()) - return - - var/datum/hive_status/corrupted/hive = user_xeno.hive - var/list/target_list = list() - if(!user_xeno.client) - return - for(var/mob/living/carbon/human/possible_target in range(7, user_xeno.client.eye)) - if(possible_target.stat == DEAD) - continue - if(possible_target.status_flags & CORRUPTED_ALLY) - continue - if(possible_target.hivenumber) - continue - target_list += possible_target - - if(!length(target_list)) - to_chat(user_xeno, SPAN_WARNING("No talls in view.")) - return - var/mob/living/target_mob = tgui_input_list(usr, "Target", "Set Up a Personal Alliance With...", target_list, theme="hive_status") - - if(!user_xeno.check_state(TRUE)) - return - - if(!target_mob) - return - - if(target_mob.hivenumber) - to_chat(user_xeno, SPAN_WARNING("We cannot set up a personal alliance with a hive cultist.")) - return - - hive.add_personal_ally(target_mob) - -/datum/action/xeno_action/onclick/manage_hive/proc/remove_personal_ally() - var/mob/living/carbon/xenomorph/queen/user_xeno = owner - if(user_xeno.hive.hivenumber != XENO_HIVE_CORRUPTED) - return - - if(!user_xeno.check_state()) - return - - var/datum/hive_status/corrupted/hive = user_xeno.hive - - if(!length(hive.personal_allies)) - to_chat(user_xeno, SPAN_WARNING("We don't have personal allies.")) - return - - var/list/mob/living/allies = list() - var/list/datum/weakref/dead_refs = list() - for(var/datum/weakref/ally_ref as anything in hive.personal_allies) - var/mob/living/ally = ally_ref.resolve() - if(ally) - allies += ally - continue - dead_refs += ally_ref - - hive.personal_allies -= dead_refs - - if(!length(allies)) - to_chat(user_xeno, SPAN_WARNING("We don't have personal allies.")) - return - - var/mob/living/target_mob = tgui_input_list(usr, "Target", "Break the Personal Alliance With...", allies, theme="hive_status") - - if(!target_mob) - return - - var/target_mob_ref = WEAKREF(target_mob) - - if(!(target_mob_ref in hive.personal_allies)) - return - - if(!user_xeno.check_state(TRUE)) - return - - hive.remove_personal_ally(target_mob_ref) - -/datum/action/xeno_action/onclick/manage_hive/proc/clear_personal_allies() - var/mob/living/carbon/xenomorph/queen/user_xeno = owner - if(user_xeno.hive.hivenumber != XENO_HIVE_CORRUPTED) - return - - if(!user_xeno.check_state()) - return - - var/datum/hive_status/corrupted/hive = user_xeno.hive - if(!length(hive.personal_allies)) - to_chat(user_xeno, SPAN_WARNING("We don't have personal allies.")) - return - - if(tgui_alert(user_xeno, "Are you sure you want to clear personal allies?", "Clear Personal Allies", list("No", "Yes"), 10 SECONDS) != "Yes") - return - - if(!length(hive.personal_allies)) - return - - hive.clear_personal_allies() - - /datum/action/xeno_action/onclick/manage_hive/proc/banish() var/mob/living/carbon/xenomorph/queen/user_xeno = owner var/plasma_cost_banish = 500 @@ -607,12 +492,12 @@ target_xeno.hud_update_banished() target_xeno.lock_evolve = TRUE user_xeno.faction.banished_ckeys[target_xeno.name] = target_xeno.ckey - addtimer(CALLBACK(src, PROC_REF(remove_banish), user_xeno.hive, target_xeno.name), 30 MINUTES) + addtimer(CALLBACK(src, PROC_REF(remove_banish), user_xeno.faction, target_xeno.name), 30 MINUTES) message_admins("[key_name_admin(user_xeno)] has banished [key_name_admin(target_xeno)]. Reason: [reason]") return -/datum/action/xeno_action/proc/remove_banish(datum/hive_status/hive, name) +/datum/action/xeno_action/proc/remove_banish(datum/faction/hive, name) hive.banished_ckeys.Remove(name) @@ -753,7 +638,7 @@ if (!check_and_use_plasma_owner()) return - new /obj/effect/alien/weeds(T, node, FALSE) + new /obj/effect/alien/weeds(T, node, X.faction, FALSE) playsound(T, "alien_resin_build", 35) recently_built_turfs += T @@ -770,7 +655,9 @@ set name = "View Xeno Tacmap" set desc = "This opens a tactical map, where you can see where every xenomorph is." set category = "Alien" - hive.tacmap.tgui_interact(src) + + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + faction_module.tacmap.tgui_interact(src) /datum/action/xeno_action/onclick/screech/use_ability(atom/target) var/mob/living/carbon/xenomorph/queen/xeno = owner diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index cfed6878a9f4..5539b89e7c60 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -56,7 +56,7 @@ if(attacking_xeno.caste && !attacking_xeno.caste.is_intelligent) if(HAS_TRAIT(src, TRAIT_NESTED) && (status_flags & XENO_HOST)) for(var/obj/item/alien_embryo/embryo in src) - if(HIVE_ALLIED_TO_HIVE(attacking_xeno.hivenumber, embryo.hivenumber)) + if(attacking_xeno.ally_faction(GLOB.faction_datums[embryo.faction_to_get])) to_chat(attacking_xeno, SPAN_WARNING("We should not harm this host! It has a sister inside.")) return XENO_NO_DELAY_ACTION @@ -235,7 +235,7 @@ M.start_pulling(src) if(INTENT_HARM) - if(isxeno(src) && xeno_hivenumber(src) == M.hivenumber) + if(faction == M.faction) var/mob/living/carbon/xenomorph/X = src if(!X.banished) M.visible_message(SPAN_WARNING("[M] nibbles [src]."), \ @@ -663,7 +663,7 @@ playsound(loc, "alien_resin_break", 25) M.animation_attack_on(src) - if (hivenumber == M.hivenumber) + if(faction == M.faction) qdel(src) else health -= M.melee_damage_lower * RESIN_XENO_DAMAGE_MULTIPLIER @@ -782,7 +782,7 @@ MODE_SET_MODIFIER(/datum/gamemode_modifier/lz_weeding, TRUE) to_chat(M, SPAN_XENONOTICE("We interact with the machine and disable remote control.")) - xeno_message(SPAN_XENOANNOUNCE("[message]"),3,M.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("[message]"), 3, M.faction) last_locked = world.time if(GLOB.almayer_orbital_cannon) GLOB.almayer_orbital_cannon.is_disabled = TRUE @@ -792,7 +792,7 @@ /datum/shuttle/ferry/marine/proc/door_override(mob/living/carbon/xenomorph/M, shuttle_tag) if(!door_override) to_chat(M, SPAN_XENONOTICE("We override the doors.")) - xeno_message(SPAN_XENOANNOUNCE("The doors of the metal bird have been overridden! Rejoice!"),3,M.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("The doors of the metal bird have been overridden! Rejoice!"), 3, M.faction) last_door_override = world.time door_override = 1 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index 947c64f5931c..34d5a1ac938f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -423,13 +423,14 @@ if(huggers_cur <= huggers_reserved) to_chat(user, SPAN_WARNING("\The [src] has reserved the remaining facehuggers for themselves.")) return - if(!faction.can_spawn_as_hugger(user)) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(!faction_module.can_spawn_as_hugger(user)) return //Need to check again because time passed due to the confirmation window if(!huggers_cur) to_chat(user, SPAN_WARNING("\The [src] doesn't have any facehuggers to inhabit.")) return - faction.spawn_as_hugger(user, src) + faction_module.spawn_as_hugger(user, src) huggers_cur-- /datum/behavior_delegate/carrier_base diff --git a/code/modules/mob/living/carbon/xenomorph/castes/King.dm b/code/modules/mob/living/carbon/xenomorph/castes/King.dm index 55283ea30fcd..159bbeceb944 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/King.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/King.dm @@ -83,10 +83,10 @@ for(var/mob/living/carbon/carbon in new_loc.contents) if(isxeno(carbon)) var/mob/living/carbon/xenomorph/xeno = carbon - if(xeno.hivenumber == src.hivenumber && !(king.client?.prefs?.toggle_prefs & TOGGLE_AUTO_SHOVE_OFF)) + if(xeno.faction == faction && !(king.client?.prefs?.toggle_prefs & TOGGLE_AUTO_SHOVE_OFF)) xeno.KnockDown((5 DECISECONDS) / GLOBAL_STATUS_MULTIPLIER) playsound(src, 'sound/weapons/alien_knockdown.ogg', 25, 1) - else if(xeno.hivenumber != src.hivenumber) + else if(xeno.faction != faction) xeno.KnockDown((1 SECONDS) / GLOBAL_STATUS_MULTIPLIER) playsound(src, 'sound/weapons/alien_knockdown.ogg', 25, 1) else diff --git a/code/modules/mob/living/carbon/xenomorph/hive_faction.dm b/code/modules/mob/living/carbon/xenomorph/hive_faction.dm index ad685f6d7703..879204821fd2 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_faction.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_faction.dm @@ -12,7 +12,7 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) .["Human"] = FACTION_LIST_HUMANOID .["Raw"] = .["Human"] + .["Xenomorph"] -*/ + /datum/hive_faction_ui var/name = "Hive Faction" @@ -53,9 +53,10 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) if(isnull(params["should_ally"]) || isnull(params["target_faction"])) return -// if(!(params["target_faction"] in GLOB.hive_alliable_factions["Raw"])) -// return + if(!(params["target_faction"] in GLOB.hive_alliable_factions["Raw"])) + return var/should_ally = text2num(params["should_ally"]) assoc_hive.change_stance(params["target_faction"], should_ally) . = TRUE +*/ diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index c542ca2c4c52..aba19da2b0e4 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -1083,7 +1083,7 @@ /datum/hive_status/tutorial name = "Tutorial Hive" reporting_id = "tutorial" - hivenumber = XENO_HIVE_TUTORIAL + hivenumber = FACTION_XENOMORPH_TUTORIAL prefix = "Inquisitive " latejoin_burrowed = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status_ui.dm b/code/modules/mob/living/carbon/xenomorph/hive_status_ui.dm index 4d031941052b..11fcad6ead62 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status_ui.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status_ui.dm @@ -15,9 +15,9 @@ var/data_initialized = FALSE - var/datum/hive_status/assoc_hive = null + var/datum/faction_module/hive_mind/assoc_hive = null -/datum/hive_status_ui/New(datum/hive_status/hive) +/datum/hive_status_ui/New(datum/faction_module/hive_mind/hive) assoc_hive = hive update_all_data() START_PROCESSING(SShive_status, src) @@ -93,7 +93,7 @@ /datum/hive_status_ui/proc/update_burrowed_larva(send_update = TRUE) burrowed_larva = assoc_hive.stored_larva if(SSxevolution) - evilution_level = SSxevolution.get_evolution_boost_power(assoc_hive.hivenumber) + evilution_level = SSxevolution.get_evolution_boost_power(assoc_hive.faction_owner.code_identificator) else evilution_level = 1 if(send_update) @@ -129,7 +129,7 @@ SStgui.update_uis(src) /datum/hive_status_ui/ui_state(mob/user) - return GLOB.hive_state[assoc_hive.internal_faction] + return GLOB.hive_state[assoc_hive.faction_owner.code_identificator] /datum/hive_status_ui/ui_status(mob/user, datum/ui_state/state) . = ..() @@ -162,8 +162,8 @@ /datum/hive_status_ui/ui_static_data(mob/user) . = list() .["user_ref"] = REF(user) - .["hive_color"] = assoc_hive.ui_color - .["hive_name"] = assoc_hive.name + .["hive_color"] = assoc_hive.faction_owner.ui_color + .["hive_name"] = assoc_hive.faction_owner.name /datum/hive_status_ui/proc/open_hive_status(mob/user) if(!user) @@ -181,7 +181,7 @@ ui = SStgui.try_update_ui(user, src, ui) if (!ui) - ui = new(user, src, "HiveStatus", "[assoc_hive.name] Status") + ui = new(user, src, "HiveStatus", "[assoc_hive.faction_owner] Status") ui.open() ui.set_autoupdate(FALSE) diff --git a/code/modules/mob/living/carbon/xenomorph/mark_menu.dm b/code/modules/mob/living/carbon/xenomorph/mark_menu.dm index cc76865335e0..7dd963f4200f 100644 --- a/code/modules/mob/living/carbon/xenomorph/mark_menu.dm +++ b/code/modules/mob/living/carbon/xenomorph/mark_menu.dm @@ -59,7 +59,7 @@ .["user_nicknumber"] = X.nicknumber var/list/mark_list_infos = list() - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + var/datum/faction_module/hive_mind/faction_module = user.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) for(var/type in faction_module.resin_marks) var/list/entry = list() var/obj/effect/alien/resin/marker/RM = type @@ -204,3 +204,64 @@ selected_xeno.start_tracking_resin_mark(mark_to_force) update_all_data() . = TRUE + +//Xeno Resin Mark Shit, the very best place for it too :0) +//Defines at the bottom of this list here will show up at the top in the mark menu +/datum/xeno_mark_define + var/name = "xeno_declare" + var/icon_state = "empty" + var/desc = "Xenos make psychic markers with this meaning as positional lasting communication to eachother" + +/datum/xeno_mark_define/fortify + name = "Fortify" + desc = "Fortify this area!" + icon_state = "fortify" + +/datum/xeno_mark_define/weeds + name = "Need Weeds" + desc = "Need weeds here!" + icon_state = "weed" + +/datum/xeno_mark_define/nest + name = "Nest" + desc = "Nest enemies here!" + icon_state = "nest" + +/datum/xeno_mark_define/hosts + name = "Hosts" + desc = "Hosts here!" + icon_state = "hosts" + +/datum/xeno_mark_define/aide + name = "Aide" + desc = "Aide here!" + icon_state = "aide" + +/datum/xeno_mark_define/defend + name = "Defend" + desc = "Defend the hive here!" + icon_state = "defend" + +/datum/xeno_mark_define/danger + name = "Danger Warning" + desc = "Caution, danger here!" + icon_state = "danger" + +/datum/xeno_mark_define/rally + name = "Rally" + desc = "Group up here!" + icon_state = "rally" + +/datum/xeno_mark_define/hold + name = "Hold" + desc = "Hold this area!" + icon_state = "hold" + +/datum/xeno_mark_define/ambush + name = "Ambush" + desc = "Ambush the enemy here!" + icon_state = "ambush" +/datum/xeno_mark_define/attack + name = "Attack" + desc = "Attack the enemy here!" + icon_state = "attack" diff --git a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm index 55452706da4e..88a9c3f2d4c6 100644 --- a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm +++ b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm @@ -4,7 +4,6 @@ var/construction_name // The name used in messages (to replace old resin2text proc) var/cost var/build_time = 2 SECONDS - var/pass_hivenumber = TRUE var/build_overlay_icon var/build_animation_effect @@ -76,10 +75,10 @@ return TRUE -/datum/resin_construction/proc/build(turf/T, hivenumber, builder) +/datum/resin_construction/proc/build(turf/T, builder, datum/faction/faction) return -/datum/resin_construction/proc/check_thick_build(turf/build_turf, hivenumber, mob/living/carbon/xenomorph/builder) +/datum/resin_construction/proc/check_thick_build(turf/build_turf, mob/living/carbon/xenomorph/builder, datum/faction/faction) var/can_build_thick = TRUE if(thick_hiveweed) var/obj/effect/alien/weeds/weeds = locate() in build_turf @@ -91,24 +90,15 @@ return FALSE // Subtype encompassing all resin constructions that are of type /obj -/datum/resin_construction/resin_obj/build(turf/build_turf, hivenumber, mob/living/carbon/xenomorph/builder) - var/path = check_thick_build(build_turf, hivenumber, builder) ? build_path_thick : build_path - if(pass_hivenumber) - return new path(build_turf, hivenumber, builder) - return new path(build_turf) +/datum/resin_construction/resin_obj/build(turf/build_turf, mob/living/carbon/xenomorph/builder, datum/faction/faction) + var/path = check_thick_build(build_turf, faction, builder) ? build_path_thick : build_path + return new path(build_turf, builder, faction) // Subtype encompassing all resin constructions that are of type /turf -/datum/resin_construction/resin_turf/build(turf/build_turf, hivenumber, mob/living/carbon/xenomorph/builder) - var/path = check_thick_build(build_turf, hivenumber, builder) ? build_path_thick : build_path - - build_turf.PlaceOnTop(path) - - var/turf/closed/wall/resin/resin_wall = build_turf - if (istype(resin_wall) && pass_hivenumber) - resin_wall.hivenumber = hivenumber - resin_wall.set_resin_builder(builder) - set_hive_data(resin_wall, hivenumber) +/datum/resin_construction/resin_turf/build(turf/build_turf, mob/living/carbon/xenomorph/builder, datum/faction/faction) + var/path = check_thick_build(build_turf, faction, builder) ? build_path_thick : build_path + build_turf.PlaceOnTop(path, builder, faction) return build_turf diff --git a/code/modules/mob/living/carbon/xenomorph/say.dm b/code/modules/mob/living/carbon/xenomorph/say.dm index 4d26134225ea..4422131e6883 100644 --- a/code/modules/mob/living/carbon/xenomorph/say.dm +++ b/code/modules/mob/living/carbon/xenomorph/say.dm @@ -144,7 +144,7 @@ if(isxeno(src) && isxeno(creature)) overwatch_insert = " (watch)" - if(isqueen(src) || faction.leading_cult_sl == src) + if(isqueen(src) || faction_module.leading_cult_sl == src) final_message = SPAN_XENOQUEEN("Hivemind, [name][overwatch_insert] hisses, '[message]'") else if(istype(zenomorph) && IS_XENO_LEADER(zenomorph)) final_message = SPAN_XENOLEADER("Hivemind, Leader [name][overwatch_insert] hisses, '[message]'") diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index b06b47cb2f9d..73d613dae4be 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -346,13 +346,13 @@ /datum/hive_leaders/ui_data(mob/user) var/list/data = list() - var/datum/hive_status/main_hive = GLOB.hive_datum[FACTION_XENOMORPH_NORMAL] + var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL].get_faction_module(FACTION_MODULE_HIVE_MIND) var/list/queens = list() - if(main_hive.living_xeno_queen) - queens += list(list("designation" = main_hive.living_xeno_queen.full_designation, "caste_type" = main_hive.living_xeno_queen.name)) + if(faction_module.living_xeno_queen) + queens += list(list("designation" = faction_module.living_xeno_queen.full_designation, "caste_type" = faction_module.living_xeno_queen.name)) data["queens"] = queens var/list/leaders = list() - for(var/mob/living/carbon/xenomorph/xeno_leader in main_hive.xeno_leader_list) + for(var/mob/living/carbon/xenomorph/xeno_leader in faction_module.xeno_leader_list) leaders += list(list("designation" = xeno_leader.full_designation, "caste_type" = xeno_leader.caste_type)) data["leaders"] = leaders return data diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 75464ee04548..03a7219065f5 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -863,7 +863,7 @@ if(.) var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(SEND_SIGNAL(P, COMSIG_BULLET_CHECK_MOB_SKIPPING, src) & COMPONENT_SKIP_MOB\ - || proj.runtime_iff_group && ally_faction(proj.runtime_iff_group)\ + || P.runtime_iff_group && ally_faction(P.runtime_iff_group)\ ) return FALSE if(mobility_aura) diff --git a/code/modules/reagents/chemistry_properties/prop_special.dm b/code/modules/reagents/chemistry_properties/prop_special.dm index d3e5e6efcf00..9292070bcc56 100644 --- a/code/modules/reagents/chemistry_properties/prop_special.dm +++ b/code/modules/reagents/chemistry_properties/prop_special.dm @@ -97,18 +97,14 @@ max_level = 6 /datum/chem_property/special/ciphering/process(mob/living/M, potency = 1, delta_time) - if(!GLOB.hive_datum[level]) // This should probably always be valid + if(!GLOB.faction_datums[FACTION_LIST_XENOMORPH[level]]) // This should probably always be valid return for(var/content in M.contents) if(!istype(content, /obj/item/alien_embryo)) continue - // level is a number rather than a hivenumber, which are strings - var/hivenumber = GLOB.hive_datum[level] - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - var/obj/item/alien_embryo/A = content - A.hivenumber = hivenumber - A.faction = hive.internal_faction + var/obj/item/alien_embryo/embryo = content + embryo.faction_to_get = FACTION_LIST_XENOMORPH[level] /datum/chem_property/special/ciphering/predator name = PROPERTY_CIPHERING_PREDATOR @@ -125,15 +121,15 @@ if(amount < 10) return - if((E.flags_embryo & FLAG_EMBRYO_PREDATOR) && E.hivenumber == GLOB.hive_datum[level]) + if((E.flags_embryo & FLAG_EMBRYO_PREDATOR) && E.faction_to_get == FACTION_LIST_XENOMORPH[level]) return E.visible_message(SPAN_DANGER("\the [E] rapidly mutates")) playsound(E, 'sound/effects/attackblob.ogg', 25, TRUE) - E.hivenumber = GLOB.hive_datum[level] - set_hive_data(E, GLOB.hive_datum[level]) + E.faction_to_get = FACTION_LIST_XENOMORPH[level] + set_hive_data(E, GLOB.faction_datums[E.faction_to_get]) E.flags_embryo |= FLAG_EMBRYO_PREDATOR /datum/chem_property/special/crossmetabolizing @@ -170,8 +166,7 @@ return for(var/i=1,i<=max((level % 100)/10,1),i++)//10's determine number of embryos var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(H) - embryo.hivenumber = min(level % 10,5) //1's determine hivenumber - embryo.faction = FACTION_LIST_XENOMORPH[embryo.hivenumber] + embryo.faction_to_get = FACTION_LIST_XENOMORPH[min(level % 10, 5)] /datum/chem_property/special/transforming name = PROPERTY_TRANSFORMING diff --git a/code/modules/reagents/chemistry_reagents/other.dm b/code/modules/reagents/chemistry_reagents/other.dm index 90b3f753d7cc..e68e96d0e394 100644 --- a/code/modules/reagents/chemistry_reagents/other.dm +++ b/code/modules/reagents/chemistry_reagents/other.dm @@ -1002,9 +1002,9 @@ volume = 0 var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(H) if(data_properties && data_properties["hive_number"]) - embryo.hivenumber = data_properties["hive_number"] + embryo.faction_to_get = data_properties["hive_number"] else - embryo.hivenumber = FACTION_XENOMORPH_NORMAL + embryo.faction_to_get = FACTION_XENOMORPH_NORMAL to_chat(H, SPAN_WARNING("Your stomach cramps and you suddenly feel very sick!")) /datum/reagent/plasma/neurotoxin diff --git a/code/modules/round_recording/round_recorder.dm b/code/modules/round_recording/round_recorder.dm index 8748b995aa6c..75fa334396e5 100644 --- a/code/modules/round_recording/round_recorder.dm +++ b/code/modules/round_recording/round_recorder.dm @@ -67,7 +67,7 @@ if(X.client) name_prefix = "[X.client.xeno_prefix ? X.client.xeno_prefix : "XX"]-" name_postfix = X.client.xeno_postfix ? ("-" + X.client.xeno_postfix) : "" - player_name = "[(X.hive ? X.hive.prefix : "")][player_role] ([name_prefix][X.nicknumber][name_postfix])" + player_name = "[(X.faction ? X.faction.prefix : "")][player_role] ([name_prefix][X.nicknumber][name_postfix])" if(ishuman(M)) var/mob/living/carbon/human/H = M diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index dfa7beaddf8f..f90a80646dc7 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -483,7 +483,7 @@ lifeboat.playing_launch_announcement_alarm = FALSE var/obj/docking_port/stationary/lifeboat_dock/lifeboat_dock = lifeboat.get_docked() lifeboat_dock.open_dock() - xeno_message(SPAN_XENOANNOUNCE("We have wrested away control of one of the metal birds! They shall not escape!"), 3, xeno.hivenumber) + xeno_message(SPAN_XENOANNOUNCE("We have wrested away control of one of the metal birds! They shall not escape!"), 3, xeno.faction) launch_initiated = FALSE remaining_time = initial(remaining_time) return XENO_NO_DELAY_ACTION diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index 3402afe50d7b..091d1185f74b 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -373,7 +373,7 @@ if(faction_module.living_xeno_queen) var/datum/action/xeno_action/onclick/grow_ovipositor/ovi_ability = get_action(faction_module.living_xeno_queen, /datum/action/xeno_action/onclick/grow_ovipositor) ovi_ability.reduce_cooldown(ovi_ability.xeno_cooldown) - addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/hive_status, override_evilution), original_evilution, FALSE), XENO_HIJACK_EVILUTION_TIME) + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/faction_module/hive_mind, override_evilution), original_evilution, FALSE), XENO_HIJACK_EVILUTION_TIME) // Notify the yautja too so they stop the hunt message_all_yautja("The serpent Queen has commanded the landing shuttle to depart.") diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index 8305b3649daa..c57be1f184d2 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -305,7 +305,7 @@ GLOBAL_LIST_EMPTY(shuttle_controls) if(Q.faction) var/datum/faction_module/hive_mind/faction_module = Q.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) - addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/hive_status, abandon_on_hijack)), DROPSHIP_WARMUP_TIME + 5 SECONDS, TIMER_UNIQUE) //+ 5 seconds catch standing in doorways + addtimer(CALLBACK(faction_module, TYPE_PROC_REF(/datum/faction_module/hive_mind, abandon_on_hijack)), DROPSHIP_WARMUP_TIME + 5 SECONDS, TIMER_UNIQUE) //+ 5 seconds catch standing in doorways if(GLOB.bomb_set) for(var/obj/structure/machinery/nuclearbomb/bomb in world) diff --git a/code/modules/tgui/states/xeno.dm b/code/modules/tgui/states/xeno.dm index 50a770ea329e..4e01a244aa86 100644 --- a/code/modules/tgui/states/xeno.dm +++ b/code/modules/tgui/states/xeno.dm @@ -22,7 +22,7 @@ GLOBAL_LIST_INIT(hive_state, setup_hive_states()) faction = faction_to_set /datum/ui_state/hive_state/can_use_topic(src_object, mob/user) - if(hive.is_ally(user)) + if(faction.faction_is_ally(user)) return UI_INTERACTIVE return UI_CLOSE @@ -37,15 +37,16 @@ GLOBAL_LIST_INIT(hive_state_queen, setup_hive_queen_states()) /proc/setup_hive_queen_states() . = list() - for(var/hivenumber in GLOB.hive_datum) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] - .[hive.internal_faction] = new/datum/ui_state/hive_state/queen(hive.hivenumber) + for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + .[faction.code_identificator] = new/datum/ui_state/hive_state/queen(faction) /datum/ui_state/hive_state/queen/can_use_topic(src_object, mob/user) . = ..() if(. == UI_CLOSE) return - if(hive.living_xeno_queen == user) + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen == user) return UI_INTERACTIVE return UI_UPDATE diff --git a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm index 11871fc36cfd..123e2c7401de 100644 --- a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm +++ b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm @@ -124,7 +124,7 @@ purge_target(living_mob) continue - if(living_mob.ally_faction(faction) || living_mob.invisibility || HAS_TRAIT(living_mob, TRAIT_ABILITY_BURROWED)) + if(living_mob.ally_faction(owner.faction) || living_mob.invisibility || HAS_TRAIT(living_mob, TRAIT_ABILITY_BURROWED)) purge_target(living_mob) continue diff --git a/colonialmarines.dme b/colonialmarines.dme index ead86081a51e..ae6ce6b191a9 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -2089,7 +2089,6 @@ #include "code\modules\mob\living\carbon\xenomorph\Evolution.dm" #include "code\modules\mob\living\carbon\xenomorph\Facehuggers.dm" #include "code\modules\mob\living\carbon\xenomorph\hive_faction.dm" -#include "code\modules\mob\living\carbon\xenomorph\hive_status.dm" #include "code\modules\mob\living\carbon\xenomorph\hive_status_ui.dm" #include "code\modules\mob\living\carbon\xenomorph\life.dm" #include "code\modules\mob\living\carbon\xenomorph\login.dm" From 895e13f07e494edfbff93d8e6276d354ca0644bf Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:24:38 +0500 Subject: [PATCH 08/24] finalyaaaaa.... fuck da shit random rework drop here AAAAAAA --- code/controllers/subsystem/influxstats.dm | 2 +- code/datums/factions/colonists.dm | 25 + code/datums/factions/faction.dm | 99 +- code/datums/factions/upp.dm | 46 + code/datums/factions/uscm/marine.dm | 138 ++ code/datums/factions/xeno/normal.dm | 29 + code/datums/factions/xeno/xeno.dm | 292 +--- code/datums/factions/yautja.dm | 33 + code/datums/factions/zombie.dm | 7 - code/game/jobs/job/antag/xeno/xenomorph.dm | 4 +- code/game/jobs/job/job.dm | 3 + code/game/jobs/role_authority.dm | 30 +- code/modules/admin/tabs/round_tab.dm | 2 +- code/modules/client/preferences.dm | 32 +- code/modules/mob/dead/observer/observer.dm | 42 +- .../living/carbon/xenomorph/hive_status.dm | 1496 ----------------- code/modules/mob/new_player/new_player.dm | 68 +- 17 files changed, 412 insertions(+), 1936 deletions(-) delete mode 100644 code/modules/mob/living/carbon/xenomorph/hive_status.dm diff --git a/code/controllers/subsystem/influxstats.dm b/code/controllers/subsystem/influxstats.dm index e82169e7a832..1f3815710e14 100644 --- a/code/controllers/subsystem/influxstats.dm +++ b/code/controllers/subsystem/influxstats.dm @@ -123,7 +123,7 @@ SUBSYSTEM_DEF(influxstats) team = "observers" else if(!job) continue - else if(mob.faction == FACTION_MARINE || mob.faction == FACTION_SURVIVOR) + else if(mob.faction.code_identificator in SSticker.mode.factions_pool) team = "humans" var/mob/living/carbon/human/employed_human = mob if(istype(employed_human)) diff --git a/code/datums/factions/colonists.dm b/code/datums/factions/colonists.dm index f3d1fa0636d9..a19c2189a8f5 100644 --- a/code/datums/factions/colonists.dm +++ b/code/datums/factions/colonists.dm @@ -1,6 +1,31 @@ +#define ROLES_REGULAR_SURV list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_SURVIVOR) + /datum/faction/colonist name = "Colonists" desc = "Colonists, the most ordinary citizens of the colonies, ADDITIONAL INFORMATION IS CHANGED" code_identificator = FACTION_COLONIST faction_iff_tag_type = /obj/item/faction_tag/colonist + + roles_list = list( + MODE_NAME_EXTENDED = list(JOB_SURVIVOR, JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR, JOB_FAX_RESPONDER), + MODE_NAME_DISTRESS_SIGNAL = list(JOB_SURVIVOR, JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR, JOB_FAX_RESPONDER), + MODE_NAME_FACTION_CLASH = list(), + MODE_NAME_WISKEY_OUTPOST = list(), + MODE_NAME_HUNTER_GAMES = list( + JOB_SURVIVOR + ), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list( + JOB_SURVIVOR + ) + ) + weight_act = list( + MODE_NAME_EXTENDED = FALSE, + MODE_NAME_DISTRESS_SIGNAL = FALSE, + MODE_NAME_FACTION_CLASH = FALSE, + MODE_NAME_WISKEY_OUTPOST = FALSE, + MODE_NAME_HUNTER_GAMES = FALSE, + MODE_NAME_HIVE_WARS = FALSE, + MODE_NAME_INFECTION = FALSE + ) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index 597feda69878..a803b4cbf3e6 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -19,9 +19,26 @@ var/list/total_dead_mobs = list() // All dead mobs linked to faction var/list/late_join_landmarks = list() // Flexible latejoin landmarks per faction - var/list/role_mappings = list() + var/list/role_mappings = list( + MODE_NAME_EXTENDED = list(), + MODE_NAME_DISTRESS_SIGNAL = list(), + MODE_NAME_FACTION_CLASH = list(), + MODE_NAME_WISKEY_OUTPOST = list(), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list(), + ) var/list/roles_list = list() var/list/coefficient_per_role = list() + var/weight_act = list( + MODE_NAME_EXTENDED = TRUE, + MODE_NAME_DISTRESS_SIGNAL = TRUE, + MODE_NAME_FACTION_CLASH = TRUE, + MODE_NAME_WISKEY_OUTPOST = TRUE, + MODE_NAME_HUNTER_GAMES = TRUE, + MODE_NAME_HIVE_WARS = TRUE, + MODE_NAME_INFECTION = TRUE, + ) var/list/banished_ckeys = list() @@ -74,39 +91,10 @@ total_mobs -= creature -/datum/faction/proc/get_join_status(mob/new_player/user, dat)/* - dat = "
" - dat += "[user.client.auto_lang(LANGUAGE_LOBBY_ROUND_TIME)]: [DisplayTimeText(world.time, language = user.client.language)]
" - dat += "[user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_CHOSE)]:
" - dat += additional_join_status(user) - - if(!latejoin_enabled) - dat = "[user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_CLOSED)]:
" - - else if(!SSautobalancer.can_join(src)) - dat = "[user.client.auto_lang(LANGUAGE_JS_BALANCE_ISSUE)]:
" - - else - var/list/roles = roles_list[SSticker.mode.name] - for(var/i in roles) - var/datum/job/job = GLOB.RoleAuthority.roles_by_name[i] - var/check_result = GLOB.RoleAuthority.check_role_entry(user, job, src, TRUE) - var/active = 0 - for(var/mob/mob in GLOB.player_list) - if(mob.client && mob.job == job.title) - active++ - - if(check_result) - dat += "[job.disp_title] ([job.current_positions]): [check_result] ([user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_ACTIVE)]: [active])
" - else - dat += "[job.disp_title] ([job.current_positions]) ([user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN_ACTIVE)]: [active])
" - - dat += "
" - show_browser(user, dat, user.client.auto_lang(LANGUAGE_LOBBY_LATE_JOIN), "latechoices", "size=420x700") -*/ /datum/faction/proc/can_delay_round_end(mob/living/carbon/creature) return TRUE + // Friend or Foe functional /atom/movable/proc/ally_faction(datum/faction/ally_faction) return FALSE @@ -161,6 +149,7 @@ return FALSE + //Minor functions /datum/faction/proc/modify_hud_holder(image/holder, mob/living/carbon/human/creature) return @@ -170,3 +159,51 @@ /datum/faction/proc/get_antag_guns_sorted_equipment() return list() + + +//Roles and join stuff +/datum/faction/proc/get_role_coeff(role_name) + if(coefficient_per_role[role_name]) + return coefficient_per_role[role_name] + return 1 + +/datum/faction/proc/get_join_status(mob/new_player/user, dat) + var/mills = world.time // 1/10 of a second, not real milliseconds but whatever + //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence... or something + var/mins = (mills % 36000) / 600 + var/hours = mills / 36000 + + dat = "
" + dat += "Round Duration: [floor(hours)]h [floor(mins)]m
" + + dat += additional_join_status_info(user) + + if(!latejoin_enabled) + dat = "Latejoin disabled
" +// else if(!SSautobalancer.can_join(src)) // WILL BE INTRODUCED IN STAGE 2 (another PR) +// dat = "Due to balance issues joining closed
" + else + dat += "Choose from the following open positions:
" + dat += custom_faction_job_fill(user) + + dat += "
" + show_browser(src, dat, "Late Join", "latechoices", "size=420x700") + +/datum/faction/proc/additional_join_status_info(mob/new_player/user) + return + +/datum/faction/proc/custom_faction_job_fill(mob/new_player/user) + . = "" + var/list/roles = roles_list[SSticker.mode.name] + for(var/i in roles) + var/datum/job/job = GLOB.RoleAuthority.roles_by_name[i] + var/check_result = GLOB.RoleAuthority.check_role_entry(user, job, src, TRUE) + var/active = 0 + for(var/mob/mob in GLOB.player_list) + if(mob.client && mob.job == job.title) + active++ + + if(check_result) + . += "[job.disp_title] ([job.current_positions]): [check_result] (Active: [active])
" + else + . += "[job.disp_title] ([job.current_positions]) (Active: [active])
" diff --git a/code/datums/factions/upp.dm b/code/datums/factions/upp.dm index e9eb5b0cfa1a..4e0e9b202b94 100644 --- a/code/datums/factions/upp.dm +++ b/code/datums/factions/upp.dm @@ -9,6 +9,52 @@ faction_iff_tag_type = /obj/item/faction_tag/upp + role_mappings = list( + MODE_NAME_EXTENDED = list(), + MODE_NAME_DISTRESS_SIGNAL = list(), + MODE_NAME_FACTION_CLASH = list(), + MODE_NAME_WISKEY_OUTPOST = list(), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list(), + ) + roles_list = list( + MODE_NAME_EXTENDED = list(), + MODE_NAME_DISTRESS_SIGNAL = list(), + MODE_NAME_FACTION_CLASH = UPP_JOB_LIST, + MODE_NAME_WISKEY_OUTPOST = list(), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list(), + ) + coefficient_per_role = list( + JOB_UPP_KOL_OFFICER = 2.5, + JOB_UPP_MAY_OFFICER = 1.75, + JOB_UPP_SRLT_OFFICER = 1.5, + JOB_UPP_LT_OFFICER = 1.25, + JOB_UPP_INTEL = 1, + JOB_UPP_CREWMAN = 4, + JOB_UPP_POLICE = 0.5, + JOB_UPP_CORPORATE_LIAISON = 0.25, + JOB_UPP_COMBAT_SYNTH = 6, + JOB_UPP_LT_DOKTOR = 2, + JOB_UPP_LEADER = 1.75, + JOB_UPP_CONSCRIPT = 1.5, + JOB_UPP_SPECIALIST = 3, + JOB_UPP_MEDIC = 2.25, + JOB_UPP_ENGI = 2, + JOB_UPP = 1.25, + ) + weight_act = list( + MODE_NAME_EXTENDED = FALSE, + MODE_NAME_DISTRESS_SIGNAL = FALSE, + MODE_NAME_FACTION_CLASH = TRUE, + MODE_NAME_WISKEY_OUTPOST = FALSE, + MODE_NAME_HUNTER_GAMES = FALSE, + MODE_NAME_HIVE_WARS = FALSE, + MODE_NAME_INFECTION = FALSE, + ) + minimap_flag = MINIMAP_FLAG_UPP /datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/human) diff --git a/code/datums/factions/uscm/marine.dm b/code/datums/factions/uscm/marine.dm index 796caed0db38..3ae2ac8eec5c 100644 --- a/code/datums/factions/uscm/marine.dm +++ b/code/datums/factions/uscm/marine.dm @@ -3,3 +3,141 @@ code_identificator = FACTION_MARINE faction_iff_tag_type = /obj/item/faction_tag/uscm/marine + + role_mappings = list( + MODE_NAME_EXTENDED = list(), + MODE_NAME_DISTRESS_SIGNAL = list(), + MODE_NAME_FACTION_CLASH = list(), + MODE_NAME_WISKEY_OUTPOST = list( + /datum/job/command/commander/whiskey = JOB_CO, + /datum/job/command/executive/whiskey = JOB_XO, + /datum/job/civilian/synthetic/whiskey = JOB_SYNTH, + /datum/job/command/warrant/whiskey = JOB_CHIEF_POLICE, + /datum/job/command/bridge/whiskey = JOB_SO, + /datum/job/command/tank_crew/whiskey = JOB_TANK_CREW, + /datum/job/command/police/whiskey = JOB_POLICE, + /datum/job/command/pilot/whiskey = JOB_CAS_PILOT, + /datum/job/logistics/requisition/whiskey = JOB_CHIEF_REQUISITION, + /datum/job/civilian/professor/whiskey = JOB_CMO, + /datum/job/civilian/doctor/whiskey = JOB_DOCTOR, + /datum/job/civilian/researcher/whiskey = JOB_RESEARCHER, + /datum/job/logistics/engineering/whiskey = JOB_CHIEF_ENGINEER, + /datum/job/logistics/maint/whiskey = JOB_MAINT_TECH, + /datum/job/logistics/cargo/whiskey = JOB_CARGO_TECH, + /datum/job/civilian/liaison/whiskey = JOB_CORPORATE_LIAISON, + /datum/job/marine/leader/whiskey = JOB_SQUAD_LEADER, + /datum/job/marine/specialist/whiskey = JOB_SQUAD_SPECIALIST, + /datum/job/marine/smartgunner/whiskey = JOB_SQUAD_SMARTGUN, + /datum/job/marine/medic/whiskey = JOB_SQUAD_MEDIC, + /datum/job/marine/engineer/whiskey = JOB_SQUAD_ENGI, + /datum/job/marine/standard/whiskey = JOB_SQUAD_MARINE, + ), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list(), + ) + roles_list = list( + MODE_NAME_EXTENDED = list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO,JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE, JOB_AUXILIARY_OFFICER, JOB_SEA, JOB_INTEL, JOB_CAS_PILOT, JOB_DROPSHIP_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_TANK_CREW, JOB_SYNTH, JOB_WORKING_JOE, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE), + MODE_NAME_DISTRESS_SIGNAL = list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO,JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE, JOB_AUXILIARY_OFFICER, JOB_SEA, JOB_INTEL, JOB_CAS_PILOT, JOB_DROPSHIP_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_TANK_CREW, JOB_SYNTH, JOB_WORKING_JOE, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE), + MODE_NAME_FACTION_CLASH = list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO,JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE, JOB_AUXILIARY_OFFICER, JOB_SEA, JOB_INTEL, JOB_CAS_PILOT, JOB_DROPSHIP_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_TANK_CREW, JOB_SYNTH, JOB_WORKING_JOE, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE), + MODE_NAME_WISKEY_OUTPOST = list(JOB_WO_CO, JOB_WO_XO, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION, JOB_WO_CMO, JOB_WO_DOCTOR, JOB_WO_RESEARCHER, JOB_WO_SQUAD_MARINE, JOB_WO_SQUAD_MEDIC, JOB_WO_SQUAD_ENGINEER, JOB_WO_SQUAD_SMARTGUNNER, JOB_WO_SQUAD_SPECIALIST, JOB_WO_SQUAD_LEADER), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO,JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE, JOB_AUXILIARY_OFFICER, JOB_SEA, JOB_INTEL, JOB_CAS_PILOT, JOB_DROPSHIP_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_TANK_CREW, JOB_SYNTH, JOB_WORKING_JOE, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE), + ) + coefficient_per_role = list( + JOB_CO = 2, + JOB_XO = 1.5, + JOB_SO = 1, + JOB_INTEL = 0.5, + JOB_PILOT = 0.25, + JOB_DROPSHIP_CREW_CHIEF = 0.75, + JOB_CREWMAN = 2.5, + JOB_POLICE = 0.25, + JOB_CORPORATE_LIAISON = 0.25, + JOB_CHIEF_REQUISITION = 0.5, + JOB_CHIEF_ENGINEER = 1, + JOB_CMO = 1, + JOB_CHIEF_POLICE = 0.75, + JOB_SEA = 0.25, + JOB_SYNTH = 4, + JOB_WARDEN = 0.75, + JOB_ORDNANCE_TECH = 1.5, + JOB_MAINT_TECH = 0.75, + JOB_WORKING_JOE = 1, + JOB_MESS_SERGEANT = 0.25, + JOB_CARGO_TECH = 0.5, + JOB_RESEARCHER = 1, + JOB_DOCTOR = 1.25, + JOB_NURSE = 0.75, + JOB_SQUAD_LEADER = 1.5, + JOB_SQUAD_RTO = 1, + JOB_SQUAD_SPECIALIST = 3, + JOB_SQUAD_SMARTGUN = 2, + JOB_SQUAD_MEDIC = 1.5, + JOB_SQUAD_ENGI = 1.25, + JOB_SQUAD_MARINE = 1, + ) + weight_act = list( + MODE_NAME_EXTENDED = TRUE, + MODE_NAME_DISTRESS_SIGNAL = TRUE, + MODE_NAME_FACTION_CLASH = TRUE, + MODE_NAME_WISKEY_OUTPOST = TRUE, + MODE_NAME_HUNTER_GAMES = FALSE, + MODE_NAME_HIVE_WARS = FALSE, + MODE_NAME_INFECTION = TRUE, + ) + +/datum/faction/uscm/marine/additional_join_status_info(user) + . = "" + if(SShijack) + switch(SShijack.evac_status) + if(EVACUATION_STATUS_INITIATED) + . += "The [MAIN_SHIP_NAME] is being evacuated.
" + + +/datum/faction/uscm/marine/custom_faction_job_fill(mob/new_player/user) + . = "" + var/roles_show = FLAG_SHOW_ALL_JOBS + for(var/i in GLOB.RoleAuthority.roles_for_mode) + var/datum/job/J = GLOB.RoleAuthority.roles_for_mode[i] + if(!GLOB.RoleAuthority.check_role_entry(src, J, src, TRUE)) + continue + var/active = 0 + // Only players with the job assigned and AFK for less than 10 minutes count as active + for(var/mob/M in GLOB.player_list) + if(M.client && M.job == J.title) + active++ + if(roles_show & FLAG_SHOW_CIC && GLOB.ROLES_CIC.Find(J.title)) + . += "Command:
" + roles_show ^= FLAG_SHOW_CIC + + else if(roles_show & FLAG_SHOW_AUXIL_SUPPORT && GLOB.ROLES_AUXIL_SUPPORT.Find(J.title)) + . += "
Auxiliary Combat Support:
" + roles_show ^= FLAG_SHOW_AUXIL_SUPPORT + + else if(roles_show & FLAG_SHOW_MISC && GLOB.ROLES_MISC.Find(J.title)) + . += "
Other:
" + roles_show ^= FLAG_SHOW_MISC + + else if(roles_show & FLAG_SHOW_POLICE && GLOB.ROLES_POLICE.Find(J.title)) + . += "
Military Police:
" + roles_show ^= FLAG_SHOW_POLICE + + else if(roles_show & FLAG_SHOW_ENGINEERING && GLOB.ROLES_ENGINEERING.Find(J.title)) + . += "
Engineering:
" + roles_show ^= FLAG_SHOW_ENGINEERING + + else if(roles_show & FLAG_SHOW_REQUISITION && GLOB.ROLES_REQUISITION.Find(J.title)) + . += "
Requisitions:
" + roles_show ^= FLAG_SHOW_REQUISITION + + else if(roles_show & FLAG_SHOW_MEDICAL && GLOB.ROLES_MEDICAL.Find(J.title)) + . += "
Medbay:
" + roles_show ^= FLAG_SHOW_MEDICAL + + else if(roles_show & FLAG_SHOW_MARINES && GLOB.ROLES_MARINES.Find(J.title)) + . += "
Marines:
" + roles_show ^= FLAG_SHOW_MARINES + + . += "[J.disp_title] ([J.current_positions]) (Active: [active])
" diff --git a/code/datums/factions/xeno/normal.dm b/code/datums/factions/xeno/normal.dm index 4fa4b77db127..84eee33d5fac 100644 --- a/code/datums/factions/xeno/normal.dm +++ b/code/datums/factions/xeno/normal.dm @@ -7,4 +7,33 @@ color = null ui_color = "#8200FF" + roles_list = list( + MODE_NAME_EXTENDED = list(JOB_XENOMORPH_QUEEN, JOB_XENOMORPH), + MODE_NAME_DISTRESS_SIGNAL = list(JOB_XENOMORPH_QUEEN, JOB_XENOMORPH), + MODE_NAME_FACTION_CLASH = list(), + MODE_NAME_WISKEY_OUTPOST = list( + JOB_XENOMORPH + ), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list( + JOB_XENOMORPH + ), + MODE_NAME_INFECTION = list( + JOB_XENOMORPH + ), + ) + coefficient_per_role = list( + JOB_XENOMORPH = 8, + JOB_XENOMORPH_QUEEN = 16 + ) + weight_act = list( + MODE_NAME_EXTENDED = FALSE, + MODE_NAME_DISTRESS_SIGNAL = TRUE, + MODE_NAME_FACTION_CLASH = FALSE, + MODE_NAME_WISKEY_OUTPOST = FALSE, + MODE_NAME_HUNTER_GAMES = FALSE, + MODE_NAME_HIVE_WARS = TRUE, + MODE_NAME_INFECTION = FALSE, + ) + minimap_flag = MINIMAP_FLAG_XENO diff --git a/code/datums/factions/xeno/xeno.dm b/code/datums/factions/xeno/xeno.dm index e4ebd108a736..6da8d5cf0492 100644 --- a/code/datums/factions/xeno/xeno.dm +++ b/code/datums/factions/xeno/xeno.dm @@ -23,288 +23,12 @@ if(!faction_is_ally(GLOB.faction_datums[FACTION_MARINE])) return TRUE return FALSE -/* -/datum/faction/xenomorph/get_join_status(mob/new_player/user, dat) - if(SSticker.current_state != GAME_STATE_PLAYING || !SSticker.mode) - to_chat(user, SPAN_WARNING(user.client.auto_lang(LANGUAGE_LOBBY_ROUND_NO_JOIN))) - return - if(alert(user, user.client.auto_lang(LANGUAGE_LOBBY_JOIN_XENOMORPH), user.client.auto_lang(LANGUAGE_CONFIRM), user.client.auto_lang(LANGUAGE_YES), user.client.auto_lang(LANGUAGE_NO)) == user.client.auto_lang(LANGUAGE_YES)) - if(SSticker.mode.check_xeno_late_join(user)) - var/mob/new_xeno = SSticker.mode.attempt_to_join_as_xeno(user, 0) - if(new_xeno && !istype(new_xeno, /mob/living/carbon/xenomorph/larva)) - SSticker.mode.transfer_xenomorph(user, new_xeno) - user.close_spawn_windows() -*/ -/* -//LANDMARKS -/datum/xeno_mark_define - var/name = "xeno_declare" - var/icon_state = "empty" - var/desc = "Xenos make psychic markers with this meaning as positional lasting communication to eachother" - -/datum/xeno_mark_define/fortify - name = "Fortify" - desc = "Fortify this area!" - icon_state = "fortify" - -/datum/xeno_mark_define/weeds - name = "Need Weeds" - desc = "Need weeds here!" - icon_state = "weed" - -/datum/xeno_mark_define/nest - name = "Nest" - desc = "Nest enemies here!" - icon_state = "nest" - -/datum/xeno_mark_define/hosts - name = "Hosts" - desc = "Hosts here!" - icon_state = "hosts" - -/datum/xeno_mark_define/aide - name = "Aide" - desc = "Aide here!" - icon_state = "aide" - -/datum/xeno_mark_define/defend - name = "Defend" - desc = "Defend the hive here!" - icon_state = "defend" - -/datum/xeno_mark_define/danger - name = "Danger Warning" - desc = "Caution, danger here!" - icon_state = "danger" - -/datum/xeno_mark_define/rally - name = "Rally" - desc = "Group up here!" - icon_state = "rally" - -/datum/xeno_mark_define/hold - name = "Hold" - desc = "Hold this area!" - icon_state = "hold" - -/datum/xeno_mark_define/ambush - name = "Ambush" - desc = "Ambush the enemy here!" - icon_state = "ambush" - -/datum/xeno_mark_define/attack - name = "Attack" - desc = "Attack the enemy here!" - icon_state = "attack" - - -//HIVE STATUS -/datum/hive_status_ui - var/name = "Hive Status" - - // Data to pass when rendering the UI (not static) - var/total_xenos - var/list/xeno_counts - var/list/tier_slots - var/list/xeno_vitals - var/list/xeno_keys - var/list/xeno_info - var/faction_location - var/burrowed_larva - var/evolution_level - - var/data_initialized = FALSE - - var/datum/faction/assoc_hive = null - -/datum/hive_status_ui/New(datum/faction/faction) - assoc_hive = faction - update_all_data() - START_PROCESSING(SShive_status, src) - -/datum/hive_status_ui/process() - update_xeno_vitals() - update_xeno_info(FALSE) - SStgui.update_uis(src) - -// Updates the list tracking how many xenos there are in each tier, and how many there are in total -/datum/hive_status_ui/proc/update_xeno_counts(send_update = TRUE) - xeno_counts = assoc_hive.get_xeno_counts() - - total_xenos = 0 - for(var/counts in xeno_counts) - for(var/caste in counts) - total_xenos += counts[caste] - - if(send_update) - SStgui.update_uis(src) - - xeno_counts[1] -= "Queen" // don't show queen in the amount of xenos - - // Also update the amount of T2/T3 slots - tier_slots = assoc_hive.get_tier_slots() - -// Updates the hive location using the area name of the defined hive location turf -/datum/hive_status_ui/proc/update_faction_location(send_update = TRUE) - if(!assoc_hive.faction_location) - return - - faction_location = strip_improper(get_area_name(assoc_hive.faction_location)) - - if(send_update) - SStgui.update_uis(src) - -// Updates the sorted list of all xenos that we use as a key for all other information -/datum/hive_status_ui/proc/update_xeno_keys(send_update = TRUE) - xeno_keys = assoc_hive.get_xeno_keys() - - if(send_update) - SStgui.update_uis(src) - -// Mildly related to the above, but only for when xenos are removed from the hive -// If a xeno dies, we don't have to regenerate all xeno info and sort it again, just remove them from the data list -/datum/hive_status_ui/proc/xeno_removed(mob/living/carbon/xenomorph/xenomorph) - if(!xeno_keys) - return - - for(var/index in 1 to length(xeno_keys)) - var/list/info = xeno_keys[index] - if(info["nicknumber"] == xenomorph.nicknumber) - - // tried Remove(), didn't work. *shrug* - xeno_keys[index] = null - xeno_keys -= null - return - - SStgui.update_uis(src) - -// Updates the list of xeno names, strains and references -/datum/hive_status_ui/proc/update_xeno_info(send_update = TRUE) - xeno_info = assoc_hive.get_xeno_info() - - if(send_update) - SStgui.update_uis(src) - -// Updates vital information about xenos such as health and location. Only info that should be updated regularly -/datum/hive_status_ui/proc/update_xeno_vitals() - xeno_vitals = assoc_hive.get_xeno_vitals() - -// Updates how many buried larva there are -/datum/hive_status_ui/proc/update_burrowed_larva(send_update = TRUE) - burrowed_larva = assoc_hive.stored_larva - if(SSxevolution) - evolution_level = SSxevolution.get_evolution_boost_power(assoc_hive) - else - evolution_level = 1 - - if(send_update) - SStgui.update_uis(src) - -// Updates all data except pooled larva -/datum/hive_status_ui/proc/update_all_xeno_data(send_update = TRUE) - update_xeno_counts(FALSE) - update_xeno_vitals() - update_xeno_keys(FALSE) - update_xeno_info(FALSE) - - if(send_update) - SStgui.update_uis(src) - -// Updates all data, including pooled larva -/datum/hive_status_ui/proc/update_all_data() - data_initialized = TRUE - update_all_xeno_data(FALSE) - update_burrowed_larva(FALSE) - SStgui.update_uis(src) - -/datum/hive_status_ui/ui_state(mob/user) - return GLOB.hive_state[assoc_hive.faction_name] - -/datum/hive_status_ui/ui_status(mob/user, datum/ui_state/state) - . = ..() - if(isobserver(user)) - return UI_INTERACTIVE - -/datum/hive_status_ui/ui_data(mob/user) - . = list() - .["total_xenos"] = total_xenos - .["xeno_counts"] = xeno_counts - .["tier_slots"] = tier_slots - .["xeno_keys"] = xeno_keys - .["xeno_info"] = xeno_info - .["xeno_vitals"] = xeno_vitals - .["queen_location"] = get_area_name(assoc_hive.living_xeno_queen) - .["faction_location"] = faction_location - .["burrowed_larva"] = burrowed_larva - .["evolution_level"] = evolution_level - - var/mob/living/carbon/xenomorph/queen/Q = user - .["is_in_ovi"] = istype(Q) && Q.ovipositor - -/datum/hive_status_ui/ui_static_data(mob/user) - . = list() - .["user_ref"] = REF(user) - .["hive_color"] = assoc_hive.ui_color - .["hive_name"] = assoc_hive.name - -/datum/hive_status_ui/tgui_interact(mob/user, datum/tgui/ui) - if(!assoc_hive) - return - - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "HiveStatus", "[assoc_hive.name] Status") - ui.set_autoupdate(FALSE) - ui.open() - -/datum/hive_status_ui/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) - . = ..() - if(.) - return - - switch(action) - if("give_plasma") - var/mob/living/carbon/xenomorph/target_xenomorph = locate(params["target_ref"]) in GLOB.living_xeno_list - var/mob/living/carbon/xenomorph/xenomorph = ui.user - - if(QDELETED(target_xenomorph) || target_xenomorph.stat == DEAD || target_xenomorph.statistic_exempt) - return - - if(xenomorph.stat == DEAD) - return - - var/datum/action/xeno_action/A = get_xeno_action_by_type(xenomorph, /datum/action/xeno_action/activable/queen_give_plasma) - A?.use_ability_wrapper(target_xenomorph) - - if("heal") - var/mob/living/carbon/xenomorph/target_xenomorph = locate(params["target_ref"]) in GLOB.living_xeno_list - var/mob/living/carbon/xenomorph/xenomorph = ui.user - - if(QDELETED(target_xenomorph) || target_xenomorph.stat == DEAD || target_xenomorph.statistic_exempt) - return - - if(xenomorph.stat == DEAD) - return - - var/datum/action/xeno_action/A = get_xeno_action_by_type(xenomorph, /datum/action/xeno_action/activable/queen_heal) - A?.use_ability_wrapper(target_xenomorph, TRUE) - - if("overwatch") - var/mob/living/carbon/xenomorph/target_xenomorph = locate(params["target_ref"]) in GLOB.living_xeno_list - var/mob/living/carbon/xenomorph/xenomorph = ui.user - - if(QDELETED(target_xenomorph) || target_xenomorph.stat == DEAD || target_xenomorph.statistic_exempt) - return - - if(xenomorph.stat == DEAD) - if(isobserver(xenomorph)) - var/mob/dead/observer/O = xenomorph - O.ManualFollow(target_xenomorph) - return - - if(!xenomorph.check_state(TRUE)) - return - - xenomorph.overwatch(target_xenomorph) -*/ +/datum/faction/xenomorph/get_join_status(mob/new_player/user) + if(SSticker.mode.check_xeno_late_join(user)) + var/mob/new_xeno = SSticker.mode.attempt_to_join_as_xeno(user, FALSE) + if(!new_xeno && tgui_alert(user, "Are you sure you wish to observe to be a xeno candidate?\nWhen you observe, you will not be able to join as marine.\nIt might also take some time to become a xeno or responder!", "Confirmation", list("Yes", "No"), 10 SECONDS) == "Yes") + user.observe_for_xeno() + else if(!istype(new_xeno, /mob/living/carbon/xenomorph/larva)) + SSticker.mode.transfer_xeno(user, new_xeno) + return TRUE diff --git a/code/datums/factions/yautja.dm b/code/datums/factions/yautja.dm index 94967e849e9c..2a9c319934f0 100644 --- a/code/datums/factions/yautja.dm +++ b/code/datums/factions/yautja.dm @@ -6,3 +6,36 @@ relations_pregen = RELATIONS_HOSTILE minimap_flag = MINIMAP_FLAG_YAUTJA + + role_mappings = list( + MODE_NAME_EXTENDED = list(), + MODE_NAME_DISTRESS_SIGNAL = list(), + MODE_NAME_FACTION_CLASH = list(), + MODE_NAME_WISKEY_OUTPOST = list(), + MODE_NAME_HUNTER_GAMES = list(), + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = list(), + ) + roles_list = list( + MODE_NAME_EXTENDED = JOB_PREDATOR, + MODE_NAME_DISTRESS_SIGNAL = JOB_PREDATOR, + MODE_NAME_FACTION_CLASH = JOB_PREDATOR, + MODE_NAME_WISKEY_OUTPOST = list(), + MODE_NAME_HUNTER_GAMES = JOB_PREDATOR, + MODE_NAME_HIVE_WARS = list(), + MODE_NAME_INFECTION = JOB_PREDATOR, + ) + weight_act = list( + MODE_NAME_EXTENDED = FALSE, + MODE_NAME_DISTRESS_SIGNAL = FALSE, + MODE_NAME_FACTION_CLASH = FALSE, + MODE_NAME_WISKEY_OUTPOST = FALSE, + MODE_NAME_HUNTER_GAMES = FALSE, + MODE_NAME_HIVE_WARS = FALSE, + MODE_NAME_INFECTION = FALSE, + ) + +/datum/faction/yautja/get_join_status(mob/new_player/user) + if(SSticker.mode.check_predator_late_join(user, 0)) + user.close_spawn_windows() + SSticker.mode.attempt_to_join_as_predator(user) diff --git a/code/datums/factions/zombie.dm b/code/datums/factions/zombie.dm index d8e1b37108ca..f140e9a846bb 100644 --- a/code/datums/factions/zombie.dm +++ b/code/datums/factions/zombie.dm @@ -8,13 +8,6 @@ organ_faction_iff_tag_type = /obj/item/faction_tag/organ/zombie /datum/faction/zombie/get_join_status(mob/user, dat) - if(!user.client) - return - - if(SSticker.current_state < GAME_STATE_PLAYING || !SSticker.mode) - to_chat(src, SPAN_WARNING("The game hasn't started yet!")) - return - var/list/zombie_list = list() if(length(GLOB.zombie_landmarks)) zombie_list += list("Underground Zombie" = "Underground Zombie") diff --git a/code/game/jobs/job/antag/xeno/xenomorph.dm b/code/game/jobs/job/antag/xeno/xenomorph.dm index 8ae3ed7ea891..721fec2f9efd 100644 --- a/code/game/jobs/job/antag/xeno/xenomorph.dm +++ b/code/game/jobs/job/antag/xeno/xenomorph.dm @@ -12,6 +12,8 @@ spawn_positions = -1 total_positions = -1 + faction_identificator = FACTION_XENOMORPH_NORMAL + /datum/job/antag/xenos/proc/calculate_extra_spawn_positions(count) return max((floor(count * XENO_TO_TOTAL_SPAWN_RATIO)), 0) @@ -23,7 +25,7 @@ . = ..() var/mob/living/carbon/human/H = . - transform_to_xeno(H, GLOB.faction_datums[FACTION_XENOMORPH_NORMAL]) + transform_to_xeno(H, GLOB.faction_datums[faction_identificator]) /datum/job/antag/xenos/proc/transform_to_xeno(mob/living/carbon/human/human_to_transform, datum/faction/faction_to_set) var/datum/mind/new_xeno = human_to_transform.mind diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 069bc5e93ac4..b1591d234899 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -40,6 +40,9 @@ /// If TRUE, this job will spawn w/ a cryo emergency kit during evac/red alert var/gets_emergency_kit = TRUE + //I don't want to change rn system how we give fucking points, so this fuckery solve issue with benos, rn this is not making dif, but in future can + var/faction_identificator + /datum/job/New() . = ..() diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index f71529278eb5..f758617edd27 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -126,7 +126,6 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou //===============================================================\\ //PART I: Get roles relevant to the mode - var/datum/game_mode/G = SSticker.mode roles_for_mode = list() for(var/faction_to_get in FACTION_LIST_ALL) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] @@ -141,9 +140,9 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou // Also register game mode specific mappings to standard roles role_mappings = list() default_roles = list() - if(G.role_mappings) - for(var/role_path in G.role_mappings) - var/mapped_title = G.role_mappings[role_path] + if(SSticker.mode.active_roles_mappings_pool) + for(var/role_path in SSticker.mode.active_roles_mappings_pool) + var/mapped_title = SSticker.mode.active_roles_mappings_pool[role_path] var/datum/job/J = roles_by_path[role_path] if(!J || !roles_by_name[mapped_title]) continue @@ -328,16 +327,19 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou * people late joining. This weight also controls the size of local wildlife population, * survivors and the number of roundstart Squad Rifleman slots. */ -/datum/authority/branch/role/proc/calculate_role_weight(datum/job/J) - if(!J) +/datum/authority/branch/role/proc/calculate_role_weight(datum/job/job) + if(!job) return 0 - if(GLOB.ROLES_MARINES.Find(J.title)) - return 1 - if(GLOB.ROLES_XENO.Find(J.title)) - return 1 - if(J.title == JOB_SURVIVOR) - return 1 - return SHIPSIDE_ROLE_WEIGHT + var/datum/faction/faction = GLOB.faction_datums[job.gear_preset ? initial(job.gear_preset.job_faction) : job.faction_identificator] + if(!faction) + if(GLOB.ROLES_MARINES.Find(job.title)) + return 1 + if(GLOB.ROLES_XENO.Find(job.title)) + return 1 + if(job.title == JOB_SURVIVOR) + return 1 + return SHIPSIDE_ROLE_WEIGHT + return faction.get_role_coeff(job) /datum/authority/branch/role/proc/assign_random_role(mob/new_player/M, list/roles_to_iterate) //In case we want to pass on a list. . = roles_to_iterate @@ -551,7 +553,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou //we make a list of squad that is randomized so alpha isn't always lowest squad. var/list/mixed_squads = list() for(var/datum/squad/squad in squads) - if(squad.roundstart && squad.usable && squad.faction == human.faction && squad.name != "Root") + if(squad.roundstart && squad.usable && squad.faction == human.faction.code_identificator && squad.name != "Root") mixed_squads += squad mixed_squads = shuffle(mixed_squads) diff --git a/code/modules/admin/tabs/round_tab.dm b/code/modules/admin/tabs/round_tab.dm index bc154e6ee1c3..42def5eaf9d2 100644 --- a/code/modules/admin/tabs/round_tab.dm +++ b/code/modules/admin/tabs/round_tab.dm @@ -95,7 +95,7 @@ var/roles[] = new var/datum/job/J - var/active_role_names = GLOB.gamemode_roles[GLOB.master_mode] + var/active_role_names = SSticker.mode.active_roles_pool if(!active_role_names) active_role_names = GLOB.ROLES_DISTRESS_SIGNAL diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 66e97667ba7b..08f860a8d064 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -259,6 +259,8 @@ GLOBAL_LIST_INIT(bgstate_options, list( var/unlock_content = 0 + var/datum/faction/observing_faction + var/current_menu = MENU_MARINE /// if this client has custom cursors enabled @@ -675,9 +677,13 @@ GLOBAL_LIST_INIT(bgstate_options, list( if(!GLOB.RoleAuthority) return + if(!observing_faction) + observing_faction = GLOB.faction_datums[SSticker.mode.factions_pool[pick(SSticker.mode.factions_pool)]] + var/HTML = "" HTML += "
" HTML += "Choose occupation chances
Unavailable occupations are crossed out.

" + HTML += "Selected faction: [observing_faction]

" HTML += "
Done

" // Easier to press up here. HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns. HTML += "" @@ -685,7 +691,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows. - var/list/active_role_names = GLOB.gamemode_roles[GLOB.master_mode] + var/list/active_role_names = observing_faction.roles_list[SSticker.mode.name] if(!active_role_names) active_role_names = GLOB.ROLES_DISTRESS_SIGNAL @@ -758,6 +764,8 @@ GLOBAL_LIST_INIT(bgstate_options, list( HTML += "
" HTML += "
" + HTML += "

Change faction

" + if(user.client?.prefs) //Just makin sure var/b_color = "green" var/msg = "Get random job if preferences unavailable" @@ -795,9 +803,13 @@ GLOBAL_LIST_INIT(bgstate_options, list( if(!GLOB.RoleAuthority) return + if(!observing_faction) + observing_faction = GLOB.faction_datums[SSticker.mode.factions_pool[pick(SSticker.mode.factions_pool)]] + var/HTML = "" HTML += "
" HTML += "Assign character slots to jobs.
Unavailable occupations are crossed out.

" + HTML += "Selected faction: [observing_faction]

" HTML += "
Done

" // Easier to press up here. HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns. HTML += "" @@ -805,7 +817,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows. - var/list/active_role_names = GLOB.gamemode_roles[GLOB.master_mode] + var/list/active_role_names = observing_faction.roles_list[SSticker.mode.name] if(!active_role_names) active_role_names = GLOB.ROLES_DISTRESS_SIGNAL @@ -839,6 +851,8 @@ GLOBAL_LIST_INIT(bgstate_options, list( HTML += "
" HTML += "

" + HTML += "

Change faction

" + var/b_color var/msg if(toggle_prefs & TOGGLE_START_JOIN_CURRENT_SLOT) @@ -1011,6 +1025,13 @@ GLOBAL_LIST_INIT(bgstate_options, list( if("input") var/priority = text2num(href_list["target_priority"]) SetJob(user, href_list["text"], priority) + if("faction") + var/choice = tgui_input_list(user, "Choose faction to observer roles:", "Factions", SSticker.mode.factions_pool) + if(!choice) + return + + observing_faction = GLOB.faction_datums[SSticker.mode.factions_pool[choice]] + SetChoices(user) else SetChoices(user) return TRUE @@ -1030,6 +1051,13 @@ GLOBAL_LIST_INIT(bgstate_options, list( if("reset") reset_job_slots() set_job_slots(user) + if("faction") + var/choice = tgui_input_list(user, "Choose faction to observer roles:", "Factions", SSticker.mode.factions_pool) + if(!choice) + return + + observing_faction = GLOB.faction_datums[SSticker.mode.factions_pool[choice]] + set_job_slots(user) else set_job_slots(user) return TRUE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7468878faf19..0d7085a2c3bc 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -979,47 +979,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, SPAN_WARNING("The game hasn't started yet!")) return - var/list/zombie_list = list() - if(length(GLOB.zombie_landmarks)) - zombie_list += list("Underground Zombie" = "Underground Zombie") - for(var/mob/living/carbon/human/A in GLOB.zombie_list) - if(!A.client && A.stat != DEAD) // Only living zombies - zombie_list += list(A.real_name = A) - - if(!length(zombie_list)) - to_chat(src, SPAN_DANGER("There are no available zombies.")) - return - - var/choice = tgui_input_list(usr, "Pick a Zombie:", "Join as Zombie", zombie_list) - if(!choice) - return - - if(!client || !mind) - return - - if(choice == "Underground Zombie") - if(!length(GLOB.zombie_landmarks)) - to_chat(src, SPAN_WARNING("Sorry, the last underground zombie just got taken.")) - return - var/obj/effect/landmark/zombie/spawn_point = pick(GLOB.zombie_landmarks) - spawn_point.spawn_zombie(src) - return - - var/mob/living/carbon/human/Z = zombie_list[choice] - - if(!Z || QDELETED(Z)) - return - - if(Z.stat == DEAD) - to_chat(src, SPAN_WARNING("This zombie is dead!")) - return - - if(Z.client) - to_chat(src, SPAN_WARNING("That player is still connected.")) - return - - mind.transfer_to(Z, TRUE) - msg_admin_niche("[key_name(usr)] has joined as a [Z].") + GLOB.faction_datums[FACTION_ZOMBIE]?.get_join_status(src) /mob/dead/verb/join_as_freed_mob() diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm deleted file mode 100644 index aba19da2b0e4..000000000000 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ /dev/null @@ -1,1496 +0,0 @@ -/datum/hive_status - var/name = "Normal Hive" - - // Used for the faction of the xenomorph. Not recommended to modify. - var/internal_faction - - /// Short Hive ID as string used in stats reporting - var/reporting_id = "normal" - - var/hivenumber = FACTION_XENOMORPH_NORMAL - var/mob/living/carbon/xenomorph/queen/living_xeno_queen - var/egg_planting_range = 15 - var/slashing_allowed = XENO_SLASH_ALLOWED //This initial var allows the queen to turn on or off slashing. Slashing off means harm intent does much less damage. - var/construction_allowed = NORMAL_XENO //Who can place construction nodes for special structures - var/destruction_allowed = NORMAL_XENO //Who can destroy special structures - var/unnesting_allowed = TRUE - var/hive_orders = "" //What orders should the hive have - var/color = null - var/ui_color = null // Color for hive status collapsible buttons and xeno count list - var/prefix = "" - var/queen_leader_limit = 2 - var/list/open_xeno_leader_positions = list(1, 2) // Ordered list of xeno leader positions (indexes in xeno_leader_list) that are not occupied - var/list/xeno_leader_list[2] // Ordered list (i.e. index n holds the nth xeno leader) - var/stored_larva = 0 - - ///used by /datum/hive_status/proc/increase_larva_after_burst() to support non-integer increases to larva - var/partial_larva = 0 - /// Assoc list of free slots available to specific castes - var/list/free_slots = list( - /datum/caste_datum/burrower = 1, - /datum/caste_datum/hivelord = 1, - /datum/caste_datum/carrier = 1 - ) - /// Assoc list of slots currently used by specific castes (for calculating free_slot usage) - var/list/used_slots = list() - /// list of living tier2 xenos - var/list/tier_2_xenos = list() - /// list of living tier3 xenos - var/list/tier_3_xenos = list() - /// list of living xenos - var/list/totalXenos = list() - /// list of previously living xenos (hardrefs currently) - var/list/total_dead_xenos = list() - var/xeno_queen_timer - var/isSlotOpen = TRUE //Set true for starting alerts only after the hive has reached its full potential - var/allowed_nest_distance = 15 //How far away do we allow nests from an ovied Queen. Default 15 tiles. - var/obj/effect/alien/resin/special/pylon/core/hive_location = null //Set to ref every time a core is built, for defining the hive location - - var/tier_slot_multiplier = 1 - var/larva_gestation_multiplier = 1 - var/bonus_larva_spawn_chance = 1 - var/hijack_burrowed_surge = FALSE //at hijack, start spawning lots of burrowed - /// how many burrowed is going to spawn during larva surge - var/hijack_burrowed_left = 0 - - var/dynamic_evolution = TRUE - var/evolution_rate = 3 // Only has use if dynamic_evolution is false - var/evolution_bonus = 0 - - var/allow_no_queen_actions = FALSE - var/allow_no_queen_evo = FALSE - var/evolution_without_ovipositor = TRUE //Temporary for the roundstart. - /// Set to false if you want to prevent evolutions into Queens - var/allow_queen_evolve = TRUE - /// Set to true if you want to prevent bursts and spawns of new xenos. Will also prevent healing if the queen no longer exists - var/hardcore = FALSE - /// Set to false if you want to prevent getting burrowed larva from latejoin marines - var/latejoin_burrowed = TRUE - /// If hit limit of larva from pylons - var/hit_larva_pylon_limit = FALSE - - var/see_humans_on_tacmap = FALSE - - var/list/hive_inherant_traits - - // Cultist Info - var/mob/living/carbon/leading_cult_sl - - //List of how many maximum of each special structure you can have - var/list/hive_structures_limit = list( - XENO_STRUCTURE_CORE = 1, - XENO_STRUCTURE_CLUSTER = 8, - XENO_STRUCTURE_EGGMORPH = 6, - XENO_STRUCTURE_RECOVERY = 6, - XENO_STRUCTURE_PYLON = 2, - ) - - var/global/list/hive_structure_types = list( - XENO_STRUCTURE_CORE = /datum/construction_template/xenomorph/core, - XENO_STRUCTURE_CLUSTER = /datum/construction_template/xenomorph/cluster, - XENO_STRUCTURE_EGGMORPH = /datum/construction_template/xenomorph/eggmorph, - XENO_STRUCTURE_RECOVERY = /datum/construction_template/xenomorph/recovery - ) - - var/list/list/hive_structures = list() //Stringref list of structures that have been built - var/list/list/hive_constructions = list() //Stringref list of structures that are being built - - var/datum/hive_status_ui/hive_ui - var/datum/mark_menu_ui/mark_ui - var/datum/hive_faction_ui/faction_ui - - var/list/tunnels = list() - - var/list/allies = list() - - var/list/resin_marks = list() - - var/list/banished_ckeys = list() - - var/hivecore_cooldown = FALSE - - var/need_round_end_check = FALSE - - //Joining as Facehugger vars - /// When can huggers join the round - var/hugger_timelock = 15 MINUTES - /// How many huggers can the hive support - var/playable_hugger_limit = 0 - /// Minimum number of huggers available at any hive size - var/playable_hugger_minimum = 2 - /// This number divides the total xenos counted for slots to give the max number of facehuggers - var/playable_hugger_max_divisor = 4 - - /// How many lesser drones the hive can support - var/lesser_drone_limit = 0 - /// Slots available for lesser drones will never go below this number - var/lesser_drone_minimum = 2 - /// This number divides the total xenos counted for slots to give the max number of lesser drones - var/playable_lesser_drones_max_divisor = 3 - - var/datum/tacmap/drawing/xeno/tacmap - var/minimap_type = MINIMAP_FLAG_XENO - - var/list/available_nicknumbers = list() - - - /// Hive buffs - var/buff_points = HIVE_STARTING_BUFFPOINTS - var/max_buff_points = HIVE_MAX_BUFFPOINTS - - /// List of references to the currently active hivebuffs - var/list/active_hivebuffs - /// List of references to used hivebuffs - var/list/used_hivebuffs - /// List of references to used hivebuffs currently on cooldown - var/list/cooldown_hivebuffs - - /// List of references to hive pylons active in the game world - var/list/active_endgame_pylons - - /*Stores the image()'s for the xeno evolution radial menu - To add an image for your caste - add an icon to icons/mob/xenos/radial_xenos.dmi - Icon size should be 32x32, to make them fit within the radial menu border size your icon 22x22 and leave 10px transparent border. - The name of the icon should be the same as the XENO_CASTE_ define for that caste eg. #define XENO_CASTE_DRONE "Drone" - */ - var/static/list/evolution_menu_images - - /// Has a King hatchery - var/has_hatchery = FALSE - -/datum/hive_status/New() - hive_ui = new(src) - mark_ui = new(src) - faction_ui = new(src) -// minimap_type = faction.minimap_flag - tacmap = new(src, minimap_type) - if(!internal_faction) - internal_faction = name - for(var/number in 1 to 999) - available_nicknumbers += number - LAZYINITLIST(active_hivebuffs) - LAZYINITLIST(used_hivebuffs) - LAZYINITLIST(active_endgame_pylons) - - if(hivenumber != FACTION_XENOMORPH_NORMAL) - return - - if(!evolution_menu_images) - evolution_menu_images = list() - generate_evo_menu_images() - - RegisterSignal(SSdcs, COMSIG_GLOB_POST_SETUP, PROC_REF(post_setup)) - -///Generate the image()'s requried for the evolution radial menu. -/datum/hive_status/proc/generate_evo_menu_images() - for(var/datum/caste_datum/caste as anything in subtypesof(/datum/caste_datum)) - evolution_menu_images[initial(caste.caste_type)] = image('icons/mob/xenos/radial_xenos.dmi', initial(caste.caste_type)) - -/datum/hive_status/proc/post_setup() - SIGNAL_HANDLER - - setup_evolution_announcements() - setup_pylon_limits() - -/datum/hive_status/proc/setup_evolution_announcements() - for(var/time in GLOB.xeno_evolve_times) - if(time == "0") - continue - - addtimer(CALLBACK(src, PROC_REF(announce_evolve_available), GLOB.xeno_evolve_times[time]), text2num(time)) - -/// Sets up limits on pylons in New() for potential futureproofing with more static comms -/datum/hive_status/proc/setup_pylon_limits() - hive_structures_limit[XENO_STRUCTURE_PYLON] = length(GLOB.all_static_telecomms_towers) || 2 - -/datum/hive_status/proc/announce_evolve_available(list/datum/caste_datum/available_castes) - - var/list/castes_available = list() - for(var/datum/caste_datum/current_caste as anything in available_castes) - castes_available += initial(current_caste.caste_type) - - var/castes = castes_available.Join(", ") - xeno_message(SPAN_XENOANNOUNCE("The Hive is now strong enough to support: [castes]")) - xeno_maptext("The Hive can now support: [castes]", "Hive Strengthening") -/* - -// Adds a xeno to this hive -/datum/hive_status/proc/add_xeno(mob/living/carbon/xenomorph/X) - if(!X || !istype(X)) - return - - // If the xeno is part of another hive, they should be removed from that one first - if(X.hive && X.hive != src) - X.hive.remove_xeno(X, TRUE) - - // Already in the hive - if(X in totalXenos) - return - - // Can only have one queen. - if(isqueen(X)) - if(!living_xeno_queen && !should_block_game_interaction(X)) // Don't consider xenos in admin level - set_living_xeno_queen(X) - - X.hivenumber = hivenumber - X.hive = src - - X.set_faction(internal_faction) - - if(X.hud_list) - X.hud_update() - - var/area/A = get_area(X) - if(!should_block_game_interaction(X) || (A.flags_atom & AREA_ALLOW_XENO_JOIN)) - totalXenos += X - if(X.tier == 2) - tier_2_xenos += X - else if(X.tier == 3) - tier_3_xenos += X - - // Xenos are a fuckfest of cross-dependencies of different datums that are initialized at different times - // So don't even bother trying updating UI here without large refactors - -// Removes the xeno from the hive -/datum/hive_status/proc/remove_xeno(mob/living/carbon/xenomorph/xeno, hard = FALSE, light_mode = FALSE) - if(!xeno || !istype(xeno)) - return - - // Make sure the xeno was in the hive in the first place - if(!(xeno in totalXenos)) - return - - // This might be a redundant check now that Queen/Destroy() checks, but doesn't hurt to double check - if(living_xeno_queen == xeno) - var/mob/living/carbon/xenomorph/queen/next_queen = null - for(var/mob/living/carbon/xenomorph/queen/queen in totalXenos) - if(!should_block_game_interaction(queen) && queen != src && !QDELETED(queen)) - next_queen = queen - break - - set_living_xeno_queen(next_queen) // either null or a queen - - // We allow "soft" removals from the hive (the xeno still retains information about the hive) - // This is so that xenos can add themselves back to the hive if they should die or otherwise go "on leave" from the hive - if(hard) - xeno.hivenumber = 0 - xeno.hive = null -#ifndef UNIT_TESTS // Since this is a hard ref, we shouldn't confuse create_and_destroy - else - total_dead_xenos += xeno -#endif - - totalXenos -= xeno - if(xeno.tier == 2) - tier_2_xenos -= xeno - else if(xeno.tier == 3) - tier_3_xenos -= xeno - - // Only handle free slots if the xeno is not in tdome - if(!should_block_game_interaction(xeno)) - var/selected_caste = GLOB.xeno_datum_list[xeno.caste_type]?.type - if(used_slots[selected_caste]) - used_slots[selected_caste]-- - - if(!light_mode) - hive_ui.update_xeno_counts() - hive_ui.xeno_removed(xeno) -*/ -/datum/hive_status/proc/set_living_xeno_queen(mob/living/carbon/xenomorph/queen/queen) - if(!queen) - SStracking.delete_leader("hive_[hivenumber]") - SStracking.stop_tracking("hive_[hivenumber]", living_xeno_queen) - SShive_status.wait = 10 SECONDS - else - SStracking.set_leader("hive_[hivenumber]", queen) - SShive_status.wait = 2 SECONDS - - SEND_SIGNAL(src, COMSIG_HIVE_NEW_QUEEN, queen) - living_xeno_queen = queen - - recalculate_hive() - -/datum/hive_status/proc/recalculate_hive() - //No leaders for a Hive without a Queen! - queen_leader_limit = living_xeno_queen ? 4 : 0 - - if (length(xeno_leader_list) > queen_leader_limit) - var/diff = 0 - for (var/i in queen_leader_limit + 1 to length(xeno_leader_list)) - if(!open_xeno_leader_positions.Remove(i)) - remove_hive_leader(xeno_leader_list[i]) - diff++ - xeno_leader_list.len -= diff // Changing the size of xeno_leader_list needs to go at the end or else it won't iterate through the list properly - else if (length(xeno_leader_list) < queen_leader_limit) - for (var/i in length(xeno_leader_list) + 1 to queen_leader_limit) - open_xeno_leader_positions += i - xeno_leader_list.len++ - - hive_ui.update_all_data() - -/datum/hive_status/proc/add_hive_leader(mob/living/carbon/xenomorph/xeno) - if(!xeno) - return FALSE //How did this even happen? - if(!length(open_xeno_leader_positions)) - return FALSE //Too many leaders already (no available xeno leader positions) - if(xeno.hive_pos != NORMAL_XENO) - return FALSE //Already on the list - var/leader_num = open_xeno_leader_positions[1] - xeno_leader_list[leader_num] = xeno - xeno.hive_pos = XENO_LEADER_HIVE_POS(leader_num) - xeno.handle_xeno_leader_pheromones() - xeno.hud_update() // To add leader star - open_xeno_leader_positions -= leader_num - - xeno.update_minimap_icon() - - give_action(xeno, /datum/action/xeno_action/activable/info_marker) - - hive_ui.update_xeno_keys() - return TRUE - -/datum/hive_status/proc/remove_hive_leader(mob/living/carbon/xenomorph/xeno, light_mode = FALSE) - if(!istype(xeno) || !IS_XENO_LEADER(xeno)) - return FALSE - - var/leader_num = GET_XENO_LEADER_NUM(xeno) - - xeno_leader_list[leader_num] = null - - if(!light_mode) // Don't run side effects during deletions. Better yet, replace all this by signals someday - xeno.hive_pos = NORMAL_XENO - xeno.handle_xeno_leader_pheromones() - xeno.hud_update() // To remove leader star - - // Need to maintain ascending order of open_xeno_leader_positions - for (var/i in 1 to queen_leader_limit) - if (i > length(open_xeno_leader_positions) || open_xeno_leader_positions[i] > leader_num) - open_xeno_leader_positions.Insert(i, leader_num) - break - - if(!light_mode) - hive_ui.update_xeno_keys() - - for(var/obj/effect/alien/resin/marker/leaderless_mark in resin_marks) //no resin_mark limit abuse - if(leaderless_mark.createdby == xeno.nicknumber) - qdel(leaderless_mark) - - xeno.update_minimap_icon() - - remove_action(xeno, /datum/action/xeno_action/activable/info_marker) - - return TRUE - -/datum/hive_status/proc/replace_hive_leader(mob/living/carbon/xenomorph/original, mob/living/carbon/xenomorph/replacement) - if(!replacement || replacement.hive_pos != NORMAL_XENO) - return remove_hive_leader(original) - - var/leader_num = GET_XENO_LEADER_NUM(original) - - xeno_leader_list[leader_num] = replacement - - original.hive_pos = NORMAL_XENO - original.handle_xeno_leader_pheromones() - original.hud_update() // To remove leader star - remove_action(original, /datum/action/xeno_action/activable/info_marker) - - replacement.hive_pos = XENO_LEADER_HIVE_POS(leader_num) - replacement.handle_xeno_leader_pheromones() - replacement.hud_update() // To add leader star - give_action(replacement, /datum/action/xeno_action/activable/info_marker) - - hive_ui.update_xeno_keys() - -/datum/hive_status/proc/handle_xeno_leader_pheromones() - for(var/mob/living/carbon/xenomorph/L in xeno_leader_list) - L.handle_xeno_leader_pheromones() - -/* - * Helper procs for the Hive Status UI - * These are all called by the hive status UI manager to update its data - */ - -// Returns a list of how many of each caste of xeno there are, sorted by tier -/datum/hive_status/proc/get_xeno_counts() - // Every caste is manually defined here so you get - var/list/xeno_counts = list( - // Yes, Queen is technically considered to be tier 0 - list(XENO_CASTE_LARVA = 0, "Queen" = 0), - list(XENO_CASTE_DRONE = 0, XENO_CASTE_RUNNER = 0, XENO_CASTE_SENTINEL = 0, XENO_CASTE_DEFENDER = 0), - list(XENO_CASTE_HIVELORD = 0, XENO_CASTE_BURROWER = 0, XENO_CASTE_CARRIER = 0, XENO_CASTE_LURKER = 0, XENO_CASTE_SPITTER = 0, XENO_CASTE_WARRIOR = 0), - list(XENO_CASTE_BOILER = 0, XENO_CASTE_CRUSHER = 0, XENO_CASTE_PRAETORIAN = 0, XENO_CASTE_RAVAGER = 0) - ) - - for(var/mob/living/carbon/xenomorph/X in totalXenos) - //don't show xenos in the thunderdome when admins test stuff. - if(should_block_game_interaction(X)) - var/area/A = get_area(X) - if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) - continue - - if(X.caste && X.counts_for_slots) - xeno_counts[X.caste.tier+1][X.caste.caste_type]++ - - return xeno_counts - -// Returns a sorted list of some basic info (stuff that's needed for sorting) about all the xenos in the hive -// The idea is that we sort this list, and use it as a "key" for all the other information (especially the nicknumber) -// in the hive status UI. That way we can minimize the amount of sorts performed by only calling this when xenos are created/disposed -/datum/hive_status/proc/get_xeno_keys() - var/list/xenos = list() - - for(var/mob/living/carbon/xenomorph/X in totalXenos) - if(should_block_game_interaction(X)) - var/area/A = get_area(X) - if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) - continue - - if(!(X in GLOB.living_xeno_list)) - continue - - // This looks weird, but in DM adding List A to List B actually adds each item in List B to List A, not List B itself. - // Having a nested list like this sort of tricks it into adding the list instead. - // In this case this results in an array of different 'xeno' dictionaries, rather than just a dictionary. - xenos += list(list( - "nicknumber" = X.nicknumber, - "tier" = X.tier, // This one is only important for sorting - "is_leader" = (IS_XENO_LEADER(X)), - "is_queen" = istype(X.caste, /datum/caste_datum/queen), - "caste_type" = X.caste_type - )) - - // Make it all nice and fancy by sorting the list before returning it - var/list/sorted_keys = sort_xeno_keys(xenos) - if(length(sorted_keys)) - return sorted_keys - return xenos - -// This sorts the xeno info list by multiple criteria. Prioritized in order: -// 1. Queen -// 2. Leaders -// 3. Tier -// It uses a slightly modified insertion sort to accomplish this -/datum/hive_status/proc/sort_xeno_keys(list/xenos) - if(!length(xenos)) - return - - var/list/sorted_list = xenos.Copy() - - if(!length(sorted_list)) - return - - for(var/index in 2 to length(sorted_list)) - var/j = index - - while(j > 1) - var/current = sorted_list[j] - var/prev = sorted_list[j-1] - - // Queen comes first, always - if(current["is_queen"]) - sorted_list.Swap(j-1, j) - j-- - continue - - // don't muck up queen's slot - if(prev["is_queen"]) - j-- - continue - - // Leaders before normal xenos - if(!prev["is_leader"] && current["is_leader"]) - sorted_list.Swap(j-1, j) - j-- - continue - - // Make sure we're only comparing leaders to leaders and non-leaders to non-leaders when sorting - // This means we get leaders sorted first, then non-leaders sorted - // Sort by tier first, higher tiers over lower tiers, and then by name alphabetically - - // Could not think of an elegant way to write this - if(!(current["is_leader"]^prev["is_leader"])\ - && (prev["tier"] < current["tier"]\ - || prev["tier"] == current["tier"] && prev["caste_type"] > current["caste_type"]\ - )) - sorted_list.Swap(j-1, j) - - j-- - - return sorted_list - -// Returns a list with some more info about all xenos in the hive -/datum/hive_status/proc/get_xeno_info() - var/list/xenos = list() - - for(var/mob/living/carbon/xenomorph/X in totalXenos) - if(should_block_game_interaction(X)) - var/area/A = get_area(X) - if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) - continue - - var/xeno_name = X.name - // goddamn fucking larvas with their weird ass maturing system - // its name updates with its icon, unlike other castes which only update the mature/elder, etc. prefix on evolve - if(istype(X, /mob/living/carbon/xenomorph/larva)) - xeno_name = "Larva ([X.nicknumber])" - xenos["[X.nicknumber]"] = list( - "name" = xeno_name, - "strain" = X.get_strain_name(), - "ref" = "\ref[X]" - ) - - return xenos - -/datum/hive_status/proc/set_hive_location(obj/effect/alien/resin/special/pylon/core/C) - if(!C || C == hive_location) - return - var/area/A = get_area(C) - xeno_message(SPAN_XENOANNOUNCE("The Queen has set the hive location as \the [A]."), 3, hivenumber) - hive_location = C - hive_ui.update_hive_location() - -// Returns a list of xeno healths and locations -/datum/hive_status/proc/get_xeno_vitals() - var/list/xenos = list() - - for(var/mob/living/carbon/xenomorph/X in totalXenos) - if(should_block_game_interaction(X)) - var/area/A = get_area(X) - if(!(A.flags_atom & AREA_ALLOW_XENO_JOIN)) - continue - - if(!(X in GLOB.living_xeno_list)) - continue - - var/area/A = get_area(X) - var/area_name = "Unknown" - if(A) - area_name = A.name - - xenos["[X.nicknumber]"] = list( - "health" = round((X.health / X.maxHealth) * 100, 1), - "area" = area_name, - "is_ssd" = (!X.client) - ) - - return xenos - -#define TIER_3 "3" -#define TIER_2 "2" -#define OPEN_SLOTS "open_slots" -#define GUARANTEED_SLOTS "guaranteed_slots" - -// Returns an assoc list of open slots and guaranteed slots left -/datum/hive_status/proc/get_tier_slots() - var/list/slots = list( - TIER_3 = list( - OPEN_SLOTS = 0, - GUARANTEED_SLOTS = list(), - ), - TIER_2 = list( - OPEN_SLOTS = 0, - GUARANTEED_SLOTS = list(), - ), - ) - - var/used_tier_2_slots = length(tier_2_xenos) - var/used_tier_3_slots = length(tier_3_xenos) - - for(var/caste_path in free_slots) - var/slots_free = free_slots[caste_path] - var/slots_used = used_slots[caste_path] - var/datum/caste_datum/current_caste = caste_path - if(slots_used) - // Don't count any free slots in use - switch(initial(current_caste.tier)) - if(2) - used_tier_2_slots -= min(slots_used, slots_free) - if(3) - used_tier_3_slots -= min(slots_used, slots_free) - if(slots_free <= slots_used) - continue - // Display any free slots available - switch(initial(current_caste.tier)) - if(2) - slots[TIER_2][GUARANTEED_SLOTS][initial(current_caste.caste_type)] = slots_free - slots_used - if(3) - slots[TIER_3][GUARANTEED_SLOTS][initial(current_caste.caste_type)] = slots_free - slots_used - - var/burrowed_factor = min(stored_larva, sqrt(4*stored_larva)) - var/effective_total = floor(burrowed_factor) - for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) - if(xeno.counts_for_slots) - effective_total++ - - // Tier 3 slots are always 20% of the total xenos in the hive - slots[TIER_3][OPEN_SLOTS] = max(0, ceil(0.20*effective_total/tier_slot_multiplier) - used_tier_3_slots) - // Tier 2 slots are between 30% and 50% of the hive, depending - // on how many T3s there are. - slots[TIER_2][OPEN_SLOTS] = max(0, ceil(0.5*effective_total/tier_slot_multiplier) - used_tier_2_slots - used_tier_3_slots) - - return slots - -#undef TIER_3 -#undef TIER_2 -#undef OPEN_SLOTS -#undef GUARANTEED_SLOTS - -/datum/hive_status/proc/can_build_structure(structure_name) - if(!structure_name || !hive_structures_limit[structure_name]) - return FALSE - if(get_structure_count(structure_name) >= hive_structures_limit[structure_name]) - return FALSE - return TRUE - -/datum/hive_status/proc/get_structure_count(structure_name) - return length(hive_structures[structure_name]) + length(hive_constructions[structure_name]) - -/datum/hive_status/proc/has_structure(structure_name) - if(!structure_name) - return FALSE - if(LAZYLEN(hive_structures[structure_name])) - return TRUE - return FALSE - -/datum/hive_status/proc/add_construction(obj/effect/alien/resin/construction/S) - if(!S || !S.template) - return FALSE - var/name_ref = initial(S.template.name) - if(!hive_constructions[name_ref]) - hive_constructions[name_ref] = list() - if(length(hive_constructions[name_ref]) >= hive_structures_limit[name_ref]) - return FALSE - hive_constructions[name_ref] += src - return TRUE - -/datum/hive_status/proc/remove_construction(obj/effect/alien/resin/construction/S) - if(!S || !S.template) - return FALSE - var/name_ref = initial(S.template.name) - hive_constructions[name_ref] -= src - return TRUE - -/datum/hive_status/proc/add_special_structure(obj/effect/alien/resin/special/S) - if(!S) - return FALSE - var/name_ref = initial(S.name) - if(!hive_structures[name_ref]) - hive_structures[name_ref] = list() - if(length(hive_structures[name_ref]) >= hive_structures_limit[name_ref]) - return FALSE - hive_structures[name_ref] += S - return TRUE - -/datum/hive_status/proc/remove_special_structure(obj/effect/alien/resin/special/S) - if(!S) - return FALSE - var/name_ref = initial(S.name) - hive_structures[name_ref] -= S - return TRUE - -/datum/hive_status/proc/has_special_structure(name_ref) - if(!name_ref || !LAZYLEN(hive_structures[name_ref])) - return 0 - return length(hive_structures[name_ref]) - -/datum/hive_status/proc/abandon_on_hijack() - var/area/hijacked_dropship = get_area(living_xeno_queen) - var/shipside_humans_weighted_count = 0 - var/xenos_count = 0 - for(var/name_ref in hive_structures) - for(var/obj/effect/alien/resin/special/S in hive_structures[name_ref]) - if(get_area(S) == hijacked_dropship) - continue - S.hijack_delete = TRUE - hive_structures[name_ref] -= S - qdel(S) - for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) - if(get_area(xeno) != hijacked_dropship && xeno.loc && is_ground_level(xeno.loc.z)) - if(isfacehugger(xeno) || islesserdrone(xeno)) - to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) - if(length(xeno.stomach_contents)) - xeno.devour_timer = 0 - xeno.handle_stomach_contents() - qdel(xeno) - continue - if(xeno.hunter_data.hunted && !isqueen(xeno)) - to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, seperating you from her hive! You must defend yourself from the headhunter before you can enter hibernation...")) - xeno.set_hive_and_update(FACTION_XENOMORPH_FORSAKEN) - else - to_chat(xeno, SPAN_XENOANNOUNCE("The Queen has left without you, you quickly find a hiding place to enter hibernation as you lose touch with the hive mind.")) - if(length(xeno.stomach_contents)) - xeno.devour_timer = 0 - xeno.handle_stomach_contents() - qdel(xeno) - stored_larva++ - continue - if(xeno.tier >= 1) - xenos_count++ - for(var/i in GLOB.alive_mob_list) - var/mob/living/potential_host = i - if(!(potential_host.status_flags & XENO_HOST)) - continue - if(!is_ground_level(potential_host.z) || get_area(potential_host) == hijacked_dropship) - continue - var/obj/item/alien_embryo/A = locate() in potential_host -// if(A && A.faction != faction) -// continue -// for(var/obj/item/alien_embryo/embryo in potential_host) -// embryo.hivenumber = FACTION_XENOMORPH_FORSAKEN - potential_host.update_med_icon() - for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) - if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) - continue - var/datum/job/job = GLOB.RoleAuthority.roles_for_mode[current_human.job] - if(!job) - continue - var/turf/turf = get_turf(current_human) - if(is_mainship_level(turf?.z)) - shipside_humans_weighted_count += GLOB.RoleAuthority.calculate_role_weight(job) - hijack_burrowed_surge = TRUE - hijack_burrowed_left = max(ceil(shipside_humans_weighted_count * 0.5) - xenos_count, 5) - hivecore_cooldown = FALSE - xeno_message(SPAN_XENOBOLDNOTICE("The weeds have recovered! A new hive core can be built!"),3,hivenumber) - - // No buffs in hijack - for(var/datum/hivebuff/buff in active_hivebuffs) - buff._on_cease() - -/datum/hive_status/proc/free_respawn(client/C) - stored_larva++ - if(!hive_location || !hive_location.spawn_burrowed_larva(C.mob)) - stored_larva-- - else - hive_ui.update_burrowed_larva() - -/datum/hive_status/proc/respawn_on_turf(client/xeno_client, turf/spawning_turf) - var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber) - if(isnull(new_xeno)) - return FALSE - - if(!SSticker.mode.transfer_xeno(xeno_client.mob, new_xeno)) - qdel(new_xeno) - return FALSE - - new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly emerges from a dead husk!"), - SPAN_XENOANNOUNCE("The hive has no core! You manage to emerge from your old husk as a larva!")) - msg_admin_niche("[key_name(new_xeno)] respawned at \a [spawning_turf]. [ADMIN_JMP(spawning_turf)]") - playsound(new_xeno, 'sound/effects/xeno_newlarva.ogg', 50, 1) - if(new_xeno.client?.prefs?.toggles_flashing & FLASH_POOLSPAWN) - window_flash(new_xeno.client) - - hive_ui.update_burrowed_larva() - -/datum/hive_status/proc/do_buried_larva_spawn(mob/xeno_candidate) - var/spawning_area - if(hive_location) - spawning_area = hive_location - else if(living_xeno_queen) - spawning_area = living_xeno_queen - else for(var/mob/living/carbon/xenomorpheus as anything in totalXenos) - if(islarva(xenomorpheus) || isxeno_builder(xenomorpheus)) //next to xenos that should be in a safe spot - spawning_area = xenomorpheus - if(!spawning_area) - spawning_area = pick(totalXenos) // FUCK IT JUST GO ANYWHERE - var/list/turf_list - for(var/turf/open/open_turf in orange(3, spawning_area)) - if(istype(open_turf, /turf/open/space)) - continue - LAZYADD(turf_list, open_turf) - // just on the off-chance - if(!LAZYLEN(turf_list)) - return FALSE - var/turf/open/spawning_turf = pick(turf_list) - - var/mob/living/carbon/xenomorph/larva/new_xeno = spawn_hivenumber_larva(spawning_turf, hivenumber) - if(isnull(new_xeno)) - return FALSE - - if(!SSticker.mode.transfer_xeno(xeno_candidate, new_xeno)) - qdel(new_xeno) - return FALSE - new_xeno.visible_message(SPAN_XENODANGER("A larva suddenly burrows out of \the [spawning_turf]!"), - SPAN_XENODANGER("You burrow out of \the [spawning_turf] and awaken from your slumber. For the Hive!")) - msg_admin_niche("[key_name(new_xeno)] burrowed out from \a [spawning_turf]. [ADMIN_JMP(spawning_turf)]") - playsound(new_xeno, 'sound/effects/xeno_newlarva.ogg', 50, 1) - to_chat(new_xeno, SPAN_XENOANNOUNCE("You are a xenomorph larva awakened from slumber!")) - if(new_xeno.client) - if(new_xeno.client?.prefs?.toggles_flashing & FLASH_POOLSPAWN) - window_flash(new_xeno.client) - - stored_larva-- - hive_ui.update_burrowed_larva() - -/datum/hive_status/proc/can_delay_round_end(mob/living/carbon/xenomorph/xeno) - if(HAS_TRAIT(src, TRAIT_NO_HIVE_DELAY)) - return FALSE - return TRUE - -/datum/hive_status/proc/update_hugger_limit() - var/countable_xeno_iterator = 0 - for(var/mob/living/carbon/xenomorph/cycled_xeno as anything in totalXenos) - if(cycled_xeno.counts_for_slots) - countable_xeno_iterator++ - - playable_hugger_limit = max(floor(countable_xeno_iterator / playable_hugger_max_divisor), playable_hugger_minimum) - -/datum/hive_status/proc/can_spawn_as_hugger(mob/dead/observer/user) -// if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) -// return FALSE - if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned - to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) - return FALSE - if(world.time < hugger_timelock) - to_chat(user, SPAN_WARNING("The hive cannot support facehuggers yet...")) - return FALSE - if(!user.bypass_time_of_death_checks_hugger && world.time - user.timeofdeath < JOIN_AS_FACEHUGGER_DELAY) - var/time_left = floor((user.timeofdeath + JOIN_AS_FACEHUGGER_DELAY - world.time) / 10) - to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a facehugger until 3 minutes have passed ([time_left] seconds remaining).")) - return FALSE - if(length(totalXenos) <= 0) - //This is to prevent people from joining as Forsaken Huggers on the pred ship - to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!")) - return FALSE - for(var/mob_name in banished_ckeys) - if(banished_ckeys[mob_name] == user.ckey) - to_chat(user, SPAN_WARNING("You are banished from the [name], you may not rejoin unless the Queen re-admits you or dies.")) - return FALSE - - update_hugger_limit() - - var/current_hugger_count = 0 - for(var/mob/mob as anything in totalXenos) - if(isfacehugger(mob)) - current_hugger_count++ - if(playable_hugger_limit <= current_hugger_count) -// to_chat(user, SPAN_WARNING("\The [GLOB.hive_datum[hivenumber]] cannot support more facehuggers! Limit: [current_hugger_count]/[playable_hugger_limit]")) -// return FALSE - - if(tgui_alert(user, "Are you sure you want to become a facehugger?", "Confirmation", list("Yes", "No")) != "Yes") - return FALSE - - if(!user.client) - return FALSE - - return TRUE - -/datum/hive_status/proc/get_current_playable_facehugger_count() - var/count = 0 - for(var/mob/mob as anything in totalXenos) - if(isfacehugger(mob)) - count++ - return count - -/datum/hive_status/proc/spawn_as_hugger(mob/dead/observer/user, atom/A) - var/mob/living/carbon/xenomorph/facehugger/hugger = new /mob/living/carbon/xenomorph/facehugger(A.loc, null, hivenumber) - user.mind.transfer_to(hugger, TRUE) - hugger.visible_message(SPAN_XENODANGER("A facehugger suddenly emerges out of \the [A]!"), SPAN_XENODANGER("You emerge out of \the [A] and awaken from your slumber. For the Hive!")) - playsound(hugger, 'sound/effects/xeno_newlarva.ogg', 25, TRUE) - hugger.generate_name() - hugger.timeofdeath = user.timeofdeath // Keep old death time - -/datum/hive_status/proc/update_lesser_drone_limit() - var/countable_xeno_iterator = 0 - for(var/mob/living/carbon/xenomorph/cycled_xeno as anything in totalXenos) - if(cycled_xeno.counts_for_slots) - countable_xeno_iterator++ - - lesser_drone_limit = max(floor(countable_xeno_iterator / playable_lesser_drones_max_divisor), lesser_drone_minimum) - -/datum/hive_status/proc/can_spawn_as_lesser_drone(mob/dead/observer/user, obj/effect/alien/resin/special/pylon/spawning_pylon) -// if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) -// return FALSE - - if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned - to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) - return FALSE - - if(world.time - user.timeofdeath < JOIN_AS_LESSER_DRONE_DELAY) - var/time_left = floor((user.timeofdeath + JOIN_AS_LESSER_DRONE_DELAY - world.time) / 10) - to_chat(user, SPAN_WARNING("You ghosted too recently. You cannot become a lesser drone until 30 seconds have passed ([time_left] seconds remaining).")) - return FALSE - - if(length(totalXenos) <= 0) - to_chat(user, SPAN_WARNING("The hive has fallen, you can't join it!")) - return FALSE - - if(!living_xeno_queen) - to_chat(user, SPAN_WARNING("The selected hive does not have a Queen!")) - return FALSE - - if(spawning_pylon.lesser_drone_spawns < 1) - to_chat(user, SPAN_WARNING("The selected core or pylon does not have enough power for a lesser drone!")) - return FALSE - - update_lesser_drone_limit() - - var/current_lesser_drone_count = 0 - for(var/mob/mob as anything in totalXenos) - if(islesserdrone(mob)) - current_lesser_drone_count++ - - if(lesser_drone_limit <= current_lesser_drone_count) - to_chat(user, SPAN_WARNING("[faction] cannot support more lesser drones! Limit: [current_lesser_drone_count]/[lesser_drone_limit]")) - return FALSE - - if(!user.client) - return FALSE - - return TRUE - -// Get amount of real xenos, don't count lessers/huggers -/datum/hive_status/proc/get_real_total_xeno_count() - var/count = 0 - for(var/mob/living/carbon/xenomorph/xeno as anything in totalXenos) - if(xeno.counts_for_slots) - count++ - return count - -// Checks if we hit larva limit -/datum/hive_status/proc/check_if_hit_larva_from_pylon_limit() - var/groundside_humans_weighted_count = 0 - for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list) - if(!(isspecieshuman(current_human) || isspeciessynth(current_human))) - continue - var/datum/job/job = GLOB.RoleAuthority.roles_for_mode[current_human.job] - if(!job) - continue - var/turf/turf = get_turf(current_human) - if(is_ground_level(turf?.z)) - groundside_humans_weighted_count += GLOB.RoleAuthority.calculate_role_weight(job) - hit_larva_pylon_limit = (get_real_total_xeno_count() + stored_larva) > (groundside_humans_weighted_count * ENDGAME_LARVA_CAP_MULTIPLIER) - hive_ui.update_pylon_status() - return hit_larva_pylon_limit - -///Called by /obj/item/alien_embryo when a host is bursting to determine extra larva per burst -/datum/hive_status/proc/increase_larva_after_burst() - var/extra_per_burst = CONFIG_GET(number/extra_larva_per_burst) - partial_larva += extra_per_burst - convert_partial_larva_to_full_larva() - -///Called after times when partial larva are added to process them to stored larva -/datum/hive_status/proc/convert_partial_larva_to_full_larva() - for(var/i = 1 to partial_larva) - partial_larva-- - stored_larva++ - -/datum/hive_status/corrupted - name = "Corrupted Hive" - reporting_id = "corrupted" -// hivenumber = XENO_HIVE_CORRUPTED - prefix = "Corrupted " - color = "#80ff80" - ui_color ="#4d994d" - latejoin_burrowed = FALSE - - need_round_end_check = TRUE - - var/list/defectors = list() - var/list/datum/weakref/personal_allies = list() -/* -/datum/hive_status/corrupted/add_xeno(mob/living/carbon/xenomorph/xeno) - . = ..() - xeno.add_language(LANGUAGE_ENGLISH) - -/datum/hive_status/corrupted/remove_xeno(mob/living/carbon/xenomorph/xeno, hard) - . = ..() - xeno.remove_language(LANGUAGE_ENGLISH) - -/datum/hive_status/corrupted/can_delay_round_end(mob/living/carbon/xenomorph/xeno) - if(!faction_is_ally(FACTION_MARINE, TRUE)) - return TRUE - return FALSE - -/datum/hive_status/alpha - name = "Alpha Hive" - reporting_id = "alpha" - hivenumber = XENO_HIVE_ALPHA - prefix = "Alpha " - color = "#ff4040" - ui_color = "#992626" - latejoin_burrowed = FALSE - - dynamic_evolution = FALSE - -/datum/hive_status/bravo - name = "Bravo Hive" - reporting_id = "bravo" - hivenumber = FACTION_XENOMORPH_NORMAL - prefix = "Bravo " - color = "#ffff80" - ui_color = "#99994d" - latejoin_burrowed = FALSE - - dynamic_evolution = FALSE - -/datum/hive_status/charlie - name = "Charlie Hive" - reporting_id = "charlie" - hivenumber = XENO_HIVE_CHARLIE - prefix = "Charlie " - color = "#bb40ff" - ui_color = "#702699" - latejoin_burrowed = FALSE - - dynamic_evolution = FALSE - -/datum/hive_status/delta - name = "Delta Hive" - reporting_id = "delta" - hivenumber = XENO_HIVE_DELTA - prefix = "Delta " - color = "#8080ff" - ui_color = "#4d4d99" - latejoin_burrowed = FALSE - - dynamic_evolution = FALSE - -/datum/hive_status/feral - name = "Feral Hive" - reporting_id = "feral" - hivenumber = FACTION_XENOMORPH_FERAL - prefix = "Feral " - color = "#828296" - ui_color = "#828296" - - construction_allowed = XENO_NOBODY - destruction_allowed = XENO_NOBODY - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_no_queen_evo = TRUE - allow_queen_evolve = FALSE - latejoin_burrowed = FALSE - -/datum/hive_status/forsaken - name = "Forsaken Hive" - reporting_id = "forsaken" - hivenumber = FACTION_XENOMORPH_FORSAKEN - prefix = "Forsaken " - color = "#cc8ec4" - ui_color = "#cc8ec4" - - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_no_queen_evo = TRUE - allow_queen_evolve = FALSE - latejoin_burrowed = FALSE - - need_round_end_check = TRUE - -/datum/hive_status/forsaken/can_delay_round_end(mob/living/carbon/xenomorph/xeno) - return FALSE - -/datum/hive_status/tutorial - name = "Tutorial Hive" - reporting_id = "tutorial" - hivenumber = FACTION_XENOMORPH_TUTORIAL - prefix = "Inquisitive " - latejoin_burrowed = FALSE - - dynamic_evolution = FALSE - allow_queen_evolve = TRUE - evolution_without_ovipositor = FALSE - allow_no_queen_actions = TRUE - - ///Can have many tutorials going at once. - hive_structures_limit = list( - XENO_STRUCTURE_CORE = 999, - XENO_STRUCTURE_CLUSTER = 999, - XENO_STRUCTURE_EGGMORPH = 999, - XENO_STRUCTURE_RECOVERY = 999, - ) - -/datum/hive_status/tutorial/can_delay_round_end(mob/living/carbon/xenomorph/xeno) - return FALSE - -/datum/hive_status/yautja - name = "Hellhound Pack" - reporting_id = "hellhounds" - hivenumber = XENO_HIVE_YAUTJA - internal_faction = FACTION_YAUTJA - - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_no_queen_evo = TRUE - allow_queen_evolve = FALSE - latejoin_burrowed = FALSE - - need_round_end_check = TRUE - -/datum/hive_status/yautja/can_delay_round_end(mob/living/carbon/xenomorph/xeno) - return FALSE - -/datum/hive_status/mutated - name = "Mutated Hive" - reporting_id = "mutated" - hivenumber = XENO_HIVE_MUTATED - prefix = "Mutated " - color = "#6abd99" - ui_color = "#6abd99" - - hive_inherant_traits = list(TRAIT_XENONID, TRAIT_NO_COLOR) - latejoin_burrowed = FALSE -*/ - -/datum/hive_status/corrupted/tamed - name = "Tamed Hive" - reporting_id = "tamed" -// hivenumber = XENO_HIVE_TAMED - prefix = "Tamed " - color = "#80ff80" - - dynamic_evolution = FALSE - allow_no_queen_actions = TRUE - allow_no_queen_evo = TRUE - allow_queen_evolve = FALSE - latejoin_burrowed = FALSE - - var/mob/living/carbon/human/leader - var/list/allied_factions - -/datum/hive_status/corrupted/tamed/New() - . = ..() - hive_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0 - -/datum/hive_status/corrupted/tamed/proc/make_leader(mob/living/carbon/human/H) - if(!istype(H)) - return - - if(leader) - UnregisterSignal(leader, COMSIG_PARENT_QDELETING) - - leader = H - RegisterSignal(leader, COMSIG_PARENT_QDELETING, PROC_REF(handle_qdelete)) - -/datum/hive_status/corrupted/tamed/proc/handle_qdelete(mob/living/carbon/human/H) - SIGNAL_HANDLER - - if(H == leader) - leader = null -/* - var/list/faction_groups = H.faction_group - if(faction_groups) - allied_factions = faction_groups.Copy() - if(!(H.faction in allied_factions)) - allied_factions += H.faction - -/datum/hive_status/corrupted/tamed/add_xeno(mob/living/carbon/xenomorph/X) - . = ..() - X.faction_group = allied_factions - -/datum/hive_status/corrupted/tamed/remove_xeno(mob/living/carbon/xenomorph/X, hard) - . = ..() - X.faction_group = list(X.faction) - -/datum/hive_status/corrupted/tamed/is_ally(mob/living/carbon/C) - if(leader) - if(C.faction in leader.faction_group) - return TRUE - - if(C.faction == leader.faction) - return TRUE - else - if(C.faction in allied_factions) - return TRUE - - return ..() -*/ -/datum/hive_status/corrupted/renegade - name = "Renegade Hive" - reporting_id = "renegade" -// hivenumber = XENO_HIVE_RENEGADE - prefix = "Renegade " - color = "#ffae00" - ui_color ="#ad732c" - - dynamic_evolution = FALSE - allow_queen_evolve = FALSE - allow_no_queen_evo = TRUE - latejoin_burrowed = FALSE - -/datum/hive_status/corrupted/renegade/New() - . = ..() - hive_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0 - for(var/faction in FACTION_LIST_HUMANOID) //renegades allied to all humanoids, but it mostly affects structures. Their ability to attack humanoids and other xenos (including of the same hive) depends on iff settings - allies[faction] = TRUE - -/datum/hive_status/corrupted/renegade/can_spawn_as_hugger(mob/dead/observer/user) - to_chat(user, SPAN_WARNING("The [name] cannot support facehuggers.")) - return FALSE - -/datum/hive_status/corrupted/renegade/proc/iff_protection_check(mob/living/carbon/xenomorph/xeno, mob/living/carbon/attempt_harm_mob)/* - if(xeno == attempt_harm_mob) - return TRUE //you cannot hurt yourself... - if(!xeno.iff_tag) - return FALSE //can attack anyone if you don't have iff tag - if(isxeno(attempt_harm_mob)) - var/mob/living/carbon/xenomorph/target_xeno = attempt_harm_mob - if(!target_xeno.iff_tag) - return FALSE //can attack any xeno who don't have iff tag - for(var/faction in xeno.iff_tag.faction_groups) - if(faction in target_xeno.iff_tag.faction_groups) - return TRUE //cannot attack xenos with same iff setting - return FALSE - for(var/faction in xeno.iff_tag.faction_groups) - if(faction in attempt_harm_mob.faction_group) - return TRUE //cannot attack mob if iff is set to at least one of its factions - return FALSE -*/ -//datum/hive_status/corrupted/renegade/faction_is_ally(faction, ignore_queen_check = TRUE) -// return ..() - -/datum/hive_status/proc/on_queen_death() //break alliances on queen's death - if(allow_no_queen_actions || living_xeno_queen) - return - var/broken_alliances = FALSE - for(var/faction in allies) - if(!allies[faction]) - continue - change_stance(faction, FALSE) - broken_alliances = TRUE - - - if(broken_alliances) - xeno_message(SPAN_XENOANNOUNCE("With the death of the Queen, all alliances have been broken."), 3, hivenumber) - -/datum/hive_status/proc/change_stance(faction, should_ally) - if(faction == name) - return - if(allies[faction] == should_ally) - return - allies[faction] = should_ally - - if(living_xeno_queen) - if(allies[faction]) - xeno_message(SPAN_XENOANNOUNCE("Our Queen set up an alliance with [faction]!"), 3, hivenumber) - else - xeno_message(SPAN_XENOANNOUNCE("Our Queen broke the alliance with [faction]!"), 3, hivenumber) -/* - for(var/number in GLOB.hive_datum) - var/datum/hive_status/target_hive = GLOB.hive_datum[number] - if(target_hive.name != faction) - continue - if(!target_hive.living_xeno_queen && !target_hive.allow_no_queen_actions) - return - if(allies[faction]) - xeno_message(SPAN_XENOANNOUNCE("We sense that [name] [living_xeno_queen ? "Queen " : ""]set up an alliance with us!"), 3, target_hive.hivenumber) - return - - xeno_message(SPAN_XENOANNOUNCE("We sense that [name] [living_xeno_queen ? "Queen " : ""]broke the alliance with us!"), 3, target_hive.hivenumber) - if(target_hive.allies[name]) //autobreak alliance on betrayal - target_hive.change_stance(name, FALSE) -*/ -/datum/hive_status/corrupted/change_stance(faction, should_ally) - . = ..() - if(allies[faction]) - return - if(!(faction in FACTION_LIST_HUMANOID)) - return -/* - for(var/mob/living/carbon/xenomorph/xeno in totalXenos) // handle defecting xenos on betrayal - if(!xeno.iff_tag) - continue - if(!(faction in xeno.iff_tag.faction_groups)) - continue - if(xeno in defectors) - continue - if(xeno.caste_type == XENO_CASTE_QUEEN) - continue - INVOKE_ASYNC(src, PROC_REF(give_defection_choice), xeno, faction) - addtimer(CALLBACK(src, PROC_REF(handle_defectors), faction), 11 SECONDS) -*/ -/datum/hive_status/corrupted/proc/give_defection_choice(mob/living/carbon/xenomorph/xeno, faction)/* - if(tgui_alert(xeno, "Our Queen has broken the alliance with the [faction]. The device inside our carapace begins to suppress our connection with the Hive. Do we remove it and stay loyal to her?", "Alliance broken!", list("Stay loyal", "Obey the talls"), 10 SECONDS) == "Obey the talls") - if(!xeno.iff_tag) - to_chat(xeno, SPAN_XENOWARNING("It's too late now. The device is gone and our service to the Queen continues.")) - return - defectors += xeno - xeno.set_hive_and_update(XENO_HIVE_RENEGADE) - to_chat(xeno, SPAN_XENOANNOUNCE("You lost the connection with your Hive. Now you have no Queen, only your masters.")) - to_chat(xeno, SPAN_NOTICE("Your instincts have changed, you seem compelled to protect [english_list(xeno.iff_tag.faction_groups, "no one")].")) - return - xeno.visible_message(SPAN_XENOWARNING("[xeno] rips out [xeno.iff_tag]!"), SPAN_XENOWARNING("We rip out [xeno.iff_tag]! For the Hive!")) - xeno.adjustBruteLoss(50) - xeno.iff_tag.forceMove(get_turf(xeno)) - xeno.iff_tag = null -*/ -/datum/hive_status/corrupted/proc/handle_defectors(faction)/* - for(var/mob/living/carbon/xenomorph/xeno in totalXenos) - if(!xeno.iff_tag) - continue - if(xeno in defectors) - continue - if(!(faction in xeno.iff_tag.faction_groups)) - continue - xeno.visible_message(SPAN_XENOWARNING("[xeno] rips out [xeno.iff_tag]!"), SPAN_XENOWARNING("We rip out [xeno.iff_tag]! For the hive!")) - xeno.adjustBruteLoss(50) - xeno.iff_tag.forceMove(get_turf(xeno)) - xeno.iff_tag = null - if(!length(defectors)) - return - - xeno_message(SPAN_XENOANNOUNCE("We sense that [english_list(defectors)] turned their backs against their sisters and the Queen in favor of their slavemasters!"), 3, hivenumber) - defectors.Cut() -*/ -/datum/hive_status/corrupted/proc/add_personal_ally(mob/living/ally) - personal_allies += WEAKREF(ally) - ally.status_flags |= CORRUPTED_ALLY - ally.med_hud_set_status() - xeno_message(SPAN_XENOANNOUNCE("Our Queen proclaimed [ally] our ally! We must not harm them."), 3, hivenumber) - -/datum/hive_status/corrupted/proc/remove_personal_ally(datum/weakref/ally_ref) - personal_allies -= ally_ref - var/mob/living/ally = ally_ref.resolve() - if(ally) - ally.status_flags &= ~CORRUPTED_ALLY - ally.med_hud_set_status() - xeno_message(SPAN_XENOANNOUNCE("Our Queen has declared that [ally] is no longer our ally!"), 3, hivenumber) - -/datum/hive_status/corrupted/proc/clear_personal_allies(death = FALSE) - for(var/datum/weakref/ally_ref in personal_allies) - var/mob/living/ally = ally_ref.resolve() - if(!ally) - continue - ally.status_flags &= ~CORRUPTED_ALLY - ally.med_hud_set_status() - personal_allies.Cut() - if(!death) - xeno_message(SPAN_XENOANNOUNCE("Our Queen has broken all personal alliances with the talls! Favoritism is no more."), 3, hivenumber) - return - xeno_message(SPAN_XENOWARNING("With the death of the Queen, her friends no longer matter to us."), 3, hivenumber) -/* -/datum/hive_status/corrupted/is_ally(mob/living/living_mob) - if(living_mob.status_flags & CORRUPTED_ALLY) - return TRUE - return ..() -*/ -/datum/hive_status/proc/override_evilution(evil, override) - if(SSxevolution) - SSxevolution.override_power(hivenumber, evil, override) - -/datum/hive_status/corrupted/on_queen_death() - ..() - if(!length(personal_allies)) - return - clear_personal_allies(TRUE) -/// Hive buffs - -/// Get a list of hivebuffs which can be bought now. -/datum/hive_status/proc/get_available_hivebuffs() - var/list/potential_hivebuffs = subtypesof(/datum/hivebuff) - - // First check if we any pylons which are capable of supporting hivebuffs - if(!LAZYLEN(active_endgame_pylons)) - return - - for(var/datum/hivebuff/possible_hivebuff as anything in potential_hivebuffs) - // Round isn't old enough yet - if(ROUND_TIME < initial(possible_hivebuff.roundtime_to_enable)) - potential_hivebuffs -= possible_hivebuff - continue - - if(initial(possible_hivebuff.number_of_required_pylons) > LAZYLEN(active_endgame_pylons)) - potential_hivebuffs -= possible_hivebuff - continue - - // Prevent the same lineage of buff in active hivebuffs (e.g. no minor and major health allowed) - var/already_active = FALSE - for(var/datum/hivebuff/buff as anything in active_hivebuffs) - if(istype(buff, possible_hivebuff)) - already_active = TRUE - break - if(ispath(possible_hivebuff, buff.type)) - already_active = TRUE - break - if(already_active) - potential_hivebuffs -= possible_hivebuff - continue - - //If this buff isn't combineable, check if any other active hivebuffs aren't combineable - if(!initial(possible_hivebuff.is_combineable)) - var/found_conflict = FALSE - for(var/datum/hivebuff/active_hivebuff in active_hivebuffs) - if(!active_hivebuff.is_combineable) - found_conflict = TRUE - break - if(found_conflict) - potential_hivebuffs -= possible_hivebuff - continue - - // If the buff is not reusable check against used hivebuffs. - if(!initial(possible_hivebuff.is_reusable)) - if(locate(possible_hivebuff) in used_hivebuffs) - potential_hivebuffs -= possible_hivebuff - continue - - return potential_hivebuffs - -/datum/hive_status/proc/attempt_apply_hivebuff(datum/hivebuff/hivebuff, mob/living/purchasing_player, obj/effect/alien/resin/special/pylon/endgame/purchased_pylon) - var/datum/hivebuff/new_buff = new hivebuff(src) - if(!new_buff._on_engage(purchasing_player, purchased_pylon)) - qdel(new_buff) - return FALSE - return TRUE - - -//Xeno Resin Mark Shit, the very best place for it too :0) -//Defines at the bottom of this list here will show up at the top in the mark menu -/datum/xeno_mark_define - var/name = "xeno_declare" - var/icon_state = "empty" - var/desc = "Xenos make psychic markers with this meaning as positional lasting communication to eachother" - -/datum/xeno_mark_define/fortify - name = "Fortify" - desc = "Fortify this area!" - icon_state = "fortify" - -/datum/xeno_mark_define/weeds - name = "Need Weeds" - desc = "Need weeds here!" - icon_state = "weed" - -/datum/xeno_mark_define/nest - name = "Nest" - desc = "Nest enemies here!" - icon_state = "nest" - -/datum/xeno_mark_define/hosts - name = "Hosts" - desc = "Hosts here!" - icon_state = "hosts" - -/datum/xeno_mark_define/aide - name = "Aide" - desc = "Aide here!" - icon_state = "aide" - -/datum/xeno_mark_define/defend - name = "Defend" - desc = "Defend the hive here!" - icon_state = "defend" - -/datum/xeno_mark_define/danger - name = "Danger Warning" - desc = "Caution, danger here!" - icon_state = "danger" - -/datum/xeno_mark_define/rally - name = "Rally" - desc = "Group up here!" - icon_state = "rally" - -/datum/xeno_mark_define/hold - name = "Hold" - desc = "Hold this area!" - icon_state = "hold" - -/datum/xeno_mark_define/ambush - name = "Ambush" - desc = "Ambush the enemy here!" - icon_state = "ambush" -/datum/xeno_mark_define/attack - name = "Attack" - desc = "Attack the enemy here!" - icon_state = "attack" - diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 73d613dae4be..b623a26fe744 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -177,68 +177,20 @@ /mob/new_player/proc/late_choices() - var/mills = world.time // 1/10 of a second, not real milliseconds but whatever - //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence... or something - var/mins = (mills % 36000) / 600 - var/hours = mills / 36000 - - var/dat = "
" - dat += "Round Duration: [floor(hours)]h [floor(mins)]m
" - - if(SShijack) - switch(SShijack.evac_status) - if(EVACUATION_STATUS_INITIATED) - dat += "The [MAIN_SHIP_NAME] is being evacuated.
" - - dat += "Choose from the following open positions:
" - var/roles_show = FLAG_SHOW_ALL_JOBS - - for(var/i in GLOB.RoleAuthority.roles_for_mode) - var/datum/job/J = GLOB.RoleAuthority.roles_for_mode[i] - if(!GLOB.RoleAuthority.check_role_entry(src, J, latejoin = TRUE, faction_to_set = GLOB.faction_datums[FACTION_NEUTRAL])) + var/list/faction_to_get_list = list() + for(var/faction_to_get in SSticker.mode.factions_pool) + var/datum/faction/faction = GLOB.faction_datums[SSticker.mode.factions_pool[faction_to_get]] + if(!faction.spawning_enabled || (!faction.force_spawning && !faction.weight_act[SSticker.mode.name])) continue - var/active = 0 - // Only players with the job assigned and AFK for less than 10 minutes count as active - for(var/mob/M in GLOB.player_list) - if(M.client && M.job == J.title) - active++ - if(roles_show & FLAG_SHOW_CIC && GLOB.ROLES_CIC.Find(J.title)) - dat += "Command:
" - roles_show ^= FLAG_SHOW_CIC + faction_to_get_list += faction_to_get - else if(roles_show & FLAG_SHOW_AUXIL_SUPPORT && GLOB.ROLES_AUXIL_SUPPORT.Find(J.title)) - dat += "
Auxiliary Combat Support:
" - roles_show ^= FLAG_SHOW_AUXIL_SUPPORT - - else if(roles_show & FLAG_SHOW_MISC && GLOB.ROLES_MISC.Find(J.title)) - dat += "
Other:
" - roles_show ^= FLAG_SHOW_MISC - - else if(roles_show & FLAG_SHOW_POLICE && GLOB.ROLES_POLICE.Find(J.title)) - dat += "
Military Police:
" - roles_show ^= FLAG_SHOW_POLICE - - else if(roles_show & FLAG_SHOW_ENGINEERING && GLOB.ROLES_ENGINEERING.Find(J.title)) - dat += "
Engineering:
" - roles_show ^= FLAG_SHOW_ENGINEERING - - else if(roles_show & FLAG_SHOW_REQUISITION && GLOB.ROLES_REQUISITION.Find(J.title)) - dat += "
Requisitions:
" - roles_show ^= FLAG_SHOW_REQUISITION - - else if(roles_show & FLAG_SHOW_MEDICAL && GLOB.ROLES_MEDICAL.Find(J.title)) - dat += "
Medbay:
" - roles_show ^= FLAG_SHOW_MEDICAL - - else if(roles_show & FLAG_SHOW_MARINES && GLOB.ROLES_MARINES.Find(J.title)) - dat += "
Marines:
" - roles_show ^= FLAG_SHOW_MARINES - - dat += "[J.disp_title] ([J.current_positions]) (Active: [active])
" + var/choice = tgui_input_list(src, "Choose faction to join:", "Factions", faction_to_get_list) + if(!choice) + return - dat += "
" - show_browser(src, dat, "Late Join", "latechoices", "size=420x700") + GLOB.faction_datums[SSticker.mode.factions_pool[choice]].get_join_status(src) +// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... ??? ~blackcrystalic hones reaction /mob/new_player/proc/late_choices_upp() var/mills = world.time // 1/10 of a second, not real milliseconds but whatever //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence... or something From 7700887f06604721bee04aac6bd153b7cb54d95c Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:54:36 +0500 Subject: [PATCH 09/24] fixes after merge --- code/datums/factions/faction_modules.dm | 4 ++-- code/modules/mob/living/carbon/xenomorph/Evolution.dm | 4 ---- code/modules/objectives/mob_objectives.dm | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index 2ba18d1883cc..0e61729ed1e3 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -867,8 +867,8 @@ to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) return FALSE - for(var/mob_name in banished_ckeys) - if(banished_ckeys[mob_name] == user.ckey) + for(var/mob_name in faction_owner.banished_ckeys) + if(faction_owner.banished_ckeys[mob_name] == user.ckey) to_chat(user, SPAN_WARNING("You are banished from the [src], you may not rejoin unless the Queen re-admits you or dies.")) return FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index 7a987b49c70b..457499a3c394 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -322,10 +322,6 @@ var/level_to_switch_to = get_vision_level() var/xeno_type = GLOB.RoleAuthority.get_caste_by_text(newcaste) var/mob/living/carbon/xenomorph/new_xeno = new xeno_type(get_turf(src), src) -<<<<<<< HEAD - -======= ->>>>>>> master if(!istype(new_xeno)) //Something went horribly wrong to_chat(src, SPAN_WARNING("Something went terribly wrong here. Your new xeno is null! Tell a coder immediately!")) diff --git a/code/modules/objectives/mob_objectives.dm b/code/modules/objectives/mob_objectives.dm index 5f1f8cbb9906..0d7303016eab 100644 --- a/code/modules/objectives/mob_objectives.dm +++ b/code/modules/objectives/mob_objectives.dm @@ -123,7 +123,7 @@ if(length(scored_humansynth_corpses) <= 48) // Limit human corpse recovery to 5 total points (.1 each) return OBJECTIVE_LOW_VALUE if(!max_humans) - marine_announcement("Maximum intel points for non-xenomorph corpses has been achieved.", "Intel Announcement", 'sound/misc/notice2.ogg') + faction_announcement("Maximum intel points for non-xenomorph corpses has been achieved.", "Intel Announcement", 'sound/misc/notice2.ogg') max_humans = TRUE return OBJECTIVE_LOW_VALUE From 968a571180c285d890ff8b12acd84c474e5b3256 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:07:05 +0500 Subject: [PATCH 10/24] fix maps and linters --- code/__DEFINES/mode.dm | 9 -- code/datums/factions/colonists.dm | 4 +- code/datums/factions/iff_tag.dm | 82 +------------------ code/datums/factions/xeno/normal.dm | 2 +- code/modules/client/preferences.dm | 4 +- code/modules/defenses/sentry_computer.dm | 2 - code/modules/mob/dead/observer/orbit.dm | 22 ++--- .../vehicles/hardpoints/primary/arc_sentry.dm | 4 +- .../FOP_v3_Sciannex/Fiorina_SciAnnex.dmm | 4 +- maps/map_files/LV624/standalone/clfship.dmm | 10 +-- 10 files changed, 26 insertions(+), 117 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 536db65abab3..e34a542acbae 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -297,19 +297,10 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_XENOMORPH_TUTORIAL "tutorial_xenomorph" #define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE) -#define FACTION_LIST_MARINE list(FACTION_MARINE) #define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_FAX) #define FACTION_LIST_ERT_OTHER list(FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO) #define FACTION_LIST_ERT_ALL list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY, FACTION_CLF, FACTION_CONTRACTOR, FACTION_UPP, FACTION_FREELANCER, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_MARSHAL, FACTION_TWE) #define FACTION_LIST_WY list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) -#define FACTION_LIST_UPP list(FACTION_UPP) -#define FACTION_LIST_CLF list(FACTION_CLF) -#define FACTION_LIST_TWE list(FACTION_TWE) -#define FACTION_LIST_FREELANCER list(FACTION_FREELANCER) -#define FACTION_LIST_CONTRACTOR list(FACTION_CONTRACTOR) -#define FACTION_LIST_MERCENARY list(FACTION_MERCENARY) -#define FACTION_LIST_MARSHAL list(FACTION_MARSHAL) -#define FACTION_LIST_DUTCH list(FACTION_DUTCH) #define FACTION_LIST_ALL FACTION_LIST_HUMANOID + FACTION_LIST_XENOMORPH diff --git a/code/datums/factions/colonists.dm b/code/datums/factions/colonists.dm index a19c2189a8f5..23bff54bab86 100644 --- a/code/datums/factions/colonists.dm +++ b/code/datums/factions/colonists.dm @@ -18,7 +18,7 @@ MODE_NAME_HIVE_WARS = list(), MODE_NAME_INFECTION = list( JOB_SURVIVOR - ) + ), ) weight_act = list( MODE_NAME_EXTENDED = FALSE, @@ -27,5 +27,5 @@ MODE_NAME_WISKEY_OUTPOST = FALSE, MODE_NAME_HUNTER_GAMES = FALSE, MODE_NAME_HIVE_WARS = FALSE, - MODE_NAME_INFECTION = FALSE + MODE_NAME_INFECTION = FALSE, ) diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index 476c102ba9c2..3303be1b9310 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -190,7 +190,7 @@ DEFINE_BITFIELD(iff_flag_flags, list( storage_slots = 8 can_hold = list( /obj/item/faction_tag, - /obj/item/device/multitool + /obj/item/device/multitool, ) black_market_value = 25 @@ -245,83 +245,3 @@ DEFINE_BITFIELD(iff_flag_flags, list( user.visible_message(SPAN_NOTICE("[user] removes \the [src]'s Faction IFF tag."), SPAN_NOTICE("You remove \the [src]'s Faction IFF tag."), max_distance = 3) return . = ..() - -/* -/obj/item/iff_tag - name = "xenomorph IFF tag" - desc = "A tag containing a small IFF computer that gets inserted into the carapace of a xenomorph. You can modify the IFF groups by using an access tuner on it, or on the xeno if it's already implanted." - icon = 'icons/obj/items/Marine_Research.dmi' - icon_state = "xeno_tag" - var/list/faction_groups = list() - -/obj/item/iff_tag/attack(mob/living/carbon/xenomorph/xeno, mob/living/carbon/human/injector) - if(isxeno(xeno)) - if(xeno.stat == DEAD) - to_chat(injector, SPAN_WARNING("\The [xeno] is dead...")) - return - if(xeno.iff_tag) - to_chat(injector, SPAN_WARNING("\The [xeno] already has a tag inside it.")) - return - injector.visible_message(SPAN_NOTICE("[injector] starts forcing \the [src] into [xeno]'s carapace..."), SPAN_NOTICE("You start forcing \the [src] into [xeno]'s carapace...")) - if(!do_after(injector, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC, xeno, INTERRUPT_DIFF_LOC, BUSY_ICON_GENERIC)) - return - injector.visible_message(SPAN_NOTICE("[injector] forces \the [src] into [xeno]'s carapace!"), SPAN_NOTICE("You force \the [src] into [xeno]'s carapace!")) - xeno.iff_tag = src - injector.drop_inv_item_to_loc(src, xeno) - if(xeno.hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade - to_chat(xeno, SPAN_NOTICE("With the insertion of the device into your carapace, your instincts have changed compelling you to protect [english_list(faction_groups, "no one")].")) - return - return ..() - -/obj/item/iff_tag/attackby(obj/item/W, mob/user) - if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL) && ishuman(user)) - handle_reprogramming(user) - return - return ..() - -/obj/item/iff_tag/proc/handle_reprogramming(mob/living/carbon/human/programmer, mob/living/carbon/xenomorph/xeno) - var/list/id_faction_groups = programmer.get_id_faction_group() - var/option = tgui_alert(programmer, "The xeno tag's current IFF groups reads as: [english_list(faction_groups, "None")]\nYour ID's IFF group reads as: [english_list(id_faction_groups, "None")]", "Xenomorph IFF Tag", list("Overwrite", "Add", "Remove")) - if(!option) - return FALSE - if(xeno) - if(!xeno.iff_tag) - to_chat(programmer, SPAN_WARNING("\The [src]'s tag got removed while you were reprogramming it!")) - return FALSE - if(!programmer.Adjacent(xeno)) - to_chat(programmer, SPAN_WARNING("You need to stay close to the xenomorph to reprogram the tag!")) - return FALSE - switch(option) - if("Overwrite") - faction_groups = id_faction_groups - if("Add") - faction_groups |= id_faction_groups - if("Remove") - faction_groups = list() - to_chat(programmer, SPAN_NOTICE("You [option] the IFF group data, the IFF group on the tag now reads as: [english_list(faction_groups, "None")]")) - if(xeno?.hive.hivenumber == XENO_HIVE_RENEGADE) //it's important to know their IFF settings for renegade - to_chat(xeno, SPAN_NOTICE("Your instincts have changed, you seem compelled to protect [english_list(faction_groups, "no one")].")) - return TRUE - -/obj/item/iff_tag/pmc_handler - faction_groups = FACTION_LIST_MARINE_WY - - -/obj/item/storage/xeno_tag_case - name = "xenomorph tag case" - desc = "A sturdy case designed to store and charge xenomorph IFF tags. Provided by the Wey-Yu Research and Data(TM) Division." - icon = 'icons/obj/items/Marine_Research.dmi' - icon_state = "tag_box" - use_sound = "toolbox" - storage_slots = 8 - can_hold = list( - /obj/item/iff_tag, - /obj/item/device/multitool, - ) - black_market_value = 25 - -/obj/item/storage/xeno_tag_case/full/fill_preset_inventory() - for(var/i = 1 to storage_slots - 1) - new /obj/item/iff_tag(src) - new /obj/item/device/multitool(src) -*/ diff --git a/code/datums/factions/xeno/normal.dm b/code/datums/factions/xeno/normal.dm index 84eee33d5fac..58e9ed328774 100644 --- a/code/datums/factions/xeno/normal.dm +++ b/code/datums/factions/xeno/normal.dm @@ -24,7 +24,7 @@ ) coefficient_per_role = list( JOB_XENOMORPH = 8, - JOB_XENOMORPH_QUEEN = 16 + JOB_XENOMORPH_QUEEN = 16, ) weight_act = list( MODE_NAME_EXTENDED = FALSE, diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 08f860a8d064..cc848c651af1 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -764,7 +764,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( HTML += "" HTML += "
" - HTML += "

Change faction

" + HTML += "

Change faction

" if(user.client?.prefs) //Just makin sure var/b_color = "green" @@ -851,7 +851,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( HTML += "" HTML += "

" - HTML += "

Change faction

" + HTML += "

Change faction

" var/b_color var/msg diff --git a/code/modules/defenses/sentry_computer.dm b/code/modules/defenses/sentry_computer.dm index ed0ad450faf1..eafecc18e3d8 100644 --- a/code/modules/defenses/sentry_computer.dm +++ b/code/modules/defenses/sentry_computer.dm @@ -34,7 +34,6 @@ var/can_identify_target = FALSE // if the laptop should broadcast what it is shooting at - var/list/faction_group var/screen_state = 0 // controls the 'loading' animation /// The turf where the camera was last updated. @@ -61,7 +60,6 @@ AddComponent(/datum/component/camera_manager) SEND_SIGNAL(src, COMSIG_CAMERA_CLEAR) - faction_group = FACTION_LIST_MARINE transceiver.forceMove(src) transceiver.set_frequency(SENTRY_FREQ) transceiver.config(list(RADIO_CHANNEL_SENTRY=1)) diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index 3500f76e2b8a..f640cf5bcba8 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -161,27 +161,27 @@ synthetics += list(serialized) else if(isyautja(human)) predators += list(serialized) - else if(human.faction in FACTION_LIST_ERT_OTHER) + else if(human.faction.code_identificator in FACTION_LIST_ERT_OTHER) ert_members += list(serialized) -// else if(human.faction in FACTION_LIST_HUNTED) TODO FACTION +// else if(human) TODO FACTION ANOTHER CHECK // hunted += list(serialized) - else if(human.faction in FACTION_LIST_UPP) + else if(human.faction.code_identificator == FACTION_UPP) upp += list(serialized) - else if(human.faction in FACTION_LIST_CLF) + else if(human.faction.code_identificator == FACTION_CLF) clf += list(serialized) - else if(human.faction in FACTION_LIST_TWE) + else if(human.faction.code_identificator == FACTION_TWE) twe += list(serialized) - else if(human.faction in FACTION_LIST_FREELANCER) + else if(human.faction.code_identificator == FACTION_FREELANCER) freelancer += list(serialized) - else if(human.faction in FACTION_LIST_CONTRACTOR) + else if(human.faction.code_identificator == FACTION_CONTRACTOR) contractor += list(serialized) - else if(human.faction in FACTION_LIST_MERCENARY) + else if(human.faction.code_identificator == FACTION_MERCENARY) mercenary += list(serialized) - else if(human.faction in FACTION_LIST_MARSHAL) + else if(human.faction.code_identificator == FACTION_MARSHAL) marshal += list(serialized) - else if(human.faction in FACTION_LIST_DUTCH) + else if(human.faction.code_identificator == FACTION_DUTCH) dutch += list(serialized) - else if(human.faction in FACTION_LIST_MARINE) + else if(human.faction in FACTION_MARINE) marines += list(serialized) else if(issurvivorjob(human.job)) survivors += list(serialized) diff --git a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm index 123e2c7401de..00e210e24322 100644 --- a/code/modules/vehicles/hardpoints/primary/arc_sentry.dm +++ b/code/modules/vehicles/hardpoints/primary/arc_sentry.dm @@ -41,7 +41,7 @@ /// The range that this turret can shoot at the furthest var/turret_range = 5 /// What factions this sentry is aligned with - var/faction_group = FACTION_LIST_MARINE + var/faction = FACTION_MARINE /obj/item/hardpoint/primary/arc_sentry/on_install(obj/vehicle/multitile/vehicle) . = ..() @@ -85,7 +85,7 @@ /obj/item/hardpoint/primary/arc_sentry/set_bullet_traits() LAZYADD(traits_to_give, list( - BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff, faction_group) + BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff, faction) )) /obj/item/hardpoint/primary/arc_sentry/fire_wrapper(atom/target, mob/living/user, params) diff --git a/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm b/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm index b0e19e14996c..83ccdef1c520 100644 --- a/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm +++ b/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm @@ -843,7 +843,7 @@ /area/fiorina/station/telecomm/lz1_cargo) "aFp" = ( /obj/structure/machinery/defenses/tesla_coil/premade/smart{ - faction_group = list("CLF") + faction_to_get = "clf" }, /turf/open/floor/plating/plating_catwalk, /area/fiorina/tumor/ship) @@ -29996,7 +29996,7 @@ /area/fiorina/station/medbay) "xgx" = ( /obj/structure/machinery/defenses/tesla_coil/premade{ - faction_group = list("USCM") + faction_to_get = "clf" }, /turf/open/organic/grass/astroturf, /area/fiorina/station/park) diff --git a/maps/map_files/LV624/standalone/clfship.dmm b/maps/map_files/LV624/standalone/clfship.dmm index 177b8895c558..d9943d0d0cea 100644 --- a/maps/map_files/LV624/standalone/clfship.dmm +++ b/maps/map_files/LV624/standalone/clfship.dmm @@ -67,7 +67,7 @@ "bQ" = ( /obj/structure/machinery/defenses/sentry/premade/dumb{ dir = 1; - faction_group = list("CLF") + faction_to_get = "clf" }, /obj/item/ammo_casing/shell{ icon_state = "casing_7_1" @@ -420,7 +420,7 @@ "mH" = ( /obj/structure/machinery/defenses/sentry/premade/dumb{ dir = 4; - faction_group = list("CLF") + faction_to_get = "clf" }, /obj/item/ammo_casing/shell{ icon_state = "casing_9_1" @@ -684,7 +684,7 @@ }, /obj/structure/machinery/defenses/sentry/premade/dumb{ dir = 8; - faction_group = list("CLF") + faction_to_get = "clf" }, /turf/open/floor/platingdmg1, /area/lv624/lazarus/crashed_ship) @@ -1265,7 +1265,7 @@ }, /obj/structure/machinery/defenses/sentry/premade/dumb{ dir = 4; - faction_group = list("CLF") + faction_to_get = "clf" }, /turf/open/floor/plating/platingdmg3, /area/lv624/lazarus/crashed_ship) @@ -1430,7 +1430,7 @@ /obj/item/stack/rods, /obj/structure/machinery/defenses/sentry/premade/dumb{ dir = 1; - faction_group = list("CLF") + faction_to_get = "clf" }, /obj/item/ammo_casing/shell{ icon_state = "casing_7_1" From 441ebace94abaaf09d9021da1146f5f1444e9bed Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:34:14 +0500 Subject: [PATCH 11/24] some minor fixes --- code/__DEFINES/mode.dm | 92 +++++++++++-------- code/datums/factions/helpers.dm | 4 +- code/datums/factions/iff_tag.dm | 2 +- code/datums/factions/minor_factions.dm | 19 ++++ code/datums/factions/nspa.dm | 2 + code/datums/factions/uscm/marsoc.dm | 2 +- code/datums/factions/xeno/xeno.dm | 4 +- code/datums/factions/yautja.dm | 2 +- code/modules/cm_aliens/structures/tunnel.dm | 6 +- code/modules/gear_presets/uscm.dm | 1 + .../mob/living/carbon/xenomorph/Xenomorph.dm | 20 ++-- code/modules/mob/mob.dm | 4 +- code/modules/mob/mob_defines.dm | 2 +- code/modules/mob/new_player/new_player.dm | 4 + colonialmarines.dme | 3 + 15 files changed, 108 insertions(+), 59 deletions(-) create mode 100644 code/datums/factions/minor_factions.dm diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index e34a542acbae..cfd775307d46 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -253,51 +253,69 @@ DEFINE_BITFIELD(whitelist_status, list( // Faction names #define FACTION_NEUTRAL "nfo" + +// United States Colonial Marines #define FACTION_USCM "uscm" #define FACTION_MARINE "cmf" -#define FACTION_SURVIVOR "surv" +#define FACTION_MARSOC "msoc" +#define FACTION_MARSHAL "clmr" + +// Colonists (TO BE IMPROVED) +#define FACTION_COLONIST "colo" + +// Weyland-Yutani Corporation +#define FACTION_WY "wy" +#define FACTION_PMC "pmc" +#define FACTION_WY_DEATHSQUAD "wyds" + +// Union of Progressive Peoples #define FACTION_UPP "upp" -#define FACTION_RESS "ress" + +// Three World Empire #define FACTION_TWE "twe" #define FACTION_THREEWE "threewe" -#define FACTION_WY "wy" + +// Others +#define FACTION_RESS "ress" #define FACTION_CLF "clf" -#define FACTION_PMC "pmc" -#define FACTION_CONTRACTOR "VAI" -#define FACTION_MARSHAL "Colonial Marshal" -#define FACTION_NSPA "NSPA" -#define FACTION_WY_DEATHSQUAD "WY Death Squad" -#define FACTION_MERCENARY "Mercenary" -#define FACTION_FREELANCER "Freelancer" -#define FACTION_HEFA "HEFA Order" -#define FACTION_DUTCH "Dutch's Dozen" -#define FACTION_PIRATE "Pirate" -#define FACTION_GLADIATOR "Gladiator" -#define FACTION_PIZZA "Pizza Delivery" -#define FACTION_SOUTO "Souto Man" -#define FACTION_COLONIST "Colonist" -#define FACTION_YAUTJA "Yautja" -#define FACTION_ZOMBIE "Zombie" -#define FACTION_MONKEY "Monkey" // Nanu -#define FACTION_FAX "Fax Responder" -//XENOS -#define FACTION_XENOMORPH "xeno" -#define FACTION_XENOMORPH_NORMAL "xenomorph" -#define FACTION_XENOMORPH_CORRUPTED "corrupted_xenomoprh" -#define FACTION_XENOMORPH_ALPHA "alpha_xenomorph" -#define FACTION_XENOMORPH_BRAVO "bravo_xenomorph" -#define FACTION_XENOMORPH_CHARLIE "charlie_xenomorph" -#define FACTION_XENOMORPH_DELTA "delta_xenomorph" -#define FACTION_XENOMORPH_FERAL "feral_xenomorph" -#define FACTION_XENOMORPH_FORSAKEN "forsaken_xenomorph" -#define FACTION_XENOMORPH_TAMED "tamed_xenomorph" -#define FACTION_XENOMORPH_MUTATED "mutated_xenomorph" -#define FACTION_XENOMORPH_YAUTJA "yautja_xenomorph" -#define FACTION_XENOMORPH_RENEGADE "renegade_xenomorph" -#define FACTION_XENOMORPH_TUTORIAL "tutorial_xenomorph" +#define FACTION_CONTRACTOR "vai" +#define FACTION_NSPA "nspa" +#define FACTION_MERCENARY "merc" +#define FACTION_FREELANCER "frl" +#define FACTION_HEFA "hef" +#define FACTION_DUTCH "dut" +#define FACTION_PIRATE "pir" +#define FACTION_GLADIATOR "gla" +#define FACTION_PIZZA "piz" +#define FACTION_SOUTO "sou" +#define FACTION_YAUTJA "yakut" +#define FACTION_ZOMBIE "zom" + +// TO BE DELETED +#define FACTION_FAX "fax" +#define FACTION_SURVIVOR "surv" +#define FACTION_XENOMORPH_TUTORIAL "tutzen" + +// I have no idea where to put it, we even need that? +#define FACTION_MONKEY "ng" // Nanu + +// Zenomorphs +#define FACTION_XENOMORPH "zen" +#define FACTION_XENOMORPH_NORMAL "nzen" +#define FACTION_XENOMORPH_CORRUPTED "corzen" +#define FACTION_XENOMORPH_ALPHA "alpzen" +#define FACTION_XENOMORPH_BRAVO "bravzen" +#define FACTION_XENOMORPH_CHARLIE "charzen" +#define FACTION_XENOMORPH_DELTA "deltzen" +#define FACTION_XENOMORPH_FERAL "ferzen" +#define FACTION_XENOMORPH_FORSAKEN "forszen" +#define FACTION_XENOMORPH_TAMED "tamzen" +#define FACTION_XENOMORPH_MUTATED "mutzen" +#define FACTION_XENOMORPH_YAUTJA "yakutzen" +#define FACTION_XENOMORPH_RENEGADE "renegzen" #define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE) -#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_FAX) +#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_MARSOC, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_THREEWE, FACTION_FAX) #define FACTION_LIST_ERT_OTHER list(FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO) #define FACTION_LIST_ERT_ALL list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY, FACTION_CLF, FACTION_CONTRACTOR, FACTION_UPP, FACTION_FREELANCER, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_MARSHAL, FACTION_TWE) #define FACTION_LIST_WY list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) diff --git a/code/datums/factions/helpers.dm b/code/datums/factions/helpers.dm index 824ac778db80..e088433d8b18 100644 --- a/code/datums/factions/helpers.dm +++ b/code/datums/factions/helpers.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_INIT_TYPED(custom_event_info_list, /datum/custom_event_info, setup_custom_event_info()) + GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) /proc/setup_faction_list() @@ -7,8 +9,6 @@ GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) .[faction.code_identificator] = faction faction.relations_datum.generate_relations_helper() -GLOBAL_LIST_INIT_TYPED(custom_event_info_list, /datum/custom_event_info, setup_custom_event_info()) - /proc/setup_custom_event_info() . = list() .["glob"] = new /datum/custom_event_info(null, "Global", "glob") diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index 3303be1b9310..f1e9196b32cc 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -153,7 +153,7 @@ DEFINE_BITFIELD(iff_flag_flags, list( /obj/item/faction_tag/uscm/marsoc ally_factions_initialize = FALSE - faction_to_get = FACTION_CONTRACTOR + faction_to_get = FACTION_MARSOC /obj/item/faction_tag/wy faction_to_get = FACTION_WY diff --git a/code/datums/factions/minor_factions.dm b/code/datums/factions/minor_factions.dm new file mode 100644 index 000000000000..874b1355ecf8 --- /dev/null +++ b/code/datums/factions/minor_factions.dm @@ -0,0 +1,19 @@ +/datum/faction/survivor + name = "Survivor" + desc = "WHO THE FUCK THINK SURVIVOR IS A REAL FACTION IN OUR WORLD??? ngl, he is geni... it's even not a subfaction in faction." + code_identificator = FACTION_SURVIVOR + +/datum/faction/fax + name = "Fax" + desc = "I don't want to do any comments about it, lets just keep it shut" + code_identificator = FACTION_FAX + +/datum/faction/nanu + name = "Monkey" + desc = "As Nanu say" + code_identificator = FACTION_MONKEY + +/datum/faction/xenomorph/tut + name = "Tutorial Xeno" + desc = "Lets be honest, why the **** SOMEBODY DID IT???" + code_identificator = FACTION_SURVIVOR diff --git a/code/datums/factions/nspa.dm b/code/datums/factions/nspa.dm index 9a88df6a654c..317a6ccaf049 100644 --- a/code/datums/factions/nspa.dm +++ b/code/datums/factions/nspa.dm @@ -1,5 +1,7 @@ /datum/faction/nspa name = "Neroid Sector Policing Authority" + desc = "Warning, potential dead story teller." + code_identificator = FACTION_NSPA /datum/faction/nspa/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/uscm/marsoc.dm b/code/datums/factions/uscm/marsoc.dm index 15eadb26d93a..3b9aaa18e7b7 100644 --- a/code/datums/factions/uscm/marsoc.dm +++ b/code/datums/factions/uscm/marsoc.dm @@ -1,5 +1,5 @@ /datum/faction/uscm/marsoc - name = NAME_FACTION_MARSOC + name = "Marine Special Operations Command" desc = "Decryption required" code_identificator = FACTION_MARSOC diff --git a/code/datums/factions/xeno/xeno.dm b/code/datums/factions/xeno/xeno.dm index 6da8d5cf0492..179dc3a70478 100644 --- a/code/datums/factions/xeno/xeno.dm +++ b/code/datums/factions/xeno/xeno.dm @@ -1,6 +1,6 @@ /datum/faction/xenomorph name = "Xenomorphs" - desc = "Xenomorph hive among the all other hives." + desc = "Unknow biological weapon, no know place where it begun, but we all know place where it ends. For additional information required access 6X-X / XC-X or higher..." code_identificator = FACTION_XENOMORPH color = null @@ -10,8 +10,8 @@ relations_pregen = RELATIONS_FACTION_XENOMORPH /datum/faction/xenomorph/New() + faction_modules[FACTION_MODULE_HIVE_MIND] = new /datum/faction_module/hive_mind(src) . = ..() - faction_modules += new /datum/faction_module/hive_mind(src) /datum/faction/xenomorph/faction_is_ally(datum/faction/faction) var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) diff --git a/code/datums/factions/yautja.dm b/code/datums/factions/yautja.dm index 2a9c319934f0..f250fa632d6f 100644 --- a/code/datums/factions/yautja.dm +++ b/code/datums/factions/yautja.dm @@ -1,5 +1,5 @@ /datum/faction/yautja - name = "Yautja Hanting Groop" + name = "Yautja Hunting Groop" desc = "Unable to extract addition information." code_identificator = FACTION_YAUTJA diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 7a42833460d6..56423f348c04 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -37,8 +37,8 @@ else src.faction = GLOB.faction_datums[faction_to_get] - set_hive_data(src, faction) - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + set_hive_data(src, src.faction) + var/datum/faction_module/hive_mind/faction_module = src.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.tunnels += src var/obj/effect/alien/resin/trap/resin_trap = locate() in L @@ -48,7 +48,7 @@ if(faction_to_get == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) - SSminimaps.add_marker(src, z, faction.minimap_flag, "xenotunnel") + SSminimaps.add_marker(src, z, src.faction.minimap_flag, "xenotunnel") /obj/structure/tunnel/proc/forsaken_handling() SIGNAL_HANDLER diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index 9dd31fd259a6..fae778cd19c0 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -800,6 +800,7 @@ /datum/equipment_preset/uscm/marsoc name = "Marine Raider (!DEATHSQUAD!)" flags = EQUIPMENT_PRESET_EXTRA + job_faction = FACTION_MARSOC assignment = "Marine Raider" rank = JOB_MARINE_RAIDER role_comm_title = "Op." diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index f77a075f21d8..21635b07f961 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -439,6 +439,16 @@ GLOB.living_xeno_list += src GLOB.xeno_mob_list += src xeno_inhand_item_offset = (icon_size - 32) * 0.5 + + . = ..() + + if(!organ_faction_tag && faction.organ_faction_iff_tag_type) + organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) + + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/trait in faction_module.hive_inherant_traits) + ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) + // More setup stuff for names, abilities etc update_icon_source() generate_name() @@ -451,16 +461,6 @@ recalculate_everything() toggle_xeno_mobhud() //This is a verb, but fuck it, it just werks - . = ..() - - faction.add_mob(src) - if(!organ_faction_tag && faction.organ_faction_iff_tag_type) - organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) - - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) - for(var/trait in faction_module.hive_inherant_traits) - ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) - //Set leader to the new mob if(IS_XENO_LEADER(old_xeno)) faction_module.replace_hive_leader(old_xeno, src) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index cc163bc7387a..254291237fb9 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -56,9 +56,11 @@ focus = null /mob/Initialize() - if(faction_to_get) + if(!faction && faction_to_get) faction = GLOB.faction_datums[faction_to_get] + faction.add_mob(src) + GLOB.last_mob_gid++ gid = GLOB.last_mob_gid diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 5b1f5974b051..ee08181f9bde 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -159,7 +159,7 @@ var/job = null // Internal job title used when mob is spawned. Preds are "Predator", Xenos are "Xenomorph", Marines have their actual job title var/comm_title = "" - var/faction_to_get = null + var/faction_to_get = FACTION_NEUTRAL var/datum/faction/faction = null var/looc_overhead = FALSE diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index b623a26fe744..cd517b3f3388 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -184,6 +184,10 @@ continue faction_to_get_list += faction_to_get + if(!length(faction_to_get_list)) + to_chat(src, SPAN_WARNING("There no applicable factions to join.")) + return + var/choice = tgui_input_list(src, "Choose faction to join:", "Factions", faction_to_get_list) if(!choice) return diff --git a/colonialmarines.dme b/colonialmarines.dme index ae6ce6b191a9..762d5bce70b9 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -593,8 +593,10 @@ #include "code\datums\factions\helpers.dm" #include "code\datums\factions\iff_tag.dm" #include "code\datums\factions\mercenary.dm" +#include "code\datums\factions\minor_factions.dm" #include "code\datums\factions\nspa.dm" #include "code\datums\factions\pirate.dm" +#include "code\datums\factions\pizza_delivery.dm" #include "code\datums\factions\relations_datum.dm" #include "code\datums\factions\ress.dm" #include "code\datums\factions\souto.dm" @@ -605,6 +607,7 @@ #include "code\datums\factions\threewe\threewe.dm" #include "code\datums\factions\uscm\cmb.dm" #include "code\datums\factions\uscm\marine.dm" +#include "code\datums\factions\uscm\marsoc.dm" #include "code\datums\factions\uscm\uscm.dm" #include "code\datums\factions\wy\deathsquad.dm" #include "code\datums\factions\wy\pmc.dm" From 3b285cfe7d0240c106e10c6402f010480e111b4f Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:50:53 +0500 Subject: [PATCH 12/24] some minor fixes --- code/__DEFINES/mode.dm | 92 +++++++++++-------- code/datums/factions/helpers.dm | 4 +- code/datums/factions/iff_tag.dm | 2 +- code/datums/factions/minor_factions.dm | 19 ++++ code/datums/factions/nspa.dm | 2 + code/datums/factions/uscm/marsoc.dm | 2 +- code/datums/factions/xeno/xeno.dm | 4 +- code/datums/factions/yautja.dm | 2 +- code/game/objects/items/devices/flashlight.dm | 2 +- code/game/objects/items/stacks/flags.dm | 6 +- code/modules/cm_aliens/structures/tunnel.dm | 6 +- code/modules/cm_marines/marines_consoles.dm | 4 +- code/modules/defenses/defenses.dm | 3 + code/modules/defenses/planted_flag.dm | 4 +- code/modules/gear_presets/uscm.dm | 1 + .../mob/living/carbon/xenomorph/Xenomorph.dm | 23 ++--- .../simple_animal/friendly/farm_animals.dm | 1 - .../mob/living/simple_animal/hostile/bear.dm | 2 +- .../mob/living/simple_animal/hostile/carp.dm | 2 - .../living/simple_animal/hostile/creature.dm | 1 - .../simple_animal/hostile/giant_spider.dm | 1 - .../living/simple_animal/hostile/hostile.dm | 1 - .../simple_animal/hostile/retaliate/drone.dm | 1 - .../mob/living/simple_animal/hostile/tree.dm | 2 - code/modules/mob/mob.dm | 4 +- code/modules/mob/mob_defines.dm | 2 +- code/modules/mob/new_player/new_player.dm | 4 + colonialmarines.dme | 3 + .../map_files/BigRed/sprinkles/5.eta_carp.dmm | 2 +- maps/map_files/CORSAT/Corsat.dmm | 2 +- maps/templates/baseone.dmm | 2 +- .../lazy_templates/fax_responder_base.dmm | 14 +-- 32 files changed, 132 insertions(+), 88 deletions(-) create mode 100644 code/datums/factions/minor_factions.dm diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index e34a542acbae..cfd775307d46 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -253,51 +253,69 @@ DEFINE_BITFIELD(whitelist_status, list( // Faction names #define FACTION_NEUTRAL "nfo" + +// United States Colonial Marines #define FACTION_USCM "uscm" #define FACTION_MARINE "cmf" -#define FACTION_SURVIVOR "surv" +#define FACTION_MARSOC "msoc" +#define FACTION_MARSHAL "clmr" + +// Colonists (TO BE IMPROVED) +#define FACTION_COLONIST "colo" + +// Weyland-Yutani Corporation +#define FACTION_WY "wy" +#define FACTION_PMC "pmc" +#define FACTION_WY_DEATHSQUAD "wyds" + +// Union of Progressive Peoples #define FACTION_UPP "upp" -#define FACTION_RESS "ress" + +// Three World Empire #define FACTION_TWE "twe" #define FACTION_THREEWE "threewe" -#define FACTION_WY "wy" + +// Others +#define FACTION_RESS "ress" #define FACTION_CLF "clf" -#define FACTION_PMC "pmc" -#define FACTION_CONTRACTOR "VAI" -#define FACTION_MARSHAL "Colonial Marshal" -#define FACTION_NSPA "NSPA" -#define FACTION_WY_DEATHSQUAD "WY Death Squad" -#define FACTION_MERCENARY "Mercenary" -#define FACTION_FREELANCER "Freelancer" -#define FACTION_HEFA "HEFA Order" -#define FACTION_DUTCH "Dutch's Dozen" -#define FACTION_PIRATE "Pirate" -#define FACTION_GLADIATOR "Gladiator" -#define FACTION_PIZZA "Pizza Delivery" -#define FACTION_SOUTO "Souto Man" -#define FACTION_COLONIST "Colonist" -#define FACTION_YAUTJA "Yautja" -#define FACTION_ZOMBIE "Zombie" -#define FACTION_MONKEY "Monkey" // Nanu -#define FACTION_FAX "Fax Responder" -//XENOS -#define FACTION_XENOMORPH "xeno" -#define FACTION_XENOMORPH_NORMAL "xenomorph" -#define FACTION_XENOMORPH_CORRUPTED "corrupted_xenomoprh" -#define FACTION_XENOMORPH_ALPHA "alpha_xenomorph" -#define FACTION_XENOMORPH_BRAVO "bravo_xenomorph" -#define FACTION_XENOMORPH_CHARLIE "charlie_xenomorph" -#define FACTION_XENOMORPH_DELTA "delta_xenomorph" -#define FACTION_XENOMORPH_FERAL "feral_xenomorph" -#define FACTION_XENOMORPH_FORSAKEN "forsaken_xenomorph" -#define FACTION_XENOMORPH_TAMED "tamed_xenomorph" -#define FACTION_XENOMORPH_MUTATED "mutated_xenomorph" -#define FACTION_XENOMORPH_YAUTJA "yautja_xenomorph" -#define FACTION_XENOMORPH_RENEGADE "renegade_xenomorph" -#define FACTION_XENOMORPH_TUTORIAL "tutorial_xenomorph" +#define FACTION_CONTRACTOR "vai" +#define FACTION_NSPA "nspa" +#define FACTION_MERCENARY "merc" +#define FACTION_FREELANCER "frl" +#define FACTION_HEFA "hef" +#define FACTION_DUTCH "dut" +#define FACTION_PIRATE "pir" +#define FACTION_GLADIATOR "gla" +#define FACTION_PIZZA "piz" +#define FACTION_SOUTO "sou" +#define FACTION_YAUTJA "yakut" +#define FACTION_ZOMBIE "zom" + +// TO BE DELETED +#define FACTION_FAX "fax" +#define FACTION_SURVIVOR "surv" +#define FACTION_XENOMORPH_TUTORIAL "tutzen" + +// I have no idea where to put it, we even need that? +#define FACTION_MONKEY "ng" // Nanu + +// Zenomorphs +#define FACTION_XENOMORPH "zen" +#define FACTION_XENOMORPH_NORMAL "nzen" +#define FACTION_XENOMORPH_CORRUPTED "corzen" +#define FACTION_XENOMORPH_ALPHA "alpzen" +#define FACTION_XENOMORPH_BRAVO "bravzen" +#define FACTION_XENOMORPH_CHARLIE "charzen" +#define FACTION_XENOMORPH_DELTA "deltzen" +#define FACTION_XENOMORPH_FERAL "ferzen" +#define FACTION_XENOMORPH_FORSAKEN "forszen" +#define FACTION_XENOMORPH_TAMED "tamzen" +#define FACTION_XENOMORPH_MUTATED "mutzen" +#define FACTION_XENOMORPH_YAUTJA "yakutzen" +#define FACTION_XENOMORPH_RENEGADE "renegzen" #define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE) -#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_FAX) +#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_MARSOC, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_THREEWE, FACTION_FAX) #define FACTION_LIST_ERT_OTHER list(FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO) #define FACTION_LIST_ERT_ALL list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY, FACTION_CLF, FACTION_CONTRACTOR, FACTION_UPP, FACTION_FREELANCER, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_MARSHAL, FACTION_TWE) #define FACTION_LIST_WY list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) diff --git a/code/datums/factions/helpers.dm b/code/datums/factions/helpers.dm index 824ac778db80..e088433d8b18 100644 --- a/code/datums/factions/helpers.dm +++ b/code/datums/factions/helpers.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_INIT_TYPED(custom_event_info_list, /datum/custom_event_info, setup_custom_event_info()) + GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) /proc/setup_faction_list() @@ -7,8 +9,6 @@ GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) .[faction.code_identificator] = faction faction.relations_datum.generate_relations_helper() -GLOBAL_LIST_INIT_TYPED(custom_event_info_list, /datum/custom_event_info, setup_custom_event_info()) - /proc/setup_custom_event_info() . = list() .["glob"] = new /datum/custom_event_info(null, "Global", "glob") diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index 3303be1b9310..f1e9196b32cc 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -153,7 +153,7 @@ DEFINE_BITFIELD(iff_flag_flags, list( /obj/item/faction_tag/uscm/marsoc ally_factions_initialize = FALSE - faction_to_get = FACTION_CONTRACTOR + faction_to_get = FACTION_MARSOC /obj/item/faction_tag/wy faction_to_get = FACTION_WY diff --git a/code/datums/factions/minor_factions.dm b/code/datums/factions/minor_factions.dm new file mode 100644 index 000000000000..874b1355ecf8 --- /dev/null +++ b/code/datums/factions/minor_factions.dm @@ -0,0 +1,19 @@ +/datum/faction/survivor + name = "Survivor" + desc = "WHO THE FUCK THINK SURVIVOR IS A REAL FACTION IN OUR WORLD??? ngl, he is geni... it's even not a subfaction in faction." + code_identificator = FACTION_SURVIVOR + +/datum/faction/fax + name = "Fax" + desc = "I don't want to do any comments about it, lets just keep it shut" + code_identificator = FACTION_FAX + +/datum/faction/nanu + name = "Monkey" + desc = "As Nanu say" + code_identificator = FACTION_MONKEY + +/datum/faction/xenomorph/tut + name = "Tutorial Xeno" + desc = "Lets be honest, why the **** SOMEBODY DID IT???" + code_identificator = FACTION_SURVIVOR diff --git a/code/datums/factions/nspa.dm b/code/datums/factions/nspa.dm index 9a88df6a654c..317a6ccaf049 100644 --- a/code/datums/factions/nspa.dm +++ b/code/datums/factions/nspa.dm @@ -1,5 +1,7 @@ /datum/faction/nspa name = "Neroid Sector Policing Authority" + desc = "Warning, potential dead story teller." + code_identificator = FACTION_NSPA /datum/faction/nspa/modify_hud_holder(image/holder, mob/living/carbon/human/human) var/hud_icon_state diff --git a/code/datums/factions/uscm/marsoc.dm b/code/datums/factions/uscm/marsoc.dm index 15eadb26d93a..3b9aaa18e7b7 100644 --- a/code/datums/factions/uscm/marsoc.dm +++ b/code/datums/factions/uscm/marsoc.dm @@ -1,5 +1,5 @@ /datum/faction/uscm/marsoc - name = NAME_FACTION_MARSOC + name = "Marine Special Operations Command" desc = "Decryption required" code_identificator = FACTION_MARSOC diff --git a/code/datums/factions/xeno/xeno.dm b/code/datums/factions/xeno/xeno.dm index 6da8d5cf0492..179dc3a70478 100644 --- a/code/datums/factions/xeno/xeno.dm +++ b/code/datums/factions/xeno/xeno.dm @@ -1,6 +1,6 @@ /datum/faction/xenomorph name = "Xenomorphs" - desc = "Xenomorph hive among the all other hives." + desc = "Unknow biological weapon, no know place where it begun, but we all know place where it ends. For additional information required access 6X-X / XC-X or higher..." code_identificator = FACTION_XENOMORPH color = null @@ -10,8 +10,8 @@ relations_pregen = RELATIONS_FACTION_XENOMORPH /datum/faction/xenomorph/New() + faction_modules[FACTION_MODULE_HIVE_MIND] = new /datum/faction_module/hive_mind(src) . = ..() - faction_modules += new /datum/faction_module/hive_mind(src) /datum/faction/xenomorph/faction_is_ally(datum/faction/faction) var/datum/faction_module/hive_mind/faction_module = get_faction_module(FACTION_MODULE_HIVE_MIND) diff --git a/code/datums/factions/yautja.dm b/code/datums/factions/yautja.dm index 2a9c319934f0..f250fa632d6f 100644 --- a/code/datums/factions/yautja.dm +++ b/code/datums/factions/yautja.dm @@ -1,5 +1,5 @@ /datum/faction/yautja - name = "Yautja Hanting Groop" + name = "Yautja Hunting Groop" desc = "Unable to extract addition information." code_identificator = FACTION_YAUTJA diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 3ffbcc46a345..3986e3fbb5eb 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -661,7 +661,7 @@ /obj/item/device/flashlight/flare/signal/gun/activate_signal(mob/living/carbon/human/user) turn_on() - faction = user.faction + faction = user.faction.code_identificator return ..() /obj/item/device/flashlight/flare/signal/debug diff --git a/code/game/objects/items/stacks/flags.dm b/code/game/objects/items/stacks/flags.dm index aa967596993a..3811f0d0a94e 100644 --- a/code/game/objects/items/stacks/flags.dm +++ b/code/game/objects/items/stacks/flags.dm @@ -197,7 +197,7 @@ /obj/item/flag/plantable/get_examine_text(mob/user) . = ..() - if(play_warcry && user.faction == faction) + if(play_warcry && user.faction.code_identificator == faction) . += SPAN_NOTICE("Planting the flag while in HARM intent will cause you to bellow out a rallying warcry!") /// Proc for turning the flag item into a structure. @@ -234,11 +234,11 @@ // If there are more than 14 allies nearby, play a stronger rallying cry. // Otherwise, play the default warcry sound if there is one. If not, play a generic flag raising sfx. - if(play_warcry && user.faction == faction && user.a_intent == INTENT_HARM) + if(play_warcry && user.faction.code_identificator == faction && user.a_intent == INTENT_HARM) var/allies_nearby = 0 if(COOLDOWN_FINISHED(src, warcry_cooldown_item)) for(var/mob/living/carbon/human in orange(planted_flag, 7)) - if(human.is_dead() || human.faction != faction) + if(human.is_dead() || human.faction.code_identificator != faction) continue allies_nearby++ diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 7a42833460d6..56423f348c04 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -37,8 +37,8 @@ else src.faction = GLOB.faction_datums[faction_to_get] - set_hive_data(src, faction) - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + set_hive_data(src, src.faction) + var/datum/faction_module/hive_mind/faction_module = src.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.tunnels += src var/obj/effect/alien/resin/trap/resin_trap = locate() in L @@ -48,7 +48,7 @@ if(faction_to_get == FACTION_XENOMORPH_NORMAL) RegisterSignal(SSdcs, COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING, PROC_REF(forsaken_handling)) - SSminimaps.add_marker(src, z, faction.minimap_flag, "xenotunnel") + SSminimaps.add_marker(src, z, src.faction.minimap_flag, "xenotunnel") /obj/structure/tunnel/proc/forsaken_handling() SIGNAL_HANDLER diff --git a/code/modules/cm_marines/marines_consoles.dm b/code/modules/cm_marines/marines_consoles.dm index 1b3915d5815e..e0bfdebee9ab 100644 --- a/code/modules/cm_marines/marines_consoles.dm +++ b/code/modules/cm_marines/marines_consoles.dm @@ -838,7 +838,7 @@ GLOBAL_LIST_EMPTY_TYPED(crewmonitor, /datum/crewmonitor) if(!C || !istype(C)) continue // Check that sensors are present and active - if(!C.has_sensor || !C.sensor_mode || faction != H.faction) + if(!C.has_sensor || !C.sensor_mode || faction != H.faction.code_identificator) continue // Check if z-level is correct @@ -1155,7 +1155,7 @@ GLOBAL_LIST_EMPTY_TYPED(crewmonitor, /datum/crewmonitor) if(!isyautja(human_mob)) continue - if(faction != human_mob.faction) + if(faction != human_mob.faction.code_identificator) continue // Check if z-level is correct diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index 8a525be908fd..8eb773700e83 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -63,6 +63,9 @@ linked_laptop = null if(!QDELETED(HD)) QDEL_NULL(HD) + + faction = null + return ..() /obj/structure/machinery/defenses/proc/connect() diff --git a/code/modules/defenses/planted_flag.dm b/code/modules/defenses/planted_flag.dm index 6160c26d193b..d84426d049c0 100644 --- a/code/modules/defenses/planted_flag.dm +++ b/code/modules/defenses/planted_flag.dm @@ -141,7 +141,7 @@ handheld_type = /obj/item/defenses/handheld/planted_flag/wy defense_type = "WY" - faction = FACTION_WY + faction_to_get = FACTION_WY /obj/structure/machinery/defenses/planted_flag/wy/apply_buff_to_player(mob/living/carbon/human/H) H.activate_order_buff(COMMAND_ORDER_HOLD, buff_intensity, 2 SECONDS) @@ -159,7 +159,7 @@ handheld_type = /obj/item/defenses/handheld/planted_flag/upp defense_type = "UPP" - faction = FACTION_UPP + faction_to_get = FACTION_UPP /obj/item/storage/backpack/jima name = "JIMA frame mount" diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index 9dd31fd259a6..fae778cd19c0 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -800,6 +800,7 @@ /datum/equipment_preset/uscm/marsoc name = "Marine Raider (!DEATHSQUAD!)" flags = EQUIPMENT_PRESET_EXTRA + job_faction = FACTION_MARSOC assignment = "Marine Raider" rank = JOB_MARINE_RAIDER role_comm_title = "Op." diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index f77a075f21d8..909e4f2c6933 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -48,7 +48,7 @@ hud_possible = list(HEALTH_HUD_XENO, PLASMA_HUD, PHEROMONE_HUD, QUEEN_OVERWATCH_HUD, ARMOR_HUD_XENO, XENO_STATUS_HUD, XENO_BANISHED_HUD, XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE, HUNTER_HUD, NEW_PLAYER_HUD) unacidable = TRUE rebounds = TRUE - faction = FACTION_XENOMORPH_NORMAL + faction_to_get = FACTION_XENOMORPH_NORMAL gender = NEUTER icon_size = 48 black_market_value = KILL_MENDOZA @@ -56,6 +56,7 @@ var/xeno_inhand_item_offset dead_black_market_value = 50 light_system = MOVABLE_LIGHT + var/obj/item/clothing/suit/wear_suit = null var/obj/item/clothing/head/head = null var/obj/item/r_store = null @@ -439,6 +440,16 @@ GLOB.living_xeno_list += src GLOB.xeno_mob_list += src xeno_inhand_item_offset = (icon_size - 32) * 0.5 + + . = ..() + + if(!organ_faction_tag && faction.organ_faction_iff_tag_type) + organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) + + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + for(var/trait in faction_module.hive_inherant_traits) + ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) + // More setup stuff for names, abilities etc update_icon_source() generate_name() @@ -451,16 +462,6 @@ recalculate_everything() toggle_xeno_mobhud() //This is a verb, but fuck it, it just werks - . = ..() - - faction.add_mob(src) - if(!organ_faction_tag && faction.organ_faction_iff_tag_type) - organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) - - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) - for(var/trait in faction_module.hive_inherant_traits) - ADD_TRAIT(src, trait, TRAIT_SOURCE_HIVE) - //Set leader to the new mob if(IS_XENO_LEADER(old_xeno)) faction_module.replace_hive_leader(old_xeno, src) diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 745b169a6e76..06aa4d8b09bb 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -17,7 +17,6 @@ response_help = "pets the" response_disarm = "gently pushes aside the" response_harm = "kicks the" - faction = "goat" attacktext = "kicks" health = 40 melee_damage_lower = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 83cb250a7f28..8b0fe905f69e 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -35,7 +35,7 @@ minbodytemp = 0 var/stance_step = 0 - faction = FACTION_UPP + faction_to_get = FACTION_UPP //SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!! /mob/living/simple_animal/hostile/bear/Hudson diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index a59090c31601..8debcb577082 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -36,8 +36,6 @@ break_stuff_probability = 15 - faction = "carp" - /mob/living/simple_animal/hostile/carp/Process_Spacemove(check_drift = 0) return 1 //No drifting in space for space carp! //original comments do not steal diff --git a/code/modules/mob/living/simple_animal/hostile/creature.dm b/code/modules/mob/living/simple_animal/hostile/creature.dm index 850316685044..9322d6d8891f 100644 --- a/code/modules/mob/living/simple_animal/hostile/creature.dm +++ b/code/modules/mob/living/simple_animal/hostile/creature.dm @@ -12,5 +12,4 @@ melee_damage_upper = 50 attacktext = "chomps" attack_sound = 'sound/weapons/bite.ogg' - faction = "creature" speed = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 576c83bf8dce..6c20afd26dc9 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -29,7 +29,6 @@ cold_damage_per_tick = 20 var/poison_per_bite = 5 var/poison_type = "toxin" - faction = "spiders" var/busy = FALSE move_to_delay = 6 speed = 3 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index f3f7e3265a9a..18a8c9f025aa 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -1,5 +1,4 @@ /mob/living/simple_animal/hostile - faction = "hostile" stop_automated_movement_when_pulled = 0 black_market_value = KILL_MENDOZA dead_black_market_value = 25 diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm index 84c5d13f7862..38071e1819c6 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm @@ -47,7 +47,6 @@ minbodytemp = 0 var/has_loot = TRUE - faction = "malf_drone" /mob/living/simple_animal/hostile/retaliate/malf_drone/Initialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index 828ad41708c1..0fc909d3b1b5 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -35,8 +35,6 @@ max_n2 = 0 minbodytemp = 0 - faction = "carp" - /mob/living/simple_animal/hostile/tree/FindTarget() . = ..() if(.) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index cc163bc7387a..254291237fb9 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -56,9 +56,11 @@ focus = null /mob/Initialize() - if(faction_to_get) + if(!faction && faction_to_get) faction = GLOB.faction_datums[faction_to_get] + faction.add_mob(src) + GLOB.last_mob_gid++ gid = GLOB.last_mob_gid diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 5b1f5974b051..ee08181f9bde 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -159,7 +159,7 @@ var/job = null // Internal job title used when mob is spawned. Preds are "Predator", Xenos are "Xenomorph", Marines have their actual job title var/comm_title = "" - var/faction_to_get = null + var/faction_to_get = FACTION_NEUTRAL var/datum/faction/faction = null var/looc_overhead = FALSE diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index b623a26fe744..cd517b3f3388 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -184,6 +184,10 @@ continue faction_to_get_list += faction_to_get + if(!length(faction_to_get_list)) + to_chat(src, SPAN_WARNING("There no applicable factions to join.")) + return + var/choice = tgui_input_list(src, "Choose faction to join:", "Factions", faction_to_get_list) if(!choice) return diff --git a/colonialmarines.dme b/colonialmarines.dme index ae6ce6b191a9..762d5bce70b9 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -593,8 +593,10 @@ #include "code\datums\factions\helpers.dm" #include "code\datums\factions\iff_tag.dm" #include "code\datums\factions\mercenary.dm" +#include "code\datums\factions\minor_factions.dm" #include "code\datums\factions\nspa.dm" #include "code\datums\factions\pirate.dm" +#include "code\datums\factions\pizza_delivery.dm" #include "code\datums\factions\relations_datum.dm" #include "code\datums\factions\ress.dm" #include "code\datums\factions\souto.dm" @@ -605,6 +607,7 @@ #include "code\datums\factions\threewe\threewe.dm" #include "code\datums\factions\uscm\cmb.dm" #include "code\datums\factions\uscm\marine.dm" +#include "code\datums\factions\uscm\marsoc.dm" #include "code\datums\factions\uscm\uscm.dm" #include "code\datums\factions\wy\deathsquad.dm" #include "code\datums\factions\wy\pmc.dm" diff --git a/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm b/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm index 51e1ab45af22..1eb6721d1602 100644 --- a/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm +++ b/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm @@ -83,7 +83,7 @@ /area/bigredv2/caves/eta/xenobiology) "t" = ( /mob/living/simple_animal/hostile/carp{ - faction = "neutral"; + faction = "nfo"; name = "strange fish" }, /turf/open/ice, diff --git a/maps/map_files/CORSAT/Corsat.dmm b/maps/map_files/CORSAT/Corsat.dmm index d39ead274e2c..21851d3db515 100644 --- a/maps/map_files/CORSAT/Corsat.dmm +++ b/maps/map_files/CORSAT/Corsat.dmm @@ -1735,7 +1735,7 @@ "agX" = ( /mob/living/simple_animal/hostile/carp{ color = "orange"; - faction = "neutral"; + faction = "nfo"; harm_intent_damage = 0; melee_damage_lower = 0; melee_damage_upper = 0 diff --git a/maps/templates/baseone.dmm b/maps/templates/baseone.dmm index cd18b4d25363..3f4dc9627c8a 100644 --- a/maps/templates/baseone.dmm +++ b/maps/templates/baseone.dmm @@ -739,7 +739,7 @@ /mob/living/simple_animal/chicken{ desc = "A chubby and friendly chicken, often sticking to the person being on kitchen duty. She looks somewhat lonely."; emote_see = list("pecks at the ground","flaps its wings","clucks happily"); - faction = list("CLF","UPP"); + faction = "upp"; name = "\improper Charlie"; voice_name = "chicken" }, diff --git a/maps/templates/lazy_templates/fax_responder_base.dmm b/maps/templates/lazy_templates/fax_responder_base.dmm index 17efab844733..494cca077b42 100644 --- a/maps/templates/lazy_templates/fax_responder_base.dmm +++ b/maps/templates/lazy_templates/fax_responder_base.dmm @@ -266,7 +266,7 @@ /obj/structure/machinery/computer/crew/alt{ pixel_y = 9; pixel_x = -14; - faction = "CLF"; + faction = "clf"; name = "CLF monitoring computer"; layer = 3.01 }, @@ -1113,7 +1113,7 @@ /obj/structure/surface/table/woodentable/fancy, /obj/structure/machinery/computer/crew/alt{ pixel_y = 0; - faction = "UPP"; + faction = "upp"; name = "UPP monitoring computer"; dir = 8; pixel_x = 3 @@ -1288,7 +1288,7 @@ /obj/structure/machinery/computer/crew/alt{ pixel_y = -7; pixel_x = -3; - faction = "Colonial Marshal"; + faction = "clmr"; name = "CMB monitoring computer"; dir = 4; layer = 2.99 @@ -1843,12 +1843,12 @@ /obj/structure/machinery/computer/crew/alt{ pixel_y = 17; pixel_x = -9; - faction = "Wey-Yu"; + faction = "wy"; name = "WY monitoring computer" }, /obj/structure/machinery/computer/crew/alt{ pixel_y = 17; - faction = "PMC"; + faction = "pmc"; name = "PMC monitoring computer"; pixel_x = 8 }, @@ -2297,7 +2297,7 @@ /obj/structure/machinery/computer/crew/alt{ pixel_y = 0; pixel_x = 3; - faction = "TWE"; + faction = "twe"; name = "TWE monitoring computer"; dir = 8 }, @@ -4320,7 +4320,7 @@ "TI" = ( /mob/living/simple_animal/hostile/carp{ destroy_surroundings = 0; - faction = "Fax Responder"; + faction = "fax"; name = "Gary" }, /turf/open/space/basic, From 9dea7f1bf6b40ec0de20ca62727dccea00f61033 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:56:48 +0500 Subject: [PATCH 13/24] sss --- code/modules/client/preferences.dm | 16 ++++++++++++++++ .../mob/living/carbon/xenomorph/Xenomorph.dm | 5 +++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index cc848c651af1..68bbd4fd0de4 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -677,6 +677,10 @@ GLOBAL_LIST_INIT(bgstate_options, list( if(!GLOB.RoleAuthority) return + if(!length(SSticker.mode.factions_pool)) + to_chat(src, SPAN_WARNING("There no applicable factions.")) + return + if(!observing_faction) observing_faction = GLOB.faction_datums[SSticker.mode.factions_pool[pick(SSticker.mode.factions_pool)]] @@ -803,6 +807,10 @@ GLOBAL_LIST_INIT(bgstate_options, list( if(!GLOB.RoleAuthority) return + if(!length(SSticker.mode.factions_pool)) + to_chat(src, SPAN_WARNING("There no applicable factions.")) + return + if(!observing_faction) observing_faction = GLOB.faction_datums[SSticker.mode.factions_pool[pick(SSticker.mode.factions_pool)]] @@ -1026,6 +1034,10 @@ GLOBAL_LIST_INIT(bgstate_options, list( var/priority = text2num(href_list["target_priority"]) SetJob(user, href_list["text"], priority) if("faction") + if(!length(SSticker.mode.factions_pool)) + to_chat(src, SPAN_WARNING("There no applicable factions.")) + return + var/choice = tgui_input_list(user, "Choose faction to observer roles:", "Factions", SSticker.mode.factions_pool) if(!choice) return @@ -1052,6 +1064,10 @@ GLOBAL_LIST_INIT(bgstate_options, list( reset_job_slots() set_job_slots(user) if("faction") + if(!length(SSticker.mode.factions_pool)) + to_chat(src, SPAN_WARNING("There no applicable factions.")) + return + var/choice = tgui_input_list(user, "Choose faction to observer roles:", "Factions", SSticker.mode.factions_pool) if(!choice) return diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 909e4f2c6933..79b1ce313d92 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -463,8 +463,9 @@ toggle_xeno_mobhud() //This is a verb, but fuck it, it just werks //Set leader to the new mob - if(IS_XENO_LEADER(old_xeno)) - faction_module.replace_hive_leader(old_xeno, src) + if(old_xeno) + if(IS_XENO_LEADER(old_xeno)) + faction_module.replace_hive_leader(old_xeno, src) //Begin SStracking SStracking.start_tracking("hive_[faction.code_identificator]", src) From 3f810385f4b78a815222010ab238e2af2aaddab4 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Sat, 25 Jan 2025 11:58:04 +0500 Subject: [PATCH 14/24] some fixes --- code/datums/factions/faction_modules.dm | 6 +++--- code/datums/factions/minor_factions.dm | 2 +- code/modules/mob/living/carbon/xenomorph/Embryo.dm | 2 +- code/modules/mob/living/carbon/xenomorph/Evolution.dm | 4 ++-- code/modules/mob/living/carbon/xenomorph/Xenomorph.dm | 2 +- maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm | 2 +- .../LV759_Hybrisa_Prospera/LV759_Hybrisa_Prospera.dmm | 6 +++--- maps/map_files/USS_Almayer/USS_Almayer.dmm | 4 ++-- maps/templates/lazy_templates/weyland_ert_station.dmm | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/code/datums/factions/faction_modules.dm b/code/datums/factions/faction_modules.dm index 0e61729ed1e3..2ce1baea571a 100644 --- a/code/datums/factions/faction_modules.dm +++ b/code/datums/factions/faction_modules.dm @@ -147,7 +147,7 @@ var/list/cooldown_hivebuffs = list() /// List of references to hive pylons active in the game world - var/list/active_endgame_pylons + var/list/active_endgame_pylons = list() /*Stores the image()'s for the xeno evolution radial menu To add an image for your caste - add an icon to icons/mob/xenos/radial_xenos.dmi @@ -962,7 +962,7 @@ var/list/potential_hivebuffs = subtypesof(/datum/hivebuff) // First check if we any pylons which are capable of supporting hivebuffs - if(!LAZYLEN(active_endgame_pylons)) + if(!length(active_endgame_pylons)) return for(var/datum/hivebuff/possible_hivebuff as anything in potential_hivebuffs) @@ -971,7 +971,7 @@ potential_hivebuffs -= possible_hivebuff continue - if(initial(possible_hivebuff.number_of_required_pylons) > LAZYLEN(active_endgame_pylons)) + if(initial(possible_hivebuff.number_of_required_pylons) > length(active_endgame_pylons)) potential_hivebuffs -= possible_hivebuff continue diff --git a/code/datums/factions/minor_factions.dm b/code/datums/factions/minor_factions.dm index 874b1355ecf8..8e3800d6b932 100644 --- a/code/datums/factions/minor_factions.dm +++ b/code/datums/factions/minor_factions.dm @@ -16,4 +16,4 @@ /datum/faction/xenomorph/tut name = "Tutorial Xeno" desc = "Lets be honest, why the **** SOMEBODY DID IT???" - code_identificator = FACTION_SURVIVOR + code_identificator = MINIMAP_FLAG_XENO_CORRUPTED diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index 5c54066b5738..7efd8c39775a 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -348,7 +348,7 @@ if(!larva_embryo.ckey && larva_embryo.burrowable && loc && is_ground_level(loc.z) && (locate(/obj/structure/bed/nest) in loc) && faction_module.living_xeno_queen && faction_module.living_xeno_queen.z == loc.z) larva_embryo.visible_message(SPAN_XENODANGER("[larva_embryo] quickly burrows into the ground.")) if(GLOB.round_statistics && !larva_embryo.statistic_exempt) - GLOB.round_statistics.track_new_participant(faction, -1) // keep stats sane + GLOB.round_statistics.track_new_participant(faction.code_identificator, -1) // keep stats sane faction_module.stored_larva++ faction_module.hive_ui.update_burrowed_larva() qdel(larva_embryo) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index 457499a3c394..d4063784f8a5 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -194,7 +194,7 @@ new_xeno.client.mouse_pointer_icon = initial(new_xeno.client.mouse_pointer_icon) if(new_xeno.mind && GLOB.round_statistics) - GLOB.round_statistics.track_new_participant(new_xeno.faction, -1) //so an evolved xeno doesn't count as two. + GLOB.round_statistics.track_new_participant(new_xeno.faction.code_identificator, -1) //so an evolved xeno doesn't count as two. SSround_recording.recorder.track_player(new_xeno) SEND_SIGNAL(src, COMSIG_XENO_EVOLVE_TO_NEW_CASTE, new_xeno) @@ -368,7 +368,7 @@ new_xeno._status_traits = src._status_traits if(GLOB.round_statistics && !new_xeno.statistic_exempt) - GLOB.round_statistics.track_new_participant(faction, -1) //so an evolved xeno doesn't count as two. + GLOB.round_statistics.track_new_participant(faction.code_identificator, -1) //so an evolved xeno doesn't count as two. SSround_recording.recorder.stop_tracking(src) SSround_recording.recorder.track_player(new_xeno) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 79b1ce313d92..218550100492 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -499,7 +499,7 @@ if(current_area && current_area.statistic_exempt) statistic_exempt = TRUE if(GLOB.round_statistics && !statistic_exempt) - GLOB.round_statistics.track_new_participant(faction, 1) + GLOB.round_statistics.track_new_participant(faction.code_identificator, 1) // This can happen if a xeno gets made before the game starts if(faction_module.hive_ui) diff --git a/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm b/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm index a360532b658f..0d9b74e0dac7 100644 --- a/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm +++ b/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm @@ -5073,7 +5073,7 @@ /area/lv522/atmos/command_centre) "cOA" = ( /obj/structure/closet/crate, -/obj/item/storage/xeno_tag_case, +/obj/item/storage/tag_case, /obj/effect/decal/cleanable/dirt, /obj/structure/machinery/light{ dir = 4 diff --git a/maps/map_files/LV759_Hybrisa_Prospera/LV759_Hybrisa_Prospera.dmm b/maps/map_files/LV759_Hybrisa_Prospera/LV759_Hybrisa_Prospera.dmm index 235504749757..c73356612ae3 100644 --- a/maps/map_files/LV759_Hybrisa_Prospera/LV759_Hybrisa_Prospera.dmm +++ b/maps/map_files/LV759_Hybrisa_Prospera/LV759_Hybrisa_Prospera.dmm @@ -38200,7 +38200,7 @@ icon_state = "5-8"; color = "#550d0d" }, -/obj/item/storage/xeno_tag_case{ +/obj/item/storage/tag_case{ pixel_x = -2; pixel_y = 5 }, @@ -58488,10 +58488,10 @@ /area/lv759/indoors/caves/south_caves/derelict_ship) "idW" = ( /obj/structure/surface/table/almayer, -/obj/item/storage/xeno_tag_case/full{ +/obj/item/storage/tag_case/full{ pixel_x = 6 }, -/obj/item/storage/xeno_tag_case/full{ +/obj/item/storage/tag_case/full{ pixel_y = 8; pixel_x = 6 }, diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index f51be9983500..9ff5c361fee5 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -2265,7 +2265,7 @@ density = 0; pixel_y = 16 }, -/obj/item/storage/xeno_tag_case/full{ +/obj/item/storage/tag_case/full{ pixel_y = 15 }, /obj/item/device/camera{ @@ -45282,7 +45282,7 @@ pixel_x = 4; pixel_y = 2 }, -/obj/item/storage/xeno_tag_case/full{ +/obj/item/storage/tag_case/full{ pixel_y = -6 }, /turf/open/floor/almayer/plate, diff --git a/maps/templates/lazy_templates/weyland_ert_station.dmm b/maps/templates/lazy_templates/weyland_ert_station.dmm index a19df710109f..3287de39b7d1 100644 --- a/maps/templates/lazy_templates/weyland_ert_station.dmm +++ b/maps/templates/lazy_templates/weyland_ert_station.dmm @@ -1906,7 +1906,7 @@ req_access_txt = "200" }, /obj/structure/surface/table/reinforced/almayer_B, -/obj/item/storage/xeno_tag_case/full{ +/obj/item/storage/tag_case/full{ pixel_y = 8 }, /obj/item/restraint/adjustable/cable/red{ From 0947e8b7b047016781e938b26776cc1270547701 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Sat, 25 Jan 2025 13:31:33 +0500 Subject: [PATCH 15/24] some fixes and improvements --- code/__DEFINES/mode.dm | 16 +++-- code/controllers/subsystem/hijack.dm | 4 +- code/controllers/subsystem/influxstats.dm | 2 +- code/controllers/subsystem/tracking.dm | 2 +- code/controllers/subsystem/who.dm | 4 +- code/controllers/subsystem/x_evolution.dm | 4 +- code/datums/factions/faction.dm | 2 + code/datums/factions/helpers.dm | 12 ++-- code/datums/factions/iff_tag.dm | 12 ++-- code/datums/factions/minor_factions.dm | 2 +- code/datums/factions/relations_datum.dm | 2 +- code/datums/factions/xeno/xeno.dm | 1 + .../datums/statistics/entities/round_stats.dm | 6 +- code/defines/procs/announcement.dm | 8 +-- code/game/bioscans.dm | 2 +- code/game/gamemodes/cm_initialize.dm | 8 +-- .../colonialmarines/colonialmarines.dm | 10 ++-- .../gamemodes/colonialmarines/xenovsxeno.dm | 2 +- code/game/gamemodes/game_mode.dm | 2 +- code/game/jobs/role_authority.dm | 2 +- code/game/machinery/nuclearbomb.dm | 14 ++--- .../antag/antag_guns_snowflake.dm | 2 +- .../vendor_types/antag/antag_guns_sorted.dm | 2 +- .../admin/player_panel/actions/physical.dm | 13 ++-- .../admin/player_panel/player_panel.dm | 2 +- code/modules/admin/tabs/event_tab.dm | 40 +++++-------- code/modules/admin/topic/topic.dm | 41 +++++-------- code/modules/admin/topic/topic_events.dm | 9 ++- code/modules/admin/topic/topic_teleports.dm | 2 +- code/modules/admin/verbs/mob_verbs.dm | 2 +- code/modules/admin/verbs/select_equipment.dm | 18 +++--- code/modules/cm_aliens/XenoStructures.dm | 60 +++++++++---------- .../structures/special/pylon_core.dm | 4 +- code/modules/mob/dead/observer/observer.dm | 24 ++++---- .../living/carbon/xenomorph/castes/Queen.dm | 2 +- .../living/carbon/xenomorph/hive_faction.dm | 2 +- code/modules/mob/new_player/new_player.dm | 2 +- .../chemistry_properties/prop_special.dm | 10 ++-- code/modules/tgui/states/xeno.dm | 4 +- code/modules/vox/vox_tgui.dm | 14 +++-- maps/templates/basetwo.dmm | 2 +- 41 files changed, 191 insertions(+), 181 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index cfd775307d46..2c4857153386 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -299,6 +299,12 @@ DEFINE_BITFIELD(whitelist_status, list( // I have no idea where to put it, we even need that? #define FACTION_MONKEY "ng" // Nanu +GLOBAL_LIST_INIT(FACTION_LIST_HUMANOID, list( + FACTION_NEUTRAL, FACTION_USCM, FACTION_MARINE, FACTION_MARSOC, FACTION_MARSHAL, FACTION_COLONIST, FACTION_WY, FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_UPP, + FACTION_TWE, FACTION_THREEWE, FACTION_RESS, FACTION_CLF, FACTION_CONTRACTOR, FACTION_NSPA, FACTION_MERCENARY, FACTION_FREELANCER, FACTION_HEFA, FACTION_DUTCH, + FACTION_PIRATE, FACTION_GLADIATOR, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_FAX, FACTION_SURVIVOR, FACTION_MONKEY, +)) + // Zenomorphs #define FACTION_XENOMORPH "zen" #define FACTION_XENOMORPH_NORMAL "nzen" @@ -313,15 +319,17 @@ DEFINE_BITFIELD(whitelist_status, list( #define FACTION_XENOMORPH_MUTATED "mutzen" #define FACTION_XENOMORPH_YAUTJA "yakutzen" #define FACTION_XENOMORPH_RENEGADE "renegzen" -#define FACTION_LIST_XENOMORPH list(FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE) -#define FACTION_LIST_HUMANOID list(FACTION_MARINE, FACTION_MARSOC, FACTION_PMC, FACTION_WY, FACTION_WY_DEATHSQUAD, FACTION_CLF, FACTION_CONTRACTOR, FACTION_MARSHAL, FACTION_UPP, FACTION_FREELANCER, FACTION_SURVIVOR, FACTION_NEUTRAL, FACTION_COLONIST, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_YAUTJA, FACTION_ZOMBIE, FACTION_TWE, FACTION_THREEWE, FACTION_FAX) +GLOBAL_LIST_INIT(FACTION_LIST_XENOMORPH, list( + FACTION_XENOMORPH_NORMAL, FACTION_XENOMORPH_CORRUPTED, FACTION_XENOMORPH_ALPHA, FACTION_XENOMORPH_BRAVO, FACTION_XENOMORPH_CHARLIE, FACTION_XENOMORPH_DELTA, + FACTION_XENOMORPH_FERAL, FACTION_XENOMORPH_FORSAKEN, FACTION_XENOMORPH_TAMED, FACTION_XENOMORPH_MUTATED, FACTION_XENOMORPH_YAUTJA, FACTION_XENOMORPH_RENEGADE, + FACTION_XENOMORPH_TUTORIAL, +)) + #define FACTION_LIST_ERT_OTHER list(FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO) #define FACTION_LIST_ERT_ALL list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY, FACTION_CLF, FACTION_CONTRACTOR, FACTION_UPP, FACTION_FREELANCER, FACTION_MERCENARY, FACTION_DUTCH, FACTION_HEFA, FACTION_GLADIATOR, FACTION_PIRATE, FACTION_PIZZA, FACTION_SOUTO, FACTION_MARSHAL, FACTION_TWE) #define FACTION_LIST_WY list(FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) -#define FACTION_LIST_ALL FACTION_LIST_HUMANOID + FACTION_LIST_XENOMORPH - // Faction allegiances within a certain faction. #define FACTION_ALLEGIANCE_USCM_COMMANDER list("Doves", "Hawks", "Magpies", "Unaligned") diff --git a/code/controllers/subsystem/hijack.dm b/code/controllers/subsystem/hijack.dm index 9c2151a9dee9..b115717fc8b1 100644 --- a/code/controllers/subsystem/hijack.dm +++ b/code/controllers/subsystem/hijack.dm @@ -200,7 +200,7 @@ SUBSYSTEM_DEF(hijack) if(marine_warning_areas) marine_warning_areas = copytext(marine_warning_areas, 1, -2) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -305,7 +305,7 @@ SUBSYSTEM_DEF(hijack) if(!generator_ever_overloaded) generator_ever_overloaded = TRUE - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue diff --git a/code/controllers/subsystem/influxstats.dm b/code/controllers/subsystem/influxstats.dm index 1f3815710e14..a6efc8fa0588 100644 --- a/code/controllers/subsystem/influxstats.dm +++ b/code/controllers/subsystem/influxstats.dm @@ -52,7 +52,7 @@ SUBSYSTEM_DEF(influxstats) return result /datum/controller/subsystem/influxstats/proc/run_special_round_statistics() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) SSinfluxdriver.enqueue_stats("pooled_larva", list("hive" = faction.code_identificator), list("count" = faction_module.stored_larva)) diff --git a/code/controllers/subsystem/tracking.dm b/code/controllers/subsystem/tracking.dm index bb43eb329e45..305e7d003ef0 100644 --- a/code/controllers/subsystem/tracking.dm +++ b/code/controllers/subsystem/tracking.dm @@ -107,5 +107,5 @@ SUBSYSTEM_DEF(tracking) /datum/controller/subsystem/tracking/proc/initialize_trackers() setup_trackers(null, "marine_sl") - for(var/tracking_faction in FACTION_LIST_XENOMORPH) + for(var/tracking_faction in GLOB.FACTION_LIST_XENOMORPH) setup_trackers(null, "hive_[tracking_faction]") diff --git a/code/controllers/subsystem/who.dm b/code/controllers/subsystem/who.dm index fc568dd83083..047c3bf26ed2 100644 --- a/code/controllers/subsystem/who.dm +++ b/code/controllers/subsystem/who.dm @@ -135,13 +135,13 @@ SUBSYSTEM_DEF(who) factions_additional += list(list("content" = "Infected Predators: [counted_additional["infected_preds"]]", "color" = "#7ABA19", "text" = "Players playing as Infected Yautja")) factions_additional += list(list("content" = "Hunted In Preserve: [counted_additional["hunted"]]", "color" = "#476816", "text" = "Players playing as hunted in preserve")) - for(var/faction_to_get in FACTION_LIST_HUMANOID - FACTION_YAUTJA - FACTION_MARINE) + for(var/faction_to_get in GLOB.FACTION_LIST_HUMANOID - FACTION_YAUTJA - FACTION_MARINE) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue factions_additional += list(list("content" = "[faction]: [length(faction.total_mobs)]", "color" = faction.color, "text" = "[faction.desc]",)) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!faction || !length(faction.total_mobs)) diff --git a/code/controllers/subsystem/x_evolution.dm b/code/controllers/subsystem/x_evolution.dm index 10c95b531f7a..de9650cb6e9b 100644 --- a/code/controllers/subsystem/x_evolution.dm +++ b/code/controllers/subsystem/x_evolution.dm @@ -15,13 +15,13 @@ SUBSYSTEM_DEF(xevolution) var/force_boost_power = FALSE // Debugging only /datum/controller/subsystem/xevolution/Initialize(start_timeofday) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) boost_power[faction_to_get] = 1 overridden_power[faction_to_get] = FALSE return SS_INIT_SUCCESS /datum/controller/subsystem/xevolution/fire(resumed = FALSE) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(overridden_power[faction_to_get]) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index a803b4cbf3e6..dd9ac524d55c 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -54,6 +54,8 @@ /datum/faction/New() relations_datum = new(src) GLOB.custom_event_info_list[code_identificator] = new /datum/custom_event_info(src, null, code_identificator) + if(!istype(src, /datum/faction/xenomorph)) + GLOB.faction_by_name_humanoid[name] = src /datum/faction/proc/get_faction_module(module_required) if(module_required in faction_modules) diff --git a/code/datums/factions/helpers.dm b/code/datums/factions/helpers.dm index e088433d8b18..6ce3e3fc129d 100644 --- a/code/datums/factions/helpers.dm +++ b/code/datums/factions/helpers.dm @@ -1,5 +1,12 @@ GLOBAL_LIST_INIT_TYPED(custom_event_info_list, /datum/custom_event_info, setup_custom_event_info()) +/proc/setup_custom_event_info() + . = list() + .["glob"] = new /datum/custom_event_info(null, "Global", "glob") + +GLOBAL_LIST_INIT_TYPED(faction_by_name, /datum/faction, list()) +GLOBAL_LIST_INIT_TYPED(faction_by_name_xenomorphs, /datum/faction, list()) +GLOBAL_LIST_INIT_TYPED(faction_by_name_humanoid, /datum/faction, list()) GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) /proc/setup_faction_list() @@ -7,8 +14,5 @@ GLOBAL_LIST_INIT_TYPED(faction_datums, /datum/faction, setup_faction_list()) for(var/path in typesof(/datum/faction)) var/datum/faction/faction = new path() .[faction.code_identificator] = faction + GLOB.faction_by_name[faction.name] = faction faction.relations_datum.generate_relations_helper() - -/proc/setup_custom_event_info() - . = list() - .["glob"] = new /datum/custom_event_info(null, "Global", "glob") diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index f1e9196b32cc..ed50668797f6 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -25,15 +25,15 @@ DEFINE_BITFIELD(iff_flag_flags, list( var/faction_to_get = null var/datum/faction/faction = null -/obj/item/faction_tag/Initialize(mapload, _faction_to_get) +/obj/item/faction_tag/Initialize(mapload, faction_to_set) . = ..() - if(_faction_to_get) - if(istype(_faction_to_get, /datum/faction)) - faction = _faction_to_get + if(faction_to_set) + if(istype(faction_to_set, /datum/faction)) + faction = faction_to_set faction_to_get = faction.code_identificator else - faction_to_get = _faction_to_get - faction = GLOB.faction_datums[_faction_to_get] + faction_to_get = faction_to_set + faction = GLOB.faction_datums[faction_to_set] else if(faction_to_get) faction = GLOB.faction_datums[faction_to_get] diff --git a/code/datums/factions/minor_factions.dm b/code/datums/factions/minor_factions.dm index 8e3800d6b932..e0bb2234d28e 100644 --- a/code/datums/factions/minor_factions.dm +++ b/code/datums/factions/minor_factions.dm @@ -16,4 +16,4 @@ /datum/faction/xenomorph/tut name = "Tutorial Xeno" desc = "Lets be honest, why the **** SOMEBODY DID IT???" - code_identificator = MINIMAP_FLAG_XENO_CORRUPTED + code_identificator = FACTION_XENOMORPH_TUTORIAL diff --git a/code/datums/factions/relations_datum.dm b/code/datums/factions/relations_datum.dm index 15ddfd794779..a2b6c6919ae0 100644 --- a/code/datums/factions/relations_datum.dm +++ b/code/datums/factions/relations_datum.dm @@ -14,7 +14,7 @@ /datum/faction_module/relations/proc/generate_relations_helper() spawn(30 SECONDS) - for(var/code_identificator in FACTION_LIST_ALL) + for(var/code_identificator in GLOB.faction_datums) if(code_identificator == faction.code_identificator) relations[code_identificator] = RELATIONS_SELF continue diff --git a/code/datums/factions/xeno/xeno.dm b/code/datums/factions/xeno/xeno.dm index 179dc3a70478..20ab8ef0f99d 100644 --- a/code/datums/factions/xeno/xeno.dm +++ b/code/datums/factions/xeno/xeno.dm @@ -11,6 +11,7 @@ /datum/faction/xenomorph/New() faction_modules[FACTION_MODULE_HIVE_MIND] = new /datum/faction_module/hive_mind(src) + GLOB.faction_by_name_xenomorphs[name] = src . = ..() /datum/faction/xenomorph/faction_is_ally(datum/faction/faction) diff --git a/code/datums/statistics/entities/round_stats.dm b/code/datums/statistics/entities/round_stats.dm index 0f07de6e1b4d..d50f95362e99 100644 --- a/code/datums/statistics/entities/round_stats.dm +++ b/code/datums/statistics/entities/round_stats.dm @@ -314,7 +314,7 @@ var/total_humans_created = 0 for(var/statistic in participants) var/datum/entity/statistic/S = participants[statistic] - if(S.name in FACTION_LIST_XENOMORPH) + if(S.name in GLOB.FACTION_LIST_XENOMORPH) total_xenos_created += S.value else if(S.name == FACTION_YAUTJA) total_predators_spawned += S.value @@ -326,7 +326,7 @@ for(var/statistic in hijack_participants) var/datum/entity/statistic/S = hijack_participants[statistic] - if(S.name in FACTION_LIST_XENOMORPH) + if(S.name in GLOB.FACTION_LIST_XENOMORPH) xeno_count_during_hijack += S.value else if(S.name == FACTION_YAUTJA) continue @@ -338,7 +338,7 @@ for(var/statistic in final_participants) var/datum/entity/statistic/S = final_participants[statistic] - if(S.name in FACTION_LIST_XENOMORPH) + if(S.name in GLOB.FACTION_LIST_XENOMORPH) end_of_round_xenos += S.value else if(S.name == FACTION_YAUTJA) continue diff --git a/code/defines/procs/announcement.dm b/code/defines/procs/announcement.dm index cb4a43aed57f..85eda71d24cc 100644 --- a/code/defines/procs/announcement.dm +++ b/code/defines/procs/announcement.dm @@ -11,8 +11,8 @@ //xenomorph hive announcement /proc/xeno_announcement(message, datum/faction/faction_to_display = GLOB.faction_datums[FACTION_XENOMORPH_NORMAL], title = QUEEN_ANNOUNCE) var/list/targets = GLOB.dead_mob_list.Copy() - if(faction_to_display == "Everyone") - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + if(faction_to_display == "All Hives") + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) for(var/mob/mob as anything in GLOB.faction_datums[faction_to_get].total_mobs) if(!mob.stat || !mob.client) continue @@ -36,8 +36,8 @@ if(ARES_LOG_SECURITY) log_ares_security(title, message, signature) - else if(faction_to_display == "Everyone (-Yautja)") - for(var/faction_to_get in FACTION_LIST_HUMANOID - FACTION_YAUTJA) + else if(faction_to_display == "All Humans") + for(var/faction_to_get in GLOB.FACTION_LIST_HUMANOID - FACTION_YAUTJA) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] for(var/mob/mob as anything in faction.total_mobs) if(!mob.stat || !mob.client) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 22f48d9e58e0..3648fada5608 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -40,7 +40,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) /// Count all larva across all hives - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) larva += faction_module.stored_larva diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index e081025fc04f..a3c29e7718bf 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -471,7 +471,7 @@ Additional game mode variables. else available_xenos_non_ssd += cur_xeno - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.hardcore) @@ -558,7 +558,7 @@ Additional game mode variables. return FALSE - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] for(var/mob_name in faction.banished_ckeys) if(faction.banished_ckeys[mob_name] == candidate_observer.ckey) @@ -662,7 +662,7 @@ Additional game mode variables. /datum/game_mode/proc/attempt_to_join_as_facehugger(mob/xeno_candidate) var/list/active_hives = list() var/datum/faction/faction - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -727,7 +727,7 @@ Additional game mode variables. /datum/game_mode/proc/attempt_to_join_as_lesser_drone(mob/xeno_candidate) var/list/active_hives = list() var/datum/faction/faction - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 2638e4c070cf..a5cb77f8cc95 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -380,7 +380,7 @@ next_research_allocation = world.time + research_allocation_interval if(!round_finished) - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!faction_module.xeno_queen_timer) @@ -419,7 +419,7 @@ round_checkwin = 0 if(!evolution_ovipositor_threshold && world.time >= SSticker.round_start_time + round_time_evolution_ovipositor) - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction_module/hive_mind/faction_module = GLOB.faction_datums[faction_to_get].get_faction_module(FACTION_MODULE_HIVE_MIND) if(!faction_module.xeno_queen_timer) continue @@ -531,7 +531,7 @@ return . // Ensure there is no queen - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(faction.need_round_end_check && !faction.can_delay_round_end()) continue @@ -556,7 +556,7 @@ if(round_finished) return - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/current_faction = GLOB.faction_datums[faction_to_get] if(current_faction.need_round_end_check && !current_faction.can_delay_round_end()) continue @@ -692,7 +692,7 @@ var/list/counted_xenos = list() //organize our hives and castes in a readable and standard way | don't forget our pooled larva - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) counted_xenos[faction_to_get] = list() for(var/caste in ALL_XENO_CASTES) counted_xenos[faction_to_get][caste] = 0 diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index b15728a3c865..b177d76f00a6 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -204,7 +204,7 @@ /datum/game_mode/xenovs/proc/get_xenos_hive(list/z_levels = SSmapping.levels_by_any_trait(list(ZTRAIT_GROUND, ZTRAIT_RESERVED, ZTRAIT_MARINE_MAIN_SHIP))) var/list/list/xenos_factions = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(!is_hive_living(faction_module)) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 7ca01cd3fab0..de55fb5afd84 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -54,7 +54,7 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t if(taskbar_icon) GLOB.available_taskbar_icons |= taskbar_icon - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(length(faction.roles_list[name])) factions_pool[faction.code_identificator] = faction.code_identificator diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 98bb283061f0..cbf75b6b48e7 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -127,7 +127,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou //PART I: Get roles relevant to the mode roles_for_mode = list() - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(length(faction.roles_list[SSticker.mode.name])) for(var/role_name in faction.roles_list[SSticker.mode.name]) diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 1989f9aaee79..faf1b7762239 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -342,7 +342,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) warning = "Every sense in our form is screaming... the hive killer is almost ready to trigger!" else warning = "DISABLE IT! NOW!" - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -354,7 +354,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE ACTIVATED.\n\nDETONATION IN [floor(timeleft/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') var/t_left = duration2text_sec(floor(rand(timeleft - timeleft / 10, timeleft + timeleft / 10))) faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [t_left] to abandon the hunting grounds before it activates."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -363,7 +363,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DEACTIVATED.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DEACTIVATED.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -569,7 +569,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nThe human purification device is able to be activated."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -588,7 +588,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) if(timer_warning & NUKE_DECRYPT_SHOW_TIMER_HALF) warning = "The Hive grows restless! it's halfway done..." - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -600,7 +600,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE ORDNANCE DECRYPTION STARTED.\n\nDECRYPTION IN [floor(decryption_time/10)] SECONDS.", "HQ Nuclear Tracker", humans_other, 'sound/misc/notice1.ogg') var/time_left = duration2text_sec(floor(rand(decryption_time - decryption_time / 10, decryption_time + decryption_time / 10))) faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
A human purification device has been detected. You have approximately [time_left] before it finishes its initial phase."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue @@ -610,7 +610,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE DECRYPTION HALTED.", "[MAIN_AI_SYSTEM] Nuclear Tracker", humans_uscm, 'sound/misc/notice1.ogg') announcement_helper("ALERT.\n\nNUCLEAR EXPLOSIVE DECRYPTION HALTED.", "HQ Intel Division", humans_other, 'sound/misc/notice1.ogg') faction_announcement(SPAN_YAUTJABOLDBIG("WARNING!
The human purification device's signature has disappeared."), YAUTJA_ANNOUNCE, sound('sound/misc/notice1.ogg'), GLOB.faction_datums[FACTION_YAUTJA]) - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue diff --git a/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm b/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm index 6143210a3af4..4a9ded10bf9d 100644 --- a/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm +++ b/code/game/machinery/vending/vendor_types/antag/antag_guns_snowflake.dm @@ -18,7 +18,7 @@ /obj/structure/machinery/cm_vending/gear/antag_guns/get_listed_products(mob/user) if(!user) var/list/all_equipment = list() - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/list/equipment = faction.get_antag_guns_snowflake_equipment() if(length(equipment)) diff --git a/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm b/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm index e7194ea00e94..0cd76c829598 100644 --- a/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm +++ b/code/game/machinery/vending/vendor_types/antag/antag_guns_sorted.dm @@ -17,7 +17,7 @@ /obj/structure/machinery/cm_vending/sorted/cargo_guns/antag_guns/get_listed_products(mob/user) if(!user) var/list/all_equipment = list() - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/list/equipment = faction.get_antag_guns_sorted_equipment() if(length(equipment)) diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index cdc60045e8d7..06ba25f6dcc9 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -203,9 +203,14 @@ permissions_required = R_VAREDIT /datum/player_action/set_faction/act(client/user, mob/living/carbon/target, list/params) - var/faction_to_get = tgui_input_list(usr, "Select faction", "Faction Choice", FACTION_LIST_ALL) - if(faction_to_get) - GLOB.faction_datums[faction_to_get].add_mob(target) + var/list/datum/faction/factions = list() + for(var/faction_to_get in GLOB.faction_datums) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + factions[faction.name] = faction - message_admins("[key_name_admin(user)][faction_to_get ? "" : " failed to"] set [key_name_admin(target)]'s faction to [faction_to_get].") + var/choice = tgui_input_list(usr, "Select faction", "Faction Choice", factions) + if(choice) + factions[choice].add_mob(target) + + message_admins("[key_name_admin(user)][choice ? "" : " failed to"] set [key_name_admin(target)]'s faction to [choice].") return TRUE diff --git a/code/modules/admin/player_panel/player_panel.dm b/code/modules/admin/player_panel/player_panel.dm index c59ac2c72bdb..cfede13abdf7 100644 --- a/code/modules/admin/player_panel/player_panel.dm +++ b/code/modules/admin/player_panel/player_panel.dm @@ -515,7 +515,7 @@ GLOBAL_LIST_INIT(pp_hives, pp_generate_hives()) /proc/pp_generate_hives() . = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] .[faction.name] = faction.code_identificator diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 01c215745910..ae656ab4865c 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -474,11 +474,11 @@ return var/list/datum/faction/factions = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] - if(!length(faction_to_set.total_mobs) && !length(faction_to_set.total_dead_mobs)) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + if(!length(faction.total_mobs) && !length(faction.total_dead_mobs)) continue - LAZYSET(factions, faction_to_set.name, faction_to_set) + .[faction.name] = faction if(!length(factions)) to_chat(src, SPAN_ALERT("There seem to be no hives at the moment.")) @@ -566,28 +566,23 @@ to_chat(src, "Only administrators may use this command.") return - var/list/datum/faction/factions = list() - LAZYSET(factions, "All Humans", "Everyone (-Yautja)") - for(var/faction_to_get in FACTION_LIST_HUMANOID) - var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] - LAZYSET(factions, faction_to_set.name, faction_to_set) - - var/choice = tgui_input_list(usr, "Please choose faction your announcement will be shown to.", "Faction Selection", factions) + var/choice = tgui_input_list(usr, "Please choose faction your announcement will be shown to.", "Faction Selection", list("All Humans" = null) + GLOB.faction_by_name_humanoid) if(!choice) return var/input = input(usr, "Please enter announcement text. Be advised, this announcement will be heard both on Almayer and planetside by conscious humans of selected faction.", "What?", "") as message|null if(!input) return + var/customname = input(usr, "Pick a title for the announcement. Confirm empty text for \"[choice] Update\" title.", "Title") as text|null if(isnull(customname)) return if(!customname) customname = "[choice] Update" - if(choice == "Everyone (-Yautja)") + if(choice == "All Humans") faction_announcement(input, customname, 'sound/AI/commandreport.ogg', choice) - else if(choice == FACTION_MARINE) + else if(GLOB.faction_by_name_humanoid[choice].code_identificator == FACTION_MARINE) for(var/obj/structure/machinery/computer/almayer_control/C in GLOB.machines) if(!(C.inoperable())) var/obj/item/paper/P = new /obj/item/paper(C.loc) @@ -597,9 +592,9 @@ C.messagetitle.Add("[customname]") C.messagetext.Add(P.info) if(alert("Press \"Yes\" if you want to announce it to ship crew and marines. Press \"No\" to keep it only as printed report on communication console.",,"Yes","No") == "Yes") - faction_announcement(input, customname, 'sound/AI/commandreport.ogg', factions[choice]) + faction_announcement(input, customname, 'sound/AI/commandreport.ogg', GLOB.faction_by_name_humanoid[choice]) else - faction_announcement(input, customname, 'sound/AI/commandreport.ogg', factions[choice]) + faction_announcement(input, customname, 'sound/AI/commandreport.ogg', GLOB.faction_by_name_humanoid[choice]) message_admins("[key_name_admin(src)] has created a [choice] command report") log_admin("[key_name_admin(src)] [choice] command report: [input]") @@ -613,13 +608,7 @@ to_chat(src, "Only administrators may use this command.") return - var/list/datum/faction/factions = list() - LAZYSET(factions, "All Hives", "Everyone") - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] - LAZYSET(factions, faction_to_set.name, faction_to_set) - - var/choice = tgui_input_list(usr, "Please choose the hive you want to see your announcement. Selecting \"All hives\" option will change title to \"Unknown Higher Force\"", "Hive Selection", factions) + var/choice = tgui_input_list(usr, "Please choose the hive you want to see your announcement. Selecting \"All hives\" option will change title to \"Unknown Higher Force\"", "Hive Selection", list("All Hives" = null) + GLOB.faction_by_name_xenomorphs, theme = "hive_status") if(!choice) return @@ -628,7 +617,7 @@ return if(choice != "All Hives") - xeno_announcement(input, factions[choice], SPAN_ANNOUNCEMENT_HEADER_BLUE("[factions[choice].prefix][QUEEN_MOTHER_ANNOUNCE]")) + xeno_announcement(input, GLOB.faction_by_name_xenomorphs[choice], SPAN_ANNOUNCEMENT_HEADER_BLUE("[GLOB.faction_by_name_xenomorphs[choice].prefix][QUEEN_MOTHER_ANNOUNCE]")) else xeno_announcement(input, choice, HIGHER_FORCE_ANNOUNCE) @@ -878,7 +867,10 @@ /datum/admins/var/create_xenos_html = null /datum/admins/proc/create_xenos(mob/user) if(!create_xenos_html) - var/hive_types = jointext(FACTION_LIST_XENOMORPH, ";") + var/list/factions = list() + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + factions += GLOB.faction_datums[faction_to_get].name + var/hive_types = jointext(factions, ";") var/xeno_types = jointext(ALL_XENO_CASTES, ";") create_xenos_html = file2text('html/create_xenos.html') create_xenos_html = replacetext(create_xenos_html, "null /* hive paths */", "\"[hive_types]\"") diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 75e6186755d4..03c9cc1c0403 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -814,29 +814,26 @@ message_admins("[key_name_admin(usr)] infected [key_name_admin(H)] with a ZOMBIE VIRUS") else if(href_list["larvainfect"]) if(!check_rights(R_ADMIN)) return - var/mob/living/carbon/human/H = locate(href_list["larvainfect"]) - if(!istype(H)) + var/mob/living/carbon/human/creature = locate(href_list["larvainfect"]) + if(!istype(creature)) to_chat(usr, "This can only be used on instances of type /human") return if(alert(usr, "Are you sure you want to infect them with a xeno larva?", "Message", "Yes", "No") != "Yes") return - var/list/hives = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/hive = GLOB.faction_datums[faction_to_get] - hives += list("[hive.name]" = hive.code_identificator) - - var/newhive = tgui_input_list(usr,"Select a hive.", "Infect Larva", hives) + var/choice = tgui_input_list(usr, "Select a hive.", "Infect Larva", GLOB.faction_by_name_xenomorphs, theme = "hive_status") + if(!choice) + return - if(!H) + if(!creature) to_chat(usr, "This mob no longer exists") return - var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(H) - embryo.faction_to_get = hives[newhive] + var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(creature) + embryo.faction_to_get = GLOB.faction_by_name_xenomorphs[choice].code_identificator - message_admins("[key_name_admin(usr)] infected [key_name_admin(H)] with a xeno ([newhive]) larva.") + message_admins("[key_name_admin(usr)] infected [key_name_admin(creature)] with a xeno ([choice]) larva.") else if(href_list["makemutineer"]) if(!check_rights(R_DEBUG|R_SPAWN)) @@ -865,29 +862,21 @@ to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") return - var/list/hives = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - hives[faction.name] = faction - hives["CANCEL"] = null - - var/hive_name = tgui_input_list(usr, "Which Hive will he belongs to", "Make Cultist", hives) - if(!hive_name || hive_name == "CANCEL") + var/choice = tgui_input_list(usr, "Which Hive will he belongs to", "Make Cultist", GLOB.faction_by_name_xenomorphs, theme = "hive_status") + if(!choice) to_chat(usr, SPAN_ALERT("Hive choice error. Aborting.")) - var/datum/faction/hive = hives[hive_name] - if(href_list["makecultist"]) var/datum/equipment_preset/preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/xeno_cultist] preset.load_race(H) - preset.load_status(H, hive) - message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist for [hive].") + preset.load_status(H, GLOB.faction_by_name_xenomorphs[choice]) + message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist for [GLOB.faction_by_name_xenomorphs[choice]].") else if(href_list["makecultistleader"]) var/datum/equipment_preset/preset = GLOB.gear_path_presets_list[/datum/equipment_preset/other/xeno_cultist/leader] preset.load_race(H) - preset.load_status(H, hive) - message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist leader for [hive].") + preset.load_status(H, GLOB.faction_by_name_xenomorphs[choice]) + message_admins("[key_name_admin(usr)] has made [key_name_admin(H)] into a cultist leader for [GLOB.faction_by_name_xenomorphs[choice]].") else if(href_list["forceemote"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/topic/topic_events.dm b/code/modules/admin/topic/topic_events.dm index f91052d49475..3be289672448 100644 --- a/code/modules/admin/topic/topic_events.dm +++ b/code/modules/admin/topic/topic_events.dm @@ -108,13 +108,16 @@ if(isnull(permit_recipients[1])) //Cancel button. return if("Hive") - permit_hives += GLOB.faction_datums[tgui_input_list(usr, "Select recipient hive:", "Armed Hive", FACTION_LIST_XENOMORPH)] + var/choice = tgui_input_list(usr, "Select recipient hive:", "Armed Hive", GLOB.faction_by_name_xenomorphs) + if(!choice) + return + permit_hives += GLOB.faction_by_name_xenomorphs[choice] if(isnull(permit_hives[1])) //Cancel button. return permit_recipients = permit_hives[1].total_mobs.Copy() if("All Xenos") permit_recipients = GLOB.living_xeno_list.Copy() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) permit_hives += GLOB.faction_datums[faction_to_get] var/list/handled_xenos = list() @@ -336,7 +339,7 @@ var/mob/living/carbon/xenomorph/X for(var/i = 0 to xenos_to_spawn - 1) spawn_turf = pick(turfs) - X = new caste_type(spawn_turf, null, xeno_hive) + X = new caste_type(spawn_turf, null, GLOB.faction_by_name_xenomorphs[xeno_hive]) if(!X.hud_used) X.create_hud() diff --git a/code/modules/admin/topic/topic_teleports.dm b/code/modules/admin/topic/topic_teleports.dm index 8a5e3596db7f..870269a9a7b4 100644 --- a/code/modules/admin/topic/topic_teleports.dm +++ b/code/modules/admin/topic/topic_teleports.dm @@ -98,7 +98,7 @@ if("teleport_mobs_by_faction") var/list/datum/faction/factions = list() - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] LAZYSET(factions, faction_to_set.name, faction_to_set) diff --git a/code/modules/admin/verbs/mob_verbs.dm b/code/modules/admin/verbs/mob_verbs.dm index 3ec2d299f06d..223f67ef43c3 100644 --- a/code/modules/admin/verbs/mob_verbs.dm +++ b/code/modules/admin/verbs/mob_verbs.dm @@ -338,7 +338,7 @@ return var/list/datum/faction/factions = list() - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction_to_set = GLOB.faction_datums[faction_to_get] LAZYSET(factions, faction_to_set.name, faction_to_set) diff --git a/code/modules/admin/verbs/select_equipment.dm b/code/modules/admin/verbs/select_equipment.dm index 2ff649c6eeed..30bd5a7104fe 100644 --- a/code/modules/admin/verbs/select_equipment.dm +++ b/code/modules/admin/verbs/select_equipment.dm @@ -33,10 +33,11 @@ if(rankpath) var/obj/item/clothing/accessory/ranks/R = new rankpath() C.attach_accessory(H, R) - var/new_faction = tgui_input_list(usr, "Select faction.", "Faction Choice", FACTION_LIST_HUMANOID) - if(!new_faction) - new_faction = FACTION_NEUTRAL - H.faction = new_faction + var/choice = tgui_input_list(usr, "Select faction.", "Faction Choice", GLOB.faction_by_name_humanoid) + if(!choice) + GLOB.faction_datums[FACTION_NEUTRAL].add_mob(H) + else + GLOB.faction_by_name_humanoid[choice].add_mob(H) else switch(newrank) if("Weyland-Yutani") @@ -81,10 +82,11 @@ I.assignment = IDtitle I.name = "[I.registered_name]'s [I.id_type] ([I.assignment])" - var/new_faction = tgui_input_list(usr, "Select faction.", "Faction Choice", FACTION_LIST_HUMANOID) - if(!new_faction) - new_faction = FACTION_NEUTRAL - H.faction = new_faction + var/choice = tgui_input_list(usr, "Select faction.", "Faction Choice", GLOB.faction_by_name_humanoid) + if(!choice) + GLOB.faction_datums[FACTION_NEUTRAL].add_mob(H) + else + GLOB.faction_by_name_humanoid[choice].add_mob(H) var/newskillset = tgui_input_list(usr, "Select a skillset", "Skill Set", GLOB.RoleAuthority.roles_by_name) if(!newskillset) diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index 44830827ea2b..df76ccb6cd88 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -893,14 +893,14 @@ /obj/effect/alien/resin/king_cocoon/Destroy() if(!hatched) faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP IN [uppertext(get_area_name(loc))] HAS BEEN STOPPED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] - if(!length(cur_faction.total_mobs)) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(cur_faction == faction) - xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED! VENGEANCE!"), cur_faction, XENO_GENERAL_ANNOUNCE) + if(check_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED! VENGEANCE!"), check_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED!"), cur_faction, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("THE HATCHERY WAS DESTROYED!"), check_faction, XENO_GENERAL_ANNOUNCE) var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.has_hatchery = FALSE @@ -929,14 +929,14 @@ addtimer(CALLBACK(src, PROC_REF(check_pylons)), 10 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME|TIMER_LOOP) faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 10 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] - if(!length(cur_faction.total_mobs)) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(cur_faction == faction) - xeno_announcement(SPAN_XENOANNOUNCE("The King is growing at [get_area_name(loc)]. Protect it at all costs!"), cur_faction, XENO_GENERAL_ANNOUNCE) + if(check_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("The King is growing at [get_area_name(loc)]. Protect it at all costs!"), check_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King is growing at [get_area_name(loc)]."), cur_faction, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King is growing at [get_area_name(loc)]."), check_faction, XENO_GENERAL_ANNOUNCE) /// Callback for a repeating 10s timer to ensure both pylons are active (otherwise delete) and counts the number of marines groundside (would cause hatching to expedite). /obj/effect/alien/resin/king_cocoon/proc/check_pylons() @@ -977,14 +977,14 @@ timer = addtimer(CALLBACK(src, PROC_REF(start_vote)), 4 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [uppertext(get_area_name(loc))].\n\nESTIMATED TIME UNTIL COMPLETION - 5 MINUTES.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] - if(!length(cur_faction.total_mobs)) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(cur_faction == faction) - xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately 5 minutes."), cur_faction, XENO_GENERAL_ANNOUNCE) + if(check_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately 5 minutes."), check_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately 5 minutes."), cur_faction, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately 5 minutes."), check_faction, XENO_GENERAL_ANNOUNCE) #define KING_PLAYTIME_HOURS (50 HOURS) @@ -1146,14 +1146,14 @@ return faction_announcement("ALERT.\n\nUNUSUAL ENERGY BUILDUP DETECTED IN [get_area_name(loc)].\n\nESTIMATED TIME UNTIL COMPLETION - ONE MINUTE.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] - if(!length(cur_faction.total_mobs)) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(cur_faction == faction) - xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately one minute."), cur_faction, XENO_GENERAL_ANNOUNCE) + if(check_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("The King will hatch in approximately one minute."), check_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately one minute."), cur_faction, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King will hatch in approximately one minute."), check_faction, XENO_GENERAL_ANNOUNCE) timer = addtimer(CALLBACK(src, PROC_REF(animate_hatch_king)), 1 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) @@ -1163,14 +1163,14 @@ addtimer(CALLBACK(src, PROC_REF(hatch_king)), 2 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE) faction_announcement("ALERT.\n\nEXTREME ENERGY INFLUX DETECTED IN [get_area_name(loc)].\n\nCAUTION IS ADVISED.", "[MAIN_AI_SYSTEM] Biological Scanner", 'sound/misc/notice1.ogg') - for(var/faction_to_get in FACTION_LIST_XENOMORPH) - var/datum/faction/cur_faction = GLOB.faction_datums[faction_to_get] - if(!length(cur_faction.total_mobs)) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) + var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] + if(!length(check_faction.total_mobs)) continue - if(cur_faction == faction) - xeno_announcement(SPAN_XENOANNOUNCE("All hail the King."), cur_faction, XENO_GENERAL_ANNOUNCE) + if(check_faction == faction) + xeno_announcement(SPAN_XENOANNOUNCE("All hail the King."), check_faction, XENO_GENERAL_ANNOUNCE) else - xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King has hatched!"), cur_faction, XENO_GENERAL_ANNOUNCE) + xeno_announcement(SPAN_XENOANNOUNCE("Another hive's King has hatched!"), check_faction, XENO_GENERAL_ANNOUNCE) /// Actually hatches the King transferring the candidate into the spawned mob and initiates the next timer. /obj/effect/alien/resin/king_cocoon/proc/hatch_king() diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index c8b5a1964bed..55a4485b4c8c 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -171,7 +171,7 @@ faction_announcement("ALERT.\n\nEnergy build up around communication relay at [get_area_name(src)] halted.", "[MAIN_AI_SYSTEM] Biological Scanner") - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] if(!length(check_faction.total_mobs)) continue @@ -187,7 +187,7 @@ /obj/effect/alien/resin/special/pylon/endgame/proc/comms_relay_connection() faction_announcement("ALERT.\n\nIrregular build up of energy around communication relays at [get_area_name(src)], biological hazard detected.\n\nDANGER: Hazard is strengthening xenomorphs, advise urgent termination of hazard by ground forces.", "[MAIN_AI_SYSTEM] Biological Scanner") - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/check_faction = GLOB.faction_datums[faction_to_get] if(!length(check_faction.total_mobs)) continue diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 0d7085a2c3bc..b14125bd2036 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -883,27 +883,29 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc = "Check the status of the hive." set category = "Ghost.View" - var/list/datum/faction/hives = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + var/list/datum/faction/factions = list() + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] if(!length(faction.total_mobs)) continue - hives[faction.name] = faction + factions[faction.name] = faction - if(!length(hives)) + if(!length(factions)) to_chat(src, SPAN_ALERT("There seem to be no living hives at the moment")) return - else if(length(hives) == 1) // Only one hive, don't need an input menu for that - var/datum/faction_module/hive_mind/faction_module = hives[1].get_faction_module(FACTION_MODULE_HIVE_MIND) - faction_module.hive_ui.open_hive_status(src) + + var/datum/faction_module/hive_mind/faction_module + if(length(factions) == 1) // Only one hive, don't need an input menu for that + faction_module = factions[factions[1]].get_faction_module(FACTION_MODULE_HIVE_MIND) else - var/selected_hive = tgui_input_list(src, "Select which hive status menu to open up", "Hive Choice", hives, theme="hive_status") - if(!selected_hive) + var/choice = tgui_input_list(src, "Select which hive status menu to open up", "Hive Choice", factions, theme = "hive_status") + if(!choice) to_chat(src, SPAN_ALERT("Hive choice error. Aborting.")) return - var/datum/faction_module/hive_mind/faction_module = hives[selected_hive].get_faction_module(FACTION_MODULE_HIVE_MIND) - faction_module.hive_ui.open_hive_status(src) + faction_module = factions[choice].get_faction_module(FACTION_MODULE_HIVE_MIND) + + faction_module.hive_ui.open_hive_status(src) /mob/dead/observer/verb/view_uscm_tacmap() set name = "View USCM Tacmap" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 2305d54ed47c..22e4a3c1d5ed 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -53,7 +53,7 @@ /proc/update_living_queens() // needed to update when you change a queen to a different hive outer_loop: - for(var/faction_to_get in FACTION_LIST_ALL) + for(var/faction_to_get in GLOB.faction_datums) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.living_xeno_queen) diff --git a/code/modules/mob/living/carbon/xenomorph/hive_faction.dm b/code/modules/mob/living/carbon/xenomorph/hive_faction.dm index 879204821fd2..4b0226887fe0 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_faction.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_faction.dm @@ -9,7 +9,7 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions()) var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] .["Xenomorph"] += hive.internal_faction - .["Human"] = FACTION_LIST_HUMANOID + .["Human"] = GLOB.FACTION_LIST_HUMANOID .["Raw"] = .["Human"] + .["Xenomorph"] diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index cd517b3f3388..2236e3405978 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -153,7 +153,7 @@ if(latejoin_larva_drop && SSticker.mode.latejoin_tally - SSticker.mode.latejoin_larva_used >= latejoin_larva_drop) SSticker.mode.latejoin_larva_used += latejoin_larva_drop - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) if(faction_module.latejoin_burrowed == TRUE) diff --git a/code/modules/reagents/chemistry_properties/prop_special.dm b/code/modules/reagents/chemistry_properties/prop_special.dm index 9292070bcc56..db936cf88495 100644 --- a/code/modules/reagents/chemistry_properties/prop_special.dm +++ b/code/modules/reagents/chemistry_properties/prop_special.dm @@ -97,14 +97,14 @@ max_level = 6 /datum/chem_property/special/ciphering/process(mob/living/M, potency = 1, delta_time) - if(!GLOB.faction_datums[FACTION_LIST_XENOMORPH[level]]) // This should probably always be valid + if(!GLOB.faction_datums[GLOB.FACTION_LIST_XENOMORPH[level]]) // This should probably always be valid return for(var/content in M.contents) if(!istype(content, /obj/item/alien_embryo)) continue var/obj/item/alien_embryo/embryo = content - embryo.faction_to_get = FACTION_LIST_XENOMORPH[level] + embryo.faction_to_get = GLOB.FACTION_LIST_XENOMORPH[level] /datum/chem_property/special/ciphering/predator name = PROPERTY_CIPHERING_PREDATOR @@ -121,14 +121,14 @@ if(amount < 10) return - if((E.flags_embryo & FLAG_EMBRYO_PREDATOR) && E.faction_to_get == FACTION_LIST_XENOMORPH[level]) + if((E.flags_embryo & FLAG_EMBRYO_PREDATOR) && E.faction_to_get == GLOB.FACTION_LIST_XENOMORPH[level]) return E.visible_message(SPAN_DANGER("\the [E] rapidly mutates")) playsound(E, 'sound/effects/attackblob.ogg', 25, TRUE) - E.faction_to_get = FACTION_LIST_XENOMORPH[level] + E.faction_to_get = GLOB.FACTION_LIST_XENOMORPH[level] set_hive_data(E, GLOB.faction_datums[E.faction_to_get]) E.flags_embryo |= FLAG_EMBRYO_PREDATOR @@ -166,7 +166,7 @@ return for(var/i=1,i<=max((level % 100)/10,1),i++)//10's determine number of embryos var/obj/item/alien_embryo/embryo = new /obj/item/alien_embryo(H) - embryo.faction_to_get = FACTION_LIST_XENOMORPH[min(level % 10, 5)] + embryo.faction_to_get = GLOB.FACTION_LIST_XENOMORPH[min(level % 10, 5)] /datum/chem_property/special/transforming name = PROPERTY_TRANSFORMING diff --git a/code/modules/tgui/states/xeno.dm b/code/modules/tgui/states/xeno.dm index 4e01a244aa86..a7f141041f74 100644 --- a/code/modules/tgui/states/xeno.dm +++ b/code/modules/tgui/states/xeno.dm @@ -9,7 +9,7 @@ GLOBAL_LIST_INIT(hive_state, setup_hive_states()) /proc/setup_hive_states() . = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] .[faction.code_identificator] = new/datum/ui_state/hive_state(faction) @@ -37,7 +37,7 @@ GLOBAL_LIST_INIT(hive_state_queen, setup_hive_queen_states()) /proc/setup_hive_queen_states() . = list() - for(var/faction_to_get in FACTION_LIST_XENOMORPH) + for(var/faction_to_get in GLOB.FACTION_LIST_XENOMORPH) var/datum/faction/faction = GLOB.faction_datums[faction_to_get] .[faction.code_identificator] = new/datum/ui_state/hive_state/queen(faction) diff --git a/code/modules/vox/vox_tgui.dm b/code/modules/vox/vox_tgui.dm index 9ce329f43e0d..48f362f04b7f 100644 --- a/code/modules/vox/vox_tgui.dm +++ b/code/modules/vox/vox_tgui.dm @@ -18,7 +18,7 @@ GLOBAL_DATUM_INIT(vox_panel, /datum/vox_panel_tgui, new) /datum/vox_panel_tgui/ui_static_data(mob/user) . = list() .["glob_vox_types"] = GLOB.vox_types - .["factions"] = FACTION_LIST_HUMANOID + .["factions"] = GLOB.FACTION_LIST_HUMANOID /datum/vox_panel_tgui/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() @@ -40,11 +40,13 @@ GLOBAL_DATUM_INIT(vox_panel, /datum/vox_panel_tgui, new) var/list/vox = GLOB.vox_types[params["vox_type"]] var/message = "[params["message"]]" // Sanitize by converting into a string - var/list/to_play_to = list() - for(var/i in GLOB.player_list) - var/mob/M = i - if(M.stat == DEAD || (M.faction in factions)) - to_play_to |= M.client + var/list/to_play_to = GLOB.observer_list.Copy() + for(var/faction_to_get in factions) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + for(var/mob/creature in faction.total_mobs) + if(!creature.client) + continue + to_play_to += creature.client play_sound_vox(message, to_play_to, vox, usr.client, text2num(params["volume"])) var/factions_string = factions.Join(", ") diff --git a/maps/templates/basetwo.dmm b/maps/templates/basetwo.dmm index c4eaba0906df..e92a3d6fadbb 100644 --- a/maps/templates/basetwo.dmm +++ b/maps/templates/basetwo.dmm @@ -901,7 +901,7 @@ /area/adminlevel/bunker01/hydroponics) "dg" = ( /obj/effect/alien/weeds/node/pylon/core{ - hivenumber = "xeno_hive_alpha" + faction_to_get = "alpzen" }, /turf/open/mars_cave, /area/adminlevel/bunker01/caves/xeno) From 1072d9ef2f14e712b207850c08e23fa39556a028 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Sat, 25 Jan 2025 13:58:03 +0500 Subject: [PATCH 16/24] some local test issues, stop bothering me! just work! --- code/game/gamemodes/cm_process.dm | 4 ++-- code/game/machinery/computer/groundside_operations.dm | 2 +- code/game/machinery/cryopod.dm | 4 ++-- code/game/objects/items/devices/motion_detector.dm | 2 +- code/game/objects/items/explosives/grenades/marines.dm | 2 +- code/game/objects/items/explosives/mine.dm | 6 +++--- code/modules/assembly/proximity.dm | 2 +- code/modules/cm_marines/radar.dm | 2 +- code/modules/cm_preds/smartdisc.dm | 2 +- code/modules/defenses/bell_tower.dm | 4 ++-- code/modules/maptext_alerts/text_blurbs.dm | 4 ++-- code/modules/mob/dead/observer/orbit.dm | 6 +++--- code/modules/mob/living/carbon/human/human.dm | 4 ++-- .../mob/living/carbon/xenomorph/castes/Hellhound.dm | 2 +- code/modules/projectiles/guns/smartgun.dm | 8 ++++---- code/modules/vehicles/souto_mobile.dm | 2 +- maps/map_files/BigRed/sprinkles/5.eta_carp.dmm | 2 +- maps/map_files/CORSAT/Corsat.dmm | 2 +- maps/templates/baseone.dmm | 2 +- maps/templates/lazy_templates/fax_responder_base.dmm | 2 +- 20 files changed, 32 insertions(+), 32 deletions(-) diff --git a/code/game/gamemodes/cm_process.dm b/code/game/gamemodes/cm_process.dm index 283084ae1e1a..4376a4f87d20 100644 --- a/code/game/gamemodes/cm_process.dm +++ b/code/game/gamemodes/cm_process.dm @@ -225,9 +225,9 @@ GLOBAL_VAR_INIT(next_admin_bioscan, 30 MINUTES) for(var/i in GLOB.alive_human_list) var/mob/M = i if(M.z && (M.z in z_levels) && !istype(M.loc, /turf/open/space) && !istype(M.loc, /area/adminlevel/ert_station/fax_response_station)) - if(M.faction in FACTION_LIST_WY) + if(M.faction.code_identificator in FACTION_LIST_WY) num_pmcs++ - else if(M.faction == FACTION_MARINE) + else if(M.faction.code_identificator == FACTION_MARINE) num_marines++ return list(num_marines,num_pmcs) diff --git a/code/game/machinery/computer/groundside_operations.dm b/code/game/machinery/computer/groundside_operations.dm index c4017a7e0673..0e0890acfe67 100644 --- a/code/game/machinery/computer/groundside_operations.dm +++ b/code/game/machinery/computer/groundside_operations.dm @@ -242,7 +242,7 @@ if(!is_announcement_active) to_chat(usr, SPAN_WARNING("Please allow at least [COOLDOWN_COMM_MESSAGE*0.1] second\s to pass between announcements.")) return FALSE - if(announcement_faction != FACTION_MARINE && usr.faction != GLOB.faction_datums[announcement_faction]) + if(announcement_faction != FACTION_MARINE && usr.faction.code_identificator != announcement_faction) to_chat(usr, SPAN_WARNING("Access denied.")) return var/input = stripped_multiline_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement", "") diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 8a5655138535..ac5ac03faa02 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -244,7 +244,7 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li dept_console = GLOB.frozen_items["Eng"] - if(cryo_human.faction != FACTION_MARINE) + if(cryo_human.faction.code_identificator != FACTION_MARINE) dept_console = GLOB.frozen_items[cryo_human.faction] if(cryo_human.job in FAX_RESPONDER_JOB_LIST) @@ -565,7 +565,7 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li return TRUE if(no_store_pod) return TRUE - if(occupant.faction != FACTION_MARINE) + if(occupant.faction.code_identificator != FACTION_MARINE) return TRUE return FALSE diff --git a/code/game/objects/items/devices/motion_detector.dm b/code/game/objects/items/devices/motion_detector.dm index 6526e0091803..e908347b4146 100644 --- a/code/game/objects/items/devices/motion_detector.dm +++ b/code/game/objects/items/devices/motion_detector.dm @@ -224,7 +224,7 @@ var/mob/living/M = A //do this to skip the unnecessary istype() check; everything in ping_candidate is a mob already if(M == loc) continue //device user isn't detected if(world.time > M.l_move_time + 20) continue //hasn't moved recently - if(M.ally_faction(iff_signal)) + if(M.ally_faction(GLOB.faction_datums[iff_signal])) continue apply_debuff(M) diff --git a/code/game/objects/items/explosives/grenades/marines.dm b/code/game/objects/items/explosives/grenades/marines.dm index c3b334fbf19c..124f9b9496fa 100644 --- a/code/game/objects/items/explosives/grenades/marines.dm +++ b/code/game/objects/items/explosives/grenades/marines.dm @@ -541,7 +541,7 @@ SPAN_NOTICE("You finish deploying [src].")) var/obj/item/explosive/mine/sebb/planted = new /obj/item/explosive/mine/sebb(get_turf(user)) planted.activate_sensors() - planted.iff_signal = user.faction // assuring IFF is set + planted.iff_signal = user.faction.code_identificator // assuring IFF is set planted.pixel_x += rand(-5, 5) planted.pixel_y += rand(-5, 5) qdel(src) diff --git a/code/game/objects/items/explosives/mine.dm b/code/game/objects/items/explosives/mine.dm index dd59907441b6..4cf169dd5b91 100644 --- a/code/game/objects/items/explosives/mine.dm +++ b/code/game/objects/items/explosives/mine.dm @@ -117,7 +117,7 @@ if(active) if(user.action_busy) return - if(user.faction == iff_signal) + if(user.faction.code_identificator == iff_signal) user.visible_message(SPAN_NOTICE("[user] starts disarming [src]."), \ SPAN_NOTICE("You start disarming [src].")) else @@ -127,7 +127,7 @@ user.visible_message(SPAN_WARNING("[user] stops disarming [src]."), \ SPAN_WARNING("You stop disarming [src].")) return - if(user.faction != iff_signal) //ow! + if(user.faction.code_identificator != iff_signal) //ow! if(prob(75)) triggered = TRUE if(tripwire) @@ -205,7 +205,7 @@ return if(L.stat == DEAD) return - if(L.ally_faction(iff_signal)) + if(L.ally_faction(GLOB.faction_datums[iff_signal])) return if(HAS_TRAIT(L, TRAIT_ABILITY_BURROWED)) return diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index a34098a379dc..35fc5a9c5670 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -70,7 +70,7 @@ if(scanning) var/turf/mainloc = get_turf(src) for(var/mob/living/M in range(range,mainloc)) - if(M.ally_faction(iff_signal)) + if(M.ally_faction(GLOB.faction_datums[iff_signal])) continue HasProximity(M) diff --git a/code/modules/cm_marines/radar.dm b/code/modules/cm_marines/radar.dm index e2f0e3c7715f..f3d6a79dab8d 100644 --- a/code/modules/cm_marines/radar.dm +++ b/code/modules/cm_marines/radar.dm @@ -228,7 +228,7 @@ if(!humanoid || !istype(humanoid)) return FALSE if(..()) - if(humanoid.faction != faction) + if(humanoid.faction.code_identificator != faction) return FALSE if(istype(humanoid.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/uniform = humanoid.w_uniform diff --git a/code/modules/cm_preds/smartdisc.dm b/code/modules/cm_preds/smartdisc.dm index 15a1f7ef0fbd..20a4210e1e99 100644 --- a/code/modules/cm_preds/smartdisc.dm +++ b/code/modules/cm_preds/smartdisc.dm @@ -148,7 +148,7 @@ break_stuff_probability = 0 destroy_surroundings = 0 - faction = FACTION_YAUTJA + faction_to_get = FACTION_YAUTJA var/lifetime = 8 //About 15 seconds. var/time_idle = 0 diff --git a/code/modules/defenses/bell_tower.dm b/code/modules/defenses/bell_tower.dm index a22de7491a2f..0a9f70f79cdf 100644 --- a/code/modules/defenses/bell_tower.dm +++ b/code/modules/defenses/bell_tower.dm @@ -162,11 +162,11 @@ /obj/structure/machinery/defenses/bell_tower/md/setup_tripwires() md = new(src) md.linked_tower = src - md.iff_signal = faction + md.iff_signal = faction.code_identificator md.toggle_active(null, FALSE) if(!md.iff_signal) - md.iff_signal = GLOB.faction_datums[FACTION_MARINE] + md.iff_signal = FACTION_MARINE /obj/structure/machinery/defenses/bell_tower/md/clear_tripwires() if(md) diff --git a/code/modules/maptext_alerts/text_blurbs.dm b/code/modules/maptext_alerts/text_blurbs.dm index 297b02aff3a3..3f8d1cad33f3 100644 --- a/code/modules/maptext_alerts/text_blurbs.dm +++ b/code/modules/maptext_alerts/text_blurbs.dm @@ -42,8 +42,8 @@ base = the base the marines are staging from. The ship, Whiskey Outpost etc. Non "cl" = list(), "misc" = list()) - for(var/mob/living/carbon/human/H as anything in GLOB.alive_human_list) - if(H.faction != FACTION_MARINE || (H.z in exempt_zlevels)) + for(var/mob/living/carbon/human/H as anything in GLOB.faction_datums[FACTION_MARINE].total_mobs) + if(H.z in exempt_zlevels) continue switch(H.job) if(BLURB_USCM_COMBAT) diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index f640cf5bcba8..f83aebb7812a 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -153,9 +153,9 @@ in_thunderdome += list(serialized) else if(human.job in FAX_RESPONDER_JOB_LIST) responders += list(serialized) - else if(SSticker.mode.is_in_endgame == TRUE && !is_mainship_level(human.z) && !(human.faction in FACTION_LIST_ERT_ALL) && !(isyautja(human))) + else if(SSticker.mode.is_in_endgame == TRUE && !is_mainship_level(human.z) && !(human.faction.code_identificator in FACTION_LIST_ERT_ALL) && !(isyautja(human))) escaped += list(serialized) - else if(human.faction in FACTION_LIST_WY) + else if(human.faction.code_identificator in FACTION_LIST_WY) wy += list(serialized) else if(issynth(human) && !isinfiltratorsynthetic(human)) synthetics += list(serialized) @@ -181,7 +181,7 @@ marshal += list(serialized) else if(human.faction.code_identificator == FACTION_DUTCH) dutch += list(serialized) - else if(human.faction in FACTION_MARINE) + else if(human.faction.code_identificator == FACTION_MARINE) marines += list(serialized) else if(issurvivorjob(human.job)) survivors += list(serialized) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 99d1dd29879a..041ba5ba3f70 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1061,7 +1061,7 @@ set name = "View Crew Manifest" set category = "IC" - if(faction != FACTION_MARINE && !((faction in FACTION_LIST_WY) || faction == FACTION_FAX)) + if(faction.code_identificator != FACTION_MARINE && !((faction.code_identificator in FACTION_LIST_WY) || faction.code_identificator == FACTION_FAX)) to_chat(usr, SPAN_WARNING("You have no access to [MAIN_SHIP_NAME] crew manifest.")) return GLOB.crew_manifest.open_ui(src) @@ -1074,7 +1074,7 @@ to_chat(src, "The game appears to have misplaced your mind datum.") return - if(!skillcheck(usr, SKILL_INTEL, SKILL_INTEL_TRAINED) || faction != FACTION_MARINE && !(faction in FACTION_LIST_WY)) + if(!skillcheck(usr, SKILL_INTEL, SKILL_INTEL_TRAINED) || faction.code_identificator != FACTION_MARINE && !(faction.code_identificator in FACTION_LIST_WY)) to_chat(usr, SPAN_WARNING("You have no access to the [MAIN_SHIP_NAME] intel network.")) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm index e2ce5159bd01..b1b05cdb50ff 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm @@ -75,7 +75,7 @@ weed_food_states_flipped = list("Hellhound_1","Hellhound_2","Hellhound_3") /mob/living/carbon/xenomorph/hellhound/Initialize(mapload, mob/living/carbon/xenomorph/old_xeno, datum/faction/faction_to_set) - . = ..(mapload, old_xeno, faction_to_set || FACTION_XENOMORPH_YAUTJA) + . = ..(mapload, old_xeno, faction_to_set || GLOB.faction_datums[FACTION_XENOMORPH_YAUTJA]) set_languages(list(LANGUAGE_HELLHOUND, LANGUAGE_YAUTJA)) diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index 5c9549b7f53c..68c514c8cce2 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -770,7 +770,7 @@ /obj/item/weapon/gun/smartgun/dirty/Initialize(mapload, ...) . = ..() - MD.iff_signal = FACTION_PMC + MD.iff_signal =GLOB.faction_datums[FACTION_PMC] //TERMINATOR SMARTGUN /obj/item/weapon/gun/smartgun/dirty/elite @@ -779,7 +779,7 @@ /obj/item/weapon/gun/smartgun/dirty/elite/Initialize(mapload, ...) . = ..() - MD.iff_signal = FACTION_WY_DEATHSQUAD + MD.iff_signal = GLOB.faction_datums[FACTION_WY_DEATHSQUAD] /obj/item/weapon/gun/smartgun/dirty/elite/set_gun_config_values() ..() @@ -801,7 +801,7 @@ /obj/item/weapon/gun/smartgun/clf/Initialize(mapload, ...) . = ..() - MD.iff_signal = FACTION_CLF + MD.iff_signal = GLOB.faction_datums[FACTION_CLF] /obj/item/weapon/gun/smartgun/admin requires_power = FALSE @@ -854,4 +854,4 @@ /obj/item/weapon/gun/smartgun/rmc/Initialize(mapload, ...) . = ..() - MD.iff_signal = FACTION_TWE + MD.iff_signal = GLOB.faction_datums[FACTION_TWE] diff --git a/code/modules/vehicles/souto_mobile.dm b/code/modules/vehicles/souto_mobile.dm index 29c066601a93..2eee3f882fff 100644 --- a/code/modules/vehicles/souto_mobile.dm +++ b/code/modules/vehicles/souto_mobile.dm @@ -37,7 +37,7 @@ /obj/vehicle/souto/super/buckle_mob(mob/M, mob/user) if(!locked) //Vehicle is unlocked until first being mounted, since the Soutomobile is faction-locked and otherwise Souto Man cannot automatically buckle in on spawn as his equipment is spawned before his ID. locked = TRUE - else if(M == user && M.faction != FACTION_SOUTO && locked == TRUE) //Are you a cool enough dude to drive this bike? Nah, nobody's THAT cool. + else if(M == user && M.faction.code_identificator != FACTION_SOUTO && locked == TRUE) //Are you a cool enough dude to drive this bike? Nah, nobody's THAT cool. to_chat(user, SPAN_WARNING("Somehow, as you take hold of the handlebars, [src] manages to glare at you. You back off. We didn't sign up for haunted motorbikes, man.")) return ..() diff --git a/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm b/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm index 1eb6721d1602..d1edb9d2a3ea 100644 --- a/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm +++ b/maps/map_files/BigRed/sprinkles/5.eta_carp.dmm @@ -83,7 +83,7 @@ /area/bigredv2/caves/eta/xenobiology) "t" = ( /mob/living/simple_animal/hostile/carp{ - faction = "nfo"; + faction_to_get = "nfo"; name = "strange fish" }, /turf/open/ice, diff --git a/maps/map_files/CORSAT/Corsat.dmm b/maps/map_files/CORSAT/Corsat.dmm index 21851d3db515..0e812f913398 100644 --- a/maps/map_files/CORSAT/Corsat.dmm +++ b/maps/map_files/CORSAT/Corsat.dmm @@ -1735,7 +1735,7 @@ "agX" = ( /mob/living/simple_animal/hostile/carp{ color = "orange"; - faction = "nfo"; + faction_to_get = "nfo"; harm_intent_damage = 0; melee_damage_lower = 0; melee_damage_upper = 0 diff --git a/maps/templates/baseone.dmm b/maps/templates/baseone.dmm index 3f4dc9627c8a..74a36e10ec4f 100644 --- a/maps/templates/baseone.dmm +++ b/maps/templates/baseone.dmm @@ -739,7 +739,7 @@ /mob/living/simple_animal/chicken{ desc = "A chubby and friendly chicken, often sticking to the person being on kitchen duty. She looks somewhat lonely."; emote_see = list("pecks at the ground","flaps its wings","clucks happily"); - faction = "upp"; + faction_to_get = "upp"; name = "\improper Charlie"; voice_name = "chicken" }, diff --git a/maps/templates/lazy_templates/fax_responder_base.dmm b/maps/templates/lazy_templates/fax_responder_base.dmm index 494cca077b42..9f492ccbf1c9 100644 --- a/maps/templates/lazy_templates/fax_responder_base.dmm +++ b/maps/templates/lazy_templates/fax_responder_base.dmm @@ -4320,7 +4320,7 @@ "TI" = ( /mob/living/simple_animal/hostile/carp{ destroy_surroundings = 0; - faction = "fax"; + faction_to_get = "fax"; name = "Gary" }, /turf/open/space/basic, From 7589e01ce1f3249928cb044eee5cb42a65f02f98 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Sat, 25 Jan 2025 14:39:35 +0500 Subject: [PATCH 17/24] fix? --- code/datums/factions/faction.dm | 1 + code/datums/factions/iff_tag.dm | 2 +- icons/obj/items/Marine_Research.dmi | Bin 4324 -> 4052 bytes 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index dd9ac524d55c..8c70b1dd68b1 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -88,6 +88,7 @@ if(hard) creature.faction = null + total_dead_mobs -= creature else total_dead_mobs |= creature diff --git a/code/datums/factions/iff_tag.dm b/code/datums/factions/iff_tag.dm index ed50668797f6..3ef407d63d2d 100644 --- a/code/datums/factions/iff_tag.dm +++ b/code/datums/factions/iff_tag.dm @@ -91,7 +91,7 @@ DEFINE_BITFIELD(iff_flag_flags, list( /obj/item/faction_tag/organ name = "Sticky Gland" desc = "Strange organic object, that somehow help to be indentificated." - icon_state = "gland_tag" +// icon_state = "gland_tag" tag_flags = ORGAN_TAG /obj/item/faction_tag/organ/zombie diff --git a/icons/obj/items/Marine_Research.dmi b/icons/obj/items/Marine_Research.dmi index 1b7623440f4dadaf6b77c07f309b28fc0f881321..678a7735cb8ca46f99864407e3fcdd45b21a9e95 100644 GIT binary patch literal 4052 zcmaJ^XE+-S*S7ZviYi)r*B&iu?^SA3TTz;zVpS;GY7{Zrsy(YTK{Sd->=I&Cqp2cd zgxa*!9`X6}zTfx0KfWL5oahHQ4j^hcknR5k62usPQe| zp+^Ifa)rMDwYRy#I0QNB)>8R~*%BE$vKg$OW_~qx_s>Jk)T%$tQBH4c$HyFd3aPZo zw(v;IpK#?@i&z5PnZXwk8-@OeLh!MDJj=T{=G-UIljNBd-s^}y+8Xd-5(NcYxw(

{#15558RW*)^|GpZDdw_@I9+QD|o+I=)j<$!0tIQTE&2~*8yRrYoR&Gv!d zA|9~+dyD)D3KGIF9#Fw!Yo^D*WPnHnWYbterOabgsenqv3&y$8slv8G;^|~#^xyM< z`jwK1-`mj(m|SvjFfZk{Y06EikQyqrcZPr1qN zP)!lHLk#i?+nU^P>lpkEJd4wcd&gBWK_iPryO!9WO$6U14KQ;_S_SVMHh|9EyvX^L zJOKX>(QL7`K^TLbx~*YG*1l^+xw40iIcUBudVUxm5JT_9l`2yzLrgEHtq5F6GyYxg z(YLTD*_ZwLf=zQ~{;8URl@Y}B%tsR+ z4Fi)hloysZ^+_cQm6wI-HGwXFU2jXhp(ytAlT7`{hyXCtgKnbfu$utl(UF^WbKGmW zUuyT2_4FKCOuu9?ChIq!oQPHkwb<@ij9v+ukmt1YDwedw<6w)o*jL)5h0zXBH3>iH z8&;1$H-1Ao>8`wC#2i~eL3wDR3%E-w zx|Sy{Iut-npZR*cs`@Z=`UxvQ?Z;^!EOU-SP3;uJ-TUDccPQDZ=yt@=ehAc(QT!6AmnqZP-Uy3e|HiQ*6Ro z;8igK<@09{umH-ywtY4u&;b1LaOQF86-tsYA>XuT9-sdj1*tlEV5;P}ri_Y%X8%kF zh*A+00(9g8(hKI+H=IEpQlQhRj9s-DWEkf(4}fKikMo|9f)HaP3X~g(H62T)p_6Iz zNH^crmw7~iDkp5^7YW1g&Z+CuLuHHLPIn_^rV?%M&oj}QOinN2PIind;G|)_4fVyC zi|$g_T08YeBP4iNj)d*6Gzy_+YyUp3xW9K+Tp!To64~Q~`Ye%U4|zv9`iw&b3(IQ`KNY== zeKC?UKGOjws>0&*D{PEf8vhmoM)nu{Zdn;U{l_o!?ABKV4#`)Lm*T(77+j#RNBZj> z={Y9T))X}(jSc1-%zs=m24^-|HsrnU=(UDO4Kn2e>|(ABC7MV$2q|@xseNoeVX&d) z8l{+GQ|8Qq=`i9V&UyMY3X#CI2 z4dTU1cW(S2UV1_6|M?4*vYQVjUtL3Dx|53@Z@%gS)Wi+yHCQM;&o^UFx7Hf#ffj1! zRgvhCyq_Ny2}%EM@kpklK+{p77YP^*uYrP`r}k-GlPwmr(7{9U<_x|mv}0?!X$|&U zyz|J8b14K{ETyS?RD_Fq+%xtdPKwdorM(`UP`+5WgXM}gf^2hTwlAsPpTQh5c`=w3 z6^kc3}ngQe`)f1De1Vt#|(4Qxeq{gb3y zqUPzXq7oMHNzPmcj+pQFYt)j0iY3&b`FBLc8@-0rd@Fhmq+)hZZT##%bO_LK9JdjJ zIh2LhMkg!!T+x+uAJJp^-v99K>%#mFg)3Jz1jW}q%d`?ggibRAZsT!rx1P|=bRqlg z{sfiP?`y3IVp^7ZGU8isg1VfbQYGv3YXxgH{0E~_S6x|s z=-xSI;!s2K?W%>$*HgCfx_EKhyji+n%k9D1K|8 zs*q<3ACZ3zx+>FR2KE2E-g4w5bb1@3F_u_1R`e2+7u&^A$a_a#M^>6Kw#1#!7PGxn z?>^>*UM!qye-JN9GlL$Ua#MxT^r_5~Usb~7h1?2sSU)ny!3cccAk>mpMc-n~-TuOB zy#&wQ?uRYB$X$^zfXL!E59g`br(tVB0M22SnC4AESCZ(hCeRCBzHe4hCMj1{HZ5G? zHGe^#FrCPL(*wiQO=r*RPu^c=>>Nsb`6@xd^K1cw!dn|VI@*4mU3Gylm8*2RPq9z( zG?2QTm8mNph17brbPA&NH!DvKJ??BrYSgHZTSM7YVf?z*+MR!-^UwR!OXgS4iz0iJ z63EO0S(Mcs_{hU`$xy^@}L{H3NXTq#QFuE_u?4Za-M;KH?Wl$A**2pXh6;>W3%gTAfv z$#E8 z_hWO`pF2kFiT-me+HVDr{`gR&@i+TY%DF8+Y# zy;_$stTlCN_wJ)!SJPGs2`~zW2n(Uz-efU5{7}7V^IUUFbVFa;UvDTKoFEdmhxKtK z|E|oWA*we*;Fm1S!tM2fl#et9hO!cl{K-URdtVxNrj{WpN-Jy65q4K$vN`)fCa zNVH?0z#%_;8?e`)<`owz4WEMoGFs^v@}jcC4b27$77{@Tb(d? zESh#K29MzsjWABr^gb35-IlCSdiCR&Th>v8MR5f9>p>52S(B^epRq(M-^Gp4UPbcD ze_zml9o_#IjQ=eq){#q+(vkI?ZDA9{ApP@=*M7Zv7 zME9hkbv)kZwc!y6M231~X)3H{nUX6!9&Og`{Uz8|{~0?X>UyG)37!iFvXLPO=k6%c z8h)4ZXahe~s!CS({$T@D&FFREI!xnQTbl1#u8Mi5;3Xe0Rw4)%0CvNPGyN{TR4Kx; z2;?U(M@MdlYW2UdPAl89jRS3Id$;AhudZ(tIwwBe!zkl)TvF_o*w@JXSlfX-vPGN3rV^nY8o%}yQ+LX{#t z6qTY75D*Mi>Ai|C_uhB!?!NnDXZG7EyR$npJG*hF#(GTjJoEqnFzF-Ux5@Yoxnb#O z$S}dtftQT7g3Yb`;Sc>BeO$v0UcSqUF4;O~p zv`rmlMhYhE%Zzpo)YyCJAsa@KEPH>gy9ht=Fs*>{&uI>%x%{Y^!Llpj=vKG&U`w9At%CY-%NLishuk@+UzZEVa60nod?F#@ zTGtn}k8!M#cuU>>(YU_Jh?|mmKy?4T=M&6Hd*kehATG%VA1D91N~x%)73bf*Tz|5# zxnsw`fZR0_F&O`{pi?;Uhb1s@OgV6$y?KdmNsnvXTgAeZ-+h(yxAA|2_G#DV-@_9h27hYU`0q@H$`BvHzSC{qWjlWdl zeCkJkK0SXYr&NWsj5pM3=1js^eUL01!G6`kkx}9W!)JyF(F{$UH!?HlKG2Ymz!0yH z=0m5XS!eN=GtP$_4NI`I@S)wcAB7zb)mS0SHro#_&FP6`EXWd}83_>;>fm5aod7i%xJsb_TyURhY?z?|{B zxs?SR&+^q`f#fXzGNR+XLE`-5csYXFKR6#bFats|H?%x76u&|0Epm_PQl#?CKRmoE zhG^U8G>m<&MQ9iLAbUQz*qH0YXx;uKM&lYz`e>MRe6;eiOO~*_tnr*YX7OtWs{hPb z^LGFR-r>0m4^FjmHMH!Je9+50OCdvp4{U+Y^FYAFY%qIRR~Tu#`j%t0bQuWPO7dIp z8-iTe6Ui@NluR2Av-`X=IB;b!d}D{>p$S!@W~!t$}5tG#)%SVaPaLdkQs6uGdXJlh>txH1U(t z)7f}FMTsH3pq?A$n7N1Ki6-u~YC+#M+B3bFPatj2zhjwqnPDCiWh?^8Wd+Ltdf@Z= zQ}>xYDh}uNu4~yn>&M3?WxnzoS5q>h8gs#Bg>2n5yoo!fV{z&(uCS}2jubfSNt;W950B3%~@dWefi*iRQs?%@KuDeFn{ZHHZAIH`06)!>T zl_`*4<=ri@2QFdlufDd#mrxsa*4D-VDhrNbTDsQ$lvx%D{R{47d(xM50PHVCr1}YV zbbc+gj;e`|wa4dD4ND5-u{!&oC7SGG*598i`!xSVT>f$QBlX~#i7?Ew zT+;tzE6c1>803Do)GoGdiMp=)ZaAT-)>(Y1 z9|6nP__r)Z4@P)LgG3v(DOqiVDZrJfTcgx5z4M6Ag&nm0Kx zRLqpdJcW=^(Uean{=bw(BolyP0$~W2@t!oo(Knx|pW{wTVPJ!pd;KxitzIA9h`nlU z=_@1yeKIjRKPPnhq_f#!s)zVEsk5Lb@;dkxPDk|^S1!YF+=clyMxcTnj%A$lxHVqn zvV-^w3(Z^qbXqnxZX@o}KjUN&Y`y#R6!IAEZ_9+MmtL3{3(5Ab$?w?=3LN@Er#g;E zsN&FKILb`Awu5#%>)~^)SFD;94dFM04MwoVR;ncm3l^N{SfAYf`cfTq)YT!}5@1(r zz^j(js+@XzMXrs{t(PUL#(998A@`Pz;z=NNx(6@TYpod9^uAY8lkJj+6USmlUlF}n z3s&7)4k%=3jqT^13Ds4<*`AE<+%s)NU@$$D&=!XXLUqDo8Xz=4I4CyXoboF9(J=eQ z-}C|^)a%r(nw|LV4ddjK1 zEgf+~_#sAJx97Gnd5L}Xv#H$FIpmSJgdUR^4_K)o@EyOO??5+6w0Df4?K!)$B zoVVF+c33d}(>!1OX9au2&ia&>%H*)f)aHQI{W!8Ul2$%>jTOo*^R%6gg96<-<=>JA zaGtsy=~NQ-_f@Ezn=44Lx#UmkyhufRNnH6Y@@}}`(Q)h2tF?X7STS{z&F!uTPY~a0 z{Ds!~M;T$EXqy9@-OfuBD~p-8>ErRHrhHb9C6Y%{B_OpFbZ-h_LV%(5zQ|I= zG28F!Es=tyr7gMd?$D$b`1@K`oO5j+ZG01~;8=1hCRv%exQ|4M&ZWNBS9!P&{zVzt z<8!@ec3IWUS@V$Ps+@*Nqs&N?)ar3A!%=_9t(s+B?NHUC$<63xJ5xTzA}xf9;@sE= zDuAzHuISX)C52)}|2mJnSMLnsI*;x5;$2VcL|9O7m4-D0Xs>>&tfYhyd`}x$sbGIP zPTcCK^3)>ZPR_5qcd|b(HtaoNCfL&DZjTLwYtmgB4nBbz*P*+DPeLWP1N2cw6+c6V zsI5@SIh#$`?^)IvEDRuwVO`DIzmg{tz$Y)ni>!p<6+dS9=eyPTirS+&}W1F?q@bqN`sN+R+Pq=SP` zz1x-})AMx=&)hRi7^=#vER0~9`B*g>&MwDC_+f8<(`n0jhg1^m5`QAC#muSwPx0yP zDqENguBI$K6i~ld!F`8j@x(rb`|tks`&`&zTKx+C|I?B1t6$zp=Am5gF8L$v`fc=)>eP=l(n2{6|ssPco~INmqHO({s$r z@Y7l4l>_lV&$YXu2|^qu^!h3_aj}d?XM#iqAo;2=bu0gC*^id68r@h?aGsR~=N?yb zJ<6gU|!?aoA zyH%mKN>KSUioRXl$G_A#@(0FdF1 z3Fz6ul2)|;*C0g!VB!P6>tBzM)<%?JJYf=TPbvy>c;vLKN2zYh4`Bc1Lcs^sO@k5~ z!sZmMJsF*(Cc9^~GlKDY9X&UTDS?D+m5cXgXG-+%Jb1zY2xzOGgtV86`2i{lbCURtfP*mOH+AjYG?-pwhsU z#JCKU6om%7e>8DdM*u)QInXhvq z@b@JYdJggpx?%;`r~xZeb^&l5#_RqzN7|g8Wd)}$;ml_G;|rtVtR49xR-~e!jvbui3V%f*n&1~t zsAua{9TEnIDHc$J76yGfqu5)vm%if+CG*-Aay;*vE=X4=OsZ~8&?4G2FKts&US7Tk z5ic~CK2&bYx zh1Tf)(Fv5!aMBs&J+K(*!cL)E!=!rCe@QC++lvHgWC}uT0k<&8D(g% zEl@>C^8v=M^8ude+CPdV#xN+i`G?)8hY37`-2A-Q9~}Ip>FfYK-6|vR)8a&<9pmg%pt9!brW^<*2^nxsul6yRNTe~^_y+di_L7ew&) znc|hN-d@>Uy%p-yGJjfdMctO&%VVfswT2NSMd$5c~$D>A3A}WztPvg4x ze^CmPSGx8lk_oo(-4$Tv)-r*YslG3d^6nKB5a4`w%fZnB`qrEb0gQ1SV(8&ll_=<5 zv8Z5<>by;S;OW7-Rg-V=;P(1d0~OYzIfPf31-$a4wsxuqmHm0CX6XC$&`Y(3vM-)H)zEC5u{J`+X3saisg#TKu7=ocVf%QlmzK zcTnTK1DhtaEAI^L0W)}oid8RUCFozz;D7gwV-1*&aa_S4XgK-X0?@x{46oF-kNh92 C8YhSV From 05a70680edfccdc00999d3f5939d61ba76d3e392 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Sat, 25 Jan 2025 21:34:20 +0500 Subject: [PATCH 18/24] this one probably will solve issue? --- code/datums/factions/faction.dm | 3 ++- code/modules/mob/mob.dm | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index 8c70b1dd68b1..d0e10f7809a3 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -83,7 +83,8 @@ if(!istype(creature)) return - for(var/datum/faction_module/faction_module in faction_modules) + for(var/faction_module_to_get in faction_modules) + var/datum/faction_module/faction_module = faction_modules[faction_module_to_get] faction_module.remove_mob(creature, hard, light_mode) if(hard) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 254291237fb9..4a536f266056 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -35,7 +35,6 @@ QDEL_NULL(faction_tag) if(faction) faction.remove_mob(src, TRUE) - faction = null tgui_open_uis = null buckled = null From 1632d28e301db9b694034e634edd09f00eefefc5 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Sat, 25 Jan 2025 23:38:00 +0500 Subject: [PATCH 19/24] some fixes --- code/_globalvars/lists/mapping_globals.dm | 2 -- code/game/gamemodes/cm_initialize.dm | 8 ++++---- .../jobs/job/civilians/support/working_joe.dm | 13 ++++++++----- code/game/jobs/job/job.dm | 13 +++++++------ code/game/jobs/role_authority.dm | 17 +++++------------ .../game/objects/effects/landmarks/landmarks.dm | 14 ++++++++++++-- 6 files changed, 36 insertions(+), 31 deletions(-) diff --git a/code/_globalvars/lists/mapping_globals.dm b/code/_globalvars/lists/mapping_globals.dm index 2fccad48134f..47c48f64f8fa 100644 --- a/code/_globalvars/lists/mapping_globals.dm +++ b/code/_globalvars/lists/mapping_globals.dm @@ -25,8 +25,6 @@ GLOBAL_LIST_EMPTY(thunderdome_observer) GLOBAL_LIST_EMPTY(latewhiskey) GLOBAL_LIST_EMPTY(latejoin) -GLOBAL_LIST_EMPTY(latejoin_by_squad) -GLOBAL_LIST_EMPTY(latejoin_by_job) GLOBAL_LIST_EMPTY(zombie_landmarks) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index a3c29e7718bf..166e37312312 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -325,8 +325,8 @@ Additional game mode variables. responder_candidate.client.prefs.find_assigned_slot(JOB_FAX_RESPONDER) - var/turf/spawn_point = get_turf(pick(GLOB.latejoin_by_job[sub_job])) - var/mob/living/carbon/human/new_responder = new(spawn_point) + var/mob/living/carbon/human/new_responder = new() + new_responder.forceMove(get_latejoin_spawn(new_responder, new_responder.faction, sub_job)) responder_candidate.mind.transfer_to(new_responder, TRUE) new_responder.client?.prefs.copy_all_to(new_responder, JOB_FAX_RESPONDER, TRUE, TRUE) @@ -1198,8 +1198,8 @@ Additional game mode variables. log_debug("Null client attempted to transform_joe") return - var/turf/spawn_point = get_turf(pick(GLOB.latejoin_by_job[JOB_WORKING_JOE])) - var/mob/living/carbon/human/synthetic/new_joe = new(spawn_point) + var/mob/living/carbon/human/synthetic/new_joe = new() + new_joe.forceMove(get_latejoin_spawn(new_joe, new_joe.faction, JOB_WORKING_JOE)) joe_candidate.mind.transfer_to(new_joe, TRUE) var/datum/job/joe_job = GLOB.RoleAuthority.roles_by_name[JOB_WORKING_JOE] diff --git a/code/game/jobs/job/civilians/support/working_joe.dm b/code/game/jobs/job/civilians/support/working_joe.dm index 7eafb1af666e..a865a0c83d39 100644 --- a/code/game/jobs/job/civilians/support/working_joe.dm +++ b/code/game/jobs/job/civilians/support/working_joe.dm @@ -56,17 +56,20 @@ addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(ares_apollo_talk), "[H.real_name] has been activated."), 1.5 SECONDS) return ..() -/obj/effect/landmark/start/working_joe - name = JOB_WORKING_JOE - icon_state = "wj_spawn" - job = /datum/job/civilian/working_joe - /datum/job/civilian/working_joe/generate_entry_conditions(mob/living/M, whitelist_status) . = ..() if(SSticker.mode) SSticker.mode.initialize_joe(M) +/datum/job/civilian/working_joe/get_latejoin_turf(mob/living/carbon/human/creature) + return get_latejoin_spawn(creature, creature.faction, creature.job) + +/obj/effect/landmark/start/working_joe + name = JOB_WORKING_JOE + icon_state = "wj_spawn" + job = /datum/job/civilian/working_joe + /datum/job/antag/upp/dzho_automaton title = JOB_UPP_JOE total_positions = 3 //Number is actually based on information from Colonial Marines_Operations Manual, 1IVAN/3 starts to lag if it is connected to more than 3. diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index b1591d234899..70997a4b952f 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -286,12 +286,10 @@ join_turf = get_turf(pick(GLOB.spawns_by_squad_and_job[assigned_squad][type])) else if(GLOB.spawns_by_job[type]) join_turf = get_turf(pick(GLOB.spawns_by_job[type])) - else if(assigned_squad && GLOB.latejoin_by_squad[assigned_squad]) - join_turf = get_turf(pick(GLOB.latejoin_by_squad[assigned_squad])) - else if(GLOB.latejoin_by_job[title]) - join_turf = get_turf(pick(GLOB.latejoin_by_job[title])) - else - join_turf = get_turf(pick(GLOB.latejoin)) + + if(!join_turf) + join_turf = get_latejoin_turf(human) + human.forceMove(join_turf) for(var/cardinal in GLOB.cardinals) @@ -325,3 +323,6 @@ /// Called when the job owner enters deep cryogenic storage /datum/job/proc/on_cryo(mob/living/carbon/human/cryoing) return + +/datum/job/proc/get_latejoin_turf(mob/living/carbon/human/creature) + return get_latejoin_spawn(creature, creature.faction, creature.assigned_squad?.name) diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index cbf75b6b48e7..dfcbbc0eb61d 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -491,14 +491,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou if(isturf(late_join)) new_human.forceMove(late_join) else if(late_join) - var/turf/late_join_turf - if(GLOB.latejoin_by_squad[assigned_squad]) - late_join_turf = get_turf(pick(GLOB.latejoin_by_squad[assigned_squad])) - else if(GLOB.latejoin_by_job[new_job.title]) - late_join_turf = get_turf(pick(GLOB.latejoin_by_job[new_job.title])) - else - late_join_turf = get_turf(pick(GLOB.latejoin)) - new_human.forceMove(late_join_turf) + new_human.forceMove(new_job.get_latejoin_turf(new_human)) else var/turf/join_turf if(assigned_squad && GLOB.spawns_by_squad_and_job[assigned_squad] && GLOB.spawns_by_squad_and_job[assigned_squad][new_job.type]) @@ -507,10 +500,10 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou join_turf = get_turf(pick(GLOB.spawns_by_job[new_job.type])) else if(GLOB.spawns_by_job[new_job.title]) join_turf = get_turf(pick(GLOB.spawns_by_job[new_job.title])) - else if(assigned_squad && GLOB.latejoin_by_squad[assigned_squad]) - join_turf = get_turf(pick(GLOB.latejoin_by_squad[assigned_squad])) - else - join_turf = get_turf(pick(GLOB.latejoin)) + + if(!join_turf) + join_turf = new_job.get_latejoin_turf(new_human) + new_human.forceMove(join_turf) for(var/cardinal in GLOB.cardinals) diff --git a/code/game/objects/effects/landmarks/landmarks.dm b/code/game/objects/effects/landmarks/landmarks.dm index 78efc47af503..185e396ac190 100644 --- a/code/game/objects/effects/landmarks/landmarks.dm +++ b/code/game/objects/effects/landmarks/landmarks.dm @@ -316,10 +316,8 @@ for(var/job_from_list in job_list) if(squad) LAZYREMOVE(GLOB.spawns_by_squad_and_job[squad][job_from_list], src) - LAZYREMOVE(GLOB.latejoin_by_squad[squad][job_from_list], src) else LAZYREMOVE(GLOB.spawns_by_job[job_from_list], src) - LAZYREMOVE(GLOB.latejoin_by_job[job_from_list], src) return ..() /obj/effect/landmark/start/AISloc @@ -567,6 +565,18 @@ name = "Press Fax Responder late join" job = JOB_FAX_RESPONDER_PRESS +/proc/get_latejoin_spawn(mob/living/carbon/human/human, datum/faction/faction_assigned_spawn, assigned_squad = "other") + var/turf/selected_turf = get_turf(pick(GLOB.latejoin)) + if(human && faction_assigned_spawn && assigned_squad) + if(length(faction_assigned_spawn.late_join_landmarks[assigned_squad])) + selected_turf = get_turf(pick(faction_assigned_spawn.late_join_landmarks[assigned_squad])) + if(!selected_turf) + for(var/squad in faction_assigned_spawn.late_join_landmarks) + if(!length(faction_assigned_spawn.late_join_landmarks[squad])) + continue + selected_turf = get_turf(pick(faction_assigned_spawn.late_join_landmarks[squad])) + return selected_turf + //****************************************** STATIC COMMS ************************************************// /obj/effect/landmark/static_comms name = "static comms" From a70730a8ec4f2948bef7e7d543e1ff2829ee7703 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Mon, 27 Jan 2025 02:29:22 +0500 Subject: [PATCH 20/24] fix of runtimes at tests? --- code/modules/mob/death.dm | 3 ++- code/modules/mob/living/carbon/xenomorph/Xenomorph.dm | 1 - code/modules/mob/mob.dm | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 50de241c57e7..764e4a34a952 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -48,7 +48,8 @@ if(stat == DEAD) return 0 - faction.remove_mob(src) + if(faction) + faction.remove_mob(src) if(!gibbed) visible_message("[src.name] [deathmessage]") diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 218550100492..2e33e5e538d2 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -694,7 +694,6 @@ if(IS_XENO_LEADER(src)) //Strip them from the Xeno leader list, if they are indexed in here var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) faction_module.remove_hive_leader(src, light_mode = TRUE) - SStracking.stop_tracking("hive_[faction.code_identificator]", src) remove_from_all_mob_huds() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4a536f266056..387ecd1e7a9c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -17,6 +17,11 @@ mind.original = null mind = null + QDEL_NULL(organ_faction_tag) + QDEL_NULL(faction_tag) + if(faction) + faction.remove_mob(src, TRUE) + QDEL_NULL(skills) QDEL_NULL_LIST(actions) QDEL_NULL_LIST(viruses) @@ -31,11 +36,6 @@ QDEL_NULL(mob_language_menu) QDEL_NULL_LIST(open_uis) - QDEL_NULL(organ_faction_tag) - QDEL_NULL(faction_tag) - if(faction) - faction.remove_mob(src, TRUE) - tgui_open_uis = null buckled = null skincmds = null From 0b9a72eeab57c7e51058fb1838de0bb72f2095af Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Mon, 27 Jan 2025 02:37:45 +0500 Subject: [PATCH 21/24] maybe this one will solve issue? --- code/__DEFINES/dcs/signals/signals_datum.dm | 2 +- code/datums/diseases/black_goo.dm | 2 +- .../mob/living/carbon/xenomorph/castes/Queen.dm | 16 ---------------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_datum.dm b/code/__DEFINES/dcs/signals/signals_datum.dm index c35038fcf3e9..f22f51c515d6 100644 --- a/code/__DEFINES/dcs/signals/signals_datum.dm +++ b/code/__DEFINES/dcs/signals/signals_datum.dm @@ -64,7 +64,7 @@ // from /datum/emergency_call/proc/spawn_candidates() #define COMSIG_ERT_SETUP "ert_setup" -// from /proc/update_living_queens() : /mob/living/carbon/xenomorph/queen +// from /datum/faction_module/hive_mind/proc/set_living_xeno_queen() : /mob/living/carbon/xenomorph/queen #define COMSIG_HIVE_NEW_QUEEN "hive_new_queen" /// Fired on the lazy template datum when the template is finished loading. (list/loaded_atom_movables, list/loaded_turfs, list/loaded_areas) diff --git a/code/datums/diseases/black_goo.dm b/code/datums/diseases/black_goo.dm index 729b5be537d8..414e53e2fa91 100644 --- a/code/datums/diseases/black_goo.dm +++ b/code/datums/diseases/black_goo.dm @@ -159,7 +159,7 @@ human.jitteriness = 0 human.set_species(SPECIES_ZOMBIE) stage = 4 - human.faction = FACTION_ZOMBIE + GLOB.faction_datums[FACTION_ZOMBIE].add_mob(human) zombie_is_transforming = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 22e4a3c1d5ed..d98cd302b91a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -51,21 +51,6 @@ royal_caste = TRUE -/proc/update_living_queens() // needed to update when you change a queen to a different hive - outer_loop: - for(var/faction_to_get in GLOB.faction_datums) - var/datum/faction/faction = GLOB.faction_datums[faction_to_get] - var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) - if(faction_module.living_xeno_queen) - if(faction_module.living_xeno_queen.faction == faction) - continue - for(var/mob/living/carbon/xenomorph/queen/Q in GLOB.living_xeno_list) - if(Q.faction == faction && !should_block_game_interaction(Q)) - faction_module.living_xeno_queen = Q - xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"), 3, faction) - continue outer_loop - faction_module.living_xeno_queen = null - /mob/hologram/queen name = "Queen Eye" action_icon_state = "queen_exit" @@ -493,7 +478,6 @@ /mob/living/carbon/xenomorph/queen/set_hive_and_update(new_hivenumber) if(!..()) return FALSE - update_living_queens() /mob/living/carbon/xenomorph/queen/proc/make_combat_effective() queen_aged = TRUE From 7038c094abee5ca10cb03d65db1a56cdbcdb853c Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Mon, 27 Jan 2025 03:05:59 +0500 Subject: [PATCH 22/24] hhhhhhhhhhhmmmmmmmmmm --- code/datums/factions/faction.dm | 3 ++- .../mob/living/carbon/xenomorph/castes/Queen.dm | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/code/datums/factions/faction.dm b/code/datums/factions/faction.dm index d0e10f7809a3..15a3ac21e28e 100644 --- a/code/datums/factions/faction.dm +++ b/code/datums/factions/faction.dm @@ -65,7 +65,8 @@ if(!istype(creature)) return - for(var/datum/faction_module/faction_module in faction_modules) + for(var/faction_module_to_get in faction_modules) + var/datum/faction_module/faction_module = faction_modules[faction_module_to_get] faction_module.add_mob(creature) if(creature.faction && creature.faction != src) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index d98cd302b91a..22e4a3c1d5ed 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -51,6 +51,21 @@ royal_caste = TRUE +/proc/update_living_queens() // needed to update when you change a queen to a different hive + outer_loop: + for(var/faction_to_get in GLOB.faction_datums) + var/datum/faction/faction = GLOB.faction_datums[faction_to_get] + var/datum/faction_module/hive_mind/faction_module = faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + if(faction_module.living_xeno_queen) + if(faction_module.living_xeno_queen.faction == faction) + continue + for(var/mob/living/carbon/xenomorph/queen/Q in GLOB.living_xeno_list) + if(Q.faction == faction && !should_block_game_interaction(Q)) + faction_module.living_xeno_queen = Q + xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"), 3, faction) + continue outer_loop + faction_module.living_xeno_queen = null + /mob/hologram/queen name = "Queen Eye" action_icon_state = "queen_exit" @@ -478,6 +493,7 @@ /mob/living/carbon/xenomorph/queen/set_hive_and_update(new_hivenumber) if(!..()) return FALSE + update_living_queens() /mob/living/carbon/xenomorph/queen/proc/make_combat_effective() queen_aged = TRUE From 1f31dd6a626eb05187bef00fcd3d090f086df905 Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Mon, 27 Jan 2025 03:22:19 +0500 Subject: [PATCH 23/24] funny issue with test made by me changing a little bit of place call to parrent --- code/modules/mob/living/carbon/xenomorph/Embryo.dm | 5 ++--- .../mob/living/carbon/xenomorph/Xenomorph.dm | 13 ++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index 7efd8c39775a..d6b82dbee09d 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -242,11 +242,10 @@ var/mob/living/carbon/xenomorph/larva/new_xeno if(isyautja(affected_mob) || (flags_embryo & FLAG_EMBRYO_PREDATOR)) - new_xeno = new /mob/living/carbon/xenomorph/larva/predalien(affected_mob) + new_xeno = new /mob/living/carbon/xenomorph/larva/predalien(affected_mob, null, faction) else - new_xeno = new(affected_mob) + new_xeno = new(affected_mob, null, faction) - faction.add_mob(new_xeno) if(!affected_mob.first_xeno && faction_module.hive_location) faction_module.increase_larva_after_burst() faction_module.hive_ui.update_burrowed_larva() diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 2e33e5e538d2..f3facc59670c 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -383,7 +383,7 @@ old_xeno.drop_inv_item_on_ground(item) old_xeno.empty_gut() - old_xeno.faction.add_mob(src) + faction = old_xeno.faction if(old_xeno.organ_faction_tag) organ_faction_tag = old_xeno.organ_faction_tag organ_faction_tag.forceMove(src) @@ -394,8 +394,11 @@ faction_tag.forceMove(src) old_xeno.faction_tag = null - else if(faction_to_set) - faction = faction_to_set + if(!faction) + if(faction_to_set) + faction = faction_to_set + else if(faction_to_get) + faction = GLOB.faction_datums[faction_to_get] //Set caste stuff if(caste_type && GLOB.xeno_datum_list[caste_type]) @@ -441,8 +444,6 @@ GLOB.xeno_mob_list += src xeno_inhand_item_offset = (icon_size - 32) * 0.5 - . = ..() - if(!organ_faction_tag && faction.organ_faction_iff_tag_type) organ_faction_tag = new faction.organ_faction_iff_tag_type(src, faction) @@ -462,6 +463,8 @@ recalculate_everything() toggle_xeno_mobhud() //This is a verb, but fuck it, it just werks + . = ..() + //Set leader to the new mob if(old_xeno) if(IS_XENO_LEADER(old_xeno)) From e12b0f5e2dc82f636889488100e539be9a465a2a Mon Sep 17 00:00:00 2001 From: BlackCrystalic <39885003+blackcrystall@users.noreply.github.com> Date: Fri, 31 Jan 2025 02:35:28 +0500 Subject: [PATCH 24/24] aaaaaaaaaaaaaa --- code/datums/statistics/entities/xeno_death.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/datums/statistics/entities/xeno_death.dm b/code/datums/statistics/entities/xeno_death.dm index e416e014182b..245cc2b5ce86 100644 --- a/code/datums/statistics/entities/xeno_death.dm +++ b/code/datums/statistics/entities/xeno_death.dm @@ -34,10 +34,15 @@ y = dead_xeno.y || -1 z = dead_xeno.z || -1 death_minute = floor((world.time * 0.1) / 60) || -1 - hive = dead_xeno.hive.name || "Unknown Hive" caste = dead_xeno.caste.caste_type || "Unknown" strain = dead_xeno.strain?.name || "None" - leader = (dead_xeno in dead_xeno.hive.xeno_leader_list) + if(dead_xeno.faction) + hive = dead_xeno.faction.code_identificator + var/datum/faction_module/hive_mind/faction_module = dead_xeno.faction.get_faction_module(FACTION_MODULE_HIVE_MIND) + leader = (dead_xeno in faction_module.xeno_leader_list) + else + hive = "Unknown Hive" + leader = FALSE minutes_alive = floor(((world.time - dead_xeno.creation_time) * 0.1) / 60) || -1 ckey = dead_xeno.ckey || dead_xeno.persistent_ckey || "" damage_taken = dead_xeno.life_damage_taken_total || 0