removed testing class; tweaks to items; heart piece message

v5stable
Ondřej Hruška 11 years ago
parent 88efff430b
commit abc1db104c
  1. 2
      src/mightypork/rogue/screens/game/InvSlot.java
  2. 16
      src/mightypork/rogue/t/TryItemDmg.java
  3. 18
      src/mightypork/rogue/world/World.java
  4. 4
      src/mightypork/rogue/world/item/items/ItemBaseFood.java
  5. 4
      src/mightypork/rogue/world/item/items/ItemBaseWeapon.java
  6. 2
      src/mightypork/rogue/world/item/items/active/ItemHeartPiece.java

@ -138,7 +138,7 @@ public class InvSlot extends ClickableComponent {
if (itm.getType() == ItemType.FOOD) { if (itm.getType() == ItemType.FOOD) {
rtTxP.setText(Calc.toString(itm.getFoodPoints() / 2D)); rtTxP.setText(Calc.toString(itm.getFoodPoints() / 2D));
rbTxP.setColor(RGB.GREEN); rtTxP.setColor(RGB.GREEN);
rtTxP.render(); rtTxP.render();
} else if (itm.getType() == ItemType.WEAPON) { } else if (itm.getType() == ItemType.WEAPON) {

@ -1,16 +0,0 @@
package mightypork.rogue.t;
import mightypork.rogue.world.item.Item;
import mightypork.rogue.world.item.Items;
public class TryItemDmg {
public static void main(String[] args)
{
final Item itm = Items.CLUB.createItemDamaged(80);
System.out.println(itm.getMaxUses() + " - remaining: " + itm.getRemainingUses());
}
}

@ -360,6 +360,12 @@ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pausea
{ {
playerEntity.health.setHealthMax(health); playerEntity.health.setHealthMax(health);
} }
public World getWorld()
{
return World.this;
}
} }
// not saved stuffs // not saved stuffs
@ -550,7 +556,7 @@ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pausea
public void msgPick(Item item) public void msgPick(Item item)
{ {
console.addMessage("You've picked a " + item.getVisualName() + "."); console.addMessage("You've picked up a " + item.getVisualName() + ".");
console.lastPickupItem = item; console.lastPickupItem = item;
console.timeSinceLastPickup = 0; console.timeSinceLastPickup = 0;
} }
@ -606,12 +612,18 @@ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pausea
public void msgCannotPick() public void msgCannotPick()
{ {
console.addMessage("Can't pick items, inventory is full."); console.addMessage("Can't collect items, inventory is full.");
} }
public void msgEnterFloor(int floor) public void msgEnterFloor(int floor)
{ {
console.addMessage("~ Floor " + floor + " ~"); console.addMessage("~ Welcome to floor " + (1+floor) + "! ~");
}
public void msgHeartPiece()
{
console.addMessage("Your health capacity has been increased.");
} }
} }

@ -22,14 +22,14 @@ public abstract class ItemBaseFood extends Item {
@Override @Override
public int getAttackPoints() public final int getAttackPoints()
{ {
return 0; return 0;
} }
@Override @Override
public ItemType getType() public final ItemType getType()
{ {
return ItemType.FOOD; return ItemType.FOOD;
} }

@ -22,14 +22,14 @@ public abstract class ItemBaseWeapon extends Item {
@Override @Override
public int getFoodPoints() public final int getFoodPoints()
{ {
return 0; return 0;
} }
@Override @Override
public ItemType getType() public final ItemType getType()
{ {
return ItemType.WEAPON; return ItemType.WEAPON;
} }

@ -80,6 +80,8 @@ public class ItemHeartPiece extends Item {
pl.setHealthMax(pl.getHealthMax() + 2); // two points / heart pl.setHealthMax(pl.getHealthMax() + 2); // two points / heart
pl.setHealth(pl.getHealthMax()); pl.setHealth(pl.getHealthMax());
pl.getWorld().msgHeartPiece();
return true; return true;
} }

Loading…
Cancel
Save