bring merging to MVP

This commit is contained in:
Phillip Thelen
2023-07-11 15:10:50 +02:00
parent bb54a6532d
commit 74ba5c0b27
2 changed files with 15 additions and 0 deletions

View File

@@ -150,6 +150,8 @@
"youCastParty": "You cast <%= spell %> for the party.", "youCastParty": "You cast <%= spell %> for the party.",
"chatCastSpellParty": "<%= username %> casts <%= spell %> for the party.", "chatCastSpellParty": "<%= username %> casts <%= spell %> for the party.",
"chatCastSpellUser": "<%= username %> casts <%= spell %> on <%= target %>.", "chatCastSpellUser": "<%= username %> casts <%= spell %> on <%= target %>.",
"chatCastSpellPartyTimes": "<%= username %> casts <%= spell %> for the party <%= times =%> times.",
"chatCastSpellUserTimes": "<%= username %> casts <%= spell %> on <%= target %> <%= times =%> times.",
"critBonus": "Critical Hit! Bonus: ", "critBonus": "Critical Hit! Bonus: ",
"gainedGold": "You gained some Gold", "gainedGold": "You gained some Gold",
"gainedMana": "You gained some Mana", "gainedMana": "You gained some Mana",

View File

@@ -250,6 +250,19 @@ async function castSpell (req, res, { isV3 = false }) {
const lastMessage = lastMessages[0]; const lastMessage = lastMessages[0];
if (lastMessage.info.spell === spellId && lastMessage.info.user === user.profile.name) { if (lastMessage.info.spell === spellId && lastMessage.info.user === user.profile.name) {
lastMessage.info.times += 1; lastMessage.info.times += 1;
lastMessage.timestamp = Number(new Date());
if (targetType === 'user') {
lastMessage.message = `\`${common.i18n.t('chatCastSpellUserTimes', {
username: user.profile.name,
spell: spell.text(),
target: partyMembers.profile.name,
times: lastMessage.info.times,
}, 'en')}\``;
} else {
lastMessage.message = `\`${common.i18n.t('chatCastSpellPartyTimes', {
username: user.profile.name, spell: spell.text(), times: lastMessage.info.times,
}, 'en')}\``;
}
await lastMessage.save(); await lastMessage.save();
return; return;
} }