mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
Puts the kinetic crusher's projectile firing on rmb (#64964)
* Puts crusher projectile firing on rmb * Ranged proc melee click cooldown * Implements code review * implements further code review
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
|
||||
/obj/item/kinetic_crusher/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += span_notice("Mark a large creature with the destabilizing force, then hit them in melee to do <b>[force + detonation_damage]</b> damage.")
|
||||
. += span_notice("Mark a large creature with a destabilizing force with right-click, then hit them in melee to do <b>[force + detonation_damage]</b> damage.")
|
||||
. += span_notice("Does <b>[force + detonation_damage + backstab_bonus]</b> damage if the target is backstabbed, instead of <b>[force + detonation_damage]</b>.")
|
||||
for(var/t in trophies)
|
||||
var/obj/item/crusher_trophy/T = t
|
||||
@@ -97,27 +97,6 @@
|
||||
C.total_damage += target_health - target.health //we did some damage, but let's not assume how much we did
|
||||
|
||||
/obj/item/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams)
|
||||
. = ..()
|
||||
var/modifiers = params2list(clickparams)
|
||||
if(!wielded)
|
||||
return
|
||||
if(!proximity_flag && charged)//Mark a target, or mine a tile.
|
||||
var/turf/proj_turf = user.loc
|
||||
if(!isturf(proj_turf))
|
||||
return
|
||||
var/obj/projectile/destabilizer/D = new /obj/projectile/destabilizer(proj_turf)
|
||||
for(var/t in trophies)
|
||||
var/obj/item/crusher_trophy/T = t
|
||||
T.on_projectile_fire(D, user)
|
||||
D.preparePixelProjectile(target, user, modifiers)
|
||||
D.firer = user
|
||||
D.hammer_synced = src
|
||||
playsound(user, 'sound/weapons/plasma_cutter.ogg', 100, TRUE)
|
||||
D.fire()
|
||||
charged = FALSE
|
||||
update_appearance()
|
||||
addtimer(CALLBACK(src, .proc/Recharge), charge_time)
|
||||
return
|
||||
if(proximity_flag && isliving(target))
|
||||
var/mob/living/L = target
|
||||
var/datum/status_effect/crusher_mark/CM = L.has_status_effect(/datum/status_effect/crusher_mark)
|
||||
@@ -146,6 +125,39 @@
|
||||
C.total_damage += detonation_damage
|
||||
L.apply_damage(detonation_damage, BRUTE, blocked = def_check)
|
||||
|
||||
/obj/item/kinetic_crusher/attack_secondary(atom/target, mob/living/user, clickparams)
|
||||
return SECONDARY_ATTACK_CONTINUE_CHAIN
|
||||
|
||||
/obj/item/kinetic_crusher/afterattack_secondary(atom/target, mob/living/user, clickparams)
|
||||
if(!wielded)
|
||||
balloon_alert(user, "wield it first!")
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
if(target == user)
|
||||
balloon_alert(user, "can't aim at yourself!")
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
fire_kinetic_blast(target, user, clickparams)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
/obj/item/kinetic_crusher/proc/fire_kinetic_blast(atom/target, mob/living/user, clickparams)
|
||||
if(!charged)
|
||||
return
|
||||
var/modifiers = params2list(clickparams)
|
||||
var/turf/proj_turf = user.loc
|
||||
if(!isturf(proj_turf))
|
||||
return
|
||||
var/obj/projectile/destabilizer/destabilizer = new(proj_turf)
|
||||
for(var/obj/item/crusher_trophy/attached_trophy as anything in trophies)
|
||||
attached_trophy.on_projectile_fire(destabilizer, user)
|
||||
destabilizer.preparePixelProjectile(target, user, modifiers)
|
||||
destabilizer.firer = user
|
||||
destabilizer.hammer_synced = src
|
||||
playsound(user, 'sound/weapons/plasma_cutter.ogg', 100, TRUE)
|
||||
destabilizer.fire()
|
||||
charged = FALSE
|
||||
update_appearance()
|
||||
addtimer(CALLBACK(src, .proc/Recharge), charge_time)
|
||||
|
||||
/obj/item/kinetic_crusher/proc/Recharge()
|
||||
if(!charged)
|
||||
charged = TRUE
|
||||
|
||||
Reference in New Issue
Block a user