Package horizons :: Package scenario :: Module conditions
[hide private]
[frames] | no frames]

Module conditions

source code

Classes [hide private]
  ConditionsRegistry
Class that holds all available conditions.
Functions [hide private]
 
settlements_num_greater(session, limit)
Returns whether the number of player settlements is greater than *limit*.
source code
 
settler_level_greater(session, limit)
Returns whether the highest tier reached in any player settlement is greater than *limit*.
source code
 
player_gold_greater(session, limit)
Returns whether the player has more gold than *limit*.
source code
 
player_gold_less(session, limit)
Returns whether the player has less gold than *limit*.
source code
 
settlement_balance_greater(session, limit)
Returns whether the balance of at least one player settlement is higher than *limit*.
source code
 
player_balance_greater(session, limit)
Returns whether the cumulative balance of all player settlements is higher than *limit*.
source code
 
settlement_inhabitants_greater(session, limit)
Returns whether at least one player settlement has more than *limit* inhabitants.
source code
 
player_inhabitants_greater(session, limit)
Returns whether all player settlements combined have more than *limit* inhabitants.
source code
 
building_num_of_type_greater(session, building_class, limit)
Returns whether any player settlement has more than *limit* buildings of type *building_class*.
source code
 
player_res_stored_greater(session, resource, limit)
Returns whether all player settlements combined have more than *limit* of *resource* in their inventories.
source code
 
player_res_stored_less(session, resource, limit)
Returns whether all player settlements combined have less than *limit* of *resource* in their inventories.
source code
 
settlement_res_stored_greater(session, resource, limit)
Returns whether at least one player settlement has more than *limit* of *resource* in its inventory.
source code
 
player_total_earnings_greater(session, limit)
Returns whether the player has earned more than *limit* money with trading in all settlements combined.
source code
 
settlement_produced_res_greater(session, resource, limit)
Returns whether more than *limit* resource have been produced in any player settlement.
source code
 
player_produced_res_greater(session, resource, limit)
Returns whether more than *limit* of the resource *resource* have been produced in all player settlements combined.
source code
 
buildings_connected_to_warehouse_gt(session, building_class, limit)
Checks whether more than *limit* of *building_class* type buildings are connected to a warehouse or storage.
source code
 
buildings_connected_to_warehouse_lt(session, building_class, limit)
Checks whether less than *limit* of *building_class* type buildings are connected to a warehouse or storage.
source code
 
buildings_connected_to_building_gt(session, building_class, class2, limit)
Checks whether more than *limit* of *building_class* type buildings are connected to any building of type *class2*.
source code
 
buildings_connected_to_building_lt(session, building_class, class2, limit)
Checks whether less than *limit* of *building_class* type buildings are connected to any building of type *class2*.
source code
 
building_in_range(session, building_class1, building_class2)
Checks whether there is a building_class2 in range of a building_class1.
source code
 
time_passed(session, seconds)
Returns whether at least *seconds* seconds have passed since the game started.
source code
 
game_started(session)
Always return True.
source code
 
var_eq(session, variable, value)
Returns whether *variable* has a value equal to *value*.
source code
 
var_gt(session, variable, value)
Returns whether *variable* has a value greater than *value*.
source code
 
var_lt(session, variable, value)
Returns whether *variable* has a value less than *value*.
source code
 
_get_player_settlements(session)
Helper generator, returns settlements of local player.
source code
 
_get_scenario_vars(session) source code
 
_building_connected_to_any_of(session, building_class, *classes)
Returns the exact amount of buildings of type *building_class* that are connected to any building of a class in the building type list *classes*.
source code
 
player_number_of_ships_gt(session, player_id, limit)
Returns whether the number of ships owned by the player *player_id* is greater than *limit*.
source code
 
player_number_of_ships_lt(session, player_id, limit)
Returns whether the number of ships owned by the player *player_id* is less than *limit*.
source code
 
_building_connected_to_all_of(session, building_class, *classes)
Returns the exact amount of buildings of type *building_class* that are connected to any building of each class in *classes*.
source code
 
_building_in_range_of(session, building_class, *classes)
Returns whether there is any building of type *building_class* in range of any building of a class in the building type list *classes*.
source code
Variables [hide private]
  CONDITIONS = ConditionsRegistry()
  register = CONDITIONS.register
Function Details [hide private]

settlements_num_greater(session, limit)

source code 

Returns whether the number of player settlements is greater than *limit*.

Decorators:
  • @register()

settler_level_greater(session, limit)

source code 

Returns whether the highest tier reached in any player settlement is greater than *limit*.

Decorators:
  • @register()

player_gold_greater(session, limit)

source code 

Returns whether the player has more gold than *limit*.

Decorators:
  • @register(periodically= True)

player_gold_less(session, limit)

source code 

Returns whether the player has less gold than *limit*.

Decorators:
  • @register(periodically= True)

settlement_balance_greater(session, limit)

source code 

Returns whether the balance of at least one player settlement is higher than *limit*.

Decorators:
  • @register(periodically= True)

player_balance_greater(session, limit)

source code 

Returns whether the cumulative balance of all player settlements is higher than *limit*.

Decorators:
  • @register(periodically= True)

settlement_inhabitants_greater(session, limit)

source code 

Returns whether at least one player settlement has more than *limit* inhabitants.

Decorators:
  • @register(periodically= True)

player_inhabitants_greater(session, limit)

source code 

Returns whether all player settlements combined have more than *limit* inhabitants.

Decorators:
  • @register(periodically= True)

building_num_of_type_greater(session, building_class, limit)

source code 

Returns whether any player settlement has more than *limit* buildings of type *building_class*.

Decorators:
  • @register()

player_res_stored_greater(session, resource, limit)

source code 

Returns whether all player settlements combined have more than *limit* of *resource* in their inventories.

Decorators:
  • @register(periodically= True)

player_res_stored_less(session, resource, limit)

source code 

Returns whether all player settlements combined have less than *limit* of *resource* in their inventories.

Decorators:
  • @register(periodically= True)

settlement_res_stored_greater(session, resource, limit)

source code 

Returns whether at least one player settlement has more than *limit* of *resource* in its inventory.

Decorators:
  • @register(periodically= True)

player_total_earnings_greater(session, limit)

source code 

Returns whether the player has earned more than *limit* money with trading in all settlements combined. Profit = sell_income - buy_expenses.

Decorators:
  • @register(periodically= True)

settlement_produced_res_greater(session, resource, limit)

source code 

Returns whether more than *limit* resource have been produced in any player settlement.

Decorators:
  • @register(periodically= True)

player_produced_res_greater(session, resource, limit)

source code 

Returns whether more than *limit* of the resource *resource* have been produced in all player settlements combined.

Decorators:
  • @register(periodically= True)

buildings_connected_to_warehouse_gt(session, building_class, limit)

source code 

Checks whether more than *limit* of *building_class* type buildings are connected to a warehouse or storage.

Decorators:
  • @register(periodically= True)

buildings_connected_to_warehouse_lt(session, building_class, limit)

source code 

Checks whether less than *limit* of *building_class* type buildings are connected to a warehouse or storage.

Decorators:
  • @register(periodically= True)

buildings_connected_to_building_gt(session, building_class, class2, limit)

source code 

Checks whether more than *limit* of *building_class* type buildings are connected to any building of type *class2*.

Decorators:
  • @register(periodically= True)

buildings_connected_to_building_lt(session, building_class, class2, limit)

source code 

Checks whether less than *limit* of *building_class* type buildings are connected to any building of type *class2*.

Decorators:
  • @register(periodically= True)

building_in_range(session, building_class1, building_class2)

source code 

Checks whether there is a building_class2 in range of a building_class1.

Decorators:
  • @register(periodically= True)

time_passed(session, seconds)

source code 

Returns whether at least *seconds* seconds have passed since the game started.

Decorators:
  • @register(periodically= True)

game_started(session)

source code 

Always return True. Used for one-off events

Decorators:
  • @register()

var_eq(session, variable, value)

source code 

Returns whether *variable* has a value equal to *value*. Returns False if variable was never set in the current session.

Decorators:
  • @register()

var_gt(session, variable, value)

source code 

Returns whether *variable* has a value greater than *value*. Returns False if variable was never set in the current session.

Decorators:
  • @register()

var_lt(session, variable, value)

source code 

Returns whether *variable* has a value less than *value*. Returns False if variable was never set in the current session.

Decorators:
  • @register()

_building_connected_to_any_of(session, building_class, *classes)

source code 

Returns the exact amount of buildings of type *building_class* that are connected to any building of a class in the building type list *classes*. Counts all player settlements.

player_number_of_ships_gt(session, player_id, limit)

source code 

Returns whether the number of ships owned by the player *player_id* is greater than *limit*.

Decorators:
  • @register(periodically= True)

player_number_of_ships_lt(session, player_id, limit)

source code 

Returns whether the number of ships owned by the player *player_id* is less than *limit*.

Decorators:
  • @register(periodically= True)

_building_connected_to_all_of(session, building_class, *classes)

source code 

Returns the exact amount of buildings of type *building_class* that are connected to any building of each class in *classes*. Counts all player settlements.

_building_in_range_of(session, building_class, *classes)

source code 

Returns whether there is any building of type *building_class* in range of any building of a class in the building type list *classes*. Counts all player settlements.