Add function to get random nature, add shiny rate to library settings
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-14 10:36:38 +02:00
parent d7b3c0cd8d
commit 3058739ea0
7 changed files with 61 additions and 12 deletions

View File

@@ -5,8 +5,8 @@ use std::ptr::drop_in_place;
/// Creates a new generation 7 damage library. `has_randomness` defines whether a random damage
/// modifier (0.85x - 1.00x) is applied to the calculated damage.
#[no_mangle]
extern "C" fn gen_7_damage_library_new(randomness: u8) -> IdentifiablePointer<Box<dyn DamageLibrary>> {
let v: Box<dyn DamageLibrary> = Box::new(Gen7DamageLibrary::new(randomness == 1));
extern "C" fn gen_7_damage_library_new(has_randomness: u8) -> IdentifiablePointer<Box<dyn DamageLibrary>> {
let v: Box<dyn DamageLibrary> = Box::new(Gen7DamageLibrary::new(has_randomness == 1));
let id = v.value_identifier();
let ptr = Box::into_raw(Box::new(v));
IdentifiablePointer::new(ptr, id)