Skip to content

Commit

Permalink
Adds new loadout items (#4801)
Browse files Browse the repository at this point in the history
# About the pull request

New loadout items for customization

# Explain why it's good for the game

When someone inevitably finds your corpse, some personalized stuff on it
can add that much more storytelling.

# Changelog

:cl:
add: Added many new loadout items
code: Added a signal to items that triggers right after the mob finishes
spawning
code: Added a signal to add additional behavior to storing items in
shoes
/:cl:
  • Loading branch information
BeagleGaming1 authored Nov 3, 2023
1 parent 6f80e92 commit 4a4c57a
Show file tree
Hide file tree
Showing 36 changed files with 45,825 additions and 45,292 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@

/// from /obj/item/weapon/gun/proc/load_into_chamber() : ()
#define COMSIG_GUN_INTERRUPT_FIRE "gun_interrupt_fire"

//Additional procs on items that will be triggered right after the human finishes spawns in
#define COMSIG_POST_SPAWN_UPDATE "post_spawn_update"
2 changes: 1 addition & 1 deletion code/datums/supply_packs/black_market.dm
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ Primarily made up of things that would be best utilized, well, shipside. Recreat
/obj/item/storage/box/packet/hefa/toy,
/obj/item/toy/inflatable_duck,
/obj/item/toy/beach_ball,
/obj/item/toy/farwadoll,
/obj/item/toy/plush/farwa,
/obj/item/toy/waterflower,
/obj/item/toy/spinningtoy,
/obj/item/storage/box/snappops,
Expand Down
81 changes: 42 additions & 39 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -501,85 +501,88 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
M.job = null


/datum/authority/branch/role/proc/equip_role(mob/living/M, datum/job/J, turf/late_join)
if(!istype(M) || !istype(J))
/datum/authority/branch/role/proc/equip_role(mob/living/new_mob, datum/job/new_job, turf/late_join)
if(!istype(new_mob) || !istype(new_job))
return

. = TRUE

if(!ishuman(M))
if(!ishuman(new_mob))
return

var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/new_human = new_mob

if(J.job_options && H?.client?.prefs?.pref_special_job_options[J.title])
J.handle_job_options(H.client.prefs.pref_special_job_options[J.title])
if(new_job.job_options && new_human?.client?.prefs?.pref_special_job_options[new_job.title])
new_job.handle_job_options(new_human.client.prefs.pref_special_job_options[new_job.title])

var/job_whitelist = J.title
var/whitelist_status = J.get_whitelist_status(roles_whitelist, H.client)
var/job_whitelist = new_job.title
var/whitelist_status = new_job.get_whitelist_status(roles_whitelist, new_human.client)

if(whitelist_status)
job_whitelist = "[J.title][whitelist_status]"
job_whitelist = "[new_job.title][whitelist_status]"

H.job = J.title //TODO Why is this a mob variable at all?
new_human.job = new_job.title //TODO Why is this a mob variable at all?

if(J.gear_preset_whitelist[job_whitelist])
arm_equipment(H, J.gear_preset_whitelist[job_whitelist], FALSE, TRUE)
var/generated_account = J.generate_money_account(H)
J.announce_entry_message(H, generated_account, whitelist_status) //Tell them their spawn info.
J.generate_entry_conditions(H, whitelist_status) //Do any other thing that relates to their spawn.
if(new_job.gear_preset_whitelist[job_whitelist])
arm_equipment(new_human, new_job.gear_preset_whitelist[job_whitelist], FALSE, TRUE)
var/generated_account = new_job.generate_money_account(new_human)
new_job.announce_entry_message(new_human, generated_account, whitelist_status) //Tell them their spawn info.
new_job.generate_entry_conditions(new_human, whitelist_status) //Do any other thing that relates to their spawn.
else
arm_equipment(H, J.gear_preset, FALSE, TRUE) //After we move them, we want to equip anything else they should have.
var/generated_account = J.generate_money_account(H)
J.announce_entry_message(H, generated_account) //Tell them their spawn info.
J.generate_entry_conditions(H) //Do any other thing that relates to their spawn.
arm_equipment(new_human, new_job.gear_preset, FALSE, TRUE) //After we move them, we want to equip anything else they should have.
var/generated_account = new_job.generate_money_account(new_human)
new_job.announce_entry_message(new_human, generated_account) //Tell them their spawn info.
new_job.generate_entry_conditions(new_human) //Do any other thing that relates to their spawn.

if(J.flags_startup_parameters & ROLE_ADD_TO_SQUAD) //Are we a muhreen? Randomize our squad. This should go AFTER IDs. //TODO Robust this later.
randomize_squad(H)
if(new_job.flags_startup_parameters & ROLE_ADD_TO_SQUAD) //Are we a muhreen? Randomize our squad. This should go AFTER IDs. //TODO Robust this later.
randomize_squad(new_human)

if(Check_WO() && job_squad_roles.Find(GET_DEFAULT_ROLE(H.job))) //activates self setting proc for marine headsets for WO
if(Check_WO() && job_squad_roles.Find(GET_DEFAULT_ROLE(new_human.job))) //activates self setting proc for marine headsets for WO
var/datum/game_mode/whiskey_outpost/WO = SSticker.mode
WO.self_set_headset(H)
WO.self_set_headset(new_human)

var/assigned_squad
if(ishuman(H))
var/mob/living/carbon/human/human = H
if(ishuman(new_human))
var/mob/living/carbon/human/human = new_human
if(human.assigned_squad)
assigned_squad = human.assigned_squad.name

if(isturf(late_join))
H.forceMove(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[J.title])
late_join_turf = get_turf(pick(GLOB.latejoin_by_job[J.title]))
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))
H.forceMove(late_join_turf)
new_human.forceMove(late_join_turf)
else
var/turf/join_turf
if(assigned_squad && GLOB.spawns_by_squad_and_job[assigned_squad] && GLOB.spawns_by_squad_and_job[assigned_squad][J.type])
join_turf = get_turf(pick(GLOB.spawns_by_squad_and_job[assigned_squad][J.type]))
else if(GLOB.spawns_by_job[J.type])
join_turf = get_turf(pick(GLOB.spawns_by_job[J.type]))
if(assigned_squad && GLOB.spawns_by_squad_and_job[assigned_squad] && GLOB.spawns_by_squad_and_job[assigned_squad][new_job.type])
join_turf = get_turf(pick(GLOB.spawns_by_squad_and_job[assigned_squad][new_job.type]))
else if(GLOB.spawns_by_job[new_job.type])
join_turf = get_turf(pick(GLOB.spawns_by_job[new_job.type]))
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))
H.forceMove(join_turf)
new_human.forceMove(join_turf)

for(var/cardinal in GLOB.cardinals)
var/obj/structure/machinery/cryopod/pod = locate() in get_step(H, cardinal)
var/obj/structure/machinery/cryopod/pod = locate() in get_step(new_human, cardinal)
if(pod)
pod.go_in_cryopod(H, silent = TRUE)
pod.go_in_cryopod(new_human, silent = TRUE)
break

H.sec_hud_set_ID()
H.hud_set_squad()
new_human.sec_hud_set_ID()
new_human.hud_set_squad()

SSround_recording.recorder.track_player(H)
for(var/obj/current_item in new_human.get_contents())
SEND_SIGNAL(current_item, COMSIG_POST_SPAWN_UPDATE, new_human)

SSround_recording.recorder.track_player(new_human)

//Find which squad has the least population. If all 4 squads are equal it should just use a random one
/datum/authority/branch/role/proc/get_lowest_squad(mob/living/carbon/human/H)
Expand Down
Loading

0 comments on commit 4a4c57a

Please sign in to comment.