Skip to content

Commit

Permalink
[MIRROR] Geared Assistants Station Trait (#216)
Browse files Browse the repository at this point in the history
* Geared Assistants Station Trait

* Fixes diffs, modular adjustments

* Update tgstation.dme

* Update tgstation.dme

* lets see if that fixes the hard deletes from showing up

---------

Co-authored-by: Time-Green <[email protected]>
Co-authored-by: Giz <[email protected]>
Co-authored-by: Paxilmaniac <[email protected]>
Co-authored-by: Paxilmaniac <[email protected]>
  • Loading branch information
5 people authored and FFMirrorBot committed Jan 19, 2024
1 parent 7d9b697 commit 2f3cca3
Show file tree
Hide file tree
Showing 13 changed files with 365 additions and 100 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@
#define TRAIT_BLOB_ALLY "blob_ally"

///Traits given by station traits
#define STATION_TRAIT_ASSISTANT_GIMMICKS "station_trait_assistant_gimmicks"
#define STATION_TRAIT_BANANIUM_SHIPMENTS "station_trait_bananium_shipments"
#define STATION_TRAIT_BIGGER_PODS "station_trait_bigger_pods"
#define STATION_TRAIT_BIRTHDAY "station_trait_birthday"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
),
// AKA SSstation
/datum/controller/subsystem/processing/station = list(
"STATION_TRAIT_ASSISTANT_GIMMICKS" = STATION_TRAIT_ASSISTANT_GIMMICKS,
"STATION_TRAIT_BANANIUM_SHIPMENTS" = STATION_TRAIT_BANANIUM_SHIPMENTS,
"STATION_TRAIT_BIGGER_PODS" = STATION_TRAIT_BIGGER_PODS,
"STATION_TRAIT_BIRTHDAY" = STATION_TRAIT_BIRTHDAY,
Expand Down
2 changes: 1 addition & 1 deletion code/datums/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
for(var/skillpath in skillchips)
preload += skillpath

preload -= typesof(/obj/item/clothing/under/color/random) // NOVA EDIT - Don't preload random jumpsuit spawners that delete themselves
preload -= typesof(/obj/item/clothing/under/color/random, /obj/item/camera) // NOVA EDIT - Don't preload random jumpsuit spawners that delete themselves

return preload

Expand Down
1 change: 1 addition & 0 deletions code/datums/station_traits/neutral_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
weight = 10
show_in_report = TRUE
report_message = "Due to a shortage in standard issue jumpsuits, we have provided your assistants with one of our backup supplies."
blacklist = list(/datum/station_trait/assistant_gimmicks)

/datum/station_trait/colored_assistants/New()
. = ..()
Expand Down
10 changes: 10 additions & 0 deletions code/datums/station_traits/positive_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,5 +357,15 @@
trim_state = "trim_stationengineer"
department_color = COLOR_ASSISTANT_GRAY

/// Spawns assistants with some gear, either gimmicky or functional. Maybe, one day, it will inspire an assistant to do something productive or fun
/datum/station_trait/assistant_gimmicks
name = "Geared Assistants Pilot"
report_message = "The Nanotrassen Assistant Affairs division is performing a pilot to see if different assistant equipments help improve productivity!"
trait_type = STATION_TRAIT_POSITIVE
weight = 3
trait_to_give = STATION_TRAIT_ASSISTANT_GIMMICKS
show_in_report = TRUE
blacklist = list(/datum/station_trait/colored_assistants)

#undef PARTY_COOLDOWN_LENGTH_MIN
#undef PARTY_COOLDOWN_LENGTH_MAX
10 changes: 10 additions & 0 deletions code/game/objects/items/storage/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@
. = ..()
atom_storage.set_holdable(list(/obj/item/food/egg))

/*
* Fertile Egg Box
*/

/obj/item/storage/fancy/egg_box/fertile
name = "fertile egg box"
desc = "Only one thing here is fertile, and it's not the eggs."
spawn_type = /obj/item/food/egg/fertile
spawn_count = 6

/*
* Candle Box
*/
Expand Down
13 changes: 12 additions & 1 deletion code/modules/cargo/coupon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
var/discount_pct_off = 0.05
var/obj/machinery/computer/cargo/inserted_console

/obj/item/coupon/Initialize(mapload)
. = ..()

if(discounted_pack)
update_name()

/// Choose what our prize is :D
/obj/item/coupon/proc/generate(discount, datum/supply_pack/discounted_pack)
src.discounted_pack = discounted_pack || pick(GLOB.discountable_packs[pick_weight(GLOB.pack_discount_odds)])
Expand All @@ -65,11 +71,12 @@
if(discount_pct_off != COUPON_OMEN)
if(!discount) // the discount arg should be a number already, while the keys in the chances list cannot be numbers
discount_pct_off = text2num(discount_pct_off)
name = "coupon - [round(discount_pct_off * 100)]% off [initial(src.discounted_pack.name)]"
update_name()
return

name = "coupon - fuck you"
desc = "The small text reads, 'You will be slaughtered'... That doesn't sound right, does it?"

if(!ismob(loc))
return FALSE

Expand All @@ -83,6 +90,10 @@
to_chat(cursed, span_warning("What a horrible night... To have a curse!"))
addtimer(CALLBACK(src, PROC_REF(curse_heart), cursed), 5 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE)

/obj/item/coupon/update_name()
name = "coupon - [round(discount_pct_off * 100)]% off [initial(discounted_pack.name)]"
return ..()

/// Play stupid games, win stupid prizes
/obj/item/coupon/proc/curse_heart(mob/living/cursed)
if(!iscarbon(cursed))
Expand Down
6 changes: 5 additions & 1 deletion code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
for(var/i in roundstart_experience)
spawned_human.mind.adjust_experience(i, roundstart_experience[i], TRUE)

/// Return the outfit to use
/datum/job/proc/get_outfit()
return outfit

/// Announce that this job as joined the round to all crew members.
/// Note the joining mob has no client at this point.
/datum/job/proc/announce_job(mob/living/joining_mob, job_title) // NOVA EDIT CHANGE - ALTERNATIVE_JOB_TITLES - Original: /datum/job/proc/announce_job(mob/living/joining_mob)
Expand Down Expand Up @@ -220,7 +224,7 @@

/mob/living/carbon/human/dress_up_as_job(datum/job/equipping, visual_only = FALSE, datum/preferences/used_pref) //NOVA EDIT CHANGE
dna.species.pre_equip_species_outfit(equipping, src, visual_only)
equip_outfit_and_loadout(equipping.outfit, used_pref, visual_only, equipping) //NOVA EDIT CHANGE
equip_outfit_and_loadout(equipping.get_outfit(), used_pref, visual_only, equipping) //NOVA EDIT CHANGE : ORIGINAL equipOutfit(equipping.get_outfit(), visual_only)

/// tells the given channel that the given mob is the new department head. See communications.dm for valid channels.
/datum/job/proc/announce_head(mob/living/carbon/human/H, channels, job_title) // NOVA EDIT CHANGE - ALTERNATIVE_JOB_TITLES - Original: /datum/job/proc/announce_head(mob/living/carbon/human/H, channels)
Expand Down
96 changes: 96 additions & 0 deletions code/modules/jobs/job_types/assistant/assistant.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
GLOBAL_DATUM(colored_assistant, /datum/colored_assistant)

/*
Assistant
*/
/datum/job/assistant
title = JOB_ASSISTANT
description = "Get your space legs, assist people, ask the HoP to give you a job."
faction = FACTION_STATION
total_positions = 5
spawn_positions = 5
supervisors = "absolutely everyone"
exp_granted_type = EXP_TYPE_CREW
outfit = /datum/outfit/job/assistant
plasmaman_outfit = /datum/outfit/plasmaman
paycheck = PAYCHECK_LOWER // Get a job. Job reassignment changes your paycheck now. Get over it.

paycheck_department = ACCOUNT_CIV
display_order = JOB_DISPLAY_ORDER_ASSISTANT

liver_traits = list(TRAIT_MAINTENANCE_METABOLISM)

department_for_prefs = /datum/job_department/assistant

family_heirlooms = list(/obj/item/storage/toolbox/mechanical/old/heirloom, /obj/item/clothing/gloves/cut/heirloom)

mail_goodies = list(
/obj/effect/spawner/random/food_or_drink/donkpockets = 10,
/obj/item/clothing/mask/gas = 10,
/obj/item/clothing/gloves/color/fyellow = 7,
/obj/item/choice_beacon/music = 5,
/obj/item/toy/sprayoncan = 3,
/obj/item/crowbar/large = 1
)

job_flags = STATION_JOB_FLAGS
rpg_title = "Lout"
config_tag = "ASSISTANT"

/datum/job/assistant/get_outfit()
if(!HAS_TRAIT(SSstation, STATION_TRAIT_ASSISTANT_GIMMICKS))
return ..()

var/static/list/gimmicks = list()
if(!length(gimmicks))
for(var/datum/outfit/job/assistant/gimmick/gimmick_outfit as anything in subtypesof(/datum/outfit/job/assistant/gimmick))
gimmicks[gimmick_outfit] = gimmick_outfit::outfit_weight

return pick_weight(gimmicks)

/datum/outfit/job/assistant
name = JOB_ASSISTANT
jobtype = /datum/job/assistant
id_trim = /datum/id_trim/job/assistant
belt = /obj/item/modular_computer/pda/assistant

/datum/outfit/job/assistant/pre_equip(mob/living/carbon/human/target)
..()
for(var/holidayname in GLOB.holidays)
var/datum/holiday/holiday_today = GLOB.holidays[holidayname]
var/obj/item/special_hat = holiday_today.holiday_hat
if(prob(HOLIDAY_HAT_CHANCE) && !isnull(special_hat) && isnull(head))
head = special_hat

give_jumpsuit(target)

/datum/outfit/job/assistant/proc/give_jumpsuit(mob/living/carbon/human/target)
var/static/jumpsuit_number = 0
jumpsuit_number += 1

if (isnull(GLOB.colored_assistant))
var/configured_type = get_configured_colored_assistant_type()
GLOB.colored_assistant = new configured_type

var/index = (jumpsuit_number % GLOB.colored_assistant.jumpsuits.len) + 1

//We don't cache these, because they can delete on init
//Too fragile, better to just eat the cost
if (target.jumpsuit_style == PREF_SUIT)
uniform = GLOB.colored_assistant.jumpsuits[index]
else
uniform = GLOB.colored_assistant.jumpskirts[index]

/datum/outfit/job/assistant/consistent
name = "Assistant - Consistent"

/datum/outfit/job/assistant/consistent/give_jumpsuit(mob/living/carbon/human/target)
uniform = /obj/item/clothing/under/color/grey

/datum/outfit/job/assistant/consistent/post_equip(mob/living/carbon/human/H, visualsOnly)
..()

// This outfit is used by the assets SS, which is ran before the atoms SS
if (SSatoms.initialized == INITIALIZATION_INSSATOMS)
H.w_uniform?.update_greyscale()
H.update_worn_undersuit()
Original file line number Diff line number Diff line change
@@ -1,99 +1,3 @@
GLOBAL_DATUM(colored_assistant, /datum/colored_assistant)

/*
Assistant
*/
/datum/job/assistant
title = JOB_ASSISTANT
description = "Get your space legs, assist people, ask the HoP to give you a job."
faction = FACTION_STATION
total_positions = 5
spawn_positions = 5
supervisors = "absolutely everyone"
exp_granted_type = EXP_TYPE_CREW
outfit = /datum/outfit/job/assistant
plasmaman_outfit = /datum/outfit/plasmaman
paycheck = PAYCHECK_LOWER // Get a job. Job reassignment changes your paycheck now. Get over it.

paycheck_department = ACCOUNT_CIV
display_order = JOB_DISPLAY_ORDER_ASSISTANT

liver_traits = list(TRAIT_MAINTENANCE_METABOLISM)

department_for_prefs = /datum/job_department/assistant

family_heirlooms = list(/obj/item/storage/toolbox/mechanical/old/heirloom, /obj/item/clothing/gloves/cut/heirloom)

mail_goodies = list(
/obj/effect/spawner/random/food_or_drink/donkpockets = 10,
/obj/item/clothing/mask/gas = 10,
/obj/item/clothing/gloves/color/fyellow = 7,
/obj/item/choice_beacon/music = 5,
/obj/item/toy/sprayoncan = 3,
/obj/item/crowbar/large = 1
)

job_flags = STATION_JOB_FLAGS
rpg_title = "Lout"
config_tag = "ASSISTANT"

allow_bureaucratic_error = FALSE // NOVA EDIT ADDITION

/datum/outfit/job/assistant
name = JOB_ASSISTANT
jobtype = /datum/job/assistant
id_trim = /datum/id_trim/job/assistant
uniform = /obj/item/clothing/under/color/random // NOVA EDIT ADD
belt = /obj/item/modular_computer/pda/assistant

/datum/outfit/job/assistant/pre_equip(mob/living/carbon/human/target)
..()
for(var/holidayname in GLOB.holidays)
var/datum/holiday/holiday_today = GLOB.holidays[holidayname]
var/obj/item/special_hat = holiday_today.holiday_hat
if(prob(HOLIDAY_HAT_CHANCE) && !isnull(special_hat) && isnull(head))
head = special_hat

give_jumpsuit(target)

/datum/outfit/job/assistant/proc/give_jumpsuit(mob/living/carbon/human/target)
var/static/jumpsuit_number = 0
jumpsuit_number += 1

if (isnull(GLOB.colored_assistant))
var/configured_type = get_configured_colored_assistant_type()
GLOB.colored_assistant = new configured_type

var/index = (jumpsuit_number % GLOB.colored_assistant.jumpsuits.len) + 1

// NOVA EDIT - Loadouts (we don't want jumpsuits to override the person's loadout item)
if(modified_outfit_slots & ITEM_SLOT_ICLOTHING)
return
// NOVA EDIT END

//We don't cache these, because they can delete on init
//Too fragile, better to just eat the cost
if (target.jumpsuit_style == PREF_SUIT)
uniform = GLOB.colored_assistant.jumpsuits[index]
else
uniform = GLOB.colored_assistant.jumpskirts[index]

/datum/outfit/job/assistant/consistent
name = "Assistant - Consistent"


/datum/outfit/job/assistant/consistent/give_jumpsuit(mob/living/carbon/human/target)
uniform = /obj/item/clothing/under/color/grey

/datum/outfit/job/assistant/consistent/post_equip(mob/living/carbon/human/H, visualsOnly)
..()

// This outfit is used by the assets SS, which is ran before the atoms SS
if (SSatoms.initialized == INITIALIZATION_INSSATOMS)
H.w_uniform?.update_greyscale()
H.update_worn_undersuit()


/proc/get_configured_colored_assistant_type()
return CONFIG_GET(flag/grey_assistants) ? /datum/colored_assistant/grey : /datum/colored_assistant/random

Expand Down
Loading

0 comments on commit 2f3cca3

Please sign in to comment.