1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-11 13:39:14 +02:00
This commit is contained in:
danielmartin0 2022-06-01 20:51:35 +01:00
parent 88d4da397e
commit de538a2221
2 changed files with 18 additions and 14 deletions

View File

@ -1168,7 +1168,8 @@ local function on_gui_click(event)
Memory.set_working_id(crew_id)
local memory = Memory.get_crew_memory()
if event.element.name and event.element.name == 'etaframe_piratebutton' and (memory.boat.state == Boats.enum_state.DOCKED or memory.boat.state == Boats.enum_state.LANDED) then
if event.element.name and event.element.name == 'etaframe_piratebutton' then
if (memory.boat.state == Boats.enum_state.DOCKED or memory.boat.state == Boats.enum_state.LANDED) then
if Roles.player_privilege_level(player) >= Roles.privilege_levels.CAPTAIN then
if (not memory.undock_shortcut_are_you_sure_data) then memory.undock_shortcut_are_you_sure_data = {} end
if memory.undock_shortcut_are_you_sure_data[player.index] and memory.undock_shortcut_are_you_sure_data[player.index] > game.tick - 60 * 4 then
@ -1181,10 +1182,12 @@ local function on_gui_click(event)
memory.undock_shortcut_are_you_sure_data[player.index] = game.tick
end
end
elseif memory.boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL then
if Roles.player_privilege_level(player) >= Roles.privilege_levels.CAPTAIN then
Progression.at_sea_begin_to_set_sail()
end
end
elseif string.sub(event.element.name, -13, -1) and string.sub(event.element.name, -13, -1) == '_piratebutton' then
local name = string.sub(event.element.name, 1, -14)

View File

@ -547,6 +547,7 @@ local parrot_set_sail_advice =
local memory = Memory.get_crew_memory()
if not (memory.id and memory.id > 0) then return end --check if crew disbanded
if memory.game_lost then return end
if memory.boat and memory.boat.state and memory.boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL then
Common.parrot_speak(memory.force, {'pirates.parrot_set_sail_advice'})