Fixes for comments
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-07-15 14:22:48 +02:00
parent f6df95a824
commit f23fc43405
9 changed files with 31 additions and 23 deletions

View File

@@ -102,7 +102,8 @@ extern "C" fn pokemon_gender(handle: FFIHandle<Pokemon>) -> Gender {
handle.from_ffi_handle().gender()
}
/// The coloring of the Pokemon.
/// The coloring of the Pokemon. If this is 1, the Pokemon is shiny, otherwise it is not. This can
/// also be used for other custom coloring schemes.
#[no_mangle]
extern "C" fn pokemon_coloring(handle: FFIHandle<Pokemon>) -> u8 {
handle.from_ffi_handle().coloring()
@@ -196,13 +197,13 @@ extern "C" fn pokemon_nickname(handle: FFIHandle<Pokemon>) -> FFIResult<OwnedPtr
}
}
/// Whether the actual ability on the form is a hidden ability.
/// Whether the actual ability the Pokemon has (so not its potentially overriden ability) is a hidden ability.
#[no_mangle]
extern "C" fn pokemon_real_ability_is_hidden(handle: FFIHandle<Pokemon>) -> u8 {
u8::from(handle.from_ffi_handle().real_ability().hidden)
}
/// The index of the actual ability on the form.
/// The index of the actual ability the Pokemon has (so not its potentially overriden ability).
#[no_mangle]
extern "C" fn pokemon_real_ability_index(handle: FFIHandle<Pokemon>) -> u8 {
handle.from_ffi_handle().real_ability().index
@@ -246,7 +247,7 @@ extern "C" fn pokemon_boosted_stats(handle: FFIHandle<Pokemon>) -> FFIHandle<Arc
FFIHandle::get_handle(handle.from_ffi_handle().boosted_stats().clone().into())
}
/// Get the stat boosts for a specific stat.
/// Get the stat boosts for a specific stat. This is a value between -6 and 6.
#[no_mangle]
extern "C" fn pokemon_get_stat_boost(handle: FFIHandle<Pokemon>, statistic: Statistic) -> i8 {
handle.from_ffi_handle().stat_boost(statistic)
@@ -269,26 +270,30 @@ extern "C" fn pokemon_change_stat_boost(
}
}
/// Gets a [individual value](https://bulbapedia.bulbagarden.net/wiki/Individual_values) of the Pokemon.
/// Gets an individual value of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Individual_values)
#[no_mangle]
extern "C" fn pokemon_get_individual_value(handle: FFIHandle<Pokemon>, stat: Statistic) -> u8 {
handle.from_ffi_handle().individual_values().get_stat(stat)
}
/// Modifies a [individual value](https://bulbapedia.bulbagarden.net/wiki/Individual_values) of the Pokemon.
/// Modifies an individual value of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Individual_values)
#[no_mangle]
extern "C" fn pokemon_set_individual_value(handle: FFIHandle<Pokemon>, stat: Statistic, value: u8) -> FFIResult<()> {
handle.from_ffi_handle().individual_values().set_stat(stat, value);
handle.from_ffi_handle().recalculate_flat_stats().into()
}
/// Gets a [effort value](https://bulbapedia.bulbagarden.net/wiki/Effort_values) of the Pokemon.
/// Gets an effort value of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Effort_values)
#[no_mangle]
extern "C" fn pokemon_get_effort_value(handle: FFIHandle<Pokemon>, stat: Statistic) -> u8 {
handle.from_ffi_handle().effort_values().get_stat(stat)
}
/// Modifies a [effort value](https://bulbapedia.bulbagarden.net/wiki/Effort_values) of the Pokemon.
/// Modifies a effort value of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Effort_values)
#[no_mangle]
extern "C" fn pokemon_set_effort_value(handle: FFIHandle<Pokemon>, stat: Statistic, value: u8) -> FFIResult<()> {
handle.from_ffi_handle().effort_values().set_stat(stat, value);
@@ -341,7 +346,8 @@ extern "C" fn pokemon_allowed_experience_gain(handle: FFIHandle<Pokemon>) -> u8
u8::from(handle.from_ffi_handle().allowed_experience_gain())
}
/// The [nature](https://bulbapedia.bulbagarden.net/wiki/Nature) of the Pokemon.
/// The nature of the Pokemon.
/// [See also](https://bulbapedia.bulbagarden.net/wiki/Nature)
#[no_mangle]
extern "C" fn pokemon_nature(handle: FFIHandle<Pokemon>) -> FFIHandle<Arc<dyn Nature>> {
FFIHandle::get_handle(handle.from_ffi_handle().nature().clone().into())