forked from Bubberstation/Bubberstation
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Bubberstation:master' into master
- Loading branch information
Showing
16 changed files
with
244 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
140
modular_zubbers/code/modules/job_interns/job_interns.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...gui/interfaces/PreferencesMenu/preferences/features/game_preferences/bubber/be_intern.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; |