self.player = player
self.board_locations = board_locations
self.player_mode = state.get('player_mode', EXAMINE)
+ self.has_cheated = state.get('cheater', options.cheat_enabled)
@classmethod
def new_game(cls, deck,
return cls(state, player, board_locations)
def export(self):
- return {
+ data = {
'max_health': self.max_health,
'health': self.health,
'wins_required': self.wins_required,
'board_locations': self.export_board_locations(),
'player_mode': self.player_mode,
}
+ if self.has_cheated:
+ data['cheater'] = True
+ return data
@classmethod
def import_locations(cls, locations_definition):
from naja.constants import KEYS, PALETTE
from naja.events import QuitGameEvent
-from naja.options import options
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget, TextBoxWidget
def __init__(self, state):
super(WinScene, self).__init__(state)
self.add(TextWidget((50, 50), 'You won!', colour=PALETTE.WHITE))
- if options.cheat_enabled:
+ if self.state.gameboard.has_cheated:
self.add(TextWidget(
(50 + 64, 50), 'CHEATER!', colour=PALETTE.ORANGE))
self.add(TextBoxWidget(