Skip to main content

vitium_api/game/
prof.rs

1use serde::{Deserialize, Serialize};
2use std::collections::{HashMap, HashSet};
3
4use fe3o4::Id;
5
6use super::{Attr, Mart, Spell};
7
8/// Profession.
9#[derive(Serialize, Deserialize, Clone)]
10#[cfg_attr(target_family = "wasm", derive(tsify_next::Tsify))]
11#[cfg_attr(
12    target_family = "wasm",
13    tsify(into_wasm_abi, from_wasm_abi, large_number_types_as_bigints)
14)]
15pub struct Prof {
16    /// Coefficient of money for an initial character, timed by level.
17    pub credit: u16,
18    /// Attribution bonus provided by this profession.
19    pub attr_bonus: HashMap<Id<Attr>, i16>,
20    /// Skills which this professions provides bonus.
21    pub skill_bonus: HashMap<Id<Attr>, i16>,
22    /// Martial arts automatically learnt.
23    pub mart: HashMap<Id<Mart>, i16>,
24    /// Spells automatically learnt.
25    pub spell: HashSet<Id<Spell>>,
26    // /// Initial items given by this profession.
27    // pub item: Vec<Id<Item>>,
28}