350 lines
6.2 KiB
Rust
350 lines
6.2 KiB
Rust
|
use engine::prelude::*;
|
||
|
|
||
|
use crate::game::content::prelude::*;
|
||
|
|
||
|
use std::env::var;
|
||
|
|
||
|
#[cfg(target_os = "windows")]
|
||
|
pub fn save_game_dir() -> String {
|
||
|
let b = var("LOCALAPPDATA").expect("couldn't get local appdata variable");
|
||
|
|
||
|
format!("{}\\gavania\\saves\\", b)
|
||
|
}
|
||
|
|
||
|
#[cfg(target_os = "linux")]
|
||
|
pub fn save_game_dir() -> String {
|
||
|
let b = var("HOME").expect("couldn't get HOME variable");
|
||
|
|
||
|
format!("{}/.local/share/gavania/saves/", b)
|
||
|
}
|
||
|
|
||
|
create_settings_section!(
|
||
|
General,
|
||
|
"General",
|
||
|
{
|
||
|
level: u32,
|
||
|
exp: u32,
|
||
|
name: String,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
HelmetSlot,
|
||
|
"Helmet",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
ChestPlateSlot,
|
||
|
"ChestPlate",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
BeltSlot,
|
||
|
"Belt",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
GlovesSlot,
|
||
|
"Gloves",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
BootsSlot,
|
||
|
"Boots",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
FirstRingSlot,
|
||
|
"Ring0",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
SecondRingSlot,
|
||
|
"Ring1",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
ThirdRingSlot,
|
||
|
"Ring2",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
FourthRingSlot,
|
||
|
"Ring3",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
FirstAmuletSlot,
|
||
|
"Amulet0",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
SecondAmuletSlot,
|
||
|
"Amulet1",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
MainHandSlot,
|
||
|
"MainHand",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
OffHandSlot,
|
||
|
"OffHand",
|
||
|
{
|
||
|
used: bool,
|
||
|
level: u32,
|
||
|
strength: u32,
|
||
|
agility: u32,
|
||
|
intelligence: u32,
|
||
|
rarity: Rarities,
|
||
|
[affixes: ItemAffix],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
InventorySave,
|
||
|
"Inventory",
|
||
|
{
|
||
|
[items: String],
|
||
|
[addons: String],
|
||
|
[books: String],
|
||
|
[jewels: String],
|
||
|
[maps: String],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
FirstAbilitySlot,
|
||
|
"FirstAbilitySlot",
|
||
|
{
|
||
|
used: bool,
|
||
|
name: String,
|
||
|
rarity: Rarities,
|
||
|
level: u32,
|
||
|
[addons: String],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
SecondAbilitySlot,
|
||
|
"SecondAbilitySlot",
|
||
|
{
|
||
|
used: bool,
|
||
|
name: String,
|
||
|
rarity: Rarities,
|
||
|
level: u32,
|
||
|
[addons: String],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
ThirdAbilitySlot,
|
||
|
"ThirdAbilitySlot",
|
||
|
{
|
||
|
used: bool,
|
||
|
name: String,
|
||
|
rarity: Rarities,
|
||
|
level: u32,
|
||
|
[addons: String],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
FourthAbilitySlot,
|
||
|
"FourthAbilitySlot",
|
||
|
{
|
||
|
used: bool,
|
||
|
name: String,
|
||
|
rarity: Rarities,
|
||
|
level: u32,
|
||
|
[addons: String],
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
CraftingMaterialInfo,
|
||
|
"CraftingMaterials",
|
||
|
{
|
||
|
common: u32,
|
||
|
uncommon: u32,
|
||
|
magical: u32,
|
||
|
rare: u32,
|
||
|
epic: u32,
|
||
|
legendary: u32,
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_section!(
|
||
|
PassivesInfo,
|
||
|
"Passives",
|
||
|
{
|
||
|
blood_mage: u32,
|
||
|
vampire: u32,
|
||
|
hermes: u32,
|
||
|
thick_skinned: u32,
|
||
|
super_brain: u32,
|
||
|
survivalist: u32,
|
||
|
soul_catcher: u32,
|
||
|
pyromancer: u32,
|
||
|
thunder_god: u32,
|
||
|
sea_monster: u32,
|
||
|
gladiator: u32,
|
||
|
lucky_devil: u32,
|
||
|
rogue: u32,
|
||
|
alchemist: u32,
|
||
|
}
|
||
|
);
|
||
|
|
||
|
create_settings_container!(
|
||
|
SaveGame,
|
||
|
{
|
||
|
general: General,
|
||
|
|
||
|
// items
|
||
|
helmet: HelmetSlot,
|
||
|
chest_plate: ChestPlateSlot,
|
||
|
belt: BeltSlot,
|
||
|
gloves: GlovesSlot,
|
||
|
boots: BootsSlot,
|
||
|
|
||
|
// rings
|
||
|
ring_0: FirstRingSlot,
|
||
|
ring_1: SecondRingSlot,
|
||
|
ring_2: ThirdRingSlot,
|
||
|
ring_3: FourthRingSlot,
|
||
|
|
||
|
// amulets
|
||
|
amulet_0: FirstAmuletSlot,
|
||
|
amulet_1: SecondAmuletSlot,
|
||
|
|
||
|
// hands
|
||
|
main_hand: MainHandSlot,
|
||
|
off_hand: OffHandSlot,
|
||
|
|
||
|
// inventory
|
||
|
inventory: InventorySave,
|
||
|
|
||
|
// abilities
|
||
|
ability_0: FirstAbilitySlot,
|
||
|
ability_1: SecondAbilitySlot,
|
||
|
ability_2: ThirdAbilitySlot,
|
||
|
ability_3: FourthAbilitySlot,
|
||
|
|
||
|
crafting_materials: CraftingMaterialInfo,
|
||
|
|
||
|
passives: PassivesInfo,
|
||
|
}
|
||
|
);
|