mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Make edit mode usable; complete #11
This commit is contained in:
@@ -21,8 +21,8 @@ pub(super) fn client_config_provider() -> SimpleFunc<34, crate::UserTy, impl (Fn
|
||||
shield_hps: 2_000,
|
||||
request_review_level: 10_000,
|
||||
critical_ratio: 10.0,
|
||||
cross_promo_image: "https://git.ngni.us/TODO".to_owned(), // TODO
|
||||
cross_promo_link: "https://git.ngni.us/OpenJam/servers".to_owned(),
|
||||
cross_promo_image: "https://git.ngram.ca/assets/img/logo.png".to_owned(),
|
||||
cross_promo_link: "https://git.ngram.ca/OpenJam/servers".to_owned(),
|
||||
}.as_transmissible())
|
||||
].into(),
|
||||
}));
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 16;
|
||||
|
||||
pub(super) fn cube_inv_provider() -> SimpleFunc<16, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
pub(super) fn cube_inv_provider(cubes: &crate::persist::config::ConfigImpl) -> SimpleFunc<16, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
let cube_ids = <crate::persist::config::ConfigImpl as ConfigProvider<()>>::ids(cubes);
|
||||
SimpleFunc::new(move |params, _| {
|
||||
let mut params = params.to_dict();
|
||||
params.insert(PARAM_KEY, Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Int, // int
|
||||
val_ty: TypePrefix::Int, // int
|
||||
items: vec![
|
||||
(Typed::Int(0), Typed::Int(99)),
|
||||
] }));
|
||||
items: cube_ids.iter().map(|id| (Typed::Int(*id as _), Typed::Int(1))).collect()}));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
//use std::collections::HashMap;
|
||||
|
||||
use polariton_server::operations::Immediate;
|
||||
//use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
|
||||
|
||||
//use crate::data::cube_list::*;
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 1;
|
||||
//const DEFAULT_CUBE_ID: u32 = 227205318;
|
||||
|
||||
pub(super) fn cube_list_provider(cubes: &crate::persist::config::CubeConfig) -> Immediate<2, crate::UserTy> {
|
||||
pub(super) fn cube_list_provider(cubes: &crate::persist::config::ConfigImpl) -> Immediate<2, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, cubes.cube_list());
|
||||
|
||||
@@ -4,9 +4,11 @@ use polariton::operation::{ParameterTable, Typed};
|
||||
const PARAM_KEY: u8 = 54;
|
||||
|
||||
pub(super) fn garage_id_provider() -> SimpleFunc<177, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
SimpleFunc::new(|params, user: &crate::UserTy| {
|
||||
let lock = user.read().unwrap();
|
||||
let user_info = lock.user()?;
|
||||
let mut params = params.to_dict();
|
||||
params.insert(PARAM_KEY, Typed::Str(format!("{}_{}", 12345, 54321).into()));
|
||||
params.insert(PARAM_KEY, Typed::Str(user_info.selected_garage_uuid().into()));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,47 +1,19 @@
|
||||
use polariton::serdes::TypePrefix;
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
|
||||
use crate::data::garage_bay::*;
|
||||
use crate::data::weapon_list::ItemCategory;
|
||||
use polariton::operation::{ParameterTable, Typed};
|
||||
|
||||
const SLOTS_PARAM_KEY: u8 = 44;
|
||||
const SELECTED_SLOT_PARAM_KEY: u8 = 43;
|
||||
const SLOT_ORDER_PARAM_KEY: u8 = 58;
|
||||
|
||||
pub(super) fn garage_slot_provider() -> SimpleFunc<40, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
SimpleFunc::new(|params, user: &crate::UserTy| {
|
||||
let lock = user.read().unwrap();
|
||||
let user_info = lock.user()?;
|
||||
let mut params = params.to_dict();
|
||||
params.insert(SLOTS_PARAM_KEY, Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Int, // int
|
||||
val_ty: TypePrefix::HashMap, // hashmap
|
||||
items: vec![
|
||||
(Typed::Int(0), GarageSlotInfo {
|
||||
name: "Reverse-engineer great success! slot_name".to_owned(),
|
||||
cubes: 1,
|
||||
crf_id: 0,
|
||||
was_rated: false,
|
||||
movement_categories: vec![ItemCategory::Wheel],
|
||||
uuid: (2,4),
|
||||
thumbnail_version: 0,
|
||||
total_robot_cpu: 1,
|
||||
total_cosmetic_cpu: 0,
|
||||
total_robot_ranking: 1,
|
||||
bay_cpu: 2_000,
|
||||
tutorial_robot: false,
|
||||
starter_robot_index: -1,
|
||||
control_type: ControlType::Camera,
|
||||
control_options: ControlOptions { vertical_strafing: false, sideways_driving: false, tracks_turn_on_spot: false, },
|
||||
mastery_level: 1,
|
||||
bay_skin_id: "RC_MothershipSkin_Neptune_01".to_owned(), // TODO get the rest of the names
|
||||
weapon_order: vec![0],
|
||||
}.as_transmissible())
|
||||
],
|
||||
}));
|
||||
params.insert(SELECTED_SLOT_PARAM_KEY, Typed::Int(0));
|
||||
params.insert(SLOT_ORDER_PARAM_KEY, Typed::ObjArr(vec![
|
||||
Typed::Int(0),
|
||||
].into()));
|
||||
let all_slots = user_info.all_slots_by_id();
|
||||
params.insert(SLOTS_PARAM_KEY, all_slots.slot_info);
|
||||
params.insert(SELECTED_SLOT_PARAM_KEY, Typed::Int(user_info.selected_garage_slot() as _));
|
||||
params.insert(SLOT_ORDER_PARAM_KEY, all_slots.slot_order);
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed};
|
||||
|
||||
use crate::data::weapon_list::ItemCategory;
|
||||
use crate::data::garage_bay::*;
|
||||
|
||||
const SLOT_PARAM_KEY: u8 = 45; // uint
|
||||
const DATA_PARAM_KEY: u8 = 49; // byte arr
|
||||
const CUBES_COUNT_PARAM_KEY: u8 = 51; // int
|
||||
@@ -14,20 +11,68 @@ const CONTROL_OPTIONS_PARAM_KEY: u8 = 60; // bool arr
|
||||
const MASTERY_LEVEL_PARAM_KEY: u8 = 18; // int
|
||||
|
||||
pub(super) fn garage_machine_provider() -> SimpleFunc<43, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
SimpleFunc::new(|params, user: &crate::UserTy| {
|
||||
let mut params = params.to_dict();
|
||||
if let Some(garage_slot) = params.get(&SLOT_PARAM_KEY) {
|
||||
let lock = user.read().unwrap();
|
||||
let user_info = lock.user()?;
|
||||
if let Some(Typed::Int(garage_slot)) = params.get(&SLOT_PARAM_KEY) {
|
||||
log::debug!("Got machine request for slot {:?}", garage_slot);
|
||||
let machine = user_info.slot_by_id(*garage_slot)?;
|
||||
params.insert(DATA_PARAM_KEY, machine.data);
|
||||
params.insert(CUBES_COUNT_PARAM_KEY, machine.cube_count);
|
||||
params.insert(WEAPON_ORDER_PARAM_KEY, machine.weapon_order);
|
||||
params.insert(MOVEMENT_CATEGORIES_PARAM_KEY, machine.movement_categories);
|
||||
params.insert(CONTROL_TYPE_PARAM_KEY, machine.control_type);
|
||||
params.insert(CONTROL_OPTIONS_PARAM_KEY, machine.control_options);
|
||||
params.insert(MASTERY_LEVEL_PARAM_KEY, machine.mastery_level);
|
||||
} else {
|
||||
params.insert(SLOT_PARAM_KEY, Typed::Int(0));
|
||||
params.insert(SLOT_PARAM_KEY, Typed::Int(user_info.selected_garage_slot() as _));
|
||||
}
|
||||
params.insert(DATA_PARAM_KEY, Typed::Bytes(vec![0u8, 0u8, 0u8, 0u8].into())); // first 4 bytes are i32 for length of rest of data
|
||||
params.insert(CUBES_COUNT_PARAM_KEY, Typed::Int(1));
|
||||
params.insert(WEAPON_ORDER_PARAM_KEY, Typed::IntArr(vec![0].into()));
|
||||
params.insert(MOVEMENT_CATEGORIES_PARAM_KEY, Typed::IntArr(vec![ItemCategory::Wheel.but_bigger()].into()));
|
||||
params.insert(CONTROL_TYPE_PARAM_KEY, Typed::Int(ControlType::Camera as _));
|
||||
params.insert(CONTROL_OPTIONS_PARAM_KEY, ControlOptions { vertical_strafing: false, sideways_driving: false, tracks_turn_on_spot: false, }.as_transmissible());
|
||||
params.insert(MASTERY_LEVEL_PARAM_KEY, Typed::Int(0));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
const ERROR_PARAM_KEY: u8 = 47; // int
|
||||
//const UUID_PARAM_KEY: u8 = 54; // str
|
||||
const COMPRESSED_ROBOT_DATA_PARAM_KEY: u8 = 46; // byte arr
|
||||
const COMPRESSED_COLOUR_DATA_PARAM_KEY: u8 = 33; // byte arr
|
||||
|
||||
const INVALID_ROBOT_ERR: i16 = 140;
|
||||
|
||||
pub(super) fn garage_machine_save_provider() -> SimpleFunc<41, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, user: &crate::UserTy| {
|
||||
log::debug!("machine save params: {:?}", params);
|
||||
let mut params = params.to_dict();
|
||||
if let Some(Typed::Int(slot_index)) = params.remove(&SLOT_PARAM_KEY) {
|
||||
if let Some(Typed::Bytes(robot_data)) = params.remove(&COMPRESSED_ROBOT_DATA_PARAM_KEY) {
|
||||
if let Some(Typed::Bytes(colour_data)) = params.remove(&COMPRESSED_COLOUR_DATA_PARAM_KEY) {
|
||||
if let Some(Typed::Arr(weapon_order)) = params.remove(&WEAPON_ORDER_PARAM_KEY) {
|
||||
let weapon_order_filtered: Vec<_> = weapon_order.items.into_iter().filter_map(|ty| if let Typed::Int(i) = ty { Some(i) } else { None }).collect();
|
||||
let lock = user.read().unwrap();
|
||||
let user_info = lock.user()?;
|
||||
let vehicle_data = crate::persist::user::VehicleData {
|
||||
id: slot_index,
|
||||
robot_data: robot_data.vec,
|
||||
colour_data: colour_data.vec,
|
||||
weapon_order: weapon_order_filtered,
|
||||
};
|
||||
user_info.save_slot(vehicle_data)?;
|
||||
let mut params_out = std::collections::HashMap::with_capacity(1);
|
||||
params_out.insert(ERROR_PARAM_KEY, Typed::Int(0));
|
||||
return Ok(params_out.into());
|
||||
} else {
|
||||
log::warn!("weapon order is not this type (or does not exist)");
|
||||
}
|
||||
} else {
|
||||
log::warn!("colour data is not this type (or does not exist)");
|
||||
}
|
||||
} else {
|
||||
log::warn!("robot data is not this type (or does not exist)");
|
||||
}
|
||||
} else {
|
||||
log::warn!("slot is not this type (or does not exist)");
|
||||
}
|
||||
Err(INVALID_ROBOT_ERR)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,18 @@ const SLOT_PARAM_KEY: u8 = 31; // int
|
||||
const DATA_PARAM_KEY: u8 = 33; // byte arr
|
||||
|
||||
pub(super) fn garage_machine_colour_provider() -> SimpleFunc<33, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
SimpleFunc::new(|params, user: &crate::UserTy| {
|
||||
let mut params = params.to_dict();
|
||||
if let Some(garage_slot) = params.get(&SLOT_PARAM_KEY) {
|
||||
let lock = user.read().unwrap();
|
||||
let user_info = lock.user()?;
|
||||
if let Some(Typed::Int(garage_slot)) = params.get(&SLOT_PARAM_KEY) {
|
||||
log::debug!("Got machine colour request for slot {:?}", garage_slot);
|
||||
let machine = user_info.slot_by_id(*garage_slot)?;
|
||||
params.insert(DATA_PARAM_KEY, machine.colour_data);
|
||||
} else {
|
||||
params.insert(SLOT_PARAM_KEY, Typed::Int(0));
|
||||
params.insert(SLOT_PARAM_KEY, Typed::Int(user_info.selected_garage_slot() as _));
|
||||
}
|
||||
params.insert(DATA_PARAM_KEY, Typed::Bytes(vec![0u8, 0u8, 0u8, 0u8].into())); // first 4 bytes are i32 for length of rest of data
|
||||
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy>
|
||||
.without_state(taunts_config::taunts_config_provider())
|
||||
.without_state(all_customisations_info::all_customisations_provider())
|
||||
.without_state(tech_points::tech_points_provider())
|
||||
.without_state(cube_inventory::cube_inv_provider())
|
||||
.without_state(cube_inventory::cube_inv_provider(&init_ctx.cubes))
|
||||
.without_state(player_level::player_level_info_provider())
|
||||
.without_state(balance_info::balance_wallet_provider())
|
||||
.without_state(premium_duration::premium_remaining_provider())
|
||||
@@ -122,12 +122,12 @@ pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy>
|
||||
.without_state(garage_upgrades::garage_upgrades_provider())
|
||||
.without_state(game_event_params::event_system_params_provider())
|
||||
.without_state(garage_bay_uuid::garage_id_provider())
|
||||
.without_state(tech_tree_data::tech_tree_layout_provider())
|
||||
.without_state(tech_tree_data::tech_tree_layout_provider(&init_ctx.cubes))
|
||||
.without_state(item_shop_bundles::item_bundle_provider())
|
||||
.without_state(robot_customisations::bay_customisations_provider())
|
||||
.without_state(player_data::player_data_provider())
|
||||
.without_state(player_robopass::player_robopass_season_provider())
|
||||
.without_state(weapon_upgrades::weapons_upgrade_provider())
|
||||
.without_state(weapon_upgrades::weapons_upgrade_provider(&init_ctx.cubes))
|
||||
.without_state(polariton_server::operations::Ack::<172, _>::default()) // custom game change robot tier (param 67 is tier)
|
||||
.without_state(player_rank::rank_provider())
|
||||
.without_state(player_rank::rank_static_provider())
|
||||
@@ -158,5 +158,7 @@ pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy>
|
||||
.without_state(building_xp::building_xp_save_provider())
|
||||
.without_state(robot_sanction::all_robot_sanctions_provider())
|
||||
.without_state(reconnect_game::available_reconnect_provider())
|
||||
//.without_state(polariton_server::operations::Ack::<70, _>::default())
|
||||
.without_state(machine::garage_machine_save_provider())
|
||||
.without_state(polariton_server::operations::Ack::<32, _>::default()) // TODO handle SaveMachineColorRequest instead of ignoring it
|
||||
.without_state(polariton_server::operations::Ack::<45, _>::default()) // TODO handle UpdateThumbnailVersionRequest instead of ignoring it
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
//use polariton::serdes::TypePrefix;
|
||||
use polariton_server::operations::Immediate;
|
||||
//use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
|
||||
//use crate::data::movement_list::*;
|
||||
//use crate::data::cube_list::ItemTier;
|
||||
//use crate::data::weapon_list::ItemCategory;
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 1;
|
||||
|
||||
pub(super) fn movement_config_provider(cubes: &crate::persist::config::CubeConfig) -> Immediate<62, crate::UserTy> {
|
||||
pub(super) fn movement_config_provider(cubes: &crate::persist::config::ConfigImpl) -> Immediate<62, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, cubes.movement_list());
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
|
||||
|
||||
use crate::data::tech_tree::*;
|
||||
use polariton_server::operations::Immediate;
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 210;
|
||||
|
||||
pub(super) fn tech_tree_layout_provider() -> SimpleFunc<183, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
let mut params = params.to_dict();
|
||||
params.insert(PARAM_KEY, Typed::Dict(Dict {
|
||||
pub(super) fn tech_tree_layout_provider(cubes: &crate::persist::config::ConfigImpl) -> Immediate<183, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, cubes.tech_tree_nodes(&vec![
|
||||
227205318,
|
||||
227917916,
|
||||
1931676396,
|
||||
].into_iter().collect()));
|
||||
/*params.insert(PARAM_KEY, Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str, // str
|
||||
val_ty: TypePrefix::HashMap, // hashmap
|
||||
items: vec![
|
||||
@@ -17,12 +20,12 @@ pub(super) fn tech_tree_layout_provider() -> SimpleFunc<183, crate::UserTy, impl
|
||||
position_x: 0,
|
||||
position_y: 0,
|
||||
is_unlocked: true,
|
||||
is_unlockable: true,
|
||||
is_unlockable: false,
|
||||
tech_points: 1,
|
||||
neighbours: Vec::default(),
|
||||
}.as_transmissible_key_val(),
|
||||
],
|
||||
}));
|
||||
Ok(params.into())
|
||||
}));*/
|
||||
params.into()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,11 +6,13 @@ const DEV_PARAM_KEY: u8 = 11;
|
||||
const ADM_PARAM_KEY: u8 = 12;
|
||||
|
||||
pub(super) fn user_rights_provider() -> SimpleFunc<14, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
SimpleFunc::new(|params, user: &crate::UserTy| {
|
||||
let lock = user.read().unwrap();
|
||||
let user_info = lock.user()?;
|
||||
let mut params = params.to_dict();
|
||||
params.insert(MOD_PARAM_KEY, Typed::Bool(false.into()));
|
||||
params.insert(DEV_PARAM_KEY, Typed::Bool(false.into()));
|
||||
params.insert(ADM_PARAM_KEY, Typed::Bool(false.into()));
|
||||
params.insert(MOD_PARAM_KEY, Typed::Bool(user_info.is_mod()));
|
||||
params.insert(DEV_PARAM_KEY, Typed::Bool(user_info.is_dev()));
|
||||
params.insert(ADM_PARAM_KEY, Typed::Bool(user_info.is_admin()));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
//use polariton::serdes::TypePrefix;
|
||||
use polariton_server::operations::Immediate;
|
||||
//use polariton::operation::{Typed, Dict};
|
||||
|
||||
//use crate::data::weapon_list::*;
|
||||
//use crate::data::cube_list::ItemTier;
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 57;
|
||||
|
||||
pub(super) fn weapon_config_provider(cubes: &crate::persist::config::CubeConfig) -> Immediate<47, crate::UserTy> {
|
||||
pub(super) fn weapon_config_provider(cubes: &crate::persist::config::ConfigImpl) -> Immediate<47, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, cubes.weapon_list());
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed};
|
||||
|
||||
use crate::data::weapon_upgrade::*;
|
||||
use polariton_server::operations::Immediate;
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 38;
|
||||
|
||||
pub(super) fn weapons_upgrade_provider() -> SimpleFunc<82, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
let mut params = params.to_dict();
|
||||
params.insert(PARAM_KEY, Typed::ObjArr(vec![
|
||||
WeaponUpgradeInfo {
|
||||
tier: crate::data::cube_list::ItemTier::T0,
|
||||
type_: crate::data::weapon_list::ItemCategory::Laser,
|
||||
xp: 4.2,
|
||||
rating: 1,
|
||||
rank: 1,
|
||||
power: 1,
|
||||
}.as_transmissible(),
|
||||
].into()));
|
||||
Ok(params.into())
|
||||
pub(super) fn weapons_upgrade_provider(cubes: &crate::persist::config::ConfigImpl) -> Immediate<82, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, cubes.weapon_upgrade_list());
|
||||
params.into()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,6 +34,106 @@ pub(super) fn weapon_xp_provider() -> SimpleFunc<129, crate::UserTy, impl (Fn(Pa
|
||||
],
|
||||
}),
|
||||
].into())),
|
||||
(Typed::Int(ItemTier::T1 as _), Typed::ObjArr(vec![
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.1)),
|
||||
],
|
||||
}),
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.2)),
|
||||
],
|
||||
}),
|
||||
].into())),
|
||||
(Typed::Int(ItemTier::T2 as _), Typed::ObjArr(vec![
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.1)),
|
||||
],
|
||||
}),
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.2)),
|
||||
],
|
||||
}),
|
||||
].into())),
|
||||
(Typed::Int(ItemTier::T3 as _), Typed::ObjArr(vec![
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.1)),
|
||||
],
|
||||
}),
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.2)),
|
||||
],
|
||||
}),
|
||||
].into())),
|
||||
(Typed::Int(ItemTier::T4 as _), Typed::ObjArr(vec![
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.1)),
|
||||
],
|
||||
}),
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.2)),
|
||||
],
|
||||
}),
|
||||
].into())),
|
||||
(Typed::Int(ItemTier::T5 as _), Typed::ObjArr(vec![
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.1)),
|
||||
],
|
||||
}),
|
||||
Typed::Dict(Dict {
|
||||
key_ty: TypePrefix::Str,
|
||||
val_ty: TypePrefix::Any,
|
||||
items: vec![
|
||||
(Typed::Str("xp".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("costRobits".into()), Typed::Int(2_000)),
|
||||
(Typed::Str("damageMultiplier".into()), Typed::Float(1.2)),
|
||||
],
|
||||
}),
|
||||
].into())),
|
||||
],
|
||||
})),
|
||||
].into()));
|
||||
|
||||
Reference in New Issue
Block a user