v0.3.2: reworked the warlock subclass

This commit is contained in:
Evan Debenham
2015-09-23 21:52:33 -04:00
parent 5f09d23ea0
commit 71f65ec31a
16 changed files with 108 additions and 29 deletions
@@ -127,10 +127,6 @@ public class Hunger extends Buff implements Hero.Doom {
}
public void satisfy( float energy ) {
if (((Hero) target).subClass == HeroSubClass.WARLOCK){
Buff.affect( target, ScrollOfRecharging.Recharging.class, energy/50f);
return;
}
Artifact.ArtifactBuff buff = target.buff( HornOfPlenty.hornRecharge.class );
if (buff != null && buff.isCursed()){
@@ -142,17 +138,6 @@ public class Hunger extends Buff implements Hero.Doom {
reduceHunger( energy );
}
public void consumeSoul( float energy ){
if (level >= STARVING)
energy *= 1.33f;
else if (level < HUNGRY)
energy *= 0.67f;
if (!Dungeon.isChallenged(Challenges.NO_FOOD))
reduceHunger( energy );
}
//directly interacts with hunger, no checks.
public void reduceHunger( float energy ) {
@@ -0,0 +1,61 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2015 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class SoulMark extends FlavourBuff {
public static final float DURATION = 50f;
{
type = buffType.NEGATIVE;
}
@Override
public int icon() {
return BuffIndicator.CORRUPT;
}
@Override
public String toString() {
return "Soul Marked";
}
@Override
public boolean attachTo(Char target) {
if (super.attachTo(target) && target.sprite != null){
target.sprite.emitter().burst(ShadowParticle.UP, 10);
return true;
} else
return false;
}
@Override
public String desc() {
return "The warlock has tapped into the soul of this creature. " +
"He will heal and satisfy his hunger as it takes physical damage.\n" +
"\n" +
"This mark will last for " + dispTurns() + ".";
}
}
@@ -1101,17 +1101,6 @@ public class Hero extends Char {
EtherealChains.chainsRecharge chains = buff(EtherealChains.chainsRecharge.class);
if (chains != null) chains.gainExp(percent);
if (subClass == HeroSubClass.WARLOCK) {
int healed = Math.round(Math.min(HT - HP, HT * percent * 0.3f));
if (healed > 0) {
HP += healed;
sprite.emitter().burst( Speck.factory( Speck.HEALING ), percent > 0.3f ? 2 : 1 );
}
(buff( Hunger.class )).consumeSoul( Hunger.STARVING*percent );
}
boolean levelUp = false;
while (this.exp >= maxExp()) {
@@ -34,8 +34,8 @@ public enum HeroSubClass {
"significantly increasing his damage output." ),
WARLOCK( "warlock",
"Normal food grants the _Warlock_ additional wand recharge, but does not satisfy his hunger. " +
"Instead, after killing an enemy, he consumes its soul to heal his wounds and satisfy hunger." ),
"When using wands on an enemy, the _Warlock_ has a chance to mark their soul. " +
"Marked enemies will heal him and restore his hunger whenever they take physical damage."),
BATTLEMAGE( "battlemage",
"When fighting with his staff, the _Battlemage_ conjures bonus effects depending on the wand " +
"his staff is imbued with. His staff will also gain charge through combat." ),
@@ -29,10 +29,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.effects.Surprise;
import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
@@ -373,6 +376,13 @@ public abstract class Mob extends Char {
state = HUNTING;
}
if (buff(SoulMark.class) != null) {
int restoration = Math.max(damage, HP);
Dungeon.hero.buff(Hunger.class).satisfy(restoration*0.5f);
Dungeon.hero.HP = (int)Math.ceil(Math.min(Dungeon.hero.HT, Dungeon.hero.HP+(restoration*0.25f)));
Dungeon.hero.sprite.emitter().burst( Speck.factory(Speck.HEALING), 1 );
}
return damage;
}
@@ -22,7 +22,10 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.watabou.noosa.audio.Sample;
@@ -132,6 +135,14 @@ public abstract class Wand extends Item {
charger.setScaleFactor( chargeScaleFactor );
}
protected void processSoulMark(Char target, int chargesUsed){
if (target != Dungeon.hero &&
Dungeon.hero.subClass == HeroSubClass.WARLOCK &&
Random.Float() < .08f + (level*chargesUsed*0.04f)){
SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION);
}
}
@Override
public void onDetach( ) {
stopCharging();
@@ -73,6 +73,7 @@ public class WandOfBlastWave extends Wand {
Char ch = Actor.findChar(bolt.collisionPos + i);
if (ch != null){
processSoulMark(ch, chargesPerCast());
ch.damage(damage, this);
if (ch.isAlive()) {
@@ -86,6 +87,7 @@ public class WandOfBlastWave extends Wand {
//throws the char at the center of the blast
Char ch = Actor.findChar(bolt.collisionPos);
if (ch != null){
processSoulMark(ch, chargesPerCast());
ch.damage(damage, this);
if (ch.isAlive() && bolt.path.size() > bolt.dist+1) {
@@ -104,6 +104,8 @@ public class WandOfCorruption extends Wand {
ch.HP = ch.HT;
curCharges -= extraCharges;
usagesToKnow -= extraCharges;
processSoulMark(ch, extraCharges+chargesPerCast());
}
}
@@ -95,6 +95,7 @@ public class WandOfDisintegration extends Wand {
int dmgMin = lvl;
int dmgMax = (int) (8 + lvl * lvl / 3f);
for (Char ch : chars) {
processSoulMark(ch, chargesPerCast());
ch.damage( Random.NormalIntRange( dmgMin, dmgMax ), this );
ch.sprite.centerEmitter().burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) );
ch.sprite.flash();
@@ -68,6 +68,7 @@ public class WandOfFrost extends Wand {
ch.sprite.burst( 0xFF99CCFF, level / 2 + 2 );
}
processSoulMark(ch, chargesPerCast());
ch.damage(damage, this);
if (ch.isAlive()){
@@ -64,6 +64,7 @@ public class WandOfLightning extends Wand {
int max = Math.round(10 + (level * level / 4f));
for (Char ch : affected){
processSoulMark(ch, chargesPerCast());
ch.damage(Math.round(Random.NormalIntRange(min, max) * multipler), LightningTrap.LIGHTNING);
if (ch == Dungeon.hero) Camera.main.shake( 2, 0.3f );
@@ -45,6 +45,7 @@ public class WandOfMagicMissile extends Wand {
int level = level();
processSoulMark(ch, chargesPerCast());
ch.damage(Random.NormalIntRange(4 , 6 + level * 2), this);
ch.sprite.burst(0xFFFFFFFF, level / 2 + 2);
@@ -84,7 +84,8 @@ public class WandOfPrismaticLight extends Wand {
protected void onZap(Ballistica beam) {
Char ch = Actor.findChar(beam.collisionPos);
if (ch != null){
affectTarget(ch);
processSoulMark(ch, chargesPerCast());
affectTarget(ch);
}
affectMap(beam);
@@ -20,6 +20,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
@@ -96,6 +97,11 @@ public class WandOfRegrowth extends Wand {
Level.set( i, Terrain.GRASS );
}
Char ch = Actor.findChar(i);
if (ch != null){
processSoulMark(ch, chargesPerCast());
}
GameScene.add( Blob.seed( i, 10, Regrowth.class ) );
}
@@ -102,6 +102,8 @@ public class WandOfTransfusion extends Wand {
//if we find a character..
if (ch != null && ch instanceof Mob){
processSoulMark(ch, chargesPerCast());
//heals an ally, or charmed/corrupted enemy
if (((Mob) ch).ally || ch.buff(Charm.class) != null || ch.buff(Corruption.class) != null){
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
@@ -47,6 +48,11 @@ public class WandOfVenom extends Wand {
Blob venomGas = Blob.seed(bolt.collisionPos, 50 + 10 * level, VenomGas.class);
((VenomGas)venomGas).setStrength(level+1);
GameScene.add(venomGas);
Char ch = Actor.findChar(bolt.collisionPos);
if (ch != null){
processSoulMark(ch, chargesPerCast());
}
}
@Override