mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-31 00:26:21 +01:00
Stungloves are no longer the powerhouse they once were. They are a one-shot weapon, and have a chance for terrific failure, that can also damage the user.
294 lines
11 KiB
Plaintext
294 lines
11 KiB
Plaintext
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
|
|
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
|
M << "No attacking people at spawn, you jackass."
|
|
return
|
|
|
|
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
|
|
if (M.hand)
|
|
temp = M:organs_by_name["l_hand"]
|
|
if(temp && !temp.is_usable())
|
|
M << "\red You can't use your [temp.display_name]."
|
|
return
|
|
|
|
..()
|
|
|
|
if((M != src) && check_shields(0, M.name))
|
|
visible_message("\red <B>[M] attempted to touch [src]!</B>")
|
|
return 0
|
|
|
|
|
|
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
|
var/obj/item/clothing/gloves/G = M.gloves
|
|
if(G.cell)
|
|
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
|
|
if(G.cell.charge >= 2500)
|
|
G.cell.use(G.cell.charge) //So it drains the cell.
|
|
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
|
|
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [src.name] ([src.ckey])</font>")
|
|
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [M.name] ([M.ckey])</font>")
|
|
|
|
msg_admin_attack("[key_name_admin(M)] stungloved [src.name] ([src.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>)")
|
|
|
|
var/armorblock = run_armor_check(M.zone_sel.selecting, "energy")
|
|
apply_effects(5,5,0,0,5,0,0,armorblock)
|
|
apply_damage(rand(5,25), BURN, M.zone_sel.selecting,armorblock)
|
|
|
|
if(prob(15))
|
|
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
|
|
M.visible_message("\red The power source on [M]'s stun gloves overloads in a terrific fashion!", "\red Your jury rigged stun gloves malfunction!", "\red You hear a loud sparking.")
|
|
|
|
if(prob(50))
|
|
M.apply_damage(rand(1,5), BURN)
|
|
|
|
for(M in viewers(3, null))
|
|
var/safety = M:eyecheck()
|
|
if(!safety)
|
|
if(!M.blinded)
|
|
flick("flash", M.flash)
|
|
|
|
return 1
|
|
else
|
|
M << "\red Not enough charge! "
|
|
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
|
|
return
|
|
|
|
else if(istype(M.gloves , /obj/item/clothing/gloves/boxing/hologlove))
|
|
|
|
var/damage = rand(0, 9)
|
|
if(!damage)
|
|
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
|
visible_message("\red <B>[M] has attempted to punch [src]!</B>")
|
|
return 0
|
|
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
|
var/armor_block = run_armor_check(affecting, "melee")
|
|
|
|
if(HULK in M.mutations) damage += 5
|
|
|
|
playsound(loc, "punch", 25, 1, -1)
|
|
|
|
visible_message("\red <B>[M] has punched [src]!</B>")
|
|
|
|
apply_damage(damage, HALLOSS, affecting, armor_block)
|
|
if(damage >= 9)
|
|
visible_message("\red <B>[M] has weakened [src]!</B>")
|
|
apply_effect(4, WEAKEN, armor_block)
|
|
return
|
|
else
|
|
if(istype(M,/mob/living/carbon))
|
|
// log_debug("No gloves, [M] is truing to infect [src]")
|
|
M.spread_disease_to(src, "Contact")
|
|
|
|
|
|
switch(M.a_intent)
|
|
if("help")
|
|
if(health >= config.health_threshold_crit)
|
|
help_shake_act(M)
|
|
return 1
|
|
// if(M.health < -75) return 0
|
|
|
|
if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
|
|
M << "\blue <B>Remove your mask!</B>"
|
|
return 0
|
|
if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
|
|
M << "\blue <B>Remove his mask!</B>"
|
|
return 0
|
|
|
|
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human()
|
|
O.source = M
|
|
O.target = src
|
|
O.s_loc = M.loc
|
|
O.t_loc = loc
|
|
O.place = "CPR"
|
|
requests += O
|
|
spawn(0)
|
|
O.process()
|
|
return 1
|
|
|
|
if("grab")
|
|
if(M == src || anchored)
|
|
return 0
|
|
if(w_uniform)
|
|
w_uniform.add_fingerprint(M)
|
|
|
|
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
|
|
if(buckled)
|
|
M << "<span class='notice'>You cannot grab [src], \he is buckled in!</span>"
|
|
if(!G) //the grab will delete itself in New if affecting is anchored
|
|
return
|
|
M.put_in_active_hand(G)
|
|
grabbed_by += G
|
|
G.synch()
|
|
|
|
LAssailant = M
|
|
|
|
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
|
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves/force))
|
|
G.state = GRAB_AGGRESSIVE
|
|
G.icon_state = "grabbed1"
|
|
visible_message("<span class='warning'>[M] gets a strong grip on [src]!</span>")
|
|
return 1
|
|
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
|
|
return 1
|
|
|
|
if("hurt")
|
|
|
|
// See if they can attack, and which attacks to use.
|
|
var/datum/unarmed_attack/attack = M.species.unarmed
|
|
if(!attack.is_usable(M))
|
|
attack = M.species.secondary_unarmed
|
|
if(!attack.is_usable(M))
|
|
return 0
|
|
//Vampire code
|
|
if(M.zone_sel && M.zone_sel.selecting == "head")
|
|
if(M.mind && M.mind.vampire && (M.mind in ticker.mode.vampires) && !M.mind.vampire.draining)
|
|
if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
|
|
M << "\red Remove their mask!"
|
|
return 0
|
|
if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
|
|
M << "\red Remove your mask!"
|
|
return 0
|
|
if(mind && mind.vampire && (mind in ticker.mode.vampires))
|
|
M << "\red Your fangs fail to pierce [src.name]'s cold flesh"
|
|
return 0
|
|
if(get_species() == "Machine")
|
|
M << "\red They have no blood"
|
|
return 0
|
|
//we're good to suck the blood, blaah
|
|
//and leave an attack log
|
|
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Bit [src.name] ([src.ckey]) in the neck and draining their blood</font>")
|
|
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been bit in the neck by [M.name] ([M.ckey])</font>")
|
|
msg_admin_attack("[key_name_admin(M)] bit [key_name_admin(src)] in the neck - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>")
|
|
M.handle_bloodsucking(src)
|
|
// var/datum/organ/external/affecting = get_organ(src.zone_sel.selecting)
|
|
// affecting.take_damage(10,0,1,0,"dual puncture marks") //this does not work and causes runtimes.
|
|
return
|
|
//end vampire codes
|
|
M.attack_log += text("\[[time_stamp()]\] <font color='red'>[pick(attack.attack_verb)]ed [src.name] ([src.ckey])</font>")
|
|
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [pick(attack.attack_verb)]ed by [M.name] ([M.ckey])</font>")
|
|
msg_admin_attack("[key_name_admin(M)] [pick(attack.attack_verb)]ed [key_name_admin(src)] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>")
|
|
|
|
var/damage = rand(0, 5)//BS12 EDIT
|
|
if(!damage)
|
|
playsound(loc, attack.miss_sound, 25, 1, -1)
|
|
visible_message("\red <B>[M] tried to [pick(attack.attack_verb)] [src]!</B>")
|
|
return 0
|
|
|
|
|
|
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
|
var/armor_block = run_armor_check(affecting, "melee")
|
|
|
|
if(HULK in M.mutations) damage += 5
|
|
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves/force))
|
|
var/obj/item/clothing/gloves/force/X = M.gloves
|
|
damage *= X.amplification
|
|
playsound(loc, attack.attack_sound, 25, 1, -1)
|
|
|
|
visible_message("\red <B>[M] [pick(attack.attack_verb)]ed [src]!</B>")
|
|
//Rearranged, so claws don't increase weaken chance.
|
|
if(damage >= 5 && prob(50))
|
|
visible_message("\red <B>[M] has weakened [src]!</B>")
|
|
apply_effect(3, WEAKEN, armor_block)
|
|
|
|
damage += attack.damage
|
|
apply_damage(damage, BRUTE, affecting, armor_block, sharp=attack.sharp, edge=attack.edge)
|
|
|
|
|
|
if("disarm")
|
|
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
|
|
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
|
|
|
|
msg_admin_attack("[key_name_admin(M)] disarmed [key_name_admin(src)] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>")
|
|
|
|
if(w_uniform)
|
|
w_uniform.add_fingerprint(M)
|
|
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
|
|
|
if (istype(r_hand,/obj/item/weapon/gun) || istype(l_hand,/obj/item/weapon/gun))
|
|
var/obj/item/weapon/gun/W = null
|
|
var/chance = 0
|
|
|
|
if (istype(l_hand,/obj/item/weapon/gun))
|
|
W = l_hand
|
|
chance = hand ? 40 : 20
|
|
|
|
if (istype(r_hand,/obj/item/weapon/gun))
|
|
W = r_hand
|
|
chance = !hand ? 40 : 20
|
|
|
|
if (prob(chance))
|
|
visible_message("<spawn class=danger>[src]'s [W] goes off during struggle!")
|
|
var/list/turfs = list()
|
|
for(var/turf/T in view())
|
|
turfs += T
|
|
var/turf/target = pick(turfs)
|
|
return W.afterattack(target,src)
|
|
|
|
var/randn = rand(1, 100)
|
|
if (randn <= 25)
|
|
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves/force))
|
|
apply_effect(6, WEAKEN, run_armor_check(affecting, "melee"))
|
|
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
|
visible_message("\red <B>[M] hurls [src] to the floor!</B>")
|
|
step_away(src,M,15)
|
|
sleep(3)
|
|
step_away(src,M,15)
|
|
return
|
|
|
|
else
|
|
apply_effect(3, WEAKEN, run_armor_check(affecting, "melee"))
|
|
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
|
visible_message("\red <B>[M] has pushed [src]!</B>")
|
|
return
|
|
|
|
var/talked = 0 // BubbleWrap
|
|
|
|
if(randn <= 60)
|
|
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves/force))
|
|
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
|
visible_message("\red <B>[M] shoves, sending [src] flying!</B>")
|
|
step_away(src,M,15)
|
|
sleep(1)
|
|
step_away(src,M,15)
|
|
sleep(1)
|
|
step_away(src,M,15)
|
|
sleep(1)
|
|
step_away(src,M,15)
|
|
sleep(1)
|
|
apply_effect(1, WEAKEN, run_armor_check(affecting, "melee"))
|
|
return
|
|
//BubbleWrap: Disarming breaks a pull
|
|
if(pulling)
|
|
visible_message("\red <b>[M] has broken [src]'s grip on [pulling]!</B>")
|
|
talked = 1
|
|
stop_pulling()
|
|
|
|
//BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it?
|
|
if(istype(l_hand, /obj/item/weapon/grab))
|
|
var/obj/item/weapon/grab/lgrab = l_hand
|
|
if(lgrab.affecting)
|
|
visible_message("\red <b>[M] has broken [src]'s grip on [lgrab.affecting]!</B>")
|
|
talked = 1
|
|
spawn(1)
|
|
del(lgrab)
|
|
if(istype(r_hand, /obj/item/weapon/grab))
|
|
var/obj/item/weapon/grab/rgrab = r_hand
|
|
if(rgrab.affecting)
|
|
visible_message("\red <b>[M] has broken [src]'s grip on [rgrab.affecting]!</B>")
|
|
talked = 1
|
|
spawn(1)
|
|
del(rgrab)
|
|
//End BubbleWrap
|
|
|
|
if(!talked) //BubbleWrap
|
|
drop_item()
|
|
visible_message("\red <B>[M] has disarmed [src]!</B>")
|
|
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
|
return
|
|
|
|
|
|
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
|
visible_message("\red <B>[M] attempted to disarm [src]!</B>")
|
|
return
|
|
|
|
/mob/living/carbon/human/proc/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, inrange, params)
|
|
return |