v2.0.0: switched duelist's ability to use a charge system like wands
This commit is contained in:
@@ -1566,7 +1566,6 @@ items.weapon.melee.meleeweapon.stats_known=This _tier-%1$d_ melee weapon deals _
|
|||||||
items.weapon.melee.meleeweapon.stats_unknown=Typically this _tier-%1$d_ melee weapon deals _%2$d-%3$d damage_ and requires _%4$d strength_ to use properly.
|
items.weapon.melee.meleeweapon.stats_unknown=Typically this _tier-%1$d_ melee weapon deals _%2$d-%3$d damage_ and requires _%4$d strength_ to use properly.
|
||||||
items.weapon.melee.meleeweapon.probably_too_heavy=Probably this weapon is too heavy for you.
|
items.weapon.melee.meleeweapon.probably_too_heavy=Probably this weapon is too heavy for you.
|
||||||
items.weapon.melee.meleeweapon.stats_desc=
|
items.weapon.melee.meleeweapon.stats_desc=
|
||||||
items.weapon.melee.meleeweapon.charge_use=This will consume _%s_ charge.
|
|
||||||
items.weapon.melee.meleeweapon.ability_equip=You must equip that weapon to use its ability.
|
items.weapon.melee.meleeweapon.ability_equip=You must equip that weapon to use its ability.
|
||||||
items.weapon.melee.meleeweapon.ability_charge=You don't have enough energy to use that ability.
|
items.weapon.melee.meleeweapon.ability_charge=You don't have enough energy to use that ability.
|
||||||
items.weapon.melee.meleeweapon.prompt=Select a Target
|
items.weapon.melee.meleeweapon.prompt=Select a Target
|
||||||
|
|||||||
@@ -216,8 +216,6 @@ public enum HeroClass {
|
|||||||
(hero.belongings.weapon = new Rapier()).identify();
|
(hero.belongings.weapon = new Rapier()).identify();
|
||||||
hero.belongings.weapon.activate(hero);
|
hero.belongings.weapon.activate(hero);
|
||||||
|
|
||||||
Buff.affect(hero, MeleeWeapon.Charger.class).charge = 100f;
|
|
||||||
|
|
||||||
ThrowingKnife knives = new ThrowingKnife();
|
ThrowingKnife knives = new ThrowingKnife();
|
||||||
knives.quantity(3).collect();
|
knives.quantity(3).collect();
|
||||||
|
|
||||||
|
|||||||
+28
-17
@@ -84,12 +84,12 @@ public class MeleeWeapon extends Weapon {
|
|||||||
if (action.equals(AC_ABILITY)){
|
if (action.equals(AC_ABILITY)){
|
||||||
if (!isEquipped(hero)) {
|
if (!isEquipped(hero)) {
|
||||||
GLog.w(Messages.get(this, "ability_equip"));
|
GLog.w(Messages.get(this, "ability_equip"));
|
||||||
} else if (Buff.affect(hero, Charger.class).charge < abilityChargeUse()) {
|
} else if (Buff.affect(hero, Charger.class).charges < abilityChargeUse()) {
|
||||||
GLog.w(Messages.get(this, "ability_charge"));
|
GLog.w(Messages.get(this, "ability_charge"));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (targetingPrompt() == null){
|
if (targetingPrompt() == null){
|
||||||
Buff.affect(hero, Charger.class).charge -= abilityChargeUse();
|
Buff.affect(hero, Charger.class).charges -= abilityChargeUse();
|
||||||
duelistAbility(hero, hero.pos);
|
duelistAbility(hero, hero.pos);
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
} else {
|
} else {
|
||||||
@@ -98,7 +98,7 @@ public class MeleeWeapon extends Weapon {
|
|||||||
@Override
|
@Override
|
||||||
public void onSelect(Integer cell) {
|
public void onSelect(Integer cell) {
|
||||||
if (cell != null) {
|
if (cell != null) {
|
||||||
Buff.affect(hero, Charger.class).charge -= abilityChargeUse();
|
Buff.affect(hero, Charger.class).charges -= abilityChargeUse();
|
||||||
duelistAbility(hero, cell);
|
duelistAbility(hero, cell);
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
}
|
}
|
||||||
@@ -126,8 +126,8 @@ public class MeleeWeapon extends Weapon {
|
|||||||
//TODO make abstract
|
//TODO make abstract
|
||||||
protected void duelistAbility( Hero hero, Integer target ){}
|
protected void duelistAbility( Hero hero, Integer target ){}
|
||||||
|
|
||||||
public float abilityChargeUse(){
|
public int abilityChargeUse(){
|
||||||
return 33f; //TODO
|
return 1; //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
public int tier;
|
public int tier;
|
||||||
@@ -213,7 +213,6 @@ public class MeleeWeapon extends Weapon {
|
|||||||
|
|
||||||
if (Dungeon.hero.heroClass == HeroClass.DUELIST){
|
if (Dungeon.hero.heroClass == HeroClass.DUELIST){
|
||||||
info += "\n\n" + Messages.get(this, "ability_desc");
|
info += "\n\n" + Messages.get(this, "ability_desc");
|
||||||
info += " " + Messages.get(MeleeWeapon.class, "charge_use", new DecimalFormat("#.##").format(abilityChargeUse()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
@@ -227,7 +226,8 @@ public class MeleeWeapon extends Weapon {
|
|||||||
public String status() {
|
public String status() {
|
||||||
if (isEquipped(Dungeon.hero)
|
if (isEquipped(Dungeon.hero)
|
||||||
&& Dungeon.hero.buff(Charger.class) != null) {
|
&& Dungeon.hero.buff(Charger.class) != null) {
|
||||||
return Messages.format( "%.0f%%", Math.floor(Dungeon.hero.buff(Charger.class).charge) );
|
Charger buff = Dungeon.hero.buff(Charger.class);
|
||||||
|
return buff.charges + "/" + buff.chargeCap();
|
||||||
} else {
|
} else {
|
||||||
return super.status();
|
return super.status();
|
||||||
}
|
}
|
||||||
@@ -253,37 +253,48 @@ public class MeleeWeapon extends Weapon {
|
|||||||
|
|
||||||
public static class Charger extends Buff {
|
public static class Charger extends Buff {
|
||||||
|
|
||||||
public float charge;
|
private int charges = 3;
|
||||||
|
private float partialCharge;
|
||||||
//offhand charge as well?
|
//offhand charge as well?
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
LockedFloor lock = target.buff(LockedFloor.class);
|
||||||
if (lock == null || lock.regenOn()) {
|
if (charges < chargeCap()){
|
||||||
charge += 100 / 300f; //300 turns to full charge
|
if (lock == null || lock.regenOn()){
|
||||||
updateQuickslot();
|
partialCharge += 1/(45f-(chargeCap()-charges)); // 45 to 35 turns per charge
|
||||||
if (charge > 100) {
|
if (partialCharge >= 1){
|
||||||
charge = 100;
|
charges++;
|
||||||
|
partialCharge--;
|
||||||
|
updateQuickslot();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
partialCharge = 0;
|
||||||
}
|
}
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int chargeCap(){
|
||||||
|
return Math.min(10, 3 + (Dungeon.hero.lvl-1)/3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String CHARGES = "charges";
|
||||||
public static final String CHARGE = "charge";
|
private static final String PARTIALCHARGE = "partialCharge";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeInBundle(Bundle bundle) {
|
public void storeInBundle(Bundle bundle) {
|
||||||
super.storeInBundle(bundle);
|
super.storeInBundle(bundle);
|
||||||
bundle.put(CHARGE, charge);
|
bundle.put(CHARGES, charges);
|
||||||
|
bundle.put(PARTIALCHARGE, partialCharge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle(Bundle bundle) {
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
charge = bundle.getFloat(CHARGE);
|
charges = bundle.getInt(CHARGES);
|
||||||
|
partialCharge = bundle.getFloat(PARTIALCHARGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user