41 lines
872 B
Rust
Executable File
41 lines
872 B
Rust
Executable File
use core::any::Any;
|
|
use pkmn_lib_interface::app_interface::{ExecutingMove, Pokemon};
|
|
use pkmn_lib_interface::handling::{Script, ScriptCapabilities};
|
|
|
|
pub struct ForceEffectTriggerScript {}
|
|
|
|
impl ForceEffectTriggerScript {
|
|
pub const fn get_const_name() -> &'static str {
|
|
"force_effect_trigger"
|
|
}
|
|
}
|
|
|
|
impl Script for ForceEffectTriggerScript {
|
|
fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
fn get_name(&self) -> &'static str {
|
|
Self::get_const_name()
|
|
}
|
|
|
|
fn get_capabilities(&self) -> &[ScriptCapabilities] {
|
|
&[ScriptCapabilities::ChangeEffectChance]
|
|
}
|
|
|
|
fn change_effect_chance(
|
|
&self,
|
|
_mv: ExecutingMove,
|
|
_target: Pokemon,
|
|
_hit: u8,
|
|
chance: &mut f32,
|
|
) {
|
|
// Set to 50_000% chance.
|
|
*chance = 50_000.0;
|
|
}
|
|
|
|
fn as_any(&self) -> &dyn Any {
|
|
self
|
|
}
|
|
}
|