/** * @covers Character::setVpc */ public function testSetVpc() { // properties are all set to 1 $vpc = '1200958908699209'; $this->character->setVpc($vpc); $this->assertEquals([1, 1, 1, 1, 1, 1, 1, 1], $this->character->getMorph()); $this->assertEquals([1, 1], $this->character->getSlot(EVisualSlot::FACE_SLOT)); $this->assertEquals([1, 1, 1, 1, 1], $this->character->getGabarit()); }
/** * Read equipped armor parts * * @param Character $char */ private function readArmor(Character $char) { // head=igthu/0&chest=ictalv/1&arms=ictals/1&hands=ictalg/1&feet=ictalb/1&legs=ictalp/1&size=large $this->armor = []; // armor parts <sheet/color> $parts = [EVisualSlot::HEAD_SLOT => 'head', EVisualSlot::ARMS_SLOT => 'arms', EVisualSlot::HANDS_SLOT => 'hands', EVisualSlot::CHEST_SLOT => 'chest', EVisualSlot::FEET_SLOT => 'feet', EVisualSlot::LEGS_SLOT => 'legs']; foreach ($parts as $slot => $key) { if ($this->haircut && $slot === EVisualSlot::HEAD_SLOT) { // we have haircut, so ignore this continue; } list($index, $color) = $char->getSlot($slot); $item = $this->lookupSlotItem($slot, $index); $image = $this->getArmorFile($this->race, $this->angle, $color, $item['grade'], $item['shape']); $this->armor[$key] = $image; } // TODO: sort parts same way javascript does //$sk = ['head' => 40, 'chest' => 30, 'legs' => 10, 'feet' => 20, 'arms' => 10, 'hands' => 5]; // vest == 'm' and vest.type == 'l' -> vest = pants + 1 || vest = pants - 1 // pants.type == 'c' -> boots = pants -1 }