diff --git a/baystation12.dme b/baystation12.dme
index e79d4b43af8..fad46ccc344 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -605,6 +605,7 @@
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
#include "code\game\objects\items\weapons\AI_modules.dm"
#include "code\game\objects\items\weapons\autopsy.dm"
+#include "code\game\objects\items\weapons\bats.dm"
#include "code\game\objects\items\weapons\candle.dm"
#include "code\game\objects\items\weapons\cards_ids.dm"
#include "code\game\objects\items\weapons\cigs_lighters.dm"
diff --git a/code/game/objects/items/weapons/bats.dm b/code/game/objects/items/weapons/bats.dm
new file mode 100644
index 00000000000..563cc7d1619
--- /dev/null
+++ b/code/game/objects/items/weapons/bats.dm
@@ -0,0 +1,80 @@
+/obj/item/weapon/twohanded/baseballbat
+ name = "wooden bat"
+ desc = "HOME RUN!"
+ icon_state = "metalbat0"
+ base_icon = "metalbat"
+ item_state = "metalbat"
+ sharp = 0
+ edge = 0
+ w_class = 3
+ force = 10
+ throw_speed = 3
+ throw_range = 7
+ throwforce = 7
+ attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked")
+ hitsound = 'sound/weapons/genhit3.ogg'
+ force_wielded = 20
+ health = 10
+ var/material/material
+
+/obj/item/weapon/twohanded/baseballbat/New(var/newloc, var/material_key)
+ ..(newloc)
+ if(!material_key)
+ material_key = "wood"
+ material = get_material_by_name(material_key)
+ if(!material)
+ qdel(src)
+ else
+ name = "[material.display_name] bat"
+ base_name = name
+ health = round(material.integrity/10)
+ force = round(material.get_blunt_damage()/2)
+ force_unwielded = force
+ force_wielded = material.get_blunt_damage()
+ color = material.icon_colour
+ if(material.products_need_process())
+ processing_objects |= src
+
+/obj/item/weapon/twohanded/baseballbat/Destroy()
+ processing_objects -= src
+ ..()
+
+/obj/item/weapon/twohanded/baseballbat/attack()
+ if(!..())
+ return
+ if(!prob(material.hardness))
+ health--
+ if(health<=0)
+ shatter()
+
+/obj/item/weapon/twohanded/baseballbat/proc/shatter()
+ var/turf/T = get_turf(src)
+ T.visible_message("\The [src] shatters!")
+ if(istype(loc, /mob/living))
+ var/mob/living/M = loc
+ M.drop_from_inventory(src)
+ playsound(src, "shatter", 70, 1)
+ new material.shard_type(T)
+ qdel(src)
+
+/obj/item/weapon/twohanded/baseballbat/process()
+ if(!material.radioactivity)
+ return
+ for(var/mob/living/L in range(1,src))
+ L.apply_effect(round(material.radioactivity/3),IRRADIATE,0)
+
+//Predefined materials go here.
+/obj/item/weapon/twohanded/baseballbat/metal/New(var/newloc)
+ ..(newloc,"steel")
+
+/obj/item/weapon/twohanded/baseballbat/uranium/New(var/newloc)
+ ..(newloc,"uranium")
+
+/obj/item/weapon/twohanded/baseballbat/gold/New(var/newloc)
+ ..(newloc,"gold")
+
+/obj/item/weapon/twohanded/baseballbat/platinum/New(var/newloc)
+ ..(newloc,"platinum")
+
+/obj/item/weapon/twohanded/baseballbat/diamond/New(var/newloc)
+ ..(newloc,"diamond")
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index edf09f6ea85..e4a42d3f33e 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -19,30 +19,34 @@
/obj/item/weapon/twohanded
var/wielded = 0
var/force_wielded = 0
+ var/force_unwielded
var/wieldsound = null
var/unwieldsound = null
var/base_icon
+ var/base_name
/obj/item/weapon/twohanded/proc/unwield()
wielded = 0
- force = initial(force)
- name = "[initial(name)]"
+ force = force_unwielded
+ name = "[base_name]"
update_icon()
/obj/item/weapon/twohanded/proc/wield()
wielded = 1
force = force_wielded
- name = "[initial(name)] (Wielded)"
+ name = "[base_name] (Wielded)"
update_icon()
/obj/item/weapon/twohanded/New()
..()
update_icon()
+ force_unwielded = force
+ base_name = name
/obj/item/weapon/twohanded/mob_can_equip(M as mob, slot)
//Cannot equip wielded items.
if(wielded)
- M << "Unwield the [initial(name)] first!"
+ M << "Unwield the [base_name] first!"
return 0
return ..()
@@ -89,13 +93,13 @@
user << "You need your other hand to be empty"
return
wield()
- user << "You grab the [initial(name)] with both hands."
+ user << "You grab the [base_name] with both hands."
if (src.wieldsound)
playsound(src.loc, wieldsound, 50, 1)
var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~
- O.name = "[initial(name)] - offhand"
- O.desc = "Your second grip on the [initial(name)]"
+ O.name = "[base_name] - offhand"
+ O.desc = "Your second grip on the [base_name]"
user.put_in_inactive_hand(O)
if(istype(user,/mob/living/carbon/human))
@@ -111,11 +115,11 @@
icon_state = "offhand"
name = "offhand"
- unwield()
- qdel(src)
+/obj/item/weapon/twohanded/offhand/unwield()
+ qdel(src)
- wield()
- qdel(src)
+/obj/item/weapon/twohanded/offhand/wield()
+ qdel(src)
/obj/item/weapon/twohanded/offhand/update_icon()
return
@@ -142,15 +146,7 @@
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
var/obj/structure/window/W = A
-
- new /obj/item/weapon/shard( W.loc )
- if(W.reinf) PoolOrNew(/obj/item/stack/rods, W.loc)
-
- if (W.dir == SOUTHWEST)
- new /obj/item/weapon/shard( W.loc )
- if(W.reinf) PoolOrNew(/obj/item/stack/rods, W.loc)
- qdel(A)
-
+ W.shatter()
/*
* Double-Bladed Energy Swords - Cheridan
@@ -209,30 +205,3 @@
flags = NOSHIELD
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
-
-/obj/item/weapon/twohanded/baseballbat
- name = "wooden bat"
- desc = "HOME RUN!"
- icon_state = "woodbat0"
- base_icon = "woodbat"
- item_state = "woodbat"
- sharp = 0
- edge = 0
- w_class = 3
- force = 10
- throw_speed = 3
- throw_range = 7
- throwforce = 7
- attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked")
- hitsound = 'sound/weapons/genhit3.ogg'
- force_wielded = 20
-
-/obj/item/weapon/twohanded/baseballbat/metal
- name = "metal bat"
- desc = "A shiny metal bat."
- icon_state = "metalbat0"
- base_icon = "metalbat"
- item_state = "metalbat"
- force = 15
- w_class = 3.0
- force_wielded = 25
\ No newline at end of file
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 387c76eb698..5c517583801 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -87,11 +87,11 @@
var/index = null
index = 0
while(index < 2)
- new shardtype(loc)
+ new shardtype(loc) //todo pooling?
if(reinf) PoolOrNew(/obj/item/stack/rods, loc)
index++
else
- new shardtype(loc)
+ new shardtype(loc) //todo pooling?
if(reinf) PoolOrNew(/obj/item/stack/rods, loc)
qdel(src)
return
diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm
index d2fa4bcab16..1e49ff8742e 100644
--- a/code/modules/materials/materials.dm
+++ b/code/modules/materials/materials.dm
@@ -13,7 +13,6 @@ var/list/name_to_material
/proc/get_material_by_name(name)
if(!name_to_material)
populate_material_list()
-
return name_to_material[name]
/*
@@ -28,23 +27,30 @@ var/list/name_to_material
var/name // Tag for use in overlay generation/list population .
var/display_name
var/flags = 0
- var/icon_base = "metal"
+ var/rotting_touch_message = "crumbles under your touch"
+
+ // Shards/tables/structures
+ var/tableslam_noise = 'sound/weapons/tablehit1.ogg'
+ var/shard_type = SHARD_SHRAPNEL
+ var/shard_icon
+ var/shard_can_repair = 1
+
+ // Icons
var/icon_colour
+ var/icon_base = "metal"
var/icon_reinf = "reinf_metal"
var/stack_type
+
+ // Attributes
var/cut_delay = 0
var/radioactivity
var/ignition_point
var/melting_point = 1800 // K, walls will take damage if they're next to a fire hotter than this
var/integrity = 150 // Damage before wall falls apart, essentially.
var/hardness = 60 // Used to determine if a hulk can punch through this wall.
- var/rotting_touch_message = "crumbles under your touch"
var/opacity = 1
var/explosion_resistance = 5
- var/shard_type = SHARD_SHRAPNEL
- var/shard_icon
- var/shard_can_repair = 1
- var/tableslam_noise = 'sound/weapons/tablehit1.ogg'
+ var/weight = 20
/material/New()
..()
@@ -53,6 +59,15 @@ var/list/name_to_material
if(!shard_icon)
shard_icon = shard_type
+/material/proc/get_blunt_damage()
+ return weight //todo
+
+/material/proc/get_edge_damage()
+ return round(hardness/4) //todo
+
+/material/proc/products_need_process()
+ return (radioactivity>0) //todo
+
/material/placeholder
name = "placeholder"
@@ -84,6 +99,7 @@ var/list/name_to_material
icon_base = "stone"
icon_reinf = "reinf_stone"
icon_colour = "#007A00"
+ weight = 22
/material/diamond
name = "diamond"
@@ -94,16 +110,21 @@ var/list/name_to_material
opacity = 0.4
shard_type = SHARD_SHARD
tableslam_noise = 'sound/effects/Glasshit.ogg'
+ hardness = 100
/material/gold
name = "gold"
stack_type = /obj/item/stack/sheet/mineral/gold
icon_colour = "#EDD12F"
+ weight = 24
+ hardness = 40
/material/silver
name = "silver"
stack_type = /obj/item/stack/sheet/mineral/silver
icon_colour = "#D1E6E3"
+ weight = 22
+ hardness = 50
/material/phoron
name = "phoron"
@@ -112,6 +133,7 @@ var/list/name_to_material
icon_base = "stone"
icon_colour = "#FC2BC5"
shard_type = SHARD_SHARD
+ hardness = 30
/material/sandstone
name = "sandstone"
@@ -120,6 +142,8 @@ var/list/name_to_material
icon_reinf = "reinf_stone"
icon_colour = "#D9C179"
shard_type = SHARD_STONE_PIECE
+ weight = 22
+ hardness = 55
/material/steel
name = DEFAULT_WALL_MATERIAL
@@ -143,6 +167,8 @@ var/list/name_to_material
icon_reinf = "reinf_over"
icon_colour = "#777777"
explosion_resistance = 25
+ hardness = 80
+ weight = 23
/material/glass
name = "glass"
@@ -153,6 +179,8 @@ var/list/name_to_material
integrity = 100
shard_type = SHARD_SHARD
tableslam_noise = 'sound/effects/Glasshit.ogg'
+ hardness = 15
+ weight = 15
/material/glass/phoron
name = "phoron glass"
@@ -161,6 +189,8 @@ var/list/name_to_material
ignition_point = 300
integrity = 200 // idk why but phoron windows are strong, so.
icon_colour = "#FC2BC5"
+ hardness = 10
+ weight = 10
/material/plastic
name = "plastic"
@@ -169,6 +199,8 @@ var/list/name_to_material
icon_base = "solid"
icon_reinf = "reinf_over"
icon_colour = "#CCCCCC"
+ hardness = 10
+ weight = 12
/material/osmium
name = "osmium"
@@ -189,11 +221,13 @@ var/list/name_to_material
name = "platinum"
stack_type = /obj/item/stack/sheet/mineral/platinum
icon_colour = "#9999FF"
+ weight = 27
/material/iron
name = "iron"
stack_type = /obj/item/stack/sheet/mineral/iron
icon_colour = "#5C5454"
+ weight = 22
/material/wood
name = "wood"
@@ -204,6 +238,8 @@ var/list/name_to_material
explosion_resistance = 2
shard_type = SHARD_SPLINTER
shard_can_repair = 0 // you can't weld splinters back into planks
+ hardness = 15
+ weight = 18
/material/wood/holographic
name = "holographic wood"