Skip to content

Commit

Permalink
wip medical
Browse files Browse the repository at this point in the history
  • Loading branch information
Zonespace27 committed Sep 28, 2023
1 parent 319456d commit c0116c6
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 6 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@

/// From /mob/living/carbon/human/attack_hand() : (mob/living/carbon/human/attacked_mob)
#define COMSIG_LIVING_ATTACKHAND_HUMAN "living_attackhand_human"

/// From /obj/item/reagent_container/hypospray/attack() : (obj/item/reagent_container/hypospray/injector)
#define COMSIG_LIVING_HYPOSPRAY_INJECTED "living_hypospray_injected"
8 changes: 5 additions & 3 deletions code/datums/tutorial/_tutorial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GLOBAL_LIST_EMPTY(ongoing_tutorials)
/// A dict of type:atom ref for some important junk that should be trackable
var/list/tracking_atoms = list()
/// What map template should be used for the tutorial
var/datum/map_template/tutorial/tutorial_template = /datum/map_template/tutorial
var/datum/map_template/tutorial/tutorial_template = /datum/map_template/tutorial/s12x12
/// What is the parent path of this, to exclude from the tutorial menu
var/parent_path = /datum/tutorial

Expand Down Expand Up @@ -158,13 +158,15 @@ GLOBAL_LIST_EMPTY(ongoing_tutorials)
width = 12
height = 12

/datum/map_template/tutorial/marine_basic
/datum/map_template/tutorial/s12x12

/datum/map_template/tutorial/s8x9
name = "Tutorial Zone (8x9)"
mappath = "maps/tutorial/tutorial_8x9.dmm"
width = 8
height = 9

/datum/map_template/tutorial/ss13_basic
/datum/map_template/tutorial/s7x7
name = "Tutorial Zone (7x7)"
mappath = "maps/tutorial/tutorial_7x7.dmm"
width = 7
Expand Down
2 changes: 1 addition & 1 deletion code/datums/tutorial/marine/basic_marine.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/tutorial/marine/basic
name = "Marine - Basic"
tutorial_id = "marine_basic_1"
tutorial_template = /datum/map_template/tutorial/marine_basic
tutorial_template = /datum/map_template/tutorial/s8x9
/// How many items need to be vended from the clothing vendor for the script to continue, if something vends 2 items (for example), increase this number by 2.
var/clothing_items_to_vend = 9
/// How many items need to be vended from the gun vendor to continue
Expand Down
96 changes: 96 additions & 0 deletions code/datums/tutorial/marine/medical_basic.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/datum/tutorial/marine/medical_basic
name = "Marine - Medical (Basic)"
tutorial_id = "marine_medical_1"
tutorial_template = /datum/map_template/tutorial/s7x7

// START OF SCRIPTING

/datum/tutorial/marine/medical_basic/start_tutorial(mob/starting_mob)
. = ..()
if(!.)
return

init_mob()
message_to_player("This is the tutorial for the basics of medical that you will need to know for playing a marine role.")
addtimer(CALLBACK(src, PROC_REF(brute_tutorial)), 4 SECONDS)

/datum/tutorial/marine/medical_basic/proc/brute_tutorial()
message_to_player("The first kind of damage is <b>Brute</b>, the most common kind. It represents physical trauma from things like punches, weapons, or guns.")
var/mob/living/living_mob = tutorial_mob
living_mob.adjustBruteLoss(10)
addtimer(CALLBACK(src, PROC_REF(brute_tutorial_2)), 4 SECONDS)

/datum/tutorial/marine/medical_basic/proc/brute_tutorial_2()
message_to_player("You can observe if you have <b>Brute</b> or <b>Burn</b> damage by clicking on yourself with an empty hand on help intent.")
update_objective("Click on yourself with an empty hand.")
RegisterSignal(tutorial_mob, COMSIG_LIVING_ATTACKHAND_HUMAN, PROC_REF(on_health_examine))

/datum/tutorial/marine/medical_basic/proc/on_health_examine(datum/source, mob/living/carbon/human/attacked_mob)
SIGNAL_HANDLER

if(attacked_mob != tutorial_mob)
return

UnregisterSignal(tutorial_mob, COMSIG_LIVING_ATTACKHAND_HUMAN)
message_to_player("Good. Now, you have taken some brute damage. <b>Bicaridine</b> is used to fix brute over time. Pick up the <b>bicaridine EZ autoinjector</b> and use it in-hand.")
update_objective("Inject yourself with the bicaridine injector.")
var/obj/item/reagent_container/hypospray/autoinjector/bicaridine/skillless/one_use/brute_injector = new(loc_from_corner(0, 4))
add_to_tracking_atoms(brute_injector)
add_highlight(brute_injector)
RegisterSignal(tutorial_mob, COMSIG_LIVING_HYPOSPRAY_INJECTED, PROC_REF(on_brute_inject))

/datum/tutorial/marine/medical_basic/proc/on_brute_inject(datum/source, obj/item/reagent_container/hypospray/injector)
SIGNAL_HANDLER

if(!istype(injector, /obj/item/reagent_container/hypospray/autoinjector/bicaridine/skillless/one_use))
return

UnregisterSignal(tutorial_mob, COMSIG_LIVING_HYPOSPRAY_INJECTED)
TUTORIAL_ATOM_FROM_TRACKING(/obj/item/reagent_container/hypospray/autoinjector/bicaridine/skillless/one_use, brute_injector)
remove_highlight(brute_injector)
message_to_player("All medicines take time to work after injection. Next is <b>Burn</b> damage. It is obtained from things like acid or being set on fire.")
update_objective("")
var/mob/living/living_mob = tutorial_mob
living_mob.adjustBurnLoss(10)
addtimer(CALLBACK(src, PROC_REF(burn_tutorial)), 4 SECONDS)

/datum/tutorial/marine/medical_basic/proc/burn_tutorial()
message_to_player("<b>Kelotane</b> is used to fix burn overtime. Inject yourself with the <b>kelotane EZ autoinjector</b>.")
update_objective("Inject yourself with the kelotane injector.")
var/obj/item/reagent_container/hypospray/autoinjector/kelotane/skillless/one_use/burn_injector = new(loc_from_corner(0, 4))
add_to_tracking_atoms(burn_injector)
add_highlight(burn_injector)
RegisterSignal(tutorial_mob, COMSIG_LIVING_HYPOSPRAY_INJECTED, PROC_REF(on_burn_inject))


/datum/tutorial/marine/medical_basic/proc/on_burn_inject(datum/source, obj/item/reagent_container/hypospray/injector)
SIGNAL_HANDLER

if(!istype(injector, /obj/item/reagent_container/hypospray/autoinjector/kelotane/skillless/one_use))
return

UnregisterSignal(tutorial_mob, COMSIG_LIVING_HYPOSPRAY_INJECTED)
TUTORIAL_ATOM_FROM_TRACKING(/obj/item/reagent_container/hypospray/autoinjector/kelotane/skillless/one_use, burn_injector)
remove_highlight(burn_injector)
message_to_player("Good. Now, when you normally take damage, you will also feel <b>pain</b>. Pain slows you down and can knock you out if left unchecked.")
update_objective("")
var/mob/living/living_mob = tutorial_mob
living_mob.pain.apply_pain(PAIN_BONE_BREAK)
addtimer(CALLBACK(src, PROC_REF(pain_tutorial)), 4 SECONDS) // add tram injecting


// END OF SCRIPTING
// START OF SCRIPT HELPERS

// END OF SCRIPT HELPERS

/datum/tutorial/marine/medical_basic/init_mob()
. = ..()
arm_equipment(tutorial_mob, /datum/equipment_preset/tutorial)

TUTORIAL_ATOM_FROM_TRACKING(/obj/structure/machinery/cryopod/tutorial, tutorial_pod)
tutorial_pod.go_in_cryopod(tutorial_mob, TRUE, FALSE)


/datum/tutorial/marine/medical_basic/init_map()
new /obj/structure/surface/table/almayer(loc_from_corner(0, 4))
2 changes: 1 addition & 1 deletion code/datums/tutorial/ss13/basic_ss13.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/tutorial/ss13/basic
name = "Space Station 13 - Basic"
tutorial_id = "ss13_basic_1"
tutorial_template = /datum/map_template/tutorial/ss13_basic
tutorial_template = /datum/map_template/tutorial/s7x7

// START OF SCRIPTING

Expand Down
2 changes: 1 addition & 1 deletion code/datums/tutorial/ss13/intents.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/tutorial/ss13/intents
name = "Space Station 13 - Intents"
tutorial_id = "ss13_intents_1"
tutorial_template = /datum/map_template/tutorial/ss13_basic
tutorial_template = /datum/map_template/tutorial/s7x7

// START OF SCRIPTING

Expand Down
15 changes: 15 additions & 0 deletions code/game/objects/items/reagent_containers/autoinjectors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@
item_state = "emptyskill"
skilllock = SKILL_MEDICAL_DEFAULT

/obj/item/reagent_container/hypospray/autoinjector/tramadol/skillless/one_use
desc = "An EZ autoinjector loaded with 3 uses of Tramadol, a weak but effective painkiller for normal wounds. Doesn't require any training to use."
volume = 15
amount_per_transfer_from_this = 15

/obj/item/reagent_container/hypospray/autoinjector/oxycodone
name = "oxycodone autoinjector (EXTREME PAINKILLER)"
chemname = "oxycodone"
Expand All @@ -164,6 +169,11 @@
item_state = "emptyskill"
skilllock = SKILL_MEDICAL_DEFAULT

/obj/item/reagent_container/hypospray/autoinjector/kelotane/skillless/one_use
desc = "An EZ autoinjector loaded with 1 use of Kelotane, a common burn medicine. Doesn't require any training to use."
volume = 15
amount_per_transfer_from_this = 15

/obj/item/reagent_container/hypospray/autoinjector/bicaridine
name = "bicaridine autoinjector"
chemname = "bicaridine"
Expand All @@ -180,6 +190,11 @@
item_state = "emptyskill"
skilllock = SKILL_MEDICAL_DEFAULT

/obj/item/reagent_container/hypospray/autoinjector/bicaridine/skillless/one_use
desc = "An EZ autoinjector loaded with 1 use of Bicaridine, a common brute and circulatory damage medicine. Doesn't require any training to use."
volume = 15
amount_per_transfer_from_this = 15

/obj/item/reagent_container/hypospray/autoinjector/inaprovaline
name = "inaprovaline autoinjector"
chemname = "inaprovaline"
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/reagent_containers/hypospray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
to_chat(user, SPAN_NOTICE(" You inject [M] with [src]."))
to_chat(M, SPAN_WARNING("You feel a tiny prick!"))
playsound(loc, injectSFX, injectVOL, 1)
SEND_SIGNAL(M, COMSIG_LIVING_HYPOSPRAY_INJECTED, src)

reagents.reaction(M, INGEST)
if(M.reagents)
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ s// DM Environment file for colonialmarines.dme.
#include "code\datums\tutorial\tutorial_example.dm"
#include "code\datums\tutorial\marine\_marine.dm"
#include "code\datums\tutorial\marine\basic_marine.dm"
#include "code\datums\tutorial\marine\medical_basic.dm"
#include "code\datums\tutorial\ss13\_ss13.dm"
#include "code\datums\tutorial\ss13\basic_ss13.dm"
#include "code\datums\tutorial\ss13\intents.dm"
Expand Down

0 comments on commit c0116c6

Please sign in to comment.