Skip to content

Commit

Permalink
Removed berry rate since the formula is yet unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
igoticecream committed Oct 7, 2016
1 parent 141c2de commit 131b6c3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/icecream/snorlax/module/Pokemons.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ private double getRate(int index, double multiplier) {
return Math.round(Math.min(100.0d, mCaptureProbability.getCaptureProbability(index) * 100d * multiplier) * 100.0d) / 100.0d;
}

@Deprecated
public double getWithPokeballAndBerry() {
return getRate(0, 1.5);
}
Expand All @@ -165,6 +166,7 @@ public double getWithGreatball() {
return getRate(1, 1);
}

@Deprecated
public double getWithGreatballAndBerry() {
return getRate(1, 1.5);
}
Expand All @@ -173,6 +175,7 @@ public double getWithUltraball() {
return getRate(2, 1);
}

@Deprecated
public double getWithUltraballAndBerry() {
return getRate(2, 1.5);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,8 @@ private void onEncounter(PokemonData pokemonData, CaptureProbability captureProb
data.getMove1WithFormat(),
data.getMove2WithFormat(),
probability.getWithPokeball(),
probability.getWithPokeballAndBerry(),
probability.getWithGreatball(),
probability.getWithGreatballAndBerry(),
probability.getWithUltraball(),
probability.getWithUltraballAndBerry()
probability.getWithUltraball()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class EncounterNotification {
}

@SuppressWarnings("deprecation")
void show(int pokemonNumber, String pokemonName, double iv, int attack, int defense, int stamina, int cp, double level, int hp, String move1, String move2, double pokeRate, double pokeBerryRate, double greatRate, double greatBerryRate, double ultraRate, double ultraBerryRate) {
void show(int pokemonNumber, String pokemonName, double iv, int attack, int defense, int stamina, int cp, double level, int hp, String move1, String move2, double pokeRate, double greatRate, double ultraRate) {
new Handler(Looper.getMainLooper()).post(() -> {

Notification notification = new NotificationCompat.Builder(mContext)
Expand All @@ -71,19 +71,17 @@ void show(int pokemonNumber, String pokemonName, double iv, int attack, int defe
false
))
.setContentTitle(mContext.getString(R.string.notification_title, pokemonName, cp, level))
.setContentText(mContext.getString(R.string.notification_content, iv, attack, defense, stamina, hp))
.setContentText(mContext.getString(R.string.notification_content, iv, attack, defense, stamina))
.setStyle(new NotificationCompat.InboxStyle()
.addLine(mContext.getString(R.string.notification_categoty_stats_content, iv, attack, defense, stamina, hp))
.addLine(mContext.getString(R.string.notification_categoty_stats_content_iv, iv, attack, defense, stamina))
.addLine(mContext.getString(R.string.notification_categoty_stats_content_hp, hp))
.addLine(getBoldSpannable(mContext.getString(R.string.notification_categoty_moves_title)))
.addLine(mContext.getString(R.string.notification_categoty_moves_content, move1, move2))
.addLine(getBoldSpannable(mContext.getString(R.string.notification_categoty_catch_title)))
.addLine(mContext.getString(R.string.notification_categoty_catch_content_pokeball, pokeRate, pokeBerryRate))
.addLine(mContext.getString(R.string.notification_categoty_catch_content_greatball, greatRate, greatBerryRate))
.addLine(mContext.getString(R.string.notification_categoty_catch_content_ultraball, ultraRate, ultraBerryRate))
.addLine(mContext.getString(R.string.notification_categoty_catch_content, pokeRate, greatRate, ultraRate))
)
.setColor(ContextCompat.getColor(mContext, R.color.red_700))
.setAutoCancel(true)
//.setVibrate(new long[]{0, 60, 300, 60})
.setVibrate(new long[]{0})
.setPriority(Notification.PRIORITY_MAX)
.setCategory(NotificationCompat.CATEGORY_ALARM)
Expand Down
9 changes: 4 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
<string name="error_pokemon_missing">Install Pokemon Go to launch it</string>

<string name="notification_title">%1$s (CP %2$d) LV %3$3.1f</string>
<string name="notification_content">%1$4.1f%% [A/D/S %2$d/%3$d/%4$d] and HP %5$d</string>
<string name="notification_content">%1$4.1f%% [A/D/S %2$d/%3$d/%4$d]</string>

<string name="notification_categoty_stats_title">Stats</string>
<string name="notification_categoty_stats_content">%1$4.1f%% [A/D/S %2$d/%3$d/%4$d] and HP %5$d</string>
<string name="notification_categoty_stats_content_iv">%1$4.1f%% [A/D/S %2$d/%3$d/%4$d]</string>
<string name="notification_categoty_stats_content_hp">HP %1$d</string>

<string name="notification_categoty_moves_title">Moves</string>
<string name="notification_categoty_moves_content">%1$s - %2$s</string>

<string name="notification_categoty_catch_title">Catch Rate</string>
<string name="notification_categoty_catch_content_pokeball">Pokeball %1$4.1f%% - %2$4.1f%%</string>
<string name="notification_categoty_catch_content_greatball">Greatball %1$4.1f%% - %2$4.1f%%</string>
<string name="notification_categoty_catch_content_ultraball">Ultraball %1$4.1f%% - %2$4.1f%%</string>
<string name="notification_categoty_catch_content">Poké %1$4.1f%% - Great %2$4.1f%% - Ultra %3$4.1f%%</string>

<string name="preference_general">General</string>
<string name="preference_general_mock_enable_key">general_mock_key</string>
Expand Down

0 comments on commit 131b6c3

Please sign in to comment.