Skip to content

Commit

Permalink
MAKESHIFT WEAPONS UPDATE
Browse files Browse the repository at this point in the history
-Removes stungloves and all related code.
-Makeshift stun batons can be made in their stead, along with spears. Spears can be thrown or used one or two-handed.
-Major stun baton revamp. They now accept batteries, which can be removed and replaced.
-Fixes the bug where you could use TK to make a dualsaber from a single saber.
  • Loading branch information
Cheridan committed Apr 17, 2013
1 parent dbf3d34 commit c429e58
Show file tree
Hide file tree
Showing 24 changed files with 193 additions and 267 deletions.
8 changes: 4 additions & 4 deletions code/datums/supplypacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@

/datum/supply_packs/weapons
name = "Weapons crate"
contains = list(/obj/item/weapon/melee/baton,
/obj/item/weapon/melee/baton,
contains = list(/obj/item/weapon/melee/baton/loaded,
/obj/item/weapon/melee/baton/loaded,
/obj/item/weapon/gun/energy/laser,
/obj/item/weapon/gun/energy/laser,
/obj/item/weapon/gun/energy/taser,
Expand Down Expand Up @@ -563,8 +563,8 @@

/datum/supply_packs/riot
name = "Riot gear crate"
contains = list(/obj/item/weapon/melee/baton,
/obj/item/weapon/melee/baton,
contains = list(/obj/item/weapon/melee/baton/loaded,
/obj/item/weapon/melee/baton/loaded,
/obj/item/weapon/shield/riot,
/obj/item/weapon/shield/riot,
/obj/item/weapon/storage/box/flashbangs,
Expand Down
4 changes: 1 addition & 3 deletions code/game/machinery/bots/secbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,7 @@ Auto Patrol: []"},
Sa.overlays += image('icons/obj/aibots.dmi', "hs_hole")
Sa.created_name = src.name
new /obj/item/device/assembly/prox_sensor(Tsec)

var/obj/item/weapon/melee/baton/B = new /obj/item/weapon/melee/baton(Tsec)
B.charges = 0
new /obj/item/weapon/melee/baton(Tsec)

if(prob(50))
new /obj/item/robot_parts/l_arm(Tsec)
Expand Down
9 changes: 5 additions & 4 deletions code/game/machinery/recharger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
return
if(istype(charging, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = charging
if(B.charges < initial(B.charges))
B.charges++
if(B.bcell && B.bcell.charge < B.bcell.maxcharge)
B.bcell.charge += 175
icon_state = "recharger1"
use_power(150)
use_power(200)
else
icon_state = "recharger2"

Expand All @@ -93,7 +93,8 @@

else if(istype(charging, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = charging
B.charges = 0
if(B.bcell)
B.bcell.charge = 0
..(severity)


Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/rechargestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
else
O:charge_tick = 0
if(istype(O,/obj/item/weapon/melee/baton))
if(O:charges < 10)
O:charges += 1
var/obj/item/weapon/melee/baton/B = O
if(B.bcell)
B.bcell.charge = B.bcell.maxcharge
//Service
if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme))
if(O.reagents.get_reagent_amount("enzyme") < 50)
Expand Down
11 changes: 10 additions & 1 deletion code/game/objects/items/weapons/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
/obj/item/weapon/handcuffs/cable/white
icon_state = "cuff_white"

/obj/item/weapon/handcuffs/cable/attackby(var/obj/item/I, mob/user as mob)
..()
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
var/obj/item/weapon/wirerod/W = new /obj/item/weapon/wirerod
R.use(1)
user.put_in_hands(W)
user << "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>"
del(src)

/obj/item/weapon/handcuffs/cyborg/attack(mob/living/carbon/C, mob/user)
if(isrobot(user))
Expand All @@ -97,4 +106,4 @@
return
if(user_loc == user.loc && C_loc == C.loc)
C.handcuffed = new /obj/item/weapon/handcuffs(C)
C.update_inv_handcuffed(0)
C.update_inv_handcuffed(0)
129 changes: 93 additions & 36 deletions code/game/objects/items/weapons/stunbaton.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/item/weapon/melee/baton
name = "stun baton"
name = "stunbaton"
desc = "A stun baton for incapacitating people with."
icon_state = "stunbaton"
item_state = "baton"
Expand All @@ -10,49 +10,89 @@
w_class = 3
origin_tech = "combat=2"
attack_verb = list("beaten")
var/charges = 10
var/stunforce = 10
var/status = 0
var/obj/item/weapon/cell/high/bcell = 0
var/hitcost = 1000

suicide_act(mob/user)
viewers(user) << "\red <b>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</b>"
return (FIRELOSS)

/obj/item/weapon/melee/baton/loaded/New()
..()
bcell = new(src)
update_icon()
return

/obj/item/weapon/melee/baton/proc/deductcharge(var/chrgdeductamt)
if(bcell)
if(bcell.rigged)
bcell.explode()//exploding baton of justice
update_icon()
return
else
bcell.charge -= max(chrgdeductamt,0)
if(bcell.charge < hitcost)
status = 0
update_icon()

/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/update_icon()
if(status)
icon_state = "stunbaton_active"
icon_state = "[initial(name)]_active"
else
icon_state = "stunbaton"


/obj/item/weapon/melee/baton/attack_self(mob/user)
if(status && (CLUMSY in user.mutations) && prob(50))
user << "<span class='warning'>You grab the [src] on the wrong side.</span>"
user.Weaken(30)
charges--
if(charges < 1)
icon_state = "[initial(name)]"

/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
if(charges > 0)
return
..()
return

/obj/item/weapon/melee/baton/attack_self(mob/user)
if(bcell && bcell.charge)
status = !status
user << "<span class='notice'>[src] is now [status ? "on" : "off"].</span>"
playsound(loc, "sparks", 75, 1, -1)
update_icon()
else
status = 0
user << "<span class='warning'>[src] is out of charge.</span>"
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 [src]!</span>"
user.Weaken(30)
charges--
if(charges < 1)
status = 0
update_icon()
user.Weaken(stunforce*3)
deductcharge(hitcost)
return

if(isrobot(M))
Expand All @@ -75,19 +115,20 @@
user.lastattacked = L
L.lastattacker = user

L.Stun(10)
L.Weaken(10)
L.apply_effect(STUTTER, 10)
L.Stun(stunforce)
L.Weaken(stunforce)
L.apply_effect(STUTTER, stunforce)

L.visible_message("<span class='danger'>[L] has been stunned with [src] by [user]!</span>")
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)

if(isrobot(loc))
var/mob/living/silicon/robot/R = loc
if(R && R.cell)
R.cell.use(50)
R.cell.use(hitcost)
else
charges--
deductcharge(hitcost)

if(ishuman(L))
var/mob/living/carbon/human/H = L
H.forcesay(hit_appends)
Expand All @@ -96,17 +137,33 @@
L.attack_log += "\[[time_stamp()]\]<font color='orange'> Stunned by [user.name] ([user.ckey]) with [name]</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) stunned [L.name] ([L.ckey]) with [name]</font>" )

if(charges < 1)
if(bcell.charge < hitcost)
status = 0
update_icon()


/obj/item/weapon/melee/baton/emp_act(severity)
switch(severity)
if(1)
charges = 0
if(2)
charges = max(0, charges - 5)
if(charges < 1)
status = 0
update_icon()
if(bcell)
deductcharge(1000 / severity)
if(bcell.reliability != 100 && prob(50/severity))
bcell.reliability -= 10 / severity
..()

//Makeshift stun baton. Replacement for stun gloves.
/obj/item/weapon/melee/baton/cattleprod
name = "stunprod"
desc = "An improvised stun baton."
icon_state = "stunprod_nocell"
item_state = "prod"
force = 3
throwforce = 5
stunforce = 5
hitcost = 2500
slot_flags = null

/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)]"
15 changes: 10 additions & 5 deletions code/game/objects/items/weapons/swords_axes_etc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@
add_fingerprint(user)
return

/obj/item/weapon/melee/energy/sword/attackby(obj/item/weapon/W, mob/user)
/obj/item/weapon/melee/energy/sword/attackby(obj/item/weapon/W, mob/living/user)
..()
if(istype(W, /obj/item/weapon/melee/energy/sword))
user << "<span class='notice'>You attach the ends of the two energy swords, making a single double-bladed weapon! You're cool.</span>"
new /obj/item/weapon/twohanded/dualsaber(user.loc)
del(W)
del(src)
if(W == src)
user << "<span class='notice'>You try to attach the end of the energy sword to... itself. You're not very smart, are you?</span>"
if(ishuman(user))
user.adjustBrainLoss(10)
else
user << "<span class='notice'>You attach the ends of the two energy swords, making a single double-bladed weapon! You're cool.</span>"
new /obj/item/weapon/twohanded/dualsaber(user.loc)
del(W)
del(src)

/*
* Classic Baton
Expand Down
25 changes: 24 additions & 1 deletion code/game/objects/items/weapons/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,27 @@

/obj/item/weapon/twohanded/dualsaber/red
New()
color = "red"
color = "red"


//spears
/obj/item/weapon/twohanded/spear
icon_state = "spearglass0"
name = "spear"
desc = "A haphazardly-constructed yet still deadly weapon of ancient design."
force = 10
w_class = 4.0
slot_flags = SLOT_BACK
force_unwielded = 10
force_wielded = 13
throwforce = 15
flags = FPRINT | TABLEPASS | NOSHIELD
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")

/obj/item/weapon/twohanded/spear/update_icon()
icon_state = "spearglass[wielded]"
return

/obj/item/weapon/twohanded/spear/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
30 changes: 29 additions & 1 deletion code/game/objects/items/weapons/weaponry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,32 @@

/obj/item/weapon/katana/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
return ..()

obj/item/weapon/wirerod
name = "Wired rod"
desc = "A rod with some wire wrapped around the top. It'd be easy to attach something to the top bit."
icon_state = "wiredrod"
item_state = "rods"
flags = FPRINT | TABLEPASS | CONDUCT
force = 9
throwforce = 10
w_class = 3
m_amt = 1875
attack_verb = list("hit", "bludgeoned", "whacked", "bonked")

obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
..()
if(istype(I, /obj/item/weapon/shard))
var/obj/item/weapon/twohanded/spear/S = new /obj/item/weapon/twohanded/spear
user.put_in_hands(S)
user << "<span class='notice'>You fasten the glass shard to the top of the rod with the cable.</span>"
del(I)
del(src)

else if(istype(I, /obj/item/weapon/wirecutters))
var/obj/item/weapon/melee/baton/cattleprod/P = new /obj/item/weapon/melee/baton/cattleprod
user.put_in_hands(P)
user << "<span class='notice'>You fasten the wirecutters to the top of the rod with the cable, prongs outward.</span>"
del(I)
del(src)
12 changes: 6 additions & 6 deletions code/game/objects/structures/crates_lockers/closets/gimmick.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
new /obj/item/weapon/gun/energy/laser(src)
new /obj/item/weapon/gun/energy/laser(src)
new /obj/item/weapon/gun/energy/laser(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/storage/box/flashbangs(src)
new /obj/item/weapon/storage/box/flashbangs(src)
new /obj/item/weapon/storage/box/flashbangs(src)
Expand All @@ -130,9 +130,9 @@
new /obj/item/weapon/gun/energy/laser(src)
new /obj/item/weapon/gun/energy/laser(src)
new /obj/item/weapon/gun/energy/laser(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/melee/baton/loaded(src)
new /obj/item/weapon/storage/box/flashbangs(src)
new /obj/item/weapon/storage/box/flashbangs(src)
new /obj/item/weapon/storage/box/flashbangs(src)
Expand Down
Loading

0 comments on commit c429e58

Please sign in to comment.