A lot of work on type registration
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use pkmn_lib_interface::app_interface::list::ImmutableList;
|
||||
use pkmn_lib_interface::app_interface::{get_hash, BattleLibrary, DataLibrary, EffectParameter};
|
||||
use pkmn_lib_interface::app_interface::{
|
||||
get_hash, DataLibrary, DynamicLibrary, EffectParameter, TurnChoice,
|
||||
};
|
||||
use pkmn_lib_interface::dbg;
|
||||
use pkmn_lib_interface::handling::{Script, ScriptCapabilities};
|
||||
|
||||
@@ -16,12 +18,15 @@ impl Script for TestScript {
|
||||
}
|
||||
|
||||
fn get_capabilities(&self) -> &[ScriptCapabilities] {
|
||||
&[ScriptCapabilities::Initialize]
|
||||
&[
|
||||
ScriptCapabilities::Initialize,
|
||||
ScriptCapabilities::OnBeforeTurn,
|
||||
]
|
||||
}
|
||||
|
||||
fn on_initialize(
|
||||
&self,
|
||||
library: &BattleLibrary,
|
||||
library: &DynamicLibrary,
|
||||
parameters: Option<ImmutableList<EffectParameter>>,
|
||||
) {
|
||||
let l = library.data_library();
|
||||
@@ -32,6 +37,14 @@ impl Script for TestScript {
|
||||
dbg!(
|
||||
"Found a parameter with value: {}",
|
||||
parameters.unwrap().get(0).unwrap()
|
||||
)
|
||||
);
|
||||
if m.has_flag(b"foo") {}
|
||||
}
|
||||
|
||||
fn on_before_turn(&self, choice: TurnChoice) {
|
||||
dbg!(
|
||||
"On before turn for user: {}",
|
||||
choice.user().species().name()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user