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

Commit b3ee2f6

Browse files
things
1 parent d510f1c commit b3ee2f6

File tree

9 files changed

+37
-22
lines changed

9 files changed

+37
-22
lines changed

code/_onclick/item_attack.dm

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,32 +160,32 @@
160160
* Called from [/mob/living/proc/attackby]
161161
*
162162
* Arguments:
163-
* * mob/living/M - The mob being hit by this item
163+
* * mob/living/target - The mob being hit by this item
164164
* * mob/living/user - The mob hitting with this item
165165
* * params - Click params of this attack
166166
*/
167-
/obj/item/proc/attack(mob/living/M, mob/living/user, params)
168-
var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, M, user, params)
167+
/obj/item/proc/attack(mob/living/target, mob/living/user, params)
168+
var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, target, user, params)
169169
if(signal_return & COMPONENT_CANCEL_ATTACK_CHAIN)
170170
return TRUE
171171
if(signal_return & COMPONENT_SKIP_ATTACK)
172172
return
173173

174-
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user, params)
174+
SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, target, user, params)
175175
if(item_flags & NOBLUDGEON)
176176
return
177177

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

191191
if(force && !synth_check(user, SYNTH_ORGANIC_HARM))
@@ -199,16 +199,17 @@
199199
else if(hitsound)
200200
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
201201

202-
M.lastattacker = user.real_name
203-
M.lastattackerckey = user.ckey
202+
target.lastattacker = user.real_name
203+
target.lastattackerckey = user.ckey
204204

205205
if(force)
206-
M.last_damage = name
206+
target.last_damage = name
207207

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

211-
log_combat(user, M, "attacked", src.name, "(COMBAT MODE: [user.combat_mode ? "ON" : "OFF"]) (DAMTYPE: [uppertext(damtype)])")
212+
log_combat(user, target, "attacked", src.name, "(COMBAT MODE: [user.combat_mode ? "ON" : "OFF"]) (DAMTYPE: [uppertext(damtype)])")
212213
add_fingerprint(user)
213214
var/force_multiplier = 1
214215
if(ishuman(user))
@@ -233,6 +234,7 @@
233234
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
234235
user.do_attack_animation(attacked_atom)
235236
attacked_atom.attacked_by(src, user)
237+
user.add_exp(SKILL_FITNESS, force / 5)
236238
user.weapon_slow(src)
237239
var/force_multiplier = 1
238240
if(ishuman(user))

code/datums/components/blocking.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
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
223+
if(attack_type & (MELEE_ATTACK|UNARMED_ATTACK|THROWN_PROJECTILE_ATTACK|LEAP_ATTACK)) // being stronger provides a small increase to melee blocking
224224
force_returned += defender.get_skill(SKILL_FITNESS)
225225
if(HAS_TRAIT(weapon, TRAIT_PARRYING))
226226
force_returned *= PARRY_BONUS

code/datums/mind.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@
855855
mind.skills[skill] = clamp(mind.skills[skill] + amount, min_skill, max_skill)
856856

857857
/// Checks if the mob's skill level meets a given threshold.
858-
/mob/proc/skill_check(skill, amount, inclusive = FALSE)
858+
/mob/proc/skill_check(skill, amount)
859859
if(!mind)
860860
return FALSE
861861
return (mind.skills[skill] >= amount)

code/game/machinery/computer/dna_console.dm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@
423423
if(!(scanner_occupant == connected_scanner.occupant))
424424
return
425425

426-
check_discovery(params["alias"])
426+
check_discovery(params["alias"], usr)
427427
return
428428

429429
// Check all mutations of the occupant and check if any are discovered.
@@ -445,7 +445,7 @@
445445
// Go over all standard mutations and check if they've been discovered.
446446
for(var/mutation_type in scanner_occupant.dna.mutation_index)
447447
var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(mutation_type)
448-
check_discovery(HM.alias)
448+
check_discovery(HM.alias, usr)
449449

450450
return
451451

@@ -521,7 +521,7 @@
521521
return
522522

523523
// Check if we cracked a mutation
524-
check_discovery(alias)
524+
check_discovery(alias, usr)
525525

526526
return
527527

@@ -1908,7 +1908,7 @@
19081908
* Arguments:
19091909
* * alias - Alias of the mutation to check (ie "Mutation 51" or "Mutation 12")
19101910
*/
1911-
/obj/machinery/computer/scan_consolenew/proc/check_discovery(alias)
1911+
/obj/machinery/computer/scan_consolenew/proc/check_discovery(alias, mob/user)
19121912
// Note - All code paths that call this have already done checks on the
19131913
// current occupant to prevent cheese and other abuses. If you call this
19141914
// proc please also do the following checks first:
@@ -1933,6 +1933,7 @@
19331933
var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(path)
19341934
stored_research.discovered_mutations += path
19351935
say("Successfully discovered [HM.name].")
1936+
user.add_exp(SKILL_SCIENCE, EXPERIENCE_PER_LEVEL / 2)
19361937
return TRUE
19371938

19381939
return FALSE

code/game/objects/items/shooting_range.dm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
if(pinnedLoc)
2626
pinnedLoc.forceMove(loc)
2727

28+
/obj/item/target/bullet_act(obj/projectile/P)
29+
. = ..()
30+
if(iscarbon(P.firer)) // gain a bit of experience from shooting targets, based on distance
31+
var/mob/shooter = P.firer
32+
shooter.add_exp(SKILL_FITNESS, max(initial(P.range) - P.range, 1) * 2)
33+
2834
/obj/item/target/welder_act(mob/living/user, obj/item/I)
2935
if(I.use_tool(src, user, 0, volume=40))
3036
removeOverlays()

code/modules/jobs/job_types/detective.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
SKILL_MECHANICAL = EXP_NONE,
3232
SKILL_TECHNICAL = EXP_NONE,
3333
SKILL_SCIENCE = EXP_MID,
34-
SKILL_FITNESS = EXP_LOW,
34+
SKILL_FITNESS = EXP_MID,
3535
)
3636
skill_points = 2
3737

code/modules/mining/lavaland/ruins/gym.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
user.pixel_y = 0
5353
var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!")
5454
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "exercise", /datum/mood_event/exercise)
55+
user.add_exp(SKILL_FITNESS, 100)
5556
icon_state = initial(icon_state)
5657
to_chat(user, finishmessage)
5758
user.apply_status_effect(STATUS_EFFECT_EXERCISED)

code/modules/mob/living/carbon/human/human_defense.dm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
protection += cover.armor.getRating(armor_flag) * 0.5
2828
protection += physiology.armor.getRating(armor_flag)
2929
if(armor_flag == MELEE)
30-
protection = 100 - ((100 - protection) * (20 - get_skill(SKILL_FITNESS)) / 20) // 16% multiplicative armor at EXP_MASTER
30+
protection = 100 - ((100 - protection) * (50 - get_skill(SKILL_FITNESS)) / 50) // 8% multiplicative armor at EXP_MASTER
3131
return protection
3232

3333
///Get all the clothing on a specific body part
@@ -88,6 +88,10 @@
8888
if(shield_check & SHIELD_BLOCK)
8989
P.on_hit(src, 100, def_zone)
9090
return BULLET_ACT_HIT
91+
92+
if(iscarbon(P.firer) && stat == CONSCIOUS) // gain experience from shooting people, more if they were far away and less if it wasn't a real gun
93+
var/mob/shooter = P.firer
94+
shooter.add_exp(SKILL_FITNESS, max(initial(P.range) - P.range, 1) * ((P.nodamage || !P.damage) ? 2 : 5))
9195

9296
return ..(P, def_zone)
9397

code/modules/research/rdconsole.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ Nothing else in the console has ID requirements.
168168
SSblackbox.record_feedback("associative", "science_techweb_unlock", 1, list("id" = "[id]", "name" = TN.display_name, "price" = "[json_encode(price)]", "time" = SQLtime()))
169169
if(stored_research.research_node_id(id))
170170
say("Successfully researched [TN.display_name].")
171+
user.add_exp(SKILL_SCIENCE, price / 200)
171172
var/logname = "Unknown"
172173
if(isAI(user))
173174
logname = "AI: [user.name]"

0 commit comments

Comments
 (0)