up version
This commit is contained in:
46
package.json
46
package.json
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "tankz",
|
"name": "tankz",
|
||||||
"version": "0.8.7",
|
"version": "0.8.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dateformat": "^3.0.3",
|
"dateformat": "^3.0.3",
|
||||||
"gulp": "^4.0.0",
|
"gulp": "^4.0.0",
|
||||||
"gulp-add": "0.0.2",
|
"gulp-add": "0.0.2",
|
||||||
"gulp-clean": "^0.4.0",
|
"gulp-clean": "^0.4.0",
|
||||||
"gulp-haxetool": "^0.0.16"
|
"gulp-haxetool": "^0.0.16"
|
||||||
},
|
},
|
||||||
"haxeDependencies": {
|
"haxeDependencies": {
|
||||||
"haxework": "git@bitbucket.org:shmyga/haxework.git",
|
"haxework": "git@bitbucket.org:shmyga/haxework.git",
|
||||||
"lime": "7.2.1",
|
"lime": "7.2.1",
|
||||||
"openfl": "8.8.0",
|
"openfl": "8.8.0",
|
||||||
"hxcpp": "4.0.8",
|
"hxcpp": "4.0.8",
|
||||||
"promhx": "1.1.0",
|
"promhx": "1.1.0",
|
||||||
"protohx": "0.4.6",
|
"protohx": "0.4.6",
|
||||||
"yaml": "1.3.0",
|
"yaml": "1.3.0",
|
||||||
"orm": "2.1.0",
|
"orm": "2.1.0",
|
||||||
"yield": "2.0.0",
|
"yield": "2.0.0",
|
||||||
"haxe-crypto": "0.0.7",
|
"haxe-crypto": "0.0.7",
|
||||||
"svg": "1.1.2"
|
"svg": "1.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import ru.m.tankz.preset.DotaGame;
|
|||||||
var tankType = playerConfig.tanks[0].type;
|
var tankType = playerConfig.tanks[0].type;
|
||||||
var tankConfig = resultState.config.getTank(tankType);
|
var tankConfig = resultState.config.getTank(tankType);
|
||||||
view.tank = tankConfig == null ? 'ba' : tankConfig.skin;
|
view.tank = tankConfig == null ? 'ba' : tankConfig.skin;
|
||||||
view.color = resultState.config.getColor(player.id);
|
view.color = resultState.getPlayerColor(player.id);
|
||||||
view.life = player.frags;
|
view.life = player.frags;
|
||||||
view.score = player.score;
|
view.score = player.score;
|
||||||
return view;
|
return view;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class GameFrame extends GroupView {
|
|||||||
|
|
||||||
public function onGameComplete(state:GameState):Void {
|
public function onGameComplete(state:GameState):Void {
|
||||||
result = state;
|
result = state;
|
||||||
state = switch game.next() {
|
this.state = switch game.next() {
|
||||||
case Some(s): s;
|
case Some(s): s;
|
||||||
case None: null;
|
case None: null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,19 +82,6 @@ class Game extends GameDispatcher {
|
|||||||
return teams[playerId.team].players[playerId.index];
|
return teams[playerId.team].players[playerId.index];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPlayerColor(playerId:PlayerId):Color {
|
|
||||||
var player = getPlayer(playerId);
|
|
||||||
var team = getTeam(playerId.team);
|
|
||||||
var color = team.config.color;
|
|
||||||
if (!player.config.color.zero) {
|
|
||||||
color = player.config.color;
|
|
||||||
}
|
|
||||||
if (!player.state.color.zero) {
|
|
||||||
color = player.state.color;
|
|
||||||
}
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function buildTank(task:SpawnTask):Tank {
|
private function buildTank(task:SpawnTask):Tank {
|
||||||
var player = getPlayer(task.playerId);
|
var player = getPlayer(task.playerId);
|
||||||
var tankType:TankType = if (task.tankType != null) {
|
var tankType:TankType = if (task.tankType != null) {
|
||||||
@@ -106,7 +93,7 @@ class Game extends GameDispatcher {
|
|||||||
}
|
}
|
||||||
var tankConfig:TankConfig = config.getTank(tankType);
|
var tankConfig:TankConfig = config.getTank(tankType);
|
||||||
var tank = new Tank(task.playerId, tankConfig);
|
var tank = new Tank(task.playerId, tankConfig);
|
||||||
tank.color = getPlayerColor(player.id);
|
tank.color = state.getPlayerColor(player.id);
|
||||||
tank.bonus = Math.random() < player.config.bonus;
|
tank.bonus = Math.random() < player.config.bonus;
|
||||||
applyPoint(tank, task.point);
|
applyPoint(tank, task.point);
|
||||||
if (player.config.protect > 0) {
|
if (player.config.protect > 0) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class GameState {
|
|||||||
|
|
||||||
@:provide private var configBundle:IConfigBundle;
|
@:provide private var configBundle:IConfigBundle;
|
||||||
|
|
||||||
public function new(type:GameType, presetId:PresetId, level:Int = 1, state:GameState = null) {
|
public function new(type:GameType, presetId:PresetId, level:Int = 0, state:GameState = null) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.presetId = presetId;
|
this.presetId = presetId;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
@@ -114,4 +114,9 @@ class GameState {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPlayerColor(id:PlayerId):Color {
|
||||||
|
var playerState = players[id];
|
||||||
|
return playerState == null || playerState.color.zero ? config.getColor(id) : playerState.color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user