V0.2.0: Various artifact logic/sprite changes
This commit is contained in:
parent
5e038f5c5d
commit
14ff09373b
BIN
assets/items.png
BIN
assets/items.png
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
@ -93,7 +93,7 @@ public class ItemStatusHandler<T extends Item> {
|
||||||
Class<? extends T> item = (Class<? extends T>)(items[i]);
|
Class<? extends T> item = (Class<? extends T>)(items[i]);
|
||||||
String itemName = item.toString();
|
String itemName = item.toString();
|
||||||
|
|
||||||
if (bundle.contains( itemName + PFX_LABEL ) && Dungeon.version > 3) {
|
if (bundle.contains( itemName + PFX_LABEL ) && Dungeon.version > 4) {
|
||||||
|
|
||||||
String label = bundle.getString( itemName + PFX_LABEL );
|
String label = bundle.getString( itemName + PFX_LABEL );
|
||||||
labels.put( item, label );
|
labels.put( item, label );
|
||||||
|
|
|
@ -31,6 +31,9 @@ public class Artifact extends KindofMisc {
|
||||||
protected Buff activeBuff;
|
protected Buff activeBuff;
|
||||||
|
|
||||||
//level is used internally to track upgrades to artifacts, size/logic varies per artifact.
|
//level is used internally to track upgrades to artifacts, size/logic varies per artifact.
|
||||||
|
//already inherited from item superclass
|
||||||
|
//exp is used to count progress towards levels for some artifacts
|
||||||
|
protected int exp = 0;
|
||||||
//levelCap is the artifact's maximum level
|
//levelCap is the artifact's maximum level
|
||||||
protected int levelCap = 0;
|
protected int levelCap = 0;
|
||||||
|
|
||||||
|
@ -164,14 +167,14 @@ public class Artifact extends KindofMisc {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeInBundle( Bundle bundle ) {
|
public void storeInBundle( Bundle bundle ) {
|
||||||
bundle.put( "level", level );
|
bundle.put( "exp", exp );
|
||||||
bundle.put( "charge", charge );
|
bundle.put( "charge", charge );
|
||||||
bundle.put( "partialcharge", partialCharge);
|
bundle.put( "partialcharge", partialCharge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
level = bundle.getInt("level");
|
exp = bundle.getInt("exp");
|
||||||
charge = bundle.getInt("charge");
|
charge = bundle.getInt("charge");
|
||||||
partialCharge = bundle.getFloat("partialcharge");
|
partialCharge = bundle.getFloat("partialcharge");
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class ChaliceOfBlood extends Artifact {
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "Chalice of Blood";
|
name = "Chalice of Blood";
|
||||||
image = ItemSpriteSheet.ARTIFACT_CHALICE;
|
image = ItemSpriteSheet.ARTIFACT_CHALICE1;
|
||||||
level = 0;
|
level = 0;
|
||||||
levelCap = 8;
|
levelCap = 8;
|
||||||
//charge & chargecap are unused
|
//charge & chargecap are unused
|
||||||
|
@ -56,7 +56,7 @@ public class ChaliceOfBlood extends Artifact {
|
||||||
|
|
||||||
int damage = (level*2)*(level*2);
|
int damage = (level*2)*(level*2);
|
||||||
|
|
||||||
if (damage > hero.HT*(3/4)) {
|
if (damage > hero.HP*0.75) {
|
||||||
|
|
||||||
GameScene.show(
|
GameScene.show(
|
||||||
new WndOptions(TXT_CHALICE, TXT_PRICK, TXT_YES, TXT_NO) {
|
new WndOptions(TXT_CHALICE, TXT_PRICK, TXT_YES, TXT_NO) {
|
||||||
|
@ -79,15 +79,6 @@ public class ChaliceOfBlood extends Artifact {
|
||||||
|
|
||||||
hero.spendAndNext(3f);
|
hero.spendAndNext(3f);
|
||||||
|
|
||||||
Earthroot.Armor armor = hero.buff(Earthroot.Armor.class);
|
|
||||||
if (armor != null) {
|
|
||||||
damage = armor.absorb(damage);
|
|
||||||
}
|
|
||||||
|
|
||||||
damage -= Random.IntRange(0, hero.dr());
|
|
||||||
|
|
||||||
hero.damage(damage, this);
|
|
||||||
|
|
||||||
//TODO: make sure this look good
|
//TODO: make sure this look good
|
||||||
if (damage == 0){
|
if (damage == 0){
|
||||||
GLog.i("You prick yourself, that hardly hurt at all!");
|
GLog.i("You prick yourself, that hardly hurt at all!");
|
||||||
|
@ -105,11 +96,27 @@ public class ChaliceOfBlood extends Artifact {
|
||||||
hero.sprite.emitter().burst( ShadowParticle.CURSE, 6 );
|
hero.sprite.emitter().burst( ShadowParticle.CURSE, 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Earthroot.Armor armor = hero.buff(Earthroot.Armor.class);
|
||||||
|
if (armor != null) {
|
||||||
|
damage = armor.absorb(damage);
|
||||||
|
}
|
||||||
|
|
||||||
|
damage -= Random.IntRange(0, hero.dr());
|
||||||
|
|
||||||
|
hero.damage(damage, this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!hero.isAlive()) {
|
if (!hero.isAlive()) {
|
||||||
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth));
|
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth));
|
||||||
GLog.n("The Chalice sucks your life essence dry...");
|
GLog.n("The Chalice sucks your life essence dry...");
|
||||||
} else
|
} else {
|
||||||
level++;
|
level++;
|
||||||
|
if (level >= 5)
|
||||||
|
image = ItemSpriteSheet.ARTIFACT_CHALICE2;
|
||||||
|
else if (level >= 3)
|
||||||
|
image = ItemSpriteSheet.ARTIFACT_CHALICE3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,6 @@ public class CloakOfShadows extends Artifact {
|
||||||
bundle.put("chargecap", chargeCap);
|
bundle.put("chargecap", chargeCap);
|
||||||
bundle.put("stealthed", stealthed);
|
bundle.put("stealthed", stealthed);
|
||||||
bundle.put("cooldown", cooldown);
|
bundle.put("cooldown", cooldown);
|
||||||
bundle.put("exp", exp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -233,6 +232,5 @@ public class CloakOfShadows extends Artifact {
|
||||||
chargeCap = bundle.getInt("chargecap");
|
chargeCap = bundle.getInt("chargecap");
|
||||||
stealthed = bundle.getBoolean("stealthed");
|
stealthed = bundle.getBoolean("stealthed");
|
||||||
cooldown = bundle.getInt("cooldown");
|
cooldown = bundle.getInt("cooldown");
|
||||||
exp = bundle.getInt("exp");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class HornOfPlenty extends Artifact {
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "Horn of Plenty";
|
name = "Horn of Plenty";
|
||||||
image = ItemSpriteSheet.ARTIFACT_HORN;
|
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||||
level = 0;
|
level = 0;
|
||||||
levelCap = 30;
|
levelCap = 30;
|
||||||
charge = 0;
|
charge = 0;
|
||||||
|
@ -97,7 +97,7 @@ public class HornOfPlenty extends Artifact {
|
||||||
|
|
||||||
Badges.validateFoodEaten();
|
Badges.validateFoodEaten();
|
||||||
|
|
||||||
image = ItemSpriteSheet.ARTIFACT_HORN;
|
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||||
|
|
||||||
} else if (action.equals(AC_STORE)){
|
} else if (action.equals(AC_STORE)){
|
||||||
|
|
||||||
|
|
|
@ -130,80 +130,88 @@ public class ItemSpriteSheet {
|
||||||
public static final int RING_AGATE = ROW7+10;
|
public static final int RING_AGATE = ROW7+10;
|
||||||
public static final int RING_DIAMOND = ROW7+11;
|
public static final int RING_DIAMOND = ROW7+11;
|
||||||
|
|
||||||
//Row Eight: Artifacts
|
//Row Eight: Artifacts with Static Images
|
||||||
//ssssshhh....
|
|
||||||
public static final int ARTIFACT_CLOAK = ROW8+0;
|
public static final int ARTIFACT_CLOAK = ROW8+0;
|
||||||
public static final int ARTIFACT_HORN = ROW8+1;
|
public static final int ARTIFACT_ARMBAND = ROW8+1;
|
||||||
public static final int ARTIFACT_CHALICE = 0;
|
public static final int ARTIFACT_CAPE = ROW8+2;
|
||||||
public static final int ARTIFACT_SANDALS = 0;
|
|
||||||
public static final int ARTIFACT_ARMBAND = 0;
|
|
||||||
public static final int ARTIFACT_CAPE = 0;
|
|
||||||
public static final int ARTIFACT_TALISMAN = 0;
|
public static final int ARTIFACT_TALISMAN = 0;
|
||||||
|
|
||||||
//Row Nine: Scrolls
|
|
||||||
public static final int SCROLL_KAUNAN = ROW9+0;
|
|
||||||
public static final int SCROLL_SOWILO = ROW9+1;
|
|
||||||
public static final int SCROLL_LAGUZ = ROW9+2;
|
|
||||||
public static final int SCROLL_YNGVI = ROW9+3;
|
|
||||||
public static final int SCROLL_GYFU = ROW9+4;
|
|
||||||
public static final int SCROLL_RAIDO = ROW9+5;
|
|
||||||
public static final int SCROLL_ISAZ = ROW9+6;
|
|
||||||
public static final int SCROLL_MANNAZ = ROW9+7;
|
|
||||||
public static final int SCROLL_NAUDIZ = ROW9+8;
|
|
||||||
public static final int SCROLL_BERKANAN = ROW9+9;
|
|
||||||
public static final int SCROLL_ODAL = ROW9+10;
|
|
||||||
public static final int SCROLL_TIWAZ = ROW9+11;
|
|
||||||
|
|
||||||
//Row Ten: Potions
|
//Row Nine: Artifacts with Dynamic Images
|
||||||
public static final int POTION_CRIMSON = ROW10+0;
|
public static final int ARTIFACT_HORN1 = ROW9+0;
|
||||||
public static final int POTION_AMBER = ROW10+1;
|
public static final int ARTIFACT_HORN2 = ROW9+1;
|
||||||
public static final int POTION_GOLDEN = ROW10+2;
|
public static final int ARTIFACT_HORN3 = ROW9+2;
|
||||||
public static final int POTION_JADE = ROW10+3;
|
public static final int ARTIFACT_HORN4 = ROW9+3;
|
||||||
public static final int POTION_TURQUOISE = ROW10+4;
|
public static final int ARTIFACT_CHALICE1 = ROW9+4;
|
||||||
public static final int POTION_AZURE = ROW10+5;
|
public static final int ARTIFACT_CHALICE2 = ROW9+5;
|
||||||
public static final int POTION_INDIGO = ROW10+6;
|
public static final int ARTIFACT_CHALICE3 = ROW9+6;
|
||||||
public static final int POTION_MAGENTA = ROW10+7;
|
public static final int ARTIFACT_SANDALS = ROW9+7;
|
||||||
public static final int POTION_BISTRE = ROW10+8;
|
public static final int ARTIFACT_SHOES = ROW9+8;
|
||||||
public static final int POTION_CHARCOAL = ROW10+9;
|
public static final int ARTIFACT_BOOTS = ROW9+9;
|
||||||
public static final int POTION_SILVER = ROW10+10;
|
public static final int ARTIFACT_LEGGINGS = ROW9+10;
|
||||||
public static final int POTION_IVORY = ROW10+11;
|
|
||||||
|
|
||||||
//Row Eleven: Seeds
|
//Row Ten: Scrolls
|
||||||
public static final int SEED_ROTBERRY = ROW11+0;
|
public static final int SCROLL_KAUNAN = ROW10+0;
|
||||||
public static final int SEED_FIREBLOOM = ROW11+1;
|
public static final int SCROLL_SOWILO = ROW10+1;
|
||||||
public static final int SEED_BLINDWEED = ROW11+2;
|
public static final int SCROLL_LAGUZ = ROW10+2;
|
||||||
public static final int SEED_SUNGRASS = ROW11+3;
|
public static final int SCROLL_YNGVI = ROW10+3;
|
||||||
public static final int SEED_ICECAP = ROW11+4;
|
public static final int SCROLL_GYFU = ROW10+4;
|
||||||
public static final int SEED_SORROWMOSS = ROW11+5;
|
public static final int SCROLL_RAIDO = ROW10+5;
|
||||||
public static final int SEED_EARTHROOT = ROW11+6;
|
public static final int SCROLL_ISAZ = ROW10+6;
|
||||||
public static final int SEED_FADELEAF = ROW11+7;
|
public static final int SCROLL_MANNAZ = ROW10+7;
|
||||||
public static final int SEED_BLANDFRUIT = ROW11+8;
|
public static final int SCROLL_NAUDIZ = ROW10+8;
|
||||||
|
public static final int SCROLL_BERKANAN = ROW10+9;
|
||||||
|
public static final int SCROLL_ODAL = ROW10+10;
|
||||||
|
public static final int SCROLL_TIWAZ = ROW10+11;
|
||||||
|
|
||||||
//Row Twelve: Food
|
//Row Eleven: Potions
|
||||||
public static final int MEAT = ROW12+0;
|
public static final int POTION_CRIMSON = ROW11+0;
|
||||||
public static final int STEAK = ROW12+1;
|
public static final int POTION_AMBER = ROW11+1;
|
||||||
public static final int OVERPRICED = ROW12+2;
|
public static final int POTION_GOLDEN = ROW11+2;
|
||||||
public static final int CARPACCIO = ROW12+3;
|
public static final int POTION_JADE = ROW11+3;
|
||||||
public static final int BLANDFRUIT = ROW12+4;
|
public static final int POTION_TURQUOISE = ROW11+4;
|
||||||
public static final int RATION = ROW12+5;
|
public static final int POTION_AZURE = ROW11+5;
|
||||||
public static final int PASTY = ROW12+6;
|
public static final int POTION_INDIGO = ROW11+6;
|
||||||
|
public static final int POTION_MAGENTA = ROW11+7;
|
||||||
|
public static final int POTION_BISTRE = ROW11+8;
|
||||||
|
public static final int POTION_CHARCOAL = ROW11+9;
|
||||||
|
public static final int POTION_SILVER = ROW11+10;
|
||||||
|
public static final int POTION_IVORY = ROW11+11;
|
||||||
|
|
||||||
//Row Thirteen: Quest Items
|
//Row Twelve: Seeds
|
||||||
public static final int ROSE = ROW13+0;
|
public static final int SEED_ROTBERRY = ROW12+0;
|
||||||
public static final int SKULL = ROW13+1;
|
public static final int SEED_FIREBLOOM = ROW12+1;
|
||||||
public static final int DUST = ROW13+2;
|
public static final int SEED_BLINDWEED = ROW12+2;
|
||||||
public static final int PICKAXE = ROW13+3;
|
public static final int SEED_SUNGRASS = ROW12+3;
|
||||||
public static final int ORE = ROW13+4;
|
public static final int SEED_ICECAP = ROW12+4;
|
||||||
public static final int TOKEN = ROW13+5;
|
public static final int SEED_SORROWMOSS = ROW12+5;
|
||||||
|
public static final int SEED_EARTHROOT = ROW12+6;
|
||||||
|
public static final int SEED_FADELEAF = ROW12+7;
|
||||||
|
public static final int SEED_BLANDFRUIT = ROW12+8;
|
||||||
|
|
||||||
//Row Fourteen: Containers/Bags
|
//Row Theirteen: Food
|
||||||
public static final int VIAL = ROW14+0;
|
public static final int MEAT = ROW13+0;
|
||||||
public static final int POUCH = ROW14+1;
|
public static final int STEAK = ROW13+1;
|
||||||
public static final int HOLDER = ROW14+2;
|
public static final int OVERPRICED = ROW13+2;
|
||||||
public static final int BANDOLIER = ROW14+3;
|
public static final int CARPACCIO = ROW13+3;
|
||||||
public static final int HOLSTER = ROW14+4;
|
public static final int BLANDFRUIT = ROW13+4;
|
||||||
|
public static final int RATION = ROW13+5;
|
||||||
|
public static final int PASTY = ROW13+6;
|
||||||
|
|
||||||
//Row Fifteen: Unused
|
//Row Fourteen: Quest Items
|
||||||
|
public static final int ROSE = ROW14+0;
|
||||||
|
public static final int SKULL = ROW14+1;
|
||||||
|
public static final int DUST = ROW14+2;
|
||||||
|
public static final int PICKAXE = ROW14+3;
|
||||||
|
public static final int ORE = ROW14+4;
|
||||||
|
public static final int TOKEN = ROW14+5;
|
||||||
|
|
||||||
|
//Row Fifteen: Containers/Bags
|
||||||
|
public static final int VIAL = ROW15+0;
|
||||||
|
public static final int POUCH = ROW15+1;
|
||||||
|
public static final int HOLDER = ROW15+2;
|
||||||
|
public static final int BANDOLIER = ROW15+3;
|
||||||
|
public static final int HOLSTER = ROW15+4;
|
||||||
|
|
||||||
//Row Sixteen: Unused
|
//Row Sixteen: Unused
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user