Skip to content

Commit

Permalink
Maze: change kit number
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrobo committed Apr 7, 2024
1 parent fb66f38 commit 914f735
Show file tree
Hide file tree
Showing 13 changed files with 2,249 additions and 114 deletions.
6 changes: 3 additions & 3 deletions helper/scoreCalculatorRules/2024.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ module.exports.calculateMazeScore = function (run) {
}

const maxKits = {
H: 3,
S: 2,
H: 2,
S: 1,
U: 0,
Red: 1,
Red: 2,
Yellow: 1,
Green: 0,
};
Expand Down
12 changes: 6 additions & 6 deletions helper/scoreSheetPDFMazeRules/2024.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function drawRun(doc, config, scoringRun) {
doc,
x,
y,
'scoresheet_generation/maze/l3.png',
'scoresheet_generation/maze/l2.png',
base_size_x,
50,
'center'
Expand Down Expand Up @@ -372,7 +372,7 @@ function drawRun(doc, config, scoringRun) {
doc,
x,
y,
'scoresheet_generation/maze/f3.png',
'scoresheet_generation/maze/f2.png',
base_size_x,
50,
'center'
Expand Down Expand Up @@ -412,7 +412,7 @@ function drawRun(doc, config, scoringRun) {
doc,
x,
y,
'scoresheet_generation/maze/l2.png',
'scoresheet_generation/maze/l1.png',
base_size_x,
50,
'center'
Expand Down Expand Up @@ -449,7 +449,7 @@ function drawRun(doc, config, scoringRun) {
doc,
x,
y,
'scoresheet_generation/maze/f2.png',
'scoresheet_generation/maze/f1.png',
base_size_x,
50,
'center'
Expand Down Expand Up @@ -566,7 +566,7 @@ function drawRun(doc, config, scoringRun) {
doc,
x,
y,
'scoresheet_generation/maze/l1.png',
'scoresheet_generation/maze/l2.png',
base_size_x,
50,
'center'
Expand Down Expand Up @@ -603,7 +603,7 @@ function drawRun(doc, config, scoringRun) {
doc,
x,
y,
'scoresheet_generation/maze/f1.png',
'scoresheet_generation/maze/f2.png',
base_size_x,
50,
'center'
Expand Down
60 changes: 15 additions & 45 deletions public/javascripts/judge/maze_2024.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,15 @@ app.controller('ddController', ['$scope', '$uibModal', '$log', '$timeout', '$htt
$scope.length = response.data.length;
$scope.duration = response.data.duration || 480;
$scope.leagueType = response.data.leagueType;
if (response.data.leagueType == "entry") {
// Identification bonus
maxKit={
'Red': 1,
'Green': 1
};
} else {
maxKit={
'H': 3,
'S': 2,
'U': 0,
'Red': 1,
'Yellow': 1,
'Green': 0
};
}

maxKit={
'H': 2,
'S': 1,
'U': 0,
'Red': 2,
'Yellow': 1,
'Green': 0
};

if(response.data.parent){
if(!$scope.dice){
Expand Down Expand Up @@ -496,15 +489,13 @@ app.controller('ddController', ['$scope', '$uibModal', '$log', '$timeout', '$htt
top: false,
right: false,
left: false,
bottom: false,
floor: false
bottom: false
},
rescueKits: {
top: 0,
right: 0,
bottom: 0,
left: 0,
floor: 0
left: 0
}
}
};
Expand Down Expand Up @@ -565,15 +556,6 @@ app.controller('ddController', ['$scope', '$uibModal', '$log', '$timeout', '$htt
possible += maxKit[cell.tile.victims.bottom];
current += Math.min(tile.scoredItems.rescueKits.bottom,maxKit[cell.tile.victims.bottom]);
}
if(cell.tile.victims.floor != "None"){
possible++;
current += tile.scoredItems.victims.floor;
console.log(current)
possible += maxKit[cell.tile.victims.floor];
current += Math.min(tile.scoredItems.rescueKits.floor,maxKit[cell.tile.victims.floor]);
}



if (tile.processing)
return "processing";
Expand Down Expand Up @@ -607,15 +589,13 @@ app.controller('ddController', ['$scope', '$uibModal', '$log', '$timeout', '$htt
top: false,
right: false,
left: false,
bottom: false,
floor: false
bottom: false
},
rescueKits: {
top: 0,
right: 0,
bottom: 0,
left: 0,
floor: 0
left: 0
}
}
};
Expand All @@ -625,8 +605,7 @@ app.controller('ddController', ['$scope', '$uibModal', '$log', '$timeout', '$htt
var hasVictims = (cell.tile.victims.top != "None") ||
(cell.tile.victims.right != "None") ||
(cell.tile.victims.bottom != "None") ||
(cell.tile.victims.left != "None") ||
(cell.tile.victims.floor != "None");
(cell.tile.victims.left != "None");

// Total number of scorable things on this tile
var total = !!cell.tile.speedbump + !!cell.tile.checkpoint + !!cell.tile.steps + !!cell.tile.ramp + hasVictims;
Expand Down Expand Up @@ -871,8 +850,7 @@ app.controller('ModalInstanceCtrl', ['$scope','$uibModalInstance','cell','tile',
$scope.hasVictims = (cell.tile.victims.top != "None") ||
(cell.tile.victims.right != "None") ||
(cell.tile.victims.bottom != "None") ||
(cell.tile.victims.left != "None") ||
(cell.tile.victims.floor != "None");
(cell.tile.victims.left != "None");
$scope.clickSound = function(){
playSound(sClick);
};
Expand Down Expand Up @@ -910,14 +888,6 @@ app.controller('ModalInstanceCtrl', ['$scope','$uibModalInstance','cell','tile',
$scope.tile.scoredItems.steps = !$scope.tile.scoredItems.steps;
};

$scope.applyEntryVictimRestriction= function(direction) {
playSound(sClick);
if (!$scope.tile.scoredItems.victims[direction]) {
$scope.tile.scoredItems.rescueKits[direction] = 0;
}
}


$scope.lightStatus = function(light, kit){
if(light) return true;
return false;
Expand Down
Loading

0 comments on commit 914f735

Please sign in to comment.