mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +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
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue