Merge branch 'main' into javadoc-fixes
This commit is contained in:
@@ -42,7 +42,7 @@ public class Building8 extends BuildingCard {
|
||||
if(!player.buildingCards.contains(this))
|
||||
throw new IllegalArgumentException();
|
||||
for (Builder builder : player.builders) {
|
||||
player.addPrestige(builder.getPrestigeValue() * 2);
|
||||
player.addPrestige(builder.getPrestigeValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,8 +167,16 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
* @return {@code true} if the building card is successfully bought,
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
// sum reduction value builder=> sconto
|
||||
public boolean buy(Player player) {
|
||||
if( bought || !player.removeFood(getPrice()))
|
||||
int discount = 0;
|
||||
discount = player.builders.stream().mapToInt(x -> x.getReductionValue()).sum();
|
||||
|
||||
if(discount > this.price){
|
||||
discount = this.price;
|
||||
}
|
||||
|
||||
if(bought || !player.removeFood(this.price - discount))
|
||||
return false;
|
||||
player.buildingCards.add(this);
|
||||
bought=true;
|
||||
|
||||
@@ -91,7 +91,6 @@ public class CavePaintings extends EventCard {
|
||||
return new CavePaintings(getEra(), NLower, NPrestigeRem, NPrestigeMul) ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
|
||||
* toString to print a more detailed version.
|
||||
@@ -111,6 +110,6 @@ public class CavePaintings extends EventCard {
|
||||
*/
|
||||
@Override
|
||||
public String toStringBoard() {
|
||||
return super.toString()+" 0-"+(NLower-1)+":"+NPrestigeRem+" "+NLower+"+:"+NPrestigeMul;
|
||||
return super.toStringBoard()+" 0-"+(NLower-1)+":"+NPrestigeRem+" "+NLower+"+:"+NPrestigeMul;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class Hunt extends EventCard {
|
||||
*/
|
||||
@Override
|
||||
public String toStringBoard() {
|
||||
return super.toString()+" 1F+"+prestigeMultiplier+"PP"+" X N Hunter";
|
||||
return super.toStringBoard()+" 1F+"+prestigeMultiplier+"PP"+" X N Hunter";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ public class ShamanicRitual extends EventCard {
|
||||
*/
|
||||
@Override
|
||||
public String toStringBoard() {
|
||||
return super.toString()+" *>:"+prestigeToAdd+" *<:"+prestigeToRemove;
|
||||
return super.toStringBoard()+" *>:"+prestigeToAdd+" *<:"+prestigeToRemove;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Sustenance extends EventCard {
|
||||
* If the resulting Food debt is positive, the player must pay it with available Food.
|
||||
* If the player does not have enough Food, all remaining Food is removed and the player
|
||||
* loses Prestige equal to the unpaid Food debt multiplied by {@code PrestigeDebt}.
|
||||
* This event is intended to be executed last among event effects.
|
||||
* <b>This event is intended to be executed last among event effects.</b>
|
||||
*
|
||||
* @param playerList the list of players affected by the event.
|
||||
* @throws NullPointerException if {@code playerList} or one of its required elements is {@code null}.
|
||||
@@ -108,6 +108,6 @@ public class Sustenance extends EventCard {
|
||||
*/
|
||||
@Override
|
||||
public String toStringBoard() {
|
||||
return super.toString()+" -1F/-"+PrestigeDebt+"PP";
|
||||
return super.toStringBoard()+" -1F/-"+PrestigeDebt+"PP";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user