Skip to content

Commit

Permalink
Tanks v1.4.0 - tank editor full release
Browse files Browse the repository at this point in the history
  • Loading branch information
aehmttw committed Jul 30, 2022
1 parent 8ee806e commit f959544
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 122 deletions.
4 changes: 2 additions & 2 deletions src/main/java/lwjglwindow/FontRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public FontRenderer(LWJGLWindow h, String fontFile)
"'abcdefghijklmno" +
"pqrstuvwxyz{|}~`" +
"âăîşţàçæèéêëïôœù" +
"úûüÿáíóñ¡¿";
"úûüÿáíóñ¡¿äöå";
this.charSizes = new int[]
{
3, 2, 4, 5, 5, 6, 5, 2, 3, 3, 4, 5, 1, 5, 1, 5,
Expand All @@ -35,7 +35,7 @@ public FontRenderer(LWJGLWindow h, String fontFile)
2, 5, 5, 5, 5, 5, 4, 5, 5, 1, 5, 4, 2, 5, 5, 5,
5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 4, 1, 4, 6, 2,
5, 5, 5, 5, 3, 5, 5, 7, 5, 5, 5, 5, 3, 5, 7, 5,
5, 5, 5, 5, 5, 3, 5, 5, 3, 5
5, 5, 5, 5, 5, 3, 5, 5, 3, 5, 5, 5, 5
};

this.image = fontFile;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tanks/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public enum Framework {lwjgl, libgdx}
public static double[][] tilesDepth = new double[28][18];

//Remember to change the version in android's build.gradle and ios's robovm.properties
public static final String version = "Tanks v1.4.m";
public static final int network_protocol = 45;
public static final String version = "Tanks v1.4.0";
public static final int network_protocol = 46;
public static boolean debug = false;
public static boolean traceAllRays = false;
public static final boolean cinematic = false;
Expand Down
123 changes: 23 additions & 100 deletions src/main/java/tanks/gui/screen/ScreenChangelog.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,120 +369,43 @@ public static void setupLogs()
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.a", new String[]
new Changelog("v1.4.0", new String[]
{
"*What's new in Tanks v1.4.a:\n\n" +
"*What's new in Tanks v1.4.0:\n\n" +
"*New features:\n\n" +
"Added tank editor and custom tanks\n" +
"Added air bullet which pushes things\n" +
"Added homing bullet which moves towards targets\n" +
"Added light blue tank which uses air bullets\n" +
"Added salmon tank which uses homing bullets\n" +
"Cooldowns are now per item\n" +
"Added cooldown indicator to hotbar\n" +
"Updated item icons\n" +
"Many internal improvements\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.b", new String[]
{
"*What's new in Tanks v1.4.b:\n\n" +
"Updated crusade info and stats screens\n" +
"New singleplayer shop music\n" +
"Tanks now avoid explosive blocks\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.c", new String[]
{
"*What's new in Tanks v1.4.c:\n\n" +
"Tanks will now see through destructible blocks\n" +
"Updated 3D explosion particle effect\n" +
"Added option to disable crusade levels background\n" +
"Changed castle crusade level 'Castle artillery'\n" +
"Bug fixes and other minor improvements\n"
});
"Added beginner crusade\n\n" +

new Changelog("v1.4.d", new String[]
{
"*What's new in Tanks v1.4.d:\n\n" +
"Added tank editor and custom tanks (still WIP)\n" +
"Made UI icons more colorful\n" +
"New editor music\n" +
"Added Español translation\n" +
"Other UI improvements\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.e", new String[]
{
"*What's new in Tanks v1.4.e:\n\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.f", new String[]
{
"*What's new in Tanks v1.4.f:\n\n" +
"Improved custom tank appearance customization\n" +
"Added support for custom tanks in crusades\n" +
"*Tank behavior:\n\n" +
"Tanks now try to avoid walls\n" +
"Bug fixes and other minor improvements\n"
});
"Tanks now see through destructible blocks\n" +
"Tanks now avoid explosive blocks",

new Changelog("v1.4.g", new String[]
{
"*What's new in Tanks v1.4.g:\n\n" +
"Added new custom tank options\n" +
"*Balancing:\n\n" +
"Boss tank now only spawns 5 tank types\n" +
"Cooldowns are now per item\n" +
"Made random level teleporters rarer\n" +
"Increased player tank acceleration\n" +
"Bug fixes and other minor improvements\n"
});
"Nerfed castle crusade level 'Castle artillery'\n\n" +

new Changelog("v1.4.h", new String[]
{
"*What's new in Tanks v1.4.h:\n\n" +
"Added tank description option\n" +
"*Graphics:\n\n" +
"New tank textures and models\n" +
"Updated crusade info and stats screen background\n" +
"Updated item icons\n" +
"Made UI icons more colorful\n" +
"Updated 3D explosion particle effect\n" +
"Added indicator when new shop items are available\n" +
"Use custom tanks in current level as templates\n" +
"Increased some textbox character limits\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.i", new String[]
{
"*What's new in Tanks v1.4.i:\n\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.j", new String[]
{
"*What's new in Tanks v1.4.j:\n\n" +
"New tank models and emblems\n" +
"The built-in tanks now have models and emblems\n" +
"Bug fixes and other minor improvements\n"
});
"Added bullet cooldown indicator to hotbar",

new Changelog("v1.4.k", new String[]
{
"*What's new in Tanks v1.4.k:\n\n" +
"*More:\n\n" +
"New editor music\n" +
"Shop is now available in versus mode\n" +
"Select music tracks for custom tanks\n" +
"Added option to disable the new tank designs\n" +
"IP address can now be hidden in parties\n" +
"Added more new tank designs\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.l", new String[]
{
"*What's new in Tanks v1.4.l:\n\n" +
"Custom tanks can spawn multiple tank types\n" +
"Boss tank now only spawns 5 tank types\n" +
"Bug fixes and other minor improvements\n"
});

new Changelog("v1.4.m", new String[]
{
"*What's new in Tanks v1.4.m:\n\n" +
"Increased some textbox character limits\n" +
"IP address can now be hidden in parties\n\n" +
"Bug fixes and other minor improvements\n"
});
}
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/tanks/gui/screen/ScreenCinematicTitle.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,20 @@ public void drawWithoutBackground()
{
/*Drawing.drawing.setInterfaceFontSize(70);
Drawing.drawing.setColor(0, 0, 0);
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY - 70, "But be careful!");
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY + 70,"One mistake, and its over!");*/
//Drawing.drawing.drawInterfaceText(this.centerX, this.centerY,"Make your own levels!");
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY - 70, "Go wild with a hundred options");
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY + 70,"to customize for each tank!");*/
//Drawing.drawing.drawInterfaceText(this.centerX, this.centerY,"Make your own custom tanks!");

Drawing.drawing.setColor(174, 92, 16);
Drawing.drawing.fillInterfaceRect(Drawing.drawing.interfaceSizeX / 2, Drawing.drawing.interfaceSizeY / 2, Game.game.window.absoluteWidth / Drawing.drawing.interfaceScale, Game.game.window.absoluteHeight / Drawing.drawing.interfaceScale);

Drawing.drawing.setColor(255, 255, 255);
Drawing.drawing.drawInterfaceImage("img.png", this.centerX, this.centerY, Drawing.drawing.interfaceSizeX, Drawing.drawing.interfaceSizeY);

Drawing.drawing.setColor(255, 255, 255, 127);
Drawing.drawing.fillInterfaceRect(Math.min(t * 20 / 2, Drawing.drawing.interfaceSizeX / 2), this.centerY, Math.min(t * 20, Drawing.drawing.interfaceSizeX), 280);


if (mine.destroy)
{
t2 = Math.min(t2 + Panel.frameFrequency * 2, 50);
Expand All @@ -78,9 +82,9 @@ public void drawWithoutBackground()
Drawing.drawing.fillInterfaceGlow(this.centerX, this.centerY + 170, 600, 140);
Drawing.drawing.fillInterfaceGlow(this.centerX, this.centerY + 340, 1200, 140);
Drawing.drawing.setColor(0, 0, 0, a);
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY + 170, "Update 1.3");
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY + 170, "Update 1.4");
Drawing.drawing.setInterfaceFontSize(64 * t2 / 75);
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY + 340, "With the all-new castle crusade!");
Drawing.drawing.drawInterfaceText(this.centerX, this.centerY + 340, "Make your own custom tanks!");

}

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/tanks/gui/screen/ScreenCrusades.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ public ScreenCrusades()
}
));

fullCrusadesList.buttons.add(3, new Button(0, 0, fullCrusadesList.objWidth, fullCrusadesList.objHeight, Translation.translate("Beginner crusade"), () ->
{
Crusade c = findExistingCrusadeProgress("internal/Beginner crusade");

if (c == null)
{
ArrayList<String> al = Game.game.fileManager.getInternalFileContents("/crusades/beginner_crusade.tanks");
c = new Crusade(al, "Beginner crusade", "/beginner_crusade.tanks");
}

Game.screen = new ScreenCrusadeDetails(c);
}
));

fullCrusadesList.sortedByTime = sortByTime;
fullCrusadesList.sort(sortByTime);
crusadesList = fullCrusadesList.clone();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tanks/gui/screen/ScreenGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ else if (o.drawLevel == i)
((IPlayerTank) Game.playerTank).setDrawRange(-1);
}

if (i == 9 && Game.playerTank != null && !Game.playerTank.destroy && (ScreenPartyHost.isServer || ScreenPartyLobby.isClient)
if (i == 9 && Game.playerTank != null && !Game.playerTank.destroy
&& Game.screen instanceof ScreenGame && !((ScreenGame) Game.screen).playing && Game.movables.contains(Game.playerTank))
{
double s = Game.startTime;
Expand All @@ -2065,7 +2065,7 @@ else if (o.drawLevel == i)

double frac = (System.currentTimeMillis() % 2000) / 2000.0;
double size = Math.max(800 * (0.5 - frac), 0) * fade;
Drawing.drawing.setColor(Game.player.colorR, Game.player.colorG, Game.player.colorB, 64 * Math.sin(Math.min(frac * Math.PI, Math.PI / 2)) * fade);
Drawing.drawing.setColor(Game.playerTank.colorR, Game.playerTank.colorG, Game.playerTank.colorB, 64 * Math.sin(Math.min(frac * Math.PI, Math.PI / 2)) * fade);

if (Game.enable3d)
Drawing.drawing.fillOval(Game.playerTank.posX, Game.playerTank.posY, Game.playerTank.size / 2, size, size, false, false);
Expand All @@ -2075,16 +2075,16 @@ else if (o.drawLevel == i)
double frac2 = ((250 + System.currentTimeMillis()) % 2000) / 2000.0;
double size2 = Math.max(800 * (0.5 - frac2), 0) * fade;

Drawing.drawing.setColor(Game.player.turretColorR, Game.player.turretColorG, Game.player.turretColorB, 64 * Math.sin(Math.min(frac2 * Math.PI, Math.PI / 2)) * fade);
Drawing.drawing.setColor(Game.playerTank.secondaryColorR, Game.playerTank.secondaryColorG, Game.playerTank.secondaryColorB, 64 * Math.sin(Math.min(frac2 * Math.PI, Math.PI / 2)) * fade);

if (Game.enable3d)
Drawing.drawing.fillOval(Game.playerTank.posX, Game.playerTank.posY, Game.playerTank.size / 2, size2, size2, false, false);
else
Drawing.drawing.fillOval(Game.playerTank.posX, Game.playerTank.posY, size2, size2);

Drawing.drawing.setColor(Game.player.colorR, Game.player.colorG, Game.player.colorB);
Drawing.drawing.setColor(Game.playerTank.colorR, Game.playerTank.colorG, Game.playerTank.colorB);
this.drawSpinny(Game.playerTank.posX, Game.playerTank.posY, Game.playerTank.size / 2, 200, 4, 0.3, 75 * fade, 0.5 * fade, false);
Drawing.drawing.setColor(Game.player.turretColorR, Game.player.turretColorG, Game.player.turretColorB);
Drawing.drawing.setColor(Game.playerTank.secondaryColorR, Game.playerTank.secondaryColorG, Game.playerTank.secondaryColorB);
this.drawSpinny(Game.playerTank.posX, Game.playerTank.posY, Game.playerTank.size / 2, 198, 3, 0.5, 60 * fade, 0.375 * fade, false);
}

Expand Down Expand Up @@ -2346,7 +2346,7 @@ else if (ScreenPartyLobby.isClient)
if (newItemsNotification)
{
Button.drawGlow(enterShop.posX - enterShop.sizeX / 2 + enterShop.sizeY / 2, enterShop.posY + 2.5 + 1, enterShop.sizeY * 3 / 4, enterShop.sizeY * 3 / 4, 0.6, 0, 0, 0, 100, false);
drawing.setInterfaceFontSize(this.textSize);
drawing.setInterfaceFontSize(this.textSize / Drawing.drawing.interfaceScaleZoom);
drawing.setColor(255, 127, 0);
drawing.fillInterfaceOval(enterShop.posX - enterShop.sizeX / 2 + enterShop.sizeY / 2, enterShop.posY, enterShop.sizeY * 3 / 4, enterShop.sizeY * 3 / 4);
drawing.setColor(255, 255, 255);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tanks/gui/screen/ScreenLanguage.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public ScreenLanguage()
}
));*/

/*languages.buttons.add(2, new Button(0, 0, 350, 40, "Svenska", () ->
languages.buttons.add(2, new Button(0, 0, 350, 40, "Svenska", () ->
{
changeLanguage(new Translation("se.lang"));
}
));

languages.buttons.add(3, new Button(0, 0, 350, 40, "Română", () ->
/*languages.buttons.add(3, new Button(0, 0, 350, 40, "Română", () ->
{
changeLanguage(new Translation("ro.lang"));
}
Expand Down
16 changes: 15 additions & 1 deletion src/main/java/tanks/tank/TankAIControlled.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import static tanks.tank.TankProperty.Category.*;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -2890,7 +2891,8 @@ public void cloneProperties(TankAIControlled t)
{
for (Field f : TankAIControlled.class.getFields())
{
if (f.getAnnotation(TankProperty.class) != null)
TankProperty a = f.getAnnotation(TankProperty.class);
if (a != null)
{
if (Item.class.isAssignableFrom(f.getType()))
{
Expand Down Expand Up @@ -2918,6 +2920,18 @@ else if (Tank.class.isAssignableFrom(f.getType()))
else
f.set(t, null);
}
else if (a.miscType() == TankProperty.MiscType.spawnedTanks)
{
ArrayList<SpawnedTankEntry> a1 = (ArrayList<SpawnedTankEntry>) f.get(this);

ArrayList<SpawnedTankEntry> al = new ArrayList<SpawnedTankEntry>();
for (SpawnedTankEntry o: a1)
{
al.add(new SpawnedTankEntry(o.tank, o.weight));
}

f.set(t, al);
}
else
f.set(t, f.get(this));
}
Expand Down
15 changes: 15 additions & 0 deletions src/main/resources/crusades/beginner_crusade.tanks
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
properties
10,1,false,false
items
tanks
levels
{17,11,235,207,166,20,20,20,0,100,50|0...1-0-hard,0-1-hard,0-9...10-hard,1-10-hard,8-4...6-hard-2.5,15...16-0-hard,15...16-10-hard,16-1-hard,16-9-hard|13-5-brown-2-enemy,3-5-player-0-ally|ally-true,enemy-true} name=beginner_1
{17,11,235,207,166,20,20,20,0,100,50|5-5-hard,6-4-hard,7-3-hard,9-7-hard,10-6-hard,11-5-hard|2-2-brown-0-enemy,14-8-brown-2-enemy,8-5-player-0-ally|ally-true,enemy-true} name=beginner_2
{17,11,235,207,166,20,20,20,0,100,50|3-5-hard,4-5-hard-1.5,5-5-hard-2.0,6-5-hard-2.5,7...9-5-hard-3.0,10-5-hard-2.5,11-5-hard-2.0,12-5-hard-1.5,13-5-hard|14-8-gray-2-enemy,2-2-player-0-ally|ally-true,enemy-true} name=beginner_3
{17,11,235,207,166,20,20,20,0,100,50|10-4...6,10-0-hard-2.0,10-1-hard-1.5,10-2-hard-2.0,10-3-hard-1.5,10-7-hard-1.5,10-8-hard-2.0,10-9-hard-1.5,10-10-hard-2.0|14-9-brown-3-enemy,14-1-brown-1-enemy,14-5-gray-2-enemy,2-5-player-0-ally|ally-true,enemy-true} name=beginner_4
{17,11,235,207,166,20,20,20,0,100,50|5-6...10-hard-2.0,11-0...4-hard-2.0|14-1-mint-2-enemy,2-9-player-0-ally|ally-true,enemy-true} name=beginner_5
{17,11,235,207,166,20,20,20,0,100,50|8-3...6-hard,9...11-6-hard|15-4-mint-2-enemy,12-1-mint-1-enemy,14-2-gray-1-enemy,2-8-player-0-ally|ally-true,enemy-true} name=beginner_6
{17,11,235,207,166,20,20,20,0,100,50|6...14-2,6-3...8,7...14-8,14-3...7|8-6-yellow-0-enemy,16-3-brown-2-enemy,16-7-brown-2-enemy,2-2-player-0-ally|ally-true,enemy-true} name=beginner_7
{17,11,235,207,166,20,20,20,0,100,50|5-3...7,9-0...3,9-7...10,13-3...7|13-9-yellow-3-enemy,13-1-yellow-1-enemy,15-6-mint-2-enemy,15-4-mint-2-enemy,2-5-player-0-ally|ally-true,enemy-true} name=beginner_8
{17,11,235,207,166,20,20,20,0,100,50|5...7-4-hard,6-3-hard,6-5-hard,9...11-7-hard,10-6-hard,10-8-hard|14-8-magenta-2-enemy,2-2-player-0-ally|ally-true,enemy-true} name=beginner_9
{17,11,235,207,166,20,20,20,0,100,50|7...11-2-hard,7-3-hard,7-7...8-hard,8...11-8-hard|9-5-brown-2-enemy,11-4-gray-2-enemy,11-6-mint-2-enemy,13-3-magenta-2-enemy,13-7-yellow-2-enemy,13-5-brown-2-enemy,2-5-player-0-ally|ally-true,enemy-true} name=beginner_10
Binary file modified src/main/resources/font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/emblems/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f959544

Please sign in to comment.