mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Merge pull request #6036 from kevlahnota/master2
update adventure defeat penalty
This commit is contained in:
@@ -23,6 +23,7 @@ public class ItemData {
|
|||||||
|
|
||||||
public boolean usableOnWorldMap;
|
public boolean usableOnWorldMap;
|
||||||
public boolean usableInPoi;
|
public boolean usableInPoi;
|
||||||
|
public boolean isCracked;
|
||||||
public String commandOnUse;
|
public String commandOnUse;
|
||||||
public int shardsNeeded;
|
public int shardsNeeded;
|
||||||
public DialogData dialogOnUse;
|
public DialogData dialogOnUse;
|
||||||
|
|||||||
@@ -842,6 +842,20 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemData getRandomEquippedArmor() {
|
||||||
|
Array<ItemData> armor = new Array<>();
|
||||||
|
for (String name : equippedItems.values()) {
|
||||||
|
ItemData data = ItemData.getItem(name);
|
||||||
|
if (data != null
|
||||||
|
&& ("Boots".equalsIgnoreCase(data.equipmentSlot)
|
||||||
|
|| "Body".equalsIgnoreCase(data.equipmentSlot)
|
||||||
|
|| "Neck".equalsIgnoreCase(data.equipmentSlot))) {
|
||||||
|
armor.add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return armor.random();
|
||||||
|
}
|
||||||
|
|
||||||
public ItemData getEquippedAbility1() {
|
public ItemData getEquippedAbility1() {
|
||||||
for (String name : equippedItems.values()) {
|
for (String name : equippedItems.values()) {
|
||||||
ItemData data = ItemData.getItem(name);
|
ItemData data = ItemData.getItem(name);
|
||||||
@@ -879,6 +893,10 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
return difficultyData;
|
return difficultyData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHardorInsaneDifficulty() {
|
||||||
|
return "Hard".equalsIgnoreCase(difficultyData.name) || "Insane".equalsIgnoreCase(difficultyData.name);
|
||||||
|
}
|
||||||
|
|
||||||
public void renameDeck(String text) {
|
public void renameDeck(String text) {
|
||||||
deck = (Deck) deck.copyTo(text);
|
deck = (Deck) deck.copyTo(text);
|
||||||
decks[selectedDeckIndex] = deck;
|
decks[selectedDeckIndex] = deck;
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ public class DuelScene extends ForgeScene {
|
|||||||
} else if (this.eventData != null) {
|
} else if (this.eventData != null) {
|
||||||
deck = eventData.nextOpponent.getDeck();
|
deck = eventData.nextOpponent.getDeck();
|
||||||
} else {
|
} else {
|
||||||
deck = currentEnemy.copyPlayerDeck ? this.playerDeck : currentEnemy.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().getDifficulty().name.equalsIgnoreCase("Insane") || Current.player().getDifficulty().name.equalsIgnoreCase("Hard"));
|
deck = currentEnemy.copyPlayerDeck ? this.playerDeck : currentEnemy.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().isHardorInsaneDifficulty());
|
||||||
}
|
}
|
||||||
RegisteredPlayer aiPlayer = RegisteredPlayer.forVariants(playerCount, appliedVariants, deck, null, false, null, null);
|
RegisteredPlayer aiPlayer = RegisteredPlayer.forVariants(playerCount, appliedVariants, deck, null, false, null, null);
|
||||||
|
|
||||||
@@ -410,9 +410,7 @@ public class DuelScene extends ForgeScene {
|
|||||||
this.eventData = eventData;
|
this.eventData = eventData;
|
||||||
if (eventData != null && eventData.eventRules == null)
|
if (eventData != null && eventData.eventRules == null)
|
||||||
eventData.eventRules = new AdventureEventData.AdventureEventRules(AdventureEventController.EventFormat.Constructed, 1.0f);
|
eventData.eventRules = new AdventureEventData.AdventureEventRules(AdventureEventController.EventFormat.Constructed, 1.0f);
|
||||||
this.arenaBattleChallenge = isArena
|
this.arenaBattleChallenge = isArena && Current.player().isHardorInsaneDifficulty();
|
||||||
&& (Current.player().getDifficulty().name.equalsIgnoreCase("Hard")
|
|
||||||
|| Current.player().getDifficulty().name.equalsIgnoreCase("Insane"));
|
|
||||||
if (eventData != null && eventData.registeredDeck != null)
|
if (eventData != null && eventData.registeredDeck != null)
|
||||||
this.playerDeck = eventData.registeredDeck;
|
this.playerDeck = eventData.registeredDeck;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -218,10 +218,13 @@ public class InventoryScene extends UIScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearItemDescription() {
|
||||||
|
itemDescription.setText("");
|
||||||
|
}
|
||||||
private void setSelected(Button actor) {
|
private void setSelected(Button actor) {
|
||||||
selected = actor;
|
selected = actor;
|
||||||
if (actor == null) {
|
if (actor == null) {
|
||||||
itemDescription.setText("");
|
clearItemDescription();
|
||||||
deleteButton.setDisabled(true);
|
deleteButton.setDisabled(true);
|
||||||
equipButton.setDisabled(true);
|
equipButton.setDisabled(true);
|
||||||
useButton.setDisabled(true);
|
useButton.setDisabled(true);
|
||||||
@@ -246,7 +249,7 @@ public class InventoryScene extends UIScene {
|
|||||||
if (Current.player().getShards() < data.shardsNeeded)
|
if (Current.player().getShards() < data.shardsNeeded)
|
||||||
useButton.setDisabled(true);
|
useButton.setDisabled(true);
|
||||||
|
|
||||||
if (data.equipmentSlot == null || data.equipmentSlot.isEmpty()) {
|
if (data.equipmentSlot == null || data.equipmentSlot.isEmpty() || data.isCracked) {
|
||||||
equipButton.setDisabled(true);
|
equipButton.setDisabled(true);
|
||||||
} else {
|
} else {
|
||||||
equipButton.setDisabled(false);
|
equipButton.setDisabled(false);
|
||||||
@@ -261,7 +264,8 @@ public class InventoryScene extends UIScene {
|
|||||||
button.layout();
|
button.layout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
itemDescription.setText(data.name + "\n[%98]" + data.getDescription());
|
String status = data.isCracked ? " (" + Forge.getLocalizer().getMessage("lblCracked") + ")" : "";
|
||||||
|
itemDescription.setText(data.name + status + "\n[%98]" + data.getDescription());
|
||||||
}
|
}
|
||||||
else if (deckLocation.containsKey(actor)){
|
else if (deckLocation.containsKey(actor)){
|
||||||
Deck data = (deckLocation.get(actor));
|
Deck data = (deckLocation.get(actor));
|
||||||
|
|||||||
@@ -379,6 +379,28 @@ public class SaveLoadScene extends UIScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getSaveFileSuffix() {
|
public String getSaveFileSuffix() {
|
||||||
return ASCII_179 + GameScene.instance().getAdventurePlayerLocation(true, true);
|
String difficulty;
|
||||||
|
switch (AdventurePlayer.current().getDifficulty().name) {
|
||||||
|
case "easy":
|
||||||
|
case "Easy":
|
||||||
|
difficulty = "[%99][CYAN]\uFF0A[WHITE]";
|
||||||
|
break;
|
||||||
|
case "normal":
|
||||||
|
case "Normal":
|
||||||
|
difficulty = "[%99][GREEN]\uFF0A[WHITE]";
|
||||||
|
break;
|
||||||
|
case "hard":
|
||||||
|
case "Hard":
|
||||||
|
difficulty = "[%99][GOLD]\uFF0A[WHITE]";
|
||||||
|
break;
|
||||||
|
case "insane":
|
||||||
|
case "Insane":
|
||||||
|
difficulty = "[%99][RED]\uFF0A[WHITE]";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
difficulty = "[%99][WHITE]";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ASCII_179 + difficulty + GameScene.instance().getAdventurePlayerLocation(true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ public class ConsoleCommandInterpreter {
|
|||||||
});
|
});
|
||||||
registerCommand(new String[]{"dumpEnemyDeckColors"}, s -> {
|
registerCommand(new String[]{"dumpEnemyDeckColors"}, s -> {
|
||||||
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
||||||
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().getDifficulty().name.equalsIgnoreCase("Hard"));
|
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().isHardorInsaneDifficulty());
|
||||||
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
||||||
ColorSet colorSet = DP.getColor();
|
ColorSet colorSet = DP.getColor();
|
||||||
System.out.printf("%s: Colors: %s (%s%s%s%s%s%s)\n", D.getName(), DP.getColor(),
|
System.out.printf("%s: Colors: %s (%s%s%s%s%s%s)\n", D.getName(), DP.getColor(),
|
||||||
@@ -270,7 +270,7 @@ public class ConsoleCommandInterpreter {
|
|||||||
});
|
});
|
||||||
registerCommand(new String[]{"dumpEnemyDeckList"}, s -> {
|
registerCommand(new String[]{"dumpEnemyDeckList"}, s -> {
|
||||||
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
||||||
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().getDifficulty().name.equalsIgnoreCase("Hard"));
|
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().isHardorInsaneDifficulty());
|
||||||
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
||||||
System.out.printf("Deck: %s\n%s\n\n", D.getName(), DP.getDeck().getMain().toCardList("\n")
|
System.out.printf("Deck: %s\n%s\n\n", D.getName(), DP.getDeck().getMain().toCardList("\n")
|
||||||
);
|
);
|
||||||
@@ -279,7 +279,7 @@ public class ConsoleCommandInterpreter {
|
|||||||
});
|
});
|
||||||
registerCommand(new String[]{"dumpEnemyColorIdentity"}, s -> {
|
registerCommand(new String[]{"dumpEnemyColorIdentity"}, s -> {
|
||||||
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
||||||
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().getDifficulty().name.equalsIgnoreCase("Hard"));
|
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().isHardorInsaneDifficulty());
|
||||||
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
||||||
System.out.printf("%s Colors: %s | Deck Colors: %s (%s)%s\n", E.name, E.colors, DP.getColorIdentity().toEnumSet().toString(), DP.getName()
|
System.out.printf("%s Colors: %s | Deck Colors: %s (%s)%s\n", E.name, E.colors, DP.getColorIdentity().toEnumSet().toString(), DP.getName()
|
||||||
, E.boss ? " - BOSS" : "");
|
, E.boss ? " - BOSS" : "");
|
||||||
|
|||||||
@@ -658,11 +658,12 @@ public abstract class GameStage extends Stage {
|
|||||||
Timer.schedule(new Timer.Task() {
|
Timer.schedule(new Timer.Task() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
showImageDialog(Forge.getLocalizer().getMessage("lblYouDied", Current.player().getName()), null,
|
showImageDialog(Current.generateDefeatMessage(), null,
|
||||||
() -> FThreads.invokeInEdtNowOrLater(() -> Forge.setTransitionScreen(new TransitionScreen(() -> {
|
() -> FThreads.invokeInEdtNowOrLater(() -> Forge.setTransitionScreen(new TransitionScreen(() -> {
|
||||||
Forge.advFreezePlayerControls = false;
|
Forge.advFreezePlayerControls = false;
|
||||||
WorldStage.getInstance().setPosition(new Vector2(poi.getPosition().x - 16f, poi.getPosition().y + 16f));
|
WorldStage.getInstance().setPosition(new Vector2(poi.getPosition().x - 16f, poi.getPosition().y + 16f));
|
||||||
WorldStage.getInstance().loadPOI(poi);
|
WorldStage.getInstance().loadPOI(poi);
|
||||||
|
WorldSave.getCurrentSave().autoSave();
|
||||||
Forge.clearTransitionScreen();
|
Forge.clearTransitionScreen();
|
||||||
}, Forge.takeScreenshot(), ""))));
|
}, Forge.takeScreenshot(), ""))));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -750,7 +750,6 @@ public class MapStage extends GameStage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean exitDungeon(boolean defeated) {
|
public boolean exitDungeon(boolean defeated) {
|
||||||
WorldSave.getCurrentSave().autoSave();
|
|
||||||
AdventureQuestController.instance().updateQuestsLeave();
|
AdventureQuestController.instance().updateQuestsLeave();
|
||||||
clearIsInMap();
|
clearIsInMap();
|
||||||
AdventureQuestController.instance().showQuestDialogs(this);
|
AdventureQuestController.instance().showQuestDialogs(this);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package forge.adventure.util;
|
package forge.adventure.util;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
|
import forge.adventure.data.ItemData;
|
||||||
import forge.adventure.player.AdventurePlayer;
|
import forge.adventure.player.AdventurePlayer;
|
||||||
|
import forge.adventure.scene.InventoryScene;
|
||||||
import forge.adventure.world.World;
|
import forge.adventure.world.World;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
@@ -24,5 +27,18 @@ public class Current {
|
|||||||
public static void setLatestDeck(Deck generateDeck) {
|
public static void setLatestDeck(Deck generateDeck) {
|
||||||
deck=generateDeck;
|
deck=generateDeck;
|
||||||
}
|
}
|
||||||
|
public static String generateDefeatMessage() {;
|
||||||
|
String message = Forge.getLocalizer().getMessage("lblYouDied", player().getName());
|
||||||
|
if (player().isHardorInsaneDifficulty()) {
|
||||||
|
ItemData itemData = player().getRandomEquippedArmor();
|
||||||
|
if (itemData != null) {
|
||||||
|
itemData.isCracked = true;
|
||||||
|
player().equip(itemData); //unequip...
|
||||||
|
InventoryScene.instance().clearItemDescription();
|
||||||
|
message += "\n{GRADIENT=RED;GRAY;1;1}" + itemData.name + " {ENDGRADIENT}" + Forge.getLocalizer().getMessage("lblCracked");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3434,3 +3434,4 @@ lblShowNoSell=No-Sell Anzeigen
|
|||||||
lblShowAll=Alle Anzeigen
|
lblShowAll=Alle Anzeigen
|
||||||
lblHideCollection=Sammlung Ausblenden
|
lblHideCollection=Sammlung Ausblenden
|
||||||
lblShowCollection=Sammlung Anzeigen
|
lblShowCollection=Sammlung Anzeigen
|
||||||
|
lblCracked=Geknackt!
|
||||||
@@ -3167,3 +3167,4 @@ lblShowNoSell=Show No-Sell
|
|||||||
lblShowAll=Show All
|
lblShowAll=Show All
|
||||||
lblHideCollection=Hide Collection
|
lblHideCollection=Hide Collection
|
||||||
lblShowCollection=Show Collection
|
lblShowCollection=Show Collection
|
||||||
|
lblCracked=Cracked!
|
||||||
@@ -3448,3 +3448,4 @@ lblShowNoSell=Mostrar No Vender
|
|||||||
lblShowAll=Mostrar Todo
|
lblShowAll=Mostrar Todo
|
||||||
lblHideCollection=Ocultar Colección
|
lblHideCollection=Ocultar Colección
|
||||||
lblShowCollection=Mostrar Colección
|
lblShowCollection=Mostrar Colección
|
||||||
|
lblCracked=¡Agrietado!
|
||||||
@@ -3442,3 +3442,4 @@ lblShowNoSell=Afficher Non-Vente
|
|||||||
lblShowAll=Afficher Tout
|
lblShowAll=Afficher Tout
|
||||||
lblHideCollection=Masquer la Collection
|
lblHideCollection=Masquer la Collection
|
||||||
lblShowCollection=Afficher la Collection
|
lblShowCollection=Afficher la Collection
|
||||||
|
lblCracked=Fissuré!
|
||||||
@@ -3440,3 +3440,4 @@ lblShowNoSell=Mostra Non Vendita
|
|||||||
lblShowAll=Mostra Tutto
|
lblShowAll=Mostra Tutto
|
||||||
lblHideCollection=Nascondi Collezione
|
lblHideCollection=Nascondi Collezione
|
||||||
lblShowCollection=Mostra Collezione
|
lblShowCollection=Mostra Collezione
|
||||||
|
lblCracked=Incrinato!
|
||||||
@@ -3436,3 +3436,4 @@ lblShowNoSell=ノーセールを表示
|
|||||||
lblShowAll=すべて表示
|
lblShowAll=すべて表示
|
||||||
lblHideCollection=コレクションを非表示にする
|
lblHideCollection=コレクションを非表示にする
|
||||||
lblShowCollection=ショーコレクション
|
lblShowCollection=ショーコレクション
|
||||||
|
lblCracked=ひび割れた!
|
||||||
@@ -3526,3 +3526,4 @@ lblShowNoSell=Mostrar Não-Venda
|
|||||||
lblShowAll=Mostrar Tudo
|
lblShowAll=Mostrar Tudo
|
||||||
lblHideCollection=Ocultar Coleção
|
lblHideCollection=Ocultar Coleção
|
||||||
lblShowCollection=Mostrar Coleção
|
lblShowCollection=Mostrar Coleção
|
||||||
|
lblCracked=Rachado!
|
||||||
@@ -3427,3 +3427,4 @@ lblShowNoSell=显示不卖
|
|||||||
lblShowAll=显示全部
|
lblShowAll=显示全部
|
||||||
lblHideCollection=隐藏收藏
|
lblHideCollection=隐藏收藏
|
||||||
lblShowCollection=展会系列
|
lblShowCollection=展会系列
|
||||||
|
lblCracked=破裂了!
|
||||||
Reference in New Issue
Block a user