pub struct UpgradeableFighter {
pub name: Arc<str>,
pub is_companion: bool,
pub level: u16,
pub class: Class,
pub attribute_basis: EnumMap<AttributeType, u32>,
pub pet_attribute_bonus_perc: EnumMap<AttributeType, f64>,
pub equipment: Equipment,
pub active_potions: [Option<Potion>; 3],
pub portal_hp_bonus: u32,
pub portal_dmg_bonus: u32,
pub gladiator: u32,
}Fields§
§name: Arc<str>§is_companion: bool§level: u16§class: Class§attribute_basis: EnumMap<AttributeType, u32>The base attributes without any equipment, or other boosts
pet_attribute_bonus_perc: EnumMap<AttributeType, f64>§equipment: Equipment§active_potions: [Option<Potion>; 3]§portal_hp_bonus: u32This should be the percentage bonus to skills from pets The hp bonus in percent this player has from the personal demon portal
portal_dmg_bonus: u32The damage bonus in percent this player has from the guild demon portal
gladiator: u32Implementations§
Source§impl UpgradeableFighter
impl UpgradeableFighter
Sourcepub fn insert_gem(
&mut self,
gem: Gem,
slot: EquipmentSlot,
) -> Result<Option<Gem>, Gem>
pub fn insert_gem( &mut self, gem: Gem, slot: EquipmentSlot, ) -> Result<Option<Gem>, Gem>
Inserts a gem on the item in the specified slot If the gem could be inserted the old gem (if any) will be returned
§Errors
Will return Err if the gem could not be inserted. It will contain
the gem you tried to insert
Sourcepub fn extract_gem(&mut self, slot: EquipmentSlot) -> Option<Gem>
pub fn extract_gem(&mut self, slot: EquipmentSlot) -> Option<Gem>
Removes the gem at the provided slot and returns the old gem, if any
Sourcepub fn use_potion(&mut self, potion: Potion, slot: usize) -> Option<Potion>
pub fn use_potion(&mut self, potion: Potion, slot: usize) -> Option<Potion>
Uses a potion in the provided slot and returns the old potion, if any
Sourcepub fn remove_potion(&mut self, slot: usize) -> Option<Potion>
pub fn remove_potion(&mut self, slot: usize) -> Option<Potion>
Removes the potion at the provided slot and returns the old potion, if any
Sourcepub fn equip(
&mut self,
item: Item,
slot: EquipmentSlot,
) -> Result<Option<Item>, Item>
pub fn equip( &mut self, item: Item, slot: EquipmentSlot, ) -> Result<Option<Item>, Item>
Equip the provided item. If the item could be equiped, the previous item will be returned
§Errors
Will return Err if the item could not be equipped. It will contain
the item you tried to insert
Sourcepub fn unequip(&mut self, slot: EquipmentSlot) -> Option<Item>
pub fn unequip(&mut self, slot: EquipmentSlot) -> Option<Item>
Unequips the item at the provided slot and returns the old item, if any
Sourcepub fn get_equipment(&self, slot: EquipmentSlot) -> Option<&Item>
pub fn get_equipment(&self, slot: EquipmentSlot) -> Option<&Item>
Unequips the item at the provided slot and returns the old item, if any
pub fn from_other(other: &OtherPlayer) -> Self
pub fn attributes(&self) -> EnumMap<AttributeType, u32>
pub fn hit_points(&self, attributes: &EnumMap<AttributeType, u32>) -> i64
Trait Implementations§
Source§impl Clone for UpgradeableFighter
impl Clone for UpgradeableFighter
Source§fn clone(&self) -> UpgradeableFighter
fn clone(&self) -> UpgradeableFighter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more