2c8248575a
* Refactor several log lines to use datum_info_line and atom_loc_line * Add default return strings from datum_info_line and atom_loc_line * Add parentheses around atom_loc_line data * Change more logs to use atom_loc_line * Add check in atom_loc_line for turfs to avoid calling get_turf on them * Re-add removed 'at' * Replace datum_info_line with key_name and atom_loc_line with loc_name * Refactor logging functions * Avoid double-logging self-interactions * Fallback to simple stringification if all else fails in key_name() * Rewrite muscle spasm logging to use log_message * Standardize logging of martial arts * Tweak individual logging panel look * Fix individual logging panel source * When I typed || I really meant && * Fix Telecomms logging always showing client logs in the panel * Reverts addition of buggy ownership log to panel * Remove colon * Fix missing log_directed_talk tag * Add warning for missing type in log_direted_talk * Change warnings to stack_traces * Add square brackets around fallthrough key_name() case to help parsing * Allow atom arguments/src in log_*() functions * Change log_combat call with null argument to log_message * Change mecha types' log_message() arguments to match atom and mob version * Add key_name() case for atoms * Fix resist_grab() unsetting pulledby before log_combat gets a chance to use it * Fix log_globally logic * Add logging for hitting objects with items * Move log_combat() to atoms.dm * Use utility functions for object stringification in log_combat() * Use utility functions for object stringification in log_combat() * Add missing logs for interacting with display cases * Rewrite log_combat() comment * Add missing space in log_combat() * Add logging for hitting grilles barehanded * Add missing ..()
97 lines
3.5 KiB
Plaintext
97 lines
3.5 KiB
Plaintext
/obj/item/melee/powerfist
|
|
name = "power-fist"
|
|
desc = "A metal gauntlet with a piston-powered ram ontop for that extra 'ompfh' in your punch."
|
|
icon_state = "powerfist"
|
|
item_state = "powerfist"
|
|
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
|
|
flags_1 = CONDUCT_1
|
|
attack_verb = list("whacked", "fisted", "power-punched")
|
|
force = 20
|
|
throwforce = 10
|
|
throw_range = 7
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 40)
|
|
resistance_flags = FIRE_PROOF
|
|
var/click_delay = 1.5
|
|
var/fisto_setting = 1
|
|
var/gasperfist = 3
|
|
var/obj/item/tank/internals/tank = null //Tank used for the gauntlet's piston-ram.
|
|
|
|
|
|
/obj/item/melee/powerfist/examine(mob/user)
|
|
..()
|
|
if(!in_range(user, src))
|
|
to_chat(user, "<span class='notice'>You'll need to get closer to see any more.</span>")
|
|
return
|
|
if(tank)
|
|
to_chat(user, "<span class='notice'>[icon2html(tank, user)] It has \a [tank] mounted onto it.</span>")
|
|
|
|
|
|
/obj/item/melee/powerfist/attackby(obj/item/W, mob/user, params)
|
|
if(istype(W, /obj/item/tank/internals))
|
|
if(!tank)
|
|
var/obj/item/tank/internals/IT = W
|
|
if(IT.volume <= 3)
|
|
to_chat(user, "<span class='warning'>\The [IT] is too small for \the [src].</span>")
|
|
return
|
|
updateTank(W, 0, user)
|
|
else if(istype(W, /obj/item/wrench))
|
|
switch(fisto_setting)
|
|
if(1)
|
|
fisto_setting = 2
|
|
if(2)
|
|
fisto_setting = 3
|
|
if(3)
|
|
fisto_setting = 1
|
|
W.play_tool_sound(src)
|
|
to_chat(user, "<span class='notice'>You tweak \the [src]'s piston valve to [fisto_setting].</span>")
|
|
else if(istype(W, /obj/item/screwdriver))
|
|
if(tank)
|
|
updateTank(tank, 1, user)
|
|
|
|
|
|
/obj/item/melee/powerfist/proc/updateTank(obj/item/tank/internals/thetank, removing = 0, mob/living/carbon/human/user)
|
|
if(removing)
|
|
if(!tank)
|
|
to_chat(user, "<span class='notice'>\The [src] currently has no tank attached to it.</span>")
|
|
return
|
|
to_chat(user, "<span class='notice'>You detach \the [thetank] from \the [src].</span>")
|
|
tank.forceMove(get_turf(user))
|
|
user.put_in_hands(tank)
|
|
tank = null
|
|
if(!removing)
|
|
if(tank)
|
|
to_chat(user, "<span class='warning'>\The [src] already has a tank.</span>")
|
|
return
|
|
if(!user.transferItemToLoc(thetank, src))
|
|
return
|
|
to_chat(user, "<span class='notice'>You hook \the [thetank] up to \the [src].</span>")
|
|
tank = thetank
|
|
|
|
|
|
/obj/item/melee/powerfist/attack(mob/living/target, mob/living/user)
|
|
if(!tank)
|
|
to_chat(user, "<span class='warning'>\The [src] can't operate without a source of gas!</span>")
|
|
return
|
|
if(tank && !tank.air_contents.remove(gasperfist * fisto_setting))
|
|
to_chat(user, "<span class='warning'>\The [src]'s piston-ram lets out a weak hiss, it needs more gas!</span>")
|
|
playsound(loc, 'sound/effects/refill.ogg', 50, 1)
|
|
return
|
|
target.apply_damage(force * fisto_setting, BRUTE)
|
|
target.visible_message("<span class='danger'>[user]'s powerfist lets out a loud hiss as [user.p_they()] punch[user.p_es()] [target.name]!</span>", \
|
|
"<span class='userdanger'>You cry out in pain as [user]'s punch flings you backwards!</span>")
|
|
new /obj/effect/temp_visual/kinetic_blast(target.loc)
|
|
playsound(loc, 'sound/weapons/resonator_blast.ogg', 50, 1)
|
|
playsound(loc, 'sound/weapons/genhit2.ogg', 50, 1)
|
|
|
|
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
|
|
|
|
target.throw_at(throw_target, 5 * fisto_setting, 0.2)
|
|
|
|
log_combat(user, target, "power fisted", src)
|
|
|
|
user.changeNext_move(CLICK_CD_MELEE * click_delay)
|
|
|
|
return
|