- Owner can pause, change owner, change score, change radius, create planets, give spaceships
- Create artifacts
- Functionality for calling library of depositing/activating/deactivating artifacts
- Gives a player 5 spaceships on their home planet (can only be called once)
- This is the first (and currently only) method of spawning ships into the game
- checks planet is in capture zone
- Can only invade planets you own
- Planets can only be captured once
- Can only capture a planet you have already invaded
- Cooldown between invasion and capture
- There are a certain number of capture zones per 5000 radius
- These are proceduraly generated
- Entrypoint for various aspects of actions in the game
- refresh planet, reveal location (and check proof), initialize player, upgrade planet, transfer planet, buy hat, withdraw silver
- getters for states of the game
- Create lobby
- entrypoint for moving planets
- Handles various aspects of a move
- calls _createArrival
- Home planets don't have penalty if a ship leaves
- Otherwise, reduce planet stats depending on ship type
- Cannot abandon a planet with incoming voyages
- When abandoning:
- Always send full energy and silver
- Receive a range / speed boost
- Transfer ownership to 0 address
- Place double the default amount of space pirates
- Subtract space junk from player total
- Various whitelist functionality
- A planet can only have 1 artifact activated at a time
- Checks that an artifact is valid to be found at planet
- Generates the artifact based on the random seed inputs
- Adds points to the users score
- Artifacts can only be activated every certain amount of time since deactivation (dependent upon type)
- Can only deposit on trading posts
- Planet level must be higher than artifact rarity
- Cannot deposit spaceships
- Max 5 artifacts
- Must prospect a planet before finding an artifact on it
- Starts a cooldown until finding can be done
- Checks public inputs into the snark circuit
- Radius increases as more players join
- Details the stats of what effects artifacts have on a planet
- Check the arrivals from owner
- Check the arrivals from others
- Each of the above numbers can be at max 5
- Create a default planet based on its location, level, planet type and space type
Functions to update aspects of a planet such as:
- Silver
- Population
- If the player sending ships owns the planet, then pop is increased
- Else, checks if the planet can defend against the invading ships. If not, the ship owner now owns the planet
- Can only reveal a location every x seconds
Diamond standard storage
- Customized version of DiamondInit.sol
- Initializes the state of the system such as planet defaults
- Various structs used in the game to store data (planets, players, artifacts)
- Pairing check