97 lines
3.4 KiB
Rust
Executable File
97 lines
3.4 KiB
Rust
Executable File
// Autogenerated file. Do not edit.
|
|
|
|
use alloc::boxed::Box;
|
|
use pkmn_lib_interface::app_interface::{get_hash, StringKey};
|
|
use pkmn_lib_interface::handling::{Script, ScriptCategory};
|
|
|
|
macro_rules! resolve_match {
|
|
(
|
|
$mid:expr,
|
|
$(
|
|
$script:ty,
|
|
)*
|
|
) => (
|
|
match $mid {
|
|
$(
|
|
const { get_hash(<$script>::get_const_name()) } => {
|
|
return Some(Box::new(<$script>::new()))
|
|
}
|
|
)*
|
|
_ => {}
|
|
}
|
|
)
|
|
}
|
|
|
|
pub fn get_script(category: ScriptCategory, name: &StringKey) -> Option<Box<dyn Script>> {
|
|
match category {
|
|
ScriptCategory::Move => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
crate::moves::automize::Automize,
|
|
crate::moves::prevent_foes_exit::PreventFoesExist,
|
|
crate::moves::attract::Attract,
|
|
crate::moves::assist::Assist,
|
|
crate::moves::acupressure::Acupressure,
|
|
crate::moves::struggle::Struggle,
|
|
crate::moves::cure_party_status::CurePartyStatus,
|
|
crate::moves::multi_hit_move::MultiHitMove,
|
|
crate::moves::double_power_if_target_damaged_in_turn::DoublePowerIfTargetDamagedInTurn,
|
|
crate::moves::heal_each_end_of_turn::HealEachEndOfTurn,
|
|
crate::moves::double_power_user_damaged_by_target_in_turn::DoublePowerUserDamagedByTargetInTurn,
|
|
crate::moves::aurora_veil::AuroraVeil,
|
|
crate::moves::change_all_target_stats::ChangeAllTargetStats,
|
|
crate::moves::after_you::AfterYou,
|
|
crate::moves::drain::Drain,
|
|
crate::moves::acrobatics::Acrobatics,
|
|
crate::moves::flinch::Flinch,
|
|
crate::moves::increased_critical_stage::IncreasedCriticalStage,
|
|
}
|
|
},
|
|
ScriptCategory::Ability => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
}
|
|
},
|
|
ScriptCategory::Status => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
}
|
|
},
|
|
ScriptCategory::Pokemon => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
crate::pokemon::prevent_foes_exit::PreventFoesExitEffect,
|
|
crate::pokemon::flinch_effect::FlinchEffect,
|
|
crate::pokemon::heal_each_end_of_turn::HealEachEndOfTurnEffect,
|
|
crate::pokemon::double_power_user_damaged_by_target_in_turn::DoublePowerUserDamagedByTargetInTurnData,
|
|
crate::pokemon::infatuated::Infatuated,
|
|
}
|
|
},
|
|
ScriptCategory::Battle => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
}
|
|
},
|
|
ScriptCategory::Weather => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
crate::weather::hail::Hail,
|
|
}
|
|
},
|
|
ScriptCategory::Side => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
crate::side::light_screen::LightScreenEffect,
|
|
crate::side::double_power_if_target_damaged_in_turn_data::DoublePowerIfTargetDamagedInTurnData,
|
|
crate::side::aurora_veil_effect::AuroraVeilEffect,
|
|
}
|
|
},
|
|
ScriptCategory::ItemBattleTrigger => {
|
|
resolve_match! {
|
|
name.hash().unwrap(),
|
|
}
|
|
},
|
|
}
|
|
None
|
|
}
|
|
|