1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Make power bar configurable

This commit is contained in:
NG (Graham)
2025-08-17 15:03:30 -04:00
parent 2674ab4035
commit 1403a6e3d0
6 changed files with 39 additions and 9 deletions

View File

@@ -16,6 +16,8 @@ pub struct BattleConfig {
pub multiplayer: super::MultiplayerConfig,
#[serde(default = "default_maps")]
pub maps: super::MapsConfig,
#[serde(default = "default_energy")]
pub energy: EnergyConfig,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
@@ -234,6 +236,12 @@ impl GameType {
}
}
#[derive(Serialize, Deserialize, Clone, Debug, Copy)]
pub struct EnergyConfig {
pub refill_rate_per_s: f32,
pub total: u32,
}
fn default_game_modes() -> GameModes {
GameModes {
battle_arena: GameMode {
@@ -498,3 +506,10 @@ fn default_maps() -> super::MapsConfig {
map: super::maps::default_map(),
}
}
fn default_energy() -> EnergyConfig {
EnergyConfig {
refill_rate_per_s: 0.1, // should take 10s to refill
total: 12_550,
}
}