mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Stun baton nerf
Adds agonyforce var to stun batons, which causes halloss and eye blur. Also did some clean up of stun batons, and fixed the stun baton's bcell var being of type weapon/cell/high instead of weapon/cell. Conflicts: code/_onclick/item_attack.dm code/game/objects/items/weapons/stunbaton.dm
This commit is contained in:
@@ -24,13 +24,12 @@
|
||||
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
|
||||
|
||||
if (!istype(M)) // not sure if this is the right thing...
|
||||
return
|
||||
return 0
|
||||
var/messagesource = M
|
||||
|
||||
if (can_operate(M)) //Checks if mob is lying down on table for surgery
|
||||
if (do_surgery(M,user,src))
|
||||
return
|
||||
|
||||
return 0
|
||||
if (istype(M,/mob/living/carbon/brain))
|
||||
messagesource = M:container
|
||||
if (hitsound && force > 0)
|
||||
@@ -145,7 +144,7 @@
|
||||
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
return M:attacked_by(src, user, def_zone)
|
||||
return M:attacked_by(src, user, def_zone) //make sure to return whether we have hit or miss
|
||||
else
|
||||
switch(damtype)
|
||||
if("brute")
|
||||
|
||||
@@ -8,21 +8,23 @@
|
||||
force = 10
|
||||
throwforce = 7
|
||||
w_class = 3
|
||||
var/stunforce = 10
|
||||
var/status = 0
|
||||
var/mob/foundmob = "" //Used in throwing proc.
|
||||
var/obj/item/weapon/cell/high/bcell = 0
|
||||
var/hitcost = 1500
|
||||
|
||||
origin_tech = "combat=2"
|
||||
attack_verb = list("beaten")
|
||||
var/stunforce = 0
|
||||
var/agonyforce = 60
|
||||
var/status = 0 //whether the thing is on or not
|
||||
var/obj/item/weapon/cell/high/bcell = null
|
||||
var/mob/foundmob = "" //Used in throwing proc.
|
||||
var/hitcost = 1500 //oh god why do power cells carry so much charge? We probably need to make a distinction between "industrial" sized power cells for APCs and power cells for everything else.
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "<span class='suicide'>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</span>"
|
||||
return (FIRELOSS)
|
||||
/obj/item/weapon/melee/baton/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</span>")
|
||||
return (FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/baton/loaded/New()
|
||||
|
||||
/obj/item/weapon/melee/baton/loaded/New() //this one starts with a cell pre-installed.
|
||||
..()
|
||||
bcell = new(src)
|
||||
bcell = new/obj/item/weapon/cell/high(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -116,51 +118,60 @@
|
||||
..()
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/agony = agonyforce
|
||||
var/mob/living/L = M
|
||||
|
||||
if(user.a_intent == "hurt")
|
||||
if(!..()) return
|
||||
H.visible_message("<span class='danger'>[M] has been beaten with the [src] by [user]!</span>")
|
||||
var/contact = 1
|
||||
if(user.a_intent == "harm")
|
||||
contact = ..()
|
||||
agony *= 0.5 //whacking someone causes a much poorer contact than prodding them.
|
||||
else
|
||||
//copied from human_defense.dm
|
||||
if (ishuman(L))
|
||||
user.lastattacked = L //are these used at all, if we have logs?
|
||||
L.lastattacker = user
|
||||
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Beat [H.name] ([H.ckey]) with [src.name]</font>"
|
||||
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Beaten by [user.name] ([user.ckey]) with [src.name]</font>"
|
||||
msg_admin_attack("[user.name] ([user.ckey]) beat [H.name] ([H.ckey]) with [src.name] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
var/target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, L)
|
||||
if(user == L) // Attacking yourself can't miss
|
||||
target_zone = user.zone_sel.selecting
|
||||
if(!target_zone)
|
||||
contact = 0
|
||||
else
|
||||
switch (target_zone)
|
||||
if("head")
|
||||
agony *= 1.25
|
||||
//if("l_hand", "r_hand") //TODO
|
||||
//if("l_foot", "r_foot") //TODO
|
||||
|
||||
playsound(src.loc, "swing_hit", 50, 1, -1)
|
||||
|
||||
else if(!status)
|
||||
H.visible_message("<span class='warning'>[H] has been prodded with [src] by [user]. Luckily it was off.</span>")
|
||||
return
|
||||
|
||||
var/stunroll = (rand(1,100))
|
||||
|
||||
if(status)
|
||||
user.lastattacked = H
|
||||
H.lastattacker = user
|
||||
if(user == H) // Attacking yourself can't miss
|
||||
stunroll = 100
|
||||
if(stunroll < 40)
|
||||
H.visible_message("\red <B>[user] misses [H] with \the [src]!")
|
||||
msg_admin_attack("[key_name(user)] attempted to stun [key_name(H)] with the [src].")
|
||||
return
|
||||
H.Stun(stunforce)
|
||||
H.Weaken(stunforce)
|
||||
H.apply_effect(STUTTER, stunforce)
|
||||
|
||||
H.visible_message("<span class='danger'>[H] has been stunned with [src] by [user]!</span>")
|
||||
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
|
||||
msg_admin_attack("[key_name(user)] stunned [key_name(H)] with the [src].")
|
||||
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Stunned [H.name] ([H.ckey]) with [src.name]</font>"
|
||||
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Stunned by [user.name] ([user.ckey]) with [src.name]</font>"
|
||||
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/R = loc
|
||||
if(R && R.cell)
|
||||
R.cell.use(hitcost)
|
||||
//put this here to avoid duplicate messages and logs from ..() above
|
||||
if (!contact)
|
||||
L.visible_message("\red <B>[user] misses [L] with \the [src]!")
|
||||
else
|
||||
deductcharge(hitcost)
|
||||
if(!status)
|
||||
L.visible_message("<span class='warning'>[L] has been prodded with [src] by [user]. Luckily it was off.</span>")
|
||||
else
|
||||
L.visible_message("<span class='danger'>[L] has been prodded with [src] by [user]!</span>")
|
||||
msg_admin_attack("[key_name(user)] attempted to stun [key_name(L)] with the [src].")
|
||||
|
||||
//stun effects
|
||||
if (contact)
|
||||
if (stunforce)
|
||||
L.Stun(stunforce)
|
||||
L.Weaken(stunforce)
|
||||
L.apply_effect(STUTTER, stunforce)
|
||||
|
||||
if (agony)
|
||||
//Siemens coefficient?
|
||||
//TODO: Merge this with taser effects
|
||||
L.apply_effect(agony,AGONY,0)
|
||||
L.apply_effect(STUTTER, agony/10)
|
||||
L.apply_effect(EYE_BLUR, agony/10)
|
||||
L.flash_pain()
|
||||
|
||||
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
msg_admin_attack("[key_name(user)] stunned [key_name(L)] with the [src].")
|
||||
|
||||
deductcharge(hitcost)
|
||||
|
||||
|
||||
/obj/item/weapon/melee/baton/throw_impact(atom/hit_atom)
|
||||
@@ -196,11 +207,19 @@
|
||||
|
||||
/obj/item/weapon/melee/baton/emp_act(severity)
|
||||
if(bcell)
|
||||
deductcharge(1000 / severity)
|
||||
if(bcell.reliability != 100 && prob(50/severity))
|
||||
bcell.reliability -= 10 / severity
|
||||
bcell.emp_act(severity) //let's not duplicate code everywhere if we don't have to please.
|
||||
..()
|
||||
|
||||
//secborg stun baton module
|
||||
/obj/item/weapon/melee/baton/robot/attack_self(mob/user)
|
||||
//try to find our power cell
|
||||
var/mob/living/silicon/robot/R = loc
|
||||
if (istype(R))
|
||||
bcell = R.cell
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/melee/baton/robot/attackby(obj/item/weapon/W, mob/user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/baton/loaded/ntcane
|
||||
name = "fancy cane"
|
||||
@@ -216,8 +235,10 @@
|
||||
item_state = "prod"
|
||||
force = 3
|
||||
throwforce = 5
|
||||
stunforce = 5
|
||||
stunforce = 0
|
||||
agonyforce = 60 //same force as a stunbaton, but uses way more charge.
|
||||
hitcost = 2500
|
||||
attack_verb = list("poked")
|
||||
slot_flags = null
|
||||
|
||||
/obj/item/weapon/melee/baton/cattleprod/update_icon()
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
src.modules += new /obj/item/device/flash(src)
|
||||
src.modules += new /obj/item/borg/sight/hud/sec(src)
|
||||
src.modules += new /obj/item/weapon/handcuffs/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/melee/baton/loaded(src)
|
||||
src.modules += new /obj/item/weapon/melee/baton/robot(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/taser/cyborg(src)
|
||||
src.modules += new /obj/item/taperoll/police(src)
|
||||
src.emag = new /obj/item/weapon/gun/energy/laser/cyborg(src)
|
||||
|
||||
Reference in New Issue
Block a user