Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Add reasonablePolice.reds
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Sep 2, 2021
1 parent f082aeb commit 6a32264
Showing 1 changed file with 143 additions and 0 deletions.
143 changes: 143 additions & 0 deletions reasonablePolice.reds
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
@replaceMethod(PreventionSystem)
private final func GetSpawnDataFromHeatStage(heatStage: EPreventionHeatStage, out characterRecords: array<TweakDBID>, out spawnRange: Vector2, out unitsCount: Uint32, out spawnInterval: Float, out hasRecon: Bool) -> Bool {
let characterRecord: TweakDBID;
let characterRecordPool: array<wref<PreventionUnitPoolData_Record>>;
let heatData: wref<PreventionHeatData_Record>;
let i: Int32;
ArrayClear(characterRecords);
if IsDefined(this.m_preventionPreset) {
if !this.m_reconDeployed && NotEquals(heatStage, EPreventionHeatStage.Heat_0) {
heatData = this.m_preventionPreset.Recon();
};
if !IsDefined(heatData) {
switch heatStage {
case EPreventionHeatStage.Heat_0:
return false;
case EPreventionHeatStage.Heat_1:
heatData = this.m_preventionPreset.Heat1();
break;
case EPreventionHeatStage.Heat_2:
heatData = this.m_preventionPreset.Heat2();
break;
case EPreventionHeatStage.Heat_3:
heatData = this.m_preventionPreset.Heat3();
break;
case EPreventionHeatStage.Heat_4:
heatData = this.m_preventionPreset.Heat4();
break;
default:
return false;
};
} else {
hasRecon = true;
};
if IsDefined(heatData) && heatData.GetUnitRecordsPoolCount() > 0 {
heatData.UnitRecordsPool(characterRecordPool);
unitsCount = Cast(heatData.UnitsCount());
spawnRange = heatData.SpawnRange();
spawnInterval = MaxF(heatData.SpawnInterval(), 0.00);
i = 0;
while i < Cast(unitsCount) {
if this.GetCharacterRecordFromPool(characterRecordPool, characterRecord) {
ArrayPush(characterRecords, characterRecord);
} else {
// goto 931;
};
i += 1;
};
if ArraySize(characterRecords) > 0 {
// BEGIN PATCH
spawnRange.X = spawnRange.X * 2.0;
spawnRange.Y = spawnRange.Y * 2.0;
// END PATCH
return true;
};
};
};
switch heatStage {
case EPreventionHeatStage.Heat_0:
// BEGIN PATCH
spawnRange.X = spawnRange.X * 2.0;
spawnRange.Y = spawnRange.Y * 2.0;
// END PATCH
return false;
case EPreventionHeatStage.Heat_1:
ArrayPush(characterRecords, this.m_failsafePoliceRecordT1);
unitsCount = 2u;
spawnRange.Y = 45.00;
spawnRange.Y = 65.00;
break;
case EPreventionHeatStage.Heat_2:
ArrayPush(characterRecords, this.m_failsafePoliceRecordT2);
unitsCount = 2u;
spawnRange.Y = 45.00;
spawnRange.Y = 65.00;
break;
case EPreventionHeatStage.Heat_4:
case EPreventionHeatStage.Heat_3:
ArrayPush(characterRecords, this.m_failsafePoliceRecordT3);
unitsCount = 2u;
spawnRange.Y = 45.00;
spawnRange.Y = 65.00;
break;
default:
};
// BEGIN PATCH
spawnRange.X = spawnRange.X * 2.0;
spawnRange.Y = spawnRange.Y * 2.0;
// END PATCH
if ArraySize(characterRecords) > 0 {
return true;
};
return false;
/*
if NotEquals(heatData, null) && heatData.GetUnitRecordsPoolCount() > 0 {
heatData.UnitRecordsPool(characterRecordPool);
unitsCount = Cast(heatData.UnitsCount());
spawnRange = heatData.SpawnRange();
spawnInterval = MaxF(heatData.SpawnInterval(), 0.00);
// unitsCount = unitsCount * Cast(2);
spawnRange.X = spawnRange.X * 5.0;
spawnRange.Y = spawnRange.Y * 5.0;
// spawnInterval = spawnInterval * 0.5;
i = 0;
while i < Cast(unitsCount) {
if this.GetCharacterRecordFromPool(characterRecordPool, characterRecord) {
ArrayPush(characterRecords, characterRecord);
} else {
// goto 889;
i = Cast(unitsCount);
};
i += 1;
};
if ArraySize(characterRecords) > 0 {
return true;
};
};
*/
}

0 comments on commit 6a32264

Please sign in to comment.