军团活动:粮草先行优化

This commit is contained in:
luying
2022-07-05 18:55:00 +08:00
parent 2a9fccf59f
commit 061a63d4ea
6 changed files with 124 additions and 76 deletions

View File

@@ -310,7 +310,7 @@ export enum RACE_ACTIVITY_STATUS {
WAITING = 0, // 未开始
START = 1, // 已开始
END = 2, // 已结束
PAUSE = 3, // 暂停
BREAK = 3, // 爆破
}
export const CITY_ACTIVITY_DOOR = 1047;

View File

@@ -89,17 +89,17 @@ export class WoodenHorse {
shield: number = 0; // 护盾数量
@prop({required: true})
shieldTime: number = 0; // 天师盾符
@prop({required: true})
stopContinueTime: number = 0; // 鬼手阴符
remainItems: Map<number, { total: number, max: number }> = new Map();
isRobot: boolean = false; // debug接口生成
constructor(guildCode: string, guildName: string, guildCe: number, serverId: number, allStartTime: number) {
constructor(guildCode: string, guildName: string, guildCe: number, serverId: number, allStartTime: number, isRobot: boolean) {
this.guildCode = guildCode;
this.guildName = guildName;
this.guildCe = guildCe;
this.serverId = serverId;
this.allStartTime = allStartTime;
this.isRobot = isRobot;
}
public startRace(allStartTime: number) {
@@ -116,9 +116,6 @@ export class WoodenHorse {
*/
public calCurWoodenHorse(events: Event[]): boolean {
if(this.status == RACE_ACTIVITY_STATUS.END) return false;
if(this.status == RACE_ACTIVITY_STATUS.PAUSE && this.stopContinueTime && Date.now() > this.stopContinueTime) {
this.status = RACE_ACTIVITY_STATUS.START; this.stopContinueTime = 0;
}
if(this.status == RACE_ACTIVITY_STATUS.START) {
if(this.distance >= GUILDACTIVITY.RACEACTIVITY_LENGTH) {
@@ -165,7 +162,7 @@ export class WoodenHorse {
this.calEvent(id, count, endTime);
}
if(this.durability <= 0) {
this.status = RACE_ACTIVITY_STATUS.END;
this.status = RACE_ACTIVITY_STATUS.BREAK;
this.speed = 0;
}
return false;
@@ -189,10 +186,8 @@ export class WoodenHorse {
break;
case RACE_EVENT.GUISHOUYINFU:
if (this.shieldTime < Date.now()) {
this.stopContinueTime = endTime;
this.status = RACE_ACTIVITY_STATUS.PAUSE;
this.time = endTime;
this.speed = 0;
this.speed = effect[1];
}
break;
case RACE_EVENT.FENGCHE:
@@ -263,10 +258,8 @@ export class WoodenHorse {
}
public getTreatTime() {
console.log('#######', this.time, this.allStartTime)
return {...this, time: this.time - this.allStartTime }
}
}
export class Event {
@@ -309,6 +302,16 @@ export class Event {
setStartTime(time: number) {
this.startTime = time;
}
needReCalHorse() {
let importantEvents = [
RACE_EVENT.LIANNU, // 连弩可能durability突然变0
RACE_EVENT.GUISHOUYINFU, // 鬼手阴符
RACE_EVENT.FENGCHE, // 风车
RACE_EVENT.WUGUIBANYUNFU, // 五鬼搬运符
];
return importantEvents.indexOf(this.id) != -1
}
}
export interface GuildRankParams {

View File

@@ -5,10 +5,10 @@
"info": "每个造成0.2%的耐久度伤害",
"type": 0,
"effectType": 0,
"effect": "0.2&",
"effect": "100&",
"continueTime": 0,
"continueDistance": 0,
"effecttime": 5,
"effecttime": 1,
"effectinfo": "遭受诸葛连弩袭击",
"object": 2,
"useCount": "5&10"
@@ -19,10 +19,10 @@
"info": "使用后敌方停止移动持续5秒",
"type": 0,
"effectType": 0,
"effect": "5&",
"effect": "5&0.1",
"continueTime": 5,
"continueDistance": 0,
"effecttime": 5,
"effecttime": 1,
"effectinfo": "遭遇鬼手戏弄,木牛流马无法移动。",
"object": 2,
"useCount": "1&"
@@ -36,7 +36,7 @@
"effect": "2&5",
"continueTime": 5,
"continueDistance": 0,
"effecttime": 5,
"effecttime": 1,
"effectinfo": "大风车吱呀直溜溜地转",
"object": 1,
"useCount": "5&10"
@@ -50,7 +50,7 @@
"effect": "30&5",
"continueTime": 5,
"continueDistance": 0,
"effecttime": 5,
"effecttime": 1,
"effectinfo": "五鬼搬运,千里无踪。万钧之物,不过只手。",
"object": 1,
"useCount": "1&"
@@ -64,7 +64,7 @@
"effect": "20&",
"continueTime": 0,
"continueDistance": 0,
"effecttime": 5,
"effecttime": 1,
"effectinfo": "大盾防护",
"object": 1,
"useCount": "1&"