Skip to content

Commit

Permalink
Xeno Ranks (#14038)
Browse files Browse the repository at this point in the history
* initial_commit

* Rank icons

* Review

* hour changes

* prime rank

* apex rank

* Revert "apex rank"

This reverts commit c60b5d0.

* rank name changes

---------

Co-authored-by: ivanmixo <[email protected]>
  • Loading branch information
Barnet2 and ivanmixo authored Sep 28, 2023
1 parent 405b1ed commit f094b52
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/atom_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions code/datums/jobs/job/job_exp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ GLOBAL_PROTECT(exp_to_update)
return_text += "<LI>[dep] [get_exp_format(exp_data[dep])] ([percentage]%) while alive.</LI>"
else
return_text += "<LI>[dep] [get_exp_format(exp_data[dep])] </LI>"

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 += "<LI>[caste_type.caste_name] [get_exp_format(play_records[caste_type.caste_name])] while alive.</LI>"

if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_other_rights(src, R_ADMIN, FALSE))
return_text += "<LI>Admin (all jobs auto-unlocked)</LI>"
return_text += "</UL>"
Expand Down Expand Up @@ -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!"))
Expand Down
9 changes: 8 additions & 1 deletion code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
nicknumber = 0
generate_nicknumber()

hud_update_rank()
generate_name()
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 33 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit f094b52

Please sign in to comment.