mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-04 14:33:30 +00:00
glove attack refactor
This commit is contained in:
@@ -293,6 +293,17 @@
|
||||
punch_force = initial(punch_force)
|
||||
wearer = null
|
||||
|
||||
/obj/item/clothing/gloves
|
||||
var/datum/unarmed_attack/special_attack = null //do the gloves have a special unarmed attack?
|
||||
var/special_attack_type = null
|
||||
|
||||
/obj/item/clothing/gloves/New()
|
||||
..()
|
||||
if(special_attack_type && ispath(special_attack_type))
|
||||
special_attack = new special_attack_type
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//Rings
|
||||
|
||||
|
||||
@@ -126,6 +126,38 @@
|
||||
slot_r_hand_str = 'icons/mob/items/righthand_gloves.dmi',
|
||||
)
|
||||
item_state = "boxing"
|
||||
special_attack_type = /datum/unarmed_attack/holopugilism
|
||||
|
||||
datum/unarmed_attack/holopugilism
|
||||
sparring_variant_type = /datum/unarmed_attack/holopugilism
|
||||
|
||||
datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/zone)
|
||||
user.do_attack_animation(src)
|
||||
var/damage = rand(0, 9)
|
||||
if(!damage)
|
||||
playsound(target.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
target.visible_message("<font color='red'><B>[user] has attempted to punch [target]!</B></font>")
|
||||
return 1
|
||||
var/obj/item/organ/external/affecting = target.get_organ(ran_zone(user.zone_sel.selecting))
|
||||
var/armor_block = target.run_armor_check(affecting, "melee")
|
||||
var/armor_soak = target.get_armor_soak(affecting, "melee")
|
||||
|
||||
if(HULK in user.mutations)
|
||||
damage += 5
|
||||
|
||||
playsound(target.loc, "punch", 25, 1, -1)
|
||||
|
||||
target.visible_message("<font color='red'><B>[user] has punched [target]!</B></font>")
|
||||
|
||||
if(armor_soak >= damage)
|
||||
return
|
||||
|
||||
target.apply_damage(damage, HALLOSS, affecting, armor_block, armor_soak)
|
||||
if(damage >= 9)
|
||||
target.visible_message("<font color='red'><B>[user] has weakened [target]!</B></font>")
|
||||
target.apply_effect(4, WEAKEN, armor_block)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/structure/window/reinforced/holowindow/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(!istype(W))
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
/mob/living/carbon/human/proc/get_unarmed_attack(var/mob/living/carbon/human/target, var/hit_zone)
|
||||
if(src.gloves)
|
||||
var/obj/item/clothing/gloves/G = src.gloves
|
||||
if(G.special_attack && G.special_attack.is_usable(src, target, hit_zone))
|
||||
if(pulling_punches)
|
||||
var/datum/unarmed_attack/soft_type = G.special_attack.get_sparring_variant()
|
||||
if(soft_type)
|
||||
return soft_type
|
||||
return G.special_attack
|
||||
for(var/datum/unarmed_attack/u_attack in species.unarmed_attacks)
|
||||
if(u_attack.is_usable(src, target, hit_zone))
|
||||
if(pulling_punches)
|
||||
@@ -38,34 +46,6 @@
|
||||
H.do_attack_animation(src)
|
||||
return 0
|
||||
|
||||
if(istype(H.gloves, /obj/item/clothing/gloves/boxing/hologlove))
|
||||
H.do_attack_animation(src)
|
||||
var/damage = rand(0, 9)
|
||||
if(!damage)
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<font color='red'><B>[H] has attempted to punch [src]!</B></font>")
|
||||
return 0
|
||||
var/obj/item/organ/external/affecting = get_organ(ran_zone(H.zone_sel.selecting))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
var/armor_soak = get_armor_soak(affecting, "melee")
|
||||
|
||||
if(HULK in H.mutations)
|
||||
damage += 5
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
|
||||
visible_message("<font color='red'><B>[H] has punched [src]!</B></font>")
|
||||
|
||||
if(armor_soak >= damage)
|
||||
return
|
||||
|
||||
apply_damage(damage, HALLOSS, affecting, armor_block, armor_soak)
|
||||
if(damage >= 9)
|
||||
visible_message("<font color='red'><B>[H] has weakened [src]!</B></font>")
|
||||
apply_effect(4, WEAKEN, armor_block)
|
||||
|
||||
return
|
||||
|
||||
if(istype(M,/mob/living/carbon))
|
||||
var/mob/living/carbon/C = M
|
||||
C.spread_disease_to(src, "Contact")
|
||||
@@ -231,6 +211,9 @@
|
||||
if(!attack)
|
||||
return 0
|
||||
|
||||
if(attack.unarmed_override(H, src, hit_zone))
|
||||
return 0
|
||||
|
||||
H.do_attack_animation(src)
|
||||
if(!attack_message)
|
||||
attack.show_attack(H, src, hit_zone, rand_damage)
|
||||
@@ -252,7 +235,7 @@
|
||||
var/obj/item/clothing/gloves/G = H.gloves
|
||||
real_damage += G.punch_force
|
||||
hit_dam_type = G.punch_damtype
|
||||
if(H.pulling_punches) //SO IT IS DECREED: PULLING PUNCHES WILL PREVENT THE ACTUAL DAMAGE FROM RINGS AND KNUCKLES, BUT NOT THE ADDED PAIN
|
||||
if(H.pulling_punches && !attack.sharp && !attack.edge) //SO IT IS DECREED: PULLING PUNCHES WILL PREVENT THE ACTUAL DAMAGE FROM RINGS AND KNUCKLES, BUT NOT THE ADDED PAIN, BUT YOU CAN'T "PULL" A FUCKING KNIFE
|
||||
hit_dam_type = AGONY
|
||||
real_damage *= damage_multiplier
|
||||
rand_damage *= damage_multiplier
|
||||
|
||||
@@ -105,6 +105,9 @@ var/global/list/sparring_attack_cache = list()
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] attempts to press [TU.his] [eye_attack_text] into [target]'s eyes, but [TT.he] [TT.does]n't have any!</span>")
|
||||
|
||||
/datum/unarmed_attack/proc/unarmed_override(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/zone)
|
||||
return 0 //return true if the unarmed override prevents further attacks
|
||||
|
||||
/datum/unarmed_attack/bite
|
||||
attack_verb = list("bit")
|
||||
attack_sound = 'sound/weapons/bite.ogg'
|
||||
|
||||
Reference in New Issue
Block a user