id of stack item is event id + result of target picker
parent
e5ca788b68
commit
7258245a24
|
@ -144,8 +144,11 @@ public abstract class MagicItemOnStack implements MagicTarget {
|
|||
return source!=this.source;
|
||||
}
|
||||
|
||||
public long getEventId() {
|
||||
return event.getEventId();
|
||||
public long getItemId() {
|
||||
return
|
||||
event.getEventId() +
|
||||
((choiceResults.length > 0 && choiceResults[0] instanceof MagicTarget) ?
|
||||
((MagicTarget)choiceResults[0]).getId() : 7);
|
||||
}
|
||||
|
||||
public abstract boolean isSpell();
|
||||
|
|
|
@ -111,7 +111,7 @@ public class MagicStack extends LinkedList<MagicItemOnStack> {
|
|||
int idx = 0;
|
||||
long[] input = new long[size() + 1];
|
||||
for (MagicItemOnStack item : this) {
|
||||
input[idx] = item.getEventId();
|
||||
input[idx] = item.getItemId();
|
||||
idx++;
|
||||
}
|
||||
return magic.MurmurHash3.hash(input);
|
||||
|
|
Loading…
Reference in New Issue