v0.7.0: implemented scroll of mystical energy

This commit is contained in:
Evan Debenham 2018-07-25 02:15:47 -04:00
parent 56d7858e54
commit c41417951f
18 changed files with 181 additions and 13 deletions

View File

@ -21,5 +21,78 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
import com.watabou.utils.Bundle;
//TODO this may be very powerful, consider balancing
public class ArtifactRecharge extends Buff {
{
type = buffType.POSITIVE;
}
private int left = 30;
@Override
public boolean act() {
if (target instanceof Hero){
Belongings b = ((Hero) target).belongings;
if (b.misc1 instanceof Artifact){
((Artifact)b.misc1).charge((Hero)target);
}
if (b.misc2 instanceof Artifact){
((Artifact)b.misc2).charge((Hero)target);
}
}
left--;
if (left <= 0){
detach();
} else {
spend(TICK);
}
return true;
}
@Override
public int icon() {
return BuffIndicator.RECHARGING;
}
@Override
public void tintIcon(Image icon) {
icon.hardlight(0, 1f, 0);
}
@Override
public String toString() {
return Messages.get(this, "name");
}
@Override
public String desc() {
return Messages.get(this, "desc", dispTurns(left+1));
}
private static final String LEFT = "left";
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put( LEFT, left );
}
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
left = bundle.getInt(LEFT);
}
}

View File

@ -207,6 +207,10 @@ public class Artifact extends KindofMisc {
}
protected ArtifactBuff activeBuff() {return null; }
public void charge(Hero target){
//do nothing by default;
}
public class ArtifactBuff extends Buff {

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
@ -47,7 +48,17 @@ public class CapeOfThorns extends Artifact {
protected ArtifactBuff passiveBuff() {
return new Thorns();
}
@Override
public void charge(Hero target) {
if (cooldown == 0) {
charge += 4;
}
if (charge >= chargeCap){
target.buff(Thorns.class).proc(0, null, null);
}
}
@Override
public String desc() {
String desc = Messages.get(this, "desc");

View File

@ -135,7 +135,12 @@ public class ChaliceOfBlood extends Artifact {
protected ArtifactBuff passiveBuff() {
return new chaliceRegen();
}
@Override
public void charge(Hero target) {
target.HP = Math.min( target.HT, target.HP + 1 + Dungeon.depth/5);
}
@Override
public String desc() {
String desc = super.desc();

View File

@ -133,7 +133,14 @@ public class CloakOfShadows extends Artifact {
protected ArtifactBuff activeBuff( ) {
return new cloakStealth();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap) {
partialCharge += 0.25f;
}
}
@Override
public Item upgrade() {
chargeCap = Math.min(chargeCap + 1, 10);

View File

@ -193,7 +193,14 @@ public class DriedRose extends Artifact {
protected ArtifactBuff passiveBuff() {
return new roseRecharge();
}
@Override
public void charge(Hero target) {
if (ghost == null && charge < chargeCap){
partialCharge += 0.25f;
}
}
@Override
public Item upgrade() {
if (level() >= 9)

View File

@ -230,7 +230,15 @@ public class EtherealChains extends Artifact {
protected ArtifactBuff passiveBuff() {
return new chainsRecharge();
}
@Override
public void charge(Hero target) {
int chargeTarget = 5+(level()*2);
if (charge < chargeTarget*2){
partialCharge += 0.5f;
}
}
@Override
public String desc() {
String desc = super.desc();

View File

@ -143,7 +143,14 @@ public class HornOfPlenty extends Artifact {
protected ArtifactBuff passiveBuff() {
return new hornRecharge();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap){
partialCharge += 0.25f;
}
}
@Override
public String desc() {
String desc = super.desc();

View File

@ -261,6 +261,13 @@ public class LloydsBeacon extends Artifact {
protected ArtifactBuff passiveBuff() {
return new beaconRecharge();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap){
partialCharge += 0.25f;
}
}
@Override
public Item upgrade() {

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
@ -42,6 +43,13 @@ public class MasterThievesArmband extends Artifact {
protected ArtifactBuff passiveBuff() {
return new Thievery();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap){
charge += 10;
}
}
@Override
public String desc() {

View File

@ -99,6 +99,11 @@ public class SandalsOfNature extends Artifact {
protected ArtifactBuff passiveBuff() {
return new Naturalism();
}
@Override
public void charge(Hero target) {
target.buff(Naturalism.class).charge();
}
@Override
public String desc() {

View File

@ -102,6 +102,13 @@ public class TalismanOfForesight extends Artifact {
protected ArtifactBuff passiveBuff() {
return new Foresight();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap){
partialCharge += 4f;
}
}
@Override
public String desc() {

View File

@ -136,6 +136,13 @@ public class TimekeepersHourglass extends Artifact {
protected ArtifactBuff passiveBuff() {
return new hourglassRecharge();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap){
partialCharge += 0.25f;
}
}
@Override
public Item upgrade() {

View File

@ -170,6 +170,13 @@ public class UnstableSpellbook extends Artifact {
protected ArtifactBuff passiveBuff() {
return new bookRecharge();
}
@Override
public void charge(Hero target) {
if (charge < chargeCap){
partialCharge += 0.1f;
}
}
@Override
public Item upgrade() {

View File

@ -69,9 +69,6 @@ public abstract class ExoticScroll extends Scroll {
regToExo.put(ScrollOfTerror.class, ScrollOfPetrification.class);
exoToReg.put(ScrollOfPetrification.class, ScrollOfTerror.class);
regToExo.put(ScrollOfTransmutation.class, ScrollOfDistortion.class);
exoToReg.put(ScrollOfDistortion.class, ScrollOfTransmutation.class);
regToExo.put(ScrollOfRecharging.class, ScrollOfMysticalEnergy.class);
exoToReg.put(ScrollOfMysticalEnergy.class, ScrollOfRecharging.class);
@ -86,8 +83,11 @@ public abstract class ExoticScroll extends Scroll {
//TODO
regToExo.put(ScrollOfMirrorImage.class, ScrollOfPetrification.class);
exoToReg.put(ScrollOfPetrification.class, ScrollOfMirrorImage.class);
regToExo.put(ScrollOfMirrorImage.class, ScrollOfDivination.class);
exoToReg.put(ScrollOfDivination.class, ScrollOfMirrorImage.class);
regToExo.put(ScrollOfTransmutation.class, ScrollOfDivination.class);
exoToReg.put(ScrollOfDivination.class, ScrollOfTransmutation.class);
}
@Override

View File

@ -22,6 +22,8 @@
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
@ -37,7 +39,7 @@ public class ScrollOfMysticalEnergy extends ExoticScroll {
public void doRead() {
//append buff
ScrollOfRecharging.charge(curUser);
Buff.affect(curUser, ArtifactRecharge.class);
Sample.INSTANCE.play( Assets.SND_READ );
Invisibility.dispel();

View File

@ -48,6 +48,9 @@ actors.buffs.adrenalinesurge.desc=A surge of great might, but sadly not permanen
actors.buffs.amok.name=Amok
actors.buffs.amok.desc=Amok causes a state of great rage and confusion in its target.\n\nWhen a creature is amoked, they will attack whatever is near them, whether they be friend or foe.\n\nTurns of amok remaining: %s.
actors.buffs.artifactrecharge.name=Artifact Recharging
actors.buffs.artifactrecharge.desc=Energy is coursing through you, increasing the rate your equipped artiacts charge.\n\nEach artifact is affected a little differently, but they will all be less limited by their charge meter.\n\nTurns remaining: %s.
actors.buffs.barkskin.name=Barkskin
actors.buffs.barkskin.desc=Your skin is hardened, it feels rough and solid like bark.\n\nThe hardened skin increases your effective armor, allowing you to better defend against physical attack.\n\nYour armor is currently increased by: %d.\nTurns until barkskin weakens: %s.

View File

@ -812,7 +812,7 @@ items.scrolls.exotic.scrollofforesight.name=scroll of foresight
items.scrolls.exotic.scrollofforesight.desc=When this scroll is read, detail of nearby terrain will be constantly fed to the reader's mind in crystal clarity. For the duration of this effect, searching will not be necessary, as the reader will automatically detect everything within their search radius.
items.scrolls.exotic.scrollofmysticalenergy.name=scroll of mystical energy
items.scrolls.exotic.scrollofmysticalenergy.desc=
items.scrolls.exotic.scrollofmysticalenergy.desc=The raw magical power bound up in this parchment will, when released, charge a user's equipped artifacts over time.
items.scrolls.exotic.scrollofpassage.name=scroll of passage
items.scrolls.exotic.scrollofpassage.desc=The spell on this parchment instantly transports the reader to the nearest region entrance above them. Very handy for quickly getting to a shop.