Skip to content

Commit

Permalink
Fix trainer movesets as a whole, add night shade
Browse files Browse the repository at this point in the history
  • Loading branch information
Dabomstew committed Nov 20, 2020
1 parent a1abeae commit 2cf4ada
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 787 deletions.
4 changes: 4 additions & 0 deletions src/DamageCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ public class DamageCalculator {
// crit indicates if there is a crit or not
private static int damage(Move attack, Pokemon attacker, Pokemon defender, StatModifier atkMod,
StatModifier defMod, int rangeNum, boolean crit) {
if(attack.getName().equalsIgnoreCase("night shade")) {
return attacker.getLevel();
}

if (rangeNum < MIN_RANGE) {
rangeNum = MIN_RANGE;
}
Expand Down
3 changes: 3 additions & 0 deletions src/GameAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public abstract class GameAction {
public static final GameAction eatCarbos = new GameAction() {
void performAction(Pokemon p, Inventory inv) { p.eatCarbos(); inv.removeItem("Carbos"); }
};
public static final GameAction recalcStats = new GameAction() {
void performAction(Pokemon p, Inventory inv) { p.calculateStats(); }
};

//badges
public static final GameAction getBoulderBadge = new GameAction() {
Expand Down
15 changes: 15 additions & 0 deletions src/Moveset.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,19 @@ public void delMove(String s) {
delMove(Move.getMoveByName(s));
}

public Moveset gymLeaderClone(String thirdMove) {
return gymLeaderClone(thirdMove, 3);
}

public Moveset gymLeaderClone(String move, int moveSlot) {
Moveset newSet = new Moveset(this.moves);
if(newSet.moves.size() >= moveSlot) {
newSet.moves.set(moveSlot-1, Move.getMoveByName(move));
}
else {
newSet.addMove(move);
}
return newSet;
}

}
3 changes: 3 additions & 0 deletions src/RouteParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ else if(firstToken.equalsIgnoreCase("um") || firstToken.equalsIgnoreCase("unlear
else if(firstToken.equalsIgnoreCase("rc") || firstToken.equalsIgnoreCase("rarecandy")) {
return GameAction.eatRareCandy;
}
else if(firstToken.equalsIgnoreCase("calcstats")) {
return GameAction.recalcStats;
}
else if(firstToken.equalsIgnoreCase("hpup")) {
return GameAction.eatHPUp;
}
Expand Down
Loading

0 comments on commit 2cf4ada

Please sign in to comment.