Initial work on adding documentation, reorganises modules
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
use crate::dynamic_data::choices::TurnChoice;
|
||||
use crate::dynamic_data::event_hooks::event_hook::Event;
|
||||
use crate::dynamic_data::flow::target_resolver::resolve_targets;
|
||||
use crate::dynamic_data::models::battle::Battle;
|
||||
use crate::dynamic_data::models::damage_source::DamageSource;
|
||||
use crate::dynamic_data::models::executing_move::ExecutingMove;
|
||||
use crate::dynamic_data::models::pokemon::Pokemon;
|
||||
use crate::dynamic_data::script_handling::{ScriptSource, ScriptWrapper};
|
||||
use crate::static_data::{DataLibrary, MoveCategory};
|
||||
use crate::{run_scripts, script_hook, PkmnResult};
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::dynamic_data::choices::TurnChoice;
|
||||
use crate::dynamic_data::event_hooks::Event;
|
||||
use crate::dynamic_data::flow::target_resolver::resolve_targets;
|
||||
use crate::dynamic_data::script_handling::{ScriptSource, ScriptWrapper};
|
||||
use crate::dynamic_data::Battle;
|
||||
use crate::dynamic_data::DamageSource;
|
||||
use crate::dynamic_data::ExecutingMove;
|
||||
use crate::dynamic_data::Pokemon;
|
||||
use crate::static_data::{DataLibrary, MoveCategory};
|
||||
use crate::{run_scripts, script_hook, PkmnResult};
|
||||
|
||||
impl<'own, 'library> Battle<'own, 'library> {
|
||||
/// Execute the entire turn after the choices are all set.
|
||||
pub(crate) fn run_turn(&self) -> PkmnResult<()> {
|
||||
let choice_queue = self.current_turn_queue();
|
||||
|
||||
@@ -60,20 +62,19 @@ impl<'own, 'library> Battle<'own, 'library> {
|
||||
}
|
||||
|
||||
fn execute_choice(&self, choice: &TurnChoice<'own, 'library>) -> PkmnResult<()> {
|
||||
// A pass turn choice means the user does not intend to do anything. As such, return.
|
||||
if let TurnChoice::Pass(..) = choice {
|
||||
return Ok(());
|
||||
}
|
||||
if self.has_ended() {
|
||||
return Ok(());
|
||||
}
|
||||
{
|
||||
let user = choice.user();
|
||||
if !user.is_usable() {
|
||||
return Ok(());
|
||||
}
|
||||
if !user.is_on_battlefield() {
|
||||
return Ok(());
|
||||
}
|
||||
let user = choice.user();
|
||||
if !user.is_usable() {
|
||||
return Ok(());
|
||||
}
|
||||
if !user.is_on_battlefield() {
|
||||
return Ok(());
|
||||
}
|
||||
if !self.can_use(choice) {
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user