From cc1aeb91ac3a0832b2350a3dd1174fd2b8a0979d Mon Sep 17 00:00:00 2001 From: lolman360 Date: Thu, 18 Jun 2020 09:41:57 +1000 Subject: [PATCH 1/2] one pump chump --- code/modules/research/designs/biogenerator_designs.dm | 8 ++++++++ code/modules/vehicles/_vehicle.dm | 11 +++++++++++ code/modules/vehicles/atv.dm | 3 +++ 3 files changed, 22 insertions(+) diff --git a/code/modules/research/designs/biogenerator_designs.dm b/code/modules/research/designs/biogenerator_designs.dm index 4ec94343..19d17a45 100644 --- a/code/modules/research/designs/biogenerator_designs.dm +++ b/code/modules/research/designs/biogenerator_designs.dm @@ -178,3 +178,11 @@ materials = list(MAT_BIOMASS = 5) build_path = /obj/item/stack/tile/carpet category = list("initial","Misc") + +/datum/design/biodiesel + name = "Biodiesel" + id = "biodiesel" + build_type = BIOGENERATOR + materials = list(MAT_BIOMASS = 100) + make_reagents = list("biodiesel" = 10) + category = list("initial","Misc") diff --git a/code/modules/vehicles/_vehicle.dm b/code/modules/vehicles/_vehicle.dm index 11118991..ab5285d3 100644 --- a/code/modules/vehicles/_vehicle.dm +++ b/code/modules/vehicles/_vehicle.dm @@ -25,9 +25,14 @@ var/list/autogrant_actions_controller //assoc list "[bitflag]" = list(typepaths) var/list/mob/occupant_actions //assoc list mob = list(type = action datum assigned to mob) var/obj/vehicle/trailer + var/fueltype //what fuel do we use if we use fuel. if we don't use fuel this is null. + var/fueluse //how much fuel is consumed on a move proc + var/tanksize //size of the fuel tank /obj/vehicle/Initialize(mapload) . = ..() + if(fueltype && fueluse && tanksize) + create_reagents(tanksize) //fuel tank occupants = list() autogrant_actions_passenger = list() autogrant_actions_controller = list() @@ -106,9 +111,15 @@ return FALSE if(!default_driver_move) return + if(fueltype && fueluse) + if(reagents.get_reagent_amount(fueltype) < fueluse) + to_chat(user, "[src]'s engine sputters!") + return vehicle_move(direction) /obj/vehicle/proc/vehicle_move(direction) + if(fueltype && fueluse) + reagents.remove_reagent("fueltype", fueluse) if(lastmove + movedelay > world.time) return FALSE lastmove = world.time diff --git a/code/modules/vehicles/atv.dm b/code/modules/vehicles/atv.dm index eb6a9a92..ce6e92c3 100644 --- a/code/modules/vehicles/atv.dm +++ b/code/modules/vehicles/atv.dm @@ -5,6 +5,9 @@ icon_state = "atv" key_type = /obj/item/key var/static/mutable_appearance/atvcover + fueltype = "biodiesel" + fueluse = 0.25 + tanksize = 100 //400 tiles movement on a single tank. 1k biomass needed to fill the tank. /obj/vehicle/ridden/atv/Initialize() . = ..() From a243ac5a9798191015dc27265373dbfe01248b81 Mon Sep 17 00:00:00 2001 From: lolman360 Date: Thu, 18 Jun 2020 09:52:58 +1000 Subject: [PATCH 2/2] Update other_reagents.dm --- code/modules/reagents/chemistry/reagents/other_reagents.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 4a19d03f..6609b90d 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1743,3 +1743,8 @@ M.adjustToxLoss(0.5*REM, 0) . = 1 ..() + +/datum/reagent/fuel/biodiesel + name = "biodiesel" + id = "biodiesel" + description = "A measure of liquid biodiesel, good for running vehicles such as ATVs."