up version
This commit is contained in:
46
package.json
46
package.json
@@ -1,25 +1,25 @@
|
||||
{
|
||||
"name": "tankz",
|
||||
"version": "0.8.7",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"dateformat": "^3.0.3",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-add": "0.0.2",
|
||||
"gulp-clean": "^0.4.0",
|
||||
"gulp-haxetool": "^0.0.16"
|
||||
},
|
||||
"haxeDependencies": {
|
||||
"haxework": "git@bitbucket.org:shmyga/haxework.git",
|
||||
"lime": "7.2.1",
|
||||
"openfl": "8.8.0",
|
||||
"hxcpp": "4.0.8",
|
||||
"promhx": "1.1.0",
|
||||
"protohx": "0.4.6",
|
||||
"yaml": "1.3.0",
|
||||
"orm": "2.1.0",
|
||||
"yield": "2.0.0",
|
||||
"haxe-crypto": "0.0.7",
|
||||
"svg": "1.1.2"
|
||||
}
|
||||
"name": "tankz",
|
||||
"version": "0.8.8",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"dateformat": "^3.0.3",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-add": "0.0.2",
|
||||
"gulp-clean": "^0.4.0",
|
||||
"gulp-haxetool": "^0.0.16"
|
||||
},
|
||||
"haxeDependencies": {
|
||||
"haxework": "git@bitbucket.org:shmyga/haxework.git",
|
||||
"lime": "7.2.1",
|
||||
"openfl": "8.8.0",
|
||||
"hxcpp": "4.0.8",
|
||||
"promhx": "1.1.0",
|
||||
"protohx": "0.4.6",
|
||||
"yaml": "1.3.0",
|
||||
"orm": "2.1.0",
|
||||
"yield": "2.0.0",
|
||||
"haxe-crypto": "0.0.7",
|
||||
"svg": "1.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import ru.m.tankz.preset.DotaGame;
|
||||
var tankType = playerConfig.tanks[0].type;
|
||||
var tankConfig = resultState.config.getTank(tankType);
|
||||
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.score = player.score;
|
||||
return view;
|
||||
|
||||
@@ -75,7 +75,7 @@ class GameFrame extends GroupView {
|
||||
|
||||
public function onGameComplete(state:GameState):Void {
|
||||
result = state;
|
||||
state = switch game.next() {
|
||||
this.state = switch game.next() {
|
||||
case Some(s): s;
|
||||
case None: null;
|
||||
}
|
||||
|
||||
@@ -82,19 +82,6 @@ class Game extends GameDispatcher {
|
||||
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 {
|
||||
var player = getPlayer(task.playerId);
|
||||
var tankType:TankType = if (task.tankType != null) {
|
||||
@@ -106,7 +93,7 @@ class Game extends GameDispatcher {
|
||||
}
|
||||
var tankConfig:TankConfig = config.getTank(tankType);
|
||||
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;
|
||||
applyPoint(tank, task.point);
|
||||
if (player.config.protect > 0) {
|
||||
|
||||
@@ -53,7 +53,7 @@ class GameState {
|
||||
|
||||
@: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.presetId = presetId;
|
||||
this.level = level;
|
||||
@@ -114,4 +114,9 @@ class GameState {
|
||||
}
|
||||
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