Skip to content

Commit

Permalink
Merge pull request #54 from Die4Ever/develop
Browse files Browse the repository at this point in the history
v1.4.5 fixed 08_NYC annoying Jock triggers and missing music (issue #58), banned skills and banned skill levels at 5% chances, improvements to rearranged levels, slightly easier enemy randomization, easier to copy/paste passwords, Sam Carter fears nothing
  • Loading branch information
Die4Ever authored Nov 27, 2020
2 parents d06d358 + aa95f81 commit 7b36fef
Show file tree
Hide file tree
Showing 12 changed files with 568 additions and 87 deletions.
Binary file modified DeusEx.u
Binary file not shown.
6 changes: 6 additions & 0 deletions DeusEx/Classes/DXRActorsBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ function bool IsHuman(Actor a)
return HumanMilitary(a) != None || HumanThug(a) != None || HumanCivilian(a) != None;
}

function bool IsCritter(Actor a)
{
if( Animal(a) == None ) return false;
return Doberman(a) == None && Gray(a) == None && Greasel(a) == None && Karkian(a) == None;
}

function bool HasItem(Pawn p, class c)
{
local ScriptedPawn sp;
Expand Down
70 changes: 56 additions & 14 deletions DeusEx/Classes/DXREnemies.uc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function CheckConfig()
{
local int i;
local class<Actor> a;
if( config_version < 4 ) {
chance_clone_nonhumans = 70;
if( config_version < class'DXRFlags'.static.VersionToInt(1,4,5) ) {
chance_clone_nonhumans = 60;
enemy_multiplier = 1;

for(i=0; i < ArrayCount(randommelees); i++ ) {
Expand All @@ -36,18 +36,18 @@ function CheckConfig()
randomenemies[i].chance = 0;
}

AddRandomEnemyType("ThugMale", 10);
AddRandomEnemyType("ThugMale2", 10);
AddRandomEnemyType("ThugMale3", 10);
AddRandomEnemyType("Greasel", 6);
AddRandomEnemyType("Gray", 3);
AddRandomEnemyType("Karkian", 3);
AddRandomEnemyType("SpiderBot", 6);
AddRandomEnemyType("MilitaryBot", 3);
AddRandomEnemyType("SpiderBot2", 3);
AddRandomEnemyType("SecurityBot2", 3);
AddRandomEnemyType("SecurityBot3", 3);
AddRandomEnemyType("SecurityBot4", 3);
AddRandomEnemyType("ThugMale", 14);
AddRandomEnemyType("ThugMale2", 14);
AddRandomEnemyType("ThugMale3", 14);
AddRandomEnemyType("Greasel", 5);
AddRandomEnemyType("Gray", 2);
AddRandomEnemyType("Karkian", 2);
AddRandomEnemyType("SpiderBot2", 2);//little spider
AddRandomEnemyType("MilitaryBot", 2);
AddRandomEnemyType("SpiderBot", 2);//big spider
AddRandomEnemyType("SecurityBot2", 2);//walker
AddRandomEnemyType("SecurityBot3", 2);//little guy from liberty island
AddRandomEnemyType("SecurityBot4", 2);//unused little guy

AddRandomWeapon("WeaponPistol", 11);
AddRandomWeapon("WeaponAssaultGun", 11);
Expand Down Expand Up @@ -139,6 +139,47 @@ function FirstEntry()
{
Super.FirstEntry();
RandoEnemies(dxr.flags.enemiesrandomized);
//SwapScriptedPawns();
}

function SwapScriptedPawns()
{
local ScriptedPawn a, b;
local int num, i, slot;

SetSeed( "SwapScriptedPawns" );
num=0;
foreach AllActors(class'ScriptedPawn', a )
{
if( a.bHidden || a.bStatic ) continue;
if( a.bImportant ) continue;
if( IsCritter(a) ) continue;
num++;
}

foreach AllActors(class'ScriptedPawn', a )
{
if( a.bHidden || a.bStatic ) continue;
if( a.bImportant ) continue;
if( IsCritter(a) ) continue;

i=0;
slot=rng(num-1);
foreach AllActors(class'ScriptedPawn', b )
{
if( b.bHidden || b.bStatic ) continue;
if( b.bImportant ) continue;
if( IsCritter(b) ) continue;

if(i==slot) {
a.Orders = defaultOrders;
b.Orders = defaultOrders;
Swap(a, b);
break;
}
i++;
}
}
}

function RandoEnemies(int percent)
Expand Down Expand Up @@ -166,6 +207,7 @@ function RandoEnemies(int percent)
if( p == newsp ) break;
if( SkipActor(p, 'ScriptedPawn') ) continue;
if( p.bImportant || p.bInvincible ) continue;
if( IsCritter(p) ) continue;
//if( IsInitialEnemy(p) == False ) continue;

if( rng(100) < percent ) RandomizeSP(p, percent);
Expand Down
2 changes: 1 addition & 1 deletion DeusEx/Classes/DXREnemyRespawn.uc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function FirstEntry()
function SaveRespawn(ScriptedPawn p, out int i)
{
local int a;
if( p.IsA('Animal') && !p.IsA('Greasel') && !p.IsA('Karkian') && !p.IsA('Gray') && !p.IsA('Doberman') ) return;
if( IsCritter(p) ) return;
if( p.bImportant || p.bInvincible || p.bHidden ) return;

for(a=0; a < ArrayCount(dont_respawn); a++) {
Expand Down
Loading

0 comments on commit 7b36fef

Please sign in to comment.