Skip to content

Commit

Permalink
Merge branch 'Bubberstation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MosleyTheMalO authored Aug 16, 2024
2 parents 27f9dbe + 2f9ff35 commit 7058355
Show file tree
Hide file tree
Showing 16 changed files with 244 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/~~bubber_defines/footsteps.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//footstep mob defines
#define FOOTSTEP_MOB_SNAKE "footstep_snake"
#define FOOTSTEP_ROBOT_SMALL "footstep_smallrobot"
2 changes: 2 additions & 0 deletions code/datums/elements/footstep.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
// BUBBER EDIT START
if(FOOTSTEP_MOB_SNAKE)
footstep_sounds = 'sound/effects/footstep/crawl1.ogg'
if(FOOTSTEP_ROBOT_SMALL)
footstep_sounds = 'sound/effects/servostep.ogg'
// BUBBER EDIT END
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep))
steps_for_living[target] = 0
Expand Down
2 changes: 1 addition & 1 deletion code/datums/records/manifest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)

// SKYRAT EDIT ADDITION BEGIN - ALTERNATIVE_JOB_TITLES
// The alt job title, if user picked one, or the default
var/chosen_assignment = person_client?.prefs.alt_job_titles[assignment] || assignment
var/chosen_assignment = id_card?.get_job_title() || assignment //BUBBER EDIT: Intern Job Tags
// SKYRAT EDIT ADDITION END - ALTERNATIVE_JOB_TITLES

var/datum/record/locked/lockfile = new(
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,17 @@
/// Updates the name based on the card's vars and state.
/obj/item/card/id/proc/update_label()
var/name_string = registered_name ? "[registered_name]'s ID Card" : initial(name)
var/assignment_string
var/assignment_string = get_job_title() // BUBBER EDIT: Adds a new proc which is used to get a job title

/* BUBBER EDIT: Moved to `get_job_title()`
if(is_intern)
if(assignment)
assignment_string = trim?.intern_alt_name || "Intern [assignment]"
else
assignment_string = "Intern"
else
assignment_string = assignment
*/

name = "[name_string] ([assignment_string])"

Expand Down
8 changes: 8 additions & 0 deletions code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@
if(roundstart_experience)
for(var/i in roundstart_experience)
spawned_human.mind.adjust_experience(i, roundstart_experience[i], TRUE)
// BUBBER EDIT START - Intern jobs
var/obj/item/card/id/id_card = spawned.get_idcard()
if(id_card && istype(id_card))
id_card.set_intern_status(player_joins_as_intern(player_client))
var/obj/item/modular_computer/pda/pda = spawned.get_item_by_slot(ITEM_SLOT_BELT)
if(pda && istype(pda))
pda.imprint_id(job_name = id_card.get_job_title())
// BUBBER EDIT END

/// Return the outfit to use
/datum/job/proc/get_outfit(consistent)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/silicon/robot/robot_model.dm
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
new_model.update_quadruped()
new_model.update_lightweight()
new_model.update_robot_rest()
new_model.update_footsteps()
//BUBBER EDIT ADDTION END

INVOKE_ASYNC(new_model, PROC_REF(do_transform_animation))
Expand Down
15 changes: 15 additions & 0 deletions config/bubbers/bubbers_config.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## Allows intern tags to be applied to people new to the jobs, adding a prefix to their ID job title, only works with DB and exp_tracking enabled
ALLOW_INTERN_JOB_TAGS

## Makes it so that people are no longer eligible for the intern tag, if they have enough job exp to unlock the "master" job, which is usually the head position of the department
#USE_INTERN_MASTER_JOB_UNLOCK_THRESHOLD

## Time thresholds in hours for job experience until people are no longer eligible for the intern tag
INTERN_THRESHOLD_SECURITY 20
INTERN_THRESHOLD_CARGO 20
INTERN_THRESHOLD_MEDICAL 20
INTERN_THRESHOLD_SCIENCE 20
INTERN_THRESHOLD_SERVICE 20
INTERN_THRESHOLD_ENGINEERING 20
INTERN_THRESHOLD_COMMAND 20

# Vetted player system
## If enabled, it will use checks to determine if a player is vetted or not in different parts of the game
#CHECK_VETTED
6 changes: 6 additions & 0 deletions html/changelogs/AutoChangeLog-pr-1883.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: "pixelkitty286"
delete-after: True
changes:
- rscadd: "cat like grace to lightweight chassis and small quad borg walking sounds"
- image: "catborg death sprites"
- code_imp: "changed how cyborgs get their walking sounds."
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-1900.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Azarak (code), ReturnToZender (bugfixing)"
delete-after: True
changes:
- rscadd: "New players to a department now show properly as interns."
4 changes: 2 additions & 2 deletions modular_skyrat/modules/borgs/code/robot_model.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
return
if (model_features && (TRAIT_R_TALL in model_features))
cyborg.maptext_height = 48 //Runechat blabla
cyborg.AddElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE)
//cyborg.AddElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE)// BUBBER REMOVAL - Moved into update_footsteps()
//add_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down)// BUBBER REMOVAL - Moved into update_robot_rest()
switch(cyborg_base_icon)
if("mekamine")
Expand All @@ -23,7 +23,7 @@

else
cyborg.maptext_height = initial(cyborg.maptext_height)
cyborg.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE)
//cyborg.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE)// BUBBER REMOVAL - Moved into update_footsteps()
//remove_verb(cyborg, /mob/living/silicon/robot/proc/robot_lay_down)// BUBBER REMOVAL - Moved into update_robot_rest()
if(cyborg.GetComponent(/datum/component/robot_smoke))
qdel(cyborg.GetComponent(/datum/component/robot_smoke))
Expand Down
24 changes: 24 additions & 0 deletions modular_zubbers/code/modules/borgs/code/robot_model.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,33 @@
if (model_features && (TRAIT_R_LIGHT_WEIGHT in model_features))
cyborg.can_be_held = TRUE
cyborg.held_w_class = WEIGHT_CLASS_HUGE
cyborg.add_traits(list(TRAIT_CATLIKE_GRACE), INNATE_TRAIT)
cyborg.mob_size = MOB_SIZE_SMALL
else
cyborg.can_be_held = FALSE
cyborg.held_w_class = WEIGHT_CLASS_NORMAL
cyborg.remove_traits(list(TRAIT_CATLIKE_GRACE), INNATE_TRAIT)
cyborg.mob_size = MOB_SIZE_HUMAN

// To load the correct walking sounds with out removing them
/obj/item/robot_model/proc/update_footsteps()
var/mob/living/silicon/robot/cyborg = robot || loc
if (!istype(robot))
return

if (model_features)
// This is ugly but there is unironically not a better way
if (TRAIT_R_SQUADRUPED in model_features)
cyborg.AddElement(/datum/element/footstep, FOOTSTEP_ROBOT_SMALL, 6, -6, sound_vary = TRUE)
else
cyborg.RemoveElement(/datum/element/footstep, FOOTSTEP_ROBOT_SMALL, 6, -6, sound_vary = TRUE)

if (TRAIT_R_TALL in model_features)
cyborg.AddElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE)
else
cyborg.RemoveElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 2, -6, sound_vary = TRUE)



//For cyborgs that can rest
// Must have a resting state!
Expand Down
Binary file modified modular_zubbers/code/modules/borgs/sprites/felibot_all.dmi
Binary file not shown.
26 changes: 26 additions & 0 deletions modular_zubbers/code/modules/job_interns/config.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// Config flag to allow intern tags to be added to ID's
/datum/config_entry/flag/allow_intern_job_tags

/// Config flag to tag interns based on whether they unlocked the master job (head position usually)
/datum/config_entry/flag/use_intern_master_job_unlock_threshold

/// Intern time for security jobs
/datum/config_entry/number/intern_threshold_security

/// Intern time for cargo jobs
/datum/config_entry/number/intern_threshold_cargo

/// Intern time for medical jobs
/datum/config_entry/number/intern_threshold_medical

/// Intern time for science jobs
/datum/config_entry/number/intern_threshold_science

/// Intern time for service jobs
/datum/config_entry/number/intern_threshold_service

/// Intern time for engineering jobs
/datum/config_entry/number/intern_threshold_engineering

/// Intern time for command jobs
/datum/config_entry/number/intern_threshold_command
140 changes: 140 additions & 0 deletions modular_zubbers/code/modules/job_interns/job_interns.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/// Enables the choice of players disabling their Intern ID tag
/datum/preference/toggle/be_intern
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "be_intern"
savefile_identifier = PREFERENCE_PLAYER
default_value = TRUE

/datum/job
/// Whether the ID of the job can be tagged as an intern at all
var/can_be_intern = TRUE
/// Whether the job uses its own EXP to define the internship status
var/internship_use_self_exp_type = FALSE

/// Returns the highest priority department this job belongs to
/datum/job/proc/get_highest_priority_department()
if(!length(departments_list))
return null
// Prioritize command
if(/datum/job_department/command in departments_list)
return /datum/job_department/command
// Then security
if(/datum/job_department/security in departments_list)
return /datum/job_department/security
// Then get any first one
return departments_list[1]

/// Returns the type of intern exp used
/datum/job/proc/get_intern_exp_type()
var/prio_department = get_highest_priority_department()
if(isnull(prio_department))
return
var/datum/job_department/department = SSjob.get_department_type(prio_department)
return department.department_experience_type

/// Returns the amount of time required to not be intern
/datum/job/proc/get_intern_time_threshold()
var/intern_exp_type = get_intern_exp_type()
if(!intern_exp_type)
return 0
var/config_type
switch(intern_exp_type)
if(EXP_TYPE_COMMAND)
config_type = /datum/config_entry/number/intern_threshold_command
if(EXP_TYPE_SECURITY)
config_type = /datum/config_entry/number/intern_threshold_security
if(EXP_TYPE_SUPPLY)
config_type = /datum/config_entry/number/intern_threshold_cargo
if(EXP_TYPE_ENGINEERING)
config_type = /datum/config_entry/number/intern_threshold_engineering
if(EXP_TYPE_SERVICE)
config_type = /datum/config_entry/number/intern_threshold_service
if(EXP_TYPE_MEDICAL)
config_type = /datum/config_entry/number/intern_threshold_medical
if(EXP_TYPE_SCIENCE)
config_type = /datum/config_entry/number/intern_threshold_science
if(isnull(config_type))
return 0
return global.config.Get(config_type) * 60

/// Returns whether a player should be tagged as an intern in this job
/datum/job/proc/player_joins_as_intern(client/player_client)
if(!can_be_intern)
return FALSE
if(!CONFIG_GET(flag/allow_intern_job_tags))
return FALSE
if(!SSdbcore.Connect())
return FALSE
if(job_flags & JOB_HEAD_OF_STAFF)
return FALSE
if(!player_client?.prefs?.read_preference(/datum/preference/toggle/be_intern)) // If the pref is off, we stop here
return FALSE
var/required_time
var/playtime
if(internship_use_self_exp_type)
var/list/play_records = player_client?.prefs?.exp
if(!play_records || !islist(play_records))
stack_trace("[src] client [player_client] checking for play records resulted in invalid record data")
return FALSE
playtime = play_records[title] ? text2num(play_records[title]) : 0
required_time = get_intern_time_threshold()
else if(CONFIG_GET(flag/use_intern_master_job_unlock_threshold) && length(department_head))
// Use first department head job as our master job to compare to
var/datum/job/master_job = SSjob.GetJob(department_head[1])
playtime = player_client?.calc_exp_type(master_job.get_exp_req_type())
required_time = master_job.get_exp_req_amount()
else
var/exp_type = get_intern_exp_type()
if(!exp_type)
stack_trace("[src] failed to get intern exp type")
return FALSE
required_time = get_intern_time_threshold()
playtime = player_client?.calc_exp_type(exp_type)
if(isnull(playtime))
if(!player_client)
stack_trace("[src] tried to check playtime against no player client")
else
stack_trace("[src] client [player_client] checking for playtime resulted in null")
return FALSE
if(!required_time)
stack_trace("[src] job failed to set intern time threshold")
return FALSE
if(playtime >= required_time)
return FALSE
return TRUE

/obj/item/card/id
var/intern_status = FALSE

/// Sets an intern status and updates the label of the ID
/obj/item/card/id/proc/set_intern_status(new_status)
intern_status = new_status
update_label()

/obj/item/card/id/proc/get_job_title()
var/assignment_string
if(is_intern || intern_status)
if(assignment)
assignment_string = trim?.intern_alt_name || "Intern [assignment]"
else
assignment_string = "Intern"
else
assignment_string = assignment
return assignment_string


// Service
/datum/job/bartender
internship_use_self_exp_type = TRUE

/datum/job/janitor
internship_use_self_exp_type = TRUE

/datum/job/botanist
internship_use_self_exp_type = TRUE

/datum/job/cook
internship_use_self_exp_type = TRUE

/datum/job/prisoner
can_be_intern = FALSE
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -8909,6 +8909,8 @@
#include "modular_zubbers\code\modules\item_reskins\plastic.dm"
#include "modular_zubbers\code\modules\job_estimation\code\dead.dm"
#include "modular_zubbers\code\modules\job_exempt\job_exempt.dm"
#include "modular_zubbers\code\modules\job_interns\config.dm"
#include "modular_zubbers\code\modules\job_interns\job_interns.dm"
#include "modular_zubbers\code\modules\jobs\_job.dm"
#include "modular_zubbers\code\modules\jobs\job_types\blacksmith.dm"
#include "modular_zubbers\code\modules\jobs\job_types\blueshield.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { CheckboxInput, FeatureToggle } from '../../base';

export const be_intern: FeatureToggle = {
name: 'Be Tagged As Intern',
category: 'GAMEPLAY',
description:
'Toggles whether you will be tagged as an intern in jobs where you have low playtime.',
component: CheckboxInput,
};

0 comments on commit 7058355

Please sign in to comment.