From f094b5203ff59b11671bd9274d9439d9efe3972e Mon Sep 17 00:00:00 2001 From: Barnet Date: Thu, 28 Sep 2023 13:59:48 -0700 Subject: [PATCH] Xeno Ranks (#14038) * initial_commit * Rank icons * Review * hour changes * prime rank * apex rank * Revert "apex rank" This reverts commit c60b5d0be96162878793e19e9c5f5f77ef180184. * rank name changes --------- Co-authored-by: ivanmixo --- code/__DEFINES/atom_hud.dm | 1 + code/datums/jobs/job/job_exp.dm | 8 +++++ code/game/data_huds.dm | 9 ++++- .../xenomorph/castes/hivemind/hivemind.dm | 2 +- .../mob/living/carbon/xenomorph/login.dm | 1 + .../living/carbon/xenomorph/xeno_defines.dm | 2 +- .../mob/living/carbon/xenomorph/xenomorph.dm | 34 ++++++++++++++++++- 7 files changed, 53 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/atom_hud.dm b/code/__DEFINES/atom_hud.dm index f7c48b5fd7509..3aa678932babf 100755 --- a/code/__DEFINES/atom_hud.dm +++ b/code/__DEFINES/atom_hud.dm @@ -13,6 +13,7 @@ #define PLASMA_HUD "xeno_plasma_hud" //indicates the plasma level of xenos. #define PHEROMONE_HUD "xeno_pheromone_hud" //indicates which pheromone is active on a xeno. #define QUEEN_OVERWATCH_HUD "xeno_overwatch_hud" //indicates which xeno the queen is overwatching. +#define XENO_RANK_HUD "xeno_rank_hud" //indicates the current rank of the xeno #define ORDER_HUD "human_order_hud" //shows what orders are applied to marines #define PAIN_HUD "pain_hud" //displays human pain / preceived health. #define ARMOR_SUNDER_HUD "armor_sunder_hud" //displays how much sunder has been applied. diff --git a/code/datums/jobs/job/job_exp.dm b/code/datums/jobs/job/job_exp.dm index a13d367da262f..bb2193435cdaf 100644 --- a/code/datums/jobs/job/job_exp.dm +++ b/code/datums/jobs/job/job_exp.dm @@ -102,6 +102,11 @@ GLOBAL_PROTECT(exp_to_update) return_text += "
  • [dep] [get_exp_format(exp_data[dep])] ([percentage]%) while alive.
  • " else return_text += "
  • [dep] [get_exp_format(exp_data[dep])]
  • " + + for(var/mob_type AS in GLOB.xeno_caste_datums) + var/datum/xeno_caste/caste_type = GLOB.xeno_caste_datums[mob_type][XENO_UPGRADE_BASETYPE] + return_text += "
  • [caste_type.caste_name] [get_exp_format(play_records[caste_type.caste_name])] while alive.
  • " + if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_other_rights(src, R_ADMIN, FALSE)) return_text += "
  • Admin (all jobs auto-unlocked)
  • " return_text += "" @@ -212,6 +217,9 @@ GLOBAL_PROTECT(exp_to_update) to_chat(src,span_notice("You got: [minutes] Living EXP!")) if(living_mob.job) if(!istype(living_mob.job, /datum/job/fallen)) + if(isxeno(living_mob)) + var/mob/living/carbon/xenomorph/xeno = living_mob + play_records[xeno.xeno_caste.caste_name] += minutes play_records[living_mob.job.title] += minutes if(announce_changes) to_chat(src,span_notice("You got: [minutes] [living_mob.job] EXP!")) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 966ac9a6c505f..baac875aa08ef 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -416,7 +416,7 @@ //Xeno status hud, for xenos /datum/atom_hud/xeno - hud_icons = list(HEALTH_HUD_XENO, PLASMA_HUD, PHEROMONE_HUD, QUEEN_OVERWATCH_HUD, ARMOR_SUNDER_HUD, XENO_FIRE_HUD) + hud_icons = list(HEALTH_HUD_XENO, PLASMA_HUD, PHEROMONE_HUD, QUEEN_OVERWATCH_HUD, ARMOR_SUNDER_HUD, XENO_FIRE_HUD, XENO_RANK_HUD) /datum/atom_hud/xeno_heart hud_icons = list(HEART_STATUS_HUD) @@ -517,6 +517,13 @@ holder.overlays += I hud_list[QUEEN_OVERWATCH_HUD] = holder +/mob/living/carbon/xenomorph/proc/hud_update_rank() + var/image/holder = hud_list[XENO_RANK_HUD] + holder.icon_state = "hudblank" + if(stat != DEAD && playtime_as_number() > 0) + holder.icon_state = "hudxenoupgrade[playtime_as_number()]" + + hud_list[XENO_RANK_HUD] = holder /datum/atom_hud/security hud_icons = list(WANTED_HUD) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/hivemind/hivemind.dm b/code/modules/mob/living/carbon/xenomorph/castes/hivemind/hivemind.dm index 8104a76a22bb7..dd844b04c2565 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/hivemind/hivemind.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/hivemind/hivemind.dm @@ -30,7 +30,7 @@ move_on_shuttle = TRUE hud_type = /datum/hud/hivemind - hud_possible = list(PLASMA_HUD, HEALTH_HUD_XENO, PHEROMONE_HUD, QUEEN_OVERWATCH_HUD) + hud_possible = list(PLASMA_HUD, HEALTH_HUD_XENO, PHEROMONE_HUD, XENO_RANK_HUD, QUEEN_OVERWATCH_HUD) ///The core of our hivemind var/datum/weakref/core ///The minimum health we can have diff --git a/code/modules/mob/living/carbon/xenomorph/login.dm b/code/modules/mob/living/carbon/xenomorph/login.dm index 0cd5e9b38f22b..f3d6daf6fc886 100644 --- a/code/modules/mob/living/carbon/xenomorph/login.dm +++ b/code/modules/mob/living/carbon/xenomorph/login.dm @@ -14,4 +14,5 @@ nicknumber = 0 generate_nicknumber() + hud_update_rank() generate_name() diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index b56167c2eed71..f7f36867995c1 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -273,7 +273,7 @@ appearance_flags = TILE_BOUND|PIXEL_SCALE|KEEP_TOGETHER see_infrared = TRUE hud_type = /datum/hud/alien - hud_possible = list(HEALTH_HUD_XENO, PLASMA_HUD, PHEROMONE_HUD, QUEEN_OVERWATCH_HUD, ARMOR_SUNDER_HUD, XENO_DEBUFF_HUD, XENO_FIRE_HUD) + hud_possible = list(HEALTH_HUD_XENO, PLASMA_HUD, PHEROMONE_HUD, XENO_RANK_HUD, QUEEN_OVERWATCH_HUD, ARMOR_SUNDER_HUD, XENO_DEBUFF_HUD, XENO_FIRE_HUD) buckle_flags = NONE faction = FACTION_XENO initial_language_holder = /datum/language_holder/xeno diff --git a/code/modules/mob/living/carbon/xenomorph/xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/xenomorph.dm index ae73e4e49c88e..677d76689e0bb 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenomorph.dm @@ -147,8 +147,23 @@ //Since Xenos change names like they change shoes, we need somewhere to hammer in all those legos //We set their name first, then update their real_name AND their mind name /mob/living/carbon/xenomorph/proc/generate_name() + var/playtime_mins = client?.get_exp(xeno_caste.caste_name) + var/rank_name + switch(playtime_mins) + if(0 to 600) + rank_name = "Broodling" + if(601 to 3000) + rank_name = "Mature" + if(3001 to 9000) + rank_name = "Noble" + if(9001 to 18000) + rank_name = "Royal" + if(18001 to INFINITY) + rank_name = "Archon" + else + rank_name = "Broodling" var/prefix = (hive.prefix || xeno_caste.upgrade_name) ? "[hive.prefix][xeno_caste.upgrade_name] " : "" - name = prefix + "[xeno_caste.display_name] ([nicknumber])" + name = prefix + "[rank_name ? "[rank_name] " : ""][xeno_caste.display_name] ([nicknumber])" //Update linked data so they show up properly real_name = name @@ -164,6 +179,23 @@ if(XENO_UPGRADE_PRIMO) return 1 +///Returns the playtime as a number, used for rank icons +/mob/living/carbon/xenomorph/proc/playtime_as_number() + var/playtime_mins = client?.get_exp(xeno_caste.caste_name) + switch(playtime_mins) + if(0 to 600) + return 0 + if(601 to 3000) + return 1 + if(3001 to 9000) + return 2 + if(9001 to 18000) + return 3 + if(18001 to INFINITY) + return 4 + else + return 0 + /mob/living/carbon/xenomorph/proc/upgrade_next() switch(upgrade) if(XENO_UPGRADE_INVALID)