Skip to content

Commit

Permalink
Fixing #128. Had to remove Attack#equals and #hashCode, which might e…
Browse files Browse the repository at this point in the history
…nd up affecting other features that depend on them.
  • Loading branch information
tukkek committed Sep 26, 2017
1 parent 8211fa5 commit 57020dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
5 changes: 2 additions & 3 deletions javelin/model/unit/Monster.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,8 @@ public int getbaseattackbonus() {
classesbab += classdata.advancebab(i);
}
}
return classesbab
+ new Long(Math.round(originalhd * WeaponFocus.BAB.get(type)))
.intValue();
double bab = originalhd * WeaponFocus.BAB.get(type);
return classesbab + new Long(Math.round(bab)).intValue();
}

/**
Expand Down
10 changes: 0 additions & 10 deletions javelin/model/unit/attack/Attack.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ public Attack clone() {
}
}

@Override
public boolean equals(Object o) {
return name.equals(((Attack) o).name);
}

@Override
public int hashCode() {
return name.hashCode();
}

public Spell geteffect() {
if (temporaryeffect != null) {
return temporaryeffect;
Expand Down
14 changes: 9 additions & 5 deletions javelin/model/unit/feat/attack/PowerAttack.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ public void add(Combatant c) {
update(c.source);
}

private AttackSequence createattack(AttackSequence attack, int target) {
attack = attack.clone();
for (Attack a : attack) {
private AttackSequence createattack(AttackSequence sequence, int target) {
if (sequence.powerful) {
throw new RuntimeException(
"Cannot derivate from a Power Attack sequence!");
}
sequence = sequence.clone();
for (Attack a : sequence) {
a.bonus -= target;
a.damage[2] += target;
}
attack.powerful = true;
return attack;
sequence.powerful = true;
return sequence;
}

@Override
Expand Down

0 comments on commit 57020dc

Please sign in to comment.