v0.7.0: added a curse effect to armband, and made cursed cloak unusable

This commit is contained in:
Evan Debenham 2018-09-17 01:15:00 -04:00
parent c41a901898
commit aa21833ebd
4 changed files with 32 additions and 6 deletions

View File

@ -66,7 +66,7 @@ public class CloakOfShadows extends Artifact {
@Override
public ArrayList<String> actions( Hero hero ) {
ArrayList<String> actions = super.actions( hero );
if (isEquipped( hero ) && charge > 1)
if (isEquipped( hero ) && !cursed && charge > 1)
actions.add(AC_STEALTH);
return actions;
}
@ -80,6 +80,7 @@ public class CloakOfShadows extends Artifact {
if (!stealthed){
if (!isEquipped(hero)) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
else if (cursed) GLog.i( Messages.get(this, "cursed") );
else if (charge <= 0) GLog.i( Messages.get(this, "no_charge") );
else {
stealthed = true;

View File

@ -55,15 +55,23 @@ public class MasterThievesArmband extends Artifact {
public String desc() {
String desc = super.desc();
if ( isEquipped (Dungeon.hero) )
desc += "\n\n" + Messages.get(this, "desc_worn");
if ( isEquipped (Dungeon.hero) ){
if (cursed){
desc += "\n\n" + Messages.get(this, "desc_cursed");
} else {
desc += "\n\n" + Messages.get(this, "desc_worn");
}
}
return desc;
}
public class Thievery extends ArtifactBuff{
public void collect(int gold){
charge += gold/2;
if (!cursed) {
charge += gold/2;
}
}
@Override
@ -71,7 +79,22 @@ public class MasterThievesArmband extends Artifact {
charge *= 0.95;
super.detach();
}
@Override
public boolean act() {
if (cursed) {
if (Dungeon.gold > 0 && Random.Int(6) == 0){
Dungeon.gold--;
}
spend(TICK);
return true;
} else {
return super.act();
}
}
public boolean steal(int value){
if (value <= charge){
charge -= value;

View File

@ -137,7 +137,7 @@ public class WndTradeItem extends Window {
};
final MasterThievesArmband.Thievery thievery = Dungeon.hero.buff(MasterThievesArmband.Thievery.class);
if (thievery != null) {
if (thievery != null && !thievery.isCursed()) {
final float chance = thievery.stealChance(price);
RedButton btnSteal = new RedButton( Messages.get(this, "steal", Math.min(100, (int)(chance*100)))) {
@Override

View File

@ -176,6 +176,7 @@ items.artifacts.chaliceofblood.desc_3=The chalice is filled to the brim with you
items.artifacts.cloakofshadows.name=cloak of shadows
items.artifacts.cloakofshadows.ac_stealth=STEALTH
items.artifacts.cloakofshadows.cooldown=Your cloak needs %d more rounds to re-energize.
items.artifacts.cloakofshadows.cursed=You cannot use a cursed cloak.
items.artifacts.cloakofshadows.no_charge=Your cloak hasn't recharged enough to be usable yet.
items.artifacts.cloakofshadows.desc=A priceless magical cloak, stolen from the royal armory many years ago by the Rogue. When worn, it can be used to turn completely invisible for a short time.\n\nThe more the cloak is used, the stronger it will become, allowing the Rogue to become invisible more frequently and for longer durations.
items.artifacts.cloakofshadows$cloakstealth.no_charge=Your cloak has run out of energy.
@ -261,6 +262,7 @@ items.artifacts.lloydsbeacon.desc_set=This beacon was set somewhere on the level
items.artifacts.masterthievesarmband.name=master thieves' armband
items.artifacts.masterthievesarmband.desc=This purple velvet armband bears the mark of a master thief. This doesn't belong to you, but it probably didn't belong to its last user either.
items.artifacts.masterthievesarmband.desc_cursed=The cursed armband is bound to your wrist, and somehow your pouch of gold seems to be slowly getting lighter...
items.artifacts.masterthievesarmband.desc_worn=With the armband around your wrist, every piece of gold you find makes you desire other people's property more. Perhaps it wouldn't be too hard to steal from a shop...
items.artifacts.sandalsofnature.name=sandals of nature