v0.3.5: lots of berserker polish

This commit is contained in:
Evan Debenham 2016-04-16 22:49:17 -04:00
parent b5bf1001ad
commit 03a4ffb652
10 changed files with 70 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 472 B

View File

@ -1,12 +1,15 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal.WarriorShield;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
/**
* Created by Evan on 20/03/2016.
*/
public class Berserk extends Buff {
private enum State{
@ -47,6 +50,7 @@ public class Berserk extends Buff {
target.SHLD -= Math.min(target.SHLD, 2);
if (target.SHLD == 0) {
target.die(this);
Dungeon.fail(this.getClass());
}
} else {
state = State.EXHAUSTED;
@ -67,10 +71,14 @@ public class Berserk extends Buff {
}
public int damageFactor(int dmg){
float percentMissing = 1f - target.HP/(float)target.HT;
float bonus = 1f + (percentMissing * percentMissing);
float bonus;
if (state == State.EXHAUSTED) bonus *= (50 - exhaustion) / 50f;
if (state == State.EXHAUSTED) {
bonus = (50 - exhaustion) / 50f;
} else {
float percentMissing = 1f - target.HP/(float)target.HT;
bonus = 1f + (percentMissing * percentMissing);
}
return Math.round(dmg * bonus);
}
@ -83,6 +91,10 @@ public class Berserk extends Buff {
state = State.BERSERK;
BuffIndicator.refreshHero();
target.SHLD = sigil.maxShield() * 5;
SpellSprite.show(target, SpellSprite.BERSERK);
Sample.INSTANCE.play( Assets.SND_CHALLENGE );
GameScene.flash(0xFF0000);
}
}
@ -105,13 +117,13 @@ public class Berserk extends Buff {
public int icon() {
switch (state){
case NORMAL: default:
return BuffIndicator.NONE;
return BuffIndicator.ANGERED;
case BERSERK:
return BuffIndicator.FURY;
case EXHAUSTED:
return BuffIndicator.FURY;
return BuffIndicator.EXHAUSTED;
case RECOVERING:
return BuffIndicator.FURY;
return BuffIndicator.RECOVERING;
}
}
@ -119,27 +131,28 @@ public class Berserk extends Buff {
public String toString() {
switch (state){
case NORMAL: default:
return "";
return Messages.get(this, "angered");
case BERSERK:
return "BERSERK!";
return Messages.get(this, "berserk");
case EXHAUSTED:
return "Exhausted";
return Messages.get(this, "exhausted");
case RECOVERING:
return "Recovering";
return Messages.get(this, "recovering");
}
}
@Override
public String desc() {
float dispDamage = damageFactor(10000)/100f;
switch (state){
case NORMAL: default:
return "";
return Messages.get(this, "angered_desc", dispDamage);
case BERSERK:
return "Berserking, you're invincible!";
return Messages.get(this, "berserk_desc");
case EXHAUSTED:
return "Exhausted! Damage down!";
return Messages.get(this, "exhausted_desc", exhaustion , dispDamage);
case RECOVERING:
return "Recovering from rage, can't do it again.";
return Messages.get(this, "recovering_desc", levelRecovery, dispDamage);
}
}
}

View File

@ -1293,7 +1293,13 @@ public class Hero extends Char {
@Override
public boolean isAlive() {
return super.isAlive() || (subClass == HeroSubClass.BERSERKER && Buff.affect(this, Berserk.class).berserking());
if (subClass == HeroSubClass.BERSERKER){
Berserk berserk = buff(Berserk.class);
if (berserk != null && berserk.berserking()){
return true;
}
}
return super.isAlive();
}
@Override

View File

@ -20,14 +20,14 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.effects;
import java.util.HashMap;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.TextureFilm;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.TextureFilm;
import java.util.HashMap;
public class SpellSprite extends Image {
@ -35,6 +35,7 @@ public class SpellSprite extends Image {
public static final int MAP = 1;
public static final int CHARGE = 2;
public static final int MASTERY = 3;
public static final int BERSERK = 4;
private static final int SIZE = 16;

View File

@ -20,22 +20,22 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Fury;
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.SpellSprite;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndChooseWay;
import com.watabou.noosa.audio.Sample;
import java.util.ArrayList;
public class TomeOfMastery extends Item {
@ -124,8 +124,8 @@ public class TomeOfMastery extends Item {
curUser.sprite.emitter().burst( Speck.factory( Speck.MASTERY ), 12 );
GLog.w( Messages.get(this, "way", way.title()) );
if (way == HeroSubClass.BERSERKER && curUser.HP <= curUser.HT * Fury.LEVEL) {
Buff.affect( curUser, Fury.class );
if (way == HeroSubClass.BERSERKER) {
Buff.affect( curUser, Berserk.class );
}
}
}

View File

@ -36,6 +36,16 @@ actors.buffs.amok.desc=Amok causes a state of great rage and confusion in its ta
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. The armor bonus will decrease by one point each turn until it expires.\n\nYour armor is currently increased by: %d.
actors.buffs.berserk.angered=Angered
actors.buffs.berserk.berserk=Berserking
actors.buffs.berserk.exhausted=Exhausted
actors.buffs.berserk.recovering=Recovering
actors.buffs.berserk.angered_desc=The severity of the berserker's injuries strengthen his blows. The lower the berserker's health is, the more bonus damage he will deal. This bonus is significantly stronger when the berserker is close to death.\n\nWhen the berserker is brought to 0 hp and is wearing his seal, he will go berserk and _refuse to die_ for a short time.\n\nCurrent damage: %.2f%%.
actors.buffs.berserk.berserk_desc=At the brink of death, fear and uncertainty bleed away, leaving only anger. In this state of near-death the berserker is incredibly powerful, _dealing double damage, gaining bonus shielding, and refusing to die._\n\nThis bonus shielding is stronger the better the berserker's armor, and will slowly deplete over time. When this shielding is reduced to 0, the berserker will give in and die.\n\nAny form of healing will return the berserker to stability, but he will be exhausted. While exhausted, the berserker will suffer a large reduction in damage for a short time, and then will need to gain experience before being able to berserk again.
actors.buffs.berserk.exhausted_desc=Inner strength has its limits. The berserker is exhausted, weakening him and making him unable to rage.\n\nIn this state The berserker deals significantly reduced damage, and will immediately die at 0 health.\n\nTurns of exhaustion remaining: %d\nCurrent damage: %.2f%%.
actors.buffs.berserk.recovering_desc=Inner strength has its limits. The berserker must rest before using his rage again.\n\nWhile recovering the berserker still deals bonus damage, but will immediately die at 0 health.\n\nLevels until recovered: %.2f\nCurrent damage: %.2f%%.
actors.buffs.berserk.rankings_desc=Berserked to Death
actors.buffs.bleeding.name=Bleeding
actors.buffs.bleeding.ondeath=You bled to death...
actors.buffs.bleeding.heromsg=You are bleeding!
@ -231,7 +241,7 @@ actors.hero.heroclass.huntress_perk5=Potions of Mind Vision are identified from
actors.hero.herosubclass.gladiator=gladiator
actors.hero.herosubclass.gladiator_desc=A successful attack with a melee weapon allows the _Gladiator_ to start a combo, in which every next successful hit inflicts more damage.
actors.hero.herosubclass.berserker=berserker
actors.hero.herosubclass.berserker_desc=When severely wounded, the _Berserker_ enters a state of wild fury significantly increasing his damage output.
actors.hero.herosubclass.berserker_desc=The _Berserker_ deals bonus damage scaling with the severity of his wounds. When reduced to 0 health, he will REFUSE TO DIE for a short time, at the cost of exhaustion.
actors.hero.herosubclass.warlock=warlock
actors.hero.herosubclass.warlock_desc=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.
actors.hero.herosubclass.battlemage=battlemage

View File

@ -20,6 +20,10 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.ui;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoBuff;
import com.watabou.gltextures.SmartTexture;
@ -29,16 +33,13 @@ import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.tweeners.AlphaTweener;
import com.watabou.noosa.ui.Button;
import com.watabou.noosa.ui.Component;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.watabou.utils.SparseArray;
public class BuffIndicator extends Component {
public static final int NONE = -1;
//TODO consider creating an enum to store both index, and tint. Saves making separate images for color differences.
public static final int MIND_VISION = 0;
public static final int LEVITATION = 1;
public static final int FIRE = 2;
@ -79,6 +80,9 @@ public class BuffIndicator extends Component {
public static final int BLESS = 37;
public static final int RAGE = 38;
public static final int SACRIFICE = 39;
public static final int ANGERED = 40;
public static final int EXHAUSTED = 41;
public static final int RECOVERING = 42;
public static final int SIZE = 7;