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

Adds Skills #22683

Merged
merged 43 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9ce76d7
skill issue
SapphicOverload Oct 7, 2024
9913ea7
this shouldn't be here
SapphicOverload Oct 7, 2024
dda6cdd
more stuff
SapphicOverload Oct 7, 2024
dac65ea
bit of rebalancing
SapphicOverload Oct 7, 2024
a1c48f6
i hate javascript!!!
SapphicOverload Oct 8, 2024
c1a810a
more balance
SapphicOverload Oct 8, 2024
d510f1c
stuff
SapphicOverload Oct 8, 2024
b3ee2f6
things
SapphicOverload Oct 9, 2024
96ff7f6
fixed some stuff
SapphicOverload Oct 15, 2024
053cef0
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Oct 15, 2024
aa9f2f7
hacking
SapphicOverload Oct 17, 2024
4830523
ghost roles
SapphicOverload Oct 17, 2024
97151f7
fix
SapphicOverload Oct 18, 2024
3c777b6
crafting skill requirements
SapphicOverload Oct 18, 2024
4c2d46e
real menu button
SapphicOverload Oct 18, 2024
ad8b347
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Oct 18, 2024
aa3c3f7
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Oct 18, 2024
e9bfc21
cyborg
SapphicOverload Oct 19, 2024
7cef28c
fixed IPC repair
SapphicOverload Oct 19, 2024
c6fd7d8
new skill icons
SapphicOverload Oct 19, 2024
31490d1
fix + rebalancing
SapphicOverload Oct 19, 2024
64399ef
skill icons 2
SapphicOverload Oct 19, 2024
b95448f
exploit fixed
SapphicOverload Oct 20, 2024
ee3dabf
chem dispenser fix
SapphicOverload Oct 20, 2024
7fa94e6
fix again
SapphicOverload Oct 20, 2024
c7fb868
clockwork style
SapphicOverload Oct 20, 2024
a2e26ea
genetics
SapphicOverload Oct 21, 2024
0eadd5f
science fix
SapphicOverload Oct 21, 2024
219ba71
progress bar indicators
SapphicOverload Oct 31, 2024
845ed80
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Oct 31, 2024
589566a
minor refactor + rebalance
SapphicOverload Nov 1, 2024
63cc83b
dna console fix
SapphicOverload Nov 1, 2024
9768a62
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Nov 1, 2024
ba17312
exploit fix
SapphicOverload Nov 24, 2024
307f6cb
progress bar
SapphicOverload Nov 24, 2024
0b82574
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Nov 24, 2024
97dc170
more like evilscript
SapphicOverload Nov 24, 2024
4675a1a
remove exploit
SapphicOverload Nov 27, 2024
b22d530
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Dec 4, 2024
7ad64a8
fix
SapphicOverload Dec 4, 2024
2decf23
Merge remote-tracking branch 'upstream/master' into skill-issue
SapphicOverload Dec 8, 2024
d4fb826
why is round ID a string???
SapphicOverload Dec 12, 2024
06d9159
another day, another exploit fixed
SapphicOverload Dec 25, 2024
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
27 changes: 27 additions & 0 deletions code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

/// Medicine and surgery.
#define SKILL_PHYSIOLOGY "physiology"
/// Construction and repair of structures and machinery.
#define SKILL_MECHANICAL "mechanics"
/// Hacking, piloting, and robotic maintenance.
#define SKILL_TECHNICAL "technical"
/// Chemistry, botany, physics, and other sciences.
#define SKILL_SCIENCE "science"
/// Strength, endurance, accuracy.
#define SKILL_FITNESS "fitness"

/// No experience whatsoever.
#define EXP_NONE 0
/// Some experience, but not much.
#define EXP_LOW 1
/// Enough experience to do a decent job.
#define EXP_MID 2
/// Above average skill level.
#define EXP_HIGH 3
/// Exceptionally skilled.
#define EXP_MASTER 4
/// Uniquely gifted. Not obtainable through normal means.
#define EXP_GENIUS 5

/// Experience required to increase your skills by one level. Increases exponentially the higher your level already is.
#define EXPERIENCE_PER_LEVEL 500
1 change: 1 addition & 0 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define TOOL_MULTITOOL "multitool"
#define TOOL_SCREWDRIVER "screwdriver"
#define TOOL_WIRECUTTER "wirecutter"
#define TOOL_WIRING "wiring"
#define TOOL_WRENCH "wrench"
#define TOOL_WELDER "welder"
#define TOOL_ANALYZER "analyzer"
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
#define TRAIT_IGNOREDAMAGESLOWDOWN "ignoredamageslowdown"
/// Makes the screen go black and white while illuminating all mobs based on their body temperature
#define TRAIT_INFRARED_VISION "infrared_vision"
/// Punches don't stun. Use this instead of setting punchstunchance to zero.
#define TRAIT_NO_PUNCH_STUN "no-punch-stun"

////////////////////////////////////////////////////////////////////////////////////
//-------------------------Species Specific defines-------------------------------//
Expand Down Expand Up @@ -440,6 +442,10 @@
#define TRAIT_PRESENT_VISION "present-vision"
#define TRAIT_DISK_VERIFIER "disk-verifier"
#define TRAIT_NOMOBSWAP "no-mob-swap"
/// Can allocate 5 points into one skill instead of the usual 4
#define TRAIT_EXCEPTIONAL_SKILL "exceptional-skill"
/// Acts as an additional skill point for piloting mechs, up to EXP_MASTER.
#define TRAIT_SKILLED_PILOT "skilled-pilot"
/// Can examine IDs to see if they are roundstart.
#define TRAIT_ID_APPRAISER "id_appraiser"
/// Gives us turf, mob and object vision through walls
Expand Down
8 changes: 7 additions & 1 deletion code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ GLOBAL_LIST_EMPTY(species_list)
* given `delay`. Returns `TRUE` on success or `FALSE` on failure.
* 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.
*/
/proc/do_after(mob/user, delay, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks, interaction_key, max_interact_count = 1)
/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)
if(!user)
return FALSE
if(!isnum(delay))
Expand All @@ -344,6 +344,9 @@ GLOBAL_LIST_EMPTY(species_list)

if(!(timed_action_flags & IGNORE_SLOWDOWNS))
delay *= user.action_speed_modifier * user.do_after_coefficent() //yogs: darkspawn

if(skill_check && user.mind)
delay *= (12 - user.get_skill(skill_check)) / 10

var/datum/progressbar/progbar
if(progress)
Expand Down Expand Up @@ -378,6 +381,9 @@ GLOBAL_LIST_EMPTY(species_list)
. = FALSE
break

if(skill_check) // get better at things by practicing them
user.add_exp(skill_check, delay)

if(!QDELETED(progbar))
progbar.end_progress()

Expand Down
68 changes: 68 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,74 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
var/mob/living/carbon/C = mob_viewer
C.take(giver, receiving)

//SKILLS

/atom/movable/screen/alert/skill_up
name = "Allocate Skill Points"
desc = "You have unspent skill points! Click here to allocate them."
var/list/allocated_skills = list(
SKILL_PHYSIOLOGY = 0,
SKILL_MECHANICAL = 0,
SKILL_TECHNICAL = 0,
SKILL_SCIENCE = 0,
SKILL_FITNESS = 0,
)
var/allocated_points = 0

/atom/movable/screen/alert/skill_up/Click(location, control, params)
. = ..()
ui_interact(mob_viewer)

/atom/movable/screen/alert/skill_up/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if (!ui)
ui = new(user, src, "SkillMenu", "Allocate Skill Points")
ui.open()

/atom/movable/screen/alert/skill_up/ui_data(mob/user)
var/list/data = list()
var/list/skill_data = list()
for(var/skill in user.mind.skills)
skill_data.Add(list(list(
"base" = user.get_skill(skill),
"allocated" = allocated_skills[skill],
)))
data["skills"] = skill_data
data["skill_points"] = user.mind.skill_points
data["allocated_points"] = allocated_points
data["exceptional_skill"] = HAS_TRAIT(user, TRAIT_EXCEPTIONAL_SKILL)
return data

/atom/movable/screen/alert/skill_up/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
var/mob/user = usr
if(!user.mind)
CRASH("User ([user]) without a mind attempted to allocate skill points!")
switch(action)
if("confirm")
for(var/skill in user.mind.skills)
user.adjust_skill(skill, allocated_skills[skill], max_skill = EXP_GENIUS)
allocated_skills[skill] = 0
user.mind.skill_points -= allocated_points
allocated_points = 0
if(!user.mind.skill_points)
user.clear_alert("skill points")
return TRUE
if("allocate")
allocated_skills[params["skill"]] += params["amount"]
allocated_points += params["amount"]
return TRUE

/atom/movable/screen/alert/skill_up/ui_status(mob/user)
if(!user.mind)
return UI_CLOSE
return UI_INTERACTIVE

/atom/movable/screen/alert/skill_up/ui_state(mob/user)
return GLOB.always_state

//ALIENS

/atom/movable/screen/alert/alien_tox
Expand Down
30 changes: 16 additions & 14 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,32 +160,32 @@
* Called from [/mob/living/proc/attackby]
*
* Arguments:
* * mob/living/M - The mob being hit by this item
* * mob/living/target - The mob being hit by this item
* * mob/living/user - The mob hitting with this item
* * params - Click params of this attack
*/
/obj/item/proc/attack(mob/living/M, mob/living/user, params)
var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, M, user, params)
/obj/item/proc/attack(mob/living/target, mob/living/user, params)
var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, target, user, params)
if(signal_return & COMPONENT_CANCEL_ATTACK_CHAIN)
return TRUE
if(signal_return & COMPONENT_SKIP_ATTACK)
return

SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user, params)
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, target, user, params)
if(item_flags & NOBLUDGEON)
return

if(tool_behaviour && !user.combat_mode) // checks for combat mode with surgery tool
var/list/modifiers = params2list(params)
if(attempt_initiate_surgery(src, M, user, modifiers))
if(attempt_initiate_surgery(src, target, user, modifiers))
return TRUE
if(iscarbon(M))
var/mob/living/carbon/C = M
if(iscarbon(target))
var/mob/living/carbon/C = target
for(var/i in C.all_wounds)
var/datum/wound/W = i
if(W.try_treating(src, user))
return TRUE
to_chat(user, span_warning("You can't perform any surgeries on [M]'s [parse_zone(user.zone_selected)]!")) //yells at you
to_chat(user, span_warning("You can't perform any surgeries on [target]'s [parse_zone(user.zone_selected)]!")) //yells at you
return TRUE

if(force && !synth_check(user, SYNTH_ORGANIC_HARM))
Expand All @@ -199,16 +199,17 @@
else if(hitsound)
playsound(loc, hitsound, get_clamped_volume(), 1, -1)

M.lastattacker = user.real_name
M.lastattackerckey = user.ckey
target.lastattacker = user.real_name
target.lastattackerckey = user.ckey

if(force)
M.last_damage = name
target.last_damage = name

user.do_attack_animation(M)
M.attacked_by(src, user)
user.do_attack_animation(target)
user.add_exp(SKILL_FITNESS, target.stat == CONSCIOUS ? force : force / 5) // attacking things that can't move isn't very good experience
target.attacked_by(src, user)

log_combat(user, M, "attacked", src.name, "(COMBAT MODE: [user.combat_mode ? "ON" : "OFF"]) (DAMTYPE: [uppertext(damtype)])")
log_combat(user, target, "attacked", src.name, "(COMBAT MODE: [user.combat_mode ? "ON" : "OFF"]) (DAMTYPE: [uppertext(damtype)])")
add_fingerprint(user)
var/force_multiplier = 1
if(ishuman(user))
Expand All @@ -233,6 +234,7 @@
user.changeNext_move(CLICK_CD_MELEE * weapon_stats[SWING_SPEED] * (range_cooldown_mod ? (dist > 0 ? min(dist, weapon_stats[REACH]) * range_cooldown_mod : range_cooldown_mod) : 1)) //range increases attack cooldown by swing speed
user.do_attack_animation(attacked_atom)
attacked_atom.attacked_by(src, user)
user.add_exp(SKILL_FITNESS, force / 5)
user.weapon_slow(src)
var/force_multiplier = 1
if(ishuman(user))
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,14 @@ SUBSYSTEM_DEF(shuttle)
* * dock_id - The ID of the destination (stationary docking port) to move to
* * timed - If true, have the shuttle follow normal spool-up, jump, dock process. If false, immediately move to the new location.
*/
/datum/controller/subsystem/shuttle/proc/moveShuttle(shuttle_id, dock_id, timed)
/datum/controller/subsystem/shuttle/proc/moveShuttle(shuttle_id, dock_id, timed, skill_multiplier = 1)
var/obj/docking_port/mobile/shuttle_port = getShuttle(shuttle_id)
var/obj/docking_port/stationary/docking_target = getDock(dock_id)

if(!shuttle_port)
return DOCKING_NULL_SOURCE
if(timed)
if(shuttle_port.request(docking_target))
if(shuttle_port.request(docking_target, skill_multiplier))
return DOCKING_IMMOBILIZED
else
if(shuttle_port.initiate_docking(docking_target) != DOCKING_SUCCESS)
Expand Down
2 changes: 2 additions & 0 deletions code/datums/components/blocking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@
if(!blocking_component.can_block(defender, incoming, damage, attack_type))
return 0
force_returned = blocking_component.block_force
if(attack_type & (MELEE_ATTACK|UNARMED_ATTACK|THROWN_PROJECTILE_ATTACK|LEAP_ATTACK)) // being stronger provides a small increase to melee blocking
force_returned += defender.get_skill(SKILL_FITNESS)
if(HAS_TRAIT(weapon, TRAIT_PARRYING))
force_returned *= PARRY_BONUS
return max(force_returned - max(armour_penetration - weapon.armour_penetration, 0) * AP_TO_FORCE, 0)
Expand Down
7 changes: 0 additions & 7 deletions code/datums/components/mech_pilot.dm

This file was deleted.

4 changes: 2 additions & 2 deletions code/datums/diseases/advance/symptoms/necropolis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
fullpower = TRUE
H.physiology.punchdamagehigh_bonus += 4
H.physiology.punchdamagelow_bonus += 4
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)
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)
H.physiology.brute_mod *= 0.6
H.physiology.burn_mod *= 0.6
H.physiology.heat_mod *= 0.6
Expand Down Expand Up @@ -103,7 +103,7 @@
H.remove_movespeed_modifier(MOVESPEED_ID_NECRO_VIRUS_SLOWDOWN)
H.physiology.punchdamagehigh_bonus -= 4
H.physiology.punchdamagelow_bonus -= 4
H.physiology.punchstunthreshold_bonus -= 1
H.physiology.punchstunchance_bonus -= 0.4
H.physiology.brute_mod /= 0.6
H.physiology.burn_mod /= 0.6
H.physiology.heat_mod /= 0.6
Expand Down
6 changes: 3 additions & 3 deletions code/datums/martial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
* used for basic punch attacks
*/
/datum/martial_art/proc/basic_hit(mob/living/carbon/human/A,mob/living/carbon/human/D)

var/damage = rand(A.get_punchdamagelow(), A.get_punchdamagehigh())
var/percentile = rand()
var/damage = LERP(A.get_punchdamagelow(), A.get_punchdamagehigh(), percentile)

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

log_combat(A, D, "punched")

if((D.stat != DEAD) && damage >= A.get_punchstunthreshold())
if((D.stat != DEAD) && percentile > (1 - A.get_punchstunchance()) && !HAS_TRAIT(A, TRAIT_NO_PUNCH_STUN))
D.visible_message(span_danger("[A] has knocked [D] down!!"), \
span_userdanger("[A] has knocked [D] down!"))
D.apply_effect(40, EFFECT_KNOCKDOWN, armor_block)
Expand Down
4 changes: 1 addition & 3 deletions code/datums/martial/lightning_flow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
id = MARTIALART_LIGHTNINGFLOW
no_guns = TRUE
help_verb = /mob/living/carbon/human/proc/lightning_flow_help
martial_traits = list(TRAIT_STRONG_GRABBER)
martial_traits = list(TRAIT_STRONG_GRABBER, TRAIT_NO_PUNCH_STUN)
var/dashing = FALSE
COOLDOWN_DECLARE(action_cooldown)
var/list/action_modifiers = list()
Expand Down Expand Up @@ -147,15 +147,13 @@
var/mob/living/carbon/human/user = H
user.physiology.punchdamagelow_bonus += 5
user.physiology.punchdamagehigh_bonus += 5
user.physiology.punchstunthreshold_bonus += 6 //no knockdowns

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

#undef ACTION_DELAY
Expand Down
4 changes: 1 addition & 3 deletions code/datums/martial/ultra_violence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
help_verb = /mob/living/carbon/human/proc/ultra_violence_help
gun_exceptions = list(/obj/item/gun/ballistic/revolver/ipcmartial)
no_gun_message = "This gun is not compliant with Ultra Violence standards."
martial_traits = list(TRAIT_NOSOFTCRIT, TRAIT_IGNOREDAMAGESLOWDOWN, TRAIT_NOLIMBDISABLE, TRAIT_NO_STUN_WEAPONS, TRAIT_NO_BLOCKING, TRAIT_NODISMEMBER, TRAIT_STUNIMMUNE, TRAIT_SLEEPIMMUNE, TRAIT_NO_HOLDUP)
martial_traits = list(TRAIT_NOSOFTCRIT, TRAIT_IGNOREDAMAGESLOWDOWN, TRAIT_NOLIMBDISABLE, TRAIT_NO_STUN_WEAPONS, TRAIT_NO_PUNCH_STUN, TRAIT_NO_BLOCKING, TRAIT_NODISMEMBER, TRAIT_STUNIMMUNE, TRAIT_SLEEPIMMUNE, TRAIT_NO_HOLDUP)
///used to keep track of the dash stuff
var/dashing = FALSE
var/dashes = 3
Expand Down Expand Up @@ -429,7 +429,6 @@
H.dna.species.attack_sound = 'sound/weapons/shotgunshot.ogg'
H.dna.species.punchdamagelow += 4
H.dna.species.punchdamagehigh += 4 //no fancy comboes, just punches
H.dna.species.punchstunthreshold += 50 //disables punch stuns
H.dna.species.staminamod = 0 //my god, why must you make me add all these additional things, stop trying to disable them, just kill them
RegisterSignal(H, COMSIG_MOB_CLICKON, PROC_REF(on_click)) // death to click_intercept
H.throw_alert("dash_charge", /atom/movable/screen/alert/ipcmartial, dashes+1)
Expand All @@ -440,7 +439,6 @@
H.dna.species.attack_sound = initial(H.dna.species.attack_sound) //back to flimsy tin tray punches
H.dna.species.punchdamagelow -= 4
H.dna.species.punchdamagehigh -= 4
H.dna.species.punchstunthreshold -= 50
H.dna.species.staminamod = initial(H.dna.species.staminamod)
UnregisterSignal(H, COMSIG_MOB_CLICKON)
deltimer(dash_timer)
Expand Down
Loading
Loading