mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Fikser en bug vedrørende skade fra trippel laser
This commit is contained in:
parent
1060fb70b6
commit
d23bfed055
@ -854,7 +854,21 @@ public class Board {
|
||||
* @param robot The robot getting hit by the robot
|
||||
*/
|
||||
private void applyLaserDamage(WallType laserType, Robot robot) {
|
||||
robot.setDamageTaken(robot.getDamageTaken() + laserType.getWallTypeID() - 2);
|
||||
int laserDamage;
|
||||
switch (laserType) {
|
||||
case WALL_LASER_SINGLE:
|
||||
laserDamage = 1;
|
||||
break;
|
||||
case WALL_LASER_DOUBLE:
|
||||
laserDamage = 2;
|
||||
break;
|
||||
case WALL_LASER_TRIPLE:
|
||||
laserDamage = 3;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid laser type encountered.");
|
||||
}
|
||||
robot.setDamageTaken(robot.getDamageTaken() + laserDamage - 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user