AvatarConfig, UnlockConfig collections

This commit is contained in:
xeon 2024-05-24 19:17:45 +03:00
parent 560daa08ac
commit 934ad89fdf
5 changed files with 1512 additions and 13 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,352 @@
[
{
"ID": 1001,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 1,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconSundryBtn.png",
"Name": "UIText_321"
},
{
"ID": 1002,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconGashaponBtn.png",
"Name": "UIText_322"
},
{
"ID": 1003,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconShopBtn02.png",
"Name": "UIText_323"
},
{
"ID": 1004,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconMissionBtn.png",
"Name": "UIText_324"
},
{
"ID": 1005,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 1,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconYorozuyaManualBtn.png",
"Name": "UIText_325"
},
{
"ID": 1006,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 1,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconBagBtn.png",
"Name": "UIText_326"
},
{
"ID": 1007,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconBangBooBtn.png",
"Name": "UIText_327"
},
{
"ID": 1008,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 1,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconRoleBtn02.png",
"Name": "UIText_328"
},
{
"ID": 1009,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 1,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconTeleportBtn.png",
"Name": "UIText_329"
},
{
"ID": 1010,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 1011,
"LockType": 1,
"LockParam": "MenuText_LockHint",
"UnlockType": 1,
"UnlockParam": "MenuText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 1013,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 1014,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 1,
"IconRes": "UI/Sprite/MainCityMenus/Packer/IconSetUp.png",
"Name": "UIText_330"
},
{
"ID": 1015,
"LockType": 2,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 2,
"IconRes": "UI/Sprite/A1DynamicLoad/IconMenusOption/Packer/IconMail.png",
"Name": "UIText_331"
},
{
"ID": 1016,
"LockType": 2,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 2,
"IconRes": "UI/Sprite/A1DynamicLoad/IconMenusOption/Packer/IconNotice.png",
"Name": "UIText_332"
},
{
"ID": 1017,
"LockType": 2,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 2,
"IconRes": "UI/Sprite/A1DynamicLoad/IconMenusOption/Packer/IconFeedback.png",
"Name": "UIText_354"
},
{
"ID": 1018,
"LockType": 1,
"LockParam": "HollowPause_LockHint",
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 1019,
"LockType": 2,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 2,
"IconRes": "UI/Sprite/A1DynamicLoad/IconMenusOption/Packer/IconSignOut",
"Name": "UIText_367"
},
{
"ID": 10001,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10002,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10003,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10004,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10005,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10006,
"LockType": 1,
"LockParam": "InventoryText_LockHint",
"UnlockType": 0,
"UnlockParam": "InventoryText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10007,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10008,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10009,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10010,
"LockType": 1,
"LockParam": "SmithyText_LockHint",
"UnlockType": 1,
"UnlockParam": "SmithyText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10012,
"LockType": 1,
"LockParam": "RamenText_LockHint",
"UnlockType": 1,
"UnlockParam": "RamenText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10013,
"LockType": 1,
"LockParam": "WorkbenchText_LockHint",
"UnlockType": 1,
"UnlockParam": "WorkbenchText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10014,
"LockType": 1,
"LockParam": "VHSStoreText_LockHint",
"UnlockType": 1,
"UnlockParam": "VHSStoreText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10015,
"LockType": 1,
"LockParam": "GroceryText_LockHint",
"UnlockType": 1,
"UnlockParam": "GroceryText_UnlockHint",
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10017,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10018,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
},
{
"ID": 10019,
"LockType": 1,
"LockParam": null,
"UnlockType": 0,
"UnlockParam": null,
"MenuType": 0,
"IconRes": null,
"Name": null
}
]

View file

@ -32,6 +32,8 @@ macro_rules! template_collections {
}
template_collections! {
AvatarConfig;
UnlockConfig;
MainCityObject;
}

View file

@ -40,3 +40,102 @@ pub struct MainCityObjectTemplate {
pub npc_icon: Option<String>,
pub action_switch: Option<String>,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct UnlockConfigTemplate {
#[serde(rename = "ID")]
pub id: i32,
pub lock_type: i32,
pub lock_param: Option<String>,
pub unlock_type: i32,
pub unlock_param: Option<String>,
pub menu_type: i32,
pub icon_res: Option<String>,
pub name: Option<String>,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct AvatarConfigTemplate {
#[serde(rename = "ID")]
pub id: i32,
pub code_name: String,
pub name: String,
pub audio_event_replace_param: String,
pub audio_bank: String,
pub hud_icon_path: String,
pub hollow_icon_path: String,
pub icon_path: String,
pub rect_icon_path: String,
pub avatar_path: String,
pub script_config_path: String,
#[serde(rename = "UIScriptConfigPath")]
pub uiscript_config_path: String,
pub prefab_path: String,
#[serde(rename = "UIPrefabPath")]
pub uiprefab_path: String,
pub main_page_show: bool,
pub need_show: bool,
pub hit_types: Vec<i32>,
pub element_types: Vec<i32>,
pub tags: Vec<String>,
pub gender: i32,
pub camp: i32,
pub camp_name: Option<String>,
pub group_icon_path: String,
pub weapon_type: i32,
pub star_initial: i32,
#[serde(rename = "AvatarPieceID")]
pub avatar_piece_id: i32,
pub avatar_decompose: i32,
pub avatar_compose: i32,
#[serde(rename = "HP")]
pub hp: i32,
#[serde(rename = "HPGrowth")]
pub hp_growth: i32,
pub armor: i32,
pub armor_growth: i32,
pub shield: i32,
pub shield_growth: i32,
pub endurance: i32,
pub attack: i32,
pub attack_growth: i32,
pub defence: i32,
pub defence_growth: i32,
pub crit: i32,
pub crit_damage: i32,
pub crit_res: i32,
pub crit_dmg_res: i32,
pub pen_rate: i32,
pub pen_delta: i32,
pub luck: i32,
pub stun: i32,
pub break_stun: i32,
#[serde(rename = "SPBarPoint")]
pub spbar_point: i32,
pub sp_recover: i32,
#[serde(rename = "RBL")]
pub rbl: i32,
#[serde(rename = "RBLCorrectionFactor")]
pub rblcorrection_factor: i32,
#[serde(rename = "RBLProbability")]
pub rblprobability: i32,
pub buff_resist_burn_possibility_ratio: i32,
pub buff_resist_burn_possibility_delta: i32,
pub buff_resist_frozen_possibility_ratio: i32,
pub buff_resist_frozen_possibility_delta: i32,
pub buff_resist_electric_possibility_ratio: i32,
pub buff_resist_electric_possibility_delta: i32,
pub weapon: i32,
#[serde(rename = "RBP")]
pub rbp: i32,
#[serde(rename = "RBPFadeOutRate")]
pub rbp_fade_out_rate: i32,
#[serde(rename = "RBPFadeOutTime")]
pub rbp_fade_out_time: i32,
#[serde(rename = "RBPCorrectionFactor")]
pub rbp_correction_factor: i32,
#[serde(rename = "RBPProbability")]
pub rbp_probability: i32,
}

View file

@ -7,16 +7,6 @@ use crate::game::{globals, util};
use super::*;
static UNLOCK_AVATARS: [i32; 12] = [
1011, 1021, 1031, 1041, 1061, 1081, 1091, 1101, 1111, 1121, 1131, 1141,
];
static UNLOCK_FEATURES: [i32; 35] = [
1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1013, 1014, 1015, 1016, 1017,
1018, 1019, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10012, 10013,
10014, 10015, 10017, 10018, 10019,
];
pub async fn on_rpc_run_event_graph_arg(
session: &NetworkSession,
arg: &RpcRunEventGraphArg,
@ -144,7 +134,7 @@ pub async fn on_ptc_player_operation_arg(
pub async fn on_rpc_save_pos_in_main_city_arg(
session: &NetworkSession,
arg: &RpcSavePosInMainCityArg,
_arg: &RpcSavePosInMainCityArg,
) -> Result<()> {
tracing::info!("MainCity pos updated");
@ -217,12 +207,15 @@ pub async fn on_rpc_enter_world_arg(
item_manager.add_resource(10, 228);
item_manager.add_resource(100, 1337);
for avatar_id in UNLOCK_AVATARS {
for avatar_id in config::iter_avatar_config_collection()
.map(|c| c.id)
.filter(|id| *id < 2000)
{
item_manager.unlock_avatar(avatar_id);
}
let unlock_manager = session.context.unlock_manager.borrow();
for unlock_id in UNLOCK_FEATURES {
for unlock_id in config::iter_unlock_config_collection().map(|c| c.id) {
unlock_manager.unlock(unlock_id);
}