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
This commit is contained in:
Qustinnus
2021-02-04 16:37:32 +13:00
committed by GitHub
parent c0c39018f3
commit 707fc287b4
277 changed files with 1137 additions and 1254 deletions
+2 -2
View File
@@ -342,7 +342,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
add_fingerprint(usr)
return ..()
/obj/item/attack_hand(mob/user)
/obj/item/attack_hand(mob/user, modifiers)
. = ..()
if(.)
return
@@ -604,7 +604,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "eye_stab", /datum/mood_event/eye_stab)
log_combat(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])")
log_combat(user, M, "attacked", "[src.name]", "(Combat mode: [user.combat_mode ? "On" : "Off"])")
var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES)
if(!eyes)
+1 -1
View File
@@ -39,7 +39,7 @@
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/cardboard_cutout/attack_hand(mob/living/user)
if(user.a_intent == INTENT_HELP || pushed_over)
if(!user.combat_mode || pushed_over)
return ..()
user.visible_message("<span class='warning'>[user] pushes over [src]!</span>", "<span class='danger'>You push over [src]!</span>")
playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE)
+3 -3
View File
@@ -82,7 +82,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]")
log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]")
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && user.a_intent == INTENT_HELP)
if(lit && cig && !user.combat_mode)
if(cig.lit)
to_chat(user, "<span class='warning'>[cig] is already lit!</span>")
if(M == user)
@@ -296,7 +296,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
light("<span class='notice'>[user] lights [src] with [M]'s burning body. What a cold-blooded badass.</span>")
return
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && user.a_intent == INTENT_HELP)
if(lit && cig && !user.combat_mode)
if(cig.lit)
to_chat(user, "<span class='warning'>The [cig.name] is already lit!</span>")
if(M == user)
@@ -734,7 +734,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]")
log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]")
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && user.a_intent == INTENT_HELP)
if(lit && cig && !user.combat_mode)
if(cig.lit)
to_chat(user, "<span class='warning'>The [cig.name] is already lit!</span>")
if(M == user)
+3 -3
View File
@@ -123,7 +123,7 @@
playsound(loc, 'sound/items/welder2.ogg', 20, TRUE)
/obj/item/razor/attack(mob/M, mob/user)
/obj/item/razor/attack(mob/M, mob/living/user)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/location = user.zone_selected
@@ -131,7 +131,7 @@
to_chat(user, "<span class='warning'>[H] doesn't have a head!</span>")
return
if(location == BODY_ZONE_PRECISE_MOUTH)
if(user.a_intent == INTENT_HELP)
if(!user.combat_mode)
if(H.gender == MALE)
if (H == user)
to_chat(user, "<span class='warning'>You need a mirror to properly style your own facial hair!</span>")
@@ -178,7 +178,7 @@
shave(H, location)
else if(location == BODY_ZONE_HEAD)
if(user.a_intent == INTENT_HELP)
if(!user.combat_mode)
if (H == user)
to_chat(user, "<span class='warning'>You need a mirror to properly style your own hair!</span>")
return
+4 -3
View File
@@ -410,7 +410,7 @@
forceMove(defib)
defib.update_power()
/obj/item/shockpaddles/attack(mob/M, mob/user)
/obj/item/shockpaddles/attack(mob/M, mob/living/user, params)
if(busy)
return
if(req_defib && !defib.powered)
@@ -430,7 +430,8 @@
to_chat(user, "<span class='warning'>[src] are recharging!</span>")
return
if(user.a_intent == INTENT_DISARM)
var/list/modifiers = params2list(params)
if(modifiers && modifiers["right"])
do_disarm(M, user)
return
@@ -446,7 +447,7 @@
to_chat(user, "<span class='warning'>You need to target your patient's chest with [src]!</span>")
return
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
do_harm(H, user)
return
@@ -123,9 +123,9 @@
update_icon()
to_chat(user, "<span class='notice'>[icon2html(src, user)] You switch [scanning ? "on" : "off"] [src].</span>")
/obj/item/geiger_counter/afterattack(atom/target, mob/user)
/obj/item/geiger_counter/afterattack(atom/target, mob/living/user, params)
. = ..()
if(user.a_intent == INTENT_HELP)
if(!user.combat_mode)
if(!(obj_flags & EMAGGED))
user.visible_message("<span class='notice'>[user] scans [target] with [src].</span>", "<span class='notice'>You scan [target]'s radiation levels with [src]...</span>")
addtimer(CALLBACK(src, .proc/scan, target, user), 20, TIMER_UNIQUE) // Let's not have spamming GetAllContents
@@ -276,7 +276,7 @@ effective or pretty fucking useless.
new /obj/item/wirecutters(src)
/obj/item/storage/toolbox/emergency/turret/attackby(obj/item/I, mob/living/user, params)
if(I.tool_behaviour == TOOL_WRENCH && user.a_intent == INTENT_HARM)
if(I.tool_behaviour == TOOL_WRENCH && user.combat_mode)
user.visible_message("<span class='danger'>[user] bashes [src] with [I]!</span>", \
"<span class='danger'>You bash [src] with [I]!</span>", null, COMBAT_MESSAGE_RANGE)
playsound(src, "sound/items/drill_use.ogg", 80, TRUE, -1)
+2 -2
View File
@@ -89,8 +89,8 @@
to_chat(user, "The safety is [safety ? "on" : "off"].")
return
/obj/item/extinguisher/attack(mob/M, mob/user)
if(user.a_intent == INTENT_HELP && !safety) //If we're on help intent and going to spray people, don't bash them.
/obj/item/extinguisher/attack(mob/M, mob/living/user)
if(!user.combat_mode && !safety) //If we're on help intent and going to spray people, don't bash them.
return FALSE
else
return ..()
+3 -3
View File
@@ -833,11 +833,11 @@
add_overlay(pancake_visual)
update_icon()
/obj/item/food/pancakes/attack(mob/M, mob/user, def_zone, stacked = TRUE)
if(user.a_intent == INTENT_HARM || !contents.len || !stacked)
/obj/item/food/pancakes/attack(mob/M, mob/living/user, params, stacked = TRUE)
if(user.combat_mode || !contents.len || !stacked)
return ..()
var/obj/item/O = contents[contents.len]
. = O.attack(M, user, def_zone, FALSE)
. = O.attack(M, user, params, FALSE)
update_icon()
#undef PANCAKE_MAX_STACK
+3 -3
View File
@@ -34,7 +34,7 @@
cell.emp_act(severity)
/obj/item/inducer/attack_obj(obj/O, mob/living/carbon/user)
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return ..()
if(cantbeused(user))
@@ -135,8 +135,8 @@
recharging = FALSE
/obj/item/inducer/attack(mob/M, mob/user)
if(user.a_intent == INTENT_HARM)
/obj/item/inducer/attack(mob/M, mob/living/user)
if(user.combat_mode)
return ..()
if(cantbeused(user))
+37 -36
View File
@@ -244,7 +244,7 @@
/obj/item/melee/classic_baton/proc/additional_effects_silicon(mob/living/target, mob/living/user)
return
/obj/item/melee/classic_baton/attack(mob/living/target, mob/living/user)
/obj/item/melee/classic_baton/attack(mob/living/target, mob/living/user, params)
if(!on)
return ..()
@@ -264,7 +264,7 @@
return
if(iscyborg(target))
// We don't stun if we're on harm.
if (user.a_intent != INTENT_HARM)
if (!user.combat_mode)
if (affect_silicon)
var/list/desc = get_silicon_stun_description(target, user)
@@ -284,44 +284,45 @@
return
if(!isliving(target))
return
if (user.a_intent == INTENT_HARM)
if(!..())
var/list/modifiers = params2list(params)
if(modifiers && modifiers["right"])
..()
return
if(cooldown_check > world.time)
var/wait_desc = get_wait_description()
if (wait_desc)
to_chat(user, wait_desc)
return
if(ishuman(target))
var/mob/living/carbon/human/H = target
if (H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK))
return
if(!iscyborg(target))
if(check_martial_counter(H, user))
return
var/list/desc = get_stun_description(target, user)
if (stun_animation)
user.do_attack_animation(target)
playsound(get_turf(src), on_stun_sound, 75, TRUE, -1)
target.Knockdown(knockdown_time_carbon)
target.apply_damage(stamina_damage, STAMINA, BODY_ZONE_CHEST)
additional_effects_carbon(target, user)
log_combat(user, target, "stunned", src)
add_fingerprint(user)
target.visible_message(desc["visible"], desc["local"])
if(!iscarbon(user))
target.LAssailant = null
else
if(cooldown_check <= world.time)
if(ishuman(target))
var/mob/living/carbon/human/H = target
if (H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK))
return
if(check_martial_counter(H, user))
return
target.LAssailant = user
cooldown_check = world.time + cooldown
return
var/list/desc = get_stun_description(target, user)
if (stun_animation)
user.do_attack_animation(target)
playsound(get_turf(src), on_stun_sound, 75, TRUE, -1)
target.Knockdown(knockdown_time_carbon)
target.apply_damage(stamina_damage, STAMINA, BODY_ZONE_CHEST)
additional_effects_carbon(target, user)
log_combat(user, target, "stunned", src)
add_fingerprint(user)
target.visible_message(desc["visible"], desc["local"])
if(!iscarbon(user))
target.LAssailant = null
else
target.LAssailant = user
cooldown_check = world.time + cooldown
else
var/wait_desc = get_wait_description()
if (wait_desc)
to_chat(user, wait_desc)
/obj/item/conversion_kit
name = "conversion kit"
+1 -1
View File
@@ -82,7 +82,7 @@
update_icon()
/obj/item/pet_carrier/attack(mob/living/target, mob/living/user)
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return ..()
if(!open)
to_chat(user, "<span class='warning'>You need to open [src]'s door!</span>")
+3 -3
View File
@@ -70,8 +70,8 @@
out += "<span class='notice'>[icon2html(tank, user)] It has \a [tank] mounted onto it.</span>"
. += out.Join("\n")
/obj/item/pneumatic_cannon/attackby(obj/item/W, mob/user, params)
if(user.a_intent == INTENT_HARM)
/obj/item/pneumatic_cannon/attackby(obj/item/W, mob/living/user, params)
if(user.combat_mode)
return ..()
if(istype(W, /obj/item/tank/internals))
if(!tank)
@@ -135,7 +135,7 @@
/obj/item/pneumatic_cannon/afterattack(atom/target, mob/living/user, flag, params)
. = ..()
if(flag && user.a_intent == INTENT_HARM) //melee attack
if(flag && user.combat_mode)//melee attack
return
if(!istype(user))
return
+5 -4
View File
@@ -30,7 +30,7 @@
playsound(loc, 'sound/weapons/egloves.ogg', 50, TRUE, -1)
log_combat(user, M, "stunned", src, "(INTENT: [uppertext(user.a_intent)])")
log_combat(user, M, "stunned", src, "(Combat mode: [user.combat_mode ? "On" : "Off"])")
/obj/item/borg/cyborghug
name = "hugging module"
@@ -64,14 +64,15 @@
if(3)
to_chat(user, "ERROR: ARM ACTUATORS OVERLOADED.")
/obj/item/borg/cyborghug/attack(mob/living/M, mob/living/silicon/robot/user)
/obj/item/borg/cyborghug/attack(mob/living/M, mob/living/silicon/robot/user, params)
if(M == user)
return
switch(mode)
if(0)
if(M.health >= 0)
if(isanimal(M))
M.attack_hand(user) //This enables borgs to get the floating heart icon and mob emote from simple_animal's that have petbonus == true.
var/list/modifiers = params2list(params)
M.attack_hand(user, modifiers) //This enables borgs to get the floating heart icon and mob emote from simple_animal's that have petbonus == true.
return
if(user.zone_selected == BODY_ZONE_HEAD)
user.visible_message("<span class='notice'>[user] playfully boops [M] on the head!</span>", \
@@ -910,7 +911,7 @@
. += arm
/obj/item/borg/apparatus/beaker/attack_self(mob/living/silicon/robot/user)
if(stored && !user.client?.keys_held["Alt"] && user.a_intent != "help")
if(stored && !user.client?.keys_held["Alt"] && user.combat_mode)
var/obj/item/reagent_containers/C = stored
C.SplashReagents(get_turf(user))
loc.visible_message("<span class='notice'>[user] spills the contents of the [C] all over the floor.</span>")
+1 -1
View File
@@ -68,7 +68,7 @@
step_towards(H,pull)
step_towards(H,pull)
/obj/item/singularityhammer/afterattack(atom/A as mob|obj|turf|area, mob/user, proximity)
/obj/item/singularityhammer/afterattack(atom/A as mob|obj|turf|area, mob/living/user, proximity)
. = ..()
if(!proximity)
return
+1 -1
View File
@@ -294,7 +294,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
desc += "<span class='warning'>The name [ownername] is written in blood inside the cover.</span>"
/obj/item/storage/book/bible/syndicate/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE)
if (user.a_intent == INTENT_HELP)
if (!user.combat_mode)
return ..()
else
return ..(M,user,heal_mode = FALSE)
+18 -16
View File
@@ -1,6 +1,6 @@
/obj/item/melee/baton
name = "stun baton"
desc = "A stun baton for incapacitating people with."
desc = "A stun baton for incapacitating people with. Left click to harm, right click to stun."
icon_state = "stunbaton"
inhand_icon_state = "baton"
@@ -179,7 +179,7 @@
return TRUE
return FALSE
/obj/item/melee/baton/attack(mob/M, mob/living/carbon/human/user)
/obj/item/melee/baton/attack(mob/M, mob/living/carbon/human/user, params)
if(clumsy_check(user))
return FALSE
@@ -193,23 +193,25 @@
if(check_martial_counter(L, user))
return
if(user.a_intent != INTENT_HARM)
if(turned_on)
if(attack_cooldown_check <= world.time)
if(baton_effect(M, user))
user.do_attack_animation(M)
return
else
to_chat(user, "<span class='danger'>The baton is still charging!</span>")
else
M.visible_message("<span class='warning'>[user] prods [M] with [src]. Luckily it was off.</span>", \
"<span class='warning'>[user] prods you with [src]. Luckily it was off.</span>")
else
var/list/modifiers = params2list(params)
if(modifiers && modifiers["right"])
if(turned_on)
if(attack_cooldown_check <= world.time)
baton_effect(M, user)
..()
return
else if(turned_on)
if(attack_cooldown_check <= world.time)
if(baton_effect(M, user))
user.do_attack_animation(M)
return
else
to_chat(user, "<span class='danger'>The baton is still charging!</span>")
return
else
M.visible_message("<span class='warning'>[user] prods [M] with [src]. Luckily it was off.</span>", \
"<span class='warning'>[user] prods you with [src]. Luckily it was off.</span>")
return
/obj/item/melee/baton/proc/baton_effect(mob/living/L, mob/user)
if(shields_blocked(L, user))
@@ -277,7 +279,7 @@
//Makeshift stun baton. Replacement for stun gloves.
/obj/item/melee/baton/cattleprod
name = "stunprod"
desc = "An improvised stun baton."
desc = "An improvised stun baton. Left click to harm, right click to stun."
icon_state = "stunprod"
inhand_icon_state = "prod"
worn_icon_state = null
+1 -1
View File
@@ -31,7 +31,7 @@
. = ..()
if(!istype(I,/obj/item/tail_pin))
return
if(!(user.a_intent != INTENT_HARM && !(I.item_flags & ABSTRACT))) //We're using the same trick that tables use for placing objects x and y onto the click location.
if(!(I.item_flags & ABSTRACT)) //We're using the same trick that tables use for placing objects x and y onto the click location.
return
if(!user.transferItemToLoc(I, drop_location(), silent = FALSE))
return
+2 -2
View File
@@ -113,13 +113,13 @@
dyn_explosion(T, plasmaAmount/5)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder
qdel(src)
/obj/item/weldingtool/attack(mob/living/carbon/human/H, mob/user)
/obj/item/weldingtool/attack(mob/living/carbon/human/H, mob/living/user)
if(!istype(H))
return ..()
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
if(affecting && affecting.status == BODYPART_ROBOTIC && user.a_intent != INTENT_HARM)
if(affecting && affecting.status == BODYPART_ROBOTIC && !user.combat_mode)
if(src.use_tool(H, user, 0, volume=50, amount=1))
if(user == H)
user.visible_message("<span class='notice'>[user] starts to fix some of the dents on [H]'s [affecting.name].</span>",
+1 -1
View File
@@ -156,7 +156,7 @@
if(target == user)
to_chat(user, "<span class='notice'>Target another toy mech if you want to start a battle with yourself.</span>")
return
else if(user.a_intent != INTENT_HARM)
else if(!user.combat_mode)
if(wants_to_battle) //prevent spamming someone with offers
to_chat(user, "<span class='notice'>You already are offering battle to someone!</span>")
return
+5 -4
View File
@@ -23,13 +23,13 @@ oranges says: This is a meme relating to the english translation of the ss13 rus
mrdoombringer sez: and remember kids, if you try and PR a fix for this item's grammar, you are admitting that you are, indeed, a newfriend.
for further reading, please see: https://github.com/tgstation/tgstation/pull/30173 and https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=%2F%2Flurkmore.to%2FSS13&edit-text=&act=url
*/
/obj/item/banhammer/attack(mob/M, mob/user)
/obj/item/banhammer/attack(mob/M, mob/living/user)
if(user.zone_selected == BODY_ZONE_HEAD)
M.visible_message("<span class='danger'>[user] are stroking the head of [M] with a bangammer.</span>", "<span class='userdanger'>[user] are stroking your head with a bangammer.</span>", "<span class='hear'>You hear a bangammer stroking a head.</span>") // see above comment
else
M.visible_message("<span class='danger'>[M] has been banned FOR NO REISIN by [user]!</span>", "<span class='userdanger'>You have been banned FOR NO REISIN by [user]!</span>", "<span class='hear'>You hear a banhammer banning someone.</span>")
playsound(loc, 'sound/effects/adminhelp.ogg', 15) //keep it at 15% volume so people don't jump out of their skin too much
if(user.a_intent != INTENT_HELP)
if(user.combat_mode)
return ..(M, user)
/obj/item/sord
@@ -961,12 +961,13 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
name = "\improper ACME Extendo-Hand"
desc = "A novelty extendo-hand produced by the ACME corporation. Originally designed to knock out roadrunners."
/obj/item/extendohand/attack(atom/M, mob/living/carbon/human/user)
/obj/item/extendohand/attack(atom/M, mob/living/carbon/human/user, params)
var/dist = get_dist(M, user)
if(dist < min_reach)
to_chat(user, "<span class='warning'>[M] is too close to use [src] on.</span>")
return
M.attack_hand(user)
var/list/modifiers = params2list(params)
M.attack_hand(user, modifiers)
/obj/item/gohei
name = "gohei"
+1 -1
View File
@@ -88,7 +88,7 @@
ui.open()
/obj/item/canvas/attackby(obj/item/I, mob/living/user, params)
if(user.a_intent == INTENT_HELP)
if(!user.combat_mode)
ui_interact(user)
else
return ..()
@@ -84,7 +84,7 @@
playsound(loc, 'sound/items/welder.ogg', 100, TRUE)
/obj/structure/bed/nest/attack_alien(mob/living/carbon/alien/user)
if(user.a_intent != INTENT_HARM)
if(!user.combat_mode)
return attack_hand(user)
else
return ..()
@@ -256,7 +256,7 @@
else
return ..()
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/user)//returns TRUE if attackBy call shouldn't be continued (because tool was used/closet was of wrong type), FALSE if otherwise
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/living/user)//returns TRUE if attackBy call shouldn't be continued (because tool was used/closet was of wrong type), FALSE if otherwise
. = TRUE
if(opened)
if(istype(W, cutting_tool))
@@ -303,7 +303,7 @@
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
"<span class='hear'>You hear a ratchet.</span>")
else if(user.a_intent != INTENT_HARM)
else if(!user.combat_mode)
var/item_is_id = W.GetID()
if(!item_is_id)
return FALSE
@@ -22,7 +22,7 @@
else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
/obj/structure/closet/crate/large/attackby(obj/item/W, mob/user, params)
/obj/structure/closet/crate/large/attackby(obj/item/W, mob/living/user, params)
if(W.tool_behaviour == TOOL_CROWBAR)
if(manifest)
tear_manifest(user)
@@ -41,7 +41,7 @@
qdel(src)
else
if(user.a_intent == INTENT_HARM) //Only return ..() if intent is harm, otherwise return 0 or just end it.
if(user.combat_mode) //Only return ..() if intent is harm, otherwise return 0 or just end it.
return ..() //Stops it from opening and turning invisible when items are used on it.
else
+8 -8
View File
@@ -113,14 +113,14 @@
else if(!open)
. += "[initial(icon_state)]_closed"
/obj/structure/displaycase/attackby(obj/item/W, mob/user, params)
/obj/structure/displaycase/attackby(obj/item/W, mob/living/user, params)
if(W.GetID() && !broken && openable)
if(allowed(user))
to_chat(user, "<span class='notice'>You [open ? "close":"open"] [src].</span>")
toggle_lock(user)
else
to_chat(user, "<span class='alert'>Access denied.</span>")
else if(W.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
else if(W.tool_behaviour == TOOL_WELDER && !user.combat_mode && !broken)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=5))
return
@@ -177,7 +177,7 @@
/obj/structure/displaycase/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/displaycase/attack_hand(mob/user)
/obj/structure/displaycase/attack_hand(mob/living/user)
. = ..()
if(.)
return
@@ -192,7 +192,7 @@
//prevents remote "kicks" with TK
if (!Adjacent(user))
return
if (user.a_intent == INTENT_HELP)
if (!user.combat_mode)
if(!user.is_blind())
user.examinate(src)
return
@@ -293,11 +293,11 @@
GLOB.trophy_cases -= src
return ..()
/obj/structure/displaycase/trophy/attackby(obj/item/W, mob/user, params)
/obj/structure/displaycase/trophy/attackby(obj/item/W, mob/living/user, params)
if(!user.Adjacent(src)) //no TK museology
return
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return ..()
if(user.is_holding_item_of_type(/obj/item/key/displaycase))
@@ -539,7 +539,7 @@
/obj/structure/displaycase/forsale/wrench_act(mob/living/user, obj/item/I)
. = ..()
if(open && user.a_intent == INTENT_HELP )
if(open && !user.combat_mode)
if(anchored)
to_chat(user, "<span class='notice'>You start unsecuring [src]...</span>")
else
@@ -553,7 +553,7 @@
to_chat(user, "<span class='notice'>You secure [src].</span>")
set_anchored(!anchored)
return
else if(!open && user.a_intent == INTENT_HELP)
else if(!open && !user.combat_mode)
to_chat(user, "<span class='notice'>[src] must be open to move it.</span>")
return
+2 -2
View File
@@ -46,7 +46,7 @@
stored_extinguisher = null
update_icon()
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/living/user, params)
if(I.tool_behaviour == TOOL_WRENCH && !stored_extinguisher)
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
I.play_tool_sound(src)
@@ -68,7 +68,7 @@
return TRUE
else
toggle_cabinet(user)
else if(user.a_intent != INTENT_HARM)
else if(!user.combat_mode)
toggle_cabinet(user)
else
return ..()
+2 -2
View File
@@ -22,10 +22,10 @@
QDEL_NULL(fireaxe)
return ..()
/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/user, params)
/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/living/user, params)
if(iscyborg(user) || I.tool_behaviour == TOOL_MULTITOOL)
toggle_lock(user)
else if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
else if(I.tool_behaviour == TOOL_WELDER && !user.combat_mode && !broken)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=2))
return
+2 -2
View File
@@ -66,7 +66,7 @@
if (LAZYLEN(buckled_mobs))
. += "Someone appears to be strapped in. You can help them out, or you can harm them by activating the guillotine."
/obj/structure/guillotine/attack_hand(mob/user)
/obj/structure/guillotine/attack_hand(mob/living/user)
add_fingerprint(user)
// Currently being used by something
@@ -83,7 +83,7 @@
return
if (GUILLOTINE_BLADE_RAISED)
if (LAZYLEN(buckled_mobs))
if (user.a_intent == INTENT_HARM)
if (user.combat_mode)
user.visible_message("<span class='warning'>[user] begins to pull the lever!</span>",
"<span class='warning'>You begin to the pull the lever.</span>")
current_action = GUILLOTINE_ACTION_INUSE
+2 -2
View File
@@ -34,7 +34,7 @@
else
. += "[icon_state]_door"
/obj/structure/guncase/attackby(obj/item/I, mob/user, params)
/obj/structure/guncase/attackby(obj/item/I, mob/living/user, params)
if(iscyborg(user) || isalien(user))
return
if(istype(I, gun_category) && open)
@@ -47,7 +47,7 @@
to_chat(user, "<span class='warning'>[src] is full.</span>")
return
else if(user.a_intent != INTENT_HARM)
else if(!user.combat_mode)
open = !open
update_icon()
else
+1 -1
View File
@@ -162,7 +162,7 @@
return TRUE
/obj/structure/holosign/barrier/medical/attack_hand(mob/living/user)
if(CanPass(user) && user.a_intent == INTENT_HELP)
if(CanPass(user) && !user.combat_mode)
force_allaccess = !force_allaccess
to_chat(user, "<span class='warning'>You [force_allaccess ? "deactivate" : "activate"] the biometric scanners.</span>") //warning spans because you can make the station sick!
else
@@ -61,8 +61,8 @@
return TRUE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/kitchenspike/attack_hand(mob/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())
/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
@@ -127,10 +127,10 @@
/obj/structure/mineral_door/update_icon_state()
icon_state = "[initial(icon_state)][door_opened ? "open":""]"
/obj/structure/mineral_door/attackby(obj/item/I, mob/user)
/obj/structure/mineral_door/attackby(obj/item/I, mob/living/user)
if(pickaxe_door(user, I))
return
else if(user.a_intent != INTENT_HARM)
else if(!user.combat_mode)
return attack_hand(user)
else
return ..()
@@ -341,7 +341,7 @@
fire_act(I.get_temperature())
return
if((user.a_intent != INTENT_HARM) && istype(I, /obj/item/paper) && (obj_integrity < max_integrity))
if((!user.combat_mode) && istype(I, /obj/item/paper) && (obj_integrity < max_integrity))
user.visible_message("<span class='notice'>[user] starts to patch the holes in [src].</span>", "<span class='notice'>You start patching some of the holes in [src]!</span>")
if(do_after(user, 2 SECONDS, src))
obj_integrity = min(obj_integrity+4,max_integrity)
+1 -1
View File
@@ -70,7 +70,7 @@
/obj/structure/mirror/welder_act(mob/living/user, obj/item/I)
..()
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return FALSE
if(!broken)
@@ -60,7 +60,7 @@
/obj/structure/plaque/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This plaque is already in perfect condition.</span>")
@@ -78,7 +78,7 @@
/obj/item/plaque/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This plaque is already in perfect condition.</span>")
+1 -1
View File
@@ -30,7 +30,7 @@
..()
add_fingerprint(user)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP)
if(I.tool_behaviour == TOOL_WELDER && !user.combat_mode)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return
+2 -2
View File
@@ -93,7 +93,7 @@
/obj/structure/sign/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This sign is already in perfect condition.</span>")
@@ -111,7 +111,7 @@
/obj/item/sign/welder_act(mob/living/user, obj/item/I)
. = ..()
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return FALSE
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>This sign is already in perfect condition.</span>")
+36 -36
View File
@@ -69,15 +69,16 @@
if(pushed_mob.buckled)
to_chat(user, "<span class='warning'>[pushed_mob] is buckled to [pushed_mob.buckled]!</span>")
return
if(user.a_intent == INTENT_GRAB)
if(user.grab_state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return
if(user.grab_state >= GRAB_NECK)
tablelimbsmash(user, pushed_mob)
else
tablepush(user, pushed_mob)
if(user.a_intent == INTENT_HELP)
if(user.combat_mode)
switch(user.grab_state)
if(GRAB_PASSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return
if(GRAB_AGGRESSIVE)
tablepush(user, pushed_mob)
if(GRAB_NECK to GRAB_KILL)
tablelimbsmash(user, pushed_mob)
else
pushed_mob.visible_message("<span class='notice'>[user] begins to place [pushed_mob] onto [src]...</span>", \
"<span class='userdanger'>[user] begins to place [pushed_mob] onto [src]...</span>")
if(do_after(user, 35, target = pushed_mob))
@@ -161,8 +162,9 @@
log_combat(user, pushed_mob, "head slammed", null, "against [src]")
SEND_SIGNAL(pushed_mob, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table_limbsmash, banged_limb)
/obj/structure/table/attackby(obj/item/I, mob/user, params)
if(!(flags_1 & NODECONSTRUCT_1) && user.a_intent != INTENT_HELP)
/obj/structure/table/attackby(obj/item/I, mob/living/user, params)
var/list/modifiers = params2list(params)
if(!(flags_1 & NODECONSTRUCT_1) && modifiers && modifiers["right"])
if(I.tool_behaviour == TOOL_SCREWDRIVER && deconstruction_ready)
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
if(I.use_tool(src, user, 20, volume=50))
@@ -192,30 +194,26 @@
var/mob/living/carried_mob = riding_item.rider
if(carried_mob == user) //Piggyback user.
return
switch(user.a_intent)
if(INTENT_HARM)
user.unbuckle_mob(carried_mob)
tablelimbsmash(user, carried_mob)
if(INTENT_HELP)
var/tableplace_delay = 3.5 SECONDS
var/skills_space = ""
if(HAS_TRAIT(user, TRAIT_QUICKER_CARRY))
tableplace_delay = 2 SECONDS
skills_space = " expertly"
else if(HAS_TRAIT(user, TRAIT_QUICK_CARRY))
tableplace_delay = 2.75 SECONDS
skills_space = " quickly"
carried_mob.visible_message("<span class='notice'>[user] begins to[skills_space] place [carried_mob] onto [src]...</span>",
"<span class='userdanger'>[user] begins to[skills_space] place [carried_mob] onto [src]...</span>")
if(do_after(user, tableplace_delay, target = carried_mob))
user.unbuckle_mob(carried_mob)
tableplace(user, carried_mob)
else
if(user.combat_mode)
user.unbuckle_mob(carried_mob)
tablelimbsmash(user, carried_mob)
else
var/tableplace_delay = 3.5 SECONDS
var/skills_space = ""
if(HAS_TRAIT(user, TRAIT_QUICKER_CARRY))
tableplace_delay = 2 SECONDS
skills_space = " expertly"
else if(HAS_TRAIT(user, TRAIT_QUICK_CARRY))
tableplace_delay = 2.75 SECONDS
skills_space = " quickly"
carried_mob.visible_message("<span class='notice'>[user] begins to[skills_space] place [carried_mob] onto [src]...</span>",
"<span class='userdanger'>[user] begins to[skills_space] place [carried_mob] onto [src]...</span>")
if(do_after(user, tableplace_delay, target = carried_mob))
user.unbuckle_mob(carried_mob)
tablepush(user, carried_mob)
return TRUE
if(user.a_intent != INTENT_HARM && !(I.item_flags & ABSTRACT))
if(!user.combat_mode && !(I.item_flags & ABSTRACT))
if(user.transferItemToLoc(I, drop_location(), silent = FALSE))
var/list/click_params = params2list(params)
//Center the icon where the user clicked.
@@ -511,8 +509,9 @@
else
return "<span class='notice'>The top cover is firmly <b>welded</b> on.</span>"
/obj/structure/table/reinforced/attackby(obj/item/W, mob/user, params)
if(W.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HELP)
/obj/structure/table/reinforced/attackby(obj/item/W, mob/living/user, params)
var/list/modifiers = params2list(params)
if(W.tool_behaviour == TOOL_WELDER && modifiers && modifiers["right"])
if(!W.tool_start_check(user, amount=0))
return
@@ -632,12 +631,13 @@
if(O.loc != src.loc)
step(O, get_dir(O, src))
/obj/structure/rack/attackby(obj/item/W, mob/user, params)
if (W.tool_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1) && user.a_intent != INTENT_HELP)
/obj/structure/rack/attackby(obj/item/W, mob/living/user, params)
var/list/modifiers = params2list(params)
if (W.tool_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1) && modifiers && modifiers["right"])
W.play_tool_sound(src)
deconstruct(TRUE)
return
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return ..()
if(user.transferItemToLoc(W, drop_location()))
return 1
@@ -38,7 +38,7 @@
if(5 to TANK_DISPENSER_CAPACITY)
. += "plasma-5"
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/living/user, params)
var/full
if(istype(I, /obj/item/tank/internals/plasma))
if(plasmatanks < TANK_DISPENSER_CAPACITY)
@@ -53,7 +53,7 @@
else if(I.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, I, time = 20)
return
else if(user.a_intent != INTENT_HARM)
else if(!user.combat_mode)
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
return
else
+2 -2
View File
@@ -37,8 +37,8 @@
. = ..()
. += "<span class='notice'>It is held together by some <b>screws</b>.</span>"
/obj/structure/tank_holder/attackby(obj/item/W, mob/user, params)
if(user.a_intent == INTENT_HARM)
/obj/structure/tank_holder/attackby(obj/item/W, mob/living/user, params)
if(user.combat_mode)
return ..()
if(!SEND_SIGNAL(W, COMSIG_CONTAINER_TRY_ATTACH, src, user))
to_chat(user, "<span class='warning'>[W] does not fit in [src].</span>")
@@ -107,8 +107,8 @@
* Meant for attaching an item to the machine, should only be a training toolbox or target. If emagged, the
* machine will gain an auto-attached syndicate toolbox, so in that case we shouldn't be able to swap it out
*/
/obj/structure/training_machine/attackby(obj/item/target, mob/user)
if (user.a_intent != INTENT_HELP)
/obj/structure/training_machine/attackby(obj/item/target, mob/living/user)
if (!user.combat_mode)
return ..()
if (!istype(target, /obj/item/training_toolbox) && !istype(target, /obj/item/target))
return ..()
@@ -357,9 +357,9 @@
///Number of hits made since the Lap button (alt-click) was last pushed
var/lap_hits = 0
/obj/item/training_toolbox/afterattack(atom/target, mob/user, proximity)
/obj/item/training_toolbox/afterattack(atom/target, mob/living/user, proximity)
. = ..()
if (!proximity || target == user || user.a_intent == INTENT_HELP)
if (!proximity || target == user || !user.combat_mode)
return
if (check_hit(target))
user.changeNext_move(CLICK_CD_MELEE)
@@ -64,7 +64,7 @@
if(.)
return
if(!pod_moving)
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
if(user.pulling && isliving(user.pulling))
if(open_status == STATION_TUBE_OPEN)
var/mob/living/GM = user.pulling
if(user.grab_state >= GRAB_AGGRESSIVE)
+18 -19
View File
@@ -29,7 +29,7 @@
log_combat(user, swirlie, "swirlied (brute)")
swirlie.adjustBruteLoss(5)
else if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
else if(user.pulling && isliving(user.pulling))
user.changeNext_move(CLICK_CD_MELEE)
var/mob/living/GM = user.pulling
if(user.grab_state >= GRAB_AGGRESSIVE)
@@ -103,21 +103,20 @@
else if(I.tool_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
I.play_tool_sound(src)
deconstruct()
else if(cistern)
if(user.a_intent != INTENT_HARM)
if(I.w_class > WEIGHT_CLASS_NORMAL)
to_chat(user, "<span class='warning'>[I] does not fit!</span>")
return
if(w_items + I.w_class > WEIGHT_CLASS_HUGE)
to_chat(user, "<span class='warning'>The cistern is full!</span>")
return
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>")
return
w_items += I.w_class
to_chat(user, "<span class='notice'>You carefully place [I] into the cistern.</span>")
else if(cistern && !user.combat_mode)
if(I.w_class > WEIGHT_CLASS_NORMAL)
to_chat(user, "<span class='warning'>[I] does not fit!</span>")
return
if(w_items + I.w_class > WEIGHT_CLASS_HUGE)
to_chat(user, "<span class='warning'>The cistern is full!</span>")
return
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>")
return
w_items += I.w_class
to_chat(user, "<span class='notice'>You carefully place [I] into the cistern.</span>")
else if(istype(I, /obj/item/reagent_containers))
else if(istype(I, /obj/item/reagent_containers) && !user.combat_mode)
if (!open)
return
if(istype(I, /obj/item/food/monkeycube))
@@ -160,11 +159,11 @@
. = ..()
hiddenitem = new /obj/item/food/urinalcake
/obj/structure/urinal/attack_hand(mob/user)
/obj/structure/urinal/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(user.pulling && user.a_intent == INTENT_GRAB && isliving(user.pulling))
if(user.pulling && isliving(user.pulling))
var/mob/living/GM = user.pulling
if(user.grab_state >= GRAB_AGGRESSIVE)
if(GM.loc != get_turf(src))
@@ -394,7 +393,7 @@
if(O.item_flags & ABSTRACT) //Abstract items like grabs won't wash. No-drop items will though because it's still technically an item in your hand.
return
if(user.a_intent != INTENT_HARM)
if(!user.combat_mode)
to_chat(user, "<span class='notice'>You start washing [O]...</span>")
busy = TRUE
if(!do_after(user, 40, target = src))
@@ -577,7 +576,7 @@
if(O.item_flags & ABSTRACT) //Abstract items like grabs won't wash. No-drop items will though because it's still technically an item in your hand.
return
if(user.a_intent != INTENT_HARM)
if(!user.combat_mode)
to_chat(user, "<span class='notice'>You start washing [O]...</span>")
busy = TRUE
if(!do_after(user, 4 SECONDS, target = src))
+10 -9
View File
@@ -138,7 +138,7 @@
return
. = ..()
/obj/structure/window/attack_hand(mob/user)
/obj/structure/window/attack_hand(mob/living/user)
. = ..()
if(.)
return
@@ -146,7 +146,7 @@
return
user.changeNext_move(CLICK_CD_MELEE)
if(user.a_intent != INTENT_HARM)
if(!user.combat_mode)
user.visible_message("<span class='notice'>[user] knocks on [src].</span>", \
"<span class='notice'>You knock on [src].</span>")
playsound(src, knocksound, 50, TRUE)
@@ -169,7 +169,7 @@
add_fingerprint(user)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP)
if(I.tool_behaviour == TOOL_WELDER && !user.combat_mode)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return
@@ -384,10 +384,11 @@
//this is shitcode but all of construction is shitcode and needs a refactor, it works for now
//If you find this like 4 years later and construction still hasn't been refactored, I'm so sorry for this //Adding a timestamp, I found this in 2020, I hope it's from this year -Lemon
//2021 AND STILLLL GOING STRONG
/obj/structure/window/reinforced/attackby(obj/item/I, mob/living/user, params)
switch(state)
if(RWINDOW_SECURE)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HARM)
if(I.tool_behaviour == TOOL_WELDER && user.combat_mode)
user.visible_message("<span class='notice'>[user] holds \the [I] to the security screws on \the [src]...</span>",
"<span class='notice'>You begin heating the security screws on \the [src]...</span>")
if(I.use_tool(src, user, 150, volume = 100))
@@ -516,7 +517,7 @@
/obj/structure/window/plasma/reinforced/attackby(obj/item/I, mob/living/user, params)
switch(state)
if(RWINDOW_SECURE)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HARM)
if(I.tool_behaviour == TOOL_WELDER && user.combat_mode)
user.visible_message("<span class='notice'>[user] holds \the [I] to the security screws on \the [src]...</span>",
"<span class='notice'>You begin heating the security screws on \the [src]...</span>")
if(I.use_tool(src, user, 180, volume = 100))
@@ -774,11 +775,11 @@
for (var/i in 1 to rand(1,4))
. += new /obj/item/paper/natural(location)
/obj/structure/window/paperframe/attack_hand(mob/user)
/obj/structure/window/paperframe/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
take_damage(4,BRUTE,MELEE, 0)
if(!QDELETED(src))
update_icon()
@@ -796,11 +797,11 @@
QUEUE_SMOOTH(src)
/obj/structure/window/paperframe/attackby(obj/item/W, mob/user)
/obj/structure/window/paperframe/attackby(obj/item/W, mob/living/user)
if(W.get_temperature())
fire_act(W.get_temperature())
return
if(user.a_intent == INTENT_HARM)
if(user.combat_mode)
return ..()
if(istype(W, /obj/item/paper) && obj_integrity < max_integrity)
user.visible_message("<span class='notice'>[user] starts to patch the holes in \the [src].</span>")