-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbb1e0a
commit 8f4e0b2
Showing
7 changed files
with
76 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,34 @@ | ||
|
||
|
||
function onlyType(state, condition) { | ||
let boolean = false; | ||
state.hand.forEach(card => { | ||
if(card.type !== condition.type) { | ||
boolean = true; | ||
} | ||
}) | ||
let boolean = false | ||
state.hand.forEach((card) => { | ||
if (card.type !== condition.type) { | ||
boolean = true | ||
} | ||
}) | ||
|
||
return boolean | ||
return boolean | ||
} | ||
|
||
function shouldNotHaveLessThen(state, condition) { | ||
let boolean = false; | ||
const player = state.player; | ||
if((player.currentHealth / player.maxHealth) * 100 < condition.percentage) { | ||
boolean = true | ||
} | ||
return boolean | ||
let boolean = false | ||
const player = state.player | ||
if ((player.currentHealth / player.maxHealth) * 100 < condition.percentage) { | ||
boolean = true | ||
} | ||
return boolean | ||
} | ||
|
||
function shouldNotHaveMoreThen(state, condition) { | ||
let boolean = false; | ||
const player = state.player; | ||
if((player.currentHealth / player.maxHealth) * 100 > condition.percentage) { | ||
boolean = true | ||
} | ||
return boolean | ||
let boolean = false | ||
const player = state.player | ||
if ((player.currentHealth / player.maxHealth) * 100 > condition.percentage) { | ||
boolean = true | ||
} | ||
return boolean | ||
} | ||
|
||
|
||
export default { | ||
onlyType, | ||
shouldNotHaveLessThen, | ||
shouldNotHaveMoreThen | ||
} | ||
onlyType, | ||
shouldNotHaveLessThen, | ||
shouldNotHaveMoreThen, | ||
} |
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