use titan::Message; use crate::battle::LogicGameObjectRef; pub const BATTLE_RESULT_WIN: i32 = 1; pub const BATTLE_RESULT_LOSE: i32 = 2; pub const BATTLE_RESULT_DRAW: i32 = 3; #[derive(Debug, Default, Clone, PartialEq, Eq, Message)] #[message(id = 20225, direction = "server", name = "BattleResultMessage")] pub struct BattleResultMessage { #[codec(vint)] pub result: i32, #[codec(vint)] pub score_change: i32, #[codec(vint)] pub unknown_56: i32, #[codec(vint)] pub unknown_60: i32, #[codec(vint)] pub unknown_64: i32, #[codec(vint)] pub unknown_68: i32, #[codec(vint)] pub gold_reward: i32, #[codec(vint)] pub exp_reward: i32, #[codec(vint)] pub own_stars: i32, #[codec(vint)] pub opponent_stars: i32, pub treasure_chest: LogicGameObjectRef, #[codec(bytes)] pub full_update: Option>, #[codec(bool)] pub unknown_100: bool, pub unknown_104: LogicGameObjectRef, pub unknown_108: LogicGameObjectRef, pub unknown_112: LogicGameObjectRef, pub unknown_116: LogicGameObjectRef, } impl BattleResultMessage { pub fn npc_win(exp_reward: i32, gold_reward: i32, own_stars: i32) -> Self { Self { result: BATTLE_RESULT_WIN, exp_reward, gold_reward, own_stars, ..Self::default() } } }