This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user