Files
Bubberstation/code/game/objects/items/fireaxe.dm
Ghom 339616ae78 You can now interact with held mobs beside wearing them (feat: "minor" melee attack chain cleanup) (#90080)
## About The Pull Request
People can now pet held mothroaches and pugs if they want to, or use
items on them, hopefully without causing many issues. After all, it only
took about a couple dozen lines of code to make...

...Oh, did the 527 files changed or the 850~ lines added/removed perhaps
catch your eye? Made you wonder if I accidentally pushed the wrong
branch? or skewed something up big time? Well, nuh uh. I just happen to
be fed up with the melee attack chain still using stringized params
instead of an array/list. It was frankly revolting to see how I'd have
had to otherwise call `list2params` for what I'm trying to accomplish
here, and make this PR another tessera to the immense stupidity of our
attack chain procs calling `params2list` over and over and over instead
of just using that one call instance from `ClickOn` as an argument. It's
2025, honey, wake up!

I also tried to replace some of those single letter vars/args but there
are just way too many of them.

## Why It's Good For The Game
Improving old code. And I want to be able to pet mobroaches while
holding them too.

## Changelog

🆑
qol: You can now interact with held mobs in more ways beside wearing
them.
/🆑
2025-04-23 20:18:26 +00:00

112 lines
3.7 KiB
Plaintext

GLOBAL_DATUM(bridge_axe, /obj/item/fireaxe)
/*
* Fireaxe
*/
/obj/item/fireaxe // DEM AXES MAN, marker -Agouri
name = "fire axe"
desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
icon = 'icons/obj/weapons/fireaxe.dmi'
icon_state = "fireaxe0"
base_icon_state = "fireaxe"
lefthand_file = 'icons/mob/inhands/weapons/axes_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/axes_righthand.dmi'
force = 5
throwforce = 15
demolition_mod = 1.25
w_class = WEIGHT_CLASS_BULKY
obj_flags = CONDUCTS_ELECTRICITY
slot_flags = ITEM_SLOT_BACK
attack_verb_continuous = list("attacks", "chops", "cleaves", "tears", "lacerates", "cuts")
attack_verb_simple = list("attack", "chop", "cleave", "tear", "lacerate", "cut")
hitsound = 'sound/items/weapons/bladeslice.ogg'
sharpness = SHARP_EDGED
armor_type = /datum/armor/item_fireaxe
resistance_flags = FIRE_PROOF
wound_bonus = -15
bare_wound_bonus = 20
/// How much damage to do unwielded
var/force_unwielded = 5
/// How much damage to do wielded
var/force_wielded = 24
/datum/armor/item_fireaxe
fire = 100
acid = 30
/obj/item/fireaxe/Initialize(mapload)
. = ..()
if(!GLOB.bridge_axe && istype(get_area(src), /area/station/command))
GLOB.bridge_axe = src
AddComponent(/datum/component/butchering, \
speed = 10 SECONDS, \
effectiveness = 80, \
bonus_modifier = 0 , \
butcher_sound = hitsound, \
)
//axes are not known for being precision butchering tools
AddComponent(/datum/component/two_handed, force_unwielded=force_unwielded, force_wielded=force_wielded, icon_wielded="[base_icon_state]1")
/obj/item/fireaxe/Destroy()
if(GLOB.bridge_axe == src)
GLOB.bridge_axe = null
return ..()
/obj/item/fireaxe/get_demolition_modifier(obj/target)
return HAS_TRAIT(src, TRAIT_WIELDED) ? demolition_mod : 0.8
/obj/item/fireaxe/update_icon_state()
icon_state = "[base_icon_state]0"
return ..()
/obj/item/fireaxe/suicide_act(mob/living/user)
user.visible_message(span_suicide("[user] axes [user.p_them()]self from head to toe! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/fireaxe/afterattack(atom/target, mob/user, list/modifiers)
if(!HAS_TRAIT(src, TRAIT_WIELDED)) //destroys windows and grilles in one hit
return
if(target.resistance_flags & INDESTRUCTIBLE)
return
if(istype(target, /obj/structure/window) || istype(target, /obj/structure/grille))
target.atom_destruction("fireaxe")
/*
* Bone Axe
*/
/obj/item/fireaxe/boneaxe // Blatant imitation of the fireaxe, but made out of bone.
name = "bone axe"
desc = "A large, vicious axe crafted out of several sharpened bone plates and crudely tied together. Made of monsters, by killing monsters, for killing monsters."
icon_state = "bone_axe0"
base_icon_state = "bone_axe"
icon_angle = 180
force_unwielded = 5
force_wielded = 23
/*
* Metal Hydrogen Axe
*/
/obj/item/fireaxe/metal_h2_axe
name = "metallic hydrogen axe"
desc = "A lightweight crowbar with an extreme sharp fire axe head attached. It trades its heft as a weapon by making it easier to carry around when holstered to suits without having to sacrifice your backpack."
icon_state = "metalh2_axe0"
base_icon_state = "metalh2_axe"
icon_angle = -45
force_unwielded = 5
force_wielded = 15
demolition_mod = 2
tool_behaviour = TOOL_CROWBAR
toolspeed = 1
usesound = 'sound/items/tools/crowbar.ogg'
//boarding axe
/obj/item/fireaxe/boardingaxe
name = "boarding axe"
desc = "A hulking cleaver that feels like a burden just looking at it. Seems excellent at halving obstacles like windows, airlocks, barricades and people."
icon_state = "boarding_axe0"
base_icon_state = "boarding_axe"
force_unwielded = 5
force_wielded = 30
demolition_mod = 3