forked from ObolSquad/trigger-rs
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:
parent
8f606a8256
commit
42fdc33849
7 changed files with 18 additions and 25 deletions
|
@ -29,7 +29,7 @@ impl GameState {
|
||||||
} => Self {
|
} => Self {
|
||||||
filecfg,
|
filecfg,
|
||||||
scene: Scene::Fight(FightScene {
|
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(),
|
play_type: (*play_type).into(),
|
||||||
perform: ScenePerform {
|
perform: ScenePerform {
|
||||||
time: String::from("Morning"),
|
time: String::from("Morning"),
|
||||||
|
@ -53,11 +53,7 @@ impl GameState {
|
||||||
buddy_type: 0,
|
buddy_type: 0,
|
||||||
buddy_id: 50001,
|
buddy_id: 50001,
|
||||||
}],
|
}],
|
||||||
inner_quests: vec![Self::get_scene_event_id(
|
inner_quests: vec![Self::get_scene_id(filecfg, *quest_id, (*play_type).into())],
|
||||||
filecfg,
|
|
||||||
*quest_id,
|
|
||||||
(*play_type).into(),
|
|
||||||
)],
|
|
||||||
equip: dungeon_equip.clone(),
|
equip: dungeon_equip.clone(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -69,7 +65,7 @@ impl GameState {
|
||||||
dungeon_equip,
|
dungeon_equip,
|
||||||
} => Self {
|
} => Self {
|
||||||
scene: Scene::Rally(RallyScene {
|
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 {
|
perform: ScenePerform {
|
||||||
time: String::from("Morning"),
|
time: String::from("Morning"),
|
||||||
weather: String::from("SunShine"),
|
weather: String::from("SunShine"),
|
||||||
|
@ -92,11 +88,7 @@ impl GameState {
|
||||||
buddy_type: 0,
|
buddy_type: 0,
|
||||||
buddy_id: 50001,
|
buddy_id: 50001,
|
||||||
}],
|
}],
|
||||||
inner_quests: vec![Self::get_scene_event_id(
|
inner_quests: vec![Self::get_scene_id(filecfg, *quest_id, (*play_type).into())],
|
||||||
filecfg,
|
|
||||||
*quest_id,
|
|
||||||
(*play_type).into(),
|
|
||||||
)],
|
|
||||||
equip: dungeon_equip.clone(),
|
equip: dungeon_equip.clone(),
|
||||||
},
|
},
|
||||||
filecfg,
|
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 {
|
match play_type {
|
||||||
ELocalPlayType::TrainingRoom => 19800014,
|
ELocalPlayType::TrainingRoom => 19800014,
|
||||||
ELocalPlayType::ArchiveBattle => filecfg
|
ELocalPlayType::ArchiveBattle => filecfg
|
||||||
|
@ -135,7 +127,7 @@ impl GameState {
|
||||||
debug!(
|
debug!(
|
||||||
"the battle is over, quest_id: {}, event_id: {}",
|
"the battle is over, quest_id: {}, event_id: {}",
|
||||||
self.dungeon.quest_id,
|
self.dungeon.quest_id,
|
||||||
self.scene.get_event_id()
|
self.scene.get_scene_id()
|
||||||
);
|
);
|
||||||
|
|
||||||
vec![
|
vec![
|
||||||
|
|
|
@ -3,7 +3,7 @@ use trigger_logic::scene::ELocalPlayType;
|
||||||
use super::ScenePerform;
|
use super::ScenePerform;
|
||||||
|
|
||||||
pub struct FightScene {
|
pub struct FightScene {
|
||||||
pub event_id: u32,
|
pub scene_id: u32,
|
||||||
pub play_type: ELocalPlayType,
|
pub play_type: ELocalPlayType,
|
||||||
pub perform: ScenePerform,
|
pub perform: ScenePerform,
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ impl FightScene {
|
||||||
SceneData {
|
SceneData {
|
||||||
scene_type: 3,
|
scene_type: 3,
|
||||||
local_play_type: self.play_type.into(),
|
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 {
|
fight_scene_info: Some(FightSceneInfo {
|
||||||
level_perform_info: Some(LevelPerformInfo {
|
level_perform_info: Some(LevelPerformInfo {
|
||||||
time: self.perform.time.clone(),
|
time: self.perform.time.clone(),
|
||||||
|
|
|
@ -22,10 +22,10 @@ impl Scene {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_event_id(&self) -> u32 {
|
pub fn get_scene_id(&self) -> u32 {
|
||||||
match self {
|
match self {
|
||||||
Self::Fight(scene) => scene.event_id,
|
Self::Fight(scene) => scene.scene_id,
|
||||||
Self::Rally(scene) => scene.event_id,
|
Self::Rally(scene) => scene.scene_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use trigger_logic::scene::ELocalPlayType;
|
||||||
use super::ScenePerform;
|
use super::ScenePerform;
|
||||||
|
|
||||||
pub struct RallyScene {
|
pub struct RallyScene {
|
||||||
pub event_id: u32,
|
pub scene_id: u32,
|
||||||
pub perform: ScenePerform,
|
pub perform: ScenePerform,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ impl RallyScene {
|
||||||
SceneData {
|
SceneData {
|
||||||
scene_type: 7,
|
scene_type: 7,
|
||||||
local_play_type: ELocalPlayType::RallyLongFight.into(),
|
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 {
|
rally_scene_info: Some(RallySceneInfo {
|
||||||
level_perform_info: Some(LevelPerformInfo {
|
level_perform_info: Some(LevelPerformInfo {
|
||||||
time: self.perform.time.clone(),
|
time: self.perform.time.clone(),
|
||||||
|
|
|
@ -3,10 +3,9 @@ use std::path::Path;
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rerun-if-changed=fbs");
|
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")],
|
inputs: &[Path::new("fbs/tables.fbs")],
|
||||||
out_dir: Path::new("gen_flatbuffers"),
|
out_dir: Path::new("gen_flatbuffers"),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
});
|
||||||
.expect("Couldn't compile tables.fbs");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6502,6 +6502,7 @@ impl From<SceneData> for ::trigger_protocol::SceneData {
|
||||||
fight_scene_info: value.fight_scene_info.map(|v| v.into()),
|
fight_scene_info: value.fight_scene_info.map(|v| v.into()),
|
||||||
scene_type: value.scene_type.into(),
|
scene_type: value.scene_type.into(),
|
||||||
rally_scene_info: value.rally_scene_info.map(|v| v.into()),
|
rally_scene_info: value.rally_scene_info.map(|v| v.into()),
|
||||||
|
scene_id: value.scene_id.into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6516,6 +6517,7 @@ impl From<::trigger_protocol::SceneData> for SceneData {
|
||||||
fight_scene_info: value.fight_scene_info.map(|v| v.into()),
|
fight_scene_info: value.fight_scene_info.map(|v| v.into()),
|
||||||
scene_type: value.scene_type.into(),
|
scene_type: value.scene_type.into(),
|
||||||
rally_scene_info: value.rally_scene_info.map(|v| v.into()),
|
rally_scene_info: value.rally_scene_info.map(|v| v.into()),
|
||||||
|
scene_id: value.scene_id.into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,7 @@ pub struct Transform {
|
||||||
#[derive(Default, Debug, Clone, Encodeable, Decodeable)]
|
#[derive(Default, Debug, Clone, Encodeable, Decodeable)]
|
||||||
pub struct SceneData {
|
pub struct SceneData {
|
||||||
pub scene_type: u32,
|
pub scene_type: u32,
|
||||||
pub event_id: u32,
|
pub scene_id: u32,
|
||||||
pub local_play_type: u32,
|
pub local_play_type: u32,
|
||||||
pub hall_scene_info: Option<HallSceneInfo>,
|
pub hall_scene_info: Option<HallSceneInfo>,
|
||||||
pub fight_scene_info: Option<FightSceneInfo>,
|
pub fight_scene_info: Option<FightSceneInfo>,
|
||||||
|
|
Loading…
Reference in a new issue