Combat mode component. (#12338)

* Combat mode component.

* Whoops.

* test.

* Oh

* refs begone, and documentation.
This commit is contained in:
Ghom
2020-05-27 18:00:32 -07:00
committed by GitHub
parent 93a168d8a8
commit 968426fd48
38 changed files with 325 additions and 296 deletions
@@ -1,29 +1,16 @@
/mob/living/carbon
var/lastmousedir
var/wrongdirmovedelay
//oh no vore time
var/voremode = FALSE
/mob/living/carbon/proc/toggle_vore_mode()
if(SEND_SIGNAL(src, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_TOGGLED))
return FALSE //let's not override the main draw of the game these days
voremode = !voremode
var/obj/screen/voretoggle/T = locate() in hud_used?.static_inventory
T?.update_icon_state()
if(combat_flags & COMBAT_FLAG_COMBAT_TOGGLED)
return FALSE //let's not override the main draw of the game these days
SEND_SIGNAL(src, COMSIG_VORE_TOGGLED, src, voremode)
return TRUE
/mob/living/carbon/Move(atom/newloc, direct = 0)
. = ..()
wrongdirmovedelay = FALSE
if((combat_flags & COMBAT_FLAG_COMBAT_ACTIVE) && client && lastmousedir)
if(lastmousedir != dir)
wrongdirmovedelay = TRUE
setDir(lastmousedir, ismousemovement = TRUE)
/mob/living/carbon/onMouseMove(object, location, control, params)
if(!(combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
return
face_atom(object, TRUE)
lastmousedir = dir
/mob/living/carbon/proc/disable_vore_mode()
voremode = FALSE
var/obj/screen/voretoggle/T = locate() in hud_used?.static_inventory
T?.update_icon_state()
@@ -37,7 +37,7 @@
if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT) && total_health >= STAMINA_CRIT && !stat)
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
set_resting(TRUE, FALSE, FALSE)
disable_intentional_combat_mode(TRUE, FALSE)
SEND_SIGNAL(src, COMSIG_DISABLE_COMBAT_MODE)
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_HARD_STAMCRIT)
filters += CIT_FILTER_STAMINACRIT
update_mobility()