军团活动:诸侯混战城池状态
This commit is contained in:
@@ -278,7 +278,7 @@ export class RaceActivityObject {
|
||||
|
||||
public async useItem(fromRoleId: string, sid: string, fromGuild: string, toGuild: string, id: number, count: number) {
|
||||
let rec = this.handleItem(fromRoleId, sid, id, count);
|
||||
if(!rec) return rec;
|
||||
if(!rec) return false;
|
||||
let event = new Event(id, fromGuild, toGuild, count);
|
||||
if(!this.events.has(toGuild)) {
|
||||
this.events.set(toGuild, [event]);
|
||||
@@ -287,6 +287,8 @@ export class RaceActivityObject {
|
||||
}
|
||||
let chatSid = await getGuildChannelSid(toGuild);
|
||||
pinus.app.rpc.chat.guildRemote.sendRaceEvent.toServer(chatSid, toGuild, [event]);
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
// 定时任务到,开始比赛,设置开始赛道,发放初始道具
|
||||
@@ -546,13 +548,21 @@ export class WoodenHorse {
|
||||
}
|
||||
|
||||
export class Event {
|
||||
@prop({required: true})
|
||||
id: number;
|
||||
@prop({required: true})
|
||||
fromGuild: string;
|
||||
@prop({required: true})
|
||||
toGuild: string;
|
||||
@prop({required: true})
|
||||
startTime?: number;
|
||||
@prop({required: true})
|
||||
startDistance?: number;
|
||||
@prop({required: true})
|
||||
endTime?: number;
|
||||
@prop({required: true})
|
||||
endDistance?: number;
|
||||
@prop({required: true})
|
||||
count: number = 1;
|
||||
|
||||
constructor(id: number, fromGuild: string, toGuild: string, distance?: number, count?: number) {
|
||||
|
||||
Reference in New Issue
Block a user