From 14ceb9dc67ba6b167c8dc2db8e1c3033f00a3dbd Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Tue, 3 Dec 2024 00:39:36 +0100 Subject: [PATCH] fixed GateField rent --- .../model/src/main/java/pp/monopoly/game/server/Player.java | 6 +++--- .../src/main/java/pp/monopoly/model/fields/GateField.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java index bef6f22..2bd043b 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java @@ -372,7 +372,7 @@ public class Player implements FieldVisitor{ 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{ } 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{ */ private static int rollDice() { return random.nextInt(6) + 1; - // c++; + // return (c%2 == 0)? 3: 2; // if(c < 7) { // return 3; // } else { diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/GateField.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/GateField.java index d56f65c..cd0d80d 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/GateField.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/GateField.java @@ -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