v0.9.2: artifact charging can now affect unequipped artifacts
This commit is contained in:
+3
-13
@@ -21,10 +21,8 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
@@ -45,18 +43,10 @@ public class ArtifactRecharge extends Buff {
|
|||||||
public boolean act() {
|
public boolean act() {
|
||||||
|
|
||||||
if (target instanceof Hero) {
|
if (target instanceof Hero) {
|
||||||
Belongings b = ((Hero) target).belongings;
|
|
||||||
|
|
||||||
float chargeAmount = Math.min(1, left);
|
float chargeAmount = Math.min(1, left);
|
||||||
|
for (Buff b : target.buffs()) {
|
||||||
if (b.artifact instanceof Artifact){
|
if (b instanceof Artifact.ArtifactBuff) {
|
||||||
if (!(b.artifact instanceof HornOfPlenty) || !ignoreHornOfPlenty) {
|
((Artifact.ArtifactBuff) b).charge((Hero) target, chargeAmount);
|
||||||
((Artifact) b.artifact).charge((Hero) target, chargeAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (b.misc instanceof Artifact){
|
|
||||||
if (!(b.misc instanceof HornOfPlenty) || !ignoreHornOfPlenty) {
|
|
||||||
((Artifact) b.misc).charge((Hero) target, chargeAmount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -224,6 +224,10 @@ public class Artifact extends KindofMisc {
|
|||||||
return cursed;
|
return cursed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void charge(Hero target, float amount){
|
||||||
|
Artifact.this.charge(target, amount);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String EXP = "exp";
|
private static final String EXP = "exp";
|
||||||
|
|||||||
+1
@@ -170,6 +170,7 @@ public class CloakOfShadows extends Artifact {
|
|||||||
@Override
|
@Override
|
||||||
public void charge(Hero target, float amount) {
|
public void charge(Hero target, float amount) {
|
||||||
if (charge < chargeCap) {
|
if (charge < chargeCap) {
|
||||||
|
if (!isEquipped(target)) amount *= target.pointsInTalent(Talent.LIGHT_CLOAK)/10f;
|
||||||
partialCharge += 0.25f*amount;
|
partialCharge += 0.25f*amount;
|
||||||
if (partialCharge >= 1){
|
if (partialCharge >= 1){
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
|
|||||||
+3
-2
@@ -58,8 +58,9 @@ public class WildEnergy extends TargetedSpell {
|
|||||||
ScrollOfRecharging.charge(hero);
|
ScrollOfRecharging.charge(hero);
|
||||||
|
|
||||||
hero.belongings.charge(1f);
|
hero.belongings.charge(1f);
|
||||||
if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero, 4);
|
for (Buff b : hero.buffs()){
|
||||||
if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero, 4);
|
if (b instanceof Artifact.ArtifactBuff) ((Artifact.ArtifactBuff) b).charge(hero, 4);
|
||||||
|
}
|
||||||
|
|
||||||
Buff.affect(hero, Recharging.class, 8f);
|
Buff.affect(hero, Recharging.class, 8f);
|
||||||
Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false;
|
Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false;
|
||||||
|
|||||||
+3
-2
@@ -159,8 +159,9 @@ public class MagesStaff extends MeleeWeapon {
|
|||||||
|
|
||||||
if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.MYSTICAL_CHARGE)){
|
if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.MYSTICAL_CHARGE)){
|
||||||
Hero hero = (Hero) attacker;
|
Hero hero = (Hero) attacker;
|
||||||
if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f);
|
for (Buff b : hero.buffs()){
|
||||||
if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f);
|
if (b instanceof Artifact.ArtifactBuff) ((Artifact.ArtifactBuff) b).charge(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wand != null &&
|
if (wand != null &&
|
||||||
|
|||||||
Reference in New Issue
Block a user