From fe1a85caecf4dcb3db55c56445f505bdfe6903f7 Mon Sep 17 00:00:00 2001 From: andy Date: Sat, 14 Nov 2020 15:30:37 -0400 Subject: [PATCH] mag a e s t h e t i c s --- src/entity/character.rs | 28 ++++++++++++++++++++++++++++ src/login/character.rs | 8 +++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/entity/character.rs b/src/entity/character.rs index c4f97de..00631bb 100644 --- a/src/entity/character.rs +++ b/src/entity/character.rs @@ -63,6 +63,34 @@ impl Into 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 { diff --git a/src/login/character.rs b/src/login/character.rs index af796db..82434f3 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -227,7 +227,13 @@ async fn new_character(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 {