Gen7ScriptsRs/gen_7_scripts/src/moves/acrobatics.rs

41 lines
871 B
Rust

use pkmn_lib_interface::app_interface::{ExecutingMove, Pokemon};
use pkmn_lib_interface::handling::{Script, ScriptCapabilities};
pub struct Acrobatics {}
impl Acrobatics {
pub const fn get_const_name() -> &'static str {
"acrobatics"
}
}
impl Script for Acrobatics {
fn new() -> Self {
Self {}
}
fn get_name() -> &'static str {
Self::get_const_name()
}
fn get_capabilities(&self) -> &[ScriptCapabilities] {
&[ScriptCapabilities::ChangeBasePower]
}
fn change_base_power(
&self,
mv: ExecutingMove,
_target: Pokemon,
_hit: u8,
base_power: &mut u8,
) {
if mv.user().held_item().is_none() {
if *base_power >= 128_u8 {
*base_power = 255
} else {
*base_power *= 2;
}
}
}
}