Skip to main content

battler_data/abilities/
ability_data.rs

1use alloc::string::String;
2
3use hashbrown::HashSet;
4use serde::{
5    Deserialize,
6    Serialize,
7};
8
9use crate::AbilityFlag;
10
11/// Data about a particular ability.
12///
13/// Every Mon has one ability, which affects the battle in a wide variety of ways.
14#[derive(Debug, Clone, Serialize, Deserialize)]
15pub struct AbilityData {
16    /// Name of the ability.
17    pub name: String,
18    /// Ability flags.
19    pub flags: HashSet<AbilityFlag>,
20
21    /// Dynamic battle effects.
22    #[serde(default)]
23    pub effect: serde_json::Value,
24    /// Dynamic battle effects of the condition created by this ability.
25    #[serde(default)]
26    pub condition: serde_json::Value,
27}