From e57a75370109334a6c79eab4b8845e3f21fcf13a Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 25 Jun 2017 11:35:00 -0500 Subject: [PATCH] Exporting mechs! --- code/game/mecha/mecha.dm | 9 ++- code/game/mecha/mecha.dm.rej | 10 +++ code/modules/cargo/exports/large_objects.dm | 76 +++++++++++++++++++++ code/modules/cargo/exports/tools.dm | 1 + code/modules/shuttle/supply.dm | 2 +- 5 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 code/game/mecha/mecha.dm.rej diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 3cd142fcdc..8a66a88f33 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -56,7 +56,7 @@ var/datum/gas_mixture/cabin_air var/obj/machinery/atmospherics/components/unary/portables_connector/connected_port = null - var/obj/item/device/radio/radio = null + var/obj/item/device/radio/mech/radio var/list/trackers = list() var/max_temperature = 25000 @@ -117,6 +117,7 @@ hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_TRACK_HUD) +/obj/item/device/radio/mech //this has to go somewhere /obj/mecha/Initialize() . = ..() @@ -155,11 +156,9 @@ AI = M //AIs are loaded into the mech computer itself. When the mech dies, so does the AI. They can be recovered with an AI card from the wreck. else M.forceMove(loc) - - if(prob(30)) - explosion(get_turf(loc), 0, 0, 1, 3) - if(wreckage) + if(prob(30)) + explosion(get_turf(src), 0, 0, 1, 3) var/obj/structure/mecha_wreckage/WR = new wreckage(loc, AI) for(var/obj/item/mecha_parts/mecha_equipment/E in equipment) if(E.salvageable && prob(30)) diff --git a/code/game/mecha/mecha.dm.rej b/code/game/mecha/mecha.dm.rej new file mode 100644 index 0000000000..1f2aa905dc --- /dev/null +++ b/code/game/mecha/mecha.dm.rej @@ -0,0 +1,10 @@ +diff a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm (rejected hunks) +@@ -146,7 +146,7 @@ + /obj/mecha/get_cell() + return cell + +-/obj/mecha/deconstruct(disassembled = TRUE) ++/obj/mecha/Destroy() + go_out() + var/mob/living/silicon/ai/AI + for(var/mob/M in src) //Let's just be ultra sure diff --git a/code/modules/cargo/exports/large_objects.dm b/code/modules/cargo/exports/large_objects.dm index f1555cebcd..1c6b10ff71 100644 --- a/code/modules/cargo/exports/large_objects.dm +++ b/code/modules/cargo/exports/large_objects.dm @@ -96,3 +96,79 @@ cost = 325 unit_name = "security barrier" export_types = list(/obj/item/weapon/grenade/barrier, /obj/structure/barricade/security) + +//Mecha +/datum/export/large/mech + export_types = list(/obj/mecha) + var/sellable + +/datum/export/large/mech/applies_to(obj/O) + if(!..()) + return FALSE + + var/obj/mecha/ME = O + ME.wreckage = null // So the mech doesn't blow up in the cargo shuttle + if(sellable) + return TRUE + +/datum/export/large/mech/sellable + export_types = list() + sellable = TRUE + +/datum/export/large/mech/sellable/ripley + cost = 7500 //boards cost 2500 and takes another 1566 worth of materials (glass, metal, plaseel) to build + significant labor + unit_name = "APLU \"Ripley\"" + export_types = list(/obj/mecha/working/ripley) + exclude_types = list(/obj/mecha/working/ripley/firefighter) + +/datum/export/large/mech/sellable/firefighter + cost = 9000 //same as a ripley but takes 10 more plasteel and 5 less metal + unit_name = "APLU \"Firefighter\"" + export_types = list(/obj/mecha/working/ripley/firefighter) + +/datum/export/large/mech/sellable/odysseus + cost = 6000 // 1540 of material + 2000 price boards + labor + unit_name = "odysseus" + export_types = list(/obj/mecha/medical/odysseus) + +/datum/export/large/mech/sellable/gygax + cost = 25000 // The material is worth 22631 alone. Not as big of a premium as one would expect, since R&D would have provided upgrades by then. + unit_name = "gygax" + export_types = list(/obj/mecha/combat/gygax) + exclude_types = list(/obj/mecha/combat/gygax/dark) + +/datum/export/large/mech/sellable/honkmech + cost = 80000 // The bananium alone is worth around 64887 credits + unit_name = "H.O.N.K" + message = "- HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONK HONKHONKHONKHONK" + export_types = list(/obj/mecha/combat/honker) + +/datum/export/large/mech/sellable/durand + cost = 12000 // 7586 worth of material. That's less than a gygax. Players will be disappointed by the durand's comparative lack of worth but oh well. Still a large premium because this requires significant cooperation between R&D, robotics, and cargo. + unit_name = "durand" + export_types = list(/obj/mecha/combat/durand) + +/datum/export/large/mech/sellable/phazon + cost = 50000 // 15767 material + anomaly core. Fuck it, if you're willing to try selling one of these you should get BIG FUCKING MONEY + unit_name = "phazon" + export_types = list(/obj/mecha/combat/phazon) + +/datum/export/large/mech/sellable/syndiegygax + cost = 50000 // You somehow stole a nuke op's gygax and sold it to nanotrasen. Go you. + unit_name = "captured syndicate gygax" + export_types = list(/obj/mecha/combat/gygax/dark) + +/datum/export/large/mech/sellable/syndiegygax/syndie + cost = 25000 // You somehow stole a nuke op's gygax and sold it back to the syndicate. Why would you do this? + unit_name = "gygax" + emagged = TRUE + +/datum/export/large/mech/sellable/mauler + cost = 87500 // Whoa, momma. + unit_name = "captured mauler" + export_types = list(/obj/mecha/combat/marauder/mauler) + +/datum/export/large/mech/sellable/mauler/syndie + cost = 43750 // Just like the mauler is worth 1.75x the telecrystals compared to the gygax, the price reflects this + unit_name = "mauler" + emagged = TRUE diff --git a/code/modules/cargo/exports/tools.dm b/code/modules/cargo/exports/tools.dm index 8dcf68a9f0..c0643d9c4d 100644 --- a/code/modules/cargo/exports/tools.dm +++ b/code/modules/cargo/exports/tools.dm @@ -99,6 +99,7 @@ cost = 5 unit_name = "radio" export_types = list(/obj/item/device/radio) + exclude_types = list(/obj/item/device/radio/mech) // High-tech tools. diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 60b37236c1..bc8648b873 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -109,7 +109,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/sold_atoms = "" for(var/atom/movable/AM in areaInstance) - if(AM.anchored) + if(AM.anchored && !istype(AM, /obj/mecha)) continue sold_atoms += export_item_and_contents(AM, contraband, emagged, dry_run = FALSE)