More work on using interior mutability instead of exterior mutability for dynamic types (Battle, Pokemon, etc).
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-06-18 15:52:39 +02:00
parent c45c7538bf
commit 5576bc8b80
21 changed files with 324 additions and 385 deletions

View File

@@ -1,9 +1,8 @@
use crate::dynamic_data::models::executing_move::ExecutingMove;
use crate::dynamic_data::models::pokemon::Pokemon;
use crate::dynamic_data::script_handling::ScriptSource;
use crate::script_hook;
use crate::utils::random::Random;
use crate::{script_hook, script_hook_on_lock};
use parking_lot::RwLock;
use std::fmt::{Debug, Formatter};
use std::sync::{Arc, Mutex};
@@ -37,7 +36,7 @@ impl BattleRandom {
&self,
mut chance: f32,
executing_move: &ExecutingMove,
target: &Arc<RwLock<Pokemon>>,
target: &Arc<Pokemon>,
hit_number: u8,
) -> bool {
script_hook!(
@@ -48,7 +47,7 @@ impl BattleRandom {
hit_number,
&mut chance
);
script_hook_on_lock!(
script_hook!(
change_incoming_effect_chance,
target,
executing_move,