Skip to content

Commit

Permalink
fixed with real pokemon
Browse files Browse the repository at this point in the history
  • Loading branch information
maloney626 committed Apr 4, 2013
1 parent 0be1cbc commit 14c0ea2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 45 deletions.
Expand Up @@ -40,20 +40,20 @@ protected void setUp() throws Exception {
loc=new Location(0, 0, 0);
AttackerMove=MoveDataBase.generateMove(MoveName.Tackle);
DefenderMove=MoveDataBase.generateMove(MoveName.Bite);
Attacker=new Pokemon(PokeID.Charizard, 40);
Defender=new Pokemon(PokeID.Pikachu, 35);
Attacker=Pokemon.GeneratePokemon(PokeID.Charizard, 40);
Defender=Pokemon.GeneratePokemon(PokeID.Pikachu, 35);
Attacker.getMoves().add(AttackerMove);
Attacker.getMoves().add(DefenderMove);
Defender.getMoves().add(DefenderMove);

Pokemon Attacker2=new Pokemon(PokeID.Charizard, 40);
Pokemon Attacker2=Pokemon.GeneratePokemon(PokeID.Charizard, 40);
Attacker2=Attacker;
Pokemon Attacker3=new Pokemon(PokeID.Charizard, 40);
Pokemon Attacker3=Pokemon.GeneratePokemon(PokeID.Charizard, 40);
Attacker3=Attacker;

Pokemon Defender2=new Pokemon(PokeID.Pikachu, 35);
Pokemon Defender2=Pokemon.GeneratePokemon(PokeID.Pikachu, 35);
Defender2=Defender;
Pokemon Defender3=new Pokemon(PokeID.Pikachu, 35);
Pokemon Defender3=Pokemon.GeneratePokemon(PokeID.Pikachu, 35);
Defender3=Defender;
user=new Player(200, "joey", false, loc);
user.getTeam().add(Attacker);
Expand Down
Expand Up @@ -46,12 +46,12 @@ public class FokemonUI implements EntryPoint {
static final int refreshRate = 25;

public void onModuleLoad() {

createPokedexReader();
panel = new AbsolutePanel();
map = new MapView();
tempView = new CirculatingImagesView();
battle = new BattleView();
createPokedexReader();


panel.getElement().getStyle().setPosition(Position.RELATIVE);
//System.out.println(pokedex.getPokeMap().firstKey().toString());

Expand Down Expand Up @@ -88,6 +88,8 @@ public void onFailure(Throwable caught) {
public void onSuccess(PokedexReader result) {
//updateTable(result);
setPokedex(result);
battle = new BattleView();
System.out.println("battle is made");
}
};

Expand All @@ -96,25 +98,8 @@ public void onSuccess(PokedexReader result) {
//pokedexReaderSvc.readCSV(callback).getPrices(stocks.toArray(new String[0]), callback);
}

protected void CreatePokedexReader() {
RPC.pokedexReader.readCSV(new AsyncCallback<PokedexReader>() {
@Override
public void onSuccess(PokedexReader result) {
GWT.log("Order succeeded!");
setPokedex(result);

// FIXME: should update the UI to inform the user of the completion of the order
}

@Override
public void onFailure(Throwable caught) {
GWT.log("Order failure", caught);

// FIXME: should update the UI to inform the user of the error
}
});

}


public static PokedexReader getPokedex() {
return pokedex;
}
Expand Down
Expand Up @@ -36,11 +36,13 @@ public class TempBattle {

public TempBattle() {
loc=new Location(0, 0, 0);
user=new Player(200, "Cody F.", true, loc);
opp=new Player(100,"Roberto", true, loc);
AttackerMove=MoveDataBase.generateMove(MoveName.Tackle);
DefenderMove=MoveDataBase.generateMove(MoveName.Bite);
Attacker=new Pokemon(PokeID.Charizard, 50);
Attacker=Pokemon.GeneratePokemon(PokeID.Charizard, 50);
Attacker.getInfo().setNickname("Charizizzle");
Defender=new Pokemon(PokeID.Pikachu, 35);
Defender=Pokemon.GeneratePokemon(PokeID.Pikachu, 35);
Defender.getInfo().setNickname("Pikajew");
Attacker.getMoves().add(AttackerMove);
Attacker.getMoves().add(DefenderMove);
Expand All @@ -49,18 +51,18 @@ public TempBattle() {
Defender.getMoves().add(DefenderMove);
Pokemon Attacker2=Pokemon.GeneratePokemon(PokeID.Charizard, 10);

Pokemon Attacker3=new Pokemon(PokeID.Blastoise,30);
Pokemon Attacker3=Pokemon.GeneratePokemon(PokeID.Blastoise,30);


Pokemon Defender2=Pokemon.GeneratePokemon(PokeID.Abra,10);

Pokemon Defender3=new Pokemon(PokeID.Gastly,35);
Pokemon Defender3=Pokemon.GeneratePokemon(PokeID.Gastly,35);


user=new Player(200, "Cody F.", true, loc);
user.getTeam().add(Attacker);
user.getTeam().add(Attacker2);
user.getTeam().add(Attacker3);
opp=new Player(100,"Roberto", true, loc);

opp.getTeam().add(Defender);
opp.getTeam().add(Defender2);
opp.getTeam().add(Defender3);
Expand Down
Expand Up @@ -22,16 +22,7 @@ public Pokemon(PokeInfo info, BattleStats stats, ArrayList <Move> moves){
this.stats=stats;
this.moves=moves;
}
public Pokemon(PokeID nPokeNum, int lvl) {
/*ArrayList <PokeType> type= new ArrayList<PokeType>();
type.add(PokeType.NORMAL);
stats=new BattleStats(lvl, lvl, lvl, lvl, lvl, lvl, lvl, Status.NRM, lvl, null, null);
info=new PokeInfo(nPokeNum, 100, "<<Name>>", "<<Nickname>>", true, type, lvl, lvl);
tempBattleStats= new TempBattleStats();
moves= new ArrayList<Move>();*/
GeneratePokemon(nPokeNum, lvl);

}

public static Pokemon GeneratePokemon(PokeID ID, int lvl){
Random rand=new Random();
Expand All @@ -43,16 +34,22 @@ public static Pokemon GeneratePokemon(PokeID ID, int lvl){
boolean gender;
if(rand.nextInt()%2==0)gender=false;
else gender=true;
PokeInfo info=new PokeInfo(entry.getPokeID(),TempBattle.getUser().getPlayerID(),entry.getPokeName(),entry.getPokeName(),gender,entry.getType(),lvl,0);
entry.getPokeID();
TempBattle.getUser().getPlayerID();
entry.getPokeName();
entry.getPokeName();
entry.getType();
PokeInfo information=new PokeInfo(entry.getPokeID(),TempBattle.getUser().getPlayerID(),entry.getPokeName(),entry.getPokeName(),gender,entry.getType(),lvl,0);

Move move1=MoveDataBase.generateMove(MoveName.Tackle);
ArrayList<Move>moves=new ArrayList<Move>();

moves.add(move1);
BattleStats battleStats=new BattleStats(0,0,0,0,0,0, 0, Status.NRM,entry.getBaseXP(),entry.getBaseStats(),entry.getEVyield());
Pokemon pokemon=new Pokemon(info, battleStats, moves);
Pokemon pokemon=new Pokemon(information, battleStats, moves);

pokemon.UpdateStats();
pokemon.getStats().setCurHp(pokemon.getStats().getMaxHp());


return pokemon;
Expand Down

0 comments on commit 14c0ea2

Please sign in to comment.