Fixed PMCs not being hostile to player scav until they're very close

Fixed incorrect capitalisation

Added `SavageEnemyChance` property to pmc config
This commit is contained in:
Dev 2024-09-19 12:28:33 +01:00
parent 5d5adb263c
commit d35063ecb1
4 changed files with 25 additions and 14 deletions

View File

@ -778,7 +778,7 @@
"additionalEnemyTypes": [ "additionalEnemyTypes": [
"bossPartisan" "bossPartisan"
], ],
"ChancedEnemies": [{ "chancedEnemies": [{
"EnemyChance": 100, "EnemyChance": 100,
"Role": "assault" "Role": "assault"
}, { }, {
@ -789,8 +789,10 @@
"Role": "pmcUSEC" "Role": "pmcUSEC"
} }
], ],
"BearEnemyChance": 85, "bearEnemyChance": 85,
"UsecEnemyChance": 100 "usecEnemyChance": 100,
"savageEnemyChance": 95,
"savagePlayerBehaviour": "ChancedEnemies"
}, },
"pmcbear": { "pmcbear": {
"additionalEnemyTypes": [ "additionalEnemyTypes": [
@ -807,8 +809,10 @@
"Role": "pmcBEAR" "Role": "pmcBEAR"
} }
], ],
"BearEnemyChance": 85, "bearEnemyChance": 85,
"UsecEnemyChance": 100 "usecEnemyChance": 100,
"savageEnemyChance": 95,
"savagePlayerBehaviour": "ChancedEnemies"
} }
}, },
"forceHealingItemsIntoSecure": true, "forceHealingItemsIntoSecure": true,

View File

@ -197,6 +197,7 @@ export interface IAdditionalHostilitySettings {
ChancedEnemies: IChancedEnemy[]; ChancedEnemies: IChancedEnemy[];
Neutral: string[]; Neutral: string[];
SavagePlayerBehaviour: string; SavagePlayerBehaviour: string;
SavageEnemyChance?: number;
UsecEnemyChance: number; UsecEnemyChance: number;
UsecPlayerBehaviour: string; UsecPlayerBehaviour: string;
Warn: string[]; Warn: string[];

View File

@ -55,9 +55,10 @@ export interface IHostilitySettings {
/** Bot roles that are 100% an enemy */ /** Bot roles that are 100% an enemy */
additionalEnemyTypes?: string[]; additionalEnemyTypes?: string[];
/** Objects that determine the % chance another bot type is an enemy */ /** Objects that determine the % chance another bot type is an enemy */
ChancedEnemies?: IChancedEnemy[]; chancedEnemies?: IChancedEnemy[];
BearEnemyChance?: number; bearEnemyChance?: number;
UsecEnemyChance?: number; usecEnemyChance?: number;
savageEnemyChance?: number;
/** Bot roles that are 100% an friendly */ /** Bot roles that are 100% an friendly */
additionalFriendlyTypes?: string[]; additionalFriendlyTypes?: string[];
savagePlayerBehaviour?: string; savagePlayerBehaviour?: string;

View File

@ -167,8 +167,8 @@ export class LocationLifecycleService {
} }
// Add/edit chance settings // Add/edit chance settings
if (configHostilityChanges.ChancedEnemies) { if (configHostilityChanges.chancedEnemies) {
for (const chanceDetailsToApply of configHostilityChanges.ChancedEnemies) { for (const chanceDetailsToApply of configHostilityChanges.chancedEnemies) {
const locationBotDetails = locationBotHostilityDetails.ChancedEnemies.find( const locationBotDetails = locationBotHostilityDetails.ChancedEnemies.find(
(botChance) => botChance.Role === chanceDetailsToApply.Role, (botChance) => botChance.Role === chanceDetailsToApply.Role,
); );
@ -192,13 +192,18 @@ export class LocationLifecycleService {
} }
// Adjust bear hostility chance // Adjust bear hostility chance
if (typeof configHostilityChanges.BearEnemyChance !== "undefined") { if (typeof configHostilityChanges.bearEnemyChance !== "undefined") {
locationBotHostilityDetails.BearEnemyChance = configHostilityChanges.BearEnemyChance; locationBotHostilityDetails.BearEnemyChance = configHostilityChanges.bearEnemyChance;
} }
// Adjust usec hostility chance // Adjust usec hostility chance
if (typeof configHostilityChanges.UsecEnemyChance !== "undefined") { if (typeof configHostilityChanges.usecEnemyChance !== "undefined") {
locationBotHostilityDetails.UsecEnemyChance = configHostilityChanges.UsecEnemyChance; locationBotHostilityDetails.UsecEnemyChance = configHostilityChanges.usecEnemyChance;
}
// Adjust usec hostility chance
if (typeof configHostilityChanges.savageEnemyChance !== "undefined") {
locationBotHostilityDetails.SavageEnemyChance = configHostilityChanges.savageEnemyChance;
} }
// Adjust scav hostility behaviour // Adjust scav hostility behaviour