Skip to content

Commit

Permalink
TGS Test Merge (#7106)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Oct 12, 2024
2 parents ed15e4a + a490c79 commit 53bf89f
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 83 deletions.
20 changes: 15 additions & 5 deletions code/datums/factions/clf.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/datum/faction/clf
name = "Colonial Liberation Front"
faction_tag = FACTION_CLF
hud_icon_prefix = "clf_"

/datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/human)
/datum/faction/clf/modify_hud_holder(image/holder, mob/living/carbon/human/current_human)
var/hud_icon_state
var/obj/item/card/id/ID = human.get_idcard()
var/used_icon_file = hud_icon_file
var/used_icon_prefix = hud_icon_prefix
var/obj/item/card/id/ID = current_human.get_idcard()
var/_role
if(human.mind)
_role = human.job
if(current_human.mind)
_role = current_human.job
else if(ID)
_role = ID.rank
switch(_role)
Expand All @@ -23,8 +26,15 @@
hud_icon_state = "synth"
if(JOB_CLF_COMMANDER)
hud_icon_state = "cellcom"

if(current_human.rank_icon_file_override)
used_icon_file = current_human.rank_icon_file_override
if(current_human.rank_icon_state_override)
hud_icon_state = current_human.rank_icon_state_override
if(current_human.rank_icon_prefix_override)
used_icon_prefix = current_human.rank_icon_prefix_override
if(hud_icon_state)
holder.overlays += image('icons/mob/hud/marine_hud.dmi', human, "clf_[hud_icon_state]")
holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]")

/datum/faction/clf/get_antag_guns_snowflake_equipment()
return list(
Expand Down
2 changes: 2 additions & 0 deletions code/datums/factions/faction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
var/name = "Neutral Faction"
var/faction_tag = FACTION_NEUTRAL
var/hud_type = FACTION_HUD
var/hud_icon_prefix
var/hud_icon_file = 'icons/mob/hud/marine_hud.dmi'

/datum/faction/proc/modify_hud_holder(image/holder, mob/living/carbon/human/H)
return
Expand Down
20 changes: 15 additions & 5 deletions code/datums/factions/pmc.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/datum/faction/pmc
name = "Private Military Company"
faction_tag = FACTION_PMC
hud_icon_prefix = "pmc_"

/datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/H)
/datum/faction/pmc/modify_hud_holder(image/holder, mob/living/carbon/human/current_human)
var/hud_icon_state
var/obj/item/card/id/ID = H.get_idcard()
var/used_icon_file = hud_icon_file
var/used_icon_prefix = hud_icon_prefix
var/obj/item/card/id/ID = current_human.get_idcard()
var/_role
if(H.mind)
_role = H.job
if(current_human.mind)
_role = current_human.job
else if(ID)
_role = ID.rank
switch(_role)
Expand All @@ -23,8 +26,15 @@
hud_icon_state = "md"
if(JOB_PMC_SYNTH)
hud_icon_state = "syn"

if(current_human.rank_icon_file_override)
used_icon_file = current_human.rank_icon_file_override
if(current_human.rank_icon_state_override)
hud_icon_state = current_human.rank_icon_state_override
if(current_human.rank_icon_prefix_override)
used_icon_prefix = current_human.rank_icon_prefix_override
if(hud_icon_state)
holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "pmc_[hud_icon_state]")
holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]")

/datum/faction/pmc/get_antag_guns_snowflake_equipment()
return list(
Expand Down
20 changes: 15 additions & 5 deletions code/datums/factions/royalmarinescommando.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/datum/faction/royal_marines_commando
name = "Royal Marines Commando"
faction_tag = FACTION_TWE
hud_icon_prefix = "rmc_"

/datum/faction/royal_marines_commando/modify_hud_holder(image/holder, mob/living/carbon/human/H)
/datum/faction/royal_marines_commando/modify_hud_holder(image/holder, mob/living/carbon/human/current_human)
var/hud_icon_state
var/obj/item/card/id/dogtag/ID = H.get_idcard()
var/used_icon_file = hud_icon_file
var/used_icon_prefix = hud_icon_prefix
var/obj/item/card/id/dogtag/ID = current_human.get_idcard()
var/_role
if(H.mind)
_role = H.job
if(current_human.mind)
_role = current_human.job
else if(ID)
_role = ID.rank
switch(_role)
Expand All @@ -23,8 +26,15 @@
hud_icon_state = "smartgunner"
if(JOB_TWE_RMC_BREACHER)
hud_icon_state = "breacher"

if(current_human.rank_icon_file_override)
used_icon_file = current_human.rank_icon_file_override
if(current_human.rank_icon_state_override)
hud_icon_state = current_human.rank_icon_state_override
if(current_human.rank_icon_prefix_override)
used_icon_prefix = current_human.rank_icon_prefix_override
if(hud_icon_state)
holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "rmc_[hud_icon_state]")
holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]")

/datum/faction/royal_marines_commando/get_antag_guns_snowflake_equipment()
return list(
Expand Down
20 changes: 15 additions & 5 deletions code/datums/factions/upp.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/datum/faction/upp
name = "Union of Progressive Peoples"
faction_tag = FACTION_UPP
hud_icon_prefix = "upp_"

/datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/H)
/datum/faction/upp/modify_hud_holder(image/holder, mob/living/carbon/human/current_human)
var/hud_icon_state
var/obj/item/card/id/ID = H.get_idcard()
var/used_icon_file = hud_icon_file
var/used_icon_prefix = hud_icon_prefix
var/obj/item/card/id/ID = current_human.get_idcard()
var/_role
if(H.mind)
_role = H.job
if(current_human.mind)
_role = current_human.job
else if(ID)
_role = ID.rank
switch(_role)
Expand Down Expand Up @@ -57,8 +60,15 @@
hud_icon_state = "log"
if(JOB_UPP_COMMISSAR)
hud_icon_state = "commi"

if(current_human.rank_icon_file_override)
used_icon_file = current_human.rank_icon_file_override
if(current_human.rank_icon_state_override)
hud_icon_state = current_human.rank_icon_state_override
if(current_human.rank_icon_prefix_override)
used_icon_prefix = current_human.rank_icon_prefix_override
if(hud_icon_state)
holder.overlays += image('icons/mob/hud/marine_hud.dmi', H, "upp_[hud_icon_state]")
holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][hud_icon_state]")

/datum/faction/upp/get_antag_guns_snowflake_equipment()
return list(
Expand Down
99 changes: 40 additions & 59 deletions code/datums/factions/uscm.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
/datum/faction/uscm
name = "United States Colonial Marines"
faction_tag = FACTION_MARINE
hud_icon_prefix = "hudsquad_"

/datum/faction/uscm/modify_hud_holder(image/holder, mob/living/carbon/human/current_human)
var/marine_rk
var/used_icon_file = hud_icon_file
var/used_icon_prefix = hud_icon_prefix
var/squad_clr

if(current_human.rank_icon_file_override)
used_icon_file = current_human.rank_icon_file_override

var/obj/item/card/id/id_card = current_human.get_idcard()
var/_role
if(current_human.job)
_role = current_human.job
else if(id_card)
_role = id_card.rank

var/datum/squad/squad = current_human.assigned_squad
if(istype(squad))
var/squad_clr = current_human.assigned_squad.equipment_color
var/marine_rk
var/obj/item/card/id/I = current_human.get_idcard()
var/_role
if(current_human.job)
_role = current_human.job
else if(I)
_role = I.rank
squad_clr = current_human.assigned_squad.equipment_color
switch(GET_DEFAULT_ROLE(_role))
if(JOB_SQUAD_ENGI) marine_rk = "engi"
if(JOB_SQUAD_SPECIALIST) marine_rk = "spec"
Expand Down Expand Up @@ -42,52 +51,30 @@

current_human.langchat_color = current_human.assigned_squad.chat_color

if(!marine_rk) marine_rk = current_human.rank_fallback
if(marine_rk)
var/image/IMG = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad")
if(squad_clr)
IMG.color = squad_clr
else
IMG.color = "#5A934A"
holder.overlays += IMG
holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_[marine_rk]")
if(!marine_rk)
marine_rk = current_human.rank_icon_state_override
if(current_human.assigned_squad && current_human.assigned_fireteam)
var/image/IMG2 = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_[current_human.assigned_fireteam]")
var/image/IMG2 = image(used_icon_file, current_human, "[used_icon_prefix][current_human.assigned_fireteam]")
IMG2.color = squad_clr
holder.overlays += IMG2
if(current_human.assigned_squad.fireteam_leaders[current_human.assigned_fireteam] == current_human)
var/image/IMG3 = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad_ftl")
var/image/IMG3 = image(used_icon_file, current_human, "[used_icon_prefix]ftl")
IMG3.color = squad_clr
holder.overlays += IMG3
else
var/marine_rk
var/border_rk
var/icon_prefix = "hudsquad_"
var/obj/item/card/id/ID = current_human.get_idcard()
var/_role
if(current_human.mind)
_role = current_human.job
else if(ID)
_role = ID.rank
switch(_role)
if(JOB_XO)
marine_rk = "xo"
border_rk = "command"
if(JOB_CO)
marine_rk = "co"
border_rk = "command"
if(JOB_USCM_OBSV)
marine_rk = "vo"
border_rk = "command"
if(JOB_SO)
marine_rk = "so"
border_rk = "command"
if(JOB_AUXILIARY_OFFICER)
marine_rk = "aso"
border_rk = "command"
if(JOB_GENERAL, JOB_COLONEL, JOB_ACMC, JOB_CMC)
marine_rk = "general"
border_rk = "command"
if(JOB_PLT_MED)
marine_rk = "med"
if(JOB_PLT_SL)
Expand All @@ -104,39 +91,32 @@
marine_rk = "dcc"
if(JOB_CHIEF_POLICE)
marine_rk = "cmp"
border_rk = "command"
if(JOB_POLICE)
marine_rk = "mp"
if(JOB_TANK_CREW)
marine_rk = "tc"
if(JOB_WARDEN)
marine_rk = "warden"
border_rk = "command"
if(JOB_CHIEF_REQUISITION)
marine_rk = "ro"
if(JOB_CARGO_TECH)
marine_rk = "ct"
if(JOB_CHIEF_ENGINEER)
marine_rk = "ce"
border_rk = "command"
if(JOB_MAINT_TECH)
marine_rk = "mt"
if(JOB_ORDNANCE_TECH)
marine_rk = "ot"
if(JOB_CMO)
marine_rk = "cmo"
border_rk = "command"
if(JOB_DOCTOR)
marine_rk = "doctor"
border_rk = "command"
if(JOB_RESEARCHER)
marine_rk = "researcher"
border_rk = "command"
if(JOB_NURSE)
marine_rk = "nurse"
if(JOB_SEA)
marine_rk = "sea"
border_rk = "command"
if(JOB_SYNTH)
marine_rk = "syn"
if(JOB_MESS_SERGEANT)
Expand All @@ -148,22 +128,16 @@
marine_rk = "pvtml"
if(JOB_PROVOST_INSPECTOR)
marine_rk = "pvi"
border_rk = "command"
if(JOB_PROVOST_UNDERCOVER)
marine_rk = "pvuc"
border_rk = "command"
if(JOB_PROVOST_CINSPECTOR)
marine_rk = "pvci"
border_rk = "command"
if(JOB_PROVOST_ADVISOR)
marine_rk = "pva"
border_rk = "command"
if(JOB_PROVOST_DMARSHAL)
marine_rk = "pvdm"
border_rk = "command"
if(JOB_PROVOST_MARSHAL, JOB_PROVOST_CMARSHAL, JOB_PROVOST_SMARSHAL)
marine_rk = "pvm"
border_rk = "command"
// TIS
if(JOB_TIS_IO)
marine_rk = "tisio"
Expand Down Expand Up @@ -200,19 +174,19 @@
// Colonial Marshals
if(JOB_CMB_TL)
marine_rk = "mar"
icon_prefix = "cmb_"
used_icon_prefix = "cmb_"
if(JOB_CMB)
marine_rk = "dep"
icon_prefix = "cmb_"
used_icon_prefix = "cmb_"
if(JOB_CMB_SYN)
marine_rk = "syn"
icon_prefix = "cmb_"
used_icon_prefix = "cmb_"
if(JOB_CMB_ICC)
marine_rk = "icc"
icon_prefix = "cmb_"
used_icon_prefix = "cmb_"
if(JOB_CMB_OBS)
marine_rk = "obs"
icon_prefix = "cmb_"
used_icon_prefix = "cmb_"
// Check squad marines here too, for the unique ones
if(JOB_SQUAD_ENGI)
marine_rk = "engi"
Expand All @@ -227,10 +201,17 @@
if(JOB_SQUAD_LEADER)
marine_rk = "leader"

if(marine_rk)
var/image/I = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad")
I.color = "#5A934A"
holder.overlays += I
holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "[icon_prefix][marine_rk]")
if(border_rk)
holder.overlays += image('icons/mob/hud/marine_hud.dmi', current_human, "hudmarineborder[border_rk]")

if(current_human.rank_icon_state_override)
marine_rk = current_human.rank_icon_state_override
if(current_human.rank_icon_prefix_override)
used_icon_prefix = current_human.rank_icon_prefix_override

if(marine_rk)
var/image/underlay = image(used_icon_file, current_human, "hudsquad")
if(squad_clr)
underlay.color = squad_clr
else
underlay.color = "#5A934A"
holder.overlays += underlay
holder.overlays += image(used_icon_file, current_human, "[used_icon_prefix][marine_rk]")
4 changes: 2 additions & 2 deletions code/game/jobs/job/marine/squad_info.dm
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@
rank = "SL"
else
rank = ""
if(H.rank_fallback)
rank = H.rank_fallback
if(H.rank_icon_state_override)
rank = H.rank_icon_state_override
mar[H.real_name] += list("rank" = rank)
else
mar[H.real_name] += list("paygrade" = "N/A")
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/pamphlets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

/obj/item/pamphlet/skill/spotter/on_use(mob/living/carbon/human/user)
. = ..()
user.rank_fallback = "ass"
user.rank_icon_state_override = "ass"
user.hud_set_squad()

var/obj/item/card/id/ID = user.get_idcard()
Expand Down
Loading

0 comments on commit 53bf89f

Please sign in to comment.