mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
164 lines
7.1 KiB
Rust
164 lines
7.1 KiB
Rust
use serde::{Serialize, Deserialize};
|
|
|
|
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
|
|
#[serde(default)]
|
|
pub struct WeaponData {
|
|
pub damage_inflicted: Option<i32>,
|
|
pub protonium_damage_scale: Option<f32>,
|
|
pub projectile_speed: Option<f32>,
|
|
pub projectile_range: Option<f32>,
|
|
pub base_inaccuracy: Option<f32>,
|
|
pub base_air_inaccuracy: Option<f32>,
|
|
pub movement_inaccuracy: Option<f32>,
|
|
pub movement_max_speed: Option<f32>,
|
|
pub movement_min_speed: Option<f32>,
|
|
pub gun_rotation_slow: Option<f32>,
|
|
pub movement_inaccuracy_decay: Option<f32>,
|
|
pub slow_rotation_decay: Option<f32>,
|
|
pub quick_rotation_decay: Option<f32>,
|
|
pub movement_inaccuracy_recovery: Option<f32>,
|
|
pub repeat_fire_inaccuracy_total_degrees: Option<f32>,
|
|
pub repeat_fire_inaccuracy_decay: Option<f32>,
|
|
pub repeat_fire_innaccuracy_recovery: Option<f32>,
|
|
pub fire_instant_accuracy_decay: Option<f32>, // degrees
|
|
pub accuracy_non_recover_time: Option<f32>,
|
|
pub accuracy_decay: Option<f32>,
|
|
pub damage_radius: Option<f32>,
|
|
pub plasma_time_to_full_damage: Option<f32>,
|
|
pub plasma_starting_radius_scale: Option<f32>,
|
|
pub nano_dps: Option<f32>,
|
|
pub nano_hps: Option<f32>,
|
|
pub tesla_damage: Option<f32>,
|
|
pub tesla_charges: Option<f32>,
|
|
pub aeroflak_proximity_damage: Option<f32>,
|
|
pub aeroflak_damage_radius: Option<f32>,
|
|
pub aeroflak_explosion_radius: Option<f32>,
|
|
pub aeroflak_ground_clearance: Option<f32>,
|
|
pub aeroflak_max_stacks: Option<i32>,
|
|
pub aeroflak_damage_per_stack: Option<i32>,
|
|
pub aeroflak_stack_expire: Option<f32>,
|
|
pub shot_cooldown: Option<f32>,
|
|
pub smart_rotation_cooldown: Option<f32>,
|
|
pub smart_rotation_cooldown_extra: Option<f32>,
|
|
pub smart_rotation_max_stacks: Option<f32>,
|
|
pub spin_up_time: Option<f32>,
|
|
pub spin_down_time: Option<f32>,
|
|
pub spin_initial_cooldown: Option<f32>,
|
|
#[serde(default = "group_fire_scales_default")]
|
|
pub group_fire_scales: Vec<f32>,
|
|
pub mana_cost: Option<f32>,
|
|
pub lock_time: Option<f32>,
|
|
pub full_lock_release: Option<f32>,
|
|
pub change_lock_time: Option<f32>,
|
|
pub max_rotation_speed: Option<f32>,
|
|
pub initial_rotation_speed: Option<f32>,
|
|
pub rotation_acceleration: Option<f32>,
|
|
pub nano_healing_priority_time: Option<f32>,
|
|
pub module_range: Option<f32>,
|
|
pub shield_lifetime: Option<f32>,
|
|
pub teleport_time: Option<f32>,
|
|
pub camera_time: Option<f32>,
|
|
pub camera_delay: Option<f32>,
|
|
pub to_invisible_speed: Option<f32>,
|
|
pub to_invisible_duration: Option<f32>,
|
|
pub to_visible_duration: Option<f32>,
|
|
pub countdown_time: Option<f32>,
|
|
pub stun_time: Option<f32>,
|
|
pub stun_radius: Option<f32>,
|
|
pub effect_duration: Option<f32>,
|
|
}
|
|
|
|
fn group_fire_scales_default() -> Vec<f32> {
|
|
vec![1.0]
|
|
}
|
|
|
|
impl std::convert::Into<crate::data::weapon_list::WeaponData> for WeaponData {
|
|
fn into(self) -> crate::data::weapon_list::WeaponData {
|
|
crate::data::weapon_list::WeaponData {
|
|
damage_inflicted: self.damage_inflicted,
|
|
protonium_damage_scale: self.protonium_damage_scale,
|
|
projectile_speed: self.projectile_speed,
|
|
projectile_range: self.projectile_range,
|
|
base_inaccuracy: self.base_inaccuracy,
|
|
base_air_inaccuracy: self.base_air_inaccuracy,
|
|
movement_inaccuracy: self.movement_inaccuracy,
|
|
movement_max_speed: self.movement_max_speed,
|
|
movement_min_speed: self.movement_min_speed,
|
|
gun_rotation_slow: self.gun_rotation_slow,
|
|
movement_inaccuracy_decay: self.movement_inaccuracy_decay,
|
|
slow_rotation_decay: self.slow_rotation_decay,
|
|
quick_rotation_decay: self.quick_rotation_decay,
|
|
movement_inaccuracy_recovery: self.movement_inaccuracy_recovery,
|
|
repeat_fire_inaccuracy_total_degrees: self.repeat_fire_inaccuracy_total_degrees,
|
|
repeat_fire_inaccuracy_decay: self.repeat_fire_inaccuracy_decay,
|
|
repeat_fire_innaccuracy_recovery: self.repeat_fire_innaccuracy_recovery,
|
|
fire_instant_accuracy_decay: self.fire_instant_accuracy_decay, // degrees
|
|
accuracy_non_recover_time: self.accuracy_non_recover_time,
|
|
accuracy_decay: self.accuracy_decay,
|
|
damage_radius: self.damage_radius,
|
|
plasma_time_to_full_damage: self.plasma_time_to_full_damage,
|
|
plasma_starting_radius_scale: self.plasma_starting_radius_scale,
|
|
nano_dps: self.nano_dps,
|
|
nano_hps: self.nano_hps,
|
|
tesla_damage: self.tesla_damage,
|
|
tesla_charges: self.tesla_charges,
|
|
aeroflak_proximity_damage: self.aeroflak_proximity_damage,
|
|
aeroflak_damage_radius: self.aeroflak_damage_radius,
|
|
aeroflak_explosion_radius: self.aeroflak_explosion_radius,
|
|
aeroflak_ground_clearance: self.aeroflak_ground_clearance,
|
|
aeroflak_max_stacks: self.aeroflak_max_stacks,
|
|
aeroflak_damage_per_stack: self.aeroflak_damage_per_stack,
|
|
aeroflak_stack_expire: self.aeroflak_stack_expire,
|
|
shot_cooldown: self.shot_cooldown,
|
|
smart_rotation_cooldown: self.smart_rotation_cooldown,
|
|
smart_rotation_cooldown_extra: self.smart_rotation_cooldown_extra,
|
|
smart_rotation_max_stacks: self.smart_rotation_max_stacks,
|
|
spin_up_time: self.spin_up_time,
|
|
spin_down_time: self.spin_down_time,
|
|
spin_initial_cooldown: self.spin_initial_cooldown,
|
|
group_fire_scales: self.group_fire_scales,
|
|
mana_cost: self.mana_cost,
|
|
lock_time: self.lock_time,
|
|
full_lock_release: self.full_lock_release,
|
|
change_lock_time: self.change_lock_time,
|
|
max_rotation_speed: self.max_rotation_speed,
|
|
initial_rotation_speed: self.initial_rotation_speed,
|
|
rotation_acceleration: self.rotation_acceleration,
|
|
nano_healing_priority_time: self.nano_healing_priority_time,
|
|
module_range: self.module_range,
|
|
shield_lifetime: self.shield_lifetime,
|
|
teleport_time: self.teleport_time,
|
|
camera_time: self.camera_time,
|
|
camera_delay: self.camera_delay,
|
|
to_invisible_speed: self.to_invisible_speed,
|
|
to_invisible_duration: self.to_invisible_duration,
|
|
to_visible_duration: self.to_visible_duration,
|
|
countdown_time: self.countdown_time,
|
|
stun_time: self.stun_time,
|
|
stun_radius: self.stun_radius,
|
|
effect_duration: self.effect_duration,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
|
|
pub struct WeaponUpgradeInfo {
|
|
pub xp: f64,
|
|
pub rating: i32,
|
|
pub rank: i32,
|
|
pub power: i32,
|
|
}
|
|
|
|
impl WeaponUpgradeInfo {
|
|
pub fn into_data(self, tier: super::ItemTier, type_: super::ItemCategory) -> crate::data::weapon_upgrade::WeaponUpgradeInfo {
|
|
crate::data::weapon_upgrade::WeaponUpgradeInfo {
|
|
tier: tier.into(),
|
|
type_: type_.into(),
|
|
xp: self.xp,
|
|
rating: self.rating,
|
|
rank: self.rank,
|
|
power: self.power,
|
|
}
|
|
}
|
|
}
|