|
160 | 160 | * Called from [/mob/living/proc/attackby] |
161 | 161 | * |
162 | 162 | * Arguments: |
163 | | - * * mob/living/M - The mob being hit by this item |
| 163 | + * * mob/living/target - The mob being hit by this item |
164 | 164 | * * mob/living/user - The mob hitting with this item |
165 | 165 | * * params - Click params of this attack |
166 | 166 | */ |
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) |
169 | 169 | if(signal_return & COMPONENT_CANCEL_ATTACK_CHAIN) |
170 | 170 | return TRUE |
171 | 171 | if(signal_return & COMPONENT_SKIP_ATTACK) |
172 | 172 | return |
173 | 173 |
|
174 | | - SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, M, user, params) |
| 174 | + SEND_SIGNAL(user, COMSIG_MOB_ITEM_ATTACK, target, user, params) |
175 | 175 | if(item_flags & NOBLUDGEON) |
176 | 176 | return |
177 | 177 |
|
178 | 178 | if(tool_behaviour && !user.combat_mode) // checks for combat mode with surgery tool |
179 | 179 | var/list/modifiers = params2list(params) |
180 | | - if(attempt_initiate_surgery(src, M, user, modifiers)) |
| 180 | + if(attempt_initiate_surgery(src, target, user, modifiers)) |
181 | 181 | return TRUE |
182 | | - if(iscarbon(M)) |
183 | | - var/mob/living/carbon/C = M |
| 182 | + if(iscarbon(target)) |
| 183 | + var/mob/living/carbon/C = target |
184 | 184 | for(var/i in C.all_wounds) |
185 | 185 | var/datum/wound/W = i |
186 | 186 | if(W.try_treating(src, user)) |
187 | 187 | 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 |
189 | 189 | return TRUE |
190 | 190 |
|
191 | 191 | if(force && !synth_check(user, SYNTH_ORGANIC_HARM)) |
|
199 | 199 | else if(hitsound) |
200 | 200 | playsound(loc, hitsound, get_clamped_volume(), 1, -1) |
201 | 201 |
|
202 | | - M.lastattacker = user.real_name |
203 | | - M.lastattackerckey = user.ckey |
| 202 | + target.lastattacker = user.real_name |
| 203 | + target.lastattackerckey = user.ckey |
204 | 204 |
|
205 | 205 | if(force) |
206 | | - M.last_damage = name |
| 206 | + target.last_damage = name |
207 | 207 |
|
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) |
210 | 211 |
|
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)])") |
212 | 213 | add_fingerprint(user) |
213 | 214 | var/force_multiplier = 1 |
214 | 215 | if(ishuman(user)) |
|
233 | 234 | 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 |
234 | 235 | user.do_attack_animation(attacked_atom) |
235 | 236 | attacked_atom.attacked_by(src, user) |
| 237 | + user.add_exp(SKILL_FITNESS, force / 5) |
236 | 238 | user.weapon_slow(src) |
237 | 239 | var/force_multiplier = 1 |
238 | 240 | if(ishuman(user)) |
|
0 commit comments