game_objects.move:
upgrade_space_fighter
and upgrade_pilot
functions consume gold and upgrade the attributes of the fighter and pilot respectively.
distribute_rewards
calculates an additional bonus if a pilot is linked to a fighter and adds it to the player's total.
generate_monster
dynamically adjusts the monster's health and damage based on the current level.
generate_space_pirate
returns a pirate with stronger stats if the level is a multiple of 20.
MintPilotEvent, UpgradeEvent, RewardEvent, and PirateAppearanceEvent provide visibility into the game's progress.
Holds each player's score and address.
Contains the entire collection of leaderboard entries.
update_leaderboard
: Searches for existing player scores or creates new entries if needed.
get_ranking
: Returns a sorted vector of leaderboard entries in descending order of score.
LeaderboardUpdateEvent: Indicates when the leaderboard is updated.
The combat and resource rules focus on their specific concerns and avoid cluttering other files. The event modules provide standardized event notifications for various game mechanics.
The game tests verify the correctness of core gameplay logic like upgrades and rewards. The rule tests ensure that policies and calculations align with expected behavior.