fixed GateField rent

This commit is contained in:
Johannes Schmelz 2024-12-03 00:39:36 +01:00
parent aa86c25e7c
commit 14ceb9dc67
2 changed files with 4 additions and 4 deletions

View File

@ -372,7 +372,7 @@ public class Player implements FieldVisitor<Void>{
public Void visit(GateField field) {
if(field.getOwner() == null) {
if (field.getPrice() <= accountBalance) getHandler().getLogic().send(this, new BuyPropertyRequest());
} else {
} else if (field.getOwner() != this){
int rent = field.calcRent() * field.getOwner().getNumProp(field);
field.getOwner().earnMoney(rent);
@ -487,8 +487,8 @@ public class Player implements FieldVisitor<Void>{
}
return total;
}
// private static int c = 0;
/**
* Inner class for dice functionality in the game.
* Rolls random dice values.
@ -503,8 +503,8 @@ public class Player implements FieldVisitor<Void>{
*/
private static int rollDice() {
return random.nextInt(6) + 1;
// c++;
// return (c%2 == 0)? 3: 2;
// if(c < 7) {
// return 3;
// } else {

View File

@ -11,7 +11,7 @@ public class GateField extends PropertyField{
}
GateField(String name, int id) {
super(name, id, 2000, 25);
super(name, id, 2000, 250);
}
@Override