field order taken straight off LogicBattle::encode. the object manager is columnar, not object major: 6 counters, a count, then all data refs, then all global ids, then all objects, then four component passes. global ids must be ascending, the client binary searches them. LogicRandom moved out of the shop into its own module. its abs was checked_abs().unwrap_or(0), the binary uses NEGS so i32::MIN stays i32::MIN. one seed in four billion, but it would have desynced the card shop. per object subclass encodes and the component payloads are still missing, so no snapshot can be sent yet.
49 lines
1.3 KiB
Rust
49 lines
1.3 KiB
Rust
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<Vec<u8>>,
|
|
#[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()
|
|
}
|
|
}
|
|
}
|