mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 14:31:59 +01:00
Materials subsystem, material defines instead of strings, structure materials. (#8447)
The shitcode crusade begins.
This commit is contained in:
@@ -88,10 +88,10 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/material/ashtray/plastic/New(var/newloc)
|
||||
..(newloc, "plastic")
|
||||
..(newloc, MATERIAL_PLASTIC)
|
||||
|
||||
/obj/item/material/ashtray/bronze/New(var/newloc)
|
||||
..(newloc, "bronze")
|
||||
..(newloc, MATERIAL_BRONZE)
|
||||
|
||||
/obj/item/material/ashtray/glass/New(var/newloc)
|
||||
..(newloc, "glass")
|
||||
..(newloc, MATERIAL_GLASS)
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
|
||||
//Predefined materials go here.
|
||||
/obj/item/material/twohanded/baseballbat/metal/New(var/newloc)
|
||||
..(newloc,"steel")
|
||||
..(newloc, MATERIAL_STEEL)
|
||||
|
||||
/obj/item/material/twohanded/baseballbat/uranium/New(var/newloc)
|
||||
..(newloc,"uranium")
|
||||
..(newloc, MATERIAL_URANIUM)
|
||||
|
||||
/obj/item/material/twohanded/baseballbat/gold/New(var/newloc)
|
||||
..(newloc,"gold")
|
||||
..(newloc, MATERIAL_GOLD)
|
||||
|
||||
/obj/item/material/twohanded/baseballbat/platinum/New(var/newloc)
|
||||
..(newloc,"platinum")
|
||||
..(newloc, MATERIAL_PLATINUM)
|
||||
|
||||
/obj/item/material/twohanded/baseballbat/diamond/New(var/newloc)
|
||||
..(newloc,"diamond")
|
||||
..(newloc, MATERIAL_DIAMOND)
|
||||
@@ -72,7 +72,7 @@
|
||||
sharp = TRUE
|
||||
|
||||
/obj/item/material/kitchen/utensil/fork/plastic
|
||||
default_material = "plastic"
|
||||
default_material = MATERIAL_PLASTIC
|
||||
|
||||
/obj/item/material/kitchen/utensil/spoon
|
||||
name = "spoon"
|
||||
@@ -82,7 +82,7 @@
|
||||
force_divisor = 0.1 //2 when wielded with weight 20 (steel)
|
||||
|
||||
/obj/item/material/kitchen/utensil/spoon/plastic
|
||||
default_material = "plastic"
|
||||
default_material = MATERIAL_PLASTIC
|
||||
|
||||
/*
|
||||
* Knives
|
||||
@@ -115,7 +115,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/material/kitchen/utensil/knife/plastic
|
||||
default_material = "plastic"
|
||||
default_material = MATERIAL_PLASTIC
|
||||
|
||||
/*
|
||||
* Rolling Pins
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
throwforce = round(material.get_blunt_damage()*thrown_force_divisor)
|
||||
|
||||
/obj/item/material/proc/set_material(var/new_material)
|
||||
material = get_material_by_name(new_material)
|
||||
material = SSmaterials.get_material_by_name(new_material)
|
||||
if(!material)
|
||||
qdel(src)
|
||||
else
|
||||
|
||||
@@ -93,13 +93,13 @@
|
||||
|
||||
// Preset types - left here for the code that uses them
|
||||
/obj/item/material/shard/shrapnel/New(loc)
|
||||
..(loc, "steel")
|
||||
..(loc, MATERIAL_STEEL)
|
||||
|
||||
/obj/item/material/shard/shrapnel/flechette/New(loc)
|
||||
..(loc, "titanium")
|
||||
..(loc, MATERIAL_TITANIUM)
|
||||
|
||||
/obj/item/material/shard/phoron/New(loc)
|
||||
..(loc, "borosilicate glass")
|
||||
..(loc, MATERIAL_GLASS_PHORON)
|
||||
|
||||
/obj/item/material/shard/wood/New(loc)
|
||||
..(loc, "wood")
|
||||
..(loc, MATERIAL_WOOD)
|
||||
|
||||
@@ -293,13 +293,13 @@
|
||||
|
||||
//predefined materials for spears
|
||||
/obj/item/material/twohanded/spear/steel/New(var/newloc)
|
||||
..(newloc,"steel")
|
||||
..(newloc, MATERIAL_STEEL)
|
||||
|
||||
/obj/item/material/twohanded/spear/plasteel/New(var/newloc)
|
||||
..(newloc,"plasteel")
|
||||
..(newloc, MATERIAL_PLASTEEL)
|
||||
|
||||
/obj/item/material/twohanded/spear/diamond/New(var/newloc)
|
||||
..(newloc,"diamond")
|
||||
..(newloc, MATERIAL_DIAMOND)
|
||||
|
||||
/obj/structure/headspear
|
||||
name = "head on a spear"
|
||||
@@ -307,7 +307,6 @@
|
||||
icon_state = "headspear"
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/material = "glass"
|
||||
|
||||
/obj/structure/headspear/attack_hand(mob/living/user)
|
||||
user.visible_message("<span class='warning'>[user] kicks over \the [src]!</span>", "<span class='danger'>You kick down \the [src]!</span>")
|
||||
|
||||
Reference in New Issue
Block a user