NotQuiteParadise2

Controllers

class ChooseRoomController(game: Game, parent_scene: WorldScene)[source]

Bases: nqp.base_classes.controller.Controller

Choose next room functionality and data.

  • Modify game state in accordance with game rules

  • Do not draw anything

__init__(game: Game, parent_scene: WorldScene)[source]
begin_move_to_new_room()[source]

Move Units to a new room

reset()[source]
update(delta_time: float)[source]
class CombatController(game: Game, parent_scene: WorldScene)[source]

Bases: nqp.base_classes.controller.Controller

Combat game functionality and combat only data.

  • Modify game state in accordance with game rules

  • Do not draw anything

__init__(game: Game, parent_scene: WorldScene)[source]
begin_combat()[source]

Start active combat.

end_combat()[source]

End the combat

generate_combat()[source]

Generate a random combat

prepare_combat()[source]

Complete combat preparation steps.

reset()[source]
update(delta_time: float)[source]
class EventController(game: Game, parent_scene: WorldScene)[source]

Bases: nqp.base_classes.controller.Controller

Event game functionality and event-only data.

  • Modify game state in accordance with game rules

  • Do not draw anything

__init__(game: Game, parent_scene: WorldScene)[source]
get_event(event_id: str, remove_from_pool: bool)[source]

Get a specific event. remove_from_pool determines whether the event is removed from the list of possible events.

get_random_event() Dict[source]

Get a random event from those available. This event is then removed from the list of possible events.

get_result_image(result_key: str, result_value: str, result_target: str) Union[Image, Animation][source]

Get an image for the result key given.

load_event(event_id: str, remove_from_pool: bool = False)[source]

Load a specific event.

load_random_event()[source]
static parse_event_string(result: str) Tuple[str, str, str][source]

Break event string into component parts. Applicable for Conditions, Resources and Results. (or anything that has a syntax of key:value@target.

Returns a tuple of key, value, target.

prioritise_event(event_type: str)[source]

Move an event from the event_deck to the priority events.

reset()[source]
trigger_result()[source]

Trigger the result for the option at the select current_index.

Results are a list of key value target strings. “result_action : result_value @ target”

Example

[“Gold:10”,”Gold:10”] - would add 10 gold twice.

update(delta_time: float)[source]
class InnController(game: Game, parent_scene: WorldScene)[source]

Bases: nqp.base_classes.controller.Controller

Inn game functionality and inn-only data.

  • Modify game state in accordance with game rules

  • Do not draw anything

__init__(game: Game, parent_scene: WorldScene)[source]
delete_troupe()[source]

Delete the inn troupe.

generate_units()[source]

Generate units to sell. NOTE: currently hard coded.

recruit_unit(unit: Unit)[source]

Add the unit to the player’s Troupe and remove from the inn’s.

reset()[source]
update(delta_time: float)[source]
class TrainingController(game: Game, parent_scene: WorldScene)[source]

Bases: nqp.base_classes.controller.Controller

Training game functionality and training-only data.

  • Modify game state in accordance with game rules

  • Do not draw anything

__init__(game: Game, parent_scene: WorldScene)[source]
calculate_upgrade_cost(tier: int)[source]

Calculate the cost of the upgrade based on the tier of the upgrade.

generate_upgrades()[source]

Generate upgrades to sell. NOTE: currently hard coded.

reset()[source]
update(delta_time: float)[source]
upgrade_unit(unit: Unit)[source]

Upgrade the unit.