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

No more infinite fish at sea

Changes:
- There is now a fixed amount of fish you can catch at sea, to prevent dull strategy being: stay long amount at sea and try to catch "infinite" amount of fish.
- Gourmet doesn't generate ore at sea now. This is also to discourage similar strategy: wait long intervals at sea to efficiently use fish for ore.
This commit is contained in:
Piratux 2023-01-11 22:15:55 +02:00
parent b8c8d4e1b0
commit 72178fafa9
5 changed files with 58 additions and 33 deletions

@ -232,7 +232,7 @@ class_deckhand=Deckhand
class_deckhand_explanation_advanced=They move __1__% times faster and generate ore (+__2__ every __3__ seconds) for the cabin whilst onboard above deck. No ore is generated while at sea.
class_fisherman=Fisherman
# class_fisherman_explanation=They fish at greater distance.
class_fisherman_explanation_advanced=They fish (as well as reach objects as side effect) at greater distance (__1__ extra tile range), and catch more (+__2__ fish).
class_fisherman_explanation_advanced=They fish at greater distance (__1__ extra tile range), and catch more (+__2__ fish).
class_scout=Scout
# class_scout_explanation=They are faster, but frail and deal less damage.
class_scout_explanation_advanced=They move __1__% times faster, but receive __2__% more damage and deal __3__% less damage.
@ -265,7 +265,7 @@ class_chief_excavator=Chief Excavator
class_chief_excavator_explanation_advanced=They find many more resources when handmining.
class_hatamoto=Hatamoto
# class_hatamoto_explanation=They are very tough, and *with no weapon equipped* fight well by melee, but poorly otherwise.
class_hatamoto_explanation_advanced=They receive __1__% less damage, and with no weapon equipped do extra __2__ damage in melee (scales with 'physical projectile damage' research bonuses), but deal __3__% less damage otherwise.\nIf the damage dealt in melee is an overkill, the remaining damage splashes onto nearby enemies.
class_hatamoto_explanation_advanced=They receive __1__% less damage, and with no weapon equipped do extra __2__ damage in melee (scales with 'physical projectile damage' research bonuses), but deal __3__% less damage otherwise.\n\nIf the damage dealt in melee is an overkill, the remaining damage splashes onto nearby enemies.
class_iron_leg=Iron Leg
# class_iron_leg_explanation=They are very resistant to damage when carrying 3000 iron ore.
class_iron_leg_explanation_advanced=They receive __1__% less damage when carrying at least __2__ iron ore.
@ -274,21 +274,21 @@ class_quartermaster=Quartermaster
class_quartermaster_explanation_advanced=Nearby crewmates (at __1__ tile radius) get +__2__% physical attack bonus and generate ore for the cabin (ore amount depends on nearby crewmate count).
class_dredger=Dredger
# class_dredger_explanation=They find surprising items when they fish.
class_dredger_explanation_advanced=They inherit the previous class bonuses and find surprising items when they fish.
class_dredger_explanation_advanced=They can grab fish from an insane distance (__1__ extra tile range), and catch more (+__2__ fish). In addition, they find surprising items when fishing.
class_smoldering=Smoldering
# class_smoldering_explanation=They periodically convert wood into coal, if they have less than 50 coal.
class_smoldering_explanation_advanced=They periodically convert wood into coal, if they have less than 50 coal.
class_gourmet=Gourmet
# class_gourmet_explanation=They generate ore for the cabin by eating fish in fancy locations.
class_gourmet_explanation_advanced=They generate ore for the cabin by eating fish in fancy locations.
class_gourmet_explanation_advanced=They generate ore for the cabin by eating fish in fancy locations. Does not generate ore while at sea.
class_chef=Chef
class_chef_explanation_advanced=They cook meat of defeated enemies and turn it into something tasty.
class_rock_eater=Rock Eater
class_rock_eater_explanation_advanced=When eating fish, if they have stone furnaces in their inventory, they will eat those instead.\nIn addition, they receive __1__% less damage.
class_rock_eater_explanation_advanced=When eating fish, if they have stone furnaces in their inventory, they will eat those instead.\n\nIn addition, they receive __1__% less damage.
class_soldier=Soldier
class_soldier_explanation_advanced=When eating fish, they have __1__% chance to summon defender to protect them.
class_veteran=Veteran
class_veteran_explanation_advanced=When eating fish, they have __1__% chance to summon destroyer to protect them.\nIn addition, they have __2__% chance to slow the enemy that hits them.
class_veteran_explanation_advanced=When eating fish, they have __1__% chance to summon destroyer to protect them.\n\nIn addition, they have __2__% chance to slow the enemy that hits them.
class_explanation=__1__: __2__
@ -306,6 +306,8 @@ class_upgrade=__1__ upgraded their class from __2__ to __3__ ([font=scenario-mes
# class_revoke=__1__ revoked __2__ from __3__.
class_purchase_error_prerequisite_class=Class purchase error: You need to be a __1__ to buy this.
cant_catch_fish=Looks like the fish has learned how to avoid being caught in these waters. Perhaps it would be a good idea to try somewhere else?
roles_confirm_captain=__1__ accepted the role of captain.
roles_confirm_captain_error_1=Command error: You're not the captain.
roles_confirm_captain_error_2=Command error: You're not temporary, so you don't need to accept.

@ -819,34 +819,49 @@ local function event_on_player_mined_entity(event)
elseif entity.type == 'fish' then
if not event.buffer then return end
local fish_amount = Balance.base_caught_fish_amount
local to_give = {}
if class == Classes.enum.FISHERMAN then
fish_amount = fish_amount + Balance.fisherman_fish_bonus
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
elseif class == Classes.enum.MASTER_ANGLER then
fish_amount = fish_amount + Balance.master_angler_fish_bonus
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
to_give[#to_give + 1] = {name = 'coin', count = Balance.master_angler_coin_bonus}
elseif class == Classes.enum.DREDGER then
fish_amount = fish_amount + Balance.dredger_fish_bonus
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
to_give[#to_give + 1] = Loot.dredger_loot()[1]
else
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
-- Prevent dull strategy being staying in sea for long time catching as many fish as possible (as there is kind of infinite amount there)
local boat_is_at_sea = Boats.is_boat_at_sea()
local fish_caught_while_at_sea = -1
if boat_is_at_sea and memory.boat and memory.boat.fish_caught_while_at_sea then
fish_caught_while_at_sea = memory.boat.fish_caught_while_at_sea
end
Common.give(player, to_give, entity.position)
if destination and destination.dynamic_data and destination.dynamic_data.quest_type and (not destination.dynamic_data.quest_complete) then
if destination.dynamic_data.quest_type == Quest.enum.FISH then
destination.dynamic_data.quest_progress = destination.dynamic_data.quest_progress + fish_amount
Quest.try_resolve_quest()
if (not boat_is_at_sea) or (boat_is_at_sea and fish_caught_while_at_sea < Balance.maximum_fish_allowed_to_catch_at_sea) then
if fish_caught_while_at_sea ~= -1 then
memory.boat.fish_caught_while_at_sea = memory.boat.fish_caught_while_at_sea + 1
end
local fish_amount = Balance.base_caught_fish_amount
local to_give = {}
if class == Classes.enum.FISHERMAN then
fish_amount = fish_amount + Balance.fisherman_fish_bonus
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
elseif class == Classes.enum.MASTER_ANGLER then
fish_amount = fish_amount + Balance.master_angler_fish_bonus
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
to_give[#to_give + 1] = {name = 'coin', count = Balance.master_angler_coin_bonus}
elseif class == Classes.enum.DREDGER then
fish_amount = fish_amount + Balance.dredger_fish_bonus
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
to_give[#to_give + 1] = Loot.dredger_loot()[1]
else
to_give[#to_give + 1] = {name = 'raw-fish', count = fish_amount}
end
Common.give(player, to_give, entity.position)
if destination and destination.dynamic_data and destination.dynamic_data.quest_type and (not destination.dynamic_data.quest_complete) then
if destination.dynamic_data.quest_type == Quest.enum.FISH then
destination.dynamic_data.quest_progress = destination.dynamic_data.quest_progress + fish_amount
Quest.try_resolve_quest()
end
end
else
Common.notify_player_error(player, {'pirates.cant_catch_fish'})
end
event.buffer.clear()
@ -1188,7 +1203,7 @@ local function event_on_entity_died(event)
end
if event.entity and event.entity.valid and event.entity.force and event.entity.force.name == memory.force_name then
if memory.boat and memory.boat.cannonscount and entity.name and entity.name == 'artillery-turret' then
if memory.boat and memory.boat.cannonscount and entity.name == 'artillery-turret' then
memory.boat.cannonscount = memory.boat.cannonscount - 1
-- if memory.boat.cannonscount <= 0 then
-- Crew.try_lose()

@ -78,6 +78,8 @@ Public.soldier_defender_summon_chance = 0.2
Public.veteran_destroyer_summon_chance = 0.2
Public.veteran_on_hit_slow_chance = 0.1
Public.maximum_fish_allowed_to_catch_at_sea = 30
function Public.starting_boatEEIpower_production_MW()
-- return 3 * Math.sloped(Common.capacity_scale(), 1/2) / 2 --/2 as we have 2

@ -613,6 +613,7 @@ function Public.go_from_currentdestination_to_sea()
memory.boat.speed = 0
memory.boat.position = new_boatposition
memory.boat.surface_name = seaname
memory.boat.fish_caught_while_at_sea = 0 -- how many times a fish was caught, rather than amount of fish caught in total
memory.enemy_force.reset_evolution()

@ -9,6 +9,7 @@ local Common = require 'maps.pirates.common'
local Utils = require 'maps.pirates.utils_local'
local CoreData = require 'maps.pirates.coredata'
local SurfacesCommon = require 'maps.pirates.surfaces.common'
local Boats = require 'maps.pirates.structures.boats.boats'
-- local Server = require 'utils.server'
local Public = {}
@ -110,6 +111,10 @@ function Public.explanation(class, add_is_class_obtainable)
local extra_fish = Balance.master_angler_fish_bonus
local extra_coins = Balance.master_angler_coin_bonus
full_explanation = {'', {explanation, extra_range, extra_fish, extra_coins}}
elseif class == enum.DREDGER then
local extra_range = Balance.dredger_reach_bonus
local extra_fish = Balance.dredger_fish_bonus
full_explanation = {'', {explanation, extra_range, extra_fish}}
elseif class == enum.SCOUT then
local extra_speed = Public.percentage_points_difference_from_100_percent(Balance.scout_extra_speed)
local received_damage = Public.percentage_points_difference_from_100_percent(Balance.scout_damage_taken_multiplier)
@ -349,7 +354,7 @@ local function class_on_player_used_capsule(event)
local global_memory = Memory.get_global_memory()
global_memory.last_players_health[event.player_index] = player.character.health
if class == Public.enum.GOURMET then
if class == Public.enum.GOURMET and (not Boats.is_boat_at_sea()) then
local multiplier = 0
local surfacedata = SurfacesCommon.decode_surface_name(player.surface.name)
if surfacedata.type == SurfacesCommon.enum.CABIN then