diff --git a/crates/logic/src/commands/battle.rs b/crates/logic/src/commands/battle.rs new file mode 100644 index 0000000..c8081f4 --- /dev/null +++ b/crates/logic/src/commands/battle.rs @@ -0,0 +1,34 @@ +use logic_derive::Command; +use titan::Payload; +use crate::battle::LogicVector2; +use crate::commands::command::{CommandOutcome, Execute}; +use crate::commands::command_type; +use crate::commands::header::LogicCommandHeader; +use crate::data::LogicDataRef; +use crate::home::LogicHomeMode; +use crate::model::LogicSpell; +#[derive(Debug, Default, Payload, Command)] +#[command(id = command_type::DO_SPELL)] +pub struct LogicDoSpellCommand { + pub header: LogicCommandHeader, + #[codec(vint)] + pub deck_slot: i32, + pub spell: Option, + pub position: LogicVector2, +} +impl Execute for LogicDoSpellCommand { + fn execute(&self, _mode: &mut LogicHomeMode) -> CommandOutcome { + CommandOutcome::Ignored + } +} +#[derive(Debug, Default, Payload, Command)] +#[command(id = command_type::COMPLETE_TUTORIAL_BATTLE)] +pub struct LogicCompleteTutorialBattleCommand { + pub tutorial: LogicDataRef, + pub header: LogicCommandHeader, +} +impl Execute for LogicCompleteTutorialBattleCommand { + fn execute(&self, _mode: &mut LogicHomeMode) -> CommandOutcome { + CommandOutcome::Ignored + } +} diff --git a/crates/logic/src/commands/mod.rs b/crates/logic/src/commands/mod.rs index 0343d5a..b016778 100644 --- a/crates/logic/src/commands/mod.rs +++ b/crates/logic/src/commands/mod.rs @@ -1,4 +1,5 @@ mod achievement; +mod battle; mod chest; mod command; mod deck; @@ -13,6 +14,7 @@ pub use achievement::{ LogicClaimAchievementRewardCommand, COMMODITY_ACHIEVEMENT_CLAIMED, COMMODITY_ACHIEVEMENT_PROGRESS, }; +pub use battle::{LogicCompleteTutorialBattleCommand, LogicDoSpellCommand}; pub use chest::{ LogicClaimRewardCommand, LogicCollectFreeChestCommand, LogicCollectMultiWinChestCommand, LogicStartRewardClaimCommand, @@ -33,6 +35,8 @@ pub use ui::{ LogicShopOpenedCommand, }; pub mod command_type { + pub const DO_SPELL: i32 = 1; + pub const COMPLETE_TUTORIAL_BATTLE: i32 = 2; pub const DIAMONDS_ADDED: i32 = 202; pub const CLAIM_REWARD: i32 = 213; pub const ADD_CHEST: i32 = 214;