From caf456da6d7932218b3e8d7a9c130800fc007eb2 Mon Sep 17 00:00:00 2001 From: Mirag1993 <145050764+Mirag1993@users.noreply.github.com> Date: Thu, 16 May 2024 00:36:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B1=D0=B0=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D1=81=20=D0=B4=D0=B2=D0=B8=D0=B6=D0=BA=D0=BE=D0=B2=20(=D0=A2?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=BE=D0=B2=D1=8B=D0=B9)=20=D1=872?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Часть 2 ребаланса , изменена логика плазменных двигателей , теперь двигатель адекватно потребляет топливо и адекватно регулирует тягу. Исправлено отображение реальной скорости. Требуются дополнительные тесты и фиксы. --- code/game/machinery/shuttle/shuttle_engine.dm | 11 +++++++- .../machinery/shuttle/shuttle_engine_types.dm | 14 ++++++++++- .../overmap/ships/controlled_ship_datum.dm | 8 +++++- mod_celadon/fixes/README.md | 9 +++++++ tgui/packages/tgui/interfaces/HelmConsole.js | 25 +++++++++++++++---- 5 files changed, 59 insertions(+), 8 deletions(-) diff --git a/code/game/machinery/shuttle/shuttle_engine.dm b/code/game/machinery/shuttle/shuttle_engine.dm index c4fd424d4076..c6256355ca13 100644 --- a/code/game/machinery/shuttle/shuttle_engine.dm +++ b/code/game/machinery/shuttle/shuttle_engine.dm @@ -14,7 +14,10 @@ var/thrust = 0 ///Whether this engine is actively providing thrust to the ship var/thruster_active = FALSE - +// [CELADON-ADD] - CELADON FIXES + /// Определяем тип двигателя + var/engine_type = "generic" //# Добавлено новое свойство для типа двигателя +// [/CELADON-ADD] /** * Uses up a specified percentage of the fuel cost, and returns the amount of thrust if successful. * * percentage - The percentage of total thrust that should be used @@ -23,6 +26,12 @@ update_icon_state() return FALSE +// [CELADON-ADD] - CELADON FIXES +/obj/machinery/power/shuttle/engine/proc/plasma_thrust(percentage = 100, deltatime) + update_icon_state() + return FALSE +// [/CELADON-ADD] + /** * Returns how much "Fuel" is left. (For use with engine displays.) */ diff --git a/code/game/machinery/shuttle/shuttle_engine_types.dm b/code/game/machinery/shuttle/shuttle_engine_types.dm index 090486c4f4d5..738eaee4115b 100644 --- a/code/game/machinery/shuttle/shuttle_engine_types.dm +++ b/code/game/machinery/shuttle/shuttle_engine_types.dm @@ -29,7 +29,10 @@ if(heat_creation) heat_engine() var/to_use = fuel_use * (percentage / 100) * deltatime - return resolved_heater.consume_fuel(to_use, fuel_type) / to_use * thrust //This proc returns how much was actually burned, so let's use that and multiply it by the thrust to get all the thrust we CAN give. +// [CELADON-EDIT] - CELADON_FIXES +//return resolved_heater.consume_fuel(to_use, fuel_type) / to_use * thrust //This proc returns how much was actually burned, so let's use that and multiply it by the thrust to get all the thrust we CAN give. + return resolved_heater.consume_fuel(to_use, fuel_type) +// [/CELADON-EDIT] /obj/machinery/power/shuttle/engine/fueled/return_fuel() . = ..() @@ -96,6 +99,15 @@ fuel_use = 20 thrust = 17.5 // [/CELADON-EDIT] +// [CELADON-ADD] - CELADON_FIXES + engine_type = "plasma" // Явно указываем, что это плазменный двигатель + +/obj/machinery/power/shuttle/engine/fueled/plasma/plasma_thrust(percentage = 100, deltatime) + . = ..() // Вызов родительского метода, если он существует + var/obj/machinery/atmospherics/components/unary/shuttle/heater/resolved_heater = attached_heater?.resolve() + var/true_percentage = min(resolved_heater.return_gas() / fuel_use , percentage / 100) //Выбираем меньшее доступное значение , запрещаем летать на пустом баке + return thrust * true_percentage // Возвращаем тягу, умноженную на рассчитанный процент мощности +// [/CELADON-ADD] /obj/machinery/power/shuttle/engine/fueled/expulsion name = "expulsion thruster" diff --git a/code/modules/overmap/ships/controlled_ship_datum.dm b/code/modules/overmap/ships/controlled_ship_datum.dm index 8174a3e365f4..18137147f8b7 100644 --- a/code/modules/overmap/ships/controlled_ship_datum.dm +++ b/code/modules/overmap/ships/controlled_ship_datum.dm @@ -216,7 +216,13 @@ for(var/obj/machinery/power/shuttle/engine/real_engine as anything in shuttle_port.get_engines()) if(!real_engine.enabled) continue - thrust_used += real_engine.burn_engine(percentage, deltatime) +// [CELADON-EDIT] - CELADON FIXES +//thrust_used += real_engine.burn_engine(percentage, deltatime) + var/engine_thrust = real_engine.burn_engine(percentage, deltatime) + thrust_used += engine_thrust + if(real_engine.engine_type == "plasma") + thrust_used += real_engine.plasma_thrust(percentage, deltatime) +// [/CELADON-EDIT] thrust_used = thrust_used / (shuttle_port.turf_count * 100) est_thrust = thrust_used / percentage * 100 //cheeky way of rechecking the thrust, check it every time it's used diff --git a/mod_celadon/fixes/README.md b/mod_celadon/fixes/README.md index b206681f9364..02341e8f46f9 100644 --- a/mod_celadon/fixes/README.md +++ b/mod_celadon/fixes/README.md @@ -21,6 +21,7 @@ ID мода: CELADON_FIXES ### Описание мода Этот мод Фиксит различные вещи в коде, например крашеры. +