Commit b3313042 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'V3.7' into feature-protocol-wall-position

parents c9508b67 cc32f3aa
...@@ -88,6 +88,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp ...@@ -88,6 +88,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
public static final String PLAYER = "player"; public static final String PLAYER = "player";
public static final String EVENT_SHOW_ANIMATION_FINISHED = "show animation finished"; public static final String EVENT_SHOW_ANIMATION_FINISHED = "show animation finished";
public static final String EVENT_SHOW_OTHER_FLOOR = "show other floor";
public enum GameLayer { public enum GameLayer {
...@@ -191,7 +192,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp ...@@ -191,7 +192,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
private final int START_TILE_OFFSET_X = 1; private final int START_TILE_OFFSET_X = 1;
private final int START_TILE_OFFSET_Y = 2; private final int START_TILE_OFFSET_Y = 2;
private static final String BOOKMARK_FLOOR_TEXT_KEY = "floor"; public static final String BOOKMARK_FLOOR_TEXT_KEY = "floor";
private static final String SCORE0_TEXT_KEY = "score_0"; private static final String SCORE0_TEXT_KEY = "score_0";
private static final String SCORE1_TEXT_KEY = "score_1"; private static final String SCORE1_TEXT_KEY = "score_1";
private static final String SCORE2_TEXT_KEY = "score_2"; private static final String SCORE2_TEXT_KEY = "score_2";
...@@ -684,6 +685,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp ...@@ -684,6 +685,7 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
} }
} }
GameLayer.PLAYER_LAYER.getLayerEntity().setVisible(player.getActualFloor() == mapWidgetNumber); GameLayer.PLAYER_LAYER.getLayerEntity().setVisible(player.getActualFloor() == mapWidgetNumber);
triggerScenarioStepEvent(EVENT_SHOW_OTHER_FLOOR);
} }
@Override @Override
......
...@@ -135,6 +135,7 @@ public class MapWidget extends Group { ...@@ -135,6 +135,7 @@ public class MapWidget extends Group {
} }
} }
}); });
bookmarkButton.setName((floorNumber + 1) + " " + InTheDarknessGame.BOOKMARK_FLOOR_TEXT_KEY);
backgroundLayer.addActor(bookmarkButton); backgroundLayer.addActor(bookmarkButton);
} }
......
...@@ -48,6 +48,7 @@ public class GameRulesHelper { ...@@ -48,6 +48,7 @@ public class GameRulesHelper {
public static final float BONUS_MAX_LID_TIME = 2.5f; public static final float BONUS_MAX_LID_TIME = 2.5f;
public static final float BONUS_MIN_LID_TIME = 1.2f; public static final float BONUS_MIN_LID_TIME = 1.2f;
public static final int NUMBER_OF_ROUNDS = 12; public static final int NUMBER_OF_ROUNDS = 12;
public static final int BONUS_NUMBER_OF_ROUNDS = 20;
public static final int[] ZERO_NUMBER_OF_SHADOWED = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; public static final int[] ZERO_NUMBER_OF_SHADOWED = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
public static float getCurrentLidTime(NightWatchDifficulty nightWatchDifficulty, int currentRound){ public static float getCurrentLidTime(NightWatchDifficulty nightWatchDifficulty, int currentRound){
......
...@@ -30,8 +30,10 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; ...@@ -30,8 +30,10 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import java.util.List; import java.util.List;
import cz.nic.tablexia.game.games.safe.AbstractMechanics;
import cz.nic.tablexia.game.games.safe.SafeGame; import cz.nic.tablexia.game.games.safe.SafeGame;
import cz.nic.tablexia.game.games.safe.assets.SafeAssets; import cz.nic.tablexia.game.games.safe.assets.SafeAssets;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
/** /**
...@@ -80,6 +82,7 @@ public class BonusCableGroup extends Group { ...@@ -80,6 +82,7 @@ public class BonusCableGroup extends Group {
@Override @Override
public void clicked(InputEvent event, float x, float y) { public void clicked(InputEvent event, float x, float y) {
safeGame.setSelectedLight(lightImage, listOfLights, true); safeGame.setSelectedLight(lightImage, listOfLights, true);
AbstractTablexiaScreen.triggerScenarioStepEvent(AbstractMechanics.LIGHT_LIGHTED_UP);
} }
}); });
lightImage.addListener(lightImage.getInputListener()); lightImage.addListener(lightImage.getInputListener());
......
...@@ -23,6 +23,10 @@ TestGameShootingRangeHardNoneStar ...@@ -23,6 +23,10 @@ TestGameShootingRangeHardNoneStar
TestGameShootingRangeHardOneStar TestGameShootingRangeHardOneStar
TestGameShootingRangeHardTwoStar TestGameShootingRangeHardTwoStar
TestGameShootingRangeHardThreeStar TestGameShootingRangeHardThreeStar
TestGameShootingRangeBonusNoneStar
TestGameShootingRangeBonusOneStar
TestGameShootingRangeBonusTwoStar
TestGameShootingRangeBonusThreeStar
TestGameRobberyEasyNoneStar TestGameRobberyEasyNoneStar
TestGameRobberyEasyOneStar TestGameRobberyEasyOneStar
TestGameRobberyEasyTwoStar TestGameRobberyEasyTwoStar
...@@ -35,12 +39,18 @@ TestGameRobberyHardNoneStar ...@@ -35,12 +39,18 @@ TestGameRobberyHardNoneStar
TestGameRobberyHardOneStar TestGameRobberyHardOneStar
TestGameRobberyHardTwoStar TestGameRobberyHardTwoStar
TestGameRobberyHardThreeStar TestGameRobberyHardThreeStar
TestGameRobberyBonusNoneStar
TestGameRobberyBonusOneStar
TestGameRobberyBonusTwoStars
TestGameRobberyBonusThreeStars
TestGameInTheDarknessEasy TestGameInTheDarknessEasy
TestGameInTheDarknessMedium TestGameInTheDarknessMedium
TestGameInTheDarknessHard TestGameInTheDarknessHard
TestGameInTheDarknessBonus
TestGameInTheDarknessEasyScenario TestGameInTheDarknessEasyScenario
TestGameInTheDarknessMediumScenario TestGameInTheDarknessMediumScenario
TestGameInTheDarknessHardScenario TestGameInTheDarknessHardScenario
TestGameInTheDarknessBonusScenario
TestGameNightWatchEasyNoneStar TestGameNightWatchEasyNoneStar
TestGameNightWatchEasyOneStar TestGameNightWatchEasyOneStar
TestGameNightWatchEasyTwoStar TestGameNightWatchEasyTwoStar
...@@ -53,6 +63,10 @@ TestGameNightWatchHardNoneStar ...@@ -53,6 +63,10 @@ TestGameNightWatchHardNoneStar
TestGameNightWatchHardOneStar TestGameNightWatchHardOneStar
TestGameNightWatchHardTwoStar TestGameNightWatchHardTwoStar
TestGameNightWatchHardThreeStar TestGameNightWatchHardThreeStar
TestGameNightWatchBonusNoneStar
TestGameNightWatchBonusOneStar
TestGameNightWatchBonusTwoStars
TestGameNightWatchBonusThreeStars
TestGamePursuitEasyNoneStar TestGamePursuitEasyNoneStar
TestGamePursuitEasyOneStar TestGamePursuitEasyOneStar
TestGamePursuitEasyTwoStar TestGamePursuitEasyTwoStar
...@@ -65,6 +79,10 @@ TestGamePursuitHardNoneStar ...@@ -65,6 +79,10 @@ TestGamePursuitHardNoneStar
TestGamePursuitHardOneStar TestGamePursuitHardOneStar
TestGamePursuitHardTwoStar TestGamePursuitHardTwoStar
TestGamePursuitHardThreeStar TestGamePursuitHardThreeStar
TestGamePursuitBonusNoneStar
TestGamePursuitBonusOneStar
TestGamePursuitBonusTwoStars
TestGamePursuitBonusThreeStars
TestGameCrimeSceneEasyNoneStar TestGameCrimeSceneEasyNoneStar
TestGameCrimeSceneEasyOneStar TestGameCrimeSceneEasyOneStar
TestGameCrimeSceneEasyTwoStar TestGameCrimeSceneEasyTwoStar
...@@ -77,6 +95,10 @@ TestGameCrimeSceneHardNoneStar ...@@ -77,6 +95,10 @@ TestGameCrimeSceneHardNoneStar
TestGameCrimeSceneHardOneStar TestGameCrimeSceneHardOneStar
TestGameCrimeSceneHardTwoStar TestGameCrimeSceneHardTwoStar
TestGameCrimeSceneHardThreeStar TestGameCrimeSceneHardThreeStar
TestGameCrimeSceneBonusNoneStar
TestGameCrimeSceneBonusOneStar
TestGameCrimeSceneBonusTwoStar
TestGameCrimeSceneBonusThreeStar
TestGameKidnappingEasyNoneStar TestGameKidnappingEasyNoneStar
TestGameKidnappingEasyOneStar TestGameKidnappingEasyOneStar
TestGameKidnappingEasyTwoStar TestGameKidnappingEasyTwoStar
...@@ -89,6 +111,10 @@ TestGameKidnappingHardNoneStar ...@@ -89,6 +111,10 @@ TestGameKidnappingHardNoneStar
TestGameKidnappingHardOneStar TestGameKidnappingHardOneStar
TestGameKidnappingHardTwoStar TestGameKidnappingHardTwoStar
TestGameKidnappingHardThreeStar TestGameKidnappingHardThreeStar
TestGameKidnappingBonusNoneStar
TestGameKidnappingBonusOneStar
TestGameKidnappingBonusTwoStars
TestGameKidnappingBonusThreeStars
TestGameRunesEasyNoneStar TestGameRunesEasyNoneStar
TestGameRunesEasyOneStar TestGameRunesEasyOneStar
TestGameRunesEasyTwoStar TestGameRunesEasyTwoStar
...@@ -101,6 +127,10 @@ TestGameRunesHardNoneStar ...@@ -101,6 +127,10 @@ TestGameRunesHardNoneStar
TestGameRunesHardOneStar TestGameRunesHardOneStar
TestGameRunesHardTwoStar TestGameRunesHardTwoStar
TestGameRunesHardThreeStar TestGameRunesHardThreeStar
TestGameRunesBonusNoneStar
TestGameRunesBonusOneStar
TestGameRunesBonusTwoStars
TestGameRunesBonusThreeStars
TestGameProtocolEasyNoneStar <--This test could fail TestGameProtocolEasyNoneStar <--This test could fail
TestGameProtocolEasyOneStar TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar TestGameProtocolEasyTwoStar
...@@ -125,6 +155,10 @@ TestGameSafeHardNoneStars ...@@ -125,6 +155,10 @@ TestGameSafeHardNoneStars
TestGameSafeHardOneStar TestGameSafeHardOneStar
TestGameSafeHardTwoStars TestGameSafeHardTwoStars
TestGameSafeHardThreeStars TestGameSafeHardThreeStars
TestGameSafeBonusNoneStars
TestGameSafeBonusOneStars
TestGameSafeBonusTwoStars
TestGameSafeBonusThreeStars
TestStatisticsButtons TestStatisticsButtons
TestStatisticsRobbery TestStatisticsRobbery
TestStatisticsCrimeScene TestStatisticsCrimeScene
......
...@@ -99,6 +99,7 @@ public class TestGameCrimeScene extends AbstractTestGame { ...@@ -99,6 +99,7 @@ public class TestGameCrimeScene extends AbstractTestGame {
clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM); clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM);
clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD); clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD);
clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY); clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY);
clickAt(incGetSteps() + ". Click at bonus difficulty button", GamePageGroup.DIFFICULTY_BUTTON_BONUS);
//setDifficulty //setDifficulty
setGameDificulty(); setGameDificulty();
......
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.in_the_darkness;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameInTheDarknessBonus extends TestGameInTheDarkness {
public TestGameInTheDarknessBonus(Tablexia tablexia) {
super(tablexia);
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
difficulty = GameDifficulty.BONUS;
haveScenario = false;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.in_the_darkness;
import java.util.Arrays;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.game.games.in_the_darkness.action.InTheDarknessActionType;
public class TestGameInTheDarknessBonusScenario extends TestGameInTheDarkness {
public TestGameInTheDarknessBonusScenario(Tablexia tablexia) {
super(tablexia);
TablexiaSettings.GAMES_RANDOM_SEED = 1537270739566L;
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
exceptedFail = 0;
haveScenario = true;
initSteps();
}
private void initSteps(){
scenarioSteps.put(0, Arrays.asList(new InTheDarknessActionType[]{
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.KEY,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.STAIRS,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.LEFT,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.GO,
InTheDarknessActionType.RIGHT,
InTheDarknessActionType.GO,
}));
}
}
...@@ -89,6 +89,7 @@ public class TestGameKidnapping extends AbstractTestGame { ...@@ -89,6 +89,7 @@ public class TestGameKidnapping extends AbstractTestGame {
clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM); clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM);
clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD); clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD);
clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY); clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY);
clickAt(incGetSteps() + ". Click at bonus difficulty button", GamePageGroup.DIFFICULTY_BUTTON_BONUS);
//setDifficulty //setDifficulty
setGameDificulty(); setGameDificulty();
......
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusNoneStar extends TestGameKidnapping {
public TestGameKidnappingBonusNoneStar(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.NO_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusOneStar extends TestGameKidnapping {
public TestGameKidnappingBonusOneStar(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.ONE_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusThreeStars extends TestGameKidnapping {
public TestGameKidnappingBonusThreeStars(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.THREE_STAR;
}
}
/*
* Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cz.nic.tablexia.testing.games.kidnapping;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
public class TestGameKidnappingBonusTwoStars extends TestGameKidnapping {
public TestGameKidnappingBonusTwoStars(Tablexia tablexia) {
super(tablexia);
difficulty = GameDifficulty.BONUS;
expectedResult = AbstractTablexiaGame.GameResult.TWO_STAR;
}
}
...@@ -89,6 +89,7 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -89,6 +89,7 @@ public class TestGameNightWatch extends AbstractTestGame {
clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM); clickAt(incGetSteps() + ". Click at medium difficulty button", GamePageGroup.DIFFICULTY_BUTTON_MEDIUM);
clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD); clickAt(incGetSteps() + ". Click at hard difficulty button", GamePageGroup.DIFFICULTY_BUTTON_HARD);
clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY); clickAt(incGetSteps() + ". Click at easy difficulty button", GamePageGroup.DIFFICULTY_BUTTON_EASY);
clickAt(incGetSteps() + ". Click at bonus difficulty button", GamePageGroup.DIFFICULTY_BUTTON_BONUS);
//setDifficulty //setDifficulty
setGameDificulty(); setGameDificulty();
...@@ -131,7 +132,9 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -131,7 +132,9 @@ public class TestGameNightWatch extends AbstractTestGame {
List<Pair<Integer, Integer>> windowPositions = getWindowsPositionsByDif(difficulty); List<Pair<Integer, Integer>> windowPositions = getWindowsPositionsByDif(difficulty);
for(int i=0;i< GameRulesHelper.NUMBER_OF_ROUNDS;i++){ int numberOfRounds = (difficulty == GameDifficulty.BONUS) ? GameRulesHelper.BONUS_NUMBER_OF_ROUNDS : GameRulesHelper.NUMBER_OF_ROUNDS;
for(int i=0;i< numberOfRounds;i++){
waitForEvent(incGetSteps() + ". Wait for new day event", NightWatchGame.EVENT_NEW_DAY +i); waitForEvent(incGetSteps() + ". Wait for new day event", NightWatchGame.EVENT_NEW_DAY +i);
//play round //play round
Solution solution = NightWatchGame.lastSolution; Solution solution = NightWatchGame.lastSolution;
...@@ -178,7 +181,7 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -178,7 +181,7 @@ public class TestGameNightWatch extends AbstractTestGame {
break; break;
} }
if(i != GameRulesHelper.NUMBER_OF_ROUNDS-1) { if(i != numberOfRounds-1) {
waitForEvent(incGetSteps() + ". Wait for evaluate round event",NightWatchGame.EVENT_EVALUATE_ROUND+i); waitForEvent(incGetSteps() + ". Wait for evaluate round event",NightWatchGame.EVENT_EVALUATE_ROUND+i);
waitForEvent(incGetSteps() + ". Wait for new night event", NightWatchGame.EVENT_NEW_NIGHT + i); waitForEvent(incGetSteps() + ". Wait for new night event", NightWatchGame.EVENT_NEW_NIGHT + i);
} }
...@@ -213,12 +216,19 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -213,12 +216,19 @@ public class TestGameNightWatch extends AbstractTestGame {
} }
private boolean doMistake(){ private boolean doMistake(){
if(difficulty == GameDifficulty.BONUS){
if(expectedResult == AbstractTablexiaGame.GameResult.TWO_STAR && playedRound >= NightWatchScoreResolver_V3_4.BONUS_SCORE_THREE_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS -1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.ONE_STAR && playedRound >= NightWatchScoreResolver_V3_4.BONUS_SCORE_TWO_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS-1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.NO_STAR && playedRound >= NightWatchScoreResolver_V3_4.BONUS_SCORE_ONE_STAR_V3_4-NightWatchGame.MAX_GAME_ERRORS-1) { return true;}
if(expectedResult == AbstractTablexiaGame.GameResult.TWO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS -1){ return true;} return false;
else if(expectedResult == AbstractTablexiaGame.GameResult.ONE_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS-1){ return true;} } else {
else if(expectedResult == AbstractTablexiaGame.GameResult.NO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4-NightWatchGame.MAX_GAME_ERRORS-1) { return true;} if(expectedResult == AbstractTablexiaGame.GameResult.TWO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS -1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.ONE_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4 -NightWatchGame.MAX_GAME_ERRORS-1){ return true;}
else if(expectedResult == AbstractTablexiaGame.GameResult.NO_STAR && playedRound >= NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4-NightWatchGame.MAX_GAME_ERRORS-1) { return true;}
return false; return false;
}
} }
private void clickWindowsByIndex(int index, Stage stage, List<Pair<Integer, Integer>> windowPositions){ private void clickWindowsByIndex(int index, Stage stage, List<Pair<Integer, Integer>> windowPositions){
...@@ -238,7 +248,6 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -238,7 +248,6 @@ public class TestGameNightWatch extends AbstractTestGame {
} }
if(isSelectedWindowVisible(index,stage)){ if(isSelectedWindowVisible(index,stage)){
logOK();
waitForEvent(incGetSteps() + ". Wait for window selected event",NightWatchGame.EVENT_WINDOW_SELECTED+index); waitForEvent(incGetSteps() + ". Wait for window selected event",NightWatchGame.EVENT_WINDOW_SELECTED+index);
}else{ }else{
writeToLogFile("Window not selected [TRY NEXT]\n"); writeToLogFile("Window not selected [TRY NEXT]\n");
...@@ -295,6 +304,8 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -295,6 +304,8 @@ public class TestGameNightWatch extends AbstractTestGame {
private List<Pair<Integer, Integer>> getWindowsPositionsByDif(GameDifficulty difficulty){ private List<Pair<Integer, Integer>> getWindowsPositionsByDif(GameDifficulty difficulty){
switch (difficulty){ switch (difficulty){
case BONUS:
return TextureHelper.testThirtyTwoWindowsPositions;
case HARD: case HARD:
return TextureHelper.testThirtyTwoWindowsPositions; return TextureHelper.testThirtyTwoWindowsPositions;
case MEDIUM: case MEDIUM:
...@@ -307,8 +318,9 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -307,8 +318,9 @@ public class TestGameNightWatch extends AbstractTestGame {
@Override @Override
protected void checkVictoryTable(int daoScore, Table table) { protected void checkVictoryTable(int daoScore, Table table) {
if(!checkScoreInTable(table,Integer.toString(daoScore) + " / " + GameRulesHelper.NUMBER_OF_ROUNDS)){ int numberOfRounds = (difficulty == GameDifficulty.BONUS) ? GameRulesHelper.BONUS_NUMBER_OF_ROUNDS : GameRulesHelper.NUMBER_OF_ROUNDS;
logError("Not found label in " + AbstractTablexiaGame.RESULT_TABLE+ " with correct dao score: " + Integer.toString(daoScore) + " / " + GameRulesHelper.NUMBER_OF_ROUNDS); if(!checkScoreInTable(table,Integer.toString(daoScore) + " / " + numberOfRounds)){
logError("Not found label in " + AbstractTablexiaGame.RESULT_TABLE+ " with correct dao score: " + Integer.toString(daoScore) + " / " + numberOfRounds);
stopTheTest(); stopTheTest();
} }
} }
...@@ -324,10 +336,17 @@ public class TestGameNightWatch extends AbstractTestGame { ...@@ -324,10 +336,17 @@ public class TestGameNightWatch extends AbstractTestGame {
@Override @Override
protected int getCubsCount() { protected int getCubsCount() {
if (playedRound > NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4) return 3; if(difficulty == GameDifficulty.BONUS){
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4) return 2; if (playedRound > NightWatchScoreResolver_V3_4.BONUS_SCORE_THREE_STARS_V3_4) return 3;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4) return 1; else if (playedRound > NightWatchScoreResolver_V3_4.BONUS_SCORE_TWO_STARS_V3_4) return 2;
return 0; else if (playedRound > NightWatchScoreResolver_V3_4.BONUS_SCORE_ONE_STAR_V3_4) return 1;
return 0;
} else {
if (playedRound > NightWatchScoreResolver_V3_4.SCORE_THREE_STARS_V3_4) return 3;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_TWO_STARS_V3_4) return 2;
else if (playedRound > NightWatchScoreResolver_V3_4.SCORE_ONE_STAR_V3_4) return 1;
return 0;
}
} }
@Override @Override
......