mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Fixes neck-grabs forcing people to lie down, stops people resisting when weakened
This commit is contained in:
@@ -136,9 +136,15 @@
|
|||||||
#define INCAPACITATION_RESTRAINED 1
|
#define INCAPACITATION_RESTRAINED 1
|
||||||
#define INCAPACITATION_BUCKLED_PARTIALLY 2
|
#define INCAPACITATION_BUCKLED_PARTIALLY 2
|
||||||
#define INCAPACITATION_BUCKLED_FULLY 4
|
#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_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.
|
// Bodyparts and organs.
|
||||||
#define O_MOUTH "mouth"
|
#define O_MOUTH "mouth"
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ default behaviour is:
|
|||||||
set name = "Resist"
|
set name = "Resist"
|
||||||
set category = "IC"
|
set category = "IC"
|
||||||
|
|
||||||
if(!stat && canClick())
|
if(!incapacitated(INCAPACITATION_KNOCKOUT) && canClick())
|
||||||
setClickCooldown(20)
|
setClickCooldown(20)
|
||||||
resist_grab()
|
resist_grab()
|
||||||
if(!weakened)
|
if(!weakened)
|
||||||
@@ -631,7 +631,9 @@ default behaviour is:
|
|||||||
if(GRAB_PASSIVE)
|
if(GRAB_PASSIVE)
|
||||||
qdel(G)
|
qdel(G)
|
||||||
if(GRAB_AGGRESSIVE)
|
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>")
|
visible_message("<span class='warning'>[src] has broken free of [G.assailant]'s grip!</span>")
|
||||||
qdel(G)
|
qdel(G)
|
||||||
if(GRAB_NECK)
|
if(GRAB_NECK)
|
||||||
@@ -862,7 +864,7 @@ default behaviour is:
|
|||||||
else
|
else
|
||||||
if(istype(buckled, /obj/vehicle))
|
if(istype(buckled, /obj/vehicle))
|
||||||
var/obj/vehicle/V = buckled
|
var/obj/vehicle/V = buckled
|
||||||
if(cannot_stand())
|
if(is_physically_disabled())
|
||||||
lying = 0
|
lying = 0
|
||||||
canmove = 1
|
canmove = 1
|
||||||
pixel_y = V.mob_offset_y - 5
|
pixel_y = V.mob_offset_y - 5
|
||||||
@@ -880,18 +882,13 @@ default behaviour is:
|
|||||||
anchored = 0
|
anchored = 0
|
||||||
canmove = 1
|
canmove = 1
|
||||||
|
|
||||||
else if(cannot_stand())
|
|
||||||
lying = 1
|
|
||||||
canmove = 0
|
|
||||||
else if(stunned)
|
|
||||||
canmove = 0
|
|
||||||
else if(captured)
|
else if(captured)
|
||||||
anchored = 1
|
anchored = 1
|
||||||
canmove = 0
|
canmove = 0
|
||||||
lying = 0
|
lying = 0
|
||||||
else
|
else
|
||||||
lying = 0
|
lying = incapacitated(INCAPACITATION_KNOCKDOWN)
|
||||||
canmove = 1
|
canmove = !incapacitated(INCAPACITATION_DISABLED)
|
||||||
|
|
||||||
if(lying)
|
if(lying)
|
||||||
density = 0
|
density = 0
|
||||||
|
|||||||
@@ -158,8 +158,20 @@
|
|||||||
return UNBUCKLED
|
return UNBUCKLED
|
||||||
return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED
|
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)
|
/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
|
return 1
|
||||||
|
|
||||||
if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained())
|
if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained())
|
||||||
@@ -687,9 +699,6 @@
|
|||||||
/mob/proc/can_stand_overridden()
|
/mob/proc/can_stand_overridden()
|
||||||
return 0
|
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.
|
//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()
|
/mob/proc/update_canmove()
|
||||||
return canmove
|
return canmove
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
var/voice_name = "unidentifiable voice"
|
var/voice_name = "unidentifiable voice"
|
||||||
|
|
||||||
var/faction = "neutral" //Used for checking whether hostile simple animals will attack you, possibly more stuff later
|
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.
|
//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.
|
var/proc_holder_list[] = list()//Right now unused.
|
||||||
|
|||||||
Reference in New Issue
Block a user