Commit f5c9e422 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'V3.7' into feature-protocol-bonus

parents 1bbd3158 a6146fa0
...@@ -43,6 +43,8 @@ import cz.nic.tablexia.util.Point; ...@@ -43,6 +43,8 @@ import cz.nic.tablexia.util.Point;
public class SafeMechanicsHard extends AbstractMechanics { public class SafeMechanicsHard extends AbstractMechanics {
private static final int SAFE_POINTER_WIDTH = 50; private static final int SAFE_POINTER_WIDTH = 50;
private static final int SAFE_POINTER_HEIGHT = 250; private static final int SAFE_POINTER_HEIGHT = 250;
private static final int SAFE_PEAK_WIDTH = 398;
private static final int SAFE_PEAK_HEIGHT = 565;
private static final int SAFE_LIGHT_SIZE = 50; private static final int SAFE_LIGHT_SIZE = 50;
private static final int SAFE_LIGHT_OFFSET = 20; private static final int SAFE_LIGHT_OFFSET = 20;
private static final int MIN_POINTER_Y = 130; private static final int MIN_POINTER_Y = 130;
...@@ -58,6 +60,7 @@ public class SafeMechanicsHard extends AbstractMechanics { ...@@ -58,6 +60,7 @@ public class SafeMechanicsHard extends AbstractMechanics {
@Override @Override
void prepare(SafeGame safeGame, SafeSequence safeSequence) { void prepare(SafeGame safeGame, SafeSequence safeSequence) {
Image safePeak = new Image(safeGame.getScreenTextureRegion(SafeAssets.PEAK)); Image safePeak = new Image(safeGame.getScreenTextureRegion(SafeAssets.PEAK));
safePeak.setSize(SAFE_PEAK_WIDTH, SAFE_PEAK_HEIGHT);
safePeak.setPosition(getWidth() / 2 - safePeak.getWidth() / 2, safeGame.getSceneOuterBottomY()); safePeak.setPosition(getWidth() / 2 - safePeak.getWidth() / 2, safeGame.getSceneOuterBottomY());
addActor(safePeak); addActor(safePeak);
......
...@@ -116,7 +116,7 @@ public class SafeAssets { ...@@ -116,7 +116,7 @@ public class SafeAssets {
public static final String MEDIUM_HARD_LIGHT4_GREY = GFX_PATH + LIGHTS + "4grey"; public static final String MEDIUM_HARD_LIGHT4_GREY = GFX_PATH + LIGHTS + "4grey";
//======== SAFE BONUS ============= //======== SAFE BONUS =============
public static final String KNIFE = GFX_PATH + BONUS + "knife"; public static final String TWEEZERS = GFX_PATH + BONUS + "tweezers";
public static final String BOOM = GFX_PATH + BONUS + "boom"; public static final String BOOM = GFX_PATH + BONUS + "boom";
public static final String BONUS_BACKGROUND = GFX_PATH + BONUS + "background"; public static final String BONUS_BACKGROUND = GFX_PATH + BONUS + "background";
......
...@@ -41,6 +41,9 @@ import cz.nic.tablexia.screen.AbstractTablexiaScreen; ...@@ -41,6 +41,9 @@ import cz.nic.tablexia.screen.AbstractTablexiaScreen;
*/ */
public class BonusCableGroup extends Group { public class BonusCableGroup extends Group {
public static final int TWEEZERS_WIDTH = 284;
public static final int TWEEZERS_HEIGHT = 179;
private Image finalSocket; private Image finalSocket;
private SafeGame safeGame; private SafeGame safeGame;
private SafeLightImage lightImage; private SafeLightImage lightImage;
...@@ -115,15 +118,16 @@ public class BonusCableGroup extends Group { ...@@ -115,15 +118,16 @@ public class BonusCableGroup extends Group {
} }
public void cut(SequenceAction sa) { public void cut(SequenceAction sa) {
Image knife = new Image(safeGame.getScreenTextureRegion(SafeAssets.KNIFE)); Image tweezers = new Image(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS));
float knifeXPos = cable.getX() + (cable.getWidth()/2) -knife.getWidth()/2 + 30; tweezers.setSize(TWEEZERS_WIDTH, TWEEZERS_HEIGHT);
float knifeYPos = cable.getY() + cable.getHeight()/2; float tweezersXPos = cable.getX() + cable.getWidth();
knife.setPosition(knifeXPos, knifeYPos); float tweezersYPos = cable.getY() - tweezers.getHeight()/2 + 20;
addActor(knife); tweezers.setPosition(tweezersXPos, tweezersYPos);
addActor(tweezers);
sa.addAction(Actions.sequence(Actions.run(new Runnable() { sa.addAction(Actions.sequence(Actions.run(new Runnable() {
@Override @Override
public void run() { public void run() {
knife.addAction(Actions.moveTo(knifeXPos, knifeYPos - knife.getHeight() - 20, 1f)); tweezers.addAction(Actions.moveTo(tweezersXPos - cable.getWidth()/2, tweezersYPos, 1f));
} }
}), Actions.delay(1f),Actions.run(new Runnable() { }), Actions.delay(1f),Actions.run(new Runnable() {
@Override @Override
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package cz.nic.tablexia.game.games.safe.gameobject; package cz.nic.tablexia.game.games.safe.gameobject;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.games.safe.assets.SafeAssets; import cz.nic.tablexia.game.games.safe.assets.SafeAssets;
public enum BonusCableTypeDefinition { public enum BonusCableTypeDefinition {
...@@ -68,7 +69,8 @@ public enum BonusCableTypeDefinition { ...@@ -68,7 +69,8 @@ public enum BonusCableTypeDefinition {
} }
public float getSocketPercentReduction() { public float getSocketPercentReduction() {
return socketPercentReduction; if (TablexiaSettings.getInstance().isUseHdAssets()) return socketPercentReduction;
return 2*socketPercentReduction;
} }
public String getFinalSocket() { public String getFinalSocket() {
...@@ -76,7 +78,8 @@ public enum BonusCableTypeDefinition { ...@@ -76,7 +78,8 @@ public enum BonusCableTypeDefinition {
} }
public float getFinalSocketPercentReduction() { public float getFinalSocketPercentReduction() {
return finalSocketPercentReduction; if (TablexiaSettings.getInstance().isUseHdAssets()) return finalSocketPercentReduction;
return 2*finalSocketPercentReduction;