1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-03 13:12:11 +02:00

main tick reordering

This commit is contained in:
danielmartin0 2022-06-01 22:13:09 +01:00
parent 6b44d5a4fe
commit ab7fa21fea
2 changed files with 99 additions and 153 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'

View File

@ -144,99 +144,44 @@ local function crew_tick()
local destination = Common.current_destination()
local tick = game.tick
PiratesApiOnTick.boat_movement_tick(5) --arguments are tick intervals
-- PiratesApiOnTick.parrot_tick(5)
if tick % 10 == 0 then
PiratesApiOnTick.prevent_disembark(10)
PiratesApiOnTick.prevent_unbarreling_off_ship(10)
end
if memory.age and memory.overworldx and memory.overworldx > 0 then
memory.age = memory.age + 5
end
if memory.real_age then
memory.real_age = memory.real_age + 5
end
if tick % 60 == 0 then
PiratesApiOnTick.captain_warn_afk(60)
end
if tick % Common.loading_interval == 0 then
PiratesApiOnTick.loading_update(Common.loading_interval)
end
PiratesApiOnTick.boat_movement_tick(5) --arguments are tick intervals
-- PiratesApiOnTick.parrot_tick(5)
if tick % 5 == 0 then
PiratesApiOnTick.quest_progress_tick(5)
end
if tick % 5 == 0 then
PiratesApiOnTick.strobe_player_colors(5)
end
if tick % 10 == 0 then
PiratesApiOnTick.prevent_disembark(10)
PiratesApiOnTick.prevent_unbarreling_off_ship(10)
PiratesApiOnTick.shop_ratelimit_tick(10)
end
PiratesApiOnTick.pick_up_tick(10)
QuestStructures.tick_quest_structure_entry_price_check(10)
PiratesApiOnTick.update_boat_stored_resources(10)
if tick % 30 == 0 then
PiratesApiOnTick.silo_update(30)
end
if tick % 60 == 0 then
PiratesApiOnTick.ship_deplete_fuel(60)
end
if tick % 10 == 0 then
PiratesApiOnTick.pick_up_tick(10)
end
if tick % 60 == 0 then
if memory.boat and memory.boat.state == Structures.Boats.enum_state.ATSEA_SAILING then
PiratesApiOnTick.crowsnest_natural_move(120)
end
end
if tick % 60 == 15 or tick % 60 == 45 then
if memory.boat and memory.boat.state == Structures.Boats.enum_state.ATSEA_SAILING then
PiratesApiOnTick.overworld_check_collisions(120)
end
end
if tick % 60 == 30 then
if memory.boat and memory.boat.state == Structures.Boats.enum_state.ATSEA_SAILING then
PiratesApiOnTick.crowsnest_steer(120)
end
end
if tick % 60 == 0 then
PiratesApiOnTick.slower_boat_tick(60)
end
if tick % 10 == 0 then
PiratesApiOnTick.update_boat_stored_resources(10)
end
if tick % 10 == 0 then
QuestStructures.tick_quest_structure_entry_price_check(10)
end
if tick % 30 == 0 then
PiratesApiOnTick.buried_treasure_check(30)
end
ClassPiratesApiOnTick.update_character_properties(30)
ClassPiratesApiOnTick.class_update_auxiliary_data(30)
ClassPiratesApiOnTick.class_renderings(30)
if tick % 60 == 0 then
PiratesApiOnTick.captain_warn_afk(60)
PiratesApiOnTick.ship_deplete_fuel(60)
if memory.boat and memory.boat.state == Structures.Boats.enum_state.ATSEA_SAILING then
PiratesApiOnTick.crowsnest_natural_move(60)
end
PiratesApiOnTick.slower_boat_tick(60)
PiratesApiOnTick.raft_raids(60)
end
if tick % 60 == 0 then
PiratesApiOnTick.place_cached_structures(60)
end
if tick % 240 == 0 then
PiratesApiOnTick.check_all_spawners_dead(240)
end
if tick % 60 == 0 then
if destination.dynamic_data.timer then
destination.dynamic_data.timer = destination.dynamic_data.timer + 1
@ -272,58 +217,59 @@ local function crew_tick()
end
end
end
end
if tick % 120 == 0 then
Ai.Tick_actions(120)
if tick % 240 == 0 then
PiratesApiOnTick.check_all_spawners_dead(240)
if memory.max_players_recorded then
local count_now = #Common.crew_get_crew_members()
if count_now and count_now > memory.max_players_recorded then
memory.max_players_recorded = count_now
end
end
end
if tick % 240 == 0 then
PiratesApiOnTick.Kraken_Destroyed_Backup_check(240)
PiratesApiOnTick.LOS_tick(240)
end
end
if tick % 300 == 0 then
PiratesApiOnTick.periodic_free_resources(300)
end
if tick % 30 == 0 then
ClassPiratesApiOnTick.update_character_properties(30)
ClassPiratesApiOnTick.class_update_auxiliary_data(30)
ClassPiratesApiOnTick.class_renderings(30)
end
if tick % 120 == 0 then
Ai.Tick_actions(120)
end
if tick % 240 == 0 then
PiratesApiOnTick.LOS_tick(240)
end
if tick % 420 == 0 then
ClassPiratesApiOnTick.class_rewards_tick(420)
end
if tick % 300 == 0 then
PiratesApiOnTick.update_recentcrewmember_list(300)
end
if tick % 1800 == 0 then
PiratesApiOnTick.transfer_pollution(1800)
end
if tick % 3600 == 0 then
PiratesApiOnTick.prune_offline_characters_list(3600)
end
end
end
-- if tick % (60*60*60) == 0 then
-- Parrot.parrot_say_tip()
-- end
if tick % 420 == 0 then
ClassPiratesApiOnTick.class_rewards_tick(420)
end
end
end
end
if tick % 60 == 15 or tick % 60 == 45 then
if memory.boat and memory.boat.state == Structures.Boats.enum_state.ATSEA_SAILING then
PiratesApiOnTick.overworld_check_collisions(120)
end
end
if tick % 60 == 30 then
if memory.boat and memory.boat.state == Structures.Boats.enum_state.ATSEA_SAILING then
PiratesApiOnTick.crowsnest_steer(120)
end
end
if tick % Common.loading_interval == 0 then
PiratesApiOnTick.loading_update(Common.loading_interval)
end
if memory.crew_disband_tick then
if memory.crew_disband_tick < tick then