v0.3.4: cleaned up ring of force

This commit is contained in:
Evan Debenham 2016-01-03 21:02:24 -05:00 committed by Evan Debenham
parent c19e6c2442
commit 6c95e48f14
4 changed files with 36 additions and 10 deletions

View File

@ -324,12 +324,11 @@ public class Hero extends Char {
if (wep != null) {
dmg = wep.damageRoll( this ) + bonus;
} else {
int str = STR() - 8;
dmg = bonus == 0 ?
str > 1 ? Random.NormalIntRange( 1, str ) : 1
: bonus > 0 ?
str > 0 ? Random.NormalIntRange( str/2+bonus, (int)(str*0.5f*bonus) + str*2 ) : 1
: 0;
if (bonus != 0){
dmg = Random.NormalIntRange( RingOfForce.min(bonus, STR()), RingOfForce.max(bonus, STR()) );
} else {
dmg = Random.NormalIntRange(1, Math.max(STR()-8, 1));
}
}
if (dmg < 0) dmg = 0;
return buff( Fury.class ) != null ? (int)(dmg * 1.5f) : dmg;

View File

@ -240,10 +240,9 @@ public class Ring extends KindofMisc {
String desc = isKnown()? desc() : Messages.get(this, "unknown_desc", gem());
if (isEquipped( Dungeon.hero )) {
if (cursed && isEquipped( Dungeon.hero )) {
desc += "\n\n" + Messages.get(Ring.class, "on_finger", name());
if (cursed) desc += " " + Messages.get(Ring.class, "cursed_worn");
desc += "\n\n" + Messages.get(Ring.class, "cursed_worn");
} else if (cursed && cursedKnown) {

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
public class RingOfForce extends Ring {
@ -29,6 +30,31 @@ public class RingOfForce extends Ring {
return new Force();
}
public static int min(int bonus, int herostr){
if (bonus < 0) return 0;
int STR = herostr-8;
return Math.max(STR/2+bonus, 0);
}
public static int max(int bonus, int herostr){
if (bonus < 0) return 0;
int STR = herostr-8;
return Math.max((int)(STR*0.5f*bonus) + STR*2, bonus);
}
@Override
public String desc() {
String desc = super.desc();
int str = Dungeon.hero.STR();
if (levelKnown) {
desc += "\n\n" + Messages.get(this, "avg_dmg", (min(level(), str) + max(level(), str))/2);
} else {
desc += "\n\n" + Messages.get(this, "typical_avg_dmg", (min(1, str) + max(1, str))/2);
}
return desc;
}
public class Force extends RingBuff {
}
}

View File

@ -319,7 +319,7 @@ items.rings.ring.unknown_desc=This metal band is adorned with a large %s gem tha
items.rings.ring.known=This is a %s
items.rings.ring.identify=You are now familiar enough with your %s to identify it. It is %s.
items.rings.ring.on_finger=The %s is on your finger.
items.rings.ring.cursed_worn=Because it is cursed, you are powerless to remove it.
items.rings.ring.cursed_worn=Because this ring is cursed, you are powerless to remove it.
items.rings.ring.curse_known=You can feel a malevolent magic lurking within the %s.
items.rings.ring.unequip_title=Unequip one item
items.rings.ring.unequip_message=You can only wear two misc items at a time.
@ -334,6 +334,8 @@ items.rings.ringofevasion.name=ring of evasion
items.rings.ringofevasion.desc=This ring obfuscates the true position of the wearer, making them harder to detect and attack. This ring is much stronger while the user remains undetected, and if the user is targeted the power of evasion will slowly fade away, remaining undetected will restore the ring's effectiveness. A degraded ring will instead make the user easier to detect and strike.
items.rings.ringofforce.name=ring of force
items.rings.ringofforce.avg_dmg=When unarmed, at your current strength, average damage with this ring is %d points per hit.
items.rings.ringofforce.typical_avg_dmg=When unarmed, at your current strength, typical average damage with this ring is %d points per hit.
items.rings.ringofforce.desc=This ring enhances the force of the wearer's blows. This extra power is largely wasted when wielding weapons, but an unarmed attack will be made much stronger. A degraded ring will instead weaken the wearer's blows.
items.rings.ringoffuror.name=ring of furor