V0.2.0: implemented ring of Furor, light Sharpshooting refactor
This commit is contained in:
parent
04b1ace7a7
commit
69b7e5a9fc
|
@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
||||
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.RingOfTenacity;
|
||||
import com.watabou.noosa.Camera;
|
||||
|
@ -354,7 +355,14 @@ public class Hero extends Char {
|
|||
return belongings.weapon.speedFactor( this );
|
||||
|
||||
} 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
|||
* Created by debenhame on 10/09/2014.
|
||||
*/
|
||||
public class RingOfFuror extends Ring {
|
||||
//TODO: tie this into game logic
|
||||
//TODO: testing
|
||||
{
|
||||
name = "Ring of Furor";
|
||||
}
|
||||
|
@ -17,9 +17,8 @@ public class RingOfFuror extends Ring {
|
|||
@Override
|
||||
public String desc() {
|
||||
return isKnown() ?
|
||||
"This ring grants the wearer a sort of rising inner fury. " +
|
||||
"Every successful attack will increase the wearers attacking speed " +
|
||||
"until they stop fighting or miss too frequently. " +
|
||||
"This ring grants the wearer an inner fury, allowing them to attack more rapidly. " +
|
||||
"This fury works best in large bursts, so slow weapons benefit far more than fast ones. " +
|
||||
"A cursed ring will instead slow the wearer's speed of attack." :
|
||||
super.desc();
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
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.weapon.enchantments.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
|
@ -84,6 +85,8 @@ public class Weapon extends KindOfWeapon {
|
|||
public float acuracyFactor( Hero hero ) {
|
||||
|
||||
int encumbrance = STR - hero.STR();
|
||||
|
||||
float ACU = this.ACU;
|
||||
|
||||
if (this instanceof MissileWeapon) {
|
||||
switch (hero.heroClass) {
|
||||
|
@ -99,9 +102,7 @@ public class Weapon extends KindOfWeapon {
|
|||
for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) {
|
||||
bonus += ((RingOfSharpshooting.Aim)buff).level;
|
||||
}
|
||||
float ACUbonus = (float)(Math.pow(1.1, bonus));
|
||||
|
||||
return encumbrance > 0 ? (float)((ACU * ACUbonus) / Math.pow( 1.5, encumbrance )) : ACU * ACUbonus;
|
||||
ACU *= (float)(Math.pow(1.1, bonus));
|
||||
}
|
||||
|
||||
return encumbrance > 0 ? (float)((ACU) / Math.pow( 1.5, encumbrance )) : ACU;
|
||||
|
@ -114,6 +115,13 @@ public class Weapon extends KindOfWeapon {
|
|||
if (this instanceof MissileWeapon && hero.heroClass == HeroClass.HUNTRESS) {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user