CS代写 package dungeonmania.entities.collectables.potions;

package dungeonmania.entities.collectables.potions;

import dungeonmania.Game;
import dungeonmania.battles.BattleStatistics;

Copyright By PowCoder代写 加微信 powcoder

import dungeonmania.entities.BattleItem;
import dungeonmania.entities.Entity;
import dungeonmania.entities.Player;
import dungeonmania.entities.inventory.InventoryItem;
import dungeonmania.map.GameMap;
import dungeonmania.util.Position;

public abstract class Potion extends Entity implements InventoryItem, BattleItem {
private int duration;

public Potion(Position position, int duration) {
super(position);
this.duration = duration;

public boolean canMoveOnto(GameMap map, Entity entity) {
return true;

public void onOverlap(GameMap map, Entity entity) {
if (entity instanceof Player) {
if (!((Player) entity).pickUp(this)) return;
map.destroyEntity(this);

public void onDestroy(GameMap gameMap) {

public void onMovedAway(GameMap map, Entity entity) {

public void use(Game game) {

public int getDuration() {
return duration;

public BattleStatistics applyBuff(BattleStatistics origin) {
return origin;

public int getDurability() {

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com