mag a e s t h e t i c s

This commit is contained in:
andy 2020-11-14 15:30:37 -04:00
parent 82c4c2a445
commit fe1a85caec
2 changed files with 35 additions and 1 deletions

View File

@ -63,6 +63,34 @@ impl Into<u8> for CharacterClass {
}
}
impl CharacterClass {
pub fn is_human(&self) -> bool {
match self {
CharacterClass::HUmar |
CharacterClass::RAmar | CharacterClass::RAmarl |
CharacterClass::FOmar | CharacterClass::FOmarl => true,
_ => false,
}
}
pub fn is_newman(&self) -> bool {
match self {
CharacterClass::HUnewearl |
CharacterClass::FOnewm | CharacterClass::FOnewearl => true,
_ => false,
}
}
pub fn is_android(&self) -> bool {
match self {
CharacterClass::HUcast | CharacterClass::HUcaseal |
CharacterClass::RAcast | CharacterClass::RAcaseal => true,
_ => false,
}
}
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, enum_utils::FromStr, derive_more::Display, Serialize, Deserialize)]
pub enum SectionID {

View File

@ -227,7 +227,13 @@ async fn new_character<EG: EntityGateway>(entity_gateway: &mut EG, user: &UserAc
character_id: character.id,
}}).await.unwrap();
let mut mag = Mag::baby_mag(character.appearance.skin);
let mut mag = {
if character.char_class.is_android() {
Mag::baby_mag(character.appearance.skin)
} else {
Mag::baby_mag(character.appearance.costume)
}
};
mag.change_owner(character.char_class, character.section_id);
let mag = entity_gateway.create_item(
NewItemEntity {