Large amounts of work on Rune
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-05-08 15:46:09 +02:00
parent 4bc76b0ee4
commit 4ec07ca049
43 changed files with 979 additions and 397 deletions

View File

@@ -6,7 +6,8 @@ impl TestMove {
pub fn change_speed(self, choice, speed) {
println(`change_speed: ${choice.speed()}`);
println(`user level: ${choice.user().level()}`);
speed.value = 100;
println(`owner: ${self.owner.level()}`);
speed += 100;
}
}

View File

@@ -51,8 +51,16 @@ fn validate_library_load() {
fn rune_test() {
let result = library_loader::load_library();
let library = result.library;
let p1 = PokemonBuilder::new(library.clone(), "charizard".into(), 100)
.build()
.unwrap();
let script = library
.load_script(ScriptOwnerData::None, ScriptCategory::Move, &"TestMove".into())
.load_script(
ScriptOwnerData::Pokemon(p1.weak()),
ScriptCategory::Move,
&"TestMove".into(),
)
.unwrap()
.unwrap();
assert_eq!(script.name().unwrap().str(), "TestMove");