Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for Issue47 #53

Merged
merged 3 commits into from
Dec 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Score.txt
build/
*~
*#*

# Package Files #
*.jar
Expand Down
2 changes: 1 addition & 1 deletion Score.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
785
580
580
315
350
72 changes: 0 additions & 72 deletions src/edu/ucsb/cs56/projects/games/roguelike/Bat.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/edu/ucsb/cs56/projects/games/roguelike/Beef.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,6 @@ public Beef(boolean use){
this.setIcon('+');
}

/**
*This is the getter to figure out what piece icon it is.
*/
@Override public char getIcon(){
return this.icon;
}
/**
*This is the setter for the Icon it will be
*@param NewIcon is the icon of piece that will be in the game
*/
@Override public void setIcon(char NewIcon){
this.icon=NewIcon;
}
/**
this method uses the effect value in someway.
in this method it just adds attack points to the player
Expand Down
16 changes: 0 additions & 16 deletions src/edu/ucsb/cs56/projects/games/roguelike/Elixir.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ public Elixir(boolean use){
this.setIcon('S');
}

/**
This is the getter to figure out what piece icon it is.
*/
@Override
public char getIcon(){
return this.icon;
}

/**
*This is the setter for the Icon it will be
*@param NewIcon is the icon of piece that will be in the game
*/
@Override public void setIcon(char NewIcon){
this.icon=NewIcon;
}

/**
this method uses the effect value in someway.
in this method it adds the speed value to the player.
Expand Down
14 changes: 1 addition & 13 deletions src/edu/ucsb/cs56/projects/games/roguelike/GamePiece.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@
*@version cs56 s13
*/

public interface GamePiece {

/**
*This is the getter to figure out what piece it is.
*/
public String getTypeOfPiece();

/**
*This is the setter for the TypeOfPiece it will be
*@param newTypeOfPiece is the type of piece that will be in the game
*/
public void setTypeOfPiece(String newTypeOfPiece);

public interface GamePiece {

/**
*This is the getter to figure out what piece icon it is.
Expand Down
72 changes: 0 additions & 72 deletions src/edu/ucsb/cs56/projects/games/roguelike/Golem.java

This file was deleted.

18 changes: 1 addition & 17 deletions src/edu/ucsb/cs56/projects/games/roguelike/HealthPotion.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,7 @@ public HealthPotion(boolean use){
this.setIcon('H');
}

/**
*This is the getter to figure out what piece icon it is.
*/
@Override public char getIcon(){
return this.icon;
}
/**
*This is the setter for the Icon it will be
*@param NewIcon is the icon of piece that will be in the game
*/
@Override public void setIcon(char NewIcon){
this.icon=NewIcon;
}
/**
this method uses the effect value in someway.
in this method it just adds health to the player.
*/

@Override public void UseEffect(Player p){
p.setHitPoints(this.getEffect()+p.getHitPoints());
}
Expand Down
43 changes: 23 additions & 20 deletions src/edu/ucsb/cs56/projects/games/roguelike/LogicEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ public void move(int x,int y,int xOrig,int yOrig){
consumeItem(x,y);
}

floor[x][y] = floor[xOrig][yOrig];
floor[xOrig][yOrig] = null;
if (x != xOrig || y != yOrig) {
floor[x][y] = floor[xOrig][yOrig];
floor[xOrig][yOrig] = null;
}

int[] position = {x,y};
if(floor[x][y] instanceof Player) {
Expand Down Expand Up @@ -237,10 +239,11 @@ public boolean movable(int x,int y,int xOrig, int yOrig){
}

public boolean inBounds(int x, int y) {
if ((x < 1 || x >= floorWidth - 1) || (y < 1 || y >= floorHeight - 1))
return false;
else
return true;
return !((x < 1 || x >= floorWidth - 1) || (y < 1 || y >= floorHeight - 1));
}

public boolean isGround(int x, int y) {
return (inBounds(x,y));
}

/**
Expand Down Expand Up @@ -371,43 +374,43 @@ public void createMonster(){
if(floor[xPos][yPos]==null){

switch(n){
case 0 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1);
case 0 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.MONSTER);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;
case 1 : floor[xPos][yPos] = new Troll(numGenerator.nextInt(2)+1);
listOfMonsters[xPos][yPos] = (Troll) floor[xPos][yPos];
case 1 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.TROLL);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;
case 2 : floor[xPos][yPos] = new Golem(numGenerator.nextInt(2)+1);
listOfMonsters[xPos][yPos] = (Golem) floor[xPos][yPos];
case 2 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.GOLEM);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;
case 3 : floor[xPos][yPos] = new Bat(numGenerator.nextInt(2)+1);
listOfMonsters[xPos][yPos] = (Bat) floor[xPos][yPos];
case 3 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.BAT);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;
case 4 : floor[xPos][yPos] = new Snake(numGenerator.nextInt(2)+1);
listOfMonsters[xPos][yPos] = (Snake) floor[xPos][yPos];
case 4 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.SNAKE);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;
case 5 : floor[xPos][yPos] = new Zombie(numGenerator.nextInt(2)+1);
listOfMonsters[xPos][yPos] = (Zombie) floor[xPos][yPos];
case 5 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.ZOMBIE);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;
case 6 : floor[xPos][yPos] = new Pirate(numGenerator.nextInt(2)+1);
listOfMonsters[xPos][yPos] = (Pirate) floor[xPos][yPos];
case 6 : floor[xPos][yPos] = new Monster(numGenerator.nextInt(2)+1, Monster.PIRATE);
listOfMonsters[xPos][yPos] = (Monster) floor[xPos][yPos];
listOfMonsters[xPos][yPos].setLevelBonus(level);
listOfMonsters[xPos][yPos].setMonsterPosition(xPos,yPos);
break;

//Add new monsters here. Copy the case and change just the class names
//Add new monsters here. Copy the case and change the parameter passed in



Expand Down
Loading