Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 9ce76d7

Browse files
skill issue
to do: -chemistry -virology -balance stuff -??? i forgor
1 parent 5b9e995 commit 9ce76d7

File tree

116 files changed

+872
-297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+872
-297
lines changed

code/__DEFINES/skills.dm

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
/// Medicine and surgery.
3+
#define SKILL_PHYSIOLOGY "physiology"
4+
/// Construction and repair of structures and machinery.
5+
#define SKILL_MECHANICAL "mechanics"
6+
/// Hacking, piloting, and robotic maintenance.
7+
#define SKILL_TECHNICAL "technical"
8+
/// Chemistry, botany, physics, and other sciences.
9+
#define SKILL_SCIENCE "science"
10+
/// Strength, endurance, accuracy.
11+
#define SKILL_FITNESS "fitness"
12+
13+
/// No experience whatsoever.
14+
#define EXP_NONE 0
15+
/// Some experience, but not much.
16+
#define EXP_LOW 1
17+
/// Enough experience to do a decent job.
18+
#define EXP_MID 2
19+
/// Above average skill level.
20+
#define EXP_HIGH 3
21+
/// Exceptionally skilled.
22+
#define EXP_MASTER 4
23+
/// Uniquely gifted. Not obtainable through normal means.
24+
#define EXP_GENIUS 5
25+
26+
/// Experience required to increase your skills by one level. Increases exponentially the higher your level already is.
27+
#define EXPERIENCE_PER_LEVEL 200
28+
29+
#define SKILL_TO_ACTION_SPEED(skill_level) ((12 - skill_level) / 10)

code/__DEFINES/traits/declarations.dm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
#define TRAIT_IGNOREDAMAGESLOWDOWN "ignoredamageslowdown"
110110
/// Makes the screen go black and white while illuminating all mobs based on their body temperature
111111
#define TRAIT_INFRARED_VISION "infrared_vision"
112+
/// Punches don't stun. Use this instead of setting punchstunchance to zero.
113+
#define TRAIT_NO_PUNCH_STUN "no-punch-stun"
112114

113115
////////////////////////////////////////////////////////////////////////////////////
114116
//-------------------------Species Specific defines-------------------------------//
@@ -440,6 +442,10 @@
440442
#define TRAIT_PRESENT_VISION "present-vision"
441443
#define TRAIT_DISK_VERIFIER "disk-verifier"
442444
#define TRAIT_NOMOBSWAP "no-mob-swap"
445+
/// Can allocate 5 points into one skill instead of the usual 4
446+
#define TRAIT_EXCEPTIONAL_SKILL "exceptional-skill"
447+
/// Acts as an additional skill point for piloting mechs, up to EXP_MASTER.
448+
#define TRAIT_SKILLED_PILOT "skilled-pilot"
443449
/// Can examine IDs to see if they are roundstart.
444450
#define TRAIT_ID_APPRAISER "id_appraiser"
445451
/// Gives us turf, mob and object vision through walls

code/__HELPERS/mobs.dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ GLOBAL_LIST_EMPTY(species_list)
319319
* given `delay`. Returns `TRUE` on success or `FALSE` on failure.
320320
* Interaction_key is the assoc key under which the do_after is capped, with max_interact_count being the cap. Interaction key will default to target if not set.
321321
*/
322-
/proc/do_after(mob/user, delay, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks, interaction_key, max_interact_count = 1)
322+
/proc/do_after(mob/user, delay, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks, interaction_key, max_interact_count = 1, skill_check = null)
323323
if(!user)
324324
return FALSE
325325
if(!isnum(delay))
@@ -344,6 +344,9 @@ GLOBAL_LIST_EMPTY(species_list)
344344

345345
if(!(timed_action_flags & IGNORE_SLOWDOWNS))
346346
delay *= user.action_speed_modifier * user.do_after_coefficent() //yogs: darkspawn
347+
348+
if(skill_check && user.mind)
349+
delay *= (12 - user.get_skill(skill_check)) / 10
347350

348351
var/datum/progressbar/progbar
349352
if(progress)
@@ -378,6 +381,9 @@ GLOBAL_LIST_EMPTY(species_list)
378381
. = FALSE
379382
break
380383

384+
if(skill_check) // get better at things by practicing them
385+
user.add_exp(skill_check, delay)
386+
381387
if(!QDELETED(progbar))
382388
progbar.end_progress()
383389

code/_onclick/hud/alert.dm

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,74 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
322322
var/mob/living/carbon/C = mob_viewer
323323
C.take(giver, receiving)
324324

325+
//SKILLS
326+
327+
/atom/movable/screen/alert/skill_up
328+
name = "Allocate Skill Points"
329+
desc = "You have unspent skill points! Click here to allocate them."
330+
var/list/allocated_skills = list(
331+
SKILL_PHYSIOLOGY = 0,
332+
SKILL_MECHANICAL = 0,
333+
SKILL_TECHNICAL = 0,
334+
SKILL_SCIENCE = 0,
335+
SKILL_FITNESS = 0,
336+
)
337+
var/allocated_points = 0
338+
339+
/atom/movable/screen/alert/skill_up/Click(location, control, params)
340+
. = ..()
341+
ui_interact(mob_viewer)
342+
343+
/atom/movable/screen/alert/skill_up/ui_interact(mob/user, datum/tgui/ui)
344+
ui = SStgui.try_update_ui(user, src, ui)
345+
if (!ui)
346+
ui = new(user, src, "SkillMenu", "Allocate Skill Points")
347+
ui.open()
348+
349+
/atom/movable/screen/alert/skill_up/ui_data(mob/user)
350+
var/list/data = list()
351+
var/list/skill_data = list()
352+
for(var/skill in user.mind.skills)
353+
skill_data.Add(list(list(
354+
"base" = user.get_skill(skill),
355+
"allocated" = allocated_skills[skill],
356+
)))
357+
data["skills"] = skill_data
358+
data["skill_points"] = user.mind.skill_points
359+
data["allocated_points"] = allocated_points
360+
data["exceptional_skill"] = HAS_TRAIT(user, TRAIT_EXCEPTIONAL_SKILL)
361+
return data
362+
363+
/atom/movable/screen/alert/skill_up/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
364+
. = ..()
365+
if(.)
366+
return
367+
var/mob/user = usr
368+
if(!user.mind)
369+
CRASH("User ([user]) without a mind attempted to allocate skill points!")
370+
switch(action)
371+
if("confirm")
372+
for(var/skill in user.mind.skills)
373+
user.adjust_skill(skill, allocated_skills[skill], max_skill = EXP_GENIUS)
374+
allocated_skills[skill] = 0
375+
user.mind.skill_points -= allocated_points
376+
allocated_points = 0
377+
if(!user.mind.skill_points)
378+
user.clear_alert("skill points")
379+
return TRUE
380+
if("allocate")
381+
allocated_skills[params["skill"]] += params["amount"]
382+
allocated_points += params["amount"]
383+
return TRUE
384+
385+
/atom/movable/screen/alert/skill_up/ui_status(mob/user)
386+
if(!user.mind)
387+
return UI_CLOSE
388+
return UI_INTERACTIVE
389+
390+
/atom/movable/screen/alert/skill_up/ui_state(mob/user)
391+
return GLOB.always_state
392+
325393
//ALIENS
326394

327395
/atom/movable/screen/alert/alien_tox

code/controllers/subsystem/shuttle.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,14 @@ SUBSYSTEM_DEF(shuttle)
523523
* * dock_id - The ID of the destination (stationary docking port) to move to
524524
* * timed - If true, have the shuttle follow normal spool-up, jump, dock process. If false, immediately move to the new location.
525525
*/
526-
/datum/controller/subsystem/shuttle/proc/moveShuttle(shuttle_id, dock_id, timed)
526+
/datum/controller/subsystem/shuttle/proc/moveShuttle(shuttle_id, dock_id, timed, skill_multiplier = 1)
527527
var/obj/docking_port/mobile/shuttle_port = getShuttle(shuttle_id)
528528
var/obj/docking_port/stationary/docking_target = getDock(dock_id)
529529

530530
if(!shuttle_port)
531531
return DOCKING_NULL_SOURCE
532532
if(timed)
533-
if(shuttle_port.request(docking_target))
533+
if(shuttle_port.request(docking_target, skill_multiplier))
534534
return DOCKING_IMMOBILIZED
535535
else
536536
if(shuttle_port.initiate_docking(docking_target) != DOCKING_SUCCESS)

code/datums/components/blocking.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@
220220
if(!blocking_component.can_block(defender, incoming, damage, attack_type))
221221
return 0
222222
force_returned = blocking_component.block_force
223+
if(attack_type & MELEE_ATTACK) // being stronger provides a small increase to melee blocking
224+
force_returned += defender.get_skill(SKILL_FITNESS)
223225
if(HAS_TRAIT(weapon, TRAIT_PARRYING))
224226
force_returned *= PARRY_BONUS
225227
return max(force_returned - max(armour_penetration - weapon.armour_penetration, 0) * AP_TO_FORCE, 0)

code/datums/components/mech_pilot.dm

Lines changed: 0 additions & 7 deletions
This file was deleted.

code/datums/diseases/advance/symptoms/necropolis.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
fullpower = TRUE
5858
H.physiology.punchdamagehigh_bonus += 4
5959
H.physiology.punchdamagelow_bonus += 4
60-
H.physiology.punchstunthreshold_bonus += 1 //Makes standard punches 5-14 with higher stun chance (1-10, stun on 10 -> 5-14, stun on 11-14)
60+
H.physiology.punchstunchance_bonus += 0.4 //Makes standard punches 5-14 with higher stun chance (1-10, stun on 10 -> 5-14, stun on 11-14)
6161
H.physiology.brute_mod *= 0.6
6262
H.physiology.burn_mod *= 0.6
6363
H.physiology.heat_mod *= 0.6
@@ -103,7 +103,7 @@
103103
H.remove_movespeed_modifier(MOVESPEED_ID_NECRO_VIRUS_SLOWDOWN)
104104
H.physiology.punchdamagehigh_bonus -= 4
105105
H.physiology.punchdamagelow_bonus -= 4
106-
H.physiology.punchstunthreshold_bonus -= 1
106+
H.physiology.punchstunchance_bonus -= 0.4
107107
H.physiology.brute_mod /= 0.6
108108
H.physiology.burn_mod /= 0.6
109109
H.physiology.heat_mod /= 0.6

code/datums/martial.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@
101101
* used for basic punch attacks
102102
*/
103103
/datum/martial_art/proc/basic_hit(mob/living/carbon/human/A,mob/living/carbon/human/D)
104-
105-
var/damage = rand(A.get_punchdamagelow(), A.get_punchdamagehigh())
104+
var/percentile = rand()
105+
var/damage = LERP(A.get_punchdamagelow(), A.get_punchdamagehigh(), percentile)
106106

107107
var/atk_verb = pick(A.dna.species.attack_verbs)
108108
var/atk_effect = A.dna.species.attack_effect
@@ -129,7 +129,7 @@
129129

130130
log_combat(A, D, "punched")
131131

132-
if((D.stat != DEAD) && damage >= A.get_punchstunthreshold())
132+
if((D.stat != DEAD) && percentile > (1 - A.get_punchstunchance()) && !HAS_TRAIT(A, TRAIT_NO_PUNCH_STUN))
133133
D.visible_message(span_danger("[A] has knocked [D] down!!"), \
134134
span_userdanger("[A] has knocked [D] down!"))
135135
D.apply_effect(40, EFFECT_KNOCKDOWN, armor_block)

code/datums/martial/lightning_flow.dm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
id = MARTIALART_LIGHTNINGFLOW
99
no_guns = TRUE
1010
help_verb = /mob/living/carbon/human/proc/lightning_flow_help
11-
martial_traits = list(TRAIT_STRONG_GRABBER)
11+
martial_traits = list(TRAIT_STRONG_GRABBER, TRAIT_NO_PUNCH_STUN)
1212
var/dashing = FALSE
1313
COOLDOWN_DECLARE(action_cooldown)
1414
var/list/action_modifiers = list()
@@ -147,15 +147,13 @@
147147
var/mob/living/carbon/human/user = H
148148
user.physiology.punchdamagelow_bonus += 5
149149
user.physiology.punchdamagehigh_bonus += 5
150-
user.physiology.punchstunthreshold_bonus += 6 //no knockdowns
151150

152151
/datum/martial_art/lightning_flow/on_remove(mob/living/carbon/human/H)
153152
UnregisterSignal(H, COMSIG_MOB_CLICKON)
154153
if(ishuman(H))//it's already a human, but it won't let me access physiology for some reason
155154
var/mob/living/carbon/human/user = H
156155
user.physiology.punchdamagelow_bonus -= 5
157156
user.physiology.punchdamagehigh_bonus -= 5
158-
user.physiology.punchstunthreshold_bonus -= 6
159157
return ..()
160158

161159
#undef ACTION_DELAY

0 commit comments

Comments
 (0)