add abilities
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package org.project.abilities;
|
||||
|
||||
import org.project.entity.Entity;
|
||||
import org.project.item.weapons.Dagger;
|
||||
import org.project.weaponEffects.PoisonEffect;
|
||||
import org.w3c.dom.ls.LSOutput;
|
||||
|
||||
public class PoisonDagger extends SpecialAbility{
|
||||
|
||||
/*
|
||||
|
||||
Goblin use this special ability
|
||||
applies poison effect on goblin's weapon
|
||||
|
||||
*/
|
||||
|
||||
private final int poisonDamage = 5;
|
||||
|
||||
public PoisonDagger() {
|
||||
|
||||
super("poisonDagger",15,3,AbilityTarget.SELF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApply(Entity target) {
|
||||
super.onApply(target);
|
||||
target.setWeapon(new Dagger(new PoisonEffect()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick(Entity self) {
|
||||
|
||||
System.out.println(self.getName() + " used Poisonous Dagger ");
|
||||
reduceDuration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExpire(Entity target) {
|
||||
target.setWeapon(new Dagger());
|
||||
System.out.println(target.getName() + " no longer has poisonous Dagger");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user