Renamed shards, katanas, claymores.

This commit is contained in:
Zuhayr
2015-05-16 20:36:33 +09:30
parent 0fb27e83b0
commit 8aa24b86bb
44 changed files with 171 additions and 195 deletions
@@ -1,18 +1,27 @@
/obj/item/weapon/material
health = 10
hitsound = 'sound/weapons/bladeslice.ogg'
gender = NEUTER
var/unbreakable
var/damage_divisor = 0.5
var/default_material = DEFAULT_WALL_MATERIAL
var/material/material
/obj/item/weapon/material/New(var/newloc, var/material_key)
..(newloc)
if(!material_key)
material_key = "wood"
material = get_material_by_name(material_key)
material_key = default_material
set_material(material_key)
/obj/item/weapon/material/proc/set_material(var/new_material)
material = get_material_by_name(new_material)
if(!material)
qdel(src)
else
name = "[material.display_name] bat"
health = round(material.integrity/10)
force = round(material.get_blunt_damage()/2)
force = round(material.get_blunt_damage()*damage_divisor)
color = material.icon_colour
if(material.products_need_process())
processing_objects |= src
@@ -24,10 +33,11 @@
/obj/item/weapon/material/attack()
if(!..())
return
if(!prob(material.hardness))
health--
if(health<=0)
shatter()
if(!unbreakable)
if(!prob(material.hardness))
health--
if(health<=0)
shatter()
/obj/item/weapon/material/proc/shatter()
var/turf/T = get_turf(src)
@@ -1,4 +1,4 @@
/obj/item/weapon/harpoon
/obj/item/weapon/material/harpoon
name = "harpoon"
sharp = 1
edge = 0
@@ -8,4 +8,5 @@
force = 20
throwforce = 15
w_class = 3
attack_verb = list("jabbed","stabbed","ripped")
attack_verb = list("jabbed","stabbed","ripped")
default_material = "steel"
@@ -1,77 +1,49 @@
// Glass shards
/obj/item/weapon/shard
/obj/item/weapon/material/shard
name = "shard"
icon = 'icons/obj/shards.dmi'
icon_state = "large"
sharp = 1
edge = 1
desc = "Made of nothing. How does this even exist?" // set based on material, if this desc is visible it's a bug (shards default to being made of glass)
w_class = 2.0
force = 5.0
throwforce = 8.0
w_class = 2
force = 5
throwforce = 8
item_state = "shard-glass"
//matter = list("glass" = 3750) // Weld it into sheets before you use it!
attack_verb = list("stabbed", "slashed", "sliced", "cut")
default_material = "glass"
unbreakable = 1 //It's already broken.
damage_divisor = 0.1 //So tiny.
gender = "neuter"
var/material/material = null
/obj/item/weapon/material/shard/suicide_act(mob/user)
viewers(user) << pick("\red <b>[user] is slitting \his wrists with \the [src]! It looks like \he's trying to commit suicide.</b>", \
"\red <b>[user] is slitting \his throat with \the [src]! It looks like \he's trying to commit suicide.</b>")
return (BRUTELOSS)
/obj/item/weapon/shard/suicide_act(mob/user)
viewers(user) << pick("\red <b>[user] is slitting \his wrists with \the [src]! It looks like \he's trying to commit suicide.</b>", \
"\red <b>[user] is slitting \his throat with \the [src]! It looks like \he's trying to commit suicide.</b>")
return (BRUTELOSS)
/obj/item/weapon/shard/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
/obj/item/weapon/shard/Bump()
spawn( 0 )
if (prob(20))
src.force = 15
else
src.force = 4
..()
/obj/item/weapon/material/shard/set_material(var/new_material)
..(new_material)
if(!istype(material))
return
return
/obj/item/weapon/shard/New(loc, material/material)
..(loc)
icon_state = "[material.shard_icon][pick("large", "medium", "small")]"
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
update_icon()
if(!material || !istype(material)) // We either don't have a material or we've been passed an invalid material. Use glass instead.
material = get_material_by_name("glass")
set_material(material)
/obj/item/weapon/shard/proc/set_material(material/material)
if(istype(material))
src.material = material
icon_state = "[material.shard_icon][pick("large", "medium", "small")]"
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
update_material()
update_icon()
/obj/item/weapon/shard/proc/update_material()
if(material)
if(material.shard_type)
name = "[material.display_name] [material.shard_type]"
desc = "A small piece of [material.display_name]. It looks sharp, you wouldn't want to step on it barefoot. Could probably be used as ... a throwing weapon?"
switch(material.shard_type)
if(SHARD_SPLINTER, SHARD_SHRAPNEL)
gender = "plural"
else
gender = "neuter"
else
qdel(src)
return
if(material.shard_type)
name = "[material.display_name] [material.shard_type]"
desc = "A small piece of [material.display_name]. It looks sharp, you wouldn't want to step on it barefoot. Could probably be used as ... a throwing weapon?"
switch(material.shard_type)
if(SHARD_SPLINTER, SHARD_SHRAPNEL)
gender = PLURAL
else
gender = NEUTER
else
name = initial(name)
desc = initial(desc)
qdel(src)
/obj/item/weapon/shard/update_icon()
/obj/item/weapon/material/shard/update_icon()
if(material)
color = material.icon_colour
// 1-(1-x)^2, so that glass shards with 0.3 opacity end up somewhat visible at 0.51 opacity
@@ -80,7 +52,7 @@
color = "#ffffff"
alpha = 255
/obj/item/weapon/shard/attackby(obj/item/weapon/W as obj, mob/user as mob)
/obj/item/weapon/material/shard/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/weldingtool) && material.shard_can_repair)
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
@@ -89,7 +61,7 @@
return
return ..()
/obj/item/weapon/shard/Crossed(AM as mob|obj)
/obj/item/weapon/material/shard/Crossed(AM as mob|obj)
if(ismob(AM))
var/mob/M = AM
M << "\red <B>You step on \the [src]!</B>"
@@ -112,9 +84,8 @@
..()
// Preset types - left here for the code that uses them
/obj/item/weapon/material/shard/shrapnel/New(loc)
..(loc, "steel")
/obj/item/weapon/shard/shrapnel/New(loc)
..(loc, get_material_by_name("steel"))
/obj/item/weapon/shard/phoron/New(loc)
..(loc, get_material_by_name("phoron glass"))
/obj/item/weapon/material/shard/phoron/New(loc)
..(loc, "phoron glass")
@@ -1,4 +1,4 @@
/obj/item/weapon/claymore
/obj/item/weapon/material/claymore
name = "claymore"
desc = "What are you standing around staring at this for? Get to killing!"
icon_state = "claymore"
@@ -11,19 +11,16 @@
edge = 1
w_class = 3
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
IsShield()
return 1
/obj/item/weapon/material/claymore/IsShield()
return 1
suicide_act(mob/user)
viewers(user) << "<span class='danger'>[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.</span>"
return(BRUTELOSS)
/obj/item/weapon/material/claymore/suicide_act(mob/user)
viewers(user) << "<span class='danger'>[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.</span>"
return(BRUTELOSS)
/obj/item/weapon/claymore/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
/obj/item/weapon/katana
/obj/item/weapon/material/katana
name = "katana"
desc = "Woefully underpowered in D20"
icon_state = "katana"
@@ -36,14 +33,11 @@
edge = 1
w_class = 3
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
suicide_act(mob/user)
viewers(user) << "<span class='danger'>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</span>"
return(BRUTELOSS)
/obj/item/weapon/material/katana/suicide_act(mob/user)
viewers(user) << "<span class='danger'>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</span>"
return(BRUTELOSS)
/obj/item/weapon/katana/IsShield()
/obj/item/weapon/material/katana/IsShield()
return 1
/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 ..()