mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Fixed EquipmentAttachedCount. Fixed Kemba, Kha Regent not working
This commit is contained in:
parent
900086fffc
commit
6e3ee0e6fe
2 changed files with 7 additions and 11 deletions
|
@ -58,19 +58,15 @@ public class EquipmentAttachedCount implements DynamicValue {
|
||||||
@Override
|
@Override
|
||||||
public int calculate(Game game, Ability source) {
|
public int calculate(Game game, Ability source) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId()); // don't change this - may affect other cards
|
||||||
if (equipment != null) {
|
if (permanent != null) {
|
||||||
Permanent permanent = game.getPermanent(equipment.getAttachedTo());
|
|
||||||
if (permanent != null) {
|
|
||||||
List<UUID> attachments = permanent.getAttachments();
|
List<UUID> attachments = permanent.getAttachments();
|
||||||
for (UUID attachmentId : attachments) {
|
for (UUID attachmentId : attachments) {
|
||||||
Permanent attached = game.getPermanent(attachmentId);
|
Permanent attached = game.getPermanent(attachmentId);
|
||||||
if (attached != null && attached.getSubtype().contains("Equipment")) {
|
if (attached != null && attached.getSubtype().contains("Equipment")) {
|
||||||
count++;
|
count++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return amount * count;
|
return amount * count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class CreateTokenEffect extends OneShotEffect<CreateTokenEffect> {
|
||||||
|
|
||||||
public CreateTokenEffect(final CreateTokenEffect effect) {
|
public CreateTokenEffect(final CreateTokenEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.amount = effect.amount;
|
this.amount = effect.amount.clone();
|
||||||
this.token = effect.token.copy();
|
this.token = effect.token.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue