mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Support drawing planeswalker token
This commit is contained in:
@@ -116,7 +116,10 @@ public class ConquestMapScreen extends FScreen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int progress = model.getCurrentPlaneData().getProgress();
|
||||||
int regionCount = model.getCurrentPlane().getRegions().size();
|
int regionCount = model.getCurrentPlane().getRegions().size();
|
||||||
|
FCollectionView<ConquestOpponent> opponents = region.getOpponents();
|
||||||
|
int startIndex = (regionCount - index - 1) * opponents.size();
|
||||||
|
|
||||||
//draw path with opponents
|
//draw path with opponents
|
||||||
float x0, y0, prevX = x + w / 2, prevY = y + h;
|
float x0, y0, prevX = x + w / 2, prevY = y + h;
|
||||||
@@ -127,7 +130,6 @@ public class ConquestMapScreen extends FScreen {
|
|||||||
float iconOffsetX = (colWidth - iconSize) / 2;
|
float iconOffsetX = (colWidth - iconSize) / 2;
|
||||||
float iconOffsetY = (rowHeight - iconSize) / 2;
|
float iconOffsetY = (rowHeight - iconSize) / 2;
|
||||||
float lineThickness = iconSize / 4;
|
float lineThickness = iconSize / 4;
|
||||||
FCollectionView<ConquestOpponent> opponents = region.getOpponents();
|
|
||||||
|
|
||||||
//draw line path
|
//draw line path
|
||||||
for (int i = 0; i < opponents.size(); i++) {
|
for (int i = 0; i < opponents.size(); i++) {
|
||||||
@@ -156,10 +158,22 @@ public class ConquestMapScreen extends FScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//draw fog of war overlay if region not yet unlocked
|
//draw fog of war overlay if region not yet unlocked
|
||||||
int startIndex = (regionCount - index - 1) * opponents.size();
|
if (startIndex > progress) {
|
||||||
if (startIndex > model.getCurrentPlaneData().getProgress()) {
|
|
||||||
g.fillRect(FOG_OF_WAR_COLOR, x, y, w, h);
|
g.fillRect(FOG_OF_WAR_COLOR, x, y, w, h);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
//draw planeswalker token above stop
|
||||||
|
int planeswalkerPosition = progress - startIndex;
|
||||||
|
if (planeswalkerPosition < opponents.size()) {
|
||||||
|
GridPosition pos = path[planeswalkerPosition];
|
||||||
|
x0 = x + colWidth * pos.col + iconOffsetX;
|
||||||
|
y0 = y + rowHeight * pos.row + iconOffsetY;
|
||||||
|
FImage token = (FImage)model.getPlaneswalkerToken();
|
||||||
|
float tokenWidth = iconSize * 2f;
|
||||||
|
float tokenHeight = tokenWidth * token.getHeight() / token.getWidth();
|
||||||
|
g.drawImage(token, x0 + (iconSize - tokenWidth) / 2, y0 - tokenHeight, tokenWidth, tokenHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
package forge.planarconquest;
|
package forge.planarconquest;
|
||||||
|
|
||||||
|
import forge.achievement.PlaneswalkerAchievements;
|
||||||
|
import forge.assets.ISkinImage;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.item.InventoryItem;
|
import forge.item.InventoryItem;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
@@ -48,11 +50,11 @@ public final class ConquestData {
|
|||||||
private int wins, losses;
|
private int wins, losses;
|
||||||
private int winStreakBest = 0;
|
private int winStreakBest = 0;
|
||||||
private int winStreakCurrent = 0;
|
private int winStreakCurrent = 0;
|
||||||
private int day = 1;
|
|
||||||
private int difficulty;
|
private int difficulty;
|
||||||
private ConquestPlane startingPlane, currentPlane;
|
private ConquestPlane startingPlane, currentPlane;
|
||||||
private int currentRegionIndex;
|
private int currentRegionIndex;
|
||||||
private EnumMap<ConquestPlane, ConquestPlaneData> planeDataMap = new EnumMap<ConquestPlane, ConquestPlaneData>(ConquestPlane.class);
|
private EnumMap<ConquestPlane, ConquestPlaneData> planeDataMap = new EnumMap<ConquestPlane, ConquestPlaneData>(ConquestPlane.class);
|
||||||
|
private ISkinImage planeswalkerToken = PlaneswalkerAchievements.getTrophyImage("Jace, the Mind Sculptor");
|
||||||
|
|
||||||
private final HashSet<PaperCard> collection = new HashSet<PaperCard>();
|
private final HashSet<PaperCard> collection = new HashSet<PaperCard>();
|
||||||
private final HashMap<String, Deck> decks = new HashMap<String, Deck>();
|
private final HashMap<String, Deck> decks = new HashMap<String, Deck>();
|
||||||
@@ -99,11 +101,8 @@ public final class ConquestData {
|
|||||||
return difficulty;
|
return difficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDay() {
|
public ISkinImage getPlaneswalkerToken() {
|
||||||
return day;
|
return planeswalkerToken;
|
||||||
}
|
|
||||||
public void incrementDay() {
|
|
||||||
day++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConquestPlane getStartingPlane() {
|
public ConquestPlane getStartingPlane() {
|
||||||
|
|||||||
Reference in New Issue
Block a user