Skip to content

Commit

Permalink
#700 Adds city fire image.
Browse files Browse the repository at this point in the history
Fixes doomed planet world type and amount of metal.
  • Loading branch information
tuomount committed May 10, 2024
1 parent 113640a commit 9c0dfe0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ Artifact on Planet by Tuomo Untinen with Stable Diffusion

Destroyed planet map tile by Tuomo Untinen with Stable Diffusion

City fire by Tuomo Untinen with Stable Diffusion

Gravity veins map tiles by Tuomo Untinen

Black hole map tiles by Tuomo Untinen
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/openRealmOfStars/gui/util/GuiStatics.java
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,9 @@ private GuiStatics() {
public static final String IMAGE_PARADISE = "/resources/images/landscape.png";
/** Image viruses */
public static final String IMAGE_VIRUSES = "/resources/images/viruses.png";
/** Image city in fire */
public static final String IMAGE_FIRE_IN_CITY =
"/resources/images/city-fire.png";
/** Image mysterious signal */
public static final String IMAGE_SIGNAL =
"/resources/images/mysterious_signal.png";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ private void createSolarSystem(final int sunx, final int suny,
StatusIds.VOLCANIC_ERUPTION, TimedStatusType.GAME_START,
lastTurn);
planet.addTimedStatus(status);
planet.generateWorldType();
planet.setAmountMetalInGround(HOMEWORLD_METAL);
} else {
planet.generateWorldType();
planet.setAmountMetalInGround(HOMEWORLD_METAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ public class ImageInstruction {
* Viruses image
*/
public static final String VIRUSES = "viruses";
/**
* City in fire image
*/
public static final String CITY_IN_FIRE = "city in fire";
/**
* Signal image
*/
Expand Down Expand Up @@ -699,6 +703,7 @@ public ImageInstruction addImage(final String image) {
&& !DESERT.equals(image)
&& !PARADISE.equals(image)
&& !VIRUSES.equals(image)
&& !CITY_IN_FIRE.equals(image)
&& !METEOR.equals(image)
&& !SIGNAL.equals(image)
&& !TECHNICAL_BREAKTHROUGH.equals(image)
Expand Down Expand Up @@ -1305,6 +1310,9 @@ private static BufferedImage paintImage(final BufferedImage workImage,
if (VIRUSES.equals(image)) {
drawImg = IOUtilities.loadImage(GuiStatics.IMAGE_VIRUSES);
}
if (VIRUSES.equals(image)) {
drawImg = IOUtilities.loadImage(GuiStatics.IMAGE_FIRE_IN_CITY);
}
if (SIGNAL.equals(image)) {
drawImg = IOUtilities.loadImage(GuiStatics.IMAGE_SIGNAL);
}
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/org/openRealmOfStars/starMap/planet/Planet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4670,7 +4670,7 @@ EventType.PLANET_COLONIZED, getCoordinate(), getName(),
if (imageInst != null) {
msg.setImageInstructions(imageInst.build());
}
planetOwnerInfo.getMsgList().addUpcomingMessage(msg);
planetOwnerInfo.getMsgList().addNewMessage(msg);
removeList.add(status);
}
if (status.getStatus().getId().equals(StatusIds.TECTONIC_QUAKE)) {
Expand All @@ -4694,13 +4694,16 @@ EventType.PLANET_COLONIZED, getCoordinate(), getName(),
sb.append(" kills one population");
}
sb.append(".");
//TODO: Tectonic quake is missing picture
ImageInstruction imageInst = new ImageInstruction();
imageInst.addBackground(ImageInstruction.BACKGROUND_BLACK);
imageInst.addImage(ImageInstruction.CITY_IN_FIRE);
Message msg = new Message(MessageType.PLANETARY,
sb.toString(),
Icons.getIconByName(Icons.ICON_DEATH));
msg.setImageInstructions(imageInst.build());
msg.setMatchByString(getName());
msg.setCoordinate(getCoordinate());
planetOwnerInfo.getMsgList().addUpcomingMessage(msg);
planetOwnerInfo.getMsgList().addNewMessage(msg);
}
if (status.getStatus().getId().equals(StatusIds.VOLCANIC_ERUPTION)) {
StringBuilder sb = new StringBuilder();
Expand All @@ -4718,7 +4721,7 @@ EventType.PLANET_COLONIZED, getCoordinate(), getName(),
Icons.getIconByName(Icons.ICON_DEATH));
msg.setMatchByString(getName());
msg.setCoordinate(getCoordinate());
planetOwnerInfo.getMsgList().addUpcomingMessage(msg);
planetOwnerInfo.getMsgList().addNewMessage(msg);
}
}
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c0dfe0

Please sign in to comment.