Example #1
0
 protected function setUp()
 {
     $this->player = new Player();
     $this->player->uname = $this->data->uname;
     $this->player->player_id = $this->data->player_id;
     $this->player->level = $this->data->level;
     $this->player->health = $this->data->health;
     $this->player->stamina = Player::baseStaminaByLevel($this->data->level);
     $this->player->strength = Player::baseStrengthByLevel($this->data->level);
     $this->player->speed = Player::baseSpeedByLevel($this->data->level);
 }
/**
 * Smarty plugin to wrap player stamina calculation
 *
 * @param int $level Level of pc
 * @return int
 */
function smarty_function_stamina_by_level($level)
{
    return Player::baseStaminaByLevel((int) $level);
}