v0.8.1: added item icon functionality to rings, no icon assets yet
This commit is contained in:
+5
@@ -23,10 +23,15 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfAccuracy extends Ring {
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_ACCURACY;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
|
||||
+6
-1
@@ -36,12 +36,17 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class RingOfElements extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_ELEMENTS;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.80f, soloBuffedBonus()))));
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfEnergy extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_ENERGY;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.30f, soloBuffedBonus()) - 1f)));
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfEvasion extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_EVASION;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBuffedBonus()) - 1f)));
|
||||
|
||||
+5
@@ -25,10 +25,15 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class RingOfForce extends Ring {
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_FORCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RingBuff buff( ) {
|
||||
return new Force();
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfFuror extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_FUROR;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBuffedBonus()) - 1f)));
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfHaste extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_HASTE;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBuffedBonus()) - 1f)));
|
||||
|
||||
+5
@@ -26,11 +26,16 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfMight extends Ring {
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_MIGHT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doEquip(Hero hero) {
|
||||
if (super.doEquip(hero)){
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfSharpshooting extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_SHARPSHOOT;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", soloBuffedBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f)));
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfTenacity extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_TENACITY;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBuffedBonus()))));
|
||||
|
||||
+6
-1
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.spells.ArcaneCatalyst;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
@@ -43,7 +44,11 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class RingOfWealth extends Ring {
|
||||
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_WEALTH;
|
||||
}
|
||||
|
||||
private float triesToDrop = Float.MIN_VALUE;
|
||||
private int dropsToRare = Integer.MIN_VALUE;
|
||||
|
||||
|
||||
+16
@@ -699,6 +699,22 @@ public class ItemSpriteSheet {
|
||||
}
|
||||
|
||||
private static final int RINGS = xy(1, 1); //16 slots
|
||||
public static final int RING_ACCURACY = RINGS+0;
|
||||
public static final int RING_ELEMENTS = RINGS+1;
|
||||
public static final int RING_ENERGY = RINGS+2;
|
||||
public static final int RING_EVASION = RINGS+3;
|
||||
public static final int RING_FORCE = RINGS+4;
|
||||
public static final int RING_FUROR = RINGS+5;
|
||||
public static final int RING_HASTE = RINGS+6;
|
||||
public static final int RING_MIGHT = RINGS+7;
|
||||
public static final int RING_SHARPSHOOT = RINGS+8;
|
||||
public static final int RING_TENACITY = RINGS+9;
|
||||
public static final int RING_WEALTH = RINGS+10;
|
||||
public static final int RING_UNUSED = RINGS+11;
|
||||
static {
|
||||
for (int i = RINGS; i < RINGS+16; i++)
|
||||
assignIconRect(i, 8, 8);
|
||||
}
|
||||
|
||||
//16 free slots
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
@@ -191,7 +192,7 @@ public class ItemSlot extends Button {
|
||||
|
||||
status.text( item.status() );
|
||||
|
||||
if (item.icon != -1 && item.isIdentified()){
|
||||
if (item.icon != -1 && (item.isIdentified() || (item instanceof Ring && ((Ring) item).isKnown()))){
|
||||
extra.text( null );
|
||||
|
||||
itemIcon = new Image(Assets.Sprites.ITEM_ICONS);
|
||||
|
||||
Reference in New Issue
Block a user