41 lines
880 B
Rust
Executable File
41 lines
880 B
Rust
Executable File
use crate::script;
|
|
use core::any::Any;
|
|
use pkmn_lib_interface::app_interface::{ExecutingMove, Pokemon};
|
|
use pkmn_lib_interface::handling::{Script, ScriptCapabilities};
|
|
|
|
script!(Acrobatics, "acrobatics");
|
|
|
|
impl Script for Acrobatics {
|
|
fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
fn get_name(&self) -> &'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;
|
|
}
|
|
}
|
|
}
|
|
|
|
fn as_any(&self) -> &dyn Any {
|
|
self
|
|
}
|
|
}
|