Skip to content

Commit

Permalink
Fixed bug not showing bonus tab. Updated it's text to match current s…
Browse files Browse the repository at this point in the history
…coring
  • Loading branch information
strinsberg committed Jun 26, 2020
1 parent 117c886 commit ebf42d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/components/game/SideObjectives.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ export default {
},
computed: {
...mapState([
'stacks'
'stacks',
'hands'
]),
/**
* Get an object with all the player's bonus scores.
*/
getBonuses () {
let stacks = this.stacks.filter(s => s.playerId === this.player.id)
return this.player.objectives.getBonuses(stacks)
let hand = this.hands.find(h => h.playerId === this.player.id)
return this.player.objectives.getBonuses(hand, stacks)
},
/**
* Returns a list of all the condition data.
Expand All @@ -72,17 +74,17 @@ export default {
let conds = []
conds.push({if: "group_card_played", reward: "+5 pts/card",
val: this.bonuses.group})
conds.push({if: "repeat_card_played", reward: "+2 pts/card",
conds.push({if: "repeat_card_played", reward: "+3 pts/card",
val: this.bonuses.repeat})
conds.push({if: "variable_card_played", reward: "+3 pts/card",
conds.push({if: "variable_card_played", reward: "+2 pts/card",
val: this.bonuses.variable})
conds.push({if: "safety_card_played", reward: "+10 pts/card",
conds.push({if: "safety_card_played", reward: "+3 pts/card",
val: this.bonuses.safety})
conds.push({if: "all_safeties", reward: "+10 pts",
conds.push({if: "defensive_bonus", reward: "Antivirus +10 || Firewall +5",
val: this.bonuses.defensive})
conds.push({if: "no_malware", reward: "+10 pts",
val: this.bonuses.clean})
conds.push({if: "complete_program", reward: "+10 pts",
conds.push({if: "nested_loops", reward: "+5 pts/per nested loop",
val: this.bonuses.complete})
return conds
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/WinnerModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<tr> <th>Nested Loops</th>
<td v-for="player in players" :key="player.id">{{ playerScore(player.id).bonuses.complete }}</td>
</tr>
<tr> <th>Defensive Programmer (AntiVirus)</th>
<tr> <th>Defensive Programmer</th>
<td v-for="player in players" :key="player.id">{{ playerScore(player.id).bonuses.defensive }}</td>
</tr>
<tr> <th>Clean System (No Malware)</th>
Expand Down

0 comments on commit ebf42d6

Please sign in to comment.