diff --git a/configs/compound_tbl.json b/configs/compound_tbl.json index b2d68e7..53db4d0 100644 --- a/configs/compound_tbl.json +++ b/configs/compound_tbl.json @@ -1 +1,82 @@ -[{"id":99001,"type_id":1,"value":6},{"id":99002,"type_id":1,"value":2},{"id":99003,"type_id":2,"value":20},{"id":99004,"type_id":1,"value":2},{"id":99005,"type_id":1,"value":3},{"id":99006,"type_id":1,"value":4},{"id":99007,"type_id":1,"value":12},{"id":99008,"type_id":2,"value":8},{"id":99009,"type_id":2,"value":8},{"id":99010,"type_id":2,"value":15},{"id":99011,"type_id":2,"value":20},{"id":99012,"type_id":2,"value":5},{"id":99013,"type_id":1,"value":5},{"id":99014,"type_id":2,"value":5}] \ No newline at end of file +[ + { + "id": 99001, + "type_id": 1, + "value": 6 + }, + { + "id": 99002, + "type_id": 1, + "value": 2 + }, + { + "id": 99003, + "type_id": 2, + "value": 20 + }, + { + "id": 99004, + "type_id": 1, + "value": 2 + }, + { + "id": 99005, + "type_id": 1, + "value": 3 + }, + { + "id": 99006, + "type_id": 1, + "value": 4 + }, + { + "id": 99007, + "type_id": 1, + "value": 12 + }, + { + "id": 99008, + "type_id": 2, + "value": 8 + }, + { + "id": 99009, + "type_id": 2, + "value": 8 + }, + { + "id": 99010, + "type_id": 2, + "value": 15 + }, + { + "id": 99011, + "type_id": 2, + "value": 20 + }, + { + "id": 99012, + "type_id": 2, + "value": 5 + }, + { + "id": 99013, + "type_id": 1, + "value": 5 + }, + { + "id": 99014, + "type_id": 2, + "value": 5 + }, + { + "id": 99015, + "type_id": 1, + "value": 10 + }, + { + "id": 99016, + "type_id": 1, + "value": 10 + } +] diff --git a/src/cfg/GameEnv.ts b/src/cfg/GameEnv.ts index 06146ac..8b911be 100644 --- a/src/cfg/GameEnv.ts +++ b/src/cfg/GameEnv.ts @@ -30,6 +30,10 @@ export class GameEnv { public maxPlayerPetCount: number; // 结算显示时间 public resultShowTime: number; + // 基本奖励分 + public baseAddScore: number; + // 额外奖励分 + public extraAddScore: number; public init(data: Map) { this.initCardNum = data.get(BaseConst.INIT_CARD_NUM).value; @@ -46,5 +50,7 @@ export class GameEnv { this.roundExtTime = data.get(BaseConst.ROUND_EXT_TIME).value; this.maxPlayerPetCount = data.get(BaseConst.MAX_PLAYER_PET_COUNT).value; this.resultShowTime = data.get(BaseConst.ROUND_SHOW_TIME).value; + this.baseAddScore = data.get(BaseConst.BASE_ADD_SCORE).value; + this.extraAddScore = data.get(BaseConst.EXTRA_ADD_SCORE).value; } } diff --git a/src/constants/BaseConst.ts b/src/constants/BaseConst.ts index 94fabe5..b026dc5 100644 --- a/src/constants/BaseConst.ts +++ b/src/constants/BaseConst.ts @@ -27,6 +27,11 @@ export class BaseConst { public static readonly MAX_PLAYER_PET_COUNT = 99013; // 结算时间 public static readonly ROUND_SHOW_TIME = 99014; + // 基本奖励分 + public static readonly BASE_ADD_SCORE = 99015; + // 额外奖励分 + public static readonly EXTRA_ADD_SCORE = 99016; + public static readonly COMPOUND = "compound"; diff --git a/src/rooms/commands/PartResultCommand.ts b/src/rooms/commands/PartResultCommand.ts index 2441567..e2155ba 100644 --- a/src/rooms/commands/PartResultCommand.ts +++ b/src/rooms/commands/PartResultCommand.ts @@ -6,6 +6,7 @@ import {singleton} from "../../common/Singleton"; import {GameEnv} from "../../cfg/GameEnv"; import {NextTurnCommand} from "./NextTurnCommand"; import {Wait} from "./Wait"; +import {PlayerStateConst} from "../../constants/PlayerStateConst"; /** * 游戏中的结算轮 @@ -16,16 +17,18 @@ export class PartResultCommand extends Command { execute() { this.state.gameState = GameStateConst.STATE_ROUND_RESULT; const time = singleton(GameEnv).resultShowTime || 1; + let team0 = []; let team1 = []; - let team2 = []; for (let [sessionId, player] of this.state.players) { if (player.team == 0) { - team1.push(player); + team0.push(player); } else { - team2.push(player); + team1.unshift(player); } } + + return [new Wait().setPayload(time*1000) ,new NextTurnCommand()]; } diff --git a/src/rooms/commands/SelectPetCommand.ts b/src/rooms/commands/SelectPetCommand.ts index b2811a9..1c815ec 100644 --- a/src/rooms/commands/SelectPetCommand.ts +++ b/src/rooms/commands/SelectPetCommand.ts @@ -6,6 +6,8 @@ import {TurnEndCommand} from "./TurnEndCommand"; import {Player} from "../schema/Player"; import {Card} from "../schema/Card"; import {Pet} from "../schema/Pet"; +import {singleton} from "../../common/Singleton"; +import {GameEnv} from "../../cfg/GameEnv"; /** * 选择随从或者法术 @@ -23,11 +25,44 @@ export class SelectPetCommand extends Command 2) { - moreAp += 10; + if (count === 3) { + moreAp += singleton(GameEnv).baseAddScore; + } else if (count > 3) { + moreAp += singleton(GameEnv).extraAddScore; } if (card.id == cardId) { targetCard = card; @@ -36,16 +71,15 @@ export class SelectPetCommand extends Command