Skip to content

Commit

Permalink
Merge pull request #167 from tinydetoon/dev
Browse files Browse the repository at this point in the history
Issue #156 : Profile XP Counter
  • Loading branch information
Kern046 authored Oct 5, 2017
2 parents 5c5e755 + f76cf29 commit b762290
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion system/Modules/Ares/Manager/CommanderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public function getEventInfo(Commander $commander) {
public function uChangeBase($commanderId) {
$commander = $this->get($commanderId);
$place = $this->placeManager->get($commander->rDestinationPlace);
$place->commanders = $this->getBaseCommanders($place->id);
$place->commanders = $this->getBaseCommanders($place->id,[Commander::AFFECTED,Commander::MOVING]);
$commanderPlace = $this->placeManager->get($commander->rBase);
$player = $this->playerManager->get($commander->rPlayer);
$playerBonus = $this->playerBonusManager->getBonusByPlayer($player);
Expand Down
17 changes: 6 additions & 11 deletions system/views/components/player/playerRoleplayProfil.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@

$baseLevelPlayer = $this->getContainer()->getParameter('zeus.player.base_level');
$exp = $player_playerRoleplayProfil->getExperience();
$nlv = $baseLevelPlayer * (pow(2, ($player_playerRoleplayProfil->getLevel() - 1)));
$clv = $baseLevelPlayer * (pow(2, ($player_playerRoleplayProfil->getLevel() - 2)));
$prc = ((($exp - $clv) * 200) / $nlv);

echo '<div class="number-box">';
echo '<span class="label">expérience</span>';
echo '<span class="value">' . Format::numberFormat($exp) . '</span>';
echo '</div>';
$nextlvl = $baseLevelPlayer * (pow(2, ($player_playerRoleplayProfil->getLevel() - 1)));
$currentlvl = $baseLevelPlayer * (pow(2, ($player_playerRoleplayProfil->getLevel() - 2)));
$prc = round(($exp -$currentlvl) / ($nextlvl -$currentlvl) * 100) ;

echo '<div class="number-box grey">';
echo '<span class="label">expérience nécessaire pour le prochain niveau</span>';
echo '<span class="value">' . Format::numberFormat($nlv) . '</span>';
echo '<span class="progress-bar">';
echo '<span class="label">Expérience</span>';
echo '<span class="value">'. Format::numberFormat($exp).' / ' . Format::numberFormat($nextlvl) . '</span>';
echo '<span title="' . $prc . ' %" class="progress-bar hb bl">';
echo '<span style="width:' . $prc . '%;" class="content"></span>';
echo '</span>';
echo '</div>';
Expand Down

0 comments on commit b762290

Please sign in to comment.