-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle taking the turn out of order correctly
- Loading branch information
Showing
4 changed files
with
47 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
{{#if @root.hasCombatStarted}} | ||
{{! If the combatant HAS turns left }} | ||
{{#if (and @root.round (lookup @root.turnsLeft this.id))}} | ||
{{! If a combatant has already started a turn }} | ||
{{#if @root.turnStarted}} | ||
{{#if (eq @root.combatant.id this.id)}} | ||
<a class="combatant-control take-turn" role="button" data-action="end-turn"> | ||
<i class="mats-o mats-fill">check_circle</i> | ||
</a> | ||
{{/if}} | ||
{{! If a combatant can start a turn }} | ||
{{else}} | ||
<a class="combatant-control take-turn" role="button" data-action="start-turn"> | ||
<i class="mats-o mats-fill">counter_{{lookup @root.turnsLeft this.id}}</i> | ||
</a> | ||
{{/if}} | ||
{{else}} | ||
{{#if @root.outOfTurn}} | ||
{{#if this.owner}} | ||
<a class="combatant-control take-turn out-of-turn" | ||
data-action="take-turn-out-of-turn"> | ||
{{# if (gt (lookup @root.totalTurns this.id) 1)}} | ||
<i class="mats-o">counter_{{lookup @root.turnsLeft this.id}}</i> | ||
{{else}} | ||
<i class="mats-o">check_circle</i> | ||
{{/if}} | ||
{{! If the combatant's faction CAN take a turn}} | ||
{{#if (eq @root.currentTurn this.faction)}} | ||
<a class="combatant-control take-turn" role="button" data-action="start-turn"> | ||
<i class="mats-o mats-fill">counter_{{lookup @root.turnsLeft this.id}}</i> | ||
</a> | ||
{{! If the turn is taken out of order due to some mechanic }} | ||
{{else}} | ||
<span class="combatant-control take-turn"> | ||
<i class="mats-o">check_circle</i> | ||
</span> | ||
{{#if this.isOwner}} | ||
<a class="combatant-control take-turn out-of-turn" data-action="take-turn-out-of-turn"> | ||
<i class="mats-o">counter_{{lookup @root.turnsLeft this.id}}</i> | ||
</a> | ||
{{/if}} | ||
{{/if}} | ||
{{/if}} | ||
{{! If the combatant has NO turns left }} | ||
{{else}} | ||
<a class="combatant-control" style="opacity: 0.5"> | ||
<i class="mats-o mats-fill">check_circle</i> | ||
</a> | ||
{{/if}} | ||
{{/if}} |