More documentation for script hooks, reworks stat changes to only be changeable through a function that allows for script hooks, and events.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-06-27 18:26:27 +02:00
parent 1c9edd4d9c
commit cf4d74d898
5 changed files with 119 additions and 9 deletions

View File

@@ -3,8 +3,8 @@ use std::fmt::{Debug, Formatter};
use crate::dynamic_data::DamageSource;
use crate::dynamic_data::ExecutingMove;
use crate::dynamic_data::Pokemon;
use crate::static_data::Form;
use crate::static_data::Species;
use crate::static_data::{Form, Statistic};
/// The event hook is used to store external functions that listen to events.
///
@@ -108,4 +108,15 @@ pub enum Event<'own, 'battle, 'library> {
},
/// The turn is finished running, waiting for new input.
EndTurn,
/// A pokemon had its stat boost changed
StatBoostChange {
/// The pokemon that had its stat boosts changed.
user: &'own Pokemon<'battle, 'library>,
/// The statistic that changed.
stat: Statistic,
/// The value of the stat before the change.
old_value: i8,
/// The value of the stat after the change.
new_value: i8,
},
}