Skip to content

Commit

Permalink
add achievements to storymode
Browse files Browse the repository at this point in the history
  • Loading branch information
TimRepke committed Oct 20, 2016
1 parent e0aa1cb commit 4665a71
Show file tree
Hide file tree
Showing 8 changed files with 949 additions and 1,085 deletions.
2 changes: 1 addition & 1 deletion registration-system/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ private function showSignup($fahrt) {
else
header("Location: ?fid=" . $fid . "&saveerror=" . $saveResult);
} else {
if (true or !isset($_REQUEST['hideErrors'])) {
if (!isset($_REQUEST['hideErrors'])) {
$this->showErrors($bachelor->getValidationErrors());
}
$signup_method->getFallbackMethod()->showInlineHTML();
Expand Down
5 changes: 1 addition & 4 deletions registration-system/view/signups/game1/js/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,10 +1149,7 @@ Story.credits = function () {

function allDone() {
clearInterval(standbyLoop);
Environment.fapi.setValue('signupstats', {
'method': 'game1',
'methodinfo': {'achievedAchievements': Game.achievements.achievedAchievements}
});
Environment.fapi.data.setSignupStats('game1', {'achievedAchievements': Game.achievements.achievedAchievements});
Environment.fapi.submitSignup();
}
};
Expand Down
175 changes: 87 additions & 88 deletions registration-system/view/signups/story/graphics/age.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 55 additions & 66 deletions registration-system/view/signups/story/graphics/begin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
195 changes: 93 additions & 102 deletions registration-system/view/signups/story/graphics/eat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 68 additions & 66 deletions registration-system/view/signups/story/graphics/travelEnd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion registration-system/view/signups/story/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ public static function getLogo() {
}

public static function getScore($stats) {
return rand(30,99);
$allowedAchievements = ['test','stein','elch2','bagger','ball','ohh','star','park'];
if (isset($stats['achievements'])) {
$cnt = 0;
foreach($stats['achievements'] as $a){
if (in_array($a, $allowedAchievements)) $cnt++;
}
return round($cnt/count($allowedAchievements)*100);
}
return 0;
}

public static function getBadgeDetails($stats) {
Expand Down
Loading

0 comments on commit 4665a71

Please sign in to comment.