Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
fix techniques
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvlian committed Dec 14, 2024
1 parent edb6083 commit b8d20f2
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 59 deletions.
53 changes: 29 additions & 24 deletions main/cfg-server/src/srtools/default_config.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
Self {
avatar_config: vec![
AvatarConfig {
name: String::from("Ruan Mei"),
id: 1303,
name: String::from("Bronya"),
id: 1101,
hp: 100,
sp: 50,
level: 80,
promotion: 6,
rank: 0,
lightcone: LightCone {
id: 20012,
rank: 5,
id: 23003,
rank: 1,
level: 80,
promotion: 6,
},
relics: vec![
String::from("61181,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("61182,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("61183,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("61184,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("63085,15,1,4,3:1:2,6:1:2,7:1:2,11:6:12"),
String::from("63086,15,2,4,3:1:2,6:1:2,7:1:2,11:6:12"),
String::from("61041,15,1,4,3:1:2,6:1:2,7:6:12,11:1:2"),
String::from("61042,15,1,4,3:1:2,6:1:2,9:6:12,11:1:2"),
String::from("61043,15,5,4,1:1:2,3:1:2,6:1:2,11:6:12"),
String::from("61044,15,3,4,1:6:12,3:1:2,4:1:2,11:1:2"),
String::from("63105,15,1,4,1:3:6,3:1:2,6:1:2,7:4:8"),
String::from("63106,15,2,4,1:1:2,3:1:2,7:1:2,11:5:0"),
],
use_technique: true,
// use_technique: true,
buff_id_list: vec![110101],
},
AvatarConfig {
name: String::from("Fu Xuan"),
Expand All @@ -46,31 +47,33 @@ Self {
String::from("63105,15,1,4,1:5:10,3:1:2,6:1:2,8:1:2"),
String::from("63106,15,2,4,1:1:2,4:1:2,7:1:2,11:6:12"),
],
use_technique: true,
// use_technique: true,
buff_id_list: vec![120801, 120802],
},
AvatarConfig {
name: String::from("Bronya"),
id: 1101,
name: String::from("Ruan Mei"),
id: 1303,
hp: 100,
sp: 50,
level: 80,
promotion: 6,
rank: 0,
lightcone: LightCone {
id: 23003,
rank: 1,
id: 20012,
rank: 5,
level: 80,
promotion: 6,
},
relics: vec![
String::from("61041,15,1,4,3:1:2,6:1:2,7:6:12,11:1:2"),
String::from("61042,15,1,4,3:1:2,6:1:2,9:6:12,11:1:2"),
String::from("61043,15,5,4,1:1:2,3:1:2,6:1:2,11:6:12"),
String::from("61044,15,3,4,1:6:12,3:1:2,4:1:2,11:1:2"),
String::from("63105,15,1,4,1:3:6,3:1:2,6:1:2,7:4:8"),
String::from("63106,15,2,4,1:1:2,3:1:2,7:1:2,11:5:0"),
String::from("61181,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("61182,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("61183,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("61184,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2"),
String::from("63085,15,1,4,3:1:2,6:1:2,7:1:2,11:6:12"),
String::from("63086,15,2,4,3:1:2,6:1:2,7:1:2,11:6:12"),
],
use_technique: true,
// use_technique: true,
buff_id_list: vec![130301, 130302, 130303],
},
AvatarConfig {
name: String::from("Qingque"),
Expand All @@ -94,7 +97,8 @@ Self {
String::from("63095,15,2,4,2:2:4,3:3:6,8:2:2,9:2:2"),
String::from("63096,15,4,4,2:1:2,7:1:2,8:5:10,9:1:2"),
],
use_technique: true,
// use_technique: true,
buff_id_list: vec![120101, 1000116],
},
],
battle_config: BattleConfig {
Expand All @@ -106,5 +110,6 @@ Self {
vec![100401010, 1023020],
],
monster_level: 92,
// blessings: vec![],
},
}
33 changes: 23 additions & 10 deletions main/cfg-server/src/srtools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,26 @@ impl SrToolsConfig {
self.avatar_config
.iter()
.enumerate()
.filter(|(_, av)| av.use_technique)
.map(|(i, av)| BattleBuff {
id: ((av.id * 100) + 1),
owner_index: i as u32,
level: 1,
wave_flag: u32::MAX,
target_index_list: (0..=4).collect(),
dynamic_values: HashMap::from([(String::from("SkillIndex"), 0.0)]),
..Default::default()
.flat_map(|(i, av)| {
av.buff_id_list.iter().map(move |&buff_id| {
let dynamic_val = match buff_id {
122401 | 122402 | 122403 => HashMap::from([
(String::from("SkillIndex"), 0.0),
(String::from("#ADF_1"), 3.0),
(String::from("#ADF_2"), 3.0),
]),
_ => HashMap::from([(String::from("SkillIndex"), 0.0)]),
};
BattleBuff {
id: buff_id,
owner_index: i as u32,
level: 1,
wave_flag: u32::MAX,
target_index_list: (0..=4).collect(),
dynamic_values: dynamic_val,
..Default::default()
}
})
})
.collect()
}
Expand Down Expand Up @@ -329,7 +340,8 @@ pub struct AvatarConfig {
pub rank: u32,
pub lightcone: LightCone,
pub relics: Vec<String>,
pub use_technique: bool,
// pub use_technique: bool,
pub buff_id_list: Vec<u32>,
}

#[derive(Deserialize)]
Expand All @@ -347,4 +359,5 @@ pub struct BattleConfig {
pub cycle_count: u32,
pub monster_wave: Vec<Vec<u32>>,
pub monster_level: u32,
// pub blessings: Vec<u32>,
}
64 changes: 40 additions & 24 deletions main/config.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
{
"avatar_config": [
{
"name": "Ruan Mei",
"id": 1303,
"name": "Bronya",
"id": 1101,
"hp": 100,
"sp": 50,
"level": 80,
"promotion": 6,
"rank": 0,
"lightcone": {
"id": 20012,
"rank": 5,
"id": 23003,
"rank": 1,
"level": 80,
"promotion": 6
},
"relics": [
"61181,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"61182,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"61183,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"61184,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"63085,15,1,4,3:1:2,6:1:2,7:1:2,11:6:12",
"63086,15,2,4,3:1:2,6:1:2,7:1:2,11:6:12"
"61041,15,1,4,3:1:2,6:1:2,7:6:12,11:1:2",
"61042,15,1,4,3:1:2,6:1:2,9:6:12,11:1:2",
"61043,15,5,4,1:1:2,3:1:2,6:1:2,11:6:12",
"61044,15,3,4,1:6:12,3:1:2,4:1:2,11:1:2",
"63105,15,1,4,1:3:6,3:1:2,6:1:2,7:4:8",
"63106,15,2,4,1:1:2,3:1:2,7:1:2,11:5:0"
],
"use_technique": true
"use_technique": true,
"buff_id_list": [
110101
]
},
{
"name": "Fu Xuan",
Expand All @@ -46,31 +49,40 @@
"63105,15,1,4,1:5:10,3:1:2,6:1:2,8:1:2",
"63106,15,2,4,1:1:2,4:1:2,7:1:2,11:6:12"
],
"use_technique": true
"use_technique": true,
"buff_id_list": [
120801,
120802
]
},
{
"name": "Bronya",
"id": 1101,
"name": "Ruan Mei",
"id": 1303,
"hp": 100,
"sp": 50,
"level": 80,
"promotion": 6,
"rank": 0,
"lightcone": {
"id": 23003,
"rank": 1,
"id": 20012,
"rank": 5,
"level": 80,
"promotion": 6
},
"relics": [
"61041,15,1,4,3:1:2,6:1:2,7:6:12,11:1:2",
"61042,15,1,4,3:1:2,6:1:2,9:6:12,11:1:2",
"61043,15,5,4,1:1:2,3:1:2,6:1:2,11:6:12",
"61044,15,3,4,1:6:12,3:1:2,4:1:2,11:1:2",
"63105,15,1,4,1:3:6,3:1:2,6:1:2,7:4:8",
"63106,15,2,4,1:1:2,3:1:2,7:1:2,11:5:0"
"61181,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"61182,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"61183,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"61184,15,1,4,3:1:2,6:5:10,7:1:2,11:1:2",
"63085,15,1,4,3:1:2,6:1:2,7:1:2,11:6:12",
"63086,15,2,4,3:1:2,6:1:2,7:1:2,11:6:12"
],
"use_technique": true
"use_technique": true,
"buff_id_list": [
130301,
130302,
130303
]
},
{
"name": "Qingque",
Expand All @@ -94,7 +106,11 @@
"63095,15,2,4,2:2:4,3:3:6,8:2:2,9:2:2",
"63096,15,4,4,2:1:2,7:1:2,8:5:10,9:1:2"
],
"use_technique": true
"use_technique": true,
"buff_id_list": [
120101,
1000116
]
}
],
"battle_config": {
Expand Down
2 changes: 1 addition & 1 deletion main/net-game/src/handlers/lineup/get_all_lineup_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use net_msg::Trait;

pub async fn handle(_req: &[u8]) -> Vec<u8> {
let cfg = AvatarConfig::from_file("avatar.toml");

GetAllLineupDataScRsp {
lineup_list: vec![cfg.get_cur_lineup()],
cur_index: 0,
Expand Down

0 comments on commit b8d20f2

Please sign in to comment.