mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-27 14:46:16 +01:00
Imports the following weapons from Baystation's set of makeshift weapons: * Cattelprod (a DIY stunbaton) * Spear (a DIY spear) Updates the baseball bats to be twohanded weapons, instead of one handed. Also removes the plassteel bat.
221 lines
6.7 KiB
Plaintext
221 lines
6.7 KiB
Plaintext
/obj/item/weapon/melee/baton
|
|
name = "stunbaton"
|
|
desc = "A stun baton for incapacitating people with."
|
|
icon_state = "stunbaton"
|
|
item_state = "baton"
|
|
flags = FPRINT | TABLEPASS
|
|
slot_flags = SLOT_BELT
|
|
force = 15
|
|
sharp = 0
|
|
edge = 0
|
|
throwforce = 7
|
|
w_class = 3
|
|
origin_tech = "combat=2"
|
|
attack_verb = list("beaten")
|
|
var/status = 0 //whether the thing is on or not
|
|
var/obj/item/weapon/cell/bcell = null
|
|
var/hitcost = 1000 //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.
|
|
var/mob/foundmob = "" //Throwing! And proc.
|
|
|
|
/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/New()
|
|
..()
|
|
update_icon()
|
|
return
|
|
|
|
/obj/item/weapon/melee/baton/loaded/New() //this one starts with a cell pre-installed.
|
|
..()
|
|
bcell = new/obj/item/weapon/cell/high(src)
|
|
update_icon()
|
|
return
|
|
|
|
/obj/item/weapon/melee/baton/proc/deductcharge(var/chrgdeductamt)
|
|
if(bcell)
|
|
if(bcell.use(chrgdeductamt))
|
|
return 1
|
|
else
|
|
status = 0
|
|
update_icon()
|
|
return 0
|
|
|
|
/obj/item/weapon/melee/baton/update_icon()
|
|
if(status)
|
|
icon_state = "[initial(name)]_active"
|
|
else if(!bcell)
|
|
icon_state = "[initial(name)]_nocell"
|
|
else
|
|
icon_state = "[initial(name)]"
|
|
|
|
/obj/item/weapon/melee/baton/examine()
|
|
set src in view(1)
|
|
..()
|
|
if(bcell)
|
|
usr <<"<span class='notice'>The baton is [round(bcell.percent())]% charged.</span>"
|
|
if(!bcell)
|
|
usr <<"<span class='warning'>The baton does not have a power source installed.</span>"
|
|
|
|
/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user)
|
|
if(istype(W, /obj/item/weapon/cell))
|
|
if(!bcell)
|
|
user.drop_item()
|
|
W.loc = src
|
|
bcell = W
|
|
user << "<span class='notice'>You install a cell in [src].</span>"
|
|
update_icon()
|
|
else
|
|
user << "<span class='notice'>[src] already has a cell.</span>"
|
|
|
|
else if(istype(W, /obj/item/weapon/screwdriver))
|
|
if(bcell)
|
|
bcell.updateicon()
|
|
bcell.loc = get_turf(src.loc)
|
|
bcell = null
|
|
user << "<span class='notice'>You remove the cell from the [src].</span>"
|
|
status = 0
|
|
update_icon()
|
|
return
|
|
..()
|
|
return
|
|
|
|
/obj/item/weapon/melee/baton/attack_self(mob/user)
|
|
if(bcell && bcell.charge > hitcost)
|
|
status = !status
|
|
user << "<span class='notice'>[src] is now [status ? "on" : "off"].</span>"
|
|
playsound(loc, "sparks", 75, 1, -1)
|
|
update_icon()
|
|
else
|
|
status = 0
|
|
if(!bcell)
|
|
user << "<span class='warning'>[src] does not have a power source!</span>"
|
|
else
|
|
user << "<span class='warning'>[src] is out of charge.</span>"
|
|
add_fingerprint(user)
|
|
|
|
|
|
/obj/item/weapon/melee/baton/attack(mob/M, mob/user)
|
|
if(status && (CLUMSY in user.mutations) && prob(50))
|
|
user << "<span class='danger'>You accidentally hit yourself with the [src]!</span>"
|
|
user.Weaken(30)
|
|
deductcharge(hitcost)
|
|
return
|
|
|
|
var/mob/living/carbon/human/H = M
|
|
if(isrobot(M))
|
|
..()
|
|
return
|
|
|
|
if(user.a_intent == "hurt")
|
|
if(!..()) return
|
|
//H.apply_effect(5, WEAKEN, 0)
|
|
M.visible_message("<span class='danger'>[M] has been beaten with the [src] by [user]!</span>")
|
|
|
|
user.attack_log += "\[[time_stamp()]\]<font color='red'> Beat [M.name] ([M.ckey]) with [src.name]</font>"
|
|
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Beaten by [user.name] ([user.ckey]) with [src.name]</font>"
|
|
msg_admin_attack("[key_name_admin(user)] beat [key_name_admin(M)] with [src.name] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
|
|
|
playsound(loc, "swing_hit", 50, 1, -1)
|
|
else if(!status)
|
|
M.visible_message("<span class='warning'>[M] has been prodded with the [src] by [user]. Luckily it was off.</span>")
|
|
return
|
|
|
|
if(status)
|
|
H.apply_effect(10, STUN, 0)
|
|
H.apply_effect(10, WEAKEN, 0)
|
|
H.apply_effect(10, STUTTER, 0)
|
|
user.lastattacked = M
|
|
M.lastattacker = user
|
|
if(isrobot(src.loc))
|
|
var/mob/living/silicon/robot/R = src.loc
|
|
if(R && R.cell)
|
|
R.cell.use(50)
|
|
else
|
|
deductcharge(hitcost)
|
|
M.visible_message("<span class='danger'>[M] has been stunned with the [src] by [user]!</span>")
|
|
|
|
user.attack_log += "\[[time_stamp()]\]<font color='red'> Stunned [M.name] ([M.ckey]) with [src.name]</font>"
|
|
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Stunned by [user.name] ([user.ckey]) with [src.name]</font>"
|
|
msg_admin_attack("[key_name_admin(user)] stunned [key_name_admin(M)] with [src.name] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>")
|
|
|
|
playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
|
if(bcell && bcell.charge < hitcost)
|
|
status = 0
|
|
update_icon()
|
|
|
|
add_fingerprint(user)
|
|
|
|
/obj/item/weapon/melee/baton/throw_impact(atom/hit_atom)
|
|
. = ..()
|
|
if (prob(50))
|
|
if(istype(hit_atom, /mob/living))
|
|
var/mob/living/carbon/human/H = hit_atom
|
|
if(status)
|
|
H.apply_effect(10, STUN, 0)
|
|
H.apply_effect(10, WEAKEN, 0)
|
|
H.apply_effect(10, STUTTER, 0)
|
|
deductcharge(hitcost)
|
|
|
|
for(var/mob/M in player_list) if(M.key == src.fingerprintslast)
|
|
foundmob = M
|
|
break
|
|
|
|
H.visible_message("<span class='danger'>[src], thrown by [foundmob.name], strikes [H] and stuns them!</span>")
|
|
|
|
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Stunned by thrown [src.name] last touched by ([src.fingerprintslast])</font>"
|
|
msg_admin_attack("Flying [src.name], last touched by ([src.fingerprintslast]) stunned [key_name_admin(H)] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[H.x];Y=[H.y];Z=[H.z]'>JMP</a>" )
|
|
|
|
/obj/item/weapon/melee/baton/emp_act(severity)
|
|
if(bcell)
|
|
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
|
|
|
|
/*
|
|
*Stun Rod
|
|
*/
|
|
|
|
/obj/item/weapon/melee/baton/stunrod
|
|
name = "stunrod"
|
|
desc = "A more-than-lethal weapon used to deal with high threat situations."
|
|
icon_state = "stunrod"
|
|
item_state = "stunrod"
|
|
flags = FPRINT | TABLEPASS
|
|
slot_flags = SLOT_BELT
|
|
force = 15
|
|
throwforce = 8
|
|
w_class = 3
|
|
origin_tech = "combat=4,illegal=2"
|
|
|
|
/obj/item/weapon/melee/baton/stunrod/loaded/New() //this one starts with a cell pre-installed.
|
|
..()
|
|
bcell = new/obj/item/weapon/cell/high(src)
|
|
update_icon()
|
|
return
|
|
|
|
/*
|
|
*Cattleprod
|
|
*/
|
|
|
|
/obj/item/weapon/melee/baton/cattleprod
|
|
name = "stunprod"
|
|
desc = "An improvised stun baton."
|
|
icon_state = "stunprod_nocell"
|
|
item_state = "prod"
|
|
force = 3
|
|
throwforce = 5
|
|
hitcost = 2500
|
|
attack_verb = list("poked")
|
|
slot_flags = null
|