Adds knifing, pressing eyes, jointlocking, headbutting, pushing, dancing and forcing onto the floor

fixup
This commit is contained in:
Hubblenaut
2015-05-06 21:48:47 +02:00
parent 8528948bcd
commit fb8812d1b7
6 changed files with 193 additions and 56 deletions

View File

@@ -25,6 +25,21 @@
if(!istype(M) || (can_operate(M) && do_surgery(M,user,src))) return 0 if(!istype(M) || (can_operate(M) && do_surgery(M,user,src))) return 0
// Knifing
if(edge)
for(var/obj/item/weapon/grab/G in M.grabbed_by)
if(G.assailant == user && G.state >= GRAB_NECK)
//TODO: better alternative for applying damage multiple times? Nice knifing sound?
M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge)
M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge)
M.apply_damage(20, BRUTE, "head", 0, sharp=sharp, edge=edge)
M.adjustOxyLoss(60) // Brain lacks oxygen immediately, pass out
user.visible_message("<span class='danger'>[user] slit [M]'s throat open with \the [name]!</span>")
user.attack_log += "\[[time_stamp()]\]<font color='red'> Knifed [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Got knifed by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
msg_admin_attack("[key_name(user)] knifed [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
return
///////////////////////// /////////////////////////
user.lastattacked = M user.lastattacked = M
M.lastattacker = user M.lastattacker = user

View File

@@ -41,6 +41,16 @@
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/metal(src.loc) new /obj/item/stack/sheet/metal(src.loc)
del(src) del(src)
else if(istype(W, /obj/item/weapon/grab))
user.visible_message("<span class='notice'>[user] attempts to buckle [W:affecting] into \the [src]!</span>")
if(do_after(user, 20))
W:affecting.loc = loc
if(buckle_mob(W:affecting))
W:affecting.visible_message(\
"<span class='danger'>[W:affecting.name] is buckled to [src] by [user.name]!</span>",\
"<span class='danger'>You are buckled to [src] by [user.name]!</span>",\
"<span class='notice'>You hear metal clanking.</span>")
else else
..() ..()

View File

@@ -89,12 +89,7 @@
LAssailant = M LAssailant = M
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(M.dir == src.dir) visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
G.state = GRAB_AGGRESSIVE
G.adjust_position()
visible_message("<span class ='warning'>[M] has grabbed [src] from behind!</span>")
else
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
return 1 return 1
if(I_HURT) if(I_HURT)

View File

@@ -132,6 +132,10 @@ default behaviour is:
now_pushing = 0 now_pushing = 0
return return
step(AM, t) step(AM, t)
if(ishuman(AM) && AM:grabbed_by)
for(var/obj/item/weapon/grab/G in AM:grabbed_by)
step(G:assailant, get_dir(G:assailant, AM))
G.adjust_position()
now_pushing = 0 now_pushing = 0
return return
return return

View File

@@ -7,13 +7,15 @@
icon_state = "reinforce" icon_state = "reinforce"
flags = 0 flags = 0
var/obj/screen/grab/hud = null var/obj/screen/grab/hud = null
var/mob/living/carbon/affecting = null var/mob/living/affecting = null
var/mob/living/carbon/human/assailant = null var/mob/living/carbon/human/assailant = null
var/state = GRAB_PASSIVE var/state = GRAB_PASSIVE
var/allow_upgrade = 1 var/allow_upgrade = 1
var/last_upgrade = 0 var/last_action = 0
var/last_hit_zone = 0 var/last_hit_zone = 0
var/force_down //determines if the affecting mob will be pinned to the ground
var/dancing //determines if assailant and affecting keep looking at each other. Basically a wrestling position
layer = 21 layer = 21
abstract = 1 abstract = 1
@@ -39,6 +41,15 @@
hud.name = "reinforce grab" hud.name = "reinforce grab"
hud.master = src hud.master = src
//check if assailant is grabbed by victim as well
if(assailant.grabbed_by)
for (var/obj/item/weapon/grab/G in assailant.grabbed_by)
if(G.assailant == affecting && G.affecting == assailant)
G.dancing = 1
G.adjust_position()
dancing = 1
adjust_position()
/obj/item/weapon/grab/Del() /obj/item/weapon/grab/Del()
//make sure the grabbed_by list doesn't fill up with nulls //make sure the grabbed_by list doesn't fill up with nulls
if(affecting) affecting.grabbed_by -= src if(affecting) affecting.grabbed_by -= src
@@ -50,6 +61,7 @@
if(affecting.buckled) if(affecting.buckled)
return null return null
if(state >= GRAB_AGGRESSIVE) if(state >= GRAB_AGGRESSIVE)
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1)
return affecting return affecting
return null return null
@@ -84,32 +96,13 @@
var/obj/item/weapon/grab/G = assailant.r_hand var/obj/item/weapon/grab/G = assailant.r_hand
if(G.affecting != affecting) if(G.affecting != affecting)
allow_upgrade = 0 allow_upgrade = 0
if(state >= GRAB_AGGRESSIVE)
affecting.drop_l_hand()
affecting.drop_r_hand()
var/hit_zone = assailant.zone_sel.selecting //disallow upgrading past aggressive if we're being grabbed aggressively
var/announce = 0 for(var/obj/item/weapon/grab/G in affecting.grabbed_by)
if(hit_zone != last_hit_zone) if(G == src) continue
announce = 1 if(G.state >= GRAB_AGGRESSIVE)
last_hit_zone = hit_zone allow_upgrade = 0
switch(hit_zone)
if("mouth")
if(announce)
assailant.visible_message("<span class='warning'>[assailant] covers [affecting]'s mouth!</span>")
if(affecting.silent < 3)
affecting.silent = 3
if("eyes")
if(announce)
assailant.visible_message("<span class='warning'>[assailant] covers [affecting]'s eyes!</span>")
if(affecting.eye_blind < 3)
affecting.eye_blind = 3
//disallow upgrading past aggressive if we're being grabbed aggressively
for(var/obj/item/weapon/grab/G in affecting.grabbed_by)
if(G == src) continue
if(G.state >= GRAB_AGGRESSIVE)
allow_upgrade = 0
if(allow_upgrade) if(allow_upgrade)
if(state < GRAB_AGGRESSIVE) if(state < GRAB_AGGRESSIVE)
hud.icon_state = "reinforce" hud.icon_state = "reinforce"
@@ -118,6 +111,33 @@
else else
hud.icon_state = "!reinforce" hud.icon_state = "!reinforce"
if(state >= GRAB_AGGRESSIVE)
affecting.drop_l_hand()
affecting.drop_r_hand()
var/hit_zone = assailant.zone_sel.selecting
var/announce = 0
if(hit_zone != last_hit_zone)
announce = 1
last_hit_zone = hit_zone
if(ishuman(affecting))
switch(hit_zone)
if("mouth")
if(announce)
assailant.visible_message("<span class='warning'>[assailant] covers [affecting]'s mouth!</span>")
if(affecting:silent < 3)
affecting:silent = 3
if("eyes")
if(announce)
assailant.visible_message("<span class='warning'>[assailant] covers [affecting]'s eyes!</span>")
if(affecting:eye_blind < 3)
affecting:eye_blind = 3
if(force_down)
if(affecting.loc != assailant.loc)
force_down = 0
else
affecting.Weaken(2)
if(state >= GRAB_NECK) if(state >= GRAB_NECK)
affecting.Stun(1) affecting.Stun(1)
if(isliving(affecting)) if(isliving(affecting))
@@ -141,13 +161,22 @@
//Gets called on process, when the grab gets upgraded or the assailant moves //Gets called on process, when the grab gets upgraded or the assailant moves
/obj/item/weapon/grab/proc/adjust_position() /obj/item/weapon/grab/proc/adjust_position()
if(affecting.buckled) if(affecting.buckled)
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1, LINEAR_EASING)
return
if(affecting.lying && state != GRAB_KILL)
animate(affecting, pixel_x = 0, pixel_y = 0, 5, 1, LINEAR_EASING)
if(force_down)
affecting.set_dir(SOUTH) //face up
return return
var/shift = 0 var/shift = 0
var/adir = get_dir(assailant, affecting) var/adir = get_dir(assailant, affecting)
affecting.layer = 4 affecting.layer = 4
switch(state) switch(state)
if(GRAB_PASSIVE) if(GRAB_PASSIVE)
shift = 6 shift = 8
if(dancing) //look at partner
shift = 10
assailant.set_dir(get_dir(assailant, affecting))
if(GRAB_AGGRESSIVE) if(GRAB_AGGRESSIVE)
shift = 12 shift = 12
if(GRAB_NECK, GRAB_UPGRADING) if(GRAB_NECK, GRAB_UPGRADING)
@@ -158,9 +187,8 @@
if(GRAB_KILL) if(GRAB_KILL)
shift = 0 shift = 0
adir = 1 adir = 1
affecting.set_dir(reverse_dir[assailant.dir]) affecting.set_dir(SOUTH) //face up
affecting.loc = assailant.loc affecting.loc = assailant.loc
affecting.lying = 1
switch(adir) switch(adir)
if(NORTH) if(NORTH)
@@ -182,18 +210,26 @@
return return
if(assailant.next_move > world.time) if(assailant.next_move > world.time)
return return
if(world.time < (last_upgrade + UPGRADE_COOLDOWN)) if(world.time < (last_action + UPGRADE_COOLDOWN))
return return
if(!assailant.canmove || assailant.lying) if(!assailant.canmove || assailant.lying)
del(src) del(src)
return return
last_upgrade = world.time last_action = world.time
if(state < GRAB_AGGRESSIVE) if(state < GRAB_AGGRESSIVE)
if(!allow_upgrade) if(!allow_upgrade)
return return
assailant.visible_message("<span class='warning'>[assailant] has grabbed [affecting] aggressively (now hands)!</span>") if(!affecting.lying)
assailant.visible_message("<span class='warning'>[assailant] has grabbed [affecting] aggressively (now hands)!</span>")
else
assailant.visible_message("<span class='warning'>[assailant] pins [affecting] down to the ground (now hands)!</span>")
force_down = 1
affecting.Weaken(3)
step_to(assailant, affecting)
assailant.set_dir(EAST) //face the victim
affecting.set_dir(SOUTH) //face up
state = GRAB_AGGRESSIVE state = GRAB_AGGRESSIVE
icon_state = "grabbed1" icon_state = "grabbed1"
hud.icon_state = "reinforce1" hud.icon_state = "reinforce1"
@@ -211,6 +247,7 @@
msg_admin_attack("[key_name(assailant)] grabbed the neck of [key_name(affecting)]") msg_admin_attack("[key_name(assailant)] grabbed the neck of [key_name(affecting)]")
hud.icon_state = "kill" hud.icon_state = "kill"
hud.name = "kill" hud.name = "kill"
affecting.Stun(10) //10 ticks of ensured grab
else if(state < GRAB_UPGRADING) else if(state < GRAB_UPGRADING)
assailant.visible_message("<span class='danger'>[assailant] starts to tighten \his grip on [affecting]'s neck!</span>") assailant.visible_message("<span class='danger'>[assailant] starts to tighten \his grip on [affecting]'s neck!</span>")
hud.icon_state = "kill1" hud.icon_state = "kill1"
@@ -223,6 +260,7 @@
assailant.next_move = world.time + 10 assailant.next_move = world.time + 10
affecting.losebreath += 1 affecting.losebreath += 1
affecting.set_dir(WEST)
adjust_position() adjust_position()
@@ -240,14 +278,99 @@
return 1 return 1
/obj/item/weapon/grab/attack(mob/M, mob/user) /obj/item/weapon/grab/attack(mob/M, mob/living/user)
if(!affecting) if(!affecting)
return return
if(M == affecting) if(world.time < (last_action + 10))
s_click(hud)
return return
if(M == affecting)
if(ishuman(M))
last_action = world.time
var/hit_zone = assailant.zone_sel.selecting
switch(assailant.a_intent)
if(I_HELP)
if(force_down)
assailant << "<span class='warning'>You are no longer pinning [affecting] to the ground.</span>"
force_down = 0
return
if(I_GRAB)
if(state < GRAB_AGGRESSIVE)
assailant << "<span class='warning'>You require a better grab to do this.</span>"
return
var/obj/item/organ/external/organ = affecting:get_organ(check_zone(hit_zone))
if(!organ || organ.dislocated == -1)
return
assailant.visible_message("<span class='danger'>[assailant] [pick("bent", "twisted")] [affecting]'s [organ.name] into a jointlock!</span>")
var/armor = affecting:run_armor_check(affecting, "melee")
if(armor < 2)
affecting << "<span class='danger'>You feel extreme pain!</span>"
affecting.adjustHalLoss(Clamp(0, 40-affecting.halloss, 40)) //up to 40 halloss
return
if(I_HURT)
if(hit_zone == "eyes")
if(state < GRAB_NECK)
assailant << "<span class='warning'>You require a better grab to do this.</span>"
return
if((affecting:head && affecting:head.flags & HEADCOVERSEYES) || \
(affecting:wear_mask && affecting:wear_mask.flags & MASKCOVERSEYES) || \
(affecting:glasses && affecting:glasses.flags & GLASSESCOVERSEYES))
assailant << "<span class='danger'>You're going to need to remove the eye covering first.</span>"
return
if(!affecting.has_eyes())
assailant << "<span class='danger'>You cannot locate any eyes on [affecting]!</span>"
return
assailant.visible_message("<span class='danger'>[assailant] pressed \his fingers into [affecting]'s eyes!</span>")
affecting << "<span class='danger'>You experience immense pain as you feel digits being pressed into your eyes!</span>"
assailant.attack_log += text("\[[time_stamp()]\] <font color='red'>Pressed fingers into the eyes of [affecting.name] ([affecting.ckey])</font>")
affecting.attack_log += text("\[[time_stamp()]\] <font color='orange'>Had fingers pressed into their eyes by [assailant.name] ([assailant.ckey])</font>")
msg_admin_attack("[key_name(assailant)] has pressed his fingers into [key_name(affecting)]'s eyes.")
var/obj/item/organ/eyes/eyes = affecting:internal_organs_by_name["eyes"]
eyes.damage += rand(3,4)
if (eyes.damage >= eyes.min_broken_damage)
if(affecting.stat != 2)
affecting << "\red You go blind!"
else if(hit_zone != "head")
if(state < GRAB_NECK)
assailant << "<span class='warning'>You require a better grab to do this.</span>"
return
if(affecting:grab_joint(assailant))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
else
if(affecting.lying)
return
assailant.visible_message("<span class='danger'>[assailant] thrusts \his head into [affecting]'s skull!</span>")
var/damage = 20
var/obj/item/clothing/hat = assailant.head
if(istype(hat))
damage += hat.force * 10
affecting.apply_damage(damage*rand(90, 110)/100, BRUTE, "head", affecting:run_armor_check(affecting, "melee"))
assailant.apply_damage(10*rand(90, 110)/100, BRUTE, "head", assailant:run_armor_check("head", "melee"))
playsound(assailant.loc, "swing_hit", 25, 1, -1)
assailant.attack_log += text("\[[time_stamp()]\] <font color='red'>Headbutted [affecting.name] ([affecting.ckey])</font>")
affecting.attack_log += text("\[[time_stamp()]\] <font color='orange'>Headbutted by [assailant.name] ([assailant.ckey])</font>")
msg_admin_attack("[key_name(assailant)] has headbutted [key_name(affecting)]")
return
if(I_DISARM)
if(state < GRAB_AGGRESSIVE)
assailant << "<span class='warning'>You require a better grab to do this.</span>"
return
if(!force_down)
assailant.visible_message("<span class='danger'>[assailant] is forcing [affecting] to the ground!</span>")
force_down = 1
affecting.Weaken(3)
affecting.lying = 1
step_to(assailant, affecting)
assailant.set_dir(EAST) //face the victim
affecting.set_dir(SOUTH) //face up
return
else
assailant << "<span class='warning'>You are already pinning [affecting] to the ground.</span>"
return
if(M == assailant && state >= GRAB_AGGRESSIVE) if(M == assailant && state >= GRAB_AGGRESSIVE)
var/can_eat var/can_eat
@@ -278,19 +401,7 @@
del(src) del(src)
/obj/item/weapon/grab/Del() /obj/item/weapon/grab/Del()
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1) animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1, LINEAR_EASING)
affecting.layer = 4 affecting.layer = 4
del(hud) del(hud)
..() ..()
/obj/item/weapon/grab/attack(mob/living/carbon/human/victim, mob/living/attacker)
if(victim != affecting) return
if(istype(victim))
switch(assailant.a_intent)
if(I_HURT)
if(state < GRAB_NECK)
assailant << "<span class='warning'>You require a better grab to do this.</span>"
return
if(victim.grab_joint(assailant))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return

View File

@@ -347,6 +347,8 @@
if (G.state == GRAB_NECK) if (G.state == GRAB_NECK)
mob.set_dir(reverse_dir[direct]) mob.set_dir(reverse_dir[direct])
G.adjust_position() G.adjust_position()
for (var/obj/item/weapon/grab/G in mob.grabbed_by)
G.adjust_position()
moving = 0 moving = 0
@@ -365,7 +367,7 @@
for(var/obj/item/weapon/grab/G in list(mob.l_hand, mob.r_hand)) for(var/obj/item/weapon/grab/G in list(mob.l_hand, mob.r_hand))
if(G.state == GRAB_KILL) //no wandering across the station/asteroid while choking someone if(G.state == GRAB_KILL) //no wandering across the station/asteroid while choking someone
mob.visible_message("<span class='warning'>[mob] lost \his tight grip on [G.affecting]'s neck!</span>") mob.visible_message("<span class='warning'>[mob] lost \his tight grip on [G.affecting]'s neck!</span>")
G.hud.icon_state = "disarm/kill" G.hud.icon_state = "kill"
G.state = GRAB_NECK G.state = GRAB_NECK
///Process_Incorpmove ///Process_Incorpmove