Continued implementing the Megamon and move database. Added the Megamon

party menu along with testing Megamon HP values and displays.
master
sigonasr2 7 years ago
parent 7cb1714247
commit 5322cb402d
  1. 2
      Megamon-core/.classpath
  2. BIN
      Megamon-core/assets/Megamon/1.png
  3. BIN
      Megamon-core/assets/Megamon/1_back.png
  4. BIN
      Megamon-core/assets/Megamon/1_icon.png
  5. BIN
      Megamon-core/assets/interface/healthbar.png
  6. BIN
      Megamon-core/assets/interface/megamon_party.png
  7. BIN
      Megamon-core/assets/interface/megamon_party_selection.png
  8. 197
      Megamon-core/src/sig/megamon/Database.java
  9. 50
      Megamon-core/src/sig/megamon/Megamon.java
  10. 90
      Megamon-core/src/sig/megamon/MegamonCreature.java
  11. 251
      Megamon-core/src/sig/megamon/MegamonPet.java
  12. 10
      Megamon-core/src/sig/megamon/Player.java
  13. 11
      Megamon-core/src/sig/megamon/creature/CreatureMove.java
  14. 11
      Megamon-core/src/sig/megamon/creature/CreatureMoveLinker.java
  15. 19
      Megamon-core/src/sig/megamon/creature/Evolution.java
  16. 5
      Megamon-core/src/sig/megamon/menu/MegadexMenu.java
  17. 99
      Megamon-core/src/sig/megamon/menu/MegamonPartyScreen.java
  18. 21
      Megamon-core/src/sig/megamon/menu/MenuItem.java
  19. 37
      Megamon-core/src/sig/megamon/menu/StartMenuBox.java

@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="assets"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx/1.9.6/47d1e9b890e364ec28f128e9bb3b9a12a94c164/gdx-1.9.6.jar" sourcepath="C:/Users/Joshua Sigona/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx/1.9.6/7d903ecd6b0df2ec334814b8e70618e4c93fd37c/gdx-1.9.6-sources.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-box2d/1.9.6/c249ef4060a4fada952f278455c8f7b9cba3c18a/gdx-box2d-1.9.6.jar" sourcepath="C:/Users/Joshua Sigona/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-box2d/1.9.6/584f96799f8fedc8e6bb87eef1e261f0e7f92900/gdx-box2d-1.9.6-sources.jar"/>
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-controllers/1.9.6/ea1fd4884be631d9b7cd0f496b1ab39e31eb434b/gdx-controllers-1.9.6.jar" sourcepath="C:/Users/Joshua Sigona/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx-controllers/1.9.6/a730ab024c77f376b24e635f1d82e7d69fc5c648/gdx-controllers-1.9.6-sources.jar"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

@ -1,7 +1,15 @@
package sig.megamon;
import java.awt.geom.Point2D;
import java.util.Arrays;
import java.util.LinkedList;
import sig.megamon.creature.Category;
import sig.megamon.creature.CreatureMove;
import sig.megamon.creature.CreatureMoveLinker;
import sig.megamon.creature.CreatureType;
import sig.megamon.creature.Evolution;
import sig.megamon.creature.ExperienceRate;
import sig.megamon.ref.RoomRef;
import sig.megamon.ref.SignRef;
@ -27,4 +35,193 @@ public class Database {
}
);
}
public static void SetupMoveDatabase() {
String moveName = "M.Buster";Megamon.moveDatabase.put(moveName, new CreatureMove(
moveName,"Damages the target. Exclusive to Mega Man.",
CreatureType.NORMAL, Category.SPECIAL,
35,35,95));
Megamon.moveDatabase.put(moveName="P.Buster", new CreatureMove(
moveName,"Damages the target. Exclusive to Proto Man.",
CreatureType.NORMAL, Category.SPECIAL,
35,35,95));
Megamon.moveDatabase.put(moveName="B.Buster", new CreatureMove(
moveName,"Damages the target. Exclusive to Bass.",
CreatureType.NORMAL, Category.SPECIAL,
35,35,95));
Megamon.moveDatabase.put(moveName="Bubble Lead", new CreatureMove(
moveName,"Damages the target with bubbles. Exclusive to Mega Man.",
CreatureType.WATER, Category.SPECIAL,
25,40,100));
Megamon.moveDatabase.put(moveName="Magma Bazooka", new CreatureMove(
moveName,"Has a 10% chance to burn the target. Exclusive to Proto Man.",
CreatureType.FIRE, Category.SPECIAL,
15,95,100));
Megamon.moveDatabase.put(moveName="Slide", new CreatureMove(
moveName,"Increases the user's evasion by one stage.",
CreatureType.NORMAL, Category.STATUS,
15,0,100));
Megamon.moveDatabase.put(moveName="Water Balloon", new CreatureMove(
moveName,"Damages the target with a large water baloon. Exclusive to Mega Man.",
CreatureType.WATER, Category.SPECIAL,
5,120,80));
Megamon.moveDatabase.put(moveName="Quick Jab", new CreatureMove(
moveName,"Damages the target, and is an increased priority move. Will go first regardless of the user's or targets speed.",
CreatureType.STRENGTH, Category.PHYSICAL,
30,60,100));
Megamon.moveDatabase.put(moveName="Haymaker", new CreatureMove(
moveName,"Damages the target, and has a 10% chance to paralyze the target.",
CreatureType.STRENGTH, Category.PHYSICAL,
15,90,100));
Megamon.moveDatabase.put(moveName="Proto Shield", new CreatureMove(
moveName,"If the target uses a damaging move you block 75% of the damage. If the move is non damaging the user's defense falls 1 stage.",
CreatureType.SHIELD, Category.STATUS,
25,0,100));
Megamon.moveDatabase.put(moveName="Shield Charge", new CreatureMove(
moveName,"Damages the target, and has a 10% chance to paralyze the target.",
CreatureType.SHIELD, Category.PHYSICAL,
15,90,100));
Megamon.moveDatabase.put(moveName="Jamming", new CreatureMove(
moveName,"Lowers the target's attack by 1 stage",
CreatureType.NORMAL, Category.STATUS,
40,0,100));
Megamon.moveDatabase.put(moveName="Degrade", new CreatureMove(
moveName,"Lowers the target's defense by 1 stage",
CreatureType.NORMAL, Category.STATUS,
40,0,100));
Megamon.moveDatabase.put(moveName="Shadow Punch", new CreatureMove(
moveName,"Inflicts damage and is unaffected by ACC & EVA stat mods. Will not hit targets using Fly or Dig.",
CreatureType.DARK, Category.PHYSICAL,
20,60,100));
Megamon.moveDatabase.put(moveName="Evil Energy", new CreatureMove(
moveName,"Increases the Attack by 2 Stages. Cannot Stack.",
CreatureType.DARK, Category.STATUS,
10,0,100));
Megamon.moveDatabase.put(moveName="Octagon Shot", new CreatureMove(
moveName,"Attacks 3-5 times in one turn; if one of these attacks breaks a target's Substitute, the target will take damage for the rest",
CreatureType.DARK, Category.PHYSICAL,
20,25,100));
Megamon.moveDatabase.put(moveName="Aerial Barrage", new CreatureMove(
moveName,"A powerful aerial strike.",
CreatureType.FLYING, Category.PHYSICAL,
15,95,100));
Megamon.moveDatabase.put(moveName="Beat Plane", new CreatureMove(
moveName,"Beats the target, and has a 10% chance to confuse the target.",
CreatureType.FLYING, Category.PHYSICAL,
15,75,95));
Megamon.moveDatabase.put(moveName="Double Jump", new CreatureMove(
moveName,"Increases the user's evasion by 1 stage.",
CreatureType.NORMAL, Category.STATUS,
15,0,100));
Megamon.moveDatabase.put(moveName="Double Jump", new CreatureMove(
moveName,"First turn, the user jumps into the air, becoming uncontrollable, and evades most attacks. Swift may still hit. The second turn, the user slams into the ground dealing heavy damage.",
CreatureType.NORMAL, Category.PHYSICAL,
15,70,95));
Megamon.moveDatabase.put(moveName="Spread Shot", new CreatureMove(
moveName,"Damages the target. Exclusive to Mets.",
CreatureType.NORMAL, Category.PHYSICAL,
30,35,95));
Megamon.moveDatabase.put(moveName="Taunt", new CreatureMove(
moveName,"Raises the target's attack by 2 stages and confuses it.",
CreatureType.NORMAL, Category.STATUS,
15,0,90));
Megamon.moveDatabase.put(moveName="Spark Shock", new CreatureMove(
moveName,"Damages the target, and has a 50% chance to paralyze the target. Exclusive to Spark Man.",
CreatureType.ELECTRIC, Category.SPECIAL,
10,50,85));
Megamon.moveDatabase.put(moveName="Charge", new CreatureMove(
moveName,"Raises the user's Special Attack by 1 stage.",
CreatureType.ELECTRIC, Category.STATUS,
15,0,100));
Megamon.moveDatabase.put(moveName="Rain Flush", new CreatureMove(
moveName,"Damages the target. Has a 25% chance to poison the target. Exclusive to Toad Man.",
CreatureType.WATER, Category.SPECIAL,
15,75,90));
Megamon.moveDatabase.put(moveName="Fade to Black", new CreatureMove(
moveName,"Raises the user's evasion by 1 stage.",
CreatureType.DARK, Category.STATUS,
20,0,0));
Megamon.moveDatabase.put(moveName="Dive Bomb", new CreatureMove(
moveName,"Flies up and dives straight for the target.",
CreatureType.FLYING, Category.PHYSICAL,
15,60,100));
Megamon.moveDatabase.put(moveName="Shield & Burst", new CreatureMove(
moveName,"On turn 1 a shield is put up and will absorb 25% of the attack damage. On Turn 2 the shield bursts into shrapnel-like pieces.",
CreatureType.SHIELD, Category.SPECIAL,
15,60,100));
Megamon.moveDatabase.put(moveName="Pharaoh Shot", new CreatureMove(
moveName,"Damages the target. Has a 10% chance to burn the target. Exclusive to Pharoah Man.",
CreatureType.FIRE, Category.SPECIAL,
15,95,100));
Megamon.moveDatabase.put(moveName="Pharaoh Shot", new CreatureMove(
moveName,"Damages the target. Has a 10% chance to burn the target. Exclusive to Pharoah Man.",
CreatureType.FIRE, Category.SPECIAL,
15,95,100));
Megamon.moveDatabase.put(moveName="Yamato Spear", new CreatureMove(
moveName,"Damages the target.",
CreatureType.NORMAL, Category.PHYSICAL,
15,80,100));
Megamon.moveDatabase.put(moveName="Burn", new CreatureMove(
moveName,"Inflicts a burn damage to the target. It has no effect on Fire-types.",
CreatureType.FIRE, Category.SPECIAL,
15,0,75));
Megamon.moveDatabase.put(moveName="Fire Storm", new CreatureMove(
moveName,"Damages the target. Has a 10% chance to Burn the target. Also increases Special & Attack by 1 stage to the user.",
CreatureType.FIRE, Category.SPECIAL,
15,60,100));
Megamon.moveDatabase.put(moveName="Bug Bite", new CreatureMove(
moveName,"Damages the target. Has a 20% chance to poison the target.",
CreatureType.BUG, Category.PHYSICAL,
15,65,85));
Megamon.moveDatabase.put(moveName="Air Shooter", new CreatureMove(
moveName,"Damages the target with air waves. Exclusive to Air Man.",
CreatureType.FLYING, Category.SPECIAL,
15,95,100));
Megamon.moveDatabase.put(moveName="Plant Barrier", new CreatureMove(
moveName,"It blocks any attack made by the enemy. Will always go first.",
CreatureType.SHIELD, Category.STATUS,
5,0,100));
Megamon.moveDatabase.put(moveName="Noise Crush", new CreatureMove(
moveName,"Damages the Target. If used on an enemy that has barrier, light screen, or reflect active the damage doubles.",
CreatureType.DARK, Category.PHYSICAL,
15,85,100));
Megamon.moveDatabase.put(moveName="Crystal Eye", new CreatureMove(
moveName,"Damages the target. Excluse to Crystal Man.",
CreatureType.NORMAL, Category.SPECIAL,
15,90,100));
Megamon.moveDatabase.put(moveName="Proto Song", new CreatureMove(
moveName,"Puts the target to sleep. Exclusive to Proto Man.",
CreatureType.NORMAL, Category.SPECIAL,
15,0,75));
Megamon.moveDatabase.put(moveName="Last Round", new CreatureMove(
moveName,"Lowers the user's speed by 1 stage, but increases the user's attack and defense by 1 stage.",
CreatureType.STRENGTH, Category.STATUS,
5,0,100));
Megamon.moveDatabase.put(moveName="Fire Armor", new CreatureMove(
moveName,"Damages the target and increases the users defense by 1 stage.",
CreatureType.FIRE, Category.SPECIAL,
20,50,100));
Megamon.moveDatabase.put(moveName="Ultimate Defense", new CreatureMove(
moveName,"If successful, the user's defense increases by 2 stages, If not successful the user suffers from a random status condition.",
CreatureType.FIRE, Category.SPECIAL,
5,0,50));
}
public static void SetupMegamonDatabase() {
Megamon.megamonDatabase = new LinkedList<MegamonCreature>(Arrays.asList(
new MegamonCreature("1_icon.png","1.png","1_back.png",
"Basic M", "Basic Megaman", 1, 1,
CreatureType.WATER, 44, 48, 65, 50, 43,
3, 64, ExperienceRate.MEDIUM_SLOW,
new CreatureMoveLinker[]{
new CreatureMoveLinker(Megamon.moveDatabase.get("M.Buster"),1),
new CreatureMoveLinker(Megamon.moveDatabase.get("Degrade"),1),
new CreatureMoveLinker(Megamon.moveDatabase.get("Bubble Lead"),8),
new CreatureMoveLinker(Megamon.moveDatabase.get("Slide"),15),
new CreatureMoveLinker(Megamon.moveDatabase.get("Bubble Beam"),22),
new CreatureMoveLinker(Megamon.moveDatabase.get("Water Shield"),28),
new CreatureMoveLinker(Megamon.moveDatabase.get("Water Balloon"),38),
})
));
}
}

@ -32,9 +32,11 @@ import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
import sig.megamon.creature.CreatureMove;
import sig.megamon.creature.CreatureMoveLinker;
import sig.megamon.creature.CreatureType;
import sig.megamon.creature.ExperienceRate;
import sig.megamon.menu.DialogBox;
import sig.megamon.menu.MegamonPartyScreen;
import sig.megamon.menu.StartMenuBox;
import sig.megamon.ref.Ref;
import sig.megamon.ref.RoomRef;
@ -49,6 +51,8 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
public static BitmapFont font;
public static DialogBox messagebox;
public static StartMenuBox startmenubox;
public static MegamonPartyScreen partyscreen;
public static Texture healthbar;
//AssetManager assets;
//TiledMap map;
static OrthographicCamera camera;
@ -67,6 +71,8 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
final public static int MOVEUPKEY = Keys.UP;
final public static int MOVEDOWNKEY = Keys.DOWN;
final public static int MENUKEY = Keys.ENTER;
public static List<MegamonCreature> megamonDatabase = new ArrayList<MegamonCreature>();
public static HashMap<String,CreatureMove> moveDatabase = new HashMap<String,CreatureMove>();
//public static List<Object> objects = new ArrayList<Object>();
public static Room currentLevel;
public static HashMap<String,RoomRef> doorDatabase = new HashMap<String,RoomRef>();
@ -77,6 +83,7 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
batch = new SpriteBatch();
font = new BitmapFont(Gdx.files.internal("fonts/AgencyFB.fnt"));
mainP = new Player(new Point2D.Double(1,1),"megamon_icon64.png");
healthbar = new Texture("interface/healthbar.png");
//assets = new AssetManager();
/*assets.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));
@ -91,14 +98,39 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
objects.add(new Object("megamonlogowip.png",new Point2D.Double(3, 7)));*/
Database.SetupDoorDatabase();
Database.SetupInfoDatabase();
Database.SetupMoveDatabase();
Database.SetupMegamonDatabase();
currentLevel = new Room(mainP.position,"Test Map");
/*MegamonPet testPet = new MegamonPet("Test",
MegamonPet testPet = new MegamonPet("Test Name",
new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png",
"Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL,
40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMove[]{}),
40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}),
100);
System.out.println(testPet);*/
MegamonPet testPet2 = new MegamonPet("Test Name",
new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png",
"Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL,
40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}),
100);
MegamonPet testPet3 = new MegamonPet("Test Name",
new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png",
"Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL,
40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}),
100);
MegamonPet testPet4 = new MegamonPet("Test Name",
new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png",
"Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL,
40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}),
100);
testPet.setHP((int)(Math.random()*testPet.getMaxHP()));
testPet2.setHP((int)(Math.random()*testPet2.getMaxHP()));
testPet3.setHP((int)(Math.random()*testPet3.getMaxHP()));
testPet4.setHP((int)(1));
mainP.getMegamonParty().add(testPet);
mainP.getMegamonParty().add(testPet2);
mainP.getMegamonParty().add(testPet3);
mainP.getMegamonParty().add(testPet4);
/*System.out.println(testPet);*/
//messagebox = new DialogBox("This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.");
//startmenubox = new StartMenuBox(0);
}
@ -112,6 +144,9 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
Gdx.graphics.set
//Potential resizing code.
}*/
if (partyscreen!=null) {
partyscreen.run();
} else
if (messagebox!=null) {
messagebox.run();
}
@ -142,6 +177,12 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
currentLevel.renderer.render();
batch.begin();
//batch.draw(img, 0, 0);
if (partyscreen!=null) {
partyscreen.draw(batch);
}
else
{
for (Object o : currentLevel.getObjects()) {
batch.draw(o.sprite,
(float)GraphicUtils.getRelativePixelPositionFromPlayer(camera, o.position).x,
@ -155,7 +196,8 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{
if (startmenubox!=null) {
startmenubox.draw(batch);
}
GlyphLayout size = font.draw(batch, "Test Text", 0, 32);
}
//GlyphLayout size = font.draw(batch, "Test Text", 0, 32);
//font.draw(batch, "Test Text", Megamon.WINDOW_WIDTH-size.width, 128-size.height);
batch.end();
framesPassed++;

@ -8,7 +8,9 @@ import java.util.List;
import sig.megamon.creature.CreatureLore;
import sig.megamon.creature.CreatureMove;
import sig.megamon.creature.CreatureMoveLinker;
import sig.megamon.creature.CreatureType;
import sig.megamon.creature.Evolution;
import sig.megamon.creature.ExperienceRate;
import sig.megamon.creature.SpriteCollection;
@ -26,23 +28,34 @@ public class MegamonCreature {
final int catch_rate;
final int base_exp;
final ExperienceRate exp_rate;
final List<CreatureMove> moveset;
final List<CreatureMoveLinker> moveset;
final List<Evolution> evolution_rules;
boolean seenByPlayer=false;
public MegamonCreature(String mini_icon, String sprite, String back_sprite,
String name, String bio, int size, float weight, CreatureType type1,
int base_hp, int base_atk, int base_def, int base_spd, int base_spc,
int base_hp, int base_atk, int base_def, int base_spc, int base_spd,
int catch_rate, int base_exp, ExperienceRate exp_rate,
CreatureMove...moveset) {
this(mini_icon,sprite,back_sprite,name,bio,size, weight,type1,CreatureType.NONE,base_hp,base_atk,base_def,base_spd,base_spc,catch_rate,base_exp,exp_rate,moveset);
CreatureMoveLinker...moveset) {
this(mini_icon,sprite,back_sprite,name,bio,size, weight,type1,CreatureType.NONE,base_hp,base_atk,base_def,base_spc,base_spd,catch_rate,base_exp,exp_rate,new ArrayList<Evolution>(),moveset);
}
public MegamonCreature(String mini_icon, String sprite, String back_sprite,
String name, String bio, int size, float weight, CreatureType type1,
int base_hp, int base_atk, int base_def, int base_spc, int base_spd,
int catch_rate, int base_exp, ExperienceRate exp_rate,
List<Evolution> evolution_rules,
CreatureMoveLinker...moveset) {
this(mini_icon,sprite,back_sprite,name,bio,size, weight,type1,CreatureType.NONE,base_hp,base_atk,base_def,base_spc,base_spd,catch_rate,base_exp,exp_rate,evolution_rules,moveset);
}
public MegamonCreature(String mini_icon, String sprite, String back_sprite,
String name, String bio, int size, float weight, CreatureType type1,
CreatureType type2,
int base_hp, int base_atk, int base_def, int base_spd, int base_spc,
int base_hp, int base_atk, int base_def, int base_spc, int base_spd,
int catch_rate, int base_exp, ExperienceRate exp_rate,
CreatureMove...moveset) {
List<Evolution> evolution_rules,
CreatureMoveLinker...moveset) {
this.sprites = new SpriteCollection(mini_icon,sprite,back_sprite);
this.name = name;
this.bio = new CreatureLore(bio,size,weight);
@ -57,12 +70,77 @@ public class MegamonCreature {
this.base_exp=base_exp;
this.exp_rate = exp_rate;
this.moveset = new LinkedList(Arrays.asList(moveset));
this.evolution_rules=evolution_rules;
}
public void setSeen(boolean seenByPlayer) {
this.seenByPlayer=seenByPlayer;
}
public SpriteCollection getSprites() {
return sprites;
}
public String getName() {
return name;
}
public CreatureLore getBio() {
return bio;
}
public CreatureType getType1() {
return type1;
}
public CreatureType getType2() {
return type2;
}
public int getHP() {
return hp;
}
public int getATK() {
return atk;
}
public int getDEF() {
return def;
}
public int getSPD() {
return spd;
}
public int getSPC() {
return spc;
}
public int getCatchRate() {
return catch_rate;
}
public int getBaseEXP() {
return base_exp;
}
public ExperienceRate getEXPRate() {
return exp_rate;
}
public List<CreatureMoveLinker> getMoveset() {
return moveset;
}
public boolean isSeenByPlayer() {
return seenByPlayer;
}
public List<Evolution> getEvolutionRules() {
return evolution_rules;
}
public String toString() {
StringBuilder sb = new StringBuilder(this.getClass().getSimpleName()+"(");
boolean first=true;

@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import sig.megamon.creature.CreatureMove;
import sig.megamon.creature.NonVolatileStatus;
import sig.megamon.creature.VolatileStatus;
@ -37,6 +38,7 @@ public class MegamonPet {
String original_trainer_name;
Integer level;
Integer hp_iv;
List<CreatureMove> moveset = new ArrayList<CreatureMove>();
public MegamonPet(String nickname, MegamonCreature creature_type, Integer level) {
this(nickname,creature_type,level,Megamon.mainP.trainer_id,Megamon.mainP.name);
@ -44,13 +46,19 @@ public class MegamonPet {
public MegamonPet(String nickname, MegamonCreature creature_type, Integer level,
Integer original_trainer, String original_trainer_name) {
this(nickname,creature_type,level,original_trainer,original_trainer_name,
this(nickname,creature_type,level,original_trainer,original_trainer_name, new ArrayList<CreatureMove>(),
new Integer[]{}, new Integer[]{});
}
public MegamonPet(String nickname, MegamonCreature creature_type, Integer level,
Integer original_trainer, String original_trainer_name, Integer[] stats_collection,
Integer...IV_EV_Collection) {
Integer original_trainer, String original_trainer_name, List<CreatureMove> moveset) {
this(nickname,creature_type,level,original_trainer,original_trainer_name, moveset,
new Integer[]{}, new Integer[]{});
}
public MegamonPet(String nickname, MegamonCreature creature_type, Integer level,
Integer original_trainer, String original_trainer_name, List<CreatureMove> moveset,
Integer[] stats_collection, Integer...IV_EV_Collection) {
this.creature = creature_type;
if (nickname.length()>0) {
this.nickname = nickname;
@ -61,6 +69,11 @@ public class MegamonPet {
this.original_trainer = original_trainer;
this.original_trainer_name = original_trainer_name;
InitializeStats(stats_collection,IV_EV_Collection);
LearnDefaultMoves();
}
private void LearnDefaultMoves() {
// TODO Auto-generated method stub
}
private void InitializeStats(Integer[] stats_collection, Integer[] IV_EV_Collection) {
@ -119,6 +132,238 @@ public class MegamonPet {
return (int)(((((base+iv)*2)+(Math.sqrt(ev)/4))*lv)/100)+5;
}
public MegamonCreature getCreature() {
return creature;
}
public NonVolatileStatus getStatus() {
return status;
}
public VolatileStatus getBattleStatus() {
return battlestatus;
}
public Integer getATKModifier() {
return atk_modifier;
}
public Integer getDEFModifier() {
return def_modifier;
}
public Integer getSPDModifier() {
return spd_modifier;
}
public Integer getSPCModifier() {
return spc_modifier;
}
public Integer getEVAModifier() {
return eva_modifier;
}
public Integer getACCModifier() {
return acc_modifier;
}
public Integer getATKIV() {
return atk_iv;
}
public Integer getDEFIV() {
return def_iv;
}
public Integer getSPDIV() {
return spd_iv;
}
public Integer getSPCIV() {
return spc_iv;
}
public Integer getATKEV() {
return atk_ev;
}
public Integer getDEFEV() {
return def_ev;
}
public Integer getSPDEV() {
return spd_ev;
}
public Integer getSPCEV() {
return spc_ev;
}
public Integer getHPEV() {
return hp_ev;
}
public Integer getHP() {
return hp;
}
public Integer getMaxHP() {
return maxhp;
}
public Integer getATK() {
return atk;
}
public Integer getDEF() {
return def;
}
public Integer getSPD() {
return spd;
}
public Integer getSPC() {
return spc;
}
public String getNickname() {
return nickname;
}
public Integer getOriginalTrainerID() {
return original_trainer;
}
public String getOriginalTrainerName() {
return original_trainer_name;
}
public Integer getLevel() {
return level;
}
public Integer getHPIV() {
return hp_iv;
}
public void setCreature(MegamonCreature creature) {
this.creature = creature;
}
public void setStatus(NonVolatileStatus status) {
this.status = status;
}
public void setBattleStatus(VolatileStatus battlestatus) {
this.battlestatus = battlestatus;
}
public void setATKModifier(Integer atk_modifier) {
this.atk_modifier = atk_modifier;
}
public void setDEFModifier(Integer def_modifier) {
this.def_modifier = def_modifier;
}
public void setSPDModifier(Integer spd_modifier) {
this.spd_modifier = spd_modifier;
}
public void setSPCModifier(Integer spc_modifier) {
this.spc_modifier = spc_modifier;
}
public void setEVAModifier(Integer eva_modifier) {
this.eva_modifier = eva_modifier;
}
public void setACCModifier(Integer acc_modifier) {
this.acc_modifier = acc_modifier;
}
public void setATKIV(Integer atk_iv) {
this.atk_iv = atk_iv;
}
public void setDEFIV(Integer def_iv) {
this.def_iv = def_iv;
}
public void setSPDIV(Integer spd_iv) {
this.spd_iv = spd_iv;
}
public void setSPCIV(Integer spc_iv) {
this.spc_iv = spc_iv;
}
public void setATKEV(Integer atk_ev) {
this.atk_ev = atk_ev;
}
public void setDEFEV(Integer def_ev) {
this.def_ev = def_ev;
}
public void setSPDEV(Integer spd_ev) {
this.spd_ev = spd_ev;
}
public void setSPCEV(Integer spc_ev) {
this.spc_ev = spc_ev;
}
public void setHPEV(Integer hp_ev) {
this.hp_ev = hp_ev;
}
public void setHP(Integer hp) {
this.hp = hp;
}
public void setMaxHP(Integer maxhp) {
this.maxhp = maxhp;
}
public void setATK(Integer atk) {
this.atk = atk;
}
public void setDEF(Integer def) {
this.def = def;
}
public void setSPD(Integer spd) {
this.spd = spd;
}
public void setSPC(Integer spc) {
this.spc = spc;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public void setOriginalTrainerID(Integer original_trainer) {
this.original_trainer = original_trainer;
}
public void setOriginalTrainerName(String original_trainer_name) {
this.original_trainer_name = original_trainer_name;
}
public void setLevel(Integer level) {
this.level = level;
}
public void setHPIV(Integer hp_iv) {
this.hp_iv = hp_iv;
}
public String toString() {
StringBuilder sb = new StringBuilder(this.getClass().getSimpleName()+"(");
boolean first=true;

@ -22,7 +22,7 @@ public class Player {
Point2D.Double direction = new Point2D.Double(0,0);
Point2D.Double lastdirection = new Point2D.Double(0,1);
Texture sprite;
List<MegamonPet> megamon_party = new ArrayList<MegamonPet>();
private List<MegamonPet> megamon_party = new ArrayList<MegamonPet>();
int trainer_id;
String name;
@ -89,4 +89,12 @@ public class Player {
public void draw(SpriteBatch batch) {
batch.draw(sprite, (int)GraphicUtils.getPlayerPixelPosition(Megamon.camera).getX(), (int)GraphicUtils.getPlayerPixelPosition(Megamon.camera).getY(), (int)GraphicUtils.getTileSize(Megamon.camera).getX(), (int)GraphicUtils.getTileSize(Megamon.camera).getY());
}
public void addMegamonToParty(MegamonPet megamon) {
megamon_party.add(megamon);
}
public List<MegamonPet> getMegamonParty() {
return megamon_party;
}
}

@ -3,18 +3,23 @@ package sig.megamon.creature;
import java.lang.reflect.Field;
public class CreatureMove {
int lvLearned=0;
String name="";
String desc="";
CreatureType type;
Category cat;
int pp;
int accuracy;
int power;
public CreatureMove(String name, String description, int levelLearned, CreatureType type, Category category) {
public CreatureMove(String name, String description, CreatureType type, Category category,
int initialPP, int power, int accuracy) {
this.name=name;
this.desc=description;
this.lvLearned=levelLearned;
this.type=type;
this.cat=category;
this.pp=initialPP;
this.power = power;
this.accuracy = accuracy;
}
public String toString() {

@ -0,0 +1,11 @@
package sig.megamon.creature;
public class CreatureMoveLinker {
CreatureMove move;
int lvLearned=0;
public CreatureMoveLinker(CreatureMove move, int lvLearnedAt) {
this.move=move;
this.lvLearned=lvLearnedAt;
}
}

@ -0,0 +1,19 @@
package sig.megamon.creature;
import sig.megamon.MegamonCreature;
public class Evolution {
MegamonCreature creature;
int level;
boolean trade;
public Evolution(MegamonCreature creatureEvolvesInto, int levelOfEvolution) {
this(creatureEvolvesInto,levelOfEvolution,false);
}
public Evolution(MegamonCreature creatureEvolvesInto, int levelOfEvolution, boolean tradeRequired) {
this.creature = creatureEvolvesInto;
this.level = levelOfEvolution;
this.trade = tradeRequired;
}
}

@ -0,0 +1,5 @@
package sig.megamon.menu;
public class MegadexMenu {
}

@ -0,0 +1,99 @@
package sig.megamon.menu;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.Align;
import sig.megamon.Megamon;
import sig.megamon.MegamonPet;
public class MegamonPartyScreen {
static Color backgroundColor = new Color(63/255f,72/255f,204/255f,1);
static Texture party_window = new Texture("interface/megamon_party.png");
static Texture party_window_selection = new Texture("interface/megamon_party_selection.png");
int selection = 0;
final static int MEGAMON_SLOT_SPACING = 140;
final static int WINDOW_MARGIN = 140;
int alpha=0;
final int ALPHA_SPD=4;
boolean alpha_dir=true;
public MegamonPartyScreen() {
}
public void run() {
alpha+=(alpha_dir)?ALPHA_SPD:-ALPHA_SPD;
if (Math.abs(alpha)>=255) {
alpha_dir=!alpha_dir;
}
if (Gdx.input.isKeyJustPressed(Megamon.MOVELEFTKEY)) {
if (selection<3) {
selection = Math.floorMod(selection-1, 3);
} else {
selection = Math.floorMod(selection-4, 3)+3;
}
}
if (Gdx.input.isKeyJustPressed(Megamon.MOVERIGHTKEY)) {
if (selection<3) {
selection = Math.floorMod(selection+1, 3);
} else {
selection = Math.floorMod(selection-2, 3)+3;
}
}
if (Gdx.input.isKeyJustPressed(Megamon.MOVEUPKEY)) {
selection = Math.floorMod(selection-3, 6);
}
if (Gdx.input.isKeyJustPressed(Megamon.MOVEDOWNKEY)) {
selection = Math.floorMod(selection+3, 6);
}
if (Gdx.input.isKeyJustPressed(Megamon.CANCELKEY) ||
Gdx.input.isKeyJustPressed(Megamon.MENUKEY)) {
Megamon.partyscreen=null;
return;
}
}
public void draw(SpriteBatch batch) {
Gdx.gl.glClearColor(backgroundColor.r,backgroundColor.g,backgroundColor.b,backgroundColor.a);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
int i=0;
batch.draw(party_window, 0, 0);
batch.setColor(new Color(1,1,1,Math.abs(alpha)/255f));
batch.draw(party_window_selection,
WINDOW_MARGIN + ((selection%3)*MEGAMON_SLOT_SPACING)-36,
(int)(Megamon.WINDOW_HEIGHT/(selection>2?1.9:1.1))-party_window_selection.getHeight()-32);
batch.setColor(new Color(1,1,1,1));
for (MegamonPet mp : Megamon.mainP.getMegamonParty()) {
batch.draw(
mp.getCreature().getSprites().getMiniIcon(),
WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING)+4,(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1)-64));
Megamon.font.draw(batch, "Lv",
WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING),(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1))-
mp.getCreature().getSprites().getMiniIcon().getHeight()*2-40);
DialogBox.messageboxfont.draw(batch, Integer.toString(mp.getLevel()),
WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING),(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1))-
mp.getCreature().getSprites().getMiniIcon().getHeight()*2-72,24,Align.center,false);
DialogBox.messageboxfont.draw(batch, mp.getHP()+"/"+mp.getMaxHP(),
WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING),(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1))-
mp.getCreature().getSprites().getMiniIcon().getHeight()*2-96,24,Align.center,false);
if ((float)mp.getHP()/mp.getMaxHP()<0.3) {
batch.setColor(Color.RED);
}
batch.draw(Megamon.healthbar,
WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING)+
mp.getCreature().getSprites().getMiniIcon().getWidth()+32,
(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1)-48-Megamon.healthbar.getHeight()),
0,0,Megamon.healthbar.getWidth(),Math.max(3,(int)(((float)mp.getHP()/mp.getMaxHP())*Megamon.healthbar.getHeight())));
batch.setColor(Color.WHITE);
Megamon.font.draw(batch, mp.getNickname(),
WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING)-24,(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1)-
mp.getCreature().getSprites().getMiniIcon().getHeight()*2-120),0,mp.getNickname().length(),100,Align.center,true,"...");
i++;
}
}
}

@ -0,0 +1,21 @@
package sig.megamon.menu;
public enum MenuItem {
MEGADEX("Megadex"),
MEGAMON("Megamon"),
BAG("Bag"),
TRAINER("<Trainer>"),
SAVE("Save"),
OPTIONS("Options"),
EXIT("Exit");
String displayName;
MenuItem(String displayName) {
this.displayName = displayName;
}
public String getDisplayText() {
return this.displayName;
}
}

@ -12,14 +12,7 @@ public class StartMenuBox {
static Texture startmenu_background_top = new Texture("startmenu_box.png");
static Texture startmenu_highlight = new Texture("startmenu_highlight.png");
int selection=0;
String[] menuitems = new String[]
{"Megadex",
"Megamon",
"Bag",
"<Trainer>",
"Save",
"Options",
"Exit"};
MenuItem[] menuitems = MenuItem.values();
int menuitem_spacing = 28;
public StartMenuBox(int cursorStartingPosition) {
@ -35,6 +28,30 @@ public class StartMenuBox {
}
if (Gdx.input.isKeyJustPressed(Megamon.MENUKEY)) {
Megamon.startmenubox=null;
return;
}
if (Gdx.input.isKeyJustPressed(Megamon.ACTIONKEY)) {
switch (menuitems[selection]) {
case MEGADEX:
break;
case MEGAMON:
Megamon.partyscreen = new MegamonPartyScreen();
break;
case BAG:
break;
case TRAINER:
break;
case OPTIONS:
break;
case SAVE:
break;
case EXIT:
Megamon.startmenubox = null;
break;
}
}
if (Gdx.input.isKeyJustPressed(Megamon.CANCELKEY)) {
Megamon.startmenubox=null;
}
}
@ -48,11 +65,11 @@ public class StartMenuBox {
spacingpixels);
batch.draw(startmenu_background_bottom, windowx,menubot-startmenu_background_bottom.getHeight());
int i=0;
for (String s : menuitems) {
for (MenuItem s : menuitems) {
if (i==selection) {
batch.draw(startmenu_highlight, windowx-4, windowy-((i+1)*menuitem_spacing)+8);
}
DialogBox.messageboxfont.draw(batch, s, windowx+28, windowy-(i++*menuitem_spacing));
DialogBox.messageboxfont.draw(batch, s.getDisplayText(), windowx+28, windowy-(i++*menuitem_spacing));
}
Megamon.font.draw(batch, ">", windowx+8, windowy-(selection*menuitem_spacing)+8);
}

Loading…
Cancel
Save