def seeds(self):
if self._state["seeds"] is None:
if (self._state["station"] and
- "seeds" in self._state["station"]["config"]):
- self._state["seeds"] = self._state["station"]["config"]["seeds"]
+ "seeds" in self._state["station"]["config"]):
+ self._state["seeds"] = (
+ self._state["station"]["config"]["seeds"])
else:
self._state["seeds"] = 0
return self._state["seeds"]
def get_spawn_positions(self):
return self._state["station"]["config"]["spawn positions"]
- def get_target(self):
+ @property
+ def turnip_target(self):
return self._state["station"]["config"]["turnip target"]
self._game_over_text = []
if gamestate.seeds == 0 and len(self._turnips) == 0:
self._draw_you_lose(gamestate)
- elif gamestate.harvested >= gamestate.get_target():
+ elif gamestate.harvested >= gamestate.turnip_target:
self._draw_you_win(gamestate)
def _draw_you_lose(self, gamestate):
def _update_infobar(self, gamestate):
line1 = ("Day %d: Goal: %d Turnips. Turnips harvested: %d" % (
- gamestate.days, gamestate.get_target(), gamestate.harvested))
+ gamestate.days, gamestate.turnip_target, gamestate.harvested))
line1_img = self._infobar_font.render(line1, True, (255, 255, 255))
line2 = ("Turnip Stocks: Seeds: %s. Planted: %d. Battery: %d/%d" % (
gamestate.seeds, len(self._turnips), self._battery.current,