Esempio n. 1
0
 public static function getApproximation(RPGPlayer $player)
 {
     $approximation = $player->getStatus()->level * 2;
     if ($player->hasSkill(SkillArrowMastery::getId())) {
         /**
          * @var $mastery SkillArrowMastery
          */
         $mastery = $player->getSkillById(SkillArrowMastery::getId());
         $approximation -= $mastery->getLevel() * 5;
     }
     return $approximation < 0 ? 0 : $approximation;
 }
 public static function canBeAcquired(RPGPlayer $player)
 {
     return $player->getCurrentJob()->getId() === JobArcher::getId() && $player->getStatus()->level > 40;
 }
Esempio n. 3
0
 public function createPlayer(Player $player)
 {
     $dataFile = $this->getDataFolder() . strtolower($player->getName()) . ".player";
     if (is_file($this->getDataFolder() . $player->getName() . ".player") && !is_file($dataFile)) {
         rename($this->getDataFolder() . $player->getName() . ".player", $dataFile);
     }
     if (is_file($dataFile)) {
         $data = json_decode(file_get_contents($dataFile), true);
         $this->players[$player->getName()] = RPGPlayer::getFromSaveData($player, $data);
     } else {
         $this->players[$player->getName()] = new RPGPlayer($player);
     }
     $player->setDisplayName(self::getTranslation("LV") . "." . $this->players[$player->getName()]->getStatus()->level . " " . $player->getDisplayName());
 }
Esempio n. 4
0
 public static function canBeAcquired(RPGPlayer $player)
 {
     return $player->getCurrentJob() instanceof JobArcher;
 }