Fixed HDD commissions | Reverted flatc expect (#6)

Reviewed-on: ObolSquad/trigger-rs#6
Co-authored-by: traffic95 <traffic95@xeondev.com>
Co-committed-by: traffic95 <traffic95@xeondev.com>
This commit is contained in:
traffic95 2025-03-18 21:50:55 +00:00 committed by xeon
parent 8f606a8256
commit 42fdc33849
7 changed files with 18 additions and 25 deletions

View file

@ -29,7 +29,7 @@ impl GameState {
} => Self {
filecfg,
scene: Scene::Fight(FightScene {
event_id: Self::get_scene_event_id(filecfg, *quest_id, (*play_type).into()),
scene_id: Self::get_scene_id(filecfg, *quest_id, (*play_type).into()),
play_type: (*play_type).into(),
perform: ScenePerform {
time: String::from("Morning"),
@ -53,11 +53,7 @@ impl GameState {
buddy_type: 0,
buddy_id: 50001,
}],
inner_quests: vec![Self::get_scene_event_id(
filecfg,
*quest_id,
(*play_type).into(),
)],
inner_quests: vec![Self::get_scene_id(filecfg, *quest_id, (*play_type).into())],
equip: dungeon_equip.clone(),
},
},
@ -69,7 +65,7 @@ impl GameState {
dungeon_equip,
} => Self {
scene: Scene::Rally(RallyScene {
event_id: Self::get_scene_event_id(filecfg, *quest_id, (*play_type).into()),
scene_id: Self::get_scene_id(filecfg, *quest_id, (*play_type).into()),
perform: ScenePerform {
time: String::from("Morning"),
weather: String::from("SunShine"),
@ -92,11 +88,7 @@ impl GameState {
buddy_type: 0,
buddy_id: 50001,
}],
inner_quests: vec![Self::get_scene_event_id(
filecfg,
*quest_id,
(*play_type).into(),
)],
inner_quests: vec![Self::get_scene_id(filecfg, *quest_id, (*play_type).into())],
equip: dungeon_equip.clone(),
},
filecfg,
@ -105,7 +97,7 @@ impl GameState {
})
}
fn get_scene_event_id(filecfg: &NapFileCfg, quest_id: u32, play_type: ELocalPlayType) -> u32 {
fn get_scene_id(filecfg: &NapFileCfg, quest_id: u32, play_type: ELocalPlayType) -> u32 {
match play_type {
ELocalPlayType::TrainingRoom => 19800014,
ELocalPlayType::ArchiveBattle => filecfg
@ -135,7 +127,7 @@ impl GameState {
debug!(
"the battle is over, quest_id: {}, event_id: {}",
self.dungeon.quest_id,
self.scene.get_event_id()
self.scene.get_scene_id()
);
vec![

View file

@ -3,7 +3,7 @@ use trigger_logic::scene::ELocalPlayType;
use super::ScenePerform;
pub struct FightScene {
pub event_id: u32,
pub scene_id: u32,
pub play_type: ELocalPlayType,
pub perform: ScenePerform,
}
@ -15,7 +15,7 @@ impl FightScene {
SceneData {
scene_type: 3,
local_play_type: self.play_type.into(),
event_id: self.event_id, // or maybe it's actually scene_id ?
scene_id: self.scene_id,
fight_scene_info: Some(FightSceneInfo {
level_perform_info: Some(LevelPerformInfo {
time: self.perform.time.clone(),

View file

@ -22,10 +22,10 @@ impl Scene {
}
}
pub fn get_event_id(&self) -> u32 {
pub fn get_scene_id(&self) -> u32 {
match self {
Self::Fight(scene) => scene.event_id,
Self::Rally(scene) => scene.event_id,
Self::Fight(scene) => scene.scene_id,
Self::Rally(scene) => scene.scene_id,
}
}

View file

@ -5,7 +5,7 @@ use trigger_logic::scene::ELocalPlayType;
use super::ScenePerform;
pub struct RallyScene {
pub event_id: u32,
pub scene_id: u32,
pub perform: ScenePerform,
}
@ -16,7 +16,7 @@ impl RallyScene {
SceneData {
scene_type: 7,
local_play_type: ELocalPlayType::RallyLongFight.into(),
event_id: self.event_id, // or maybe it's actually scene_id ?
scene_id: self.scene_id,
rally_scene_info: Some(RallySceneInfo {
level_perform_info: Some(LevelPerformInfo {
time: self.perform.time.clone(),

View file

@ -3,10 +3,9 @@ use std::path::Path;
fn main() {
println!("cargo:rerun-if-changed=fbs");
flatc_rust::run(flatc_rust::Args {
let _ = flatc_rust::run(flatc_rust::Args {
inputs: &[Path::new("fbs/tables.fbs")],
out_dir: Path::new("gen_flatbuffers"),
..Default::default()
})
.expect("Couldn't compile tables.fbs");
});
}

View file

@ -6502,6 +6502,7 @@ impl From<SceneData> for ::trigger_protocol::SceneData {
fight_scene_info: value.fight_scene_info.map(|v| v.into()),
scene_type: value.scene_type.into(),
rally_scene_info: value.rally_scene_info.map(|v| v.into()),
scene_id: value.scene_id.into(),
..Default::default()
}
}
@ -6516,6 +6517,7 @@ impl From<::trigger_protocol::SceneData> for SceneData {
fight_scene_info: value.fight_scene_info.map(|v| v.into()),
scene_type: value.scene_type.into(),
rally_scene_info: value.rally_scene_info.map(|v| v.into()),
scene_id: value.scene_id.into(),
..Default::default()
}
}

View file

@ -277,7 +277,7 @@ pub struct Transform {
#[derive(Default, Debug, Clone, Encodeable, Decodeable)]
pub struct SceneData {
pub scene_type: u32,
pub event_id: u32,
pub scene_id: u32,
pub local_play_type: u32,
pub hall_scene_info: Option<HallSceneInfo>,
pub fight_scene_info: Option<FightSceneInfo>,