Feature: expose 3 variables to PMC messages: playerLevel/playerName/playerSide

This commit is contained in:
Dev 2023-03-22 17:12:19 +00:00
parent e2074ffc7a
commit 990c33b9c6
3 changed files with 78 additions and 63 deletions

View File

@ -260,6 +260,8 @@
"pmcresponse-victim_positive_41": "Stone cold kill", "pmcresponse-victim_positive_41": "Stone cold kill",
"pmcresponse-victim_positive_42": "You clowned me real good", "pmcresponse-victim_positive_42": "You clowned me real good",
"pmcresponse-victim_positive_43": "I'm a little rusty but that was a decent kill", "pmcresponse-victim_positive_43": "I'm a little rusty but that was a decent kill",
"pmcresponse-victim_positive_44": "Good kill {{playerName}}",
"pmcresponse-victim_positive_45": "Clean kill {{playerName}}, I was in cover but you found an angle",
"pmcresponse-victim_negative_1": "Nice aimbot", "pmcresponse-victim_negative_1": "Nice aimbot",
"pmcresponse-victim_negative_2": "Cheap shot", "pmcresponse-victim_negative_2": "Cheap shot",
"pmcresponse-victim_negative_3": "Wow esp much", "pmcresponse-victim_negative_3": "Wow esp much",
@ -304,6 +306,8 @@
"pmcresponse-victim_negative_42": "You are such a stinky little goblin", "pmcresponse-victim_negative_42": "You are such a stinky little goblin",
"pmcresponse-victim_negative_43": "There was no need for violence", "pmcresponse-victim_negative_43": "There was no need for violence",
"pmcresponse-victim_negative_44": "1 v 1 me in dorms any time any place", "pmcresponse-victim_negative_44": "1 v 1 me in dorms any time any place",
"pmcresponse-victim_negative_45": "Typical {{playerSide}} behavior",
"pmcresponse-victim_negative_46": "I expected better from a level {{playerLevel}}",
"pmcresponse-victim_plead_1": "I was questing", "pmcresponse-victim_plead_1": "I was questing",
"pmcresponse-victim_plead_2": "I just wanted to do a quest, why'd you kill me :(", "pmcresponse-victim_plead_2": "I just wanted to do a quest, why'd you kill me :(",
"pmcresponse-victim_plead_3": "Hope ur happy i can't even afford a new kit", "pmcresponse-victim_plead_3": "Hope ur happy i can't even afford a new kit",
@ -323,6 +327,7 @@
"pmcresponse-victim_plead_17": "The wiggle is clearly a sign I'm friendly", "pmcresponse-victim_plead_17": "The wiggle is clearly a sign I'm friendly",
"pmcresponse-victim_plead_18": "BRO WHY", "pmcresponse-victim_plead_18": "BRO WHY",
"pmcresponse-victim_plead_19": "I go and make myself a ham and cheese sandwich and you kill me, incredible", "pmcresponse-victim_plead_19": "I go and make myself a ham and cheese sandwich and you kill me, incredible",
"pmcresponse-victim_plead_20": "Well well well, If it isnt {{PlayerName}}, I expected nothing less and was still disappointed",
"pmcresponse-suffix_1": "bro", "pmcresponse-suffix_1": "bro",
"pmcresponse-suffix_2": "bruh", "pmcresponse-suffix_2": "bruh",
"pmcresponse-suffix_3": "lil bro", "pmcresponse-suffix_3": "lil bro",
@ -341,58 +346,65 @@
"pmcresponse-suffix_16": "amigo", "pmcresponse-suffix_16": "amigo",
"pmcresponse-suffix_17": "bud", "pmcresponse-suffix_17": "bud",
"pmcresponse-suffix_18": "guy", "pmcresponse-suffix_18": "guy",
"pmcresponse-suffix_18": "m8", "pmcresponse-suffix_19": "m8",
"pmcresponse-suffix_19": ":)", "pmcresponse-suffix_20": ":)",
"pmcresponse-suffix_20": "(:", "pmcresponse-suffix_21": "(:",
"pmcresponse-suffix_21": ":))))))", "pmcresponse-suffix_22": ":))))))",
"pmcresponse-killer_positive_1": "Good fight", "pmcresponse-killer_positive_1": "Good fight",
"pmcresponse-killer_positive_2": "You fought well", "pmcresponse-killer_positive_2": "You fought well",
"pmcresponse-killer_positive_3": "I will stash your gear", "pmcresponse-killer_positive_3": "I will stash your gear",
"pmcresponse-killer_positive_4": "You nearly got me, great fight", "pmcresponse-killer_positive_4": "You nearly got me, great fight",
"pmcresponse-killer_positive_5": "Well played, nearly had me", "pmcresponse-killer_positive_5": "Well played, nearly had me",
"pmcresponse-killer_positive_6": "You almost had me", "pmcresponse-killer_positive_6": "You almost had me",
"pmcresponse-killer_positive_7": "If I didnt have the drop on you I would be dead", "pmcresponse-killer_positive_7": "If I didnt have the drop on you I would be dead",
"pmcresponse-killer_positive_8": "Good fite", "pmcresponse-killer_positive_8": "Good fite",
"pmcresponse-killer_positive_9": "Well fought", "pmcresponse-killer_positive_9": "Well fought",
"pmcresponse-killer_positive_10": "Whatever you were shooting destroyed my armor, good fight", "pmcresponse-killer_positive_10": "Whatever you were shooting destroyed my armor, good fight",
"pmcresponse-killer_positive_11": "Nothing personal, gotta get these Jaeger quests complete", "pmcresponse-killer_positive_11": "Nothing personal, gotta get these Jaeger quests complete",
"pmcresponse-killer_positive_12": "You had me very worried for a bit during that fight", "pmcresponse-killer_positive_12": "You had me very worried for a bit during that fight",
"pmcresponse-killer_positive_13": "Impressive skills", "pmcresponse-killer_positive_13": "Impressive skills {{PlayerName}}",
"pmcresponse-killer_positive_14": "Respect, you gave me a good fight", "pmcresponse-killer_positive_14": "Respect, you gave me a good fight",
"pmcresponse-killer_positive_15": "Clean fight, respect", "pmcresponse-killer_positive_15": "Clean fight, respect",
"pmcresponse-killer_positive_16": "That was a real cat and mouse fight, awesome", "pmcresponse-killer_positive_16": "That was a real cat and mouse fight, awesome",
"pmcresponse-killer_negative_1": "ty 4 the free loot", "pmcresponse-killer_negative_1": "ty 4 the free loot",
"pmcresponse-killer_negative_2": "Thanks for the new kit", "pmcresponse-killer_negative_2": "Thanks for the new kit",
"pmcresponse-killer_negative_3": "No wonder you died, your gun is trash", "pmcresponse-killer_negative_3": "No wonder you died, your gun is trash",
"pmcresponse-killer_negative_4": "Why are you wearing that armor lmao", "pmcresponse-killer_negative_4": "Why are you wearing that armor lmao",
"pmcresponse-killer_negative_5": "lmaoooo", "pmcresponse-killer_negative_5": "lmaoooo",
"pmcresponse-killer_negative_6": "Dont worry your gear will be on the flea soon", "pmcresponse-killer_negative_6": "Dont worry your gear will be on the flea soon",
"pmcresponse-killer_negative_7": "No wonder you play SPT with your aim", "pmcresponse-killer_negative_7": "No wonder you play SPT with your aim",
"pmcresponse-killer_negative_8": "It is what it is", "pmcresponse-killer_negative_8": "It is what it is",
"pmcresponse-killer_negative_9": "Thanks for looting for me", "pmcresponse-killer_negative_9": "Thanks for looting for me",
"pmcresponse-killer_negative_10": "At least put up a fight next time", "pmcresponse-killer_negative_10": "At least put up a fight next time",
"pmcresponse-killer_negative_11": "I think you need some more practice", "pmcresponse-killer_negative_11": "I think you need some more practice",
"pmcresponse-killer_negative_12": "Try to put up a challenge next time", "pmcresponse-killer_negative_12": "Try to put up a challenge next time",
"pmcresponse-killer_negative_13": "Rip little timmy", "pmcresponse-killer_negative_13": "Rip little timmy",
"pmcresponse-killer_negative_14": "Another dirty little rat taken care of", "pmcresponse-killer_negative_14": "Another dirty little rat taken care of",
"pmcresponse-killer_negative_15": "That was embarassing to watch", "pmcresponse-killer_negative_15": "That was embarassing to watch",
"pmcresponse-killer_negative_15": "I expected at least a little resistance, oh well", "pmcresponse-killer_negative_16": "I expected at least a little resistance, oh well",
"pmcresponse-killer_negative_16": "I hope you didnt insure that gear as you wont be getting it back", "pmcresponse-killer_negative_17": "I hope you didnt insure that gear as you wont be getting it back",
"pmcresponse-killer_negative_17": "I have a youtube series on how to get better at tarkov if you are interested", "pmcresponse-killer_negative_18": "I have a youtube series on how to get better at tarkov if you are interested",
"pmcresponse-killer_negative_18": "Another dogtag for my collection", "pmcresponse-killer_negative_19": "Another dogtag for my collection",
"pmcresponse-killer_plead_1": "I was trying to extract a quest item and you were in my path", "pmcresponse-killer_negative_20": "You are so bad you should go play spt instead",
"pmcresponse-killer_plead_2": "I was looting barrel caches and you were in the way, sorry", "pmcresponse-killer_negative_21": "Rekt",
"pmcresponse-killer_plead_3": "I need PMC kills, I am sure you understand", "pmcresponse-killer_negative_22": "And i thought i was bad",
"pmcresponse-killer_plead_4": "See you next time", "pmcresponse-killer_negative_23": "Are all {{playerSide}} this bad?",
"pmcresponse-killer_plead_5": "You didnt even have a salewa on you, I am never getting this quest completed", "pmcresponse-killer_negative_24": "Thanks for the loot",
"pmcresponse-killer_plead_6": "I spent ages looking for your body and someone already looted it", "pmcresponse-killer_plead_1": "I was trying to extract a quest item and you were in my path",
"pmcresponse-killer_plead_7": "I finally find your body and all you have is garbage", "pmcresponse-killer_plead_2": "I was looting barrel caches and you were in the way, sorry",
"pmcresponse-killer_plead_8": "I swear you killed me before", "pmcresponse-killer_plead_3": "I need PMC kills, I am sure you understand",
"launcher-profile_standard": "Same as live, basic stash size (10x28), 500,000 roubles", "pmcresponse-killer_plead_4": "See you next time",
"launcher-profile_leftbehind": "Same as Standard plus; larger stash size (10x38), extra equipment/items, 500 dollars", "pmcresponse-killer_plead_5": "You didnt even have a salewa on you, I am never getting this quest completed",
"launcher-profile_preparetoescape": "Same as Left Behind plus; larger stash size (10x48), extra equipment/items, higher starting reputation with traders, 250 euros", "pmcresponse-killer_plead_6": "I spent ages looking for your body and someone already looted it",
"launcher-edgeofdarkness": "Same as Prepare To Escape plus; larger stash size (10x68), extra equipment/items, higher starting reputation with traders, 1000 dollars, 500 euros", "pmcresponse-killer_plead_7": "I finally find your body and all you have is garbage",
"launcher-profile_spteasystart": "Lots of Roubles/Dollars/Euros, Some QoL skills are level 20, trader rep maxed, starting level is 69, no quests completed", "pmcresponse-killer_plead_8": "I swear you killed me before",
"launcher-profile_sptzerotohero": "Start with almost nothing, no Roubles/Dollars/Euros, no trader rep, 1 knife, no quests completed", "pmcresponse-killer_plead_9": "Typical behaviour of a {{playerSide}}",
"launcher-profile_sptdeveloper": "Testing profile, starting level is 69, lots of Roubles/Dollars/Euros, USEC start with all quests ready to start, BEAR start with all quests ready to hand in, invincibility balaclava" "pmcresponse-killer_plead_10": "i need to kill {{playerSide}}, i hope you understand",
} "launcher-profile_standard": "Same as live, basic stash size (10x28), 500,000 roubles",
"launcher-profile_leftbehind": "Same as Standard plus; larger stash size (10x38), extra equipment/items, 500 dollars",
"launcher-profile_preparetoescape": "Same as Left Behind plus; larger stash size (10x48), extra equipment/items, higher starting reputation with traders, 250 euros",
"launcher-edgeofdarkness": "Same as Prepare To Escape plus; larger stash size (10x68), extra equipment/items, higher starting reputation with traders, 1000 dollars, 500 euros",
"launcher-profile_spteasystart": "Lots of Roubles/Dollars/Euros, Some QoL skills are level 20, trader rep maxed, starting level is 69, no quests completed",
"launcher-profile_sptzerotohero": "Start with almost nothing, no Roubles/Dollars/Euros, no trader rep, 1 knife, no quests completed",
"launcher-profile_sptdeveloper": "Testing profile, starting level is 69, lots of Roubles/Dollars/Euros, USEC start with all quests ready to start, BEAR start with all quests ready to hand in, invincibility balaclava"
}

View File

@ -156,7 +156,7 @@ export class InraidController
const victims = offraidData.profile.Stats.Victims.filter(x => x.Role === "sptBear" || x.Role === "sptUsec"); const victims = offraidData.profile.Stats.Victims.filter(x => x.Role === "sptBear" || x.Role === "sptUsec");
if (victims?.length > 0) if (victims?.length > 0)
{ {
this.pmcChatResponseService.sendVictimResponse(sessionID, victims); this.pmcChatResponseService.sendVictimResponse(sessionID, victims, pmcData);
} }
if (insuranceEnabled) if (insuranceEnabled)

View File

@ -37,8 +37,9 @@ export class PmcChatResponseService
* For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative
* @param sessionId Session id * @param sessionId Session id
* @param pmcVictims Array of bots killed by player * @param pmcVictims Array of bots killed by player
* @param pmcData Player profile
*/ */
public sendVictimResponse(sessionId: string, pmcVictims: Victim[]): void public sendVictimResponse(sessionId: string, pmcVictims: Victim[], pmcData: IPmcData): void
{ {
for (const victim of pmcVictims) for (const victim of pmcVictims)
{ {
@ -48,7 +49,7 @@ export class PmcChatResponseService
} }
const victimDetails = this.getVictimDetails(victim); const victimDetails = this.getVictimDetails(victim);
const message = this.chooseMessage(true); const message = this.chooseMessage(true, pmcData);
this.notificationSendHelper.sendMessageToPlayer(sessionId, victimDetails, message, MessageType.USER_MESSAGE); this.notificationSendHelper.sendMessageToPlayer(sessionId, victimDetails, message, MessageType.USER_MESSAGE);
} }
} }
@ -58,6 +59,7 @@ export class PmcChatResponseService
* Not fully implemented yet, needs method of acquiring killers details after raid * Not fully implemented yet, needs method of acquiring killers details after raid
* @param sessionId Session id * @param sessionId Session id
* @param pmcData Players profile * @param pmcData Players profile
* @param killer The bot who killed the player
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: Aggressor): void public sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: Aggressor): void
@ -90,7 +92,7 @@ export class PmcChatResponseService
} }
}; };
const message = this.chooseMessage(false); const message = this.chooseMessage(false, pmcData);
if (!message) if (!message)
{ {
return; return;
@ -101,10 +103,11 @@ export class PmcChatResponseService
/** /**
* Choose a localised message to send the player (different if sender was killed or killed player) * Choose a localised message to send the player (different if sender was killed or killed player)
* @param isVictim * @param isVictim Is the message coming from a bot killed by the player
* @returns * @param pmcData Player profile
* @returns Message from PMC to player
*/ */
protected chooseMessage(isVictim: boolean): string protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string
{ {
// Positive/negative etc // Positive/negative etc
const responseType = this.chooseResponseType(isVictim); const responseType = this.chooseResponseType(isVictim);
@ -119,7 +122,7 @@ export class PmcChatResponseService
} }
// Choose random response from above list and request it from localisation service // Choose random response from above list and request it from localisation service
let responseText = this.localisationService.getText(this.randomUtil.getArrayValue(possibleResponseLocaleKeys)); let responseText = this.localisationService.getText(this.randomUtil.getArrayValue(possibleResponseLocaleKeys), {playerName: pmcData.Info.Nickname, playerLevel: pmcData.Info.Level, playerSide: pmcData.Info.Side});
if (this.appendSuffixToMessageEnd(isVictim)) if (this.appendSuffixToMessageEnd(isVictim))
{ {