Cherrypicking vox spike throwers, made crossbows and pneumatic cannons constructable.

This commit is contained in:
Zuhayr
2014-05-10 01:32:33 +09:30
parent b35232c293
commit 5e682668b2
7 changed files with 287 additions and 7 deletions

View File

@@ -202,4 +202,88 @@
A.removed(user)
arrow = null
tension = 0
icon_state = "crossbow"
icon_state = "crossbow"
// Crossbow construction.
/obj/item/weapon/crossbowframe
name = "crossbow frame"
desc = "A half-finished crossbow."
icon_state = "crossbowframe0"
item_state = "crossbow-solid"
var/buildstate = 0
/obj/item/weapon/crossbowframe/update_icon()
icon_state = "crossbowframe[buildstate]"
/obj/item/weapon/crossbowframe/examine()
..()
switch(buildstate)
if(1) usr << "It has a loose rod frame in place."
if(2) usr << "It has a steel backbone welded in place."
if(3) usr << "It has a steel backbone and a cell mount installed."
if(4) usr << "It has a steel backbone, plastic lath and a cell mount installed."
if(5) usr << "It has a steel cable loosely strung across the lath."
/obj/item/weapon/crossbowframe/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/stack/rods))
if(buildstate == 0)
var/obj/item/stack/rods/R = W
if(R.amount >= 3)
R.use(3)
user << "\blue You assemble a backbone of rods around the wooden stock."
buildstate++
update_icon()
else
user << "\blue You need at least three rods to complete this task."
return
else if(istype(W,/obj/item/weapon/weldingtool))
if(buildstate == 1)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "\blue You weld the rods into place."
buildstate++
update_icon()
return
else if(istype(W,/obj/item/weapon/cable_coil))
var/obj/item/weapon/cable_coil/C = W
if(buildstate == 2)
if(C.amount >= 5)
C.use(5)
user << "\blue You wire a crude cell mount into the top of the crossbow."
buildstate++
update_icon()
else
user << "\blue You need at least five segments of cable coil to complete this task."
return
else if(buildstate == 4)
if(C.amount >= 5)
C.use(5)
user << "\blue You string a steel cable across the crossbow's lath."
buildstate++
update_icon()
else
user << "\blue You need at least five segments of cable coil to complete this task."
return
else if(istype(W,/obj/item/stack/sheet/mineral/plastic))
if(buildstate == 3)
var/obj/item/stack/sheet/mineral/plastic/P = W
if(P.amount >= 3)
P.use(3)
user << "\blue You assemble and install a heavy plastic lath onto the crossbow."
buildstate++
update_icon()
else
user << "\blue You need at least three plastic sheets to complete this task."
return
else if(istype(W,/obj/item/weapon/screwdriver))
if(buildstate == 5)
user << "\blue You secure the crossbow's various parts."
new /obj/item/weapon/crossbow(get_turf(src))
del(src)
return
else
..()

View File

@@ -20,6 +20,9 @@
var/force_divisor = 400 // Force equates to speed. Speed/5 equates to a damage multiplier for whoever you hit.
// For reference, a fully pressurized oxy tank at 50% gas release firing a health
// analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+.
/obj/item/weapon/storage/pneumatic/New()
..()
tank_container.tag = "gas_tank_holder"
/obj/item/weapon/storage/pneumatic/verb/set_pressure() //set amount of tank pressure.
@@ -138,3 +141,82 @@
spawn(cooldown_time)
cooldown = 0
user << "[src]'s gauge informs you it's ready to be fired again."
//Constructable pneumatic cannon.
/obj/item/weapon/cannonframe
name = "pneumatic cannon frame"
desc = "A half-finished pneumatic cannon."
icon_state = "pneumatic0"
item_state = "pneumatic"
var/buildstate = 0
/obj/item/weapon/cannonframe/update_icon()
icon_state = "pneumatic[buildstate]"
/obj/item/weapon/cannonframe/examine()
..()
switch(buildstate)
if(1) usr << "It has a pipe segment installed."
if(2) usr << "It has a pipe segment welded in place."
if(3) usr << "It has an outer chassis installed."
if(4) usr << "It has an outer chassis welded in place."
if(5) usr << "It has a transfer valve installed."
/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/pipe))
if(buildstate == 0)
user.drop_item()
del(W)
user << "\blue You secure the piping inside the frame."
buildstate++
update_icon()
return
else if(istype(W,/obj/item/stack/sheet/metal))
if(buildstate == 2)
var/obj/item/stack/sheet/metal/M = W
if(M.amount >= 5)
M.use(5)
user << "\blue You assemble a chassis around the cannon frame."
buildstate++
update_icon()
else
user << "\blue You need at least five metal sheets to complete this task."
return
else if(istype(W,/obj/item/device/transfer_valve))
if(buildstate == 4)
user.drop_item()
del(W)
user << "\blue You install the transfer valve and connect it to the piping."
buildstate++
update_icon()
return
else if(istype(W,/obj/item/weapon/weldingtool))
if(buildstate == 1)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "\blue You weld the pipe into place."
buildstate++
update_icon()
if(buildstate == 3)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "\blue You weld the metal chassis together."
buildstate++
update_icon()
if(buildstate == 5)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "\blue You weld the valve into place."
new /obj/item/weapon/storage/pneumatic(get_turf(src))
del(src)
return
else
..()