Fixes neck-grabs forcing people to lie down, stops people resisting when weakened

This commit is contained in:
Yoshax
2016-05-07 16:41:01 +01:00
parent 01e9e441a6
commit 4708af3a2e
4 changed files with 28 additions and 16 deletions

View File

@@ -136,9 +136,15 @@
#define INCAPACITATION_RESTRAINED 1
#define INCAPACITATION_BUCKLED_PARTIALLY 2
#define INCAPACITATION_BUCKLED_FULLY 4
#define INCAPACITATION_STUNNED 8
#define INCAPACITATION_FORCELYING 16 //needs a better name - represents being knocked down BUT still conscious.
#define INCAPACITATION_KNOCKOUT 32
#define INCAPACITATION_DEFAULT (INCAPACITATION_RESTRAINED|INCAPACITATION_BUCKLED_FULLY)
#define INCAPACITATION_ALL (INCAPACITATION_RESTRAINED|INCAPACITATION_BUCKLED_PARTIALLY|INCAPACITATION_BUCKLED_FULLY)
#define INCAPACITATION_KNOCKDOWN (INCAPACITATION_KNOCKOUT|INCAPACITATION_FORCELYING)
#define INCAPACITATION_DISABLED (INCAPACITATION_KNOCKDOWN|INCAPACITATION_STUNNED)
#define INCAPACITATION_ALL (~INCAPACITATION_NONE)
// Bodyparts and organs.
#define O_MOUTH "mouth"

View File

@@ -566,7 +566,7 @@ default behaviour is:
set name = "Resist"
set category = "IC"
if(!stat && canClick())
if(!incapacitated(INCAPACITATION_KNOCKOUT) && canClick())
setClickCooldown(20)
resist_grab()
if(!weakened)
@@ -631,7 +631,9 @@ default behaviour is:
if(GRAB_PASSIVE)
qdel(G)
if(GRAB_AGGRESSIVE)
if(prob(60)) //same chance of breaking the grab as disarm
//Not standing up makes it much harder to break, so it is easier to cuff someone who is down without forcing them into unconsciousness.
//Otherwise, it's the same chance of breaking the grab as disarm.
if(incapacitated(INCAPACITATION_KNOCKDOWN)? prob(15) : prob(60))
visible_message("<span class='warning'>[src] has broken free of [G.assailant]'s grip!</span>")
qdel(G)
if(GRAB_NECK)
@@ -862,7 +864,7 @@ default behaviour is:
else
if(istype(buckled, /obj/vehicle))
var/obj/vehicle/V = buckled
if(cannot_stand())
if(is_physically_disabled())
lying = 0
canmove = 1
pixel_y = V.mob_offset_y - 5
@@ -880,18 +882,13 @@ default behaviour is:
anchored = 0
canmove = 1
else if(cannot_stand())
lying = 1
canmove = 0
else if(stunned)
canmove = 0
else if(captured)
anchored = 1
canmove = 0
lying = 0
else
lying = 0
canmove = 1
lying = incapacitated(INCAPACITATION_KNOCKDOWN)
canmove = !incapacitated(INCAPACITATION_DISABLED)
if(lying)
density = 0

View File

@@ -158,8 +158,20 @@
return UNBUCKLED
return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED
/mob/proc/is_physically_disabled()
return incapacitated(INCAPACITATION_DISABLED)
/mob/proc/cannot_stand()
return incapacitated(INCAPACITATION_KNOCKDOWN)
/mob/proc/incapacitated(var/incapacitation_flags = INCAPACITATION_DEFAULT)
if (stat || paralysis || stunned || weakened || resting || sleeping || (status_flags & FAKEDEATH))
if ((incapacitation_flags & INCAPACITATION_STUNNED) && stunned)
return 1
if ((incapacitation_flags & INCAPACITATION_FORCELYING) && (weakened || resting))
return 1
if ((incapacitation_flags & INCAPACITATION_KNOCKOUT) && (stat || paralysis || sleeping || (status_flags & FAKEDEATH)))
return 1
if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained())
@@ -687,9 +699,6 @@
/mob/proc/can_stand_overridden()
return 0
/mob/proc/cannot_stand()
return incapacitated(INCAPACITATION_DEFAULT & (~INCAPACITATION_RESTRAINED))
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
/mob/proc/update_canmove()
return canmove

View File

@@ -152,7 +152,7 @@
var/voice_name = "unidentifiable voice"
var/faction = "neutral" //Used for checking whether hostile simple animals will attack you, possibly more stuff later
var/captured = 0 //Functionally, should give the same effect as being buckled into a chair when true.
var/captured = 0 //Functionally, should give the same effect as being buckled into a chair when true. Only used by energy nets, TODO replace with buckling
//Generic list for proc holders. Only way I can see to enable certain verbs/procs. Should be modified if needed.
var/proc_holder_list[] = list()//Right now unused.