mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
## About The Pull Request 50 files, plus additonal file that was necessary because I slightly refactored windoor construction. This ended up like three and a half times larger than most of the other ones, I really wasn't meaning for that to happen. Maybe its because I more vigorously enforced the empty line after every return thing. The only way to find out is to read 1700 lines of changes, and I don't feel like doing that again. I pinky promise it all works, and I've tested every item changed individually. Changes beyond conversion: You can't welder down reinforced falsewalls anymore, pretty sure it was an oversight because they're supposed to be taken down by wirecutters You can right click to close gun lockers with an empty hand, because otherwise you can't close the lockers at all if there's a gun in them Meatspikes no longer runtime on construction due to the old trick of balloon alert + qdel Windoor assembly no longer SUCKS DICK!!, it's no longer storing essentially a boolean in an undocumented number in a string, it no longer requires a VERB to flip its direction. on a related note, the creator of the windoor assembly construction steps has been sent to live on a farm far out in the country Also, a quick note about how these prs are gonna fuck everything up until they're all together. There's a lot more places where `attackby()` is directly called than I would have assumed, and given as those are being changed to call `item_interaction()` potentially(usually) in a different pr than the pr in which that atom's `attackby()` is actually converted, that function's not going to work at all until both are merged. The good news is that almost every instance this is happening, it's pure convenience, where the user would have access to both items anyway and could just manually call the attack chain by clicking them together. Instances where this is not the case are being skipped over until they can be packaged together to avoid the issue, but I'm not bothering to do this on ones where the desync won't make an interaction actually unusable, because that would require me to turn a 1700 line pr into a 3500 line pr and I really was aiming for like 500 ## Why It's Good For The Game Ignore the paragraph about how I expect this to create a hostage situation where the only fix to the bugs I make is to merge my other prs, and instead think about how cool swing combat would be and how much you want it ## Changelog 🆑 fix: you now can only use a wirecutter to take down a reinforced falsewall fix: meatspikes no longer runtime on construction fix: you no longer have to use a verb that you can't use to flip windoor assemblies qol: you can right click a gun locker to close it code: 50 files have been moved from attackby() to item_interaction() /🆑
161 lines
5.8 KiB
Plaintext
161 lines
5.8 KiB
Plaintext
///Defines for the pressure strength of the fist
|
|
#define LOW_PRESSURE 1
|
|
#define MID_PRESSURE 2
|
|
#define HIGH_PRESSURE 3
|
|
///Defines for the tank change action
|
|
#define TANK_INSERTING 0
|
|
#define TANK_REMOVING 1
|
|
|
|
/obj/item/melee/powerfist
|
|
name = "power-fist"
|
|
desc = "A metal gauntlet with a piston-powered ram on top for that extra 'oomph' in your punch."
|
|
icon = 'icons/obj/antags/syndicate_tools.dmi'
|
|
icon_state = "powerfist"
|
|
inhand_icon_state = "powerfist"
|
|
icon_angle = 180
|
|
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
|
|
obj_flags = CONDUCTS_ELECTRICITY
|
|
attack_verb_continuous = list("whacks", "fists", "power-punches")
|
|
attack_verb_simple = list("whack", "fist", "power-punch")
|
|
force = 20
|
|
throwforce = 10
|
|
throw_range = 7
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
armor_type = /datum/armor/melee_powerfist
|
|
resistance_flags = FIRE_PROOF
|
|
/// Delay between attacks
|
|
var/click_delay = 0.15 SECONDS
|
|
/// Pressure level on the fist
|
|
var/fist_pressure_setting = LOW_PRESSURE
|
|
/// Amount of moles per punch
|
|
var/gas_per_fist = 3
|
|
/// Tank used for the gauntlet's piston-ram.
|
|
var/obj/item/tank/internals/tank
|
|
|
|
/datum/armor/melee_powerfist
|
|
fire = 100
|
|
acid = 40
|
|
|
|
/obj/item/melee/powerfist/proc/pressure_setting_to_text(fist_pressure_setting)
|
|
switch(fist_pressure_setting)
|
|
if(LOW_PRESSURE)
|
|
return "low"
|
|
if(MID_PRESSURE)
|
|
return "medium"
|
|
if(HIGH_PRESSURE)
|
|
return "high"
|
|
else
|
|
CRASH("Invalid pressure setting: [fist_pressure_setting]!")
|
|
|
|
/obj/item/melee/powerfist/examine(mob/user)
|
|
. = ..()
|
|
if(!in_range(user, src))
|
|
. += span_notice("You'll need to get closer to see any more.")
|
|
return
|
|
if(tank)
|
|
. += span_notice("[icon2html(tank, user)] It has \a [tank] mounted onto it.")
|
|
. += span_notice("Can be removed with a <b>screwdriver</b>.")
|
|
|
|
. += span_notice("Use a <b>wrench</b> to change the valve strength. Current strength is at <b>[pressure_setting_to_text(fist_pressure_setting)]</b> level.")
|
|
|
|
/obj/item/melee/powerfist/wrench_act(mob/living/user, obj/item/tool)
|
|
fist_pressure_setting = fist_pressure_setting >= HIGH_PRESSURE ? LOW_PRESSURE : fist_pressure_setting + 1
|
|
tool.play_tool_sound(src)
|
|
balloon_alert(user, "piston strength set to [pressure_setting_to_text(fist_pressure_setting)]")
|
|
return TRUE
|
|
|
|
/obj/item/melee/powerfist/screwdriver_act(mob/living/user, obj/item/tool)
|
|
if(!tank)
|
|
balloon_alert(user, "no tank present")
|
|
return
|
|
update_tank(tank, TANK_REMOVING, user)
|
|
return TRUE
|
|
|
|
/obj/item/melee/powerfist/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
if(!istype(tool, /obj/item/tank/internals))
|
|
return NONE
|
|
|
|
if(tank)
|
|
to_chat(user, span_notice("A tank is already present, remove it with a screwdriver first."))
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
if(astype(tool, /obj/item/tank/internals).volume <= 3)
|
|
to_chat(user, span_warning("\The [tool] is too small for \the [src]."))
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
update_tank(tool, TANK_INSERTING, user)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/item/melee/powerfist/proc/update_tank(obj/item/tank/internals/the_tank, removing = TANK_INSERTING, mob/living/carbon/human/user)
|
|
if(removing)
|
|
if(!tank)
|
|
to_chat(user, span_notice("\The [src] currently has no tank attached to it."))
|
|
return
|
|
to_chat(user, span_notice("You detach \the [the_tank] from \the [src]."))
|
|
tank.forceMove(get_turf(user))
|
|
user.put_in_hands(tank)
|
|
tank = null
|
|
return
|
|
|
|
if(tank)
|
|
to_chat(user, span_warning("\The [src] already has a tank."))
|
|
return
|
|
if(!user.transferItemToLoc(the_tank, src))
|
|
return
|
|
to_chat(user, span_notice("You hook \the [the_tank] up to \the [src]."))
|
|
tank = the_tank
|
|
|
|
/obj/item/melee/powerfist/attack(mob/living/target, mob/living/user)
|
|
if(!tank)
|
|
to_chat(user, span_warning("\The [src] can't operate without a source of gas!"))
|
|
return
|
|
if(HAS_TRAIT(user, TRAIT_PACIFISM))
|
|
to_chat(user, span_warning("You don't want to harm other living beings!"))
|
|
return
|
|
var/turf/our_turf = get_turf(src)
|
|
if(!our_turf)
|
|
return
|
|
|
|
var/datum/gas_mixture/gas_used = tank.remove_air(gas_per_fist * fist_pressure_setting)
|
|
if(!gas_used)
|
|
to_chat(user, span_warning("\The [src]'s tank is empty!"))
|
|
target.apply_damage((force / 5), BRUTE)
|
|
playsound(loc, 'sound/items/weapons/punch1.ogg', 50, TRUE)
|
|
target.visible_message(span_danger("[user]'s powerfist lets out a dull thunk as [user.p_they()] punch[user.p_es()] [target.name]!"), \
|
|
span_userdanger("[user]'s punches you!"))
|
|
return
|
|
|
|
if(!molar_cmp_equals(gas_used.total_moles(), gas_per_fist * fist_pressure_setting))
|
|
our_turf.assume_air(gas_used)
|
|
to_chat(user, span_warning("\The [src]'s piston-ram lets out a weak hiss, it needs more gas!"))
|
|
playsound(loc, 'sound/items/weapons/punch4.ogg', 50, TRUE)
|
|
target.apply_damage((force / 2), BRUTE)
|
|
target.visible_message(span_danger("[user]'s powerfist lets out a weak hiss as [user.p_they()] punch[user.p_es()] [target.name]!"), \
|
|
span_userdanger("[user]'s punch strikes with force!"))
|
|
return
|
|
|
|
target.visible_message(span_danger("[user]'s powerfist lets out a loud hiss as [user.p_they()] punch[user.p_es()] [target.name]!"), \
|
|
span_userdanger("You cry out in pain as [user]'s punch flings you backwards!"))
|
|
new /obj/effect/temp_visual/kinetic_blast(target.loc)
|
|
target.apply_damage(force * fist_pressure_setting, BRUTE, wound_bonus = CANT_WOUND)
|
|
playsound(src, 'sound/items/weapons/resonator_blast.ogg', 50, TRUE)
|
|
playsound(src, 'sound/items/weapons/genhit2.ogg', 50, TRUE)
|
|
|
|
if(!QDELETED(target))
|
|
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
|
|
|
|
target.throw_at(throw_target, 5 * fist_pressure_setting, 0.5 + (fist_pressure_setting / 2))
|
|
|
|
log_combat(user, target, "power fisted", src)
|
|
|
|
user.changeNext_move(CLICK_CD_MELEE * click_delay)
|
|
|
|
our_turf.assume_air(gas_used)
|
|
|
|
#undef LOW_PRESSURE
|
|
#undef MID_PRESSURE
|
|
#undef HIGH_PRESSURE
|
|
#undef TANK_INSERTING
|
|
#undef TANK_REMOVING
|