Skip to content

Commit

Permalink
multiple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wallemations committed May 4, 2022
1 parent c5d91de commit ad9d525
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 180 deletions.
1 change: 1 addition & 0 deletions code/modules/jobs/job_types/head_of_personnel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

outfit = /datum/outfit/job/hop
plasmaman_outfit = /datum/outfit/plasmaman/head_of_personnel
department_for_prefs = /datum/job_department/captain
departments_list = list(
// /datum/job_department/service, HEAVEN REMOVAL
/datum/job_department/command,
Expand Down
4 changes: 3 additions & 1 deletion code/modules/reagents/reagent_containers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var/spillable = FALSE
var/list/fill_icon_thresholds = null
var/fill_icon_state = null // Optional custom name for reagent fill icon_state prefix
/// HEAVEN CHANGE - HYPOVIALS
var/filling_icon = 'icons/obj/reagentfillings.dmi'

/obj/item/reagent_containers/Initialize(mapload, vol)
. = ..()
Expand Down Expand Up @@ -224,7 +226,7 @@
return

var/fill_name = fill_icon_state? fill_icon_state : icon_state
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[fill_name][fill_icon_thresholds[1]]")
var/mutable_appearance/filling = mutable_appearance(filling_icon, "[fill_name][fill_icon_thresholds[1]]") // HEAVEN CHANGE

var/percent = round((reagents.total_volume / volume) * 100)
for(var/i in 1 to fill_icon_thresholds.len)
Expand Down
2 changes: 1 addition & 1 deletion modular_heaven/_DEFINES/_module_DEFINES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

/// Head of Service
#define JOB_HEAD_OF_SERVICE "Head of Service"
#define JOB_DISPLAY_ORDER_HEAD_OF_SERVICE 3.5

Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
bodytemp_cold_damage_limit = (BODYTEMP_COLD_DAMAGE_LIMIT + 20)

// All taken from minecraft //
species_speech_sounds = list('modular_heaven/modules/text_and_speech_change/sounds/goat_say1.ogg' = 80, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_say2.ogg' = 80, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_say3.ogg' = 80)
species_speech_sounds = list('modular_heaven/modules/text_and_speech_change/sounds/goat_say1.ogg' = 60, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_say2.ogg' = 60, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_say3.ogg' = 60)
species_speech_sounds_ask = list('modular_heaven/modules/text_and_speech_change/sounds/goat_ask1.ogg' = 80, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_ask2.ogg' = 80)
species_speech_sounds_exclaim = list('modular_heaven/modules/text_and_speech_change/sounds/goat_yell1.ogg' = 80, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_yell2.ogg' = 80)
species_speech_sounds_exclaim = list('modular_heaven/modules/text_and_speech_change/sounds/goat_yell1.ogg' = 60, \
'modular_heaven/modules/text_and_speech_change/sounds/goat_yell2.ogg' = 60)


bodypart_overrides = list(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/datum/species/skeleton
//All taken from minecraft
species_speech_sounds = list('modular_heaven/modules/text_and_speech_change/sounds/skeleton1.ogg' = 75, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton2.ogg' = 75, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton3.ogg' = 75)
species_speech_sounds = list('modular_heaven/modules/text_and_speech_change/sounds/skeleton1.ogg' = 40, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton2.ogg' = 40, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton3.ogg' = 40)
species_speech_sounds_ask = list('modular_heaven/modules/text_and_speech_change/sounds/skeleton_ask1.ogg' = 75, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton_ask2.ogg' = 75, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton_ask3.ogg' = 75)
species_speech_sounds_exclaim = list('modular_heaven/modules/text_and_speech_change/sounds/skeleton_exclaim1.ogg' = 75, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton_exclaim2.ogg' = 75, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton_exclaim3.ogg' = 75)
species_speech_sounds_exclaim = list('modular_heaven/modules/text_and_speech_change/sounds/skeleton_exclaim1.ogg' = 40, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton_exclaim2.ogg' = 40, \
'modular_heaven/modules/text_and_speech_change/sounds/skeleton_exclaim3.ogg' = 40)
Original file line number Diff line number Diff line change
Expand Up @@ -361,22 +361,17 @@
name = "Executioner's Bat"
desc = "Die the Death."
icon_state = "baseball_bat_exec0"
base_icon_state = "baseball_bat_exec"
icon = 'modular_heaven/modules/heaven_weaponry/baseball_bats/icons/baseball.dmi'
lefthand_file = 'modular_heaven/modules/heaven_weaponry/baseball_bats/icons/bats_left.dmi'
righthand_file = 'modular_heaven/modules/heaven_weaponry/baseball_bats/icons/bats_right.dmi'
throwforce = 8
w_class = WEIGHT_CLASS_HUGE
slot_flags = NONE

/obj/item/fireaxe/baseball/ComponentInitialize()
AddComponent(/datum/component/two_handed, force_unwielded=2, force_wielded=13, icon_wielded="baseball_bat_exec1", dismemberment_unwielded = 0, dismemberment_wielded = 100)


/obj/item/fireaxe/baseball/update_icon_state()
icon_state = "baseball_bat_exec0"
if(wielded)
icon_state = "baseball_bat_exec1"
else
icon_state = "baseball_bat_exec0"
. = ..()
AddComponent(/datum/component/two_handed, force_unwielded=2, force_wielded=13, icon_wielded="[base_icon_state]1")

/obj/item/fireaxe/baseball/attack(mob/living/target, mob/living/user)
. = ..()
Expand Down
Binary file not shown.
Binary file not shown.
47 changes: 0 additions & 47 deletions modular_heaven/modules/hypospray_2/code/hypo_kit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
throw_range = 7
var/empty = FALSE

//Code to give hypospray kits selectable paterns.
var/current_case = "firstaid"
var/static/list/case_designs
var/static/list/cmo_case_designs
var/cmo_case = FALSE

/obj/item/storage/hypospraykit/examine(mob/living/user)
. = ..()
. += span_notice("Ctrl-Shift-Click to reskin this")

/obj/item/storage/hypospraykit/Initialize()
. = ..()
var/datum/component/storage/stored = GetComponent(/datum/component/storage)
Expand All @@ -31,42 +21,6 @@
update_icon_state()
update_icon()

/obj/item/storage/hypospraykit/proc/populate_case_designs()
case_designs = list(
"firstaid" = image(icon = src.icon, icon_state = "firstaid-mini"),
"brute" = image(icon = src.icon, icon_state = "brute-mini"),
"burn" = image(icon = src.icon, icon_state = "burn-mini"),
"toxin" = image(icon = src.icon, icon_state = "toxin-mini"),
"tactical" = image(icon= src.icon, icon_state = "tactical-mini"),
"purple" = image(icon = src.icon, icon_state = "purple-mini"),
"oxy" = image(icon = src.icon, icon_state = "oxy-mini"))
cmo_case_designs = list(
"rad" = image(icon= src.icon, icon_state = "rad-mini"))
cmo_case_designs += case_designs

/obj/item/storage/hypospraykit/proc/case_menu(mob/user)
if(.)
return
var/casetype = cmo_case_designs
if(!src.cmo_case)
casetype = case_designs
var/choice = show_radial_menu(user, src , casetype, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 42, require_near = TRUE)
if(!choice)
return FALSE
current_case = choice
update_icon()

/obj/item/storage/hypospraykit/proc/check_menu(mob/user)
if(!istype(user))
return FALSE
if(user.incapacitated() || !user.is_holding(src))
return FALSE
return TRUE


/obj/item/storage/hypospraykit/CtrlShiftClick(mob/user, obj/item/I)
case_menu(user)

//END OF HYPOSPRAY CASE MENU CODE

/obj/item/storage/hypospraykit/empty
Expand All @@ -85,7 +39,6 @@
desc = "A kit containing a deluxe hypospray and vials."
icon_state = "rad-mini"
inhand_icon_state = "firstaid-rad"
cmo_case = TRUE

/obj/item/storage/hypospraykit/cmo/PopulateContents()
if(empty)
Expand Down
141 changes: 72 additions & 69 deletions modular_heaven/modules/hypospray_2/code/hypospray2.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

#define HYPO_SPRAY 0
#define HYPO_INJECT 1

#define WAIT_SPRAY 20
#define WAIT_INJECT 20
#define SELF_SPRAY 15
Expand Down Expand Up @@ -35,8 +31,6 @@
w_class = WEIGHT_CLASS_SMALL
custom_price = 600
var/list/allowed_containers = list(/obj/item/reagent_containers/glass/hypovial/small)
//Inject or spray?
var/mode = HYPO_INJECT
var/obj/item/reagent_containers/glass/hypovial/vial
var/start_vial = /obj/item/reagent_containers/glass/hypovial/small
var/spawnwithvial = TRUE
Expand All @@ -50,7 +44,7 @@
//Time taken to spray self
var/spray_self = SELF_SPRAY

//Can you hotswap vials? - Currently no hyposprays allow this for some reason
//Can you hotswap vials?
var/quickload = FALSE
//Does it go through hardsuits?
var/penetrates = FALSE
Expand All @@ -66,6 +60,8 @@
spray_wait = DELUXE_WAIT_SPRAY
spray_self = DELUXE_SELF_SPRAY
inject_self = DELUXE_SELF_INJECT
quickload = TRUE
penetrates = TRUE

/obj/item/hypospray/mkii/combat
name = "combat hypospray mk.II"
Expand All @@ -79,13 +75,17 @@
spray_wait = COMBAT_WAIT_SPRAY
spray_self = COMBAT_SELF_SPRAY
inject_self = COMBAT_SELF_INJECT
quickload = TRUE
penetrates = TRUE

/obj/item/hypospray/mkii/combat/nanite
name = "nanite hypospray mk.II"
icon_state = "nanite2"
inhand_icon_state = "nanite_hypo"
desc = "An air-needle autoinjector for use in combat situations. Vial prefilled with experimental medical nanites and a stimulant for rapid healing and a combat boost."
start_vial = /obj/item/reagent_containers/glass/hypovial/large/combat/nanite
quickload = FALSE
penetrates = TRUE

/obj/item/hypospray/mkii/standard
name = "standard hypospray mk.II"
Expand Down Expand Up @@ -119,11 +119,22 @@
. = ..()
if(vial)
. += "[vial] has [vial.reagents.total_volume]u remaining."
if(quickload)
. += "[src] has a quickload mechanism!"
else
. += "It has no vial loaded in."
. += "[src] is set to [mode ? "Inject" : "Spray"] contents on application."
. += span_notice("<b>Ctrl-Click</b> [src] to toggle its mode from spraying to injecting and vice versa.")
. += span_notice("<b>Alt-Click</b> [src] to change the amount of reagents per transfer.")

/obj/item/hypospray/mkii/add_item_context(obj/item/source, list/context, atom/target, mob/living/user)
if (!isliving(target))
return NONE
context[SCREENTIP_CONTEXT_LMB] = "Inject"
context[SCREENTIP_CONTEXT_RMB] = "Spray"
return CONTEXTUAL_SCREENTIP_SET

/obj/item/hypospray/mkii/add_context(atom/source, list/context, obj/item/held_item, mob/user)
. = ..()
context[SCREENTIP_CONTEXT_ALT_LMB] = "Change reagents per transfer."
return CONTEXTUAL_SCREENTIP_SET

/obj/item/hypospray/mkii/proc/unload_hypo(obj/item/hypo, mob/user)
if((istype(hypo, /obj/item/reagent_containers/glass/hypovial)))
Expand Down Expand Up @@ -158,7 +169,7 @@
/obj/item/hypospray/mkii/attackby(obj/item/used_item, mob/living/user)
if((istype(used_item, /obj/item/reagent_containers/glass/hypovial) && vial != null))
if(!quickload)
to_chat(user, span_warning("[src] can not hold more than one vial!"))
to_chat(user, span_warning("[src] needs its current vial ejected in order to insert a new one!"))
return FALSE
else
insert_vial(used_item, user, vial)
Expand Down Expand Up @@ -192,92 +203,84 @@
/obj/item/hypospray/mkii/attack_hand(mob/user)
. = ..() //Don't bother changing this or removing it from containers will break.

/obj/item/hypospray/mkii/attack(obj/item/hypo, mob/user, params)
return

/obj/item/hypospray/mkii/afterattack(atom/target, mob/living/user, proximity)
if((istype(target, /obj/item/reagent_containers/glass/hypovial)))
insert_vial(target, user, vial)
return TRUE

if(!vial || !proximity || !isliving(target))
/obj/item/hypospray/mkii/attack(mob/living/victim, mob/user, params)
if(!vial || !isliving(victim))
return
var/mob/living/injectee = target

if(!injectee.reagents || !injectee.can_inject(user, user.zone_selected, penetrates))
if(!hypo_checker(victim, user))
return
use_hypospray(victim, user, "inject")
return

if(iscarbon(injectee))
var/obj/item/bodypart/affecting = injectee.get_bodypart(check_zone(user.zone_selected))
if(!affecting)
to_chat(user, span_warning("The limb is missing!"))
return
//Always log attemped injects for admins
var/list/injected = list()
for(var/datum/reagent/injected_reagent in vial.reagents.reagent_list)
injected += injected_reagent.name
var/contained = english_list(injected)
log_combat(user, injectee, "attemped to inject", src, addition="which had [contained]")

if(!vial)
to_chat(user, span_notice("[src] doesn't have any vial installed!"))
/obj/item/hypospray/mkii/attack_secondary(mob/living/victim, mob/living/user, params)
if(!vial || !isliving(victim))
return
if(!vial.reagents.total_volume)
to_chat(user, span_notice("[src]'s vial is empty!"))
if(!hypo_checker(victim, user))
return
use_hypospray(victim, user, "spray")
return

var/fp_verb = mode == HYPO_SPRAY ? "spray" : "inject"
/obj/item/hypospray/mkii/attack_self(mob/living/user)
if(user)
if(user.incapacitated())
return
else if(!vial)
to_chat(user, "This Hypo needs to be loaded first!")
return
else
unload_hypo(vial,user)

/obj/item/hypospray/mkii/proc/use_hypospray(mob/living/injectee, mob/user, mode)
if(injectee != user)
injectee.visible_message(span_danger("[user] is trying to [fp_verb] [injectee] with [src]!"), \
span_userdanger("[user] is trying to [fp_verb] you with [src]!"))
injectee.visible_message(span_danger("[user] is trying to [mode] [injectee] with [src]!"), \
span_userdanger("[user] is trying to [mode] you with [src]!"))
if(!do_mob(user, injectee, inject_wait, extra_checks = CALLBACK(injectee, /mob/living/proc/can_inject, user, user.zone_selected, penetrates)))
return
if(!vial.reagents.total_volume)
return
log_attack("<font color='red'>[user.name] ([user.ckey]) applied [src] to [injectee.name] ([injectee.ckey]), which had [contained] (COMBAT MODE: [uppertext(user.combat_mode)]) (MODE: [mode])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) applied [src] to [injectee.name] ([injectee.ckey]), which had [hypo_log_list(injectee, user)] (MODE: [mode])</font>")
if(injectee != user)
injectee.visible_message(span_danger("[user] uses the [src] on [injectee]!"), \
span_userdanger("[user] uses the [src] on you!"))
else
injectee.log_message("<font color='orange'>applied [src] to themselves ([contained]).</font>", LOG_ATTACK)
injectee.log_message("<font color='orange'>applied [src] to themselves ([hypo_log_list(injectee, user)]).</font>", LOG_ATTACK)

switch(mode)
if(HYPO_INJECT)
if("inject")
vial.reagents.trans_to(injectee, vial.amount_per_transfer_from_this)
if(HYPO_SPRAY)
if("spray")
vial.reagents.trans_to(injectee, vial.amount_per_transfer_from_this, methods = PATCH)

var/long_sound = vial.amount_per_transfer_from_this >= 15
playsound(loc, long_sound ? 'modular_heaven/modules/hypospray_2/sound/hypospray_long.ogg' : pick('modular_heaven/modules/hypospray_2/sound/hypospray.ogg','modular_heaven/modules/hypospray_2/sound/hypospray2.ogg'), 50, 1, -1)
to_chat(user, span_notice("You [fp_verb] [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units."))
to_chat(user, span_notice("You [mode] [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units."))
update_appearance()

/obj/item/hypospray/mkii/attack_self(mob/living/user)
if(user)
if(user.incapacitated())
return
else if(!vial)
to_chat(user, "This Hypo needs to be loaded first!")
return
else
unload_hypo(vial,user)
/obj/item/hypospray/mkii/proc/hypo_checker(mob/living/injectee, mob/user)
if(!injectee.reagents || !injectee.can_inject(user, user.zone_selected, penetrates))
return FALSE

/obj/item/hypospray/mkii/CtrlClick(mob/living/user)
. = ..()
if(user.canUseTopic(src, FALSE) && user.get_active_held_item(src))
switch(mode)
if(HYPO_SPRAY)
mode = HYPO_INJECT
to_chat(user, "[src] is now set to inject contents on application.")
if(HYPO_INJECT)
mode = HYPO_SPRAY
to_chat(user, "[src] is now set to spray contents on application.")
return TRUE
if(iscarbon(injectee))
var/obj/item/bodypart/affecting = injectee.get_bodypart(check_zone(user.zone_selected))
if(!affecting)
to_chat(user, span_warning("The limb is missing!"))
return FALSE
//Always log attemped injects for admins
log_combat(user, injectee, "attemped to inject", src, addition="which had [hypo_log_list(injectee, user)]")
if(!vial)
to_chat(user, span_notice("[src] doesn't have any vial installed!"))
return FALSE
if(!vial.reagents.total_volume)
to_chat(user, span_notice("[src]'s vial is empty!"))
return FALSE
return TRUE

/obj/item/hypospray/mkii/proc/hypo_log_list(mob/living/injectee, mob/user)
var/list/injected = list()
for(var/datum/reagent/injected_reagent in vial.reagents.reagent_list)
injected += injected_reagent.name
var/contained = english_list(injected)
return contained

#undef HYPO_SPRAY
#undef HYPO_INJECT
#undef WAIT_SPRAY
#undef WAIT_INJECT
#undef SELF_SPRAY
Expand Down
Loading

0 comments on commit ad9d525

Please sign in to comment.