Add fishing ships

This commit is contained in:
Nate Bowman
2026-11-06 19:22:15 -05:00
parent 5d2178cd9c
commit d5c0d928b6
8 changed files with 38 additions and 4 deletions

View File

@@ -139,4 +139,5 @@ class Costs():
Units.SKIRMISHER: (25, 35, 0, 0),
Units.ARCHER: (0, 25, 45, 0),
Units.MONK: (0, 0, 100, 0),
Units.FISHINGSHIP: (0, 75, 0, 0),
}

View File

@@ -270,4 +270,5 @@ class Dependencies():
Units.SKIRMISHER: [Ages.FEUDAL, Buildings.ARCHERYRANGE],
Units.ARCHER: [Ages.FEUDAL, Buildings.ARCHERYRANGE],
Units.MONK: [Ages.CASTLE, Buildings.MONASTERY],
Units.FISHINGSHIP: [Ages.FEUDAL, Buildings.DOCK],
}

View File

@@ -49,6 +49,12 @@ class Gameplay():
(initial_task,)))
def queue_fishing_ship(self, action_time, initial_task=Tasks.FISH_SHIP_DEEP):
self._check_time(action_time)
self.actions[action_time].append((self.world.queue_fishing_ship,
(initial_task,)))
def queue_unit(self, action_time, unit):
self._check_time(action_time)
self.actions[action_time].append((self.world.queue_unit, (unit,)))

View File

@@ -284,6 +284,7 @@ class Gather():
Tasks.IDLE,
Tasks.MONK_IDLE,
Tasks.MONK_GET_RELIC,
Tasks.FISH_SHIP_IDLE,
]:
continue
@@ -411,7 +412,8 @@ class Gather():
Buildings.MININGCAMP: {Tasks.GOLD: 4*800,
Tasks.STONE: 4*350},
Buildings.FARM: {Tasks.FARM: 175},
#Buildings.DOCK: {Tasks.WOOD: 100},
Buildings.DOCK: {Tasks.FISH_SHIP_SHORE: 100,
Tasks.FISH_SHIP_DEEP: 225*2},
Buildings.TOWNCENTER: {Tasks.WOOD: 2000,
Tasks.GOLD: 4*800,
Tasks.STONE: 4*350,
@@ -428,9 +430,9 @@ class Gather():
Tasks.BOAR: 0,
Tasks.HUNT: 0,
Tasks.FARM: 0,
Tasks.FISH_VILLAGER: 0.5,
Tasks.FISH_SHIP_SHORE: 0.5,
Tasks.FISH_SHIP_DEEP: 0,
Tasks.FISH_VILLAGER: 0,
Tasks.FISH_SHIP_SHORE: 0,
Tasks.FISH_SHIP_DEEP: 0.5,
Tasks.FISHTRAP: 0,
Tasks.WOOD: 0.85,
Tasks.GOLD: 0,

View File

@@ -26,6 +26,7 @@ class Production():
Units.SKIRMISHER: Buildings.ARCHERYRANGE,
Units.ARCHER: Buildings.ARCHERYRANGE,
Units.MONK: Buildings.MONASTERY,
Units.FISHINGSHIP: Buildings.DOCK,
Research.TOWNWATCH: Buildings.TOWNCENTER,
Research.TOWNPATROL: Buildings.TOWNCENTER,
Research.TREADMILLCRANE: Buildings.UNIVERSITY,

View File

@@ -136,4 +136,5 @@ class Times():
Units.SKIRMISHER: 22,
Units.ARCHER: 35,
Units.MONK: 51,
Units.FISHINGSHIP: 40,
}

View File

@@ -56,6 +56,7 @@ class Tasks(Enum):
LURE = auto()
FARM = auto()
FISH_VILLAGER = auto()
FISH_SHIP_IDLE = auto()
FISH_SHIP_SHORE = auto()
FISH_SHIP_DEEP = auto()
FISHTRAP = auto()
@@ -171,3 +172,4 @@ class Units(Enum):
SKIRMISHER = auto()
ARCHER = auto()
MONK = auto()
FISHINGSHIP = auto()

View File

@@ -161,10 +161,22 @@ class World():
Tasks.TRADECOG,
]
fishing_tasks = [
Tasks.FISH_SHIP_IDLE,
Tasks.FISH_SHIP_SHORE,
Tasks.FISH_SHIP_DEEP,
Tasks.FISHTRAP,
]
if new_task in non_assignable_tasks or \
previous_task in non_assignable_tasks:
raise IllegalVillagerMoveException
num_fishing_tasks = (int(new_task in non_assignable_tasks) +
int(previous_task in non_assignable_tasks))
if num_fishing_tasks == 1:
raise IllegalVillagerMoveException
if new_task:
self.gather.check_gather(self, new_task, count)
self.villager_tasks[new_task] += count
@@ -401,6 +413,10 @@ class World():
elif thing == Units.MONK:
self.villager_tasks[Tasks.MONK_IDLE] += 1
self._get_next_waiting_relic()
elif thing == Units.FISHINGSHIP:
if not initial_task:
initial_task = Tasks.FISH_SHIP_IDLE
self.villager_tasks[initial_task] += 1
def _start_producing(self, thing, initial_task):
@@ -433,6 +449,10 @@ class World():
self._queue_thing(Units.VILLAGER, initial_task)
def queue_fishing_ship(self, initial_task=Tasks.FISH_SHIP_DEEP):
self._queue_thing(Units.FISHINGSHIP, initial_task)
def _handle_events(self):
for func, args in self.events[self.current_time]:
func(*args)