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

add: health insurance #5921

Merged
merged 22 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions code/__DEFINES/insurance.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#define INSURANCE_NONE 0
#define INSURANCE_BUDGETARY 1000
#define INSURANCE_STANDART 3000
#define INSURANCE_EXTENDED 6000
#define INSURANCE_DELUXE 10000
#define INSURANCE_NT_SPECIAL 100000 // CC roles don't have accounts, but if they do, they will have this insurance.

#define INSURANCE_NONE_COST 0
#define INSURANCE_BUDGETARY_COST 0
#define INSURANCE_STANDART_COST 500
#define INSURANCE_DELUXE_COST 2000

#define INSURANCE_TYPE_NONE "None"
#define INSURANCE_TYPE_BUDGETARY "Bugetary"
#define INSURANCE_TYPE_STANDART "Standart"
#define INSURANCE_TYPE_EXTENDED "Extended"
#define INSURANCE_TYPE_DELUXE "Deluxe"
#define INSURANCE_TYPE_NT_SPECIAL "NT Special"

#define REQ_INSURANCE_BRUT 1.5
#define REQ_INSURANCE_BURN 1.5
#define REQ_INSURANCE_OXY 0.5
#define REQ_INSURANCE_TOX 0.5
#define REQ_INSURANCE_ORGAN 1
#define REQ_INSURANCE_RAD 1
#define REQ_INSURANCE_CLONE 2
#define REQ_INSURANCE_BLOOD 2 // 1% of max blood
#define REQ_INSURANCE_INTBLEED 150
#define REQ_INSURANCE_BONE 150
#define REQ_INSURANCE_LOST_ORGAN 300
#define REQ_INSURANCE_LOST_LIMB 300
#define REQ_INSURANCE_CRIT 250
#define REQ_INSURANCE_DEATH 500
22 changes: 20 additions & 2 deletions code/controllers/subsystem/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ SUBSYSTEM_DEF(jobs)
/datum/controller/subsystem/jobs/proc/CreateMoneyAccount(mob/living/H, rank, datum/job/job)
var/money_amount = rand(job.min_start_money, job.max_start_money)
var/datum/money_account/M = create_account(H.real_name, money_amount, null, job, TRUE)
if(H.dna)
GLOB.dna2account[H.dna] = M

var/remembered_info = ""

remembered_info += "<b>Номер вашего аккаунта:</b> #[M.account_number]<br>"
Expand All @@ -663,6 +666,21 @@ SUBSYSTEM_DEF(jobs)

H.mind.initial_account = M

H.mind.initial_account.insurance_type = job.insurance_type
switch (job.insurance_type)
if(INSURANCE_TYPE_NONE)
H.mind.initial_account.insurance = INSURANCE_NONE
if(INSURANCE_TYPE_BUDGETARY)
H.mind.initial_account.insurance = INSURANCE_BUDGETARY
if(INSURANCE_TYPE_STANDART)
H.mind.initial_account.insurance = INSURANCE_STANDART
if(INSURANCE_TYPE_EXTENDED)
H.mind.initial_account.insurance = INSURANCE_EXTENDED
if(INSURANCE_TYPE_DELUXE)
H.mind.initial_account.insurance = INSURANCE_DELUXE
if(INSURANCE_TYPE_NT_SPECIAL)
H.mind.initial_account.insurance = INSURANCE_NT_SPECIAL

spawn(0)
to_chat(H, "<span class='boldnotice'>Номер вашего аккаунта: [M.account_number], ПИН вашего аккаунта: [M.remote_access_pin]</span>")

Expand Down Expand Up @@ -711,11 +729,11 @@ SUBSYSTEM_DEF(jobs)
/datum/controller/subsystem/jobs/proc/account_job_transfer(name_owner, job_title, salary_capcap = TRUE)

var/datum/money_account/account_job = get_account_with_name(name_owner)

if(account_job)
account_job.linked_job = SSjobs.GetJob(job_title)
account_job.salary_payment_active = salary_capcap

/datum/controller/subsystem/jobs/proc/notify_dept_head(jobtitle, antext)
// Used to notify the department head of jobtitle X that their employee was brigged, demoted or terminated
if(!jobtitle || !antext)
Expand Down
7 changes: 0 additions & 7 deletions code/defines/procs/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,3 @@
freq_text = format_frequency(display_freq)

return freq_text

/proc/get_message_server()
if(GLOB.message_servers)
for(var/obj/machinery/message_server/MS in GLOB.message_servers)
if(MS.active)
return MS
return null
1 change: 1 addition & 0 deletions code/game/jobs/job/civilian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
minimal_access = list() //See /datum/job/assistant/get_access()
alt_titles = list("Tourist","Businessman","Trader","Assistant")
outfit = /datum/outfit/job/assistant
insurance_type = INSURANCE_TYPE_BUDGETARY

salary = SALARY_FOR_NISHEBROD
min_start_money = 10
Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/engineering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
exp_requirements = 3000
exp_type = EXP_TYPE_ENGINEERING
outfit = /datum/outfit/job/chief_engineer
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down
3 changes: 3 additions & 0 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
var/required_objectives=list() // Objectives that are ALWAYS added.
var/optional_objectives=list() // Objectives that are SOMETIMES added.

var/insurance = INSURANCE_STANDART
var/insurance_type = INSURANCE_TYPE_STANDART

//Only override this proc
/datum/job/proc/after_spawn(mob/living/carbon/human/H)

Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
exp_requirements = 3000
exp_type = EXP_TYPE_MEDICAL
outfit = /datum/outfit/job/cmo
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/science.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/datum/job_objective/further_research
)
outfit = /datum/outfit/job/rd
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down
6 changes: 6 additions & 0 deletions code/game/jobs/job/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
exp_type = EXP_TYPE_SECURITY
disabilities_allowed = 0
outfit = /datum/outfit/job/hos
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down Expand Up @@ -79,6 +80,7 @@
exp_requirements = 2100
exp_type = EXP_TYPE_SECURITY
outfit = /datum/outfit/job/warden
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down Expand Up @@ -130,6 +132,7 @@
blocked_race_for_job = list(SPECIES_VOX)
exp_type = EXP_TYPE_SECURITY
outfit = /datum/outfit/job/detective
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down Expand Up @@ -194,6 +197,7 @@
exp_requirements = 600
exp_type = EXP_TYPE_CREW
outfit = /datum/outfit/job/officer
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down Expand Up @@ -262,6 +266,7 @@
exp_requirements = 1800
exp_type = EXP_TYPE_MEDICAL
outfit = /datum/outfit/job/brigdoc
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down Expand Up @@ -303,6 +308,7 @@
exp_requirements = 1200
exp_type = EXP_TYPE_SECURITY
outfit = /datum/outfit/job/pilot
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down
2 changes: 2 additions & 0 deletions code/game/jobs/job/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
minimal_player_age = 30
exp_requirements = 3000
exp_type = EXP_TYPE_SILICON
insurance_type = INSURANCE_TYPE_NONE

/datum/job/ai/equip(mob/living/carbon/human/H)
if(!H)
Expand All @@ -33,6 +34,7 @@
exp_requirements = 300
exp_type = EXP_TYPE_CREW
alt_titles = list("Robot")
insurance_type = INSURANCE_TYPE_NONE

/datum/job/cyborg/equip(mob/living/carbon/human/H)
if(!H)
Expand Down
6 changes: 6 additions & 0 deletions code/game/jobs/job/supervisor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca
exp_type = EXP_TYPE_COMMAND
disabilities_allowed = 0
outfit = /datum/outfit/job/captain
insurance_type = INSURANCE_TYPE_DELUXE

salary = 500
min_start_money = 600
Expand Down Expand Up @@ -89,6 +90,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca
ACCESS_THEATRE, ACCESS_CHAPEL_OFFICE, ACCESS_LIBRARY, ACCESS_RESEARCH, ACCESS_HEADS_VAULT, ACCESS_MINING_STATION,
ACCESS_CLOWN, ACCESS_MIME, ACCESS_HOP, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_GATEWAY, ACCESS_WEAPONS, ACCESS_MINERAL_STOREROOM)
outfit = /datum/outfit/job/hop
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down Expand Up @@ -146,6 +148,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca
ACCESS_CLOWN, ACCESS_MIME, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_GATEWAY, ACCESS_WEAPONS, ACCESS_NTREP)
alt_titles = list("NT Consultant","Central Command Consultant")
outfit = /datum/outfit/job/nanotrasenrep
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down Expand Up @@ -193,6 +196,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca
minimal_access = list(ACCESS_FORENSICS_LOCKERS, ACCESS_SEC_DOORS, ACCESS_MEDICAL, ACCESS_CONSTRUCTION, ACCESS_ENGINE, ACCESS_MAINT_TUNNELS, ACCESS_RESEARCH,
ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_HEADS, ACCESS_BLUESHIELD, ACCESS_WEAPONS)
outfit = /datum/outfit/job/blueshield
insurance_type = INSURANCE_TYPE_DELUXE

salary = 300
min_start_money = 400
Expand Down Expand Up @@ -251,6 +255,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca
minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_LAWYER, ACCESS_MAGISTRATE, ACCESS_HEADS)
alt_titles = list("Judge")
outfit = /datum/outfit/job/judge
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down Expand Up @@ -300,6 +305,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca
exp_requirements = 3000
exp_type = EXP_TYPE_CREW
outfit = /datum/outfit/job/lawyer
insurance_type = INSURANCE_TYPE_DELUXE

salary = 170
min_start_money = 200
Expand Down
2 changes: 2 additions & 0 deletions code/game/jobs/job/support.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
exp_type = EXP_TYPE_CREW
alt_titles = list("Chief Supply Manager")
outfit = /datum/outfit/job/qm
insurance_type = INSURANCE_TYPE_DELUXE // Always has been.

//QM IS NOT THE HEAD!!
salary = 300
Expand Down Expand Up @@ -86,6 +87,7 @@
minimal_access = list(ACCESS_MINING, ACCESS_MINT, ACCESS_MINING_STATION, ACCESS_MAILSORTING, ACCESS_MAINT_TUNNELS, ACCESS_MINERAL_STOREROOM)
alt_titles = list("Spelunker")
outfit = /datum/outfit/job/mining
insurance_type = INSURANCE_TYPE_EXTENDED

salary = 100
min_start_money = 100
Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/syndicate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
admin_only = 1
syndicate_command = 1
outfit = /datum/outfit/job/syndicateofficer
insurance_type = INSURANCE_TYPE_NONE

/datum/job/syndicateofficer/get_access()
return get_syndicate_access(title)
Expand Down
24 changes: 24 additions & 0 deletions code/game/machinery/adv_med.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
var/mob/living/carbon/human/occupant
var/known_implants = list(/obj/item/implant/chem, /obj/item/implant/death_alarm, /obj/item/implant/mindshield, /obj/item/implant/tracking, /obj/item/implant/health)
var/isPrinting = FALSE
var/obj/item/card/id/inserted_id = null

/obj/machinery/bodyscanner/Destroy()
go_out()
eject_id()
return ..()

/obj/machinery/bodyscanner/power_change(forced = FALSE)
Expand Down Expand Up @@ -170,6 +172,16 @@
add_fingerprint(user)
ui_interact(user)

/obj/machinery/bodyscanner/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/card/id))
if(inserted_id)
user.balloon_alert(user, "занято")
else if(user.drop_transfer_item_to_loc(I, src))
inserted_id = I
user.balloon_alert(user, "карта вставлена")

. = ..()

/obj/machinery/bodyscanner/relaymove(mob/user)
if(user.incapacitated() || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return FALSE //maybe they should be able to get out with cuffs, but whatever
Expand All @@ -196,6 +208,13 @@
A.forceMove(loc)
SStgui.update_uis(src)

/obj/machinery/bodyscanner/proc/eject_id()
if(!inserted_id)
return
inserted_id.forceMove(loc)
inserted_id = null
SStgui.update_uis(src)

/obj/machinery/bodyscanner/force_eject_occupant(mob/target)
go_out()

Expand Down Expand Up @@ -231,6 +250,7 @@
var/list/data = list()

data["occupied"] = occupant ? TRUE : FALSE
data["has_id"] = inserted_id ? TRUE : FALSE

var/occupantData[0]
if(occupant)
Expand Down Expand Up @@ -387,6 +407,10 @@
P.info += "<br><br><b>Notes:</b><br>"
P.name = "Body Scan - [name]"
isPrinting = FALSE
if("insurance")
do_insurance_collection(usr, occupant, inserted_id ? inserted_id.associated_account_number : null)
if("eject_id")
eject_id()
else
return FALSE

Expand Down
Loading