This commit is contained in:
2022-10-26 14:32:18 +03:00
parent 7a555d5d0f
commit 955231eff0
163 changed files with 3287 additions and 0 deletions
@@ -0,0 +1,18 @@
package pokemon
import ru.ifmo.se.pokemon.Battle
import ru.ifmo.se.pokemon.Pokemon
fun Battle.addAllies(vararg allies: Pokemon) {
allies.forEach { addAlly(it) }
}
fun Battle.addFoes(vararg allies: Pokemon) {
allies.forEach { addFoe(it) }
}
fun chance(percent: Int): Boolean {
return Math.random() < (percent / 100)
}
fun chance(percent: Int, action: () -> Unit): Boolean {
return Math.random() < (percent / 100)
}