Fixed EquipmentAttachedCount. Fixed Kemba, Kha Regent not working

This commit is contained in:
magenoxx 2012-06-29 12:03:08 +04:00
parent 900086fffc
commit 6e3ee0e6fe
2 changed files with 7 additions and 11 deletions

View file

@ -58,19 +58,15 @@ public class EquipmentAttachedCount implements DynamicValue {
@Override
public int calculate(Game game, Ability source) {
int count = 0;
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null) {
Permanent permanent = game.getPermanent(equipment.getAttachedTo());
if (permanent != null) {
Permanent permanent = game.getPermanent(source.getSourceId()); // don't change this - may affect other cards
if (permanent != null) {
List<UUID> attachments = permanent.getAttachments();
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype().contains("Equipment")) {
count++;
}
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype().contains("Equipment")) {
count++;
}
}
}
return amount * count;
}

View file

@ -62,7 +62,7 @@ public class CreateTokenEffect extends OneShotEffect<CreateTokenEffect> {
public CreateTokenEffect(final CreateTokenEffect effect) {
super(effect);
this.amount = effect.amount;
this.amount = effect.amount.clone();
this.token = effect.token.copy();
}