Commit 96004378 authored by nanahira's avatar nanahira

fix

parent a89e26ee
...@@ -513,16 +513,25 @@ class DataManager { ...@@ -513,16 +513,25 @@ class DataManager {
} }
async randomDuelPlayerWin(name) { async randomDuelPlayerWin(name) {
const score = await this.getOrCreateRandomDuelScore(name); const score = await this.getOrCreateRandomDuelScore(name);
if (!score) {
return;
}
score.win(); score.win();
await this.saveRandomDuelScore(score); await this.saveRandomDuelScore(score);
} }
async randomDuelPlayerLose(name) { async randomDuelPlayerLose(name) {
const score = await this.getOrCreateRandomDuelScore(name); const score = await this.getOrCreateRandomDuelScore(name);
if (!score) {
return;
}
score.lose(); score.lose();
await this.saveRandomDuelScore(score); await this.saveRandomDuelScore(score);
} }
async randomDuelPlayerFlee(name) { async randomDuelPlayerFlee(name) {
const score = await this.getOrCreateRandomDuelScore(name); const score = await this.getOrCreateRandomDuelScore(name);
if (!score) {
return;
}
score.flee(); score.flee();
await this.saveRandomDuelScore(score); await this.saveRandomDuelScore(score);
} }
......
...@@ -520,16 +520,25 @@ export class DataManager { ...@@ -520,16 +520,25 @@ export class DataManager {
} }
async randomDuelPlayerWin(name: string) { async randomDuelPlayerWin(name: string) {
const score = await this.getOrCreateRandomDuelScore(name); const score = await this.getOrCreateRandomDuelScore(name);
if (!score) {
return;
}
score.win(); score.win();
await this.saveRandomDuelScore(score); await this.saveRandomDuelScore(score);
} }
async randomDuelPlayerLose(name: string) { async randomDuelPlayerLose(name: string) {
const score = await this.getOrCreateRandomDuelScore(name); const score = await this.getOrCreateRandomDuelScore(name);
if (!score) {
return;
}
score.lose(); score.lose();
await this.saveRandomDuelScore(score); await this.saveRandomDuelScore(score);
} }
async randomDuelPlayerFlee(name: string) { async randomDuelPlayerFlee(name: string) {
const score = await this.getOrCreateRandomDuelScore(name); const score = await this.getOrCreateRandomDuelScore(name);
if (!score) {
return;
}
score.flee(); score.flee();
await this.saveRandomDuelScore(score); await this.saveRandomDuelScore(score);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment