Replaced diceBag()->normal with diceBag()->pseudoBell, added a few fight fixes.

This commit is contained in:
Vassyli
2018-01-27 18:45:47 +01:00
parent 04a5b59ea2
commit ccbfa0553c
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -388,8 +388,8 @@ class Battle
$defendersDefense = (int) round($defendersDefense, 0);
// Lets roll the
$attackersAtkRoll = $this->game->getDiceBag()->normal(0, $attackersAttack);
$defendersDefRoll = $this->game->getDiceBag()->normal(0, $defendersDefense);
$attackersAtkRoll = $this->game->getDiceBag()->pseudoBell(0, $attackersAttack);
$defendersDefRoll = $this->game->getDiceBag()->pseudoBell(0, $defendersDefense);
$damage = $attackersAtkRoll - $defendersDefRoll;
// If the attacker's attack after modification is bigger than before,
+1 -1
View File
@@ -536,7 +536,7 @@ class BuffList
if ($buff->getBadguyDamageReflection() !== 0.) {
if ($damage > 0) {
// Damage is > 0, so badguy takes damage, we can normally reflect
$reflectedDamage = (int)round($buff->getGoodguyDamageReflection() * $damage, 0);
$reflectedDamage = (int)round($buff->getBadguyDamageReflection() * $damage, 0);
if ($reflectedDamage === 0) {
$message = $buff->getNoEffectMessage();
} else {
+1
View File
@@ -33,6 +33,7 @@ class BattleTest extends CoreModelTestCase
public function getMockGame(Character $character): Game
{
mt_srand(0);
$game = $this->getMockBuilder(Game::class)
->disableOriginalConstructor()
->getMock();