Added ability for PMCs killed by player to remark on the map they died on + added some PMC responses that involve the location

This commit is contained in:
Dev 2024-11-03 11:24:05 +00:00
parent 35b1fd07b6
commit c61de9433e
2 changed files with 23 additions and 3 deletions

View File

@ -489,6 +489,9 @@
"pmcresponse-victim_negative_99": "Your computer so bad you get 20fps on streets", "pmcresponse-victim_negative_99": "Your computer so bad you get 20fps on streets",
"pmcresponse-victim_negative_103": "Yeah you only got that kill because i had busy hands", "pmcresponse-victim_negative_103": "Yeah you only got that kill because i had busy hands",
"pmcresponse-victim_negative_104": "I would have heard you but i forgot to turn off binaural audio", "pmcresponse-victim_negative_104": "I would have heard you but i forgot to turn off binaural audio",
"pmcresponse-victim_negative_105": "I really really really hate {{victimDeathLocation}}",
"pmcresponse-victim_negative_106": "I should have installed a mod to remove the need to go to {{victimDeathLocation}}",
"pmcresponse-victim_negative_107": "I nearly got my quest item out of {{victimDeathLocation}} and then you showed up",
"pmcresponse-victim_plead_1": "I was questing", "pmcresponse-victim_plead_1": "I was questing",
"pmcresponse-victim_plead_10": "I was afk for no more than 2 minutes and you killed me", "pmcresponse-victim_plead_10": "I was afk for no more than 2 minutes and you killed me",
"pmcresponse-victim_plead_11": "I just went to the toilet and you shot me", "pmcresponse-victim_plead_11": "I just went to the toilet and you shot me",
@ -507,6 +510,7 @@
"pmcresponse-victim_plead_23": "Cheap kill", "pmcresponse-victim_plead_23": "Cheap kill",
"pmcresponse-victim_plead_24": "It is what it is", "pmcresponse-victim_plead_24": "It is what it is",
"pmcresponse-victim_plead_25": "Its so over", "pmcresponse-victim_plead_25": "Its so over",
"pmcresponse-victim_plead_26": "I just wanted to do a few quests on {{victimDeathLocation}} its not much to ask",
"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",
"pmcresponse-victim_plead_4": "Bro im new to the game why you kill me", "pmcresponse-victim_plead_4": "Bro im new to the game why you kill me",
"pmcresponse-victim_plead_5": "I am never gonna get this stupid quest done", "pmcresponse-victim_plead_5": "I am never gonna get this stupid quest done",
@ -578,6 +582,8 @@
"pmcresponse-victim_positive_65": "I cant believe you took me out like that. Great job", "pmcresponse-victim_positive_65": "I cant believe you took me out like that. Great job",
"pmcresponse-victim_positive_66": "We should duo some time", "pmcresponse-victim_positive_66": "We should duo some time",
"pmcresponse-victim_positive_67": "You know your stuff, lets raid some time", "pmcresponse-victim_positive_67": "You know your stuff, lets raid some time",
"pmcresponse-victim_positive_68": "I knew the risks going into {{victimDeathLocation}}, well played",
"pmcresponse-victim_positive_69": "Live by {{victimDeathLocation}}, die by {{victimDeathLocation}}",
"pmcresponse-victim_positive_7": "That was fair, nice kill", "pmcresponse-victim_positive_7": "That was fair, nice kill",
"pmcresponse-victim_positive_8": "You're a good shot, that's for sure", "pmcresponse-victim_positive_8": "You're a good shot, that's for sure",
"pmcresponse-victim_positive_9": "gg", "pmcresponse-victim_positive_9": "gg",

View File

@ -11,6 +11,7 @@ import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { GiftService } from "@spt/services/GiftService"; import { GiftService } from "@spt/services/GiftService";
import { LocaleService } from "@spt/services/LocaleService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService";
import { HashUtil } from "@spt/utils/HashUtil"; import { HashUtil } from "@spt/utils/HashUtil";
@ -29,6 +30,7 @@ export class PmcChatResponseService {
@inject("NotificationSendHelper") protected notificationSendHelper: NotificationSendHelper, @inject("NotificationSendHelper") protected notificationSendHelper: NotificationSendHelper,
@inject("MatchBotDetailsCacheService") protected matchBotDetailsCacheService: MatchBotDetailsCacheService, @inject("MatchBotDetailsCacheService") protected matchBotDetailsCacheService: MatchBotDetailsCacheService,
@inject("LocalisationService") protected localisationService: LocalisationService, @inject("LocalisationService") protected localisationService: LocalisationService,
@inject("LocaleService") protected localeService: LocaleService,
@inject("GiftService") protected giftService: GiftService, @inject("GiftService") protected giftService: GiftService,
@inject("WeightedRandomHelper") protected weightedRandomHelper: WeightedRandomHelper, @inject("WeightedRandomHelper") protected weightedRandomHelper: WeightedRandomHelper,
@inject("ConfigServer") protected configServer: ConfigServer, @inject("ConfigServer") protected configServer: ConfigServer,
@ -58,7 +60,7 @@ export class PmcChatResponseService {
} }
const victimDetails = this.getVictimDetails(victim); const victimDetails = this.getVictimDetails(victim);
const message = this.chooseMessage(true, pmcData); const message = this.chooseMessage(true, pmcData, victim);
if (message) { if (message) {
this.notificationSendHelper.sendMessageToPlayer( this.notificationSendHelper.sendMessageToPlayer(
sessionId, sessionId,
@ -120,9 +122,10 @@ 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 Is the message coming from a bot killed by the player * @param isVictim Is the message coming from a bot killed by the player
* @param pmcData Player profile * @param pmcData Player profile
* @param victimData OPTIMAL - details of the pmc killed
* @returns Message from PMC to player * @returns Message from PMC to player
*/ */
protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined { protected chooseMessage(isVictim: boolean, pmcData: IPmcData, victimData?: IVictim): string | undefined {
// Positive/negative etc // Positive/negative etc
const responseType = this.chooseResponseType(isVictim); const responseType = this.chooseResponseType(isVictim);
@ -139,9 +142,10 @@ export class PmcChatResponseService {
playerName: pmcData.Info.Nickname, playerName: pmcData.Info.Nickname,
playerLevel: pmcData.Info.Level, playerLevel: pmcData.Info.Level,
playerSide: pmcData.Info.Side, playerSide: pmcData.Info.Side,
victimDeathLocation: victimData ? this.getLocationName(victimData.Location) : "",
}); });
// Give the player a gift code if they were killed adn response is 'pity'. // Give the player a gift code if they were killed and response is 'pity'.
if (responseType === "pity") { if (responseType === "pity") {
const giftKeys = this.giftService.getGiftIds(); const giftKeys = this.giftService.getGiftIds();
const randomGiftKey = this.randomUtil.getStringArrayValue(giftKeys); const randomGiftKey = this.randomUtil.getStringArrayValue(giftKeys);
@ -168,6 +172,16 @@ export class PmcChatResponseService {
return responseText; return responseText;
} }
/**
* use map key to get a localised location name
* e.g. factory4_day becomes "Factory"
* @param locationKey location key to localise
* @returns Localised location name
*/
protected getLocationName(locationKey: string) {
return this.localeService.getLocaleDb()[locationKey] ?? locationKey;
}
/** /**
* Should capitalisation be stripped from the message response before sending * Should capitalisation be stripped from the message response before sending
* @param isVictim Was responder a victim of player * @param isVictim Was responder a victim of player