Death.java 761 B

123456789101112131415161718192021222324252627282930
  1. package me.hammerle.supersnuvi.entity.components;
  2. import me.hammerle.supersnuvi.entity.Entity;
  3. import me.hammerle.supersnuvi.gamelogic.Level;
  4. import me.hammerle.supersnuvi.util.SoundUtils;
  5. public abstract class Death
  6. {
  7. public static final Death NULL = new Death()
  8. {
  9. @Override
  10. public void onDeath(Entity ent)
  11. {
  12. }
  13. };
  14. public static final Death DROP_BOTTLE = new Death()
  15. {
  16. @Override
  17. public void onDeath(Entity ent)
  18. {
  19. Level l = ent.getLevel();
  20. SoundUtils.playSound(SoundUtils.Sound.COLLECT);
  21. l.increaseSouls(1);
  22. l.getHero().getHealth().addHealthPercent(0.143);
  23. }
  24. };
  25. public abstract void onDeath(Entity ent);
  26. }