V0.2.0: Various artifact logic/sprite changes
This commit is contained in:
@@ -31,6 +31,9 @@ public class Artifact extends KindofMisc {
|
||||
protected Buff activeBuff;
|
||||
|
||||
//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
|
||||
protected int levelCap = 0;
|
||||
|
||||
@@ -164,14 +167,14 @@ public class Artifact extends KindofMisc {
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
bundle.put( "level", level );
|
||||
bundle.put( "exp", exp );
|
||||
bundle.put( "charge", charge );
|
||||
bundle.put( "partialcharge", partialCharge);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
level = bundle.getInt("level");
|
||||
exp = bundle.getInt("exp");
|
||||
charge = bundle.getInt("charge");
|
||||
partialCharge = bundle.getFloat("partialcharge");
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ChaliceOfBlood extends Artifact {
|
||||
|
||||
{
|
||||
name = "Chalice of Blood";
|
||||
image = ItemSpriteSheet.ARTIFACT_CHALICE;
|
||||
image = ItemSpriteSheet.ARTIFACT_CHALICE1;
|
||||
level = 0;
|
||||
levelCap = 8;
|
||||
//charge & chargecap are unused
|
||||
@@ -56,7 +56,7 @@ public class ChaliceOfBlood extends Artifact {
|
||||
|
||||
int damage = (level*2)*(level*2);
|
||||
|
||||
if (damage > hero.HT*(3/4)) {
|
||||
if (damage > hero.HP*0.75) {
|
||||
|
||||
GameScene.show(
|
||||
new WndOptions(TXT_CHALICE, TXT_PRICK, TXT_YES, TXT_NO) {
|
||||
@@ -79,15 +79,6 @@ public class ChaliceOfBlood extends Artifact {
|
||||
|
||||
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
|
||||
if (damage == 0){
|
||||
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 );
|
||||
}
|
||||
|
||||
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()) {
|
||||
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth));
|
||||
GLog.n("The Chalice sucks your life essence dry...");
|
||||
} else
|
||||
} else {
|
||||
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("stealthed", stealthed);
|
||||
bundle.put("cooldown", cooldown);
|
||||
bundle.put("exp", exp);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -233,6 +232,5 @@ public class CloakOfShadows extends Artifact {
|
||||
chargeCap = bundle.getInt("chargecap");
|
||||
stealthed = bundle.getBoolean("stealthed");
|
||||
cooldown = bundle.getInt("cooldown");
|
||||
exp = bundle.getInt("exp");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class HornOfPlenty extends Artifact {
|
||||
|
||||
{
|
||||
name = "Horn of Plenty";
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN;
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||
level = 0;
|
||||
levelCap = 30;
|
||||
charge = 0;
|
||||
@@ -97,7 +97,7 @@ public class HornOfPlenty extends Artifact {
|
||||
|
||||
Badges.validateFoodEaten();
|
||||
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN;
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||
|
||||
} else if (action.equals(AC_STORE)){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user