Battle
A turn-based battle between a player's Voxelmon and a wild one, a trainer's or a guardian.
A handle to something in the game. Once that thing is gone, its calls fail with Gone. You get one from events, and creature.challenge(player).
Methods
| Method | Description |
|---|---|
fn player(&self) -> Result<Player>Player player() | The player battling. |
fn kind(&self) -> Result<BattleKind>BattleKind kind() | What they face. |
fn player_creature(&self) -> Result<Option<Creature>>Optional<Creature> playerCreature() | The player's Voxelmon in the battle now. |
fn opponents(&self) -> Result<Vec<Creature>>List<Creature> opponents() | What they face. |
fn turn(&self) -> Result<i64>long turn() | The turn's number. |
fn end(&self, result: BattleResult) -> Result<()>void end(BattleResult result) | Ends it now with a result. |
TurnAction
What one side did in a turn.
Plain data, copied between the server and the plugin.
| Field | Description |
|---|---|
creature: CreatureCreature creature() | Who acted. |
r#move: Option<Move>Optional<Move> move() | The move used, if one. |
damage: i64long damage() | Health it took. |
BattleKind
What a battle is against.
One of a fixed set of values.
| Value | Meaning |
|---|---|
BattleKind::WildBattleKind.WILD | A wild Voxelmon. |
BattleKind::TrainerBattleKind.TRAINER | A trainer. |
BattleKind::BossBattleKind.BOSS | A guardian or Voxelord. |
BattleResult
How a battle ended.
One of a fixed set of values.
| Value | Meaning |
|---|---|
BattleResult::WonBattleResult.WON | The player won. |
BattleResult::LostBattleResult.LOST | The player lost. |
BattleResult::FledBattleResult.FLED | The player fled. |
BattleResult::CaughtBattleResult.CAUGHT | The player caught it. |
BattleResult::CancelledBattleResult.CANCELLED | Ended by the server or a plugin. |
Events
Related events: BattleStarting, BattleStarted, BattleTurn, BattleEnded.