diff --git a/project/assets/configs/pmcchatresponse.json b/project/assets/configs/pmcchatresponse.json index 829e4309..049b4990 100644 --- a/project/assets/configs/pmcchatresponse.json +++ b/project/assets/configs/pmcchatresponse.json @@ -1,8 +1,8 @@ { "victim": { - "responseChancePercent": 15, + "responseChancePercent": 7, "responseTypeWeights": { - "positive": 8, + "positive": 7, "negative": 2, "plead": 2 }, diff --git a/project/assets/locales/en.json b/project/assets/locales/en.json index f6ac3d70..4f7245de 100644 --- a/project/assets/locales/en.json +++ b/project/assets/locales/en.json @@ -219,7 +219,7 @@ "websocket-started": "Started websocket at %s", "pmcresponse-victim_positive_1": "Nice shot", "pmcresponse-victim_positive_2": "Great shot", - "pmcresponse-victim_positive_3": "Good kill man", + "pmcresponse-victim_positive_3": "Good kill", "pmcresponse-victim_positive_4": "Deserved kill, good one", "pmcresponse-victim_positive_5": "Lucky kill", "pmcresponse-victim_positive_6": "Good fight", @@ -316,7 +316,7 @@ "pmcresponse-victim_plead_10": "I was afk for 2 minutes and you killed me", "pmcresponse-victim_plead_11": "I just went to the toilet and you shot me", "pmcresponse-victim_plead_12": "I just went to the kitchen to pick up my dino nuggets and you killed me", - "pmcresponse-victim_plead_13": "BRO PLEASE", + "pmcresponse-victim_plead_13": "bro please", "pmcresponse-victim_plead_14": "Just you wait until I download some more mods off the hub, then I'll get you", "pmcresponse-victim_plead_15": "Does the wiggle mean nothing smh smh fr", "pmcresponse-victim_plead_16": "I cant stand this game, I'm going back to roblox", @@ -336,5 +336,9 @@ "pmcresponse-suffix_11": "my guy", "pmcresponse-suffix_12": "smh", "pmcresponse-suffix_13": "man", - "pmcresponse-suffix_14": "king" + "pmcresponse-suffix_14": "king", + "pmcresponse-suffix_15": "champ", + "pmcresponse-suffix_16": "amigo", + "pmcresponse-suffix_17": "bud", + "pmcresponse-suffix_18": "guy" } \ No newline at end of file diff --git a/project/src/services/PmcChatResponseService.ts b/project/src/services/PmcChatResponseService.ts index 4213d4db..e1356ba0 100644 --- a/project/src/services/PmcChatResponseService.ts +++ b/project/src/services/PmcChatResponseService.ts @@ -30,17 +30,23 @@ export class PmcChatResponseService } /** - * Chooses a random victim from those provided and sends 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 pmcVictims Array of bots killed by player */ public sendVictimResponse(sessionId: string, pmcVictims: Victim[]): void { - const victim = this.chooseRandomVictim(pmcVictims); + for (const victim of pmcVictims) + { + if (!this.randomUtil.getChance100(this.pmcResponsesConfig.victim.responseChancePercent)) + { + continue; + } - const message = this.chooseMessage(true); - - this.notificationSendHelper.sendMessageToPlayer(sessionId, victim, message, MessageType.USER_MESSAGE); + const victimDetails = this.getVictimDetails(victim); + const message = this.chooseMessage(true); + this.notificationSendHelper.sendMessageToPlayer(sessionId, victimDetails, message, MessageType.USER_MESSAGE); + } } @@ -187,6 +193,17 @@ export class PmcChatResponseService { const randomVictim = this.randomUtil.getArrayValue(pmcVictims); - return {_id: randomVictim.Name, info:{Nickname: randomVictim.Name, Level: randomVictim.Level, Side: randomVictim.Side, MemberCategory: MemberCategory.UNIQUE_ID}}; + return this.getVictimDetails(randomVictim); + } + + /** + * Convert a victim object into a IUserDialogInfo object + * @param pmcVictim victim to convert + * @returns IUserDialogInfo + */ + protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo + { + const categories = [MemberCategory.UNIQUE_ID, MemberCategory.DEFAULT, MemberCategory.DEFAULT, MemberCategory.DEFAULT, MemberCategory.DEFAULT, MemberCategory.DEFAULT, MemberCategory.DEFAULT, MemberCategory.SHERPA, MemberCategory.DEVELOPER]; + return {_id: pmcVictim.Name, info:{Nickname: pmcVictim.Name, Level: pmcVictim.Level, Side: pmcVictim.Side, MemberCategory: this.randomUtil.getArrayValue(categories)}}; } } \ No newline at end of file