forked from endernon/JadeSR-origin-DONOTUSE
Trailblazer configuration in globals.json (gender and path)
This commit is contained in:
parent
7d8c967952
commit
b98a3e230c
11 changed files with 268 additions and 7 deletions
|
@ -32,7 +32,7 @@ prost-build = "0.12.3"
|
||||||
|
|
||||||
paste = "1.0.14"
|
paste = "1.0.14"
|
||||||
sysinfo = "0.30.7"
|
sysinfo = "0.30.7"
|
||||||
|
strum = { version = "0.26.2", features = ["derive", "strum_macros"] }
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
|
|
||||||
serde = { version = "1.0.197", features = ["derive"] }
|
serde = { version = "1.0.197", features = ["derive"] }
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"lineup": [1314],
|
"lineup": [1314],
|
||||||
|
"hero_gender": "GenderWoman",
|
||||||
|
"hero_basic_type": "GirlShaman",
|
||||||
"monster_wave_list":
|
"monster_wave_list":
|
||||||
[
|
[
|
||||||
[3013010, 3013010],
|
[3013010, 3013010],
|
||||||
|
|
|
@ -15,5 +15,7 @@ lazy_static! {
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Globals {
|
pub struct Globals {
|
||||||
pub lineup: Vec<u32>,
|
pub lineup: Vec<u32>,
|
||||||
|
pub hero_gender: String,
|
||||||
|
pub hero_basic_type: String,
|
||||||
pub monster_wave_list: Vec<Vec<u32>>,
|
pub monster_wave_list: Vec<Vec<u32>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ use proto::*;
|
||||||
pub struct PlayerInfo {
|
pub struct PlayerInfo {
|
||||||
pub uid: u32,
|
pub uid: u32,
|
||||||
pub lineup: LineupInfo,
|
pub lineup: LineupInfo,
|
||||||
|
pub gender: Gender,
|
||||||
|
pub hero_basic_type: HeroBasicType,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PlayerInfo {
|
impl PlayerInfo {
|
||||||
|
@ -14,6 +16,9 @@ impl PlayerInfo {
|
||||||
Self {
|
Self {
|
||||||
uid: 1337,
|
uid: 1337,
|
||||||
lineup: default_lineup(),
|
lineup: default_lineup(),
|
||||||
|
gender: Gender::from_str_name(globals.hero_gender.as_str()).unwrap(),
|
||||||
|
hero_basic_type: HeroBasicType::from_str_name(globals.hero_basic_type.as_str())
|
||||||
|
.unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
static UNLOCKED_AVATARS: [u32; 50] = [
|
static UNLOCKED_AVATARS: [u32; 51] = [
|
||||||
1001, 1002, 1003, 1004, 1005, 1006, 1008, 1009, 1013, 1101, 1102, 1103, 1104, 1105, 1106, 1107,
|
1001, 1002, 1003, 1004, 1005, 1006, 1008, 1009, 1013, 1101, 1102, 1103, 1104, 1105, 1106, 1107,
|
||||||
1108, 1109, 1110, 1111, 1112, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211,
|
1108, 1109, 1110, 1111, 1112, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211,
|
||||||
1212, 1213, 1214, 1215, 1217, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1312,
|
1212, 1213, 1214, 1215, 1217, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1312,
|
||||||
1314, 1315,
|
1314, 1315, 8001,
|
||||||
];
|
];
|
||||||
|
|
||||||
pub async fn on_get_avatar_data_cs_req(
|
pub async fn on_get_avatar_data_cs_req(
|
||||||
|
|
|
@ -22,7 +22,11 @@ pub async fn on_start_cocoon_stage_cs_req(
|
||||||
.iter()
|
.iter()
|
||||||
.map(|avatar| BattleAvatar {
|
.map(|avatar| BattleAvatar {
|
||||||
index: avatar.slot,
|
index: avatar.slot,
|
||||||
id: avatar.id,
|
id: if avatar.id == 8001 {
|
||||||
|
player_info.hero_basic_type as u32
|
||||||
|
} else {
|
||||||
|
avatar.id
|
||||||
|
},
|
||||||
level: 80,
|
level: 80,
|
||||||
promotion: 6,
|
promotion: 6,
|
||||||
rank: 6,
|
rank: 6,
|
||||||
|
|
|
@ -22,15 +22,17 @@ pub async fn on_get_hero_basic_type_info_cs_req(
|
||||||
session: &PlayerSession,
|
session: &PlayerSession,
|
||||||
_body: &GetHeroBasicTypeInfoCsReq,
|
_body: &GetHeroBasicTypeInfoCsReq,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
let player_info = session.player_info();
|
||||||
|
|
||||||
session
|
session
|
||||||
.send(
|
.send(
|
||||||
CMD_GET_HERO_BASIC_TYPE_INFO_SC_RSP,
|
CMD_GET_HERO_BASIC_TYPE_INFO_SC_RSP,
|
||||||
GetHeroBasicTypeInfoScRsp {
|
GetHeroBasicTypeInfoScRsp {
|
||||||
retcode: 0,
|
retcode: 0,
|
||||||
gender: Gender::Man.into(),
|
gender: player_info.gender.into(),
|
||||||
cur_basic_type: HeroBasicType::BoyWarrior.into(),
|
cur_basic_type: player_info.hero_basic_type.into(),
|
||||||
basic_type_info_list: vec![HeroBasicTypeInfo {
|
basic_type_info_list: vec![HeroBasicTypeInfo {
|
||||||
basic_type: HeroBasicType::BoyWarrior.into(),
|
basic_type: HeroBasicType::GirlShaman.into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}],
|
}],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
|
@ -7,6 +7,7 @@ version.workspace = true
|
||||||
prost.workspace = true
|
prost.workspace = true
|
||||||
prost-types.workspace = true
|
prost-types.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
strum.workspace = true
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
prost-build.workspace = true
|
prost-build.workspace = true
|
||||||
|
|
|
@ -5,6 +5,7 @@ pub fn main() {
|
||||||
|
|
||||||
prost_build::Config::new()
|
prost_build::Config::new()
|
||||||
.out_dir("out/")
|
.out_dir("out/")
|
||||||
|
.enum_attribute(".", "#[derive(EnumString)]")
|
||||||
.compile_protos(&[proto_file], &["."])
|
.compile_protos(&[proto_file], &["."])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
242
proto/out/_.rs
242
proto/out/_.rs
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,6 @@
|
||||||
mod cmd_types;
|
mod cmd_types;
|
||||||
pub use cmd_types::*;
|
pub use cmd_types::*;
|
||||||
|
|
||||||
|
use strum::EnumString;
|
||||||
|
|
||||||
include!("../out/_.rs");
|
include!("../out/_.rs");
|
||||||
|
|
Loading…
Reference in a new issue