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;
}