diff --git a/game-server/app/services/guildActivityObjService.ts b/game-server/app/services/guildActivityObjService.ts index 163618df9..3055218d3 100644 --- a/game-server/app/services/guildActivityObjService.ts +++ b/game-server/app/services/guildActivityObjService.ts @@ -246,8 +246,9 @@ export class RaceActivityObject { if(this.status == 1) { // TODO 写进const表 let item = getRaceEventItems(); this.handleItems(roleId, sid, item); + this.woodenHorseStartRace(woodenHorse); } - return woodenHorse; + return await this.getWoodenHorse(guildCode, serverId); } // 获取某个军团的木马状态 @@ -259,9 +260,6 @@ export class RaceActivityObject { let { name: guildName, guildCe } = guild; this.woodenHorses.set(guildCode, new WoodenHorse(guildCode, guildName, guildCe, serverId)); this.guildList.push({guildCode, serverId}); - if(this.status == 1) { // TODO 写进const表 - this.woodenHorseStartRace(this.woodenHorses.get(guildCode)); - } } let woodenHorse = this.woodenHorses.get(guildCode); let events = this.events.get(guildCode)||[]; @@ -298,8 +296,10 @@ export class RaceActivityObject { this.status = 1; // TODO 写进const表 let guildCodes = new Array(); for(let [code, woodenHorse] of this.woodenHorses) { - this.woodenHorseStartRace(woodenHorse); - guildCodes.push(code); + if(woodenHorse.memberCnt > 0) { + this.woodenHorseStartRace(woodenHorse); + guildCodes.push(code); + } } return guildCodes; } diff --git a/shared/domain/battleField/guildActivity.ts b/shared/domain/battleField/guildActivity.ts index e3fb3f5ff..048dd75d3 100644 --- a/shared/domain/battleField/guildActivity.ts +++ b/shared/domain/battleField/guildActivity.ts @@ -104,18 +104,24 @@ export class WoodenHorse { if(event.endDistance && event.startDistance == event.endDistance) { isEffective = true; } - delEvents.push(i); + + let index = events.findIndex(cur => cur.id == event.id); + events.splice(index, 1); } if(isEffective) { effectiveEvents.push(event); } } - for(let i of delEvents) events.splice(i, 1); // 删除过期事件 + effectiveEvents.sort((a, b) => a.startTime - b.startTime); this.speed = GUILDACTIVITY.RACE_INIT_SPEED + this.memberCnt * GUILDACTIVITY.RACE_PER_SPEED; for(let { id, count, endTime } of effectiveEvents) { this.calEvent(id, count, endTime); } + if(this.durability <= 0) { + this.status = 0; // TODO 写进const表 + this.speed = 0; + } console.log('**effect', this.speed, JSON.stringify(effectiveEvents)); return false; } @@ -182,10 +188,6 @@ export class WoodenHorse { } break; } - if(this.durability <= 0) { - this.status = 0; // TODO 写进const表 - this.speed = 0; - } } diff --git a/shared/resource/jsons/dic_zyz_raceActivity.json b/shared/resource/jsons/dic_zyz_raceActivity.json index ee013e085..16a90e433 100644 --- a/shared/resource/jsons/dic_zyz_raceActivity.json +++ b/shared/resource/jsons/dic_zyz_raceActivity.json @@ -5,10 +5,13 @@ "info": "每个造成0.2%的耐久度伤害", "type": 0, "effectType": 0, - "effect": "0.2&", + "effect": "5&", "continueTime": 0, "continueDistance": 0, - "effecttime": 5 + "effecttime": 5, + "effectinfo": "遭受诸葛连弩袭击", + "object": 2, + "useCount": "5&10" }, { "id": 2, @@ -19,7 +22,10 @@ "effect": "5&", "continueTime": 5, "continueDistance": 0, - "effecttime": 5 + "effecttime": 5, + "effectinfo": "遭遇鬼手戏弄,木牛流马无法移动。", + "object": 2, + "useCount": "1&" }, { "id": 3, @@ -30,7 +36,10 @@ "effect": "2&5", "continueTime": 5, "continueDistance": 0, - "effecttime": 5 + "effecttime": 5, + "effectinfo": "大风车吱呀直溜溜地转", + "object": 1, + "useCount": "5&10" }, { "id": 4, @@ -41,7 +50,10 @@ "effect": "40&5", "continueTime": 5, "continueDistance": 0, - "effecttime": 5 + "effecttime": 5, + "effectinfo": "五鬼搬运,千里无踪。万钧之物,不过只手。", + "object": 1, + "useCount": "1&" }, { "id": 5, @@ -52,7 +64,10 @@ "effect": "20&", "continueTime": 0, "continueDistance": 0, - "effecttime": 5 + "effecttime": 5, + "effectinfo": "大盾防护", + "object": 1, + "useCount": "1&" }, { "id": 6, @@ -63,7 +78,10 @@ "effect": "10&", "continueTime": 10, "continueDistance": 0, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "天师护盾,道法神威,万邪莫侵,无懈可击", + "object": 1, + "useCount": "1&" }, { "id": 7, @@ -74,7 +92,10 @@ "effect": "20&", "continueTime": 0, "continueDistance": 100, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "路上捡到了神秘符纸,使用后速度更上一层楼", + "object": 3, + "useCount": "&" }, { "id": 8, @@ -85,7 +106,10 @@ "effect": "1.5&", "continueTime": 0, "continueDistance": 100, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "将士饱餐一顿,士气高昂,不再沿途休息", + "object": 3, + "useCount": "&" }, { "id": 9, @@ -96,7 +120,10 @@ "effect": "15&", "continueTime": 0, "continueDistance": 0, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "路遇巧匠,能工修补,破损的木牛流马得到了修复", + "object": 3, + "useCount": "&" }, { "id": 10, @@ -107,7 +134,10 @@ "effect": "20&", "continueTime": 0, "continueDistance": 100, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "蜀道泥泞,难以通行,不得不降低速度", + "object": 3, + "useCount": "&" }, { "id": 11, @@ -118,7 +148,10 @@ "effect": "1.5&", "continueTime": 0, "continueDistance": 100, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "栈道被人破坏,只能降低速度,派人在前修路,速度降低", + "object": 3, + "useCount": "&" }, { "id": 12, @@ -129,7 +162,10 @@ "effect": "25&", "continueTime": 0, "continueDistance": 0, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "山上巨石突然滑动,掉落而下造成木牛流马损伤", + "object": 3, + "useCount": "&" }, { "id": 13, @@ -140,6 +176,9 @@ "effect": "&", "continueTime": 0, "continueDistance": 0, - "effecttime": 0 + "effecttime": 0, + "effectinfo": "丞相贴心,居然在沿路设有道具补给", + "object": 3, + "useCount": "&" } ] \ No newline at end of file