Ammolathe recycling (#27190)

* Changes how recycling is handled, now respects the machine's allowed_materials

* Lets the ammolathe recycle things

* Gives ammo and guns material values for recycling (50% of their build cost)

* oop bloat to appease the robot overlord

* adds typing to material_list

* Revert "oop bloat to appease the robot overlord"

This reverts commit a4c0409999.

Co-authored-by: tianyou <fuckgit@fuckgit.fuck>
This commit is contained in:
hbycyl
2020-07-27 12:49:45 +08:00
committed by GitHub
parent 01451bef69
commit cfd7a3e452
13 changed files with 43 additions and 27 deletions

View File

@@ -15,7 +15,7 @@
light_color = LIGHT_COLOR_RED
machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK //| EMAGGABLE
research_flags = NANOTOUCH | TAKESMATIN | HASOUTPUT | IGNORE_CHEMS | HASMAT_OVER | LOCKBOXES
research_flags = NANOTOUCH | TAKESMATIN | HASOUTPUT | IGNORE_CHEMS | HASMAT_OVER | LOCKBOXES | FAB_RECYCLER
one_part_set_only = 0
part_sets = list(
@@ -96,3 +96,6 @@
)
RefreshParts()

View File

@@ -184,9 +184,15 @@
if(I.materials.getVolume() + src.materials.getVolume() > max_material_storage)
to_chat(user, "\The [src]'s material bin is too full to recycle \the [I].")
return 1
else if(I.materials.getAmount(MAT_IRON) + I.materials.getAmount(MAT_GLASS) < I.materials.getVolume())
to_chat(user, "\The [src] can only accept objects made out of metal and glass.")
else if(allowed_materials && !((I.materials.storage & allowed_materials) ~= I.materials.storage))
var/output = "\The [src] can only accept objects made out of these: "
for(var/mat_id in allowed_materials)
output += (material_list[mat_id].processed_name + " ")
to_chat(user, output)
return 1
else if(isrobot(user))
if(isMoMMI(user))
var/mob/living/silicon/robot/mommi/M = user

View File

@@ -18,7 +18,7 @@ proc/initialize_materials()
continue
initial_materials += list(mat.id = 0) // This is for machines in r&d who have a material holder. If you can't make sheets of the material, you can't put in an r_n_d machine to begin with.
var/global/list/material_list //Stores an instance of all the datums as an assoc with their matids
var/global/list/datum/material/material_list //Stores an instance of all the datums as an assoc with their matids
var/global/list/initial_materials //Stores all the matids = 0 in helping New
/datum/materials

View File

@@ -4,6 +4,7 @@
/obj/item/ammo_storage/box
exact = 1
starting_materials = list(MAT_IRON = 2000)
/obj/item/ammo_storage/box/a357
name = "ammo box (.357)"

View File

@@ -112,7 +112,7 @@
icon_state = "gshell"
caliber = GAUGE12
projectile_type = /obj/item/projectile/bullet
starting_materials = list(MAT_IRON = 12500)
starting_materials = list(MAT_IRON = 250)
w_type = RECYK_METAL
/obj/item/ammo_casing/shotgun/update_icon()
@@ -126,56 +126,56 @@
desc = "A blank shell. Does not contain any projectile material."
icon_state = "blshell"
projectile_type = /obj/item/projectile/bullet/blank
starting_materials = list(MAT_IRON = 250)
starting_materials = list(MAT_IRON = 125)
/obj/item/ammo_casing/shotgun/beanbag
name = "beanbag shell"
desc = "A weak beanbag shell."
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/weakbullet
starting_materials = list(MAT_IRON = 500)
starting_materials = list(MAT_IRON = 250)
/obj/item/ammo_casing/shotgun/fakebeanbag
name = "beanbag shell"
desc = "A weak beanbag shell."
icon_state = "bshell"
projectile_type = /obj/item/projectile/bullet/weakbullet/booze
starting_materials = list(MAT_IRON = 12500)
starting_materials = list(MAT_IRON = 250)
/obj/item/ammo_casing/shotgun/stunshell
name = "stun shell"
desc = "A stunning shell."
icon_state = "stunshell"
projectile_type = /obj/item/projectile/bullet/stunshot
starting_materials = list(MAT_IRON = 2500)
starting_materials = list(MAT_IRON = 250)
/obj/item/ammo_casing/shotgun/dart
name = "shotgun dart"
desc = "A dart for use in shotguns."
icon_state = "blshell"
projectile_type = /obj/item/projectile/bullet/dart
starting_materials = list(MAT_IRON = 12500)
starting_materials = list(MAT_IRON = 250)
/obj/item/ammo_casing/shotgun/buckshot
name = "buckshot shell"
desc = "A 12 gauge shell filled with standard double-aught buckshot."
icon_state = "bsshell"
projectile_type = /obj/item/projectile/bullet/buckshot
starting_materials = list(MAT_IRON = 12500)
starting_materials = list(MAT_IRON = 250)
/obj/item/ammo_casing/shotgun/dragonsbreath
name = "dragon's breath shell"
desc = "A 12 gauge shell filled with an incendiary mixture, for lighting up dark areas or setting things on fire."
icon_state = "bdbshell"
projectile_type = /obj/item/projectile/bullet/fire_plume/dragonsbreath
starting_materials = list(MAT_IRON = 500, MAT_PLASMA = 2000)
starting_materials = list(MAT_IRON = 250, MAT_PLASMA = 1000)
/obj/item/ammo_casing/shotgun/frag
name = "explosive shell"
desc = "A 12 gauge shell filled with a high-explosive mixture, for heavy anti-personnel usage."
icon_state = "fragshell"
projectile_type = /obj/item/projectile/bullet/boombullet
starting_materials = list(MAT_IRON = 500, MAT_PLASMA = 8000)
starting_materials = list(MAT_IRON = 250, MAT_PLASMA = 4000)
/obj/item/ammo_casing/a762
@@ -204,7 +204,7 @@
projectile_type = /obj/item/projectile/bullet/a762x55
w_type = RECYK_METAL
icon_state = "762x55-casing-live"
starting_materials = list(MAT_IRON = 12500)
starting_materials = list(MAT_IRON = 125)
/obj/item/ammo_casing/a762x55/update_icon()
desc = "[initial(desc)][BB ? "" : " This one is spent"]"

View File

@@ -4,6 +4,8 @@
/obj/item/ammo_storage/magazine
desc = "A magazine capable of holding bullets. Can be loaded into certain weapons."
exact = 1 //we only load the thing we want to load
materials = list(MAT_IRON = 200)
/obj/item/ammo_storage/magazine/mc9mm
name = "magazine (9mm)"

View File

@@ -16,25 +16,25 @@
name = "low yield rocket"
desc = "Explosive supplement to Nanotrasen's rocket launchers."
projectile_type = "/obj/item/projectile/rocket/lowyield"
starting_materials = list(MAT_IRON = 20000)
starting_materials = list(MAT_IRON = 10000)
/obj/item/ammo_casing/rocket_rpg/blank
name = "blank rocket"
desc = "This rocket left intentionally blank."
projectile_type = "/obj/item/projectile/rocket/blank"
starting_materials = list(MAT_IRON = 100)
starting_materials = list(MAT_IRON = 50)
/obj/item/ammo_casing/rocket_rpg/emp
name = "EMP rocket"
desc = "EMP rocket for the Nanotrasen rocket launcher."
projectile_type = "/obj/item/projectile/rocket/blank/emp"
starting_materials = list(MAT_IRON = 20000, MAT_URANIUM = 500)
starting_materials = list(MAT_IRON = 10000, MAT_URANIUM = 250)
/obj/item/ammo_casing/rocket_rpg/stun
name = "stun rocket"
desc = "Stun rocket for the Nanotrasen rocket launcher. Not a flashbang."
projectile_type = "/obj/item/projectile/rocket/blank/stun"
starting_materials = list(MAT_IRON = 50000, MAT_SILVER = 1000)
starting_materials = list(MAT_IRON = 25000, MAT_SILVER = 500)
/obj/item/ammo_casing/rocket_rpg/extreme
name = "extreme rocket" //don't even map or spawn this in or you'll be very sad

View File

@@ -5,7 +5,7 @@
/obj/item/ammo_storage/speedloader
desc = "A speedloader, used to load a gun without any of that annoying fumbling."
exact = 0 //load anything in the class!
materials = list(MAT_IRON = 200)
/obj/item/ammo_storage/speedloader/c38
name = "speed loader (.38)"
icon_state = "38"

View File

@@ -21,7 +21,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "scope"
w_class = W_CLASS_SMALL
starting_materials = list(MAT_IRON = 400, MAT_GLASS = 2000)
starting_materials = list(MAT_IRON = 200, MAT_GLASS = 1000)
/obj/item/gun_part/glock_auto_conversion_kit
name = "glock full-auto conversion kit"
@@ -29,7 +29,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "fullautokit"
w_class = W_CLASS_SMALL
starting_materials = list(MAT_IRON = 400)
starting_materials = list(MAT_IRON = 200)
/obj/item/gun_part/universal_magwell_expansion_kit
name = "universal magwell expansion kit"
@@ -37,4 +37,5 @@
icon = 'icons/obj/gun.dmi'
icon_state = "magwellkit"
w_class = W_CLASS_SMALL
starting_materials = list(MAT_IRON = 400)
starting_materials = list(MAT_IRON = 200)

View File

@@ -272,6 +272,7 @@
fire_sound = 'sound/weapons/Gunshot_c20.ogg'
burst_count = 2
origin_tech = Tc_COMBAT + "=5;" + Tc_MATERIALS + "=1"
starting_materials = list(MAT_IRON = 6250, MAT_GLASS = 1500, MAT_PLASTIC = 2500)
var/receiver
/obj/item/weapon/gun/projectile/automatic/vector/isHandgun()

View File

@@ -157,6 +157,7 @@
fire_sound = 'sound/weapons/semiauto.ogg'
load_method = 2
gun_flags = SILENCECOMP | EMPTYCASINGS
starting_materials = list(MAT_IRON = 5000, MAT_GLASS = 1000, MAT_PLASTIC = 2000)
var/obj/item/gun_part/glock_auto_conversion_kit/conversionkit = null
/obj/item/weapon/gun/projectile/glock/update_icon()

View File

@@ -6,7 +6,7 @@
item_state = "rpg"
max_shells = 1
w_class = W_CLASS_LARGE
starting_materials = list(MAT_IRON = 5000)
starting_materials = list(MAT_IRON = 25000, MAT_GLASS = 7500, MAT_PLASTIC = 12500, MAT_GOLD = 3000)
w_type = RECYK_METAL
force = 10
recoil = 1 //The backblast isn't just decorative you know

View File

@@ -28,6 +28,7 @@
var/pumped = 0
var/obj/item/ammo_casing/current_shell = null
gun_flags = 0
starting_materials = list(MAT_IRON = 7500, MAT_WOOD = 3750)
/obj/item/weapon/gun/projectile/shotgun/pump/attack_self(mob/living/user as mob)
if(recentpump)