v0.9.0: reworked the faith is my armor challenge

This commit is contained in:
Evan Debenham 2020-09-17 00:20:50 -04:00
parent cfca4165a4
commit c46576a175
5 changed files with 22 additions and 30 deletions

View File

@ -72,7 +72,7 @@ badges$badge.unlock_huntress=Unlocked the Huntress
challenges.no_food=On diet challenges.no_food=On diet
challenges.no_food_desc=Food's already scarce, but you have to watch your portions as well!\n\n- Food and the horn of plenty are one third as effective at satisfying hunger\n- Other sources of satiety are unaffected challenges.no_food_desc=Food's already scarce, but you have to watch your portions as well!\n\n- Food and the horn of plenty are one third as effective at satisfying hunger\n- Other sources of satiety are unaffected
challenges.no_armor=Faith is my armor challenges.no_armor=Faith is my armor
challenges.no_armor_desc=Take on the dungeon with nothing but some cloth to protect you!\n\n- All armor except starting cloth is removed challenges.no_armor_desc=You'll need faith in yourself, as your armor won't do much!\n\n- Base blocking power reduced for all armor except cloth\n- All armor now gains very little blocking when upgraded\n- Earthen guardian's defensive power is also significantly reduced.
challenges.no_healing=Pharmacophobia challenges.no_healing=Pharmacophobia
challenges.no_healing_desc=Healing potions sure are handy, unfortunately you're allergic!\n\n- Potions of healing, and items made using potions of healing, poison the hero instead of healing them\n- Alchemical catalysts cannot randomly poison or heal the hero\n- These items still work normally for other characters challenges.no_healing_desc=Healing potions sure are handy, unfortunately you're allergic!\n\n- Potions of healing, and items made using potions of healing, poison the hero instead of healing them\n- Alchemical catalysts cannot randomly poison or heal the hero\n- These items still work normally for other characters
challenges.no_herbalism=Barren land challenges.no_herbalism=Barren land

View File

@ -23,9 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
public class Challenges { public class Challenges {
@ -56,16 +53,8 @@ public class Challenges {
public static boolean isItemBlocked( Item item ){ public static boolean isItemBlocked( Item item ){
if (Dungeon.isChallenged(NO_ARMOR)){ if (Dungeon.isChallenged(NO_HERBALISM) && item instanceof Dewdrop){
if (item instanceof Armor && !(item instanceof ClothArmor || item instanceof ClassArmor)) { return true;
return true;
}
}
if (Dungeon.isChallenged(NO_HERBALISM)){
if (item instanceof Dewdrop) {
return true;
}
} }
return false; return false;

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
@ -169,7 +168,7 @@ public class Statue extends Mob {
} }
public static Statue random(){ public static Statue random(){
if (Random.Int(10) == 0 && !Dungeon.isChallenged(Challenges.NO_ARMOR)){ if (Random.Int(10) == 0){
return new ArmoredStatue(); return new ArmoredStatue();
} else { } else {
return new Statue(); return new Statue();

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.armor; package com.shatteredpixel.shatteredpixeldungeon.items.armor;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
@ -265,6 +266,10 @@ public class Armor extends EquipableItem {
} }
public int DRMax(int lvl){ public int DRMax(int lvl){
if (Dungeon.isChallenged(Challenges.NO_ARMOR)){
return 1 + tier + lvl + augment.defenseFactor(lvl);
}
int max = tier * (2 + lvl) + augment.defenseFactor(lvl); int max = tier * (2 + lvl) + augment.defenseFactor(lvl);
if (lvl > max){ if (lvl > max){
return ((lvl - max)+1)/2; return ((lvl - max)+1)/2;
@ -278,6 +283,10 @@ public class Armor extends EquipableItem {
} }
public int DRMin(int lvl){ public int DRMin(int lvl){
if (Dungeon.isChallenged(Challenges.NO_ARMOR)){
return 0;
}
int max = DRMax(lvl); int max = DRMax(lvl);
if (lvl >= max){ if (lvl >= max){
return (lvl - max); return (lvl - max);

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -82,20 +81,16 @@ public class WndSadGhost extends Window {
btnWeapon.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT ); btnWeapon.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
add( btnWeapon ); add( btnWeapon );
if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) { RedButton btnArmor = new RedButton( Messages.get(this, "armor") ) {
RedButton btnArmor = new RedButton( Messages.get(this, "armor") ) { @Override
@Override protected void onClick() {
protected void onClick() { selectReward(ghost, Ghost.Quest.armor);
selectReward(ghost, Ghost.Quest.armor); }
} };
}; btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT);
btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT); add(btnArmor);
add(btnArmor);
resize(WIDTH, (int) btnArmor.bottom()); resize(WIDTH, (int) btnArmor.bottom());
} else {
resize(WIDTH, (int) btnWeapon.bottom());
}
} }
private void selectReward( Ghost ghost, Item reward ) { private void selectReward( Ghost ghost, Item reward ) {