Skip to content

Commit

Permalink
Playtesting Temples and Win
Browse files Browse the repository at this point in the history
  • Loading branch information
tukkek committed Oct 4, 2017
1 parent c7e9863 commit ae59690
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion javelin/Javelin.java
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public static KeyEvent message(String text, boolean requireenter) {
*/
static public Character prompt(final String prompt, boolean center) {
Game.messagepanel.clear();
BattleScreen.active.center();
// BattleScreen.active.center();
Game.message(prompt, Delay.NONE);
if (center) {
BattleScreen.active.center();
Expand Down
12 changes: 6 additions & 6 deletions javelin/model/world/location/dungeon/Chest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public Chest(String visual, int x, int y, int goldp, ItemSelection itemsp) {
@Override
public boolean activate() {
if (key != null) {
Javelin.message(
"You have found: " + key.toString().toLowerCase() + "!",
true);
String message = "You have found: " + key.toString().toLowerCase()
+ "!";
Javelin.message(message, true);
key.grab();
Portal.opensafe();
} else if (!items.isEmpty()) {
Expand All @@ -63,9 +63,9 @@ public boolean activate() {
} else if (rubies > 0) {
Javelin.message(takeruby(rubies), false);
} else {
Javelin.message(
"Party receives $" + PurchaseScreen.formatcost(gold) + "!",
false);
String message = "Party receives $"
+ PurchaseScreen.formatcost(gold) + "!";
Javelin.message(message, false);
Squad.active.gold += gold;
}
return true;
Expand Down
8 changes: 6 additions & 2 deletions javelin/model/world/location/dungeon/Dungeon.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public static boolean valid(int coordinate) {

void createchests(Set<Point> free, final Set<Point> used) {
int chests = RPG.r(3, 5);
int pool = RewardCalculator.receivegold(Squad.active.members);
for (int i = 0; i < chests; i++) {// equal trap/treasure find chance
int pool = getgoldpool();
for (int i = 0; i < chests; i++) {/* equal trap/treasure find chance */
Trap t = new Trap(findspot(free, used));
build(t, used);
pool += RewardCalculator.getgold(t.cr);
Expand All @@ -208,6 +208,10 @@ void createchests(Set<Point> free, final Set<Point> used) {
}
}

public int getgoldpool() {
return RewardCalculator.receivegold(Squad.active.members);
}

/**
* @param p
* Chest's location.
Expand Down
4 changes: 0 additions & 4 deletions javelin/model/world/location/dungeon/Trap.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ static int ratefactor(float f) {
@Override
public boolean activate() {
if (!draw) {
// if (map != null) {
draw = true;
// super.addvisual(map);
// map = null;
// }
fallinto();
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions javelin/model/world/location/dungeon/temple/AirTemple.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
* @author alex
*/
public class AirTemple extends Temple {
private static final String FLUFF =
"You are at the very peak of this mountain range, way above the cloud cover.\n"
+ "The cold wind makes your limbs tremble and your heart lust for warmer surroundings.\n"
+ "At last you manage to overcome the stone entryway that dives deep into the summit's core.\n"
+ "As you enter you immediately feel warmer but the strong gale coming from the outside threatens to carry you along its momentum.";
private static final String FLUFF = "You are at the very peak of this mountain range, way above the cloud cover.\n"
+ "The cold wind makes your limbs tremble and your heart lust for warmer surroundings.\n"
+ "At last you manage to overcome the stone entryway that dives deep into the summit's core.\n"
+ "As you enter you immediately feel warmer but the strong gale coming from the outside threatens to carry you along its momentum.";

/** Constructor. */
public AirTemple(Integer pop) {
Expand Down Expand Up @@ -53,6 +52,7 @@ public boolean hazard(TempleDungeon d) {
}
Javelin.message("A strong wind pushes you around!", true);
Point to = steps.get(steps.size() - 1);
d.herolocation = to;
JavelinApp.context.view(hero.x, hero.y);
return true;
}
Expand Down
18 changes: 13 additions & 5 deletions javelin/model/world/location/dungeon/temple/TempleDungeon.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javelin.Javelin;
import javelin.controller.Point;
import javelin.controller.challenge.CrCalculator;
import javelin.controller.challenge.RewardCalculator;
import javelin.controller.fight.Fight;
import javelin.model.item.ItemSelection;
import javelin.model.unit.Squad;
Expand All @@ -15,6 +16,7 @@
import javelin.model.world.location.dungeon.StairsUp;
import javelin.model.world.location.dungeon.temple.features.Altar;
import javelin.model.world.location.dungeon.temple.features.StairsDown;
import javelin.view.screen.DungeonScreen;

/**
* Unlike normal dungeons {@link Temple}s have many floors (levels), chests with
Expand Down Expand Up @@ -60,9 +62,8 @@ public void activate(boolean loading) {
super.activate(loading);
return;
}
String difficulty = CrCalculator
.describedifficulty(temple.el - CrCalculator
.calculateel(Squad.active.members));
String difficulty = CrCalculator.describedifficulty(
temple.el - CrCalculator.calculateel(Squad.active.members));
Character prompt = Javelin.prompt("You're at the entrance of the "
+ temple.descriptionknown + " (difficulty: " + difficulty
+ "). Do you want to enter?\n"
Expand All @@ -78,8 +79,8 @@ protected void setlocation(boolean loading) {
if (Temple.leavingfight) {
Temple.leavingfight = false;
} else {
Class<? extends Feature> reference =
Temple.climbing ? StairsDown.class : StairsUp.class;
Class<? extends Feature> reference = Temple.climbing
? StairsDown.class : StairsUp.class;
Temple.climbing = false;
for (Feature f : features) {
if (reference.isInstance(f)) {
Expand All @@ -105,6 +106,7 @@ protected Feature createspecialchest(Point p) {

@Override
public void goup() {
DungeonScreen.dontenter = true;
int level = temple.floors.indexOf(this);
if (level == 0) {
super.goup();
Expand All @@ -117,6 +119,7 @@ public void goup() {

@Override
public void godown() {
DungeonScreen.dontenter = true;
Squad.active.ellapse(1);
temple.floors.get(temple.floors.indexOf(this) + 1).activate(false);
}
Expand Down Expand Up @@ -151,4 +154,9 @@ public boolean hazard() {
protected void generate() {
super.generate();
}

@Override
public int getgoldpool() {
return RewardCalculator.getgold(temple.el) * 4;
}
}
8 changes: 4 additions & 4 deletions javelin/view/screen/haxor/Win.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ protected boolean hack(Combatant target, HaxorScreen s) {
s.text += "\nPress any key to continue...\n\n";
s.print();
}
int current = Math.round(Math.round(WorldScreen.lastday));
s.text += "Your highscore record is " + Javelin.gethighscore() + "\n";
s.text += "Your current score now is " + WorldScreen.lastday + "\n";
s.text +=
"\nDo you want to finish the current game? Press y for yes, n to continue playing.";
s.text += "Your current score now is " + current + "\n";
s.text += "\nDo you want to finish the current game? Press y for yes, n to continue playing.";
Character input = s.print();
while (input != 'y' && input != 'n') {
input = s.print();
Expand All @@ -105,7 +105,7 @@ protected boolean hack(Combatant target, HaxorScreen s) {

@Override
public String validate() {
if (Haxor.singleton.rubies < price) {
if (Haxor.singleton.rubies < price || Javelin.DEBUG) {
/* let the player think he only needs rubies to win the game hihi */
return null;
}
Expand Down

0 comments on commit ae59690

Please sign in to comment.