Add trade
This commit is contained in:
@@ -140,4 +140,5 @@ class Costs():
|
||||
Units.ARCHER: (0, 25, 45, 0),
|
||||
Units.MONK: (0, 0, 100, 0),
|
||||
Units.FISHINGSHIP: (0, 75, 0, 0),
|
||||
Units.TRADECOG: (0, 100, 50, 0),
|
||||
}
|
||||
|
||||
@@ -271,4 +271,5 @@ class Dependencies():
|
||||
Units.ARCHER: [Ages.FEUDAL, Buildings.ARCHERYRANGE],
|
||||
Units.MONK: [Ages.CASTLE, Buildings.MONASTERY],
|
||||
Units.FISHINGSHIP: [Ages.FEUDAL, Buildings.DOCK],
|
||||
Units.TRADECOG: [Ages.FEUDAL, Buildings.DOCK],
|
||||
}
|
||||
|
||||
@@ -55,6 +55,16 @@ class Gameplay():
|
||||
(initial_task,)))
|
||||
|
||||
|
||||
def queue_trade_cog(self, action_time):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.queue_trade_cog, ()))
|
||||
|
||||
|
||||
def queue_trade_cart(self, action_time):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.queue_trade_cart, ()))
|
||||
|
||||
|
||||
def queue_unit(self, action_time, unit):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.queue_unit, (unit,)))
|
||||
|
||||
@@ -27,6 +27,8 @@ class Production():
|
||||
Units.ARCHER: Buildings.ARCHERYRANGE,
|
||||
Units.MONK: Buildings.MONASTERY,
|
||||
Units.FISHINGSHIP: Buildings.DOCK,
|
||||
Units.TRADECOG: Buildings.DOCK,
|
||||
Units.TRADECART: Buildings.MARKET,
|
||||
Research.TOWNWATCH: Buildings.TOWNCENTER,
|
||||
Research.TOWNPATROL: Buildings.TOWNCENTER,
|
||||
Research.TREADMILLCRANE: Buildings.UNIVERSITY,
|
||||
|
||||
@@ -137,4 +137,5 @@ class Times():
|
||||
Units.ARCHER: 35,
|
||||
Units.MONK: 51,
|
||||
Units.FISHINGSHIP: 40,
|
||||
Units.TRADECOG: 36,
|
||||
}
|
||||
|
||||
@@ -173,3 +173,4 @@ class Units(Enum):
|
||||
ARCHER = auto()
|
||||
MONK = auto()
|
||||
FISHINGSHIP = auto()
|
||||
TRADECOG = auto()
|
||||
|
||||
19
aoe/world.py
19
aoe/world.py
@@ -43,16 +43,11 @@ class World():
|
||||
# to farms with the highest capacity.
|
||||
# We keep track of only the closest upcoming farm deletion.
|
||||
|
||||
# TODO fishing ships
|
||||
# TODO relics
|
||||
# TODO trade carts
|
||||
# TODO fishtraps
|
||||
# TODO allow automation:
|
||||
# reseeding of farms
|
||||
# queuing of villagers
|
||||
# possibly other things
|
||||
# TODO gathering boars and hunting
|
||||
# spend villager time in exchange for adding gatherable resource
|
||||
# TODO food spoilage
|
||||
# TODO use market for buy/sell
|
||||
|
||||
|
||||
@@ -419,6 +414,10 @@ class World():
|
||||
if not initial_task:
|
||||
initial_task = Tasks.FISH_SHIP_IDLE
|
||||
self.villager_tasks[initial_task] += 1
|
||||
elif thing == Units.TRADECOG:
|
||||
self.villager_tasks[Tasks.TRADECOG] += 1
|
||||
elif thing == Units.TRADECART:
|
||||
self.villager_tasks[Tasks.TRADECART] += 1
|
||||
|
||||
|
||||
def _start_producing(self, thing, initial_task):
|
||||
@@ -455,6 +454,14 @@ class World():
|
||||
self._queue_thing(Units.FISHINGSHIP, initial_task)
|
||||
|
||||
|
||||
def queue_trade_cog(self):
|
||||
self._queue_thing(Units.TRADECOG)
|
||||
|
||||
|
||||
def queue_trade_cart(self):
|
||||
self._queue_thing(Units.TRADECART)
|
||||
|
||||
|
||||
def _handle_events(self):
|
||||
for func, args in self.events[self.current_time]:
|
||||
func(*args)
|
||||
|
||||
Reference in New Issue
Block a user