snapshot migration subPhase 5.5
This commit is contained in:
@@ -447,56 +447,59 @@ async function steal(interaction) {
|
||||
* Thief stats.
|
||||
*/
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type:
|
||||
"steal_success",
|
||||
amount,
|
||||
targetUserId:
|
||||
target.id
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type: "steal_success",
|
||||
source: "steal",
|
||||
amount,
|
||||
targetUserId:
|
||||
target.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type:
|
||||
"cookie_gain",
|
||||
amount
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
source: "steal",
|
||||
amount,
|
||||
targetUserId:
|
||||
target.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Victim stats.
|
||||
*/
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type:
|
||||
"stolen_from_me",
|
||||
amount,
|
||||
thiefUserId:
|
||||
user.id
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type: "stolen_from_me",
|
||||
source: "steal",
|
||||
amount,
|
||||
thiefUserId:
|
||||
user.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type:
|
||||
"cookie_loss",
|
||||
amount
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type: "cookie_loss",
|
||||
source: "steal",
|
||||
amount,
|
||||
thiefUserId:
|
||||
user.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const [
|
||||
@@ -653,28 +656,32 @@ async function steal(interaction) {
|
||||
* Profile tracking.
|
||||
*/
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type:
|
||||
"cookie_loss",
|
||||
amount:
|
||||
penalty
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type: "cookie_loss",
|
||||
source: "steal_penalty",
|
||||
amount:
|
||||
penalty,
|
||||
targetUserId:
|
||||
target.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type:
|
||||
"cookie_gain",
|
||||
amount:
|
||||
penalty
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
source: "steal_penalty",
|
||||
amount:
|
||||
penalty,
|
||||
thiefUserId:
|
||||
user.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const [
|
||||
@@ -902,30 +909,34 @@ async function give(interaction) {
|
||||
* Sender lifetime giving.
|
||||
*/
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type:
|
||||
"cookies_given",
|
||||
amount
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
user.id,
|
||||
{
|
||||
type: "cookies_given",
|
||||
source: "give",
|
||||
amount,
|
||||
targetUserId:
|
||||
target.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Recipient lifetime gain.
|
||||
*/
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type:
|
||||
"cookie_gain",
|
||||
amount
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
target.id,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
source: "give",
|
||||
amount,
|
||||
senderUserId:
|
||||
user.id
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const [
|
||||
|
||||
+10
-8
@@ -161,14 +161,16 @@ async function declareBankruptcy(interaction, userId = interaction.user.id) {
|
||||
};
|
||||
}
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
userId,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
amount: BANKRUPTCY_GRANT
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
userId,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
source: "bankruptcy",
|
||||
amount:
|
||||
BANKRUPTCY_GRANT
|
||||
}
|
||||
);
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
|
||||
+12
-5
@@ -72,7 +72,7 @@ async function resolveCookieHeist(
|
||||
if (
|
||||
type !== "cookieHeist" ||
|
||||
ownerId !==
|
||||
interaction.user.id
|
||||
interaction.user.id
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
@@ -85,7 +85,7 @@ async function resolveCookieHeist(
|
||||
|
||||
const method =
|
||||
HEIST_METHODS[
|
||||
methodName
|
||||
methodName
|
||||
];
|
||||
|
||||
if (!method) {
|
||||
@@ -269,17 +269,24 @@ async function resolveCookieHeist(
|
||||
}
|
||||
);
|
||||
|
||||
/*
|
||||
* ============================================================
|
||||
* HEIST
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type:
|
||||
"vault_steal",
|
||||
type: "vault_steal",
|
||||
source: "heist",
|
||||
game: "heist",
|
||||
result: "win",
|
||||
amount
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const [
|
||||
playerAfter,
|
||||
vaultAfter
|
||||
|
||||
@@ -304,6 +304,7 @@ async function startBlackjack(
|
||||
game: "blackjack",
|
||||
source,
|
||||
bet,
|
||||
wager: bet,
|
||||
allIn,
|
||||
previousAllIn,
|
||||
previousBet
|
||||
@@ -1328,9 +1329,9 @@ function shuffleDeck(
|
||||
deck[i],
|
||||
deck[j]
|
||||
] = [
|
||||
deck[j],
|
||||
deck[i]
|
||||
];
|
||||
deck[j],
|
||||
deck[i]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,14 +87,15 @@ async function collectCookies(
|
||||
);
|
||||
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
userId,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
amount
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
userId,
|
||||
{
|
||||
type: "cookie_gain",
|
||||
source: "collect",
|
||||
amount
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const balance = await getCookieBalance(
|
||||
|
||||
+14
-13
@@ -495,19 +495,20 @@ async function playRoulette(
|
||||
const allIn =
|
||||
bet === playerBalance;
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type: "game_start",
|
||||
game: "roulette",
|
||||
source,
|
||||
bet,
|
||||
allIn,
|
||||
previousAllIn,
|
||||
previousBet
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type: "game_start",
|
||||
game: "roulette",
|
||||
source,
|
||||
bet,
|
||||
wager: bet,
|
||||
allIn,
|
||||
previousAllIn,
|
||||
previousBet
|
||||
}
|
||||
);
|
||||
|
||||
await interaction.update({
|
||||
embeds: [
|
||||
|
||||
+15
-10
@@ -199,16 +199,21 @@ async function playSlots(
|
||||
throw error;
|
||||
}
|
||||
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type: "game_start",
|
||||
game: "slots",
|
||||
source,
|
||||
bet
|
||||
}
|
||||
);
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type: "game_start",
|
||||
game: "slots",
|
||||
source,
|
||||
bet,
|
||||
wager: bet,
|
||||
allIn:
|
||||
bet === playerBalance,
|
||||
previousAllIn,
|
||||
previousBet
|
||||
}
|
||||
);
|
||||
|
||||
await interaction.update({
|
||||
embeds: [
|
||||
|
||||
Reference in New Issue
Block a user