public function unequip(SR_Equipment $item, $announce = true) { $field = $item->getItemType(); if (!$item->changePosition('inventory')) { return false; } unset($this->sr4_equipment[$field]); $itemid = $item->getID(); $this->sr4_inventory[$itemid] = $item; // $field = $item->getItemType(); // $itemid = $item->getID(); // # Can unequip? // if ( (false === ($item = $this->getEquipment($field))) || ($item->getID() !== $itemid) ) // { // return false; // } // $this->sr4_inventory[$itemid] = $item; // if (false === $this->updateInventory()) // { // return false; // } // if (false === $this->updateEquipment($field, NULL)) // { // return false; // } # Busy has to be set. $busy = $this->isFighting() ? $this->busy($item->getItemUnequipTime()) : 0; if ($announce) { if ($this->isFighting()) { $this->msg('5203', array($item->getName(), $busy)); } else { $this->msg('5204', array($item->getName())); } } // $this->setOption(SR_Player::EQ_DIRTY|SR_Player::INV_DIRTY|SR_Player::STATS_DIRTY); return true; }
public function canEquip(SR_Equipment $item) { return false === Shadowfunc::checkRequirements($this, $item->getItemRequirements()); }