Implements first few actual move effects.

This commit is contained in:
2022-08-28 15:50:12 +02:00
parent 98130706fb
commit 05430c5e84
38 changed files with 1539 additions and 355 deletions

View File

@@ -0,0 +1,40 @@
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;
}
}
}
}