Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PORT FEAT] Borg hats #23690

Merged
merged 36 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
705c8c2
Initial commit. Adds borg hats.
Dec 26, 2023
c44e1a8
No longer spam update_icons
Dec 27, 2023
e0cb7a1
Remove unused offset update
Dec 27, 2023
fb67dc4
Fixed destroyer borg icons (Fuck it, ship it)
Dec 31, 2023
a1ce9db
Borg hat examine
Jan 9, 2024
3116703
Borg hat examine
Jan 9, 2024
64e9e99
Destroyer borg fixes
Jan 21, 2024
65f0062
Requested fixes
Jan 21, 2024
435b082
Removed weird spacing
Jan 21, 2024
20f0b65
Corgis are not cyborgs
Jan 21, 2024
62f1333
Remove debugging statements
Jan 21, 2024
a0990f5
proc renaming
Jan 21, 2024
70dc5e8
Removed comments
Jan 21, 2024
cce8d04
Added documentation.
Jan 25, 2024
c9d217c
Merge remote-tracking branch 'upstream/master' into Borg-hats
Jan 29, 2024
6ad5860
Merge branch 'Borg-hats' of https://github.com/Adrer/Paradise into Bo…
Jan 29, 2024
7856738
Update code/modules/mob/living/silicon/robot/robot_mob.dm
Adrer Feb 16, 2024
4e6ba96
Update code/modules/mob/living/silicon/silicon_mob.dm
Adrer Feb 16, 2024
349ca59
Added missing sprite offset
Feb 20, 2024
5788ffe
Added comment to robot_module_hat_offset
Feb 25, 2024
a4cb046
Update code/modules/mob/living/silicon/robot/robot_mob.dm
Adrer Feb 26, 2024
ad95673
Changes to stretched_hat
Feb 28, 2024
763ec40
Merge branch 'Borg-hats' of https://github.com/Adrer/Paradise into Bo…
Feb 28, 2024
ae44d5b
Remove unnecessary user check
Feb 28, 2024
d690c8e
Guard clause time
Mar 2, 2024
fe5506c
Update code/modules/mob/living/silicon/silicon_mob.dm
Adrer Mar 3, 2024
06cb896
Update code/modules/mob/living/silicon/robot/drone/maint_drone.dm
Adrer Mar 3, 2024
2c159c2
Moved HOLOGRAM check up
Mar 3, 2024
56ce0a8
Merge branch 'Borg-hats' of https://github.com/Adrer/Paradise into Bo…
Mar 3, 2024
5c57370
Merge remote-tracking branch 'origin/master' into Borg-hats
Mar 3, 2024
528935d
I loathe DMI merge conflicts
Mar 3, 2024
fe708bd
Moved the hologram check even further up.
Mar 3, 2024
2c5792e
Merge remote-tracking branch 'upstream/master' into Borg-hats
Mar 5, 2024
6276e81
Yet more DMI conflicts
Mar 5, 2024
c6252b8
Move borg_icons back
Mar 6, 2024
09fc884
Merge remote-tracking branch 'upstream/master' into Borg-hats
Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code/modules/mob/living/silicon/ai/ai_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
see_invisible = SEE_INVISIBLE_LIVING_AI
see_in_dark = 8
can_strip = FALSE
hat_offset_y = 3
is_centered = TRUE
can_be_hatted = TRUE
var/list/network = list("SS13","Telecomms","Research Outpost","Mining Outpost")
var/obj/machinery/camera/current = null
var/list/connected_robots = list()
Expand Down Expand Up @@ -380,6 +383,10 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(powered_ai.anchored)
change_power_mode(ACTIVE_POWER_USE)

/mob/living/silicon/ai/update_icons()
. = ..()
update_hat_icons()

/mob/living/silicon/ai/proc/pick_icon()
set category = "AI Commands"
set name = "Set AI Core Display"
Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/living/silicon/robot/drone/maint_drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@
mob_size = MOB_SIZE_SMALL
pull_force = MOVE_FORCE_VERY_WEAK // Can only drag small items
modules_break = FALSE
hat_offset_y = -15
is_centered = TRUE
can_be_hatted = TRUE
can_wear_restricted_hats = TRUE
/// Cooldown for law syncs
var/sync_cooldown = 0



Adrer marked this conversation as resolved.
Show resolved Hide resolved
// We need to keep track of a few module items so we don't need to do list operations
// every time we need them. These get set in New() after the module is chosen.
var/obj/item/stack/sheet/metal/cyborg/stack_metal = null
Expand Down Expand Up @@ -127,6 +133,7 @@
overlays += "eyes-[icon_state]"
else
overlays -= "eyes"
update_hat_icons()

/mob/living/silicon/robot/drone/pick_module()
return
Expand Down
9 changes: 2 additions & 7 deletions code/modules/mob/living/silicon/robot/robot_inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,19 @@
inv2.icon_state = "inv2"
inv3.icon_state = "inv3"
module_active = module_state_1
return
if(2)
if(module_active != module_state_2)
inv1.icon_state = "inv1"
inv2.icon_state = "inv2 +a"
inv3.icon_state = "inv3"
module_active = module_state_2
return
if(3)
if(module_active != module_state_3)
inv1.icon_state = "inv1"
inv2.icon_state = "inv2"
inv3.icon_state = "inv3 +a"
module_active = module_state_3
return
update_icons()
return

//deselect_module(module) - Deselects the module slot specified by "module"
Expand All @@ -195,17 +193,15 @@
if(module_active == module_state_1)
inv1.icon_state = "inv1"
module_active = null
return
if(2)
if(module_active == module_state_2)
inv2.icon_state = "inv2"
module_active = null
return
if(3)
if(module_active == module_state_3)
inv3.icon_state = "inv3"
module_active = null
return
update_icons()
return

//toggle_module(module) - Toggles the selection of the module slot specified by "module".
Expand Down Expand Up @@ -240,7 +236,6 @@
select_module(slot_num)
return
while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up.

return

/mob/living/silicon/robot/unEquip(obj/item/I, force, silent = FALSE)
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/silicon/robot/robot_life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
module_state_2:screen_loc = ui_inv2
if(module_state_3)
module_state_3:screen_loc = ui_inv3
update_icons()

/mob/living/silicon/robot/proc/process_locks()
if(weapon_lock)
Expand Down
98 changes: 95 additions & 3 deletions code/modules/mob/living/silicon/robot/robot_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
scanner.Grant(src)
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(create_trail))

robot_module_hat_offset(icon_state)

/mob/living/silicon/robot/get_radio()
return radio

Expand Down Expand Up @@ -447,6 +449,85 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(

return module_sprites

/**
* Sets the offset for a cyborg's hats based on their module icon.
* Borgs are grouped by similar sprites (Eg. all the Noble borgs are all the same sprite but recoloured.)
*
* Arguments:
* * module - An `icon_state` for which the offset needs to be calculated.
*/
/mob/living/silicon/robot/proc/robot_module_hat_offset(module)
switch(module)
if("Engineering", "Miner_old", "JanBot2", "Medbot", "engineerrobot", "maximillion", "secborg", "Hydrobot")
can_be_hatted = FALSE // Their base sprite already comes with a hat
hat_offset_y = -1
if("Noble-CLN", "Noble-SRV", "Noble-DIG", "Noble-MED", "Noble-SEC", "Noble-ENG", "Noble-STD")
can_be_hatted = TRUE
can_wear_restricted_hats = TRUE
hat_offset_y = 4
if("droid-medical")
can_be_hatted = TRUE
can_wear_restricted_hats = TRUE
hat_offset_y = 4
Adrer marked this conversation as resolved.
Show resolved Hide resolved
if("droid-miner", "mk2", "mk3")
can_be_hatted = TRUE
is_centered = TRUE
hat_offset_y = 3
if("bloodhound", "nano_bloodhound", "syndie_bloodhound", "ertgamma")
can_be_hatted = TRUE
hat_offset_y = 1
if("Cricket-SEC", "Cricket-MEDI", "Cricket-JANI", "Cricket-ENGI", "Cricket-MINE", "Cricket-SERV")
can_be_hatted = TRUE
hat_offset_y = 2
if("droidcombat-shield", "droidcombat")
can_be_hatted = TRUE
hat_alpha = 255
hat_offset_y = 2
if("droidcombat-roll")
can_be_hatted = TRUE
hat_alpha = 0
hat_offset_y = 2
if("syndi-medi", "surgeon", "toiletbot")
can_be_hatted = TRUE
is_centered = TRUE
hat_offset_y = 1
if("Security", "janitorrobot", "medicalrobot")
can_be_hatted = TRUE
is_centered = TRUE
can_wear_restricted_hats = TRUE
hat_offset_y = -1
if("Brobot", "Service", "Service2", "robot_old", "securityrobot")
can_be_hatted = TRUE
is_centered = TRUE
can_wear_restricted_hats = TRUE
hat_offset_y = -1
if("Miner", "lavaland")
can_be_hatted = TRUE
hat_offset_y = -1
if("robot", "Standard", "Standard-Secy", "Standard-Medi", "Standard-Engi",
"Standard-Jani", "Standard-Serv", "Standard-Mine", "xenoborg-state-a")
can_be_hatted = TRUE
hat_offset_y = -3
if("droid")
can_be_hatted = TRUE
is_centered = TRUE
can_wear_restricted_hats = TRUE
hat_offset_y = -4
if("landmate", "syndi-engi")
can_be_hatted = TRUE
hat_offset_y = -7
if("mopgearrex")
can_be_hatted = TRUE
hat_offset_y = -6

if(silicon_hat)
if(!can_be_hatted)
remove_from_head(usr)
return
if(!can_wear_restricted_hats && is_type_in_list(silicon_hat, restricted_hats))
remove_from_head(usr)
return

/**
* Sets up the module items and sprites for the cyborg module chosen in `pick_module()`.
*
Expand Down Expand Up @@ -510,6 +591,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
custom_panel = trim(names[1])

update_module_icon()
robot_module_hat_offset(icon_state)
update_icons()
SSblackbox.record_feedback("tally", "cyborg_modtype", 1, "[lowertext(selected_module)]")
notify_ai(2)
Expand All @@ -536,6 +618,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
radio.recalculateChannels()
custom_panel = null

robot_module_hat_offset(icon_state)
update_icons()
update_headlamp()

Expand Down Expand Up @@ -1086,6 +1169,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(

/mob/living/silicon/robot/update_icons()
overlays.Cut()
borg_icons()
Adrer marked this conversation as resolved.
Show resolved Hide resolved
if(stat != DEAD && !(IsParalyzed() || IsStunned() || IsWeakened() || low_power_mode)) //Not dead, not stunned.
if(custom_panel in custom_eye_names)
overlays += "eyes-[custom_panel]"
Expand All @@ -1105,7 +1189,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
overlays += "[panelprefix]-openpanel +c"
else
overlays += "[panelprefix]-openpanel -c"
borg_icons()
robot_module_hat_offset(icon_state)
update_hat_icons()
update_fire()

/mob/living/silicon/robot/proc/borg_icons() // Exists so that robot/destroyer can override it
Expand Down Expand Up @@ -1236,6 +1321,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
if(cell) //Sanity check.
cell.forceMove(T)
cell = null
drop_hat()
qdel(src)

#define CAMERA_UPDATE_COOLDOWN 2.5 SECONDS
Expand Down Expand Up @@ -1588,8 +1674,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
set category = "Robot Commands"
set name = "Power Warning"



if(!is_component_functioning("power cell") || !cell || !cell.charge)
if(!start_audio_emote_cooldown(TRUE, 10 SECONDS))
to_chat(src, "<span class='warning'>The low-power capacitor for your speaker system is still recharging, please try again later.</span>")
Expand All @@ -1604,3 +1688,11 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
if(emagged || ("syndicate" in faction))
return TRUE
return FALSE

/datum/emote/flip/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(isrobot(user))
var/mob/living/silicon/robot/borg = user
if(borg.drop_hat())
borg.visible_message("<span class='warning'><span class='name'>[src]</span> drops their hat!</span>",
"<span class='warning'>Your hat falls off!</span>")
Loading