Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Combat mode, rclick functionality #11899

Merged
merged 151 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
cbec6f1
butchering fix
Tsar-Salat Nov 16, 2024
2060480
INITIAL DONE!
Tsar-Salat Nov 17, 2024
7a14abb
alt
Tsar-Salat Nov 17, 2024
0b9a4a6
renaming, add suit sensor interaction
Tsar-Salat Nov 17, 2024
4b4afa5
preattacksecondary
Tsar-Salat Nov 17, 2024
29f1ba5
attackhandsecondary
Tsar-Salat Nov 17, 2024
32930a8
fix pre_attack
Tsar-Salat Nov 17, 2024
bfc4fca
lazy access modifiers and ninja dash
Tsar-Salat Nov 17, 2024
c7c1c8f
secondary tool acts
Tsar-Salat Nov 17, 2024
aad7c4f
drones without drones (big toolact refactor)
Tsar-Salat Nov 17, 2024
8fdedee
right click reagent containers
Tsar-Salat Nov 17, 2024
3ec143c
redo rightclick priority
Tsar-Salat Nov 17, 2024
5901aa7
final touches on attack chain
Tsar-Salat Nov 17, 2024
1c70d7e
airlock welding rclick
Tsar-Salat Nov 17, 2024
5ea8731
reagent container unit test
Tsar-Salat Nov 17, 2024
dd8a87e
rightclick bottles
Tsar-Salat Nov 17, 2024
88d5c9b
ranged attack secondary
Tsar-Salat Nov 17, 2024
9042b6d
rcd rclick
Tsar-Salat Nov 17, 2024
a17ddd5
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Nov 17, 2024
c42712d
medical rclick
Tsar-Salat Nov 17, 2024
d450efe
syringe rclick
Tsar-Salat Nov 17, 2024
7ecb99c
crowbar
Tsar-Salat Nov 17, 2024
f01c9bd
ctrlclick
Tsar-Salat Nov 17, 2024
886d61d
washing machine
Tsar-Salat Nov 17, 2024
69ac599
stack splitting rclick
Tsar-Salat Nov 17, 2024
5bc698e
fix ai attacks
Tsar-Salat Nov 17, 2024
2c1bb01
floortile airlock interaction
Tsar-Salat Nov 17, 2024
3fe51a3
fix borg hug
Tsar-Salat Nov 17, 2024
eef0cee
hook shotgun rclick(buff)
Tsar-Salat Nov 17, 2024
4cac0d2
rpd rclick
Tsar-Salat Nov 17, 2024
8261dc0
Revert "rpd rclick"
Tsar-Salat Nov 17, 2024
9fca848
window rclick
Tsar-Salat Nov 17, 2024
9819cd7
closet lock rclick
Tsar-Salat Nov 17, 2024
78a3709
microwave and circuit rclick
Tsar-Salat Nov 17, 2024
75bbe09
fix rclick storage stuff
Tsar-Salat Nov 17, 2024
8e5f61b
I swore I did this already lmao
Tsar-Salat Nov 17, 2024
4c91741
fix locker secndary. Again.
Tsar-Salat Nov 17, 2024
7d94da7
fixes monkeycode
Tsar-Salat Nov 17, 2024
e1d71e4
autolathe screwdriver rclick
Tsar-Salat Nov 17, 2024
0b2f6f7
space heater rclick
Tsar-Salat Nov 17, 2024
d278dba
girder construction rclick
Tsar-Salat Nov 17, 2024
4edaa7f
rclick wrench deconstruct
Tsar-Salat Nov 17, 2024
e404a8d
simplerotation lmb rmb
Tsar-Salat Nov 17, 2024
398ed14
wrench closets
Tsar-Salat Nov 17, 2024
38a4aef
kinetic crusher rclick
Tsar-Salat Nov 17, 2024
ea27114
fixes abandoned crates
Tsar-Salat Nov 17, 2024
71d3842
chem machine rclick
Tsar-Salat Nov 17, 2024
0b5e12a
ladders lmb rmb
Tsar-Salat Nov 17, 2024
c25c7df
cleanup clickon.
Tsar-Salat Nov 17, 2024
c28af9f
fixes
Tsar-Salat Nov 18, 2024
86c6b46
invert handcuff?
Tsar-Salat Nov 18, 2024
dedd64d
try this instead
Tsar-Salat Nov 18, 2024
378db70
variable weapon attack speed
Tsar-Salat Nov 18, 2024
de87409
guh
Tsar-Salat Nov 18, 2024
0874894
TGUI THIS SHIRT
Tsar-Salat Nov 18, 2024
eec1347
oops
Tsar-Salat Nov 18, 2024
7468c0b
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Nov 18, 2024
96ca108
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Nov 20, 2024
6e48064
misc fixes
Tsar-Salat Nov 23, 2024
1a5ff9d
add keybind
Tsar-Salat Nov 23, 2024
b7583a2
add custom cursors + shiftclick magnifier
Tsar-Salat Nov 23, 2024
05c6fdb
fix right click not updated
Tsar-Salat Nov 25, 2024
cde8681
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Nov 28, 2024
a723eaa
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Nov 30, 2024
95fb48a
fix modkit
Tsar-Salat Nov 30, 2024
13b4560
rclick modkits
Tsar-Salat Nov 30, 2024
563732b
minebots and cyborgs are still a little effed, this should work
Tsar-Salat Nov 30, 2024
e4436c4
fix
Tsar-Salat Dec 1, 2024
e14d601
wiremod adjustments
Tsar-Salat Dec 3, 2024
85d9e91
combat unit test
Tsar-Salat Dec 3, 2024
e2d8ab5
drop items
Tsar-Salat Dec 3, 2024
ed24bcb
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Dec 8, 2024
b02352c
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Jan 8, 2025
3d8f581
herrm
Tsar-Salat Jan 8, 2025
53941b1
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Jan 19, 2025
b151fa6
CQC text fix
Tsar-Salat Jan 19, 2025
f201655
grab fixes (for humans)
Tsar-Salat Jan 20, 2025
779e998
monkeys dont hate you anymore
Tsar-Salat Jan 20, 2025
75e83d7
moving to grip code
Tsar-Salat Jan 20, 2025
cd6aebe
MARTIAL ARTS CODE IS ASSS
Tsar-Salat Jan 20, 2025
da99bc8
ctrl and more martials
Tsar-Salat Jan 20, 2025
a572d35
atomized CanUseTopic() refactor
Tsar-Salat Jan 20, 2025
1037c3c
cqc and sleeping carp
Tsar-Salat Jan 20, 2025
4573fbd
martial cleanup
Tsar-Salat Jan 20, 2025
d26f3ca
plasmafist
Tsar-Salat Jan 20, 2025
aafff88
Monkey Martial Arts
Tsar-Salat Jan 20, 2025
6bfabee
combo meter
Tsar-Salat Jan 20, 2025
7f3d07e
chisel it into stone
Tsar-Salat Jan 20, 2025
455e91a
fixes generic huds
Tsar-Salat Jan 20, 2025
9266ef8
ctrlclick fix
Tsar-Salat Jan 21, 2025
b6e2f27
pacifism martial arts
Tsar-Salat Jan 21, 2025
ca49575
cqc knockouts
Tsar-Salat Jan 21, 2025
ed730a5
make the combo menu show up for monkeys
Tsar-Salat Jan 21, 2025
82ed204
Merge remote-tracking branch 'BeeStation/master' into combatmodeatomi…
Tsar-Salat Jan 23, 2025
0a99fcb
Merge remote-tracking branch 'BeeStation/master' into martial-artspain
Tsar-Salat Jan 23, 2025
df5e3dc
.
Tsar-Salat Jan 23, 2025
951e3b7
Merge remote-tracking branch 'BeeStation/master' into martial-artspain
Tsar-Salat Jan 29, 2025
fae9a16
remove conflict
Tsar-Salat Jan 30, 2025
c1621ce
Merge remote-tracking branch 'BeeStation/master' into combatmodeatomi…
Tsar-Salat Jan 31, 2025
7ab4266
.
Tsar-Salat Jan 31, 2025
8864cbb
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 1, 2025
50aa7e1
Merge remote-tracking branch 'BeeStation/master' into martial-artspain
Tsar-Salat Feb 1, 2025
38a8fce
Merge branch 'martial-artspain' into combatmodetake5
Tsar-Salat Feb 1, 2025
105fad6
.
Tsar-Salat Feb 1, 2025
d387725
Merge remote-tracking branch 'BeeStation/master' into combatmodeatomi…
Tsar-Salat Feb 1, 2025
a1bd2b1
Merge branch 'combatmodeatomization-canusetopic' into combatmodetake5
Tsar-Salat Feb 1, 2025
ea2a05b
fix attack chain bug
Tsar-Salat Feb 1, 2025
304d19f
grrrr
Tsar-Salat Feb 1, 2025
bbc1130
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 1, 2025
547d170
trigger flags (not my issue)
Tsar-Salat Feb 1, 2025
c03a27c
fix combat mode toggle pref, firelocks
Tsar-Salat Feb 2, 2025
92c34cb
fix cyborg huds & throat slicing
Tsar-Salat Feb 2, 2025
af1d9be
fix stack splitting and health analyzer modes
Tsar-Salat Feb 3, 2025
7251f6e
move grabbing to carbon level
Tsar-Salat Feb 3, 2025
594ffa4
martial arts menu
Tsar-Salat Feb 4, 2025
f62f664
fix martial arts formatting
Tsar-Salat Feb 4, 2025
fda2d67
fix
Tsar-Salat Feb 4, 2025
4b6a378
move firedoor welding to rclick
Tsar-Salat Feb 4, 2025
d6cf144
fix cyborg action
Tsar-Salat Feb 5, 2025
41ba950
fix martials, again
Tsar-Salat Feb 5, 2025
3ba7b64
airlock icon update hotfix
Tsar-Salat Feb 5, 2025
2db2356
open na noor... open na noor!!!11!
Tsar-Salat Feb 5, 2025
a92bd7e
fix camera actions
Tsar-Salat Feb 5, 2025
32da1e3
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 6, 2025
307e120
fix piggybacking
Tsar-Salat Feb 6, 2025
f8dc9e0
fixes the combo once and for all
Tsar-Salat Feb 6, 2025
9e1359c
tribal claw combos
Tsar-Salat Feb 6, 2025
62b4f50
we all pass list modifiers. Always.
Tsar-Salat Feb 6, 2025
8cc294a
firealarm cleanup
Tsar-Salat Feb 7, 2025
a7faef1
fix supplypod launcher
Tsar-Salat Feb 8, 2025
5c65f42
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 8, 2025
69a35d6
Fixes ghosts needing to shift click
PowerfulBacon Feb 9, 2025
97df251
Merge branch 'master' into combatmodetake5
PowerfulBacon Feb 9, 2025
1fed9ed
rclick food storage
Tsar-Salat Feb 9, 2025
83be763
fix some mergeskewed huds
Tsar-Salat Feb 10, 2025
716ef7d
fix chem dispenser wrench act
Tsar-Salat Feb 11, 2025
e5ca146
fix heretic spells, adds support to rclick spells, makes mansus use r…
Tsar-Salat Feb 12, 2025
767bc76
fix bad attack chain, genericize crowbar-likes into actual crowbars, …
Tsar-Salat Feb 12, 2025
dc50fee
I like neckslicing
Tsar-Salat Feb 12, 2025
7c5a83d
hidden runechat fix
Tsar-Salat Feb 12, 2025
bc5c16a
work on zombies
Tsar-Salat Feb 12, 2025
f010e30
hm
Tsar-Salat Feb 12, 2025
9b18ace
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 12, 2025
b20d6c8
macro
Tsar-Salat Feb 12, 2025
e218e53
aggrograb
Tsar-Salat Feb 12, 2025
656f362
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 13, 2025
c272044
stunbaton cleanup, move stunshove to rclick
Tsar-Salat Feb 14, 2025
3b51651
fix your goddamn params, proc_holders!
Tsar-Salat Feb 14, 2025
be28b2b
mapedit
Tsar-Salat Feb 14, 2025
b906b34
tool_act fixes
Tsar-Salat Feb 14, 2025
64978af
Merge remote-tracking branch 'BeeStation/master' into combatmodetake5
Tsar-Salat Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
INITIAL DONE!
  • Loading branch information
Tsar-Salat committed Nov 17, 2024
commit 2060480a804994ddf2fe1aae38b76dd835a4d7e1
10 changes: 0 additions & 10 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,6 @@
#define ATTACK_EFFECT_MECHTOXIN "mech_toxin"
#define ATTACK_EFFECT_BOOP "boop" //Honk

//intent defines
#define INTENT_HELP "help"
#define INTENT_GRAB "grab"
#define INTENT_DISARM "disarm"
#define INTENT_HARM "harm"
//NOTE: INTENT_HOTKEY_* defines are not actual intents!
//they are here to support hotkeys
#define INTENT_HOTKEY_LEFT "left"
#define INTENT_HOTKEY_RIGHT "right"

//the define for visible message range in combat
#define COMBAT_MESSAGE_RANGE 3
#define DEFAULT_MESSAGE_RANGE 7
Expand Down
5 changes: 0 additions & 5 deletions code/__DEFINES/monkeys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
/// probability for the monkey to aggro when attacked
#define MONKEY_RETALIATE_PROB 85

/// probability for the monkey to aggro when attacked with harm intent
#define MONKEY_RETALIATE_HARM_PROB 95
/// probability for the monkey to aggro when attacked with disarm intent
#define MONKEY_RETALIATE_DISARM_PROB 20

/// amount of aggro to add to an enemy when they attack user
#define MONKEY_HATRED_AMOUNT 4
/// amount of aggro to add to an enemy when a monkey is recruited
Expand Down
6 changes: 3 additions & 3 deletions code/__DEFINES/power/apc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
/// The APCs external powernet has enough power to charge the APC.
#define APC_HAS_POWER 2

// !UNIMPLEMENTED! Ethereals/IPC:
//Ethereals/IPC:
/// How long it takes a powereater to drain or charge APCs. Also used as a spam limiter.
//#define APC_DRAIN_TIME (7.5 SECONDS)
#define APC_DRAIN_TIME (7.5 SECONDS)
/// How much powereater species gain/drain from APCs.
//#define APC_POWER_GAIN 200
#define APC_POWER_GAIN 200

// Wires & EMPs:
/// The wire value used to reset the APCs wires after one's EMPed.
Expand Down
30 changes: 16 additions & 14 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
changeNext_move(CLICK_CD_HANDCUFFED) //Doing shit in cuffs shall be vey slow
UnarmedAttack(A)
UnarmedAttack(A, FALSE, modifiers)
return

if(throw_mode && throw_item(A))
Expand All @@ -136,7 +136,7 @@
else
if(ismob(A))
changeNext_move(CLICK_CD_MELEE)
UnarmedAttack(A)
UnarmedAttack(A, FALSE, modifiers)
return

//Can't reach anything else in lockers or other weirdness
Expand All @@ -150,7 +150,7 @@
else
if(ismob(A))
changeNext_move(CLICK_CD_MELEE)
UnarmedAttack(A,1)
UnarmedAttack(A, TRUE, modifiers)
else
if(W)
W.afterattack(A,src,0,params)
Expand Down Expand Up @@ -273,17 +273,19 @@
return


/**
* Translates into [atom/proc/attack_hand], etc.
*
* Note: proximity_flag here is used to distinguish between normal usage (flag=1),
* and usage when clicking on things telekinetically (flag=0). This proc will
* not be called at ranged except with telekinesis.
*
* proximity_flag is not currently passed to attack_hand, and is instead used
* in human click code to allow glove touches only at melee range.
*/
/mob/proc/UnarmedAttack(atom/A, proximity_flag)
/*
* Translates into [atom/proc/attack_hand], etc.
*
* Note: proximity_flag here is used to distinguish between normal usage (flag=1),
* and usage when clicking on things telekinetically (flag=0). This proc will
* not be called at ranged except with telekinesis.
*
* proximity_flag is not currently passed to attack_hand, and is instead used
* in human click code to allow glove touches only at melee range.
*
* modifiers is the click modifiers this attack had, used for
*/
/mob/proc/UnarmedAttack(atom/A, proximity_flag, modifiers)
if(ismob(A))
changeNext_move(CLICK_CD_MELEE)
return
Expand Down
1 change: 1 addition & 0 deletions code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#define ui_above_intent "EAST-3:24, SOUTH+1:7"
#define ui_movi "EAST-2:26,SOUTH:5"
#define ui_acti "EAST-3:24,SOUTH:5"
#define ui_combat_toggle "EAST-3:24,SOUTH:5"
#define ui_zonesel "EAST-1:28,SOUTH:5"
#define ui_acti_alt "EAST-1:28,SOUTH:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_crafting "EAST-4:22,SOUTH:5"
Expand Down
10 changes: 5 additions & 5 deletions code/_onclick/hud/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
using.hud = src
static_inventory += using

using = new /atom/movable/screen/act_intent/alien()
using.icon_state = mymob.a_intent
using.hud = src
static_inventory += using
action_intent = using
action_intent = new /atom/movable/screen/combattoggle/flashy()
action_intent.hud = src
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent

if(isalienhunter(mymob))
var/mob/living/carbon/alien/humanoid/hunter/H = mymob
Expand Down
10 changes: 5 additions & 5 deletions code/_onclick/hud/alien_larva.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
..()
var/atom/movable/screen/using

using = new /atom/movable/screen/act_intent/alien()
using.icon_state = mymob.a_intent
using.hud = src
static_inventory += using
action_intent = using
action_intent = new /atom/movable/screen/combattoggle/flashy()
action_intent.hud = src
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent

healths = new /atom/movable/screen/healths/alien()
healths.hud = src
Expand Down
15 changes: 5 additions & 10 deletions code/_onclick/hud/generic_dextrous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,11 @@
using.hud = src
static_inventory += using

if(mymob.possible_a_intents)
if(mymob.possible_a_intents.len == 4)
// All possible intents - full intent selector
action_intent = new /atom/movable/screen/act_intent/segmented
else
action_intent = new /atom/movable/screen/act_intent
action_intent.icon = ui_style
action_intent.icon_state = mymob.a_intent
action_intent.hud = src
static_inventory += action_intent
action_intent = new /atom/movable/screen/combattoggle/flashy()
action_intent.hud = src
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent

zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
Expand Down
6 changes: 4 additions & 2 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@
using.icon = ui_style
static_inventory += using

action_intent = new /atom/movable/screen/act_intent/segmented
action_intent.icon_state = mymob.a_intent
action_intent = new /atom/movable/screen/combattoggle/flashy()
action_intent.hud = src
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent


using = new /atom/movable/screen/mov_intent
using.icon = ui_style
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/monkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
var/atom/movable/screen/using
var/atom/movable/screen/inventory/inv_box

action_intent = new /atom/movable/screen/act_intent()
action_intent = new /atom/movable/screen/combattoggle/flashy()
action_intent.hud = src
action_intent.icon = ui_style
action_intent.icon_state = mymob.a_intent
action_intent.screen_loc = ui_acti
action_intent.hud = src
static_inventory += action_intent


using = new /atom/movable/screen/mov_intent()
using.icon = ui_style
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
Expand Down
7 changes: 4 additions & 3 deletions code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@
using.hud = src
static_inventory += using

//Intent
action_intent = new /atom/movable/screen/act_intent/robot()
action_intent.icon_state = mymob.a_intent
//Combat Mode
action_intent = new /atom/movable/screen/combattoggle/robot()
action_intent.hud = src
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent

//Health
Expand Down
61 changes: 35 additions & 26 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
return inv_item.Click(location, control, params)

//Putting into something (if its not in us)
if(usr.attack_ui(slot_id))
if(usr.attack_ui(slot_id, params))
usr.update_inv_hands()
return TRUE

Expand Down Expand Up @@ -265,38 +265,47 @@ CREATION_TEST_IGNORE_SUBTYPES(/atom/movable/screen/close)
icon_state = usr.get_active_held_item() ? "act_drop" : null
return ..()

/atom/movable/screen/act_intent
name = "intent"
icon_state = "help"
screen_loc = ui_acti

/atom/movable/screen/act_intent/Click(location, control, params)
usr.a_intent_change(INTENT_HOTKEY_RIGHT)
/atom/movable/screen/combattoggle
name = "toggle combat mode"
icon = 'icons/hud/style/screen_midnight.dmi'
icon_state = "combat_off"
screen_loc = ui_combat_toggle

/atom/movable/screen/act_intent/segmented/Click(location, control, params)
if(usr.client.prefs.read_player_preference(/datum/preference/toggle/intent_style))
var/_x = text2num(params2list(params)["icon-x"])
var/_y = text2num(params2list(params)["icon-y"])
/atom/movable/screen/combattoggle/New(loc, ...)
. = ..()
update_icon()

if(_x<=16 && _y<=16)
usr.a_intent_change(INTENT_HARM)
/atom/movable/screen/combattoggle/Click()
if(isliving(usr))
var/mob/living/owner = usr
owner.set_combat_mode(!owner.combat_mode, FALSE)
update_icon()

else if(_x<=16 && _y>=17)
usr.a_intent_change(INTENT_HELP)
/atom/movable/screen/combattoggle/update_icon_state()
. = ..()
var/mob/living/user = hud?.mymob
if(!istype(user) || !user.client)
return
icon_state = user.combat_mode ? "combat" : "combat_off" //Treats the combat_mode

else if(_x>=17 && _y<=16)
usr.a_intent_change(INTENT_GRAB)
//Version of the combat toggle with the flashy overlay
/atom/movable/screen/combattoggle/flashy
///Mut appearance for flashy border
var/mutable_appearance/flashy

else if(_x>=17 && _y>=17)
usr.a_intent_change(INTENT_DISARM)
else
return ..()
/atom/movable/screen/combattoggle/flashy/update_overlays()
. = ..()
var/mob/living/user = hud?.mymob
if(!istype(user) || !user.client)
return

/atom/movable/screen/act_intent/alien
icon = 'icons/hud/screen_alien.dmi'
screen_loc = ui_movi
if(user.combat_mode)
if(!flashy)
flashy = mutable_appearance('icons/hud/screen_gen.dmi', "togglefull_flash")
flashy.color = "#C62727"
. += flashy

/atom/movable/screen/act_intent/robot
/atom/movable/screen/combattoggle/robot
icon = 'icons/hud/screen_cyborg.dmi'
screen_loc = ui_borg_intents

Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

var/nonharmfulhit = FALSE

if(user.a_intent == INTENT_HELP && !(item_flags & ISWEAPON))
if(!user.combat_mode && !(item_flags & ISWEAPON))
nonharmfulhit = TRUE
for(var/datum/surgery/S in target_mob.surgeries)
if(S.failed_step)
Expand Down Expand Up @@ -123,7 +123,7 @@
user.time_of_last_attack_dealt = time
user.check_for_accidental_attack()

log_combat(user, target_mob, "[nonharmfulhit ? "poked" : "attacked"]", src, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])", important = !nonharmfulhit)
log_combat(user, target_mob, "[nonharmfulhit ? "poked" : "attacked"]", src, "(COMBAT MODE: [uppertext(user.combat_mode)]) (DAMTYPE: [uppertext(damtype)])", important = !nonharmfulhit)
add_fingerprint(user)


Expand Down
Loading