v0.6.4: further improvements to challenges, and challenge descriptions

This commit is contained in:
Evan Debenham 2018-03-23 13:22:57 -04:00
parent 9208963605
commit 221d35f324
8 changed files with 62 additions and 80 deletions

View File

@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
@ -31,17 +30,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
public class Challenges {
//Some of these internal IDs are outdated and don't represent what these challenges do
public static final int NO_FOOD = 1;
public static final int NO_ARMOR = 2;
public static final int NO_HEALING = 4;
@ -78,8 +70,6 @@ public class Challenges {
if (Dungeon.isChallenged(NO_ARMOR)){
if (item instanceof Armor && !(item instanceof ClothArmor)) {
return true;
} else if (item instanceof Stylus){
return true;
}
}
@ -93,28 +83,8 @@ public class Challenges {
}
if (Dungeon.isChallenged(NO_HERBALISM)){
if (item instanceof Plant.Seed) {
if (item instanceof Dewdrop) {
return true;
} else if (item instanceof Dewdrop){
return true;
} else if (item instanceof Blandfruit){
return true;
} else if (item instanceof WandOfRegrowth){
return true;
}
}
if (Dungeon.isChallenged(NO_SCROLLS)){
if (item instanceof Scroll){
if (!(item instanceof ScrollOfUpgrade
|| item instanceof ScrollOfRemoveCurse
|| item instanceof ScrollOfMagicalInfusion)){
return true;
}
} else if (item instanceof Runestone){
if (!(item instanceof StoneOfEnchantment)){
return true;
}
}
}

View File

@ -419,9 +419,9 @@ public class Dungeon {
public static boolean souNeeded() {
int souLeftThisSet;
//3 SOU each floor set, 2 on no_scrolls challenge
//3 SOU each floor set, 1.5 (rounded) on forbidden runes challenge
if (isChallenged(Challenges.NO_SCROLLS)){
souLeftThisSet = 2 - (LimitedDrops.UPGRADE_SCROLLS.count - (depth / 5) * 2);
souLeftThisSet = Math.round(1.5f - (LimitedDrops.UPGRADE_SCROLLS.count - (depth / 5) * 1.5f));
} else {
souLeftThisSet = 3 - (LimitedDrops.UPGRADE_SCROLLS.count - (depth / 5) * 3);
}

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -282,8 +281,7 @@ public class Wandmaker extends NPC {
if (!spawned && (type != 0 || (Dungeon.depth > 6 && Random.Int( 10 - Dungeon.depth ) == 0))) {
// decide between 1,2, or 3 for quest type.
// but if the no herbalism challenge is enabled, only pick 1 or 2, no rotberry.
if (type == 0) type = Random.Int(Dungeon.isChallenged(Challenges.NO_HERBALISM) ? 2 : 3)+1;
if (type == 0) type = Random.Int(3)+1;
switch (type){
case 1: default:

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.features;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
@ -48,7 +47,6 @@ public class HighGrass {
Level.set( pos, Terrain.GRASS );
GameScene.updateMap( pos );
if (!Dungeon.isChallenged( Challenges.NO_HERBALISM )) {
int naturalismLevel = 0;
if (ch != null) {
@ -82,7 +80,6 @@ public class HighGrass {
level.drop(new Dewdrop(), pos).sprite.drop();
}
}
}
int leaves = 4;

View File

@ -21,7 +21,6 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.painters;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
@ -327,15 +326,6 @@ public abstract class RegularPainter extends Painter {
}
l.map[i] = (Random.Float() < count / 12f) ? Terrain.HIGH_GRASS : Terrain.GRASS;
}
//forces all grass to short under no herbalism challenge
if (Dungeon.isChallenged(Challenges.NO_HERBALISM)){
for (int i = 0; i < l.map.length; i++){
if (l.map[i] == Terrain.HIGH_GRASS){
l.map[i] = Terrain.GRASS;
}
}
}
}
protected void paintTraps( Level l, ArrayList<Room> rooms ) {

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.plants;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@ -144,7 +145,8 @@ public abstract class Plant implements Bundlable {
protected void onThrow( int cell ) {
if (Dungeon.level.map[cell] == Terrain.ALCHEMY
|| Dungeon.level.pit[cell]
|| Dungeon.level.traps.get(cell) != null) {
|| Dungeon.level.traps.get(cell) != null
|| Dungeon.isChallenged(Challenges.NO_HERBALISM)) {
super.onThrow( cell );
} else {
Dungeon.level.plant( this, cell );

View File

@ -23,9 +23,12 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox;
import com.shatteredpixel.shatteredpixeldungeon.ui.IconButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.RenderedText;
@ -33,7 +36,7 @@ import java.util.ArrayList;
public class WndChallenges extends Window {
private static final int WIDTH = 108;
private static final int WIDTH = 120;
private static final int TTL_HEIGHT = 12;
private static final int BTN_HEIGHT = 18;
private static final int GAP = 1;
@ -59,18 +62,33 @@ public class WndChallenges extends Window {
float pos = TTL_HEIGHT;
for (int i=0; i < Challenges.NAME_IDS.length; i++) {
CheckBox cb = new CheckBox( Messages.get(Challenges.class, Challenges.NAME_IDS[i]) );
final String challenge = Challenges.NAME_IDS[i];
CheckBox cb = new CheckBox( Messages.get(Challenges.class, challenge) );
cb.checked( (checked & Challenges.MASKS[i]) != 0 );
cb.active = editable;
if (i > 0) {
pos += GAP;
}
cb.setRect( 0, pos, WIDTH, BTN_HEIGHT );
pos = cb.bottom();
cb.setRect( 0, pos, WIDTH-16, BTN_HEIGHT );
add( cb );
boxes.add( cb );
IconButton info = new IconButton(Icons.get(Icons.INFO)){
@Override
protected void onClick() {
super.onClick();
ShatteredPixelDungeon.scene().add(
new WndMessage(Messages.get(Challenges.class, challenge+"_desc"))
);
}
};
info.setRect(cb.right(), pos, 16, BTN_HEIGHT);
add(info);
pos = cb.bottom();
}
resize( WIDTH, (int)pos );

View File

@ -66,11 +66,18 @@ badges$badge.happy_end=Happy end
badges$badge.champion=Challenge won
challenges.no_food=On diet
challenges.no_food_desc=Food is scarce, so make every bite count!\n\n- Regular rations and pasties are replaced with small rations\n- Mystery meat and blandfruit are removed\n- Horn of Plenty is removed
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_healing=Pharmacophobia
challenges.no_healing_desc=Without healing potions, you'll need to rely on alternate healing sources to survive\n\n- Potions of healing are removed
challenges.no_herbalism=Barren land
challenges.no_herbalism_desc=There seems to be no clean water left in this accursed dungeon...\n\n- Dew drops are removed\n- Plants are removed\n- Seeds still appear, but will not take root
challenges.swarm_intelligence=Swarm intelligence
challenges.swarm_intelligence_desc=Watch out, the dungeon monsters are getting smarter!\n\n- When an enemy notices you, nearby enemies are drawn to that location
challenges.darkness=Into darkness
challenges.darkness_desc=It is a dungeon after all!\n\n- Regular visible distance dramatically reduced\n- A torch appears on each floor\n- Light buff lasts for less time
challenges.no_scrolls=Forbidden runes
challenges.no_scrolls_desc=A certain rune is harder to find. Unfortunately, it's always the most useful one.\n\n- Half of the dungeon's upgrades scrolls are removed
rankings$record.something=Killed by Something