Browse Source

mag a e s t h e t i c s

pbs
andy 4 years ago
parent
commit
fe1a85caec
  1. 28
      src/entity/character.rs
  2. 8
      src/login/character.rs

28
src/entity/character.rs

@ -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)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, enum_utils::FromStr, derive_more::Display, Serialize, Deserialize)]
pub enum SectionID { pub enum SectionID {

8
src/login/character.rs

@ -227,7 +227,13 @@ async fn new_character<EG: EntityGateway>(entity_gateway: &mut EG, user: &UserAc
character_id: character.id, character_id: character.id,
}}).await.unwrap(); }}).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); mag.change_owner(character.char_class, character.section_id);
let mag = entity_gateway.create_item( let mag = entity_gateway.create_item(
NewItemEntity { NewItemEntity {

Loading…
Cancel
Save