v0.3.0: Added ability for wands to use multiple charges
This commit is contained in:
parent
444fbaf484
commit
155b275cf8
|
@ -54,10 +54,10 @@ public abstract class Wand extends KindOfWeapon {
|
||||||
private static final String TXT_DAMAGE = "When this wand is used as a melee weapon, its average damage is %d points per hit.";
|
private static final String TXT_DAMAGE = "When this wand is used as a melee weapon, its average damage is %d points per hit.";
|
||||||
private static final String TXT_WEAPON = "You can use this wand as a melee weapon.";
|
private static final String TXT_WEAPON = "You can use this wand as a melee weapon.";
|
||||||
|
|
||||||
private static final String TXT_FIZZLES = "your wand fizzles; it must be out of charges for now";
|
private static final String TXT_FIZZLES = "your wand fizzles; it must not have enough charge.";
|
||||||
private static final String TXT_SELF_TARGET = "You can't target yourself";
|
private static final String TXT_SELF_TARGET = "You can't target yourself";
|
||||||
|
|
||||||
private static final String TXT_IDENTIFY = "You are now familiar enough with your %s.";
|
private static final String TXT_IDENTIFY = "You are now familiar with your %s.";
|
||||||
|
|
||||||
private static final float TIME_TO_ZAP = 1f;
|
private static final float TIME_TO_ZAP = 1f;
|
||||||
|
|
||||||
|
@ -255,6 +255,10 @@ public abstract class Wand extends KindOfWeapon {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int chargesPerCast() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
private void calculateDamage() {
|
private void calculateDamage() {
|
||||||
int tier = 1 + level / 3;
|
int tier = 1 + level / 3;
|
||||||
MIN = tier;
|
MIN = tier;
|
||||||
|
@ -267,8 +271,9 @@ public abstract class Wand extends KindOfWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void wandUsed() {
|
protected void wandUsed() {
|
||||||
curCharges--;
|
usagesToKnow -= chargesPerCast();
|
||||||
if (!isIdentified() && --usagesToKnow <= 0) {
|
curCharges -= chargesPerCast();
|
||||||
|
if (!isIdentified() && usagesToKnow <= 0) {
|
||||||
identify();
|
identify();
|
||||||
GLog.w( TXT_IDENTIFY, name() );
|
GLog.w( TXT_IDENTIFY, name() );
|
||||||
} else {
|
} else {
|
||||||
|
@ -362,7 +367,7 @@ public abstract class Wand extends KindOfWeapon {
|
||||||
else
|
else
|
||||||
QuickSlotButton.target(Actor.findChar(cell));
|
QuickSlotButton.target(Actor.findChar(cell));
|
||||||
|
|
||||||
if (curWand.curCharges > 0) {
|
if (curWand.curCharges >= curWand.chargesPerCast()) {
|
||||||
|
|
||||||
curUser.busy();
|
curUser.busy();
|
||||||
|
|
||||||
|
@ -379,9 +384,7 @@ public abstract class Wand extends KindOfWeapon {
|
||||||
|
|
||||||
curUser.spendAndNext( TIME_TO_ZAP );
|
curUser.spendAndNext( TIME_TO_ZAP );
|
||||||
GLog.w( TXT_FIZZLES );
|
GLog.w( TXT_FIZZLES );
|
||||||
curWand.levelKnown = true;
|
|
||||||
|
|
||||||
curWand.updateQuickslot();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user