Skip to content

Commit

Permalink
v2.5.4 Alpha Merge pull request #540 from Die4Ever/develop
Browse files Browse the repository at this point in the history
v2.5.4 Alpha
  • Loading branch information
Die4Ever authored Oct 3, 2023
2 parents 9dcb90f + 64ea128 commit 1ef809d
Show file tree
Hide file tree
Showing 88 changed files with 4,015 additions and 1,620 deletions.
1 change: 1 addition & 0 deletions .github/release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ If you don't know what Deus Ex Randomizer is, then here's our old trailer which

<details>
<summary>Click to expand Minor Changes</summary>

*
</details>

Expand Down
2 changes: 1 addition & 1 deletion .github/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ runs:
shell: bash

- name: Build
run: pyinstaller installer/installer.spec
run: pyinstaller --clean installer/installer.spec
shell: bash
- run: du -ha dist
shell: bash
Expand Down
20 changes: 13 additions & 7 deletions DXRBalance/DeusEx/Classes/BalanceHacking.uc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ var int energyMeterTimer;

function Tick(float deltaTime)
{
local DeusExPlayer p;
local Human p;
if (bHacking)
{
p = DeusExPlayer(winTerm.compOwner.Owner);
if( p == None ) p = Player;// ATMs don't set the Owner
if( p != None ) {
p = Human(winTerm.compOwner.Owner);
if( p == None ) p = Human(Player);// ATMs don't set the Owner
if( p != None && !p.bZeroRando ) {
p.Energy -= deltaTime * 5.0;
if( p.Energy <= 0 ) {
p.Energy = 0;
Expand All @@ -32,6 +32,8 @@ function Tick(float deltaTime)

function CreateHackMessageWindow()
{
local Human p;
p = Human(winTerm.compOwner.Owner);

hackBackground = PersonaHeaderTextWindow(NewChild(Class'PersonaHeaderTextWindow'));
hackBackground.SetPos(22, 19);
Expand All @@ -52,6 +54,10 @@ function CreateHackMessageWindow()
energyMeter.SetSize(168, 47);
energyMeter.SetTextAlignments(HALIGN_Center, VALIGN_Center);

if(p == None || p.bZeroRando) {
energyMeter.Hide();
}

UpdateEnergyMeter();
if(energyMeterTimer == -1)
energyMeterTimer = AddTimer(0.1, true, 0, 'UpdateEnergyMeterTimer');
Expand All @@ -75,14 +81,14 @@ event DestroyWindow()

function UpdateEnergyMeter()
{
local DeusExPlayer p;
local Human p;
local int energy,energydec,req,reqdec;
local float reqEnergy;
local string msg;

p = player;
p = Human(player);

if (p==None) return;
if (p==None || p.bZeroRando) return;

//Keep it to one decimal point
energy = int(p.Energy);
Expand Down
14 changes: 6 additions & 8 deletions DXRBalance/DeusEx/Classes/BalancePS40.uc
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,28 @@ function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed,
class<PlasmaBolt>(ProjClass).default.mpDamage = HitDamage;

proj = PlasmaBolt(Super.ProjectileFire(ProjClass, ProjSpeed, bWarn));
if( proj != None ) {
if( proj != None && HitDamage > default.HitDamage ) {
proj.LightBrightness = 250;
proj.LightRadius = 20;
}

ProjClass.default.Damage = oldDamage;
class<PlasmaBolt>(ProjClass).default.mpDamage = oldmpDamage;
return proj;
return proj;
}

function PostBeginPlay()
function int UpgradeToPS40()
{
Super.PostBeginPlay();
ItemName="PS40";
Description="The PS40 is a disposable, plasma-based weapon developed by an unknown security organization as a next generation stealth pistol."
$ " Unfortunately, the necessity of maintaining a small physical profile restricts the weapon to a single shot."
$ " Despite its limited functionality, the PS40 can be lethal.";
beltDescription="PS40";
HitDamage=100;
return HitDamage;
}

defaultproperties
{
HitDamage=100
ItemName="PS40"
Description="The PS40 is a disposable, plasma-based weapon developed by an unknown security organization as a next generation stealth pistol. Unfortunately, the necessity of maintaining a small physical profile restricts the weapon to a single shot. Despite its limited functionality, the PS40 can be lethal."
beltDescription="PS40"
HitDamage=15// in between the 8 damage bugged vanilla, and the 25 or 40 damage the code implies vanilla intended
}
4 changes: 2 additions & 2 deletions DXRBalance/DeusEx/Classes/BalancePlayer.uc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
class BalancePlayer injects Human;

var travel bool bZeroRando, bReducedRando;

function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType)
{

if(damageType == 'NanoVirus') {
RandomizeAugStates();
}
Super.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType);

}

function RandomizeAugStates()
Expand Down
6 changes: 6 additions & 0 deletions DXRBalance/DeusEx/Classes/ChargedPickup.uc
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ function bool HandlePickupQuery( inventory Item )
return false;
return Super.HandlePickupQuery(Item);
}

// default Charge was 2000, which is used for hazmats and rebreathers
defaultproperties
{
Charge=1500
}
13 changes: 11 additions & 2 deletions DXRBalance/DeusEx/Classes/DartFlare.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
class DXRDartFlare injects DartFlare;

defaultproperties
auto simulated state Flying
{
DamageType=FlareFlamed
//It's goofy that this is in a function called Explode despite not exploding, but oh well
simulated function Explode(vector HitLocation, vector HitNormal)
{
if (Pawn(damagee)!=None){
DamageType='FlareFlamed'; //Special damage type that only burns for a short period of time
} else {
DamageType='Burned'; //Default flare dart damage type
}
Super.Explode(HitLocation,HitNormal);
}
}
11 changes: 11 additions & 0 deletions DXRBalance/DeusEx/Classes/RobotBalance.uc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ function TakeDamageBase(int Damage, Pawn instigatedBy, Vector hitlocation, Vecto
Super.TakeDamageBase(Damage, instigatedBy, hitLocation, momentum, damageType, bPlayAnim);
}

//Copied from the various Human classes. Makes it more possible to filter out
//accidentally walking on one vs actively jumping on one
function bool WillTakeStompDamage(actor stomper)
{
// This blows chunks!
if (stomper.IsA('PlayerPawn') && (GetPawnAllianceType(Pawn(stomper)) != ALLIANCE_Hostile))
return false;
else
return true;
}

defaultproperties
{
BaseAccuracy=0.1
Expand Down
2 changes: 1 addition & 1 deletion DXRBalance/DeusEx/Classes/TearGas.uc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class DXRTearGas injects TearGas;

defaultproperties
{
Damage=3// vanilla is 1
Damage=2// vanilla is 1
}
38 changes: 28 additions & 10 deletions DXRBalance/DeusEx/Classes/ThrownProjectile.uc
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,26 @@ simulated function Tick(float deltaTime)
}
else if(oldSkillTime == 0 && skillTime > 0 && player == None) {
// faster than vanilla, unfortunately vanilla doesn't save the triggering actor but they already factored in the skill value
skillTime *= 0.6;
skillTime += 0.2;
skillTime = loge(skillTime);
skillTime += 0.85;
log("DXRThrownProjectile Tick " $ self @ skillTime);
}
}

// scale arming time with skill and fuse length for thrown grenades (fuseLength is used for thrown grenades, but also the SetTimer call for arming attached grenades)

simulated function PreBeginPlay()
{
// based on the player's skill: scale arming time for player attached grenades, and fuse length for thrown grenades (fuseLength is used for thrown grenades, but also the SetTimer call for arming attached grenades)
local #var(PlayerPawn) player;

Super.PreBeginPlay();
player = #var(PlayerPawn)(Owner);
if(player != None) {
// high skill gives the player shorter fuses
// high skill gives the player faster arming time for attached grenades, and fuse time for thrown grenades
fuseLength += 3.0 * player.SkillSystem.GetSkillLevelValue(class'SkillDemolition');
fuseLength = FClamp(fuseLength, 0.2, 6);
} else {
// higher skill gives the enemies longer fuses
} else if(!bProximityTriggered) {
// higher skill gives the enemies longer fuses for thrown grenades
player = #var(PlayerPawn)(GetPlayerPawn());
if(player != None) {
fuseLength -= player.SkillSystem.GetSkillLevelValue(class'SkillDemolition') * 2.0 + 0.5;
Expand All @@ -56,7 +58,7 @@ function SpawnTearGas()
if ( Role < ROLE_Authority )
return;

for (i=0; i<blastRadius/36; i++)
for (i=0; i<blastRadius/34; i++)// DXRando: divide by 34 instead of 36 to make it slightly denser?
{
if (FRand() < 0.9)
{
Expand Down Expand Up @@ -121,11 +123,27 @@ state Exploding
}
}

// DXRando: Grenades will no longer immediately explode when they touch a carcass
// DXRando: Grenades will no longer immediately explode when they touch a carcass, attached grenades get bigger blast radius and damage according to demo skill
auto simulated state Flying
{
simulated function ProcessTouch (Actor Other, Vector HitLocation)
{
simulated function Explode(vector HitLocation, vector HitNormal)
{
local DeusExPlayer p;
local float f;

p = DeusExPlayer(Owner);
if(bProximityTriggered && p != None) {
f = p.SkillSystem.GetSkillLevelValue(class'SkillDemolition') * -1;
f = loge(f + 2.9);// loge(~2.72) == 1
f = FMax(f, 1.01);
blastRadius *= f;
Damage *= f;
}
Super.Explode(HitLocation, HitNormal);
}

simulated function ProcessTouch (Actor Other, Vector HitLocation)
{
if (DeusExCarcass(Other)!=None){
return;
} else {
Expand Down
33 changes: 31 additions & 2 deletions DXRCore/DeusEx/Classes/DXRActorsBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function Inventory MoveNextItemTo(Inventory item, vector Location, name Tag)

function bool SkipActorBase(Actor a)
{
if( (a.Owner != None) || a.bStatic || a.bHidden || a.bMovable==False || a.bIsSecretGoal )
if( a.Owner != None || a.bStatic || a.bHidden || a.bMovable==False || a.bIsSecretGoal || a.bDeleteMe )
return true;
return false;
}
Expand Down Expand Up @@ -723,14 +723,20 @@ static function Actor _AddActor(Actor a, class<Actor> c, vector loc, rotator rot
return d;
}
//DO NOT ASSUME THIS LIST IS COMPLETE!
//THIS IS UPDATED AS WE ENCOUNTER ISSUES!
//IF SOMETHING ISN'T LISTED HERE AND ISN'T ROTATING CORRECTLY, GET IN THE EDITOR AND DOUBLE CHECK!
//YOU CAN ALSO CHECK THE LIST IN THE unreal-map-flipper REPOSITORY INSIDE MapLibs/actor.py AND LOOK AT THE classes_rot_offsets DICTIONARY!
static function int GetRotationOffset(class<Actor> c)
{
if(ClassIsChildOf(c, class'Pawn'))
return 16384;
if(ClassIsChildOf(c, class'#var(prefix)SecurityCamera'))
if(ClassIsChildOf(c, class'#var(prefix)HackableDevices'))
return 16384;
if(ClassIsChildOf(c, class'#var(prefix)Vehicles'))
return 16384;
if(ClassIsChildOf(c, class'#var(prefix)ThrownProjectile'))
return 16384;
if(ClassIsChildOf(c, class'Brush')) {
log("WARNING: GetRotationOffset for "$c$", Brushes/Movers have negative scaling so they don't need rotation adjustments!");
return -1;
Expand Down Expand Up @@ -915,6 +921,29 @@ static function SetActorScale(Actor a, float scale)
a.DrawScale = scale;
}

function bool CheckFreeSpace(out vector loc, float radius, float height)
{
local bool success;

SetCollisionSize(radius, height);
SetCollision(true, true, true);
bCollideWhenPlacing = true;
bCollideWorld = true;

success = SetLocation(loc);

SetCollision(false, false, false);
bCollideWhenPlacing = false;
bCollideWorld = false;

if(!success || VSize(Location - loc) > 128) {
l("CheckFreeSpace failed for " $ loc);
return false;
}
loc = Location;
return true;
}

function vector GetRandomPosition(optional vector target, optional float mindist, optional float maxdist, optional bool allowWater, optional bool allowPain)
{
local PathNode temp[4096];
Expand Down
36 changes: 28 additions & 8 deletions DXRCore/DeusEx/Classes/DXRBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ simulated function int SetGlobalSeed(coerce string name)
return dxr.SetSeed( dxr.seed + dxr.Crc(name) );
}

simulated function int BranchSeed(coerce string name)
{
return dxr.SetSeed( dxr.Crc(dxr.seed $ name $ dxr.tseed) );
}

simulated function int ReapplySeed(int oldSeed)
{
return dxr.SetSeed(oldSeed);
}

simulated function int rng(int max)
{
return dxr.rng(max);
Expand Down Expand Up @@ -162,12 +172,12 @@ simulated function float rngrangeseeded(float val, float min, float max, coerce
{
local float mult, r, ret;
local int oldseed;
oldseed = dxr.SetSeed( dxr.seed + dxr.Crc(classname) );//manually set the seed to avoid using the level name in the seed
oldseed = SetGlobalSeed(classname);
mult = max - min;
r = rngf();
ret = val * (r * mult + min);
//l("rngrange r: "$r$", mult: "$mult$", min: "$min$", max: "$max$", val: "$val$", return: "$ret);
dxr.SetSeed(oldseed);
ReapplySeed(oldseed);
return ret;
}

Expand Down Expand Up @@ -266,7 +276,7 @@ simulated function bool RandoLevelValues(Actor a, float min, float max, float we
s = "(DXRando) " $ word $ ":|n " $ s;
info("RandoLevelValues "$a$" = "$s);
dxr.SetSeed( oldseed );
ReapplySeed( oldseed );
if(add_desc != "") {
s = s $ "|n|n" $ add_desc;
Expand Down Expand Up @@ -491,29 +501,39 @@ simulated function MessageBoxClicked(int button, int callbackId) {

//Returns true when you aren't in a menu, or in the intro, etc.
function bool InGame() {
local #var(PlayerPawn) p;
local DeusExRootWindow root;
#ifdef hx
return true;
#endif

if( player() == None )
p = player();

if( p == None )
return false;

if (player().InConversation()) {
if (p.InConversation()) {
return True;
}

if (None == DeusExRootWindow(player().rootWindow)) {
root = DeusExRootWindow(p.rootWindow);

if (None == root) {
return False;
}

if (None == DeusExRootWindow(player().rootWindow).hud) {
if (root.GetTopWindow() != None) {
return False;
}

if (!DeusExRootWindow(player().rootWindow).hud.isVisible()){
if (root.bUIPaused) {
return False;
}

if (root.hud.conWindow != None && root.hud.conWindow.IsVisible()) {
return false;
}

return True;
}

Expand Down
Loading

0 comments on commit 1ef809d

Please sign in to comment.