Added a configuration file for seting up parameters
This commit is contained in:
@@ -9,6 +9,7 @@ import scala.io.Source
|
||||
import scala.util.Random
|
||||
|
||||
import Statistic._
|
||||
import fmon._
|
||||
import fmon.battle.msg.{Message, SignalConsumer}
|
||||
import fmon.util._
|
||||
|
||||
@@ -142,7 +143,7 @@ abstract class Move extends MoveTurn {
|
||||
val actualPow = if (powCallback != null) powCallback(user, this, target, reader, rng) else pow
|
||||
val baseDmg = (2 * user.level / 5 + 2) * actualPow * user(atkStat) / (target(defStat) * 50) + 2
|
||||
val effectiveness = target.effectiveness(element)
|
||||
val multiplier = effectiveness * critMultiplier(user, target)
|
||||
val multiplier = effectiveness * critMultiplier(user, target) * stabMultiplier(user)
|
||||
if (effectiveness > 1.0) {
|
||||
reader ! Message("It's super effective!")
|
||||
} else if (effectiveness < 1.0) {
|
||||
@@ -160,7 +161,15 @@ abstract class Move extends MoveTurn {
|
||||
val chance = (1 << stage) \\ 16 // Doubles per stage
|
||||
if (rng.chance(chance)) {
|
||||
reader ! Message("A critical hit!")
|
||||
1.5
|
||||
Config.crit
|
||||
} else {
|
||||
1.0
|
||||
}
|
||||
}
|
||||
|
||||
def stabMultiplier(user: Monster) = {
|
||||
if (user.elements.contains(element)) {
|
||||
Config.stab
|
||||
} else {
|
||||
1.0
|
||||
}
|
||||
@@ -259,6 +268,7 @@ object Move {
|
||||
val tree = tb.parse(
|
||||
s"""
|
||||
|import scala.util.Random
|
||||
|import fmon._
|
||||
|import fmon.battle.msg._
|
||||
|import fmon.stat._
|
||||
|import fmon.stat.Statistic._
|
||||
|
||||
Reference in New Issue
Block a user