军团活动:粮草先行debug

This commit is contained in:
luying
2022-09-13 15:57:33 +08:00
parent 3def913f74
commit 576098cb2e
5 changed files with 63 additions and 20 deletions

View File

@@ -129,9 +129,11 @@ export class RaceActivityObject {
return woodenHorse;
}
public async useItem(serverId: number, fromRoleId: string, sid: string, fromGuild: string, toGuild: string, id: number, count: number) {
let rec = this.handleItems(fromRoleId, sid, [{id, count: -1 * count}]);
if(!rec) return false;
public async useItem(serverId: number, fromRoleId: string, sid: string, fromGuild: string, toGuild: string, id: number, count: number, debug = false) {
if(!debug) {
let rec = this.handleItems(fromRoleId, sid, [{id, count: -1 * count}]);
if(!rec) return false;
}
let event = new Event(id, fromGuild, toGuild, count);
if(!this.events.has(toGuild)) {
this.events.set(toGuild, [event]);