up version
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"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",
|
||||||
|
|||||||
@@ -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