Possessions can be an extra one (worn in addition...) based on whom they are attached (or being attached) to.
This commit is contained in:
@@ -32,7 +32,7 @@ public abstract class AbstractAttachable extends AbstractLotroCardBlueprint {
|
||||
return _possessionClass;
|
||||
}
|
||||
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self) {
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,13 +43,13 @@ public abstract class AbstractAttachable extends AbstractLotroCardBlueprint {
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
PossessionClass possessionClass = getPossessionClass();
|
||||
if (possessionClass != null) {
|
||||
boolean extraPossessionClass = isExtraPossessionClass(game, self);
|
||||
boolean extraPossessionClass = isExtraPossessionClass(game, self, physicalCard);
|
||||
List<PhysicalCard> attachedCards = game.getGameState().getAttachedCards(physicalCard);
|
||||
Collection<PhysicalCard> matchingClassPossessions = Filters.filter(attachedCards, gameState, modifiersQuerying, Filters.or(CardType.POSSESSION, CardType.ARTIFACT), possessionClass);
|
||||
if (matchingClassPossessions.size() > 1)
|
||||
return false;
|
||||
if (!extraPossessionClass && matchingClassPossessions.size() == 1 &&
|
||||
!((AbstractAttachable) matchingClassPossessions.iterator().next().getBlueprint()).isExtraPossessionClass(game, self))
|
||||
!((AbstractAttachable) matchingClassPossessions.iterator().next().getBlueprint()).isExtraPossessionClass(game, self, physicalCard))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Card1_216 extends AbstractAttachable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self) {
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Card2_010 extends AbstractAttachableFPPossession {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self) {
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Card2_032 extends AbstractAttachableFPPossession {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self) {
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Card2_050 extends AbstractAttachable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self) {
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,8 @@ public class Card9_017 extends AbstractAttachableFPPossession {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self) {
|
||||
PhysicalCard to = self.getAttachedTo();
|
||||
return (to != null && to.getBlueprint().getName().equals("Aragorn"));
|
||||
public boolean isExtraPossessionClass(LotroGame game, PhysicalCard self, PhysicalCard attachedTo) {
|
||||
return (attachedTo.getBlueprint().getName().equals("Aragorn"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user