Files
Bubberstation/code/game/objects/structures/kitchen_spike.dm
Qustinnus 707fc287b4 Replaces intents with combat mode (#56601)
About The Pull Request

This PR removes intents and replaces them with a combat mode. An explanation of what this means can be found below
Major changes:

    Disarm and Grab intents have been removed.
    Harm/Help is now combat mode, toggled by F or 4 by default
    The context/verb/popup menu now only works when you do shift+right-click
    Right click is now disarm, both in and out of combat mode.
    Grabbing is now on ctrl-click.
    If you're in combat mode, and are currently grabbing/pulling someone, and ctrl-click somewhere else, it will not release the grab (To prevent misclicks)

Minor interaction changes:

Right click to dissasemble tables, racks, filing cabinets (When holding the right tool to do so)
Left click to stunbaton, right click to harmbaton
Right click to tip cows
Right click to malpractice surgery
Right click to hold people at gunpoint (if youre holding a gun)
Why It's Good For The Game

Intents heavily cripple both the code and the UI design of interactions. While I understand that a lot of people will dislike this PR as they are used to intents, they are one of our weakest links in terms of explaining to players how to do specific things, and require a lot more keypresses to do compared to this.

As an example, martial arts can now be done without having to juggle 1 2 3 and 4 to switch intents quickly.

As some of you who saw the first combat mode PR, the context menu used to be disabled in combat mode. In this version it is instead on shift-right click ensuring that you can always use it in the same way.

In this version, combat mode also no longer prevents you from attacking with items when you would so before, as this was something that was commonly complained about.

The full intention of this shift in control scheme is that right click will become "secondary interaction" for items, which prevents some of the awkward juggling we have now with item modes etcetera.
Changelog

cl Qustinnus
add: Intents have been replaced with a combat mode. For more info find the PR here: #56601
/cl
2021-02-04 16:37:32 +13:00

150 lines
5.0 KiB
Plaintext

//////Kitchen Spike
#define VIABLE_MOB_CHECK(X) (isliving(X) && !issilicon(X) && !isbot(X))
/obj/structure/kitchenspike_frame
name = "meatspike frame"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spikeframe"
desc = "The frame of a meat spike."
density = TRUE
anchored = FALSE
max_integrity = 200
/obj/structure/kitchenspike_frame/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(default_unfasten_wrench(user, I))
return
else if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if(R.get_amount() >= 4)
R.use(4)
to_chat(user, "<span class='notice'>You add spikes to the frame.</span>")
var/obj/F = new /obj/structure/kitchenspike(src.loc)
transfer_fingerprints_to(F)
qdel(src)
else if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
if(I.use_tool(src, user, 50, volume=50))
visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [I].</span>",
"<span class='hear'>You hear welding.</span>")
new /obj/item/stack/sheet/metal(src.loc, 4)
qdel(src)
return
else
return ..()
/obj/structure/kitchenspike
name = "meat spike"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spike"
desc = "A spike for collecting meat from animals."
density = TRUE
anchored = TRUE
buckle_lying = 0
can_buckle = 1
max_integrity = 250
/obj/structure/kitchenspike/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I)
if(has_buckled_mobs())
to_chat(user, "<span class='warning'>You can't do that while something's on the spike!</span>")
return TRUE
if(I.use_tool(src, user, 20, volume=100))
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
deconstruct(TRUE)
return TRUE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/kitchenspike/attack_hand(mob/living/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.combat_mode && !has_buckled_mobs())
var/mob/living/L = user.pulling
if(do_mob(user, src, 120))
if(has_buckled_mobs()) //to prevent spam/queing up attacks
return
if(L.buckled)
return
if(user.pulling != L)
return
playsound(src.loc, 'sound/effects/splat.ogg', 25, TRUE)
L.visible_message("<span class='danger'>[user] slams [L] onto the meat spike!</span>", "<span class='userdanger'>[user] slams you onto the meat spike!</span>", "<span class='hear'>You hear a squishy wet noise.</span>")
L.forceMove(drop_location())
L.emote("scream")
L.add_splatter_floor()
L.adjustBruteLoss(30)
L.setDir(2)
buckle_mob(L, force=1)
var/matrix/m180 = matrix(L.transform)
m180.Turn(180)
animate(L, transform = m180, time = 3)
L.pixel_y = L.base_pixel_y + PIXEL_Y_OFFSET_LYING
else if (has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
user_unbuckle_mob(L, user)
else
..()
/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE) //Don't want them getting put on the rack other than by spiking
return
/obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/living/carbon/human/user)
if(buckled_mob)
var/mob/living/M = buckled_mob
if(M != user)
M.visible_message("<span class='notice'>[user] tries to pull [M] free of [src]!</span>",\
"<span class='notice'>[user] is trying to pull you off [src], opening up fresh wounds!</span>",\
"<span class='hear'>You hear a squishy wet noise.</span>")
if(!do_after(user, 300, target = src))
if(M?.buckled)
M.visible_message("<span class='notice'>[user] fails to free [M]!</span>",\
"<span class='notice'>[user] fails to pull you off of [src].</span>")
return
else
M.visible_message("<span class='warning'>[M] struggles to break free from [src]!</span>",\
"<span class='notice'>You struggle to break free from [src], exacerbating your wounds! (Stay still for two minutes.)</span>",\
"<span class='hear'>You hear a wet squishing noise..</span>")
M.adjustBruteLoss(30)
if(!do_after(M, 1200, target = src))
if(M?.buckled)
to_chat(M, "<span class='warning'>You fail to free yourself!</span>")
return
if(!M.buckled)
return
release_mob(M)
/obj/structure/kitchenspike/proc/release_mob(mob/living/M)
var/matrix/m180 = matrix(M.transform)
m180.Turn(180)
animate(M, transform = m180, time = 3)
M.pixel_y = M.base_pixel_y + PIXEL_Y_OFFSET_LYING
M.adjustBruteLoss(30)
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
unbuckle_mob(M,force=1)
M.emote("scream")
M.AdjustParalyzed(20)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
release_mob(L)
return ..()
/obj/structure/kitchenspike/deconstruct(disassembled = TRUE)
if(disassembled)
var/obj/F = new /obj/structure/kitchenspike_frame(src.loc)
transfer_fingerprints_to(F)
else
new /obj/item/stack/sheet/metal(src.loc, 4)
new /obj/item/stack/rods(loc, 4)
qdel(src)
#undef VIABLE_MOB_CHECK