mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Correct the update of POIChanges for bought cards from shops
This commit is contained in:
@@ -84,7 +84,7 @@ public class EnemyEdit extends FormPanel {
|
|||||||
currentData.speed= ((Double) speed.getValue()).floatValue();
|
currentData.speed= ((Double) speed.getValue()).floatValue();
|
||||||
currentData.spawnRate=((Double) spawnRate.getValue()).floatValue();
|
currentData.spawnRate=((Double) spawnRate.getValue()).floatValue();
|
||||||
currentData.difficulty=((Double) difficulty.getValue()).floatValue();
|
currentData.difficulty=((Double) difficulty.getValue()).floatValue();
|
||||||
currentData.deck= deck.getEdit().getText();
|
currentData.deck= deck.getEdit().getText().split(",");
|
||||||
currentData.rewards= rewards.getRewards();
|
currentData.rewards= rewards.getRewards();
|
||||||
preview.setSpritePath(currentData.sprite);
|
preview.setSpritePath(currentData.sprite);
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ public class EnemyEdit extends FormPanel {
|
|||||||
equipment.setText(String.join(",",currentData.equipment));
|
equipment.setText(String.join(",",currentData.equipment));
|
||||||
else
|
else
|
||||||
equipment.setText("");
|
equipment.setText("");
|
||||||
deck.getEdit().setText(currentData.deck);
|
deck.getEdit().setText(String.join(",",currentData.deck));
|
||||||
speed.setValue(new Float(currentData.speed).doubleValue());
|
speed.setValue(new Float(currentData.speed).doubleValue());
|
||||||
spawnRate.setValue(new Float(currentData.spawnRate).doubleValue());
|
spawnRate.setValue(new Float(currentData.spawnRate).doubleValue());
|
||||||
difficulty.setValue(new Float(currentData.difficulty).doubleValue());
|
difficulty.setValue(new Float(currentData.difficulty).doubleValue());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package forge.adventure.data;
|
package forge.adventure.data;
|
||||||
|
|
||||||
import forge.adventure.util.CardUtil;
|
import forge.adventure.util.*;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,7 +11,7 @@ import forge.deck.Deck;
|
|||||||
public class EnemyData {
|
public class EnemyData {
|
||||||
public String name;
|
public String name;
|
||||||
public String sprite;
|
public String sprite;
|
||||||
public String deck;
|
public String[] deck;
|
||||||
public boolean copyPlayerDeck = false;
|
public boolean copyPlayerDeck = false;
|
||||||
public String ai;
|
public String ai;
|
||||||
public boolean boss = false;
|
public boolean boss = false;
|
||||||
@@ -54,6 +54,6 @@ public class EnemyData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Deck generateDeck(boolean isFantasyMode, boolean useGeneticAI) {
|
public Deck generateDeck(boolean isFantasyMode, boolean useGeneticAI) {
|
||||||
return CardUtil.getDeck(deck, true, isFantasyMode, colors, life > 13, life > 16 && useGeneticAI);
|
return CardUtil.getDeck(deck[Current.player().getEnemyDeckNumber(this.name, deck.length)], true, isFantasyMode, colors, life > 13, life > 16 && useGeneticAI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -691,4 +691,23 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
questFlags.clear();
|
questFlags.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getEnemyDeckNumber(String enemyName, int maxDecks){
|
||||||
|
int deckNumber = 0;
|
||||||
|
if (statistic.getWinLossRecord().get(enemyName)!=null)
|
||||||
|
{
|
||||||
|
int playerWins = statistic.getWinLossRecord().get(enemyName).getKey();
|
||||||
|
int enemyWins = statistic.getWinLossRecord().get(enemyName).getValue();
|
||||||
|
if (playerWins > enemyWins){
|
||||||
|
int deckNumberAfterAlgorithmOutput = (int)((playerWins-enemyWins) * (difficultyData.enemyLifeFactor / 3));
|
||||||
|
if (deckNumberAfterAlgorithmOutput < maxDecks){
|
||||||
|
deckNumber = deckNumberAfterAlgorithmOutput;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
deckNumber = maxDecks-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return deckNumber;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
9
forge-gui/res/adventure/Shandalar/decks/red_bad[1].json
Normal file
9
forge-gui/res/adventure/Shandalar/decks/red_bad[1].json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name":"Red bad",
|
||||||
|
"template":
|
||||||
|
{
|
||||||
|
"count":70,
|
||||||
|
"colors":["Red"],
|
||||||
|
"rares":0.3
|
||||||
|
}
|
||||||
|
}
|
||||||
9
forge-gui/res/adventure/Shandalar/decks/red_bad[2].json
Normal file
9
forge-gui/res/adventure/Shandalar/decks/red_bad[2].json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name":"Red bad",
|
||||||
|
"template":
|
||||||
|
{
|
||||||
|
"count":60,
|
||||||
|
"colors":["Red"],
|
||||||
|
"rares":0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
9
forge-gui/res/adventure/Shandalar/decks/red_bad[3].json
Normal file
9
forge-gui/res/adventure/Shandalar/decks/red_bad[3].json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name":"Red bad",
|
||||||
|
"template":
|
||||||
|
{
|
||||||
|
"count":60,
|
||||||
|
"colors":["Red"],
|
||||||
|
"rares":0.8
|
||||||
|
}
|
||||||
|
}
|
||||||
9
forge-gui/res/adventure/Shandalar/decks/red_bad[4].json
Normal file
9
forge-gui/res/adventure/Shandalar/decks/red_bad[4].json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name":"Red bad",
|
||||||
|
"template":
|
||||||
|
{
|
||||||
|
"count":50,
|
||||||
|
"colors":["Red"],
|
||||||
|
"rares":1
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user