Connected the battle engine to the UI. Beginning to make messages appear in the UI

This commit is contained in:
James Daly
2019-06-13 22:22:57 -04:00
parent 2805bbf1c7
commit 0b52e91a3d
11 changed files with 109 additions and 61 deletions

View File

@@ -13,7 +13,7 @@ brn:
if (!source.isMove) {
print(s"[${source.mon}'s ${source.effect}]")
}
println(s"${mon} was burned!")
msg(s"${mon} was burned!")
/*
if (sourceEffect && sourceEffect.id === 'flameorb') {
target.status = Status('brn', '[from] 'item': Flame Orb');
@@ -45,7 +45,7 @@ confusion:
val maxDmg = (2 * mon.level / 5 + 2) * 40 * mon(PAtk) / (mon(PDef) * 50) + 2
val minDmg = (17 \\ 20) * maxDmg
val dmg = rng.nextInt(minDmg, maxDmg)
println(s"${mon} hurt itself in its confusion.")
msg(s"${mon} hurt itself in its confusion.")
mon.takeDamage(dmg)
false
} else {
@@ -65,7 +65,7 @@ confusion:
onBeforeMovePriority: 3
onEnd: println(s"${mon} snapped out of its confusion.")
onStart: |-
println(s"${mon} was confused!")
msg(s"${mon} was confused!")
/*
if (sourceEffect && sourceEffect.id === 'lockedmove') {
this.add('-start', target, 'confusion', '[fatigue]');
@@ -102,7 +102,7 @@ par:
onBeforeMovePriority: 1
onBeforeMove: |
if (rng.chance(1, 4)) {
println(s"${mon} is fully paralyzed!")
msg(s"${mon} is fully paralyzed!")
false
} else {
true