Skip to content

Commit

Permalink
skill tweaks (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapu1178 authored Nov 1, 2024
1 parent 9e6f4bc commit 1ed8dde
Show file tree
Hide file tree
Showing 25 changed files with 40 additions and 50 deletions.
5 changes: 3 additions & 2 deletions code/datums/components/embedded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,16 @@
if(harmful && user.stats.cooldown_finished("ripout_embed_check"))
user.stats.set_cooldown("ripout_embed_check", INFINITY)
var/datum/roll_result/result = user.stat_roll(12, /datum/rpg_skill/handicraft)
result.do_skill_sound(user)
switch(result.outcome)
if(CRIT_SUCCESS)
harmful = FALSE
time_taken = 0
to_chat(user, result.create_tooltip("Many hours spent on delicate projects has prepared you for this moment. (Instant and harmless removal)"))
to_chat(user, result.create_tooltip("Many hours spent on delicate projects has prepared you for this moment."))

if(SUCCESS)
time_taken = time_taken * 0.2
to_chat(user, result.create_tooltip("Your hands are more than accustomed to careful tasks. (Accelerated removal)"))
to_chat(user, result.create_tooltip("Your hands are more than accustomed to careful tasks."))

if(CRIT_FAILURE)
to_chat(user, result.create_tooltip("At a crucial moment, you second guess yourself, pressing the object deeper into your flesh."))
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1338,10 +1338,12 @@ DEFINE_INTERACTABLE(/obj/item)
var/datum/roll_result/result = user.stat_roll(7, /datum/rpg_skill/handicraft)
switch(result.outcome)
if(CRIT_SUCCESS)
to_chat(user, result.create_tooltip("A swift execution. A job well done. (Tool usage time reduced)"))
result.do_skill_sound(user)
to_chat(user, result.create_tooltip("A swift execution. A job well done."))
delay = delay * 0.25

user.stats.set_cooldown("use_tool", max(delay, 5 SECONDS))

user.stats.set_cooldown("use_tool", max(delay, 10 SECONDS))

// Play tool sound at the beginning of tool usage.
play_tool_sound(target, volume)
Expand Down
1 change: 1 addition & 0 deletions code/modules/detectivework/detective_work.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
stats.set_cooldown("examine_forensic_analysis", 15 SECONDS)
return

result.do_skill_sound(src)
stats.examined_object_weakrefs[WEAKREF(examined)] = TRUE
stats.set_cooldown("examine_forensic_analysis", 15 MINUTES)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/carbon_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@

var/list/holding = list(target.get_active_held_item() = 60, target.get_inactive_held_item() = 30)

var/roll = stat_roll(10, /datum/rpg_skill/skirmish).outcome
var/roll = stat_roll(14, /datum/rpg_skill/skirmish, defender = target).outcome

//Handle unintended consequences
for(var/obj/item/I in holding)
Expand Down
10 changes: 0 additions & 10 deletions code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ GLOBAL_LIST_EMPTY(dead_players_during_shift)
SSblackbox.ReportDeath(src)
log_message("has died (BRUTE: [src.getBruteLoss()], BURN: [src.getFireLoss()], TOX: [src.getToxLoss()], OXY: [src.getOxyLoss()], CLONE: [src.getCloneLoss()])", LOG_ATTACK)

for(var/mob/living/L in viewers(src, world.view) - src)
if(L.is_blind() || L.stat != CONSCIOUS || !L.client)
continue

var/datum/roll_result/result = L.stat_roll(7, /datum/rpg_skill/willpower)
switch(result.outcome)
if(FAILURE, CRIT_FAILURE)
if(L.apply_status_effect(/datum/status_effect/skill_mod/witness_death))
to_chat(L, result.create_tooltip("For but a moment, there is nothing. Nothing but the gnawing realisation of what you have just witnessed."))

/mob/living/carbon/human/proc/makeSkeleton()
ADD_TRAIT(src, TRAIT_DISFIGURED, TRAIT_GENERIC)
set_species(/datum/species/skeleton)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,12 @@

var/possible_invisible_damage = getToxLoss() > 20 || getBrainLoss()

if((possible_invisible_damage || length(fucked_reasons) || visible_bodyparts >= 3))
if(!length(get_missing_limbs()) && (possible_invisible_damage || length(fucked_reasons) || visible_bodyparts >= 3))
var/datum/roll_result/result = living_user.stat_roll(15, /datum/rpg_skill/anatomia)
switch(result.outcome)
if(SUCCESS, CRIT_SUCCESS)
spawn(0)
result.do_skill_sound(living_user)
if(possible_invisible_damage && living_user.stats.cooldown_finished("found_invisible_damage_[REF(src)]"))
to_chat(living_user, result.create_tooltip("Something is not right, this person is not well. You can feel it in your very core."))
living_user.stats.set_cooldown("found_invisible_damage_[REF(src)]", INFINITY) // Never again
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,10 @@
if (!do_after(src, target, 3 SECONDS, DO_PUBLIC, extra_checks = CALLBACK(src, PROC_REF(can_perform_cpr), target)))
break

visible_message(
span_notice("[src] pushes down on [target.name]'s chest!"),
)

var/datum/roll_result/result = stat_roll(6, /datum/rpg_skill/skirmish)
switch(result.outcome)
if(CRIT_SUCCESS)
Expand All @@ -547,10 +551,6 @@
if(chest.break_bones(TRUE))
to_chat(src, result.create_tooltip("Your strength betrays you as you shatter [target.name]'s [chest.encased]."))

visible_message(
span_notice("[src] pushes down on [target.name]'s chest!"),
)

log_combat(src, target, "CPRed")

if(target.breathe(TRUE) == BREATH_OKAY)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
if(HAS_TRAIT(user, TRAIT_PERFECT_ATTACKER))
roll = SUCCESS
else
roll = user.stat_roll(10, /datum/rpg_skill/skirmish, bodyzone_modifier, -7).outcome
roll = user.stat_roll(10, /datum/rpg_skill/skirmish, bodyzone_modifier, -7, src).outcome

var/hit_zone
switch(roll)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
// Set damage and find hit bodypart using weighted rng
var/target_zone = deprecise_zone(user.zone_selected)
var/bodyzone_modifier = GLOB.bodyzone_gurps_mods[target_zone]
var/roll = !HAS_TRAIT(user, TRAIT_PERFECT_ATTACKER) ? user.stat_roll(10, /datum/rpg_skill/skirmish, bodyzone_modifier, -7).outcome : SUCCESS
var/roll = !HAS_TRAIT(user, TRAIT_PERFECT_ATTACKER) ? user.stat_roll(10, /datum/rpg_skill/skirmish, bodyzone_modifier, -7, target).outcome : SUCCESS
// If we succeeded, hit the target area.
var/attacking_zone = (roll >= SUCCESS) ? target_zone : target.get_random_valid_zone()
var/obj/item/bodypart/affecting
Expand Down
12 changes: 0 additions & 12 deletions code/modules/mob/living/carbon/human/status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,3 @@
. = ..()
if(.)
update_body_parts()

/mob/living/carbon/human/fakedeath(source, silent)
. = ..()
for(var/mob/living/L in viewers(src, world.view) - src)
if(L.is_blind() || L.stat != CONSCIOUS || !L.client)
continue

var/datum/roll_result/result = L.stat_roll(6, /datum/rpg_skill/willpower)
switch(result.outcome)
if(FAILURE, CRIT_FAILURE)
if(L.apply_status_effect(/datum/status_effect/skill_mod/witness_death))
to_chat(L, result.create_tooltip("For but a moment, there is nothing. Nothing but the gnawing realisation of what you have just witnessed."))
7 changes: 3 additions & 4 deletions code/modules/mob/living/carbon/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,14 @@
var/datum/roll_result/result = stat_roll(12, /datum/rpg_skill/willpower)
switch(result.outcome)
if(CRIT_SUCCESS)

to_chat(src, result.create_tooltip("Pain is temporary, I will not die on this day! (Shock reduced)"))
to_chat(src, result.create_tooltip("Pain is temporary, I will not die on this day!"))
shock_stage = max(shock_stage - 15, 0)
stats.set_cooldown("shrug_off_pain", 180 SECONDS)
return

if(SUCCESS)
shock_stage = max(shock_stage - 5, 0)
to_chat(src, result.create_tooltip("Not here, not now. (Pain shrugged off)"))
to_chat(src, result.create_tooltip("Not here, not now."))
stats.set_cooldown("shrug_off_pain", 180 SECONDS)
return

Expand All @@ -204,7 +203,7 @@

if(CRIT_FAILURE)
shock_stage = min(shock_stage + 1, SHOCK_MAXIMUM)
to_chat(src, result.create_tooltip("I'm going to die here. (Shock increased)"))
to_chat(src, result.create_tooltip("I'm going to die here."))
stats.set_cooldown("shrug_off_pain", 60 SECONDS)
// Do not return

Expand Down
1 change: 1 addition & 0 deletions code/modules/surgery/new_surgery/_surgery_step.dm
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ GLOBAL_LIST_INIT(surgery_tool_exceptions, typecacheof(list(
can_loop = TRUE
else
step.fail_step(user, target, zone, src)
result.do_skill_sound(user)

else if(!(QDELING(user) || QDELING(target) || QDELING(src)))
step.fail_step(user, target, zone, src)
Expand Down
15 changes: 9 additions & 6 deletions code/modules/three_dsix/roll.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,22 @@ GLOBAL_DATUM_INIT(success_roll, /datum/roll_result/success, new)

return "[prefix] <span data-component=\"Tooltip\" data-innerhtml=\"[tooltip_html]\" class=\"tooltip\">[finished_prob_string]</span>[seperator][body]"

/// Play
/datum/roll_result/proc/do_skill_sound(mob/user)
if(isnull(skill_type_used))
return

var/datum/rpg_stat/stat_path = initial(skill_type_used.parent_stat_type)
var/sound_path = initial(stat_path.sound)
SEND_SOUND(user, sound(sound_path))

/datum/roll_result/success
outcome = SUCCESS
success_prob = 100
crit_success_prob = 0
roll = 18
requirement = 3

/mob/living/verb/testroll()
name = "testroll"

var/datum/roll_result/result = stat_roll(11, /datum/rpg_skill/skirmish)
to_chat(usr, result.create_tooltip("This message is a test, and not indicative of the final product."))

/// Returns a number between 0 and 100 to roll the desired value when rolling the given dice.
/proc/dice_probability(num, sides, desired)
var/static/list/outcomes_cache = new /list(0, 0)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/three_dsix/skills/coordination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Handicraft"
desc = "Control and manipulate, with style."

parent_stat_type = /datum/rpg_stat/motorics
parent_stat_type = /datum/rpg_stat/kinesis

/datum/rpg_skill/handicraft/get(mob/living/user)
. = ..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/three_dsix/stats/_stat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
var/value = STATS_BASELINE_VALUE
var/list/modifiers

var/sound

/datum/rpg_stat/proc/get(mob/living/user)
return value - STATS_BASELINE_VALUE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/datum/rpg_stat/motorics
name = "Motorics"
/datum/rpg_stat/kinesis
name = "kinesis"
desc = ""

value = STATS_BASELINE_VALUE
sound = 'sound/three_dsix/kinesis.ogg'

/datum/rpg_stat/motorics/get(mob/living/user)
/datum/rpg_stat/kinesis/get(mob/living/user)
. = ..()
if(!iscarbon(user))
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/three_dsix/stats/psyche.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
desc = ""

value = STATS_BASELINE_VALUE

sound = 'sound/three_dsix/psyche.ogg'

/datum/rpg_stat/psyche/get(mob/living/user)
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/modules/three_dsix/stats/soma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
desc = ""

value = STATS_BASELINE_VALUE
sound = 'sound/three_dsix/soma.ogg'
2 changes: 1 addition & 1 deletion daedalus.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4491,7 +4491,7 @@
#include "code\modules\three_dsix\skills\skirmish.dm"
#include "code\modules\three_dsix\skills\willpower.dm"
#include "code\modules\three_dsix\stats\_stat.dm"
#include "code\modules\three_dsix\stats\motorics.dm"
#include "code\modules\three_dsix\stats\kinesis.dm"
#include "code\modules\three_dsix\stats\psyche.dm"
#include "code\modules\three_dsix\stats\soma.dm"
#include "code\modules\tooltip\tooltip.dm"
Expand Down
Binary file added sound/three_dsix/kinesis.ogg
Binary file not shown.
Binary file added sound/three_dsix/pneuma.ogg
Binary file not shown.
Binary file added sound/three_dsix/psyche.ogg
Binary file not shown.
Binary file added sound/three_dsix/roll_fail.ogg
Binary file not shown.
Binary file added sound/three_dsix/roll_success.ogg
Binary file not shown.
Binary file added sound/three_dsix/soma.ogg
Binary file not shown.

0 comments on commit 1ed8dde

Please sign in to comment.