2023-01-28 12:59:54 +00:00
|
|
|
use crate::common_usings::*;
|
2022-08-28 13:50:12 +00:00
|
|
|
|
|
|
|
pub struct ForceEffectTriggerScript {}
|
|
|
|
|
|
|
|
impl ForceEffectTriggerScript {
|
|
|
|
pub const fn get_const_name() -> &'static str {
|
|
|
|
"force_effect_trigger"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Script for ForceEffectTriggerScript {
|
|
|
|
fn new() -> Self {
|
|
|
|
Self {}
|
|
|
|
}
|
|
|
|
|
2022-09-09 18:09:56 +00:00
|
|
|
fn get_name(&self) -> &'static str {
|
2022-08-28 13:50:12 +00:00
|
|
|
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;
|
|
|
|
}
|
2022-09-09 18:09:56 +00:00
|
|
|
|
|
|
|
fn as_any(&self) -> &dyn Any {
|
|
|
|
self
|
|
|
|
}
|
2022-08-28 13:50:12 +00:00
|
|
|
}
|