V0.2.0: implemented ring of Furor, light Sharpshooting refactor

This commit is contained in:
Evan Debenham 2014-09-12 14:16:39 -04:00
parent 04b1ace7a7
commit 69b7e5a9fc
3 changed files with 23 additions and 8 deletions

View File

@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfTenacity; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfTenacity;
import com.watabou.noosa.Camera; import com.watabou.noosa.Camera;
@ -354,7 +355,14 @@ public class Hero extends Char {
return belongings.weapon.speedFactor( this ); return belongings.weapon.speedFactor( this );
} else { } else {
return 1f; //Normally putting furor speed on unarmed attacks would be unnecessary
//But there's going to be that one guy who gets a furor+force ring combo
//This is for that one guy, you shall get your fists of fury!
int bonus = 0;
for (Buff buff : buffs(RingOfFuror.Furor.class)) {
bonus += ((RingOfFuror.Furor)buff).level;
}
return (float)(0.25 + (1 - 0.25)*Math.pow(0.8, bonus));
} }
} }

View File

@ -4,7 +4,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
* Created by debenhame on 10/09/2014. * Created by debenhame on 10/09/2014.
*/ */
public class RingOfFuror extends Ring { public class RingOfFuror extends Ring {
//TODO: tie this into game logic //TODO: testing
{ {
name = "Ring of Furor"; name = "Ring of Furor";
} }
@ -17,9 +17,8 @@ public class RingOfFuror extends Ring {
@Override @Override
public String desc() { public String desc() {
return isKnown() ? return isKnown() ?
"This ring grants the wearer a sort of rising inner fury. " + "This ring grants the wearer an inner fury, allowing them to attack more rapidly. " +
"Every successful attack will increase the wearers attacking speed " + "This fury works best in large bursts, so slow weapons benefit far more than fast ones. " +
"until they stop fighting or miss too frequently. " +
"A cursed ring will instead slow the wearer's speed of attack." : "A cursed ring will instead slow the wearer's speed of attack." :
super.desc(); super.desc();
} }

View File

@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.*; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.*;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
@ -85,6 +86,8 @@ public class Weapon extends KindOfWeapon {
int encumbrance = STR - hero.STR(); int encumbrance = STR - hero.STR();
float ACU = this.ACU;
if (this instanceof MissileWeapon) { if (this instanceof MissileWeapon) {
switch (hero.heroClass) { switch (hero.heroClass) {
case WARRIOR: case WARRIOR:
@ -99,9 +102,7 @@ public class Weapon extends KindOfWeapon {
for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) { for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) {
bonus += ((RingOfSharpshooting.Aim)buff).level; bonus += ((RingOfSharpshooting.Aim)buff).level;
} }
float ACUbonus = (float)(Math.pow(1.1, bonus)); ACU *= (float)(Math.pow(1.1, bonus));
return encumbrance > 0 ? (float)((ACU * ACUbonus) / Math.pow( 1.5, encumbrance )) : ACU * ACUbonus;
} }
return encumbrance > 0 ? (float)((ACU) / Math.pow( 1.5, encumbrance )) : ACU; return encumbrance > 0 ? (float)((ACU) / Math.pow( 1.5, encumbrance )) : ACU;
@ -115,6 +116,13 @@ public class Weapon extends KindOfWeapon {
encumrance -= 2; encumrance -= 2;
} }
int bonus = 0;
for (Buff buff : hero.buffs(RingOfFuror.Furor.class)) {
bonus += ((RingOfFuror.Furor)buff).level;
}
float DLY = (float)(0.25 + (this.DLY - 0.25)*Math.pow(0.8, bonus));
return encumrance > 0 ? (float)(DLY * Math.pow( 1.2, encumrance )) : DLY; return encumrance > 0 ? (float)(DLY * Math.pow( 1.2, encumrance )) : DLY;
} }