v0.7.4: rebalancing to wand of warding

This commit is contained in:
Evan Debenham 2019-07-12 02:07:02 -04:00
parent c987555271
commit e58c9c1c38
3 changed files with 43 additions and 45 deletions

View File

@ -533,6 +533,10 @@ public abstract class Wand extends Item {
}
}
}
public Wand wand(){
return Wand.this;
}
public void gainCharge(float charge){
partialCharge += charge;

View File

@ -4,6 +4,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
@ -35,18 +36,26 @@ public class WandOfWarding extends Wand {
@Override
protected void onZap(Ballistica bolt) {
int currentWardLevels = 0;
int currentWardEnergy = 0;
for (Char ch : Actor.chars()){
if (ch instanceof Ward){
currentWardLevels += ((Ward) ch).tier;
currentWardEnergy += ((Ward) ch).tier + 1;
}
}
int maxWardEnergy = 0;
for (Buff buff : curUser.buffs()){
if (buff instanceof Wand.Charger){
if (((Charger) buff).wand() instanceof WandOfWarding){
maxWardEnergy += 3 + ((Charger) buff).wand().level();
}
}
}
boolean canPlaceMore = currentWardLevels < level()+2;
Char ch = Actor.findChar(bolt.collisionPos);
if (ch != null){
if (ch instanceof Ward){
if (canPlaceMore) {
if (currentWardEnergy < maxWardEnergy) {
((Ward) ch).upgrade(level());
} else {
if (((Ward) ch).tier <= 3){
@ -60,7 +69,7 @@ public class WandOfWarding extends Wand {
GLog.w( Messages.get(this, "bad_location"));
}
} else if (canPlaceWard(bolt.collisionPos)){
if (canPlaceMore) {
if ((currentWardEnergy + 2) <= maxWardEnergy) {
Ward ward = new Ward();
ward.pos = bolt.collisionPos;
ward.wandLevel = level();
@ -116,38 +125,23 @@ public class WandOfWarding extends Wand {
public static boolean canPlaceWard(int pos){
int adjacentBlockedCells = 0;
int adjacentCellGroups = 0;
boolean[] passable = Dungeon.level.passable;
boolean prevPassable = passable[pos + PathFinder.CIRCLE8[PathFinder.CIRCLE8.length-1]];
for (int i : PathFinder.CIRCLE8){
if (Actor.findChar(pos+i) instanceof Ward){
return false;
}
if (!passable[pos + i]){
adjacentBlockedCells++;
}
if (prevPassable != passable[pos + i]){
prevPassable = !prevPassable;
adjacentCellGroups++;
}
}
switch (adjacentBlockedCells){
case 0: case 1:
return true;
case 2:
return (passable[pos + PathFinder.CIRCLE4[0]] || passable[ pos + PathFinder.CIRCLE4[2]])
&& (passable[pos + PathFinder.CIRCLE4[1]] || passable[ pos + PathFinder.CIRCLE4[3]]);
case 3:
return adjacentCellGroups <= 2;
default:
return false;
}
return true;
}
@Override
public String statsDesc() {
if (levelKnown)
return Messages.get(this, "stats_desc", level()+3);
else
return Messages.get(this, "stats_desc", 3);
}
public static class Ward extends NPC {
@ -187,8 +181,8 @@ public class WandOfWarding extends Wand {
HP = Math.round(48*(HP/30f));
break;
case 5:
HT = 72;
HP = Math.round(72*(HP/48f));
HT = 70;
HP = Math.round(70*(HP/48f));
break;
}
@ -282,24 +276,24 @@ public class WandOfWarding extends Wand {
totalZaps++;
switch(tier){
default:
case 1: default:
if (totalZaps >= tier){
die(this);
}
break;
case 3:
if (totalZaps >= 4){
case 2: case 3:
if (totalZaps > tier){
die(this);
}
break;
case 4:
damage(6, this);
damage(5, this);
break;
case 5:
damage(8, this);
damage(6, this);
break;
case 6:
damage(9, this);
damage(7, this);
break;
}
}

View File

@ -1218,21 +1218,21 @@ items.wands.wandoftransfusion.stats_desc=When used on allies, this wand saps som
items.wands.wandofwarding.name=wand of warding
items.wands.wandofwarding.staff_name=staff of warding
items.wands.wandofwarding.no_more_wards=Your wand can't sustain any more wards.
items.wands.wandofwarding.bad_location=There isn't enough space to place a ward here. Wards cannot be placed in corners, hallways, or next to other wards.
items.wands.wandofwarding.bad_location=There isn't enough space to place a ward there.
items.wands.wandofwarding.desc=This short metal wand has a bright purple gem floating above its tip.
items.wands.wandofwarding.stats_desc=Rather than directly damaging an enemy, this wand will summon stationary wards and sentries. Note that wards require some empty space around where they are summoned, and the wand can only sustain so many wards or sentries at one time.
items.wands.wandofwarding.stats_desc=Rather than directly damaging an enemy, this wand will summon stationary wards and sentries. Note that wards cannot be placed next to eachother, and this wand can only sustain _%d energy_ worth of wards at a time.
items.wands.wandofwarding$ward.name_1=lesser ward
items.wands.wandofwarding$ward.desc_1=This basic ward will automatically zap any enemy which comes into its range of vision, dealing _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will only zap a single time before dissipating.
items.wands.wandofwarding$ward.desc_1=This basic ward will automatically zap any enemy which comes into its range of vision, dealing _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will only zap a single time before dissipating.\n\nYour wand of warding is using _2 energy_ to sustain this ward.
items.wands.wandofwarding$ward.name_2=ward
items.wands.wandofwarding$ward.desc_2=This upgraded ward has a more intricate pattern, and can attack multiple times. Each zap from this ward will deal _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will zap two times before dissipating.
items.wands.wandofwarding$ward.desc_2=This upgraded ward has a more intricate pattern, and can attack multiple times. Each zap from this ward will deal _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will zap three times before dissipating.\n\nYour wand of warding is using _3 energy_ to sustain this ward.
items.wands.wandofwarding$ward.name_3=greater ward
items.wands.wandofwarding$ward.desc_3=This fully upgraded ward is able to attack more times, and more quickly, than its predecessors. Each zap from this ward will deal _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will zap four times before dissipating.
items.wands.wandofwarding$ward.desc_3=This fully upgraded ward is able to attack more times, and more quickly, than its predecessors. Each zap from this ward will deal _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will zap four times before dissipating.\n\nYour wand of warding is using _4 energy_ to sustain this ward.
items.wands.wandofwarding$ward.name_4=lesser sentry
items.wands.wandofwarding$ward.desc_4=This smaller sentry has the same attack power as a greater ward, but isn't nearly as fragile. It resembles the gem at the tip of your wand of warding. Each zap from this sentry will deal _%1$d-%2$d damage._\n\nZapping this sentry with your wand of warding will upgrade and heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.
items.wands.wandofwarding$ward.desc_4=This smaller sentry has the same attack power as a greater ward, but isn't nearly as fragile. It resembles the gem at the tip of your wand of warding. Each zap from this sentry will deal _%1$d-%2$d damage._\n\nZapping this sentry with your wand of warding will upgrade and heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.\n\nYour wand of warding is using _5 energy_ to sustain this sentry.
items.wands.wandofwarding$ward.name_5=sentry
items.wands.wandofwarding$ward.desc_5=This upgraded sentry is larger and able to attack more quickly than a lesser sentry. Each zap from this sentry will deal _%1$d-%2$d damage._\n\nZapping this sentry with your wand of warding will upgrade and heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.
items.wands.wandofwarding$ward.desc_5=This upgraded sentry is larger and able to attack more quickly than a lesser sentry. Each zap from this sentry will deal _%1$d-%2$d damage._\n\nZapping this sentry with your wand of warding will upgrade and heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.\n\nYour wand of warding is using _6 energy_ to sustain this ward.
items.wands.wandofwarding$ward.name_6=greater sentry
items.wands.wandofwarding$ward.desc_6=This fully upgraded sentry is significantly more durable than its predecessors. Each zap from this sentry will deal _%1$d-%2$d damage._\n\nZapping this sentry with your wand of warding will heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.
items.wands.wandofwarding$ward.desc_6=This fully upgraded sentry is significantly more durable than its predecessors. Each zap from this sentry will deal _%1$d-%2$d damage._\n\nZapping this sentry with your wand of warding will heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.\n\nYour wand of warding is using _7 energy_ to sustain this ward.
items.wands.wandofwarding$ward.dismiss_title=Dismiss this ward?
items.wands.wandofwarding$ward.dismiss_body=You can dispel this ward if you no longer want your wand to maintain it. Doing so immediately destroys the ward.\n\nDismiss this ward?
items.wands.wandofwarding$ward.dismiss_confirm=yes