id of stack item is event id + result of target picker

master
melvin 2011-06-19 17:59:17 +08:00
parent e5ca788b68
commit 7258245a24
2 changed files with 6 additions and 3 deletions

View File

@ -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();

View File

@ -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);