28 lines
566 B
Rust
28 lines
566 B
Rust
use crate::common_usings::*;
|
|
|
|
script!(FlinchEffect, "flinch_effect");
|
|
|
|
impl Script for FlinchEffect {
|
|
fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
fn get_name(&self) -> &'static str {
|
|
Self::get_const_name()
|
|
}
|
|
|
|
fn get_capabilities(&self) -> &[ScriptCapabilities] {
|
|
&[ScriptCapabilities::PreventMove]
|
|
}
|
|
|
|
fn prevent_move(&self, mv: ExecutingMove, prevent: &mut bool) -> PkmnResult<()> {
|
|
*prevent = true;
|
|
mv.user().remove_volatile(self)?;
|
|
Ok(())
|
|
}
|
|
|
|
fn as_any(&self) -> &dyn Any {
|
|
self
|
|
}
|
|
}
|