Adds assist and assurance, fixes

This commit is contained in:
2022-09-09 20:09:56 +02:00
parent 05430c5e84
commit 365bdc8aec
57 changed files with 533 additions and 95 deletions

View File

@@ -0,0 +1,74 @@
use pkmn_lib_interface::app_interface::{get_hash, MoveData};
macro_rules! non_copyable {
(
$mv:ident,
$($move_name:literal),+
) => {
match $mv.name().hash() {
0
$(
| const { get_hash($move_name) }
)* => false,
_ => true
}
};
}
pub fn can_copy_move(mv: &MoveData) -> bool {
// A list of all moves that cannot be copied. This expands to a match statement, so is fast on
// runtime.
non_copyable!(
mv,
"assist",
"baneful_bunker",
"beak_blast",
"belch",
"bestow",
"bounce",
"celebrate",
"chatter",
"circle_throw",
"copycat",
"counter",
"covet",
"destiny_bond",
"detect",
"dig",
"dive",
"dragon_tail",
"endure",
"feint",
"fly",
"focus_punch",
"follow_me",
"helping_hand",
"hold_hands",
"kings_shield",
"mat_block",
"me_first",
"metronome",
"mimic",
"mirror_coat",
"mirror_move",
"nature_power",
"phantom_force",
"protect",
"rage_powder",
"roar",
"shadow_force",
"shell_trap",
"sketch",
"sky_drop",
"sleep_talk",
"snatch",
"spiky_shield",
"spotlight",
"struggle",
"switcheroo",
"thief",
"transform",
"trick",
"whirlwind"
)
}

25
gen_7_scripts/src/utils/mod.rs Executable file
View File

@@ -0,0 +1,25 @@
pub mod copyable_moves;
#[macro_export]
macro_rules! script{
(
$name: ident,
$id: literal
$(
,
$field_name:ident : $field_type:ty
)*
) => {
pub struct $name {
$(
$field_name: $field_type,
)*
}
impl $name {
pub const fn get_const_name() -> &'static str {
$id
}
}
}
}