Skip to content

Commit

Permalink
feat: wealthyPayForPVEIsland campaign mission
Browse files Browse the repository at this point in the history
  • Loading branch information
romain22222 committed Oct 18, 2023
1 parent 2f52fc3 commit d170220
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/text/missions/wealthyPayForPVEIsland.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"translations": {
"fr": {
"desc": "Montrez votre richesse au capitaine du bateau."
},
"en": {
"desc": "Show your wealth to the boat captain."
}
},
"campaignOnly": true
}
7 changes: 7 additions & 0 deletions src/core/smallEvents/goToPVEIslandSmallEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {LogsReadRequests} from "../database/logs/LogsReadRequests";
import {PlayerMissionsInfos} from "../database/game/models/PlayerMissionsInfo";
import {TravelTime} from "../maps/TravelTime";
import {Settings} from "../database/game/models/Setting";
import {MissionsController} from "../missions/MissionsController";

/**
* Manage the callback to join the boat
Expand Down Expand Up @@ -47,6 +48,12 @@ export async function confirmationCallback(
);
await missionInfo.addGems(-price, player.discordUserId, NumberChangeReason.SMALL_EVENT);
await missionInfo.save();
if (price === PVEConstants.TRAVEL_COST[PVEConstants.TRAVEL_COST.length - 1]) {
await MissionsController.update(player, messageData.reactionMessage.sentMessage.channel, messageData.tr.language, {
missionId: "wealthyPayForPVEIsland",
set: true
});
}

Check warning on line 56 in src/core/smallEvents/goToPVEIslandSmallEvent.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (develop)

❌ New issue: Bumpy Road Ahead

confirmationCallback has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
messageData.embed.setDescription(`${emote} ${anotherMemberOnBoat ? messageData.tr.get("endStoryAcceptWithMember") : messageData.tr.get("endStoryAccept")}`);
}
}
Expand Down

0 comments on commit d170220

Please sign in to comment.