Exemplo n.º 1
0
 /**
  * Read race, gender, eyes, haircut, tattoo
  *
  * @param Character $char
  */
 private function readAvatar(Character $char)
 {
     // angle=0&race=tr&gender=f&hair=99/0&tattoo=0&eyes=0
     $dir = $char->getDirection();
     $this->angle = $dir >= 0 && $dir <= 90 || $dir >= 270 ? 0 : 1;
     $this->race = $this->normalizeRace($char->getRace());
     $this->gender = $this->normalizeGender($char->getGender());
     list($index, $color) = $char->getSlot(EVisualSlot::HEAD_SLOT);
     $haircut = $this->normalizeHaircut($index, $color);
     if ($haircut) {
         $this->haircut = $this->getHaircutFile($this->race, $this->gender, $this->angle, $haircut['color'], $haircut['shape']);
     }
     list($tattoo, $eyeColor) = $char->getSlot(EVisualSlot::FACE_SLOT);
     $this->eyes = $this->getEyesFile($this->race, $this->gender, $this->angle, $eyeColor);
     $this->tattoo = $this->getTattooFile($this->race, $this->gender, $this->angle, $tattoo);
 }