1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-14 02:34:09 +02:00

New commands to easily clear fluid from ship's tanks

Changes:
- New commands: /clear_north_tanks and /clear_south_tanks that clear fluid from ship's tanks
This commit is contained in:
Piratux 2022-11-20 21:07:04 +02:00
parent 770c3c523b
commit 250beab7e3
5 changed files with 51 additions and 7 deletions

View File

@ -1,6 +1,6 @@
require 'utils.data_stages'
_LIFECYCLE = _STAGE.control -- Control stage
_DEBUG = true
_DEBUG = false
_DUMP_ENV = false
require 'utils.server'
@ -113,7 +113,7 @@ require 'utils.freeplay'
--require 'maps.chronosphere.main'
--![[Adventure as a crew of pirates]]--
require 'maps.pirates.main'
-- require 'maps.pirates.main'
--![[Launch rockets in increasingly harder getting worlds.]]--
--require 'maps.journey.main'

View File

@ -16,7 +16,7 @@ softmod_info_tips_1=Features of the game that are hard to work out alone
softmod_info_tips_2=• The captain can steer the boat from the crow's nest by placing 100 rail signals in one of the blue boxes.\n• Resources granted to the ship appear in the captain's cabin.\n• Charging a silo drains power from everything else on its network.\n• The quantity of ore available on an island is independent of the order in which you break rocks.\n• Passive pollution ramps up over time on each island.\n• The strength of attacks is proportional to the number of remaining nests. (The time-based rate of evolution is proportional to nests too, but destroying a nest will immediately jump evolution by most of the amount it 'would have' made had it survived.)\n• Lab productivity increases with each league.\n• item-on-ground entities on the deck are moved to the cabin when the boat moves, for performance reasons.\n• Commands: /ccolor gives you a fun color. /classinfo {classname} gives the description of the named class. To manage your class, use /take {classname} or /giveup.
softmod_info_updates_1=Significant recent changes
softmod_info_updates_2=v1.4.1\n• Cannon upgrade is now more expensive and appears less often.\n• Bugfixes.\n\nv1.4.0\n• New private runs: Protect your run by a password.\n• New island: Mysterious caves.\n• New technologies now available: Car and nuclear energy.\n• New way to unlock extra holds and power upgrades.\n• Various island related balance changes.\n\nv1.3.1-v1.3.5\n• Bugfixes.\n• Rebalancings, including: iron ore amounts buffed; kraken reward improved; final resource requirement increased; overall difficulty reduced.\n• Minor reordering of islands.\n• An officer will now be prioritised for the captain role if the captain disconnects.
softmod_info_updates_2=v1.4.2\n• Disabled 'disband crew' button.\n• Increased amount of fish caught by all fishing classes.\n• Enabled concrete tech.\n• Fixed Mysterious caves island always having the same layout.\n• Fixed issue where power could get disconnected between deck and hold.\n• Added /clear_north_tanks and /clear_south_tanks commands to clear fluid from ship's storage tanks.\n\nv1.4.1\n• Cannon upgrade is now more expensive and appears less often.\n• Bugfixes.\n\nv1.4.0\n• New private runs: Protect your run by a password.\n• New island: Mysterious caves.\n• New technologies now available: Car and nuclear energy.\n• New way to unlock extra holds and power upgrades.\n• Various island related balance changes.
softmod_info_credits_1=Credits
softmod_info_credits_2=Pirate Ship designed and coded by thesixthroc. Updates from Piratux. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Some island structure blueprints contributed by Mattisso.\n\nCome chat with us: https://getcomfy.eu/discord\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
@ -605,4 +605,6 @@ cmd_explain_plank={player} is a captain command to remove a player by making the
cmd_explain_officer={player} is a captain command to make a player into an officer, or remove them as one.
cmd_explain_undock=is a captain command to undock the ship.
cmd_explain_tax=is a captain command to take a quarter of all coins, plus other game-critical items from the crew, into your inventory.
cmd_explain_clear_north_tanks=Clear ship's north fluid storage tanks on deck and all holds.
cmd_explain_clear_south_tanks=Clear ship's south fluid storage tanks on deck and all holds.
cmd_explain_dev=is a dev command.

View File

@ -158,7 +158,6 @@ function(cmd)
--local param = tostring(cmd.parameter)
if check_admin(cmd) then
--local player = game.players[cmd.player_index]
local memory = Memory.get_crew_memory()
Crew.summon_crew()
if memory.boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL then
Progression.at_sea_begin_to_set_sail()
@ -417,7 +416,6 @@ function(cmd)
--local param = tostring(cmd.parameter)
if check_captain_or_admin(cmd) then
local player = game.players[cmd.player_index]
local memory = Memory.get_crew_memory()
if memory.boat.state == Boats.enum_state.DOCKED then
Progression.undock_from_dock(true)
elseif memory.boat.state == Boats.enum_state.LANDED then
@ -438,11 +436,38 @@ function(cmd)
--local param = tostring(cmd.parameter)
if check_captain(cmd) then
--local player = game.players[cmd.player_index]
local memory = Memory.get_crew_memory()
Roles.captain_tax(memory.playerindex_captain)
end --@TODO: else
end)
commands.add_command(
'clear_north_tanks',
{'pirates.cmd_explain_clear_north_tanks'},
function(cmd)
cmd_set_memory(cmd)
local memory = Memory.get_crew_memory()
if not Common.is_id_valid(memory.id) then return end
if check_captain(cmd) then
Boats.clear_fluid_from_ship_tanks(1)
end --@TODO: else
end)
commands.add_command(
'clear_south_tanks',
{'pirates.cmd_explain_clear_south_tanks'},
function(cmd)
cmd_set_memory(cmd)
local memory = Memory.get_crew_memory()
if not Common.is_id_valid(memory.id) then return end
if check_captain(cmd) then
Boats.clear_fluid_from_ship_tanks(2)
end --@TODO: else
end)
commands.add_command(
'dump_highscores',
{'pirates.cmd_explain_dev'},

View File

@ -7,7 +7,7 @@ local _inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.4.1' --major.minor.patch versioning, to match factorio mod portal
Public.version_string = '1.4.2' --major.minor.patch versioning, to match factorio mod portal
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true

View File

@ -1434,4 +1434,21 @@ function Public.is_boat_at_sea()
end
end
function Public.clear_fluid_from_ship_tanks(idx)
local memory = Memory.get_crew_memory()
local boat = memory.boat
if boat.upstairs_fluid_storages and boat.upstairs_fluid_storages[idx] and boat.upstairs_fluid_storages[idx].valid then
boat.upstairs_fluid_storages[idx].clear_fluid_inside()
end
if boat.downstairs_fluid_storages then
for j = 1, memory.hold_surface_count do
if boat.downstairs_fluid_storages[j] and boat.downstairs_fluid_storages[j][idx] and boat.downstairs_fluid_storages[j][idx].valid then
boat.downstairs_fluid_storages[j][idx].clear_fluid_inside()
end
end
end
end
return Public