This commit is contained in:
2018-03-30 16:40:00 +02:00
parent b613303b29
commit 049d3ba14b
3 changed files with 9 additions and 10 deletions

View File

@@ -384,7 +384,6 @@ public class Facade implements IFacade {
}
/**
* <<<<<<< HEAD
* Create and return a new worm that is positioned at the given location, looks
* in the given direction, has the given radius and the given name.
*

View File

@@ -595,7 +595,7 @@ public class Worm {
public void collision(Worm smallestWorm, Worm largestWorm) {
long total = 1 + (new Random().nextLong() * (10 - 1));
long loseSmallest = total/(largestWorm.getOrientation()/(smallestWorm.getOrientation()+largestWorm.getOrientation()));
long loseSmallest = (long) (total / (largestWorm.getOrientation() / (smallestWorm.getOrientation() + largestWorm.getOrientation())));
long loseLargest = total - loseSmallest;
smallestWorm.decreaseHitPoints(loseSmallest);
largestWorm.decreaseHitPoints(loseLargest);