More documentation.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-07-01 17:07:22 +02:00
parent 03f5e3bb5a
commit 8f6ecdd4ad
35 changed files with 721 additions and 262 deletions

View File

@@ -246,14 +246,18 @@ impl<'own, 'library> Battle<'own, 'library> {
hit_data.set_damage(damage);
let mut accuracy = executing_move.use_move().accuracy();
script_hook!(
change_accuracy,
executing_move,
executing_move,
target,
hit_index,
&mut accuracy
);
// If the accuracy is 255, the move should always hit, and as such we should not allow
// modifying it.
if accuracy != 255 {
script_hook!(
change_accuracy,
executing_move,
executing_move,
target,
hit_index,
&mut accuracy
);
}
if accuracy < 100 && self.random().get_max(100) as u8 >= accuracy {
script_hook!(on_move_miss, target, executing_move, target);
self.event_hook().trigger(Event::Miss {