mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 07:20:09 +01:00
Materials subsystem, material defines instead of strings, structure materials. (#8447)
The shitcode crusade begins.
This commit is contained in:
@@ -117,7 +117,7 @@
|
||||
item_state = "rfdammo"
|
||||
w_class = 2
|
||||
origin_tech = list(TECH_MATERIAL = 2)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 30000,"glass" = 15000)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 30000, MATERIAL_GLASS = 15000)
|
||||
|
||||
/*
|
||||
RFD Construction-Class
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = 2.0
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 320, "glass" = 800)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 320, MATERIAL_GLASS = 800)
|
||||
var/obj/item/implant/imp = null
|
||||
|
||||
/obj/item/implanter/attack_self(var/mob/user)
|
||||
|
||||
@@ -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>")
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
var/maxcharge = 1000
|
||||
var/rigged = 0 // true if rigged to explode
|
||||
var/minor_fault = 0 //If not 100% reliable, it will build up faults.
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 50)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 50)
|
||||
|
||||
//currently only used by energy-type guns, that may change in the future.
|
||||
/obj/item/cell/device
|
||||
@@ -26,7 +26,7 @@
|
||||
throw_speed = 5
|
||||
throw_range = 7
|
||||
maxcharge = 1000
|
||||
matter = list("metal" = 350, "glass" = 50)
|
||||
matter = list(MATERIAL_STEEL = 350, MATERIAL_GLASS = 50)
|
||||
|
||||
/obj/item/cell/device/variable/New(newloc, charge_amount)
|
||||
..(newloc)
|
||||
@@ -38,7 +38,7 @@
|
||||
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
|
||||
origin_tech = list(TECH_POWER = 0)
|
||||
maxcharge = 500
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 40)
|
||||
|
||||
/obj/item/cell/crap/empty/Initialize()
|
||||
. = ..()
|
||||
@@ -48,7 +48,7 @@
|
||||
name = "security borg rechargable D battery"
|
||||
origin_tech = list(TECH_POWER = 0)
|
||||
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 40)
|
||||
|
||||
/obj/item/cell/secborg/empty/Initialize()
|
||||
. = ..()
|
||||
@@ -58,21 +58,21 @@
|
||||
name = "heavy-duty power cell"
|
||||
origin_tech = list(TECH_POWER = 1)
|
||||
maxcharge = 5000
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 50)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 50)
|
||||
|
||||
/obj/item/cell/high
|
||||
name = "high-capacity power cell"
|
||||
origin_tech = list(TECH_POWER = 2)
|
||||
icon_state = "hcell"
|
||||
maxcharge = 10000
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 60)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 60)
|
||||
|
||||
/obj/item/cell/mecha
|
||||
name = "exosuit-grade power cell"
|
||||
origin_tech = list(TECH_POWER = 3)
|
||||
icon_state = "hcell"
|
||||
maxcharge = 15000
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 70)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 70)
|
||||
|
||||
/obj/item/cell/high/empty/Initialize()
|
||||
. = ..()
|
||||
@@ -83,7 +83,7 @@
|
||||
origin_tech = list(TECH_POWER = 5)
|
||||
icon_state = "scell"
|
||||
maxcharge = 20000
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 70)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 70)
|
||||
|
||||
/obj/item/cell/super/empty/Initialize()
|
||||
. = ..()
|
||||
@@ -94,7 +94,7 @@
|
||||
origin_tech = list(TECH_POWER = 6)
|
||||
icon_state = "hpcell"
|
||||
maxcharge = 30000
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 80)
|
||||
|
||||
/obj/item/cell/hyper/empty/Initialize()
|
||||
. = ..()
|
||||
@@ -105,7 +105,7 @@
|
||||
icon_state = "icell"
|
||||
origin_tech = null
|
||||
maxcharge = 30000 //determines how badly mobs get shocked
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 80)
|
||||
|
||||
check_charge()
|
||||
return 1
|
||||
@@ -138,7 +138,7 @@
|
||||
desc = "A small power cell intended for use with emergency lighting."
|
||||
maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell
|
||||
w_class = ITEMSIZE_TINY
|
||||
matter = list("glass" = 20)
|
||||
matter = list(MATERIAL_GLASS = 20)
|
||||
|
||||
/obj/item/cell/device/emergency_light/empty/Initialize()
|
||||
. = ..()
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
throw_range = 4
|
||||
w_class = 4.0
|
||||
origin_tech = list(TECH_MATERIAL = 2)
|
||||
matter = list("glass" = 7500, DEFAULT_WALL_MATERIAL = 1000)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_GLASS = 7500)
|
||||
attack_verb = list("shoved", "bashed")
|
||||
var/cooldown = 0 //shield bash cooldown. based on world.time
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
desc = "Retracts stuff."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor"
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 10000, "glass" = 5000)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 5000)
|
||||
flags = CONDUCT
|
||||
w_class = 2.0
|
||||
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
|
||||
@@ -31,7 +31,7 @@
|
||||
desc = "You think you have seen this before."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "hemostat"
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 2500)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 5000, MATERIAL_GLASS = 2500)
|
||||
flags = CONDUCT
|
||||
w_class = 2.0
|
||||
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
|
||||
@@ -46,7 +46,7 @@
|
||||
desc = "This stops bleeding."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "cautery"
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 2500)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 5000, MATERIAL_GLASS = 2500)
|
||||
flags = CONDUCT
|
||||
w_class = 2.0
|
||||
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
|
||||
@@ -62,7 +62,7 @@
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "drill"
|
||||
hitsound = 'sound/weapons/saw/circsawhit.ogg'
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 15000, "glass" = 10000)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 15000, MATERIAL_GLASS = 10000)
|
||||
flags = CONDUCT
|
||||
force = 15.0
|
||||
w_class = 3
|
||||
@@ -88,7 +88,7 @@
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 10000, "glass" = 5000)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 5000)
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
drop_sound = 'sound/items/drop/knife.ogg'
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 20000,"glass" = 10000)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000)
|
||||
attack_verb = list("attacked", "slashed", "sawed", "cut")
|
||||
sharp = 1
|
||||
edge = 1
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
w_class = ITEMSIZE_SMALL
|
||||
|
||||
//Cost to make in the autolathe
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 30)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 70, MATERIAL_GLASS = 30)
|
||||
|
||||
//R&D tech level
|
||||
origin_tech = list(TECH_ENGINEERING = 1)
|
||||
@@ -184,7 +184,7 @@
|
||||
name = "industrial welding tool"
|
||||
desc = "A welding tool with an extended-capacity built-in fuel tank, standard issue for engineers."
|
||||
max_fuel = 40
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, "glass" = 60)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 60)
|
||||
base_iconstate = "ind_welder"
|
||||
origin_tech = list(TECH_ENGINEERING = 2)
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
name = "advanced welding tool"
|
||||
desc = "A rare and powerful welding tool with a super-extended fuel tank."
|
||||
max_fuel = 80
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 200, "glass" = 120)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 200, MATERIAL_GLASS = 120)
|
||||
base_iconstate = "adv_welder"
|
||||
origin_tech = list(TECH_ENGINEERING = 3)
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
name = "experimental welding tool"
|
||||
desc = "A scientifically-enhanced welding tool that uses fuel-producing microbes to gradually replenish its fuel supply."
|
||||
max_fuel = 40
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, "glass" = 120)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 120)
|
||||
base_iconstate = "exp_welder"
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_BIO = 4)
|
||||
base_itemstate = "exp_welder"
|
||||
|
||||
Reference in New Issue
Block a user