Skip to content

Commit

Permalink
v3.2.0.1 Beta Merge pull request #956 from Die4Ever/develop
Browse files Browse the repository at this point in the history
v3.2.0.1 Beta
  • Loading branch information
Die4Ever authored Sep 19, 2024
2 parents 4997e18 + 2cbda9d commit f6f04d2
Show file tree
Hide file tree
Showing 80 changed files with 808 additions and 514 deletions.
60 changes: 33 additions & 27 deletions DXRCore/DeusEx/Classes/DXRActorsBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,17 @@ static function Inventory GiveExistingItem(Pawn p, Inventory item, optional int
return item;
}

static function inventory GiveItem(Pawn p, class<Inventory> iclass, optional int add_ammo)
static function inventory GiveItem(Pawn p, class<Inventory> iclass, optional int amount)
{
local inventory item;

item = p.Spawn(iclass, p);
if( item == None ) return None;
return GiveExistingItem(p, item, add_ammo);
if(DeusExPickup(item)!=None && amount > 0) {
DeusExPickup(item).NumCopies = amount;
amount = 0;
}
return GiveExistingItem(p, item, amount);
}

static function ThrowItem(Inventory item, float VelocityMult)
Expand Down Expand Up @@ -726,10 +730,7 @@ function bool HasConversation(Actor a) {
}

function bool HasBased(Actor a) {
local Actor b;
foreach a.BasedActors(class'Actor', b)
return true;
return false;
return a.StandingCount > 0;
}

function bool DestroyActor( Actor d )
Expand Down Expand Up @@ -935,6 +936,28 @@ function ConEventAddGoal GetGoalConEvent(name goalName, name convname, optional
return GetGoalConEventStatic(goalName, GetConversation(convname), which);
}
// Creates or updates a goal with text taken from a Conversation
function DeusExGoal AddGoalFromConv(#var(PlayerPawn) player, name goaltag, name convname, optional int which, optional bool replaceText)
{
local DeusExGoal goal;
local ConEventAddGoal ceag;
ceag = GetGoalConEvent(goaltag, convname, which);
if (ceag == None)
return None;
goal = player.FindGoal(goaltag);
if (goal == None)
goal = player.AddGoal(goaltag, ceag.bPrimaryGoal);
else if (replaceText == false)
return goal;
goal.SetText(ceag.goalText);
return goal;
}
static function string GetActorName(Actor a)
{
local #var(PlayerPawn) player;
Expand Down Expand Up @@ -1711,8 +1734,8 @@ static function Actor GlowUp(Actor a, optional byte hue, optional byte saturatio
function DebugMarkKeyActor(Actor a, coerce string id)
{
local ActorDisplayWindow actorDisplay;
if( ! #defined(debug)) {
err("Don't call DebugMarkKeyActor without debug mode! Add debug to the compiler_settings.default.json file");
if( ! #defined(locdebug)) {
err("Don't call DebugMarkKeyActor without locdebug mode! Add locdebug to the compiler_settings.default.json file");
return;
}

Expand All @@ -1737,8 +1760,8 @@ function DebugMarkKeyPosition(vector pos, coerce string id)
{
local ActorDisplayWindow actorDisplay;
local Actor a;
if( ! #defined(debug)) {
err("Don't call DebugMarkKeyPosition without debug mode! Add debug to the compiler_settings.default.json file");
if( ! #defined(locdebug)) {
err("Don't call DebugMarkKeyPosition without locdebug mode! Add locdebug to the compiler_settings.default.json file");
return;
}

Expand Down Expand Up @@ -1787,20 +1810,3 @@ static function bool ChangeInitialAlliance(ScriptedPawn pawn, Name allianceName,

return true;
}

function DeusExGoal AddGoalFromConv(#var(PlayerPawn) player, name goaltag, name convname, optional int which)
{
local DeusExGoal goal;
local ConEventAddGoal ceag;

goal = player.FindGoal(goaltag);

if (goal == None) {
ceag = GetGoalConEvent(goaltag, convname, which);
if (ceag == None) return None;
goal = player.AddGoal(goaltag, ceag.bPrimaryGoal);
goal.SetText(ceag.goalText);
}

return goal;
}
5 changes: 5 additions & 0 deletions DXRCore/DeusEx/Classes/DXRBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ simulated function DXRando GetDXR()
return dxr;
}

static function DXRBase Find()
{
return class'DXRando'.default.dxr.FindModule(default.class);
}

simulated event PostNetBeginPlay()
{
Super.PostNetBeginPlay();
Expand Down
4 changes: 2 additions & 2 deletions DXRCore/DeusEx/Classes/DXRVersion.uc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ simulated static function CurrentVersion(optional out int major, optional out in
major=3;
minor=2;
patch=0;
build=0;//build can't be higher than 99
build=1;//build can't be higher than 99
}

simulated static function bool VersionIsStable()
Expand All @@ -18,7 +18,7 @@ simulated static function string VersionString(optional bool full)
local int major,minor,patch,build;
local string status;

status = "Alpha";
status = "Beta";

if(status!="") {
status = " " $ status;
Expand Down
4 changes: 2 additions & 2 deletions DXRCore/DeusEx/Classes/DXRandoTests.uc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function PostBeginPlay()

SetTimer(0, false);

foreach AllActors(class'DXRando', dxr) { break; }
dxr = class'DXRando'.default.dxr;

if( dxr.localURL != "12_VANDENBERG_TUNNELS" ) {
dxr.Destroy();
Expand All @@ -52,7 +52,7 @@ function Timer()
{
local DXRando dxr;

foreach AllActors(class'DXRando', dxr) { break; }
dxr = class'DXRando'.default.dxr;
if( dxr.bTickEnabled ) {
log("waiting... dxr: " $ dxr $ ", dxr.bTickEnabled: " $ dxr.bTickEnabled );
return;
Expand Down
2 changes: 1 addition & 1 deletion DXRCore/DeusEx/Classes/DataStorage.uc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ simulated function static DataStorage GetObjFromPlayer(Actor p)
}
#endif
foreach p.AllActors(class'DXRando', dxr) { break; }
dxr = class'DXRando'.default.dxr;
if(dxr == None)
return None;
Expand Down
2 changes: 1 addition & 1 deletion DXRFixes/DeusEx/Classes/Animal.uc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function EndPetting(optional bool bInterrupted)

if (!bHasBeenPet && !bInterrupted){
bHasBeenPet=True;
class'DXREvents'.static.MarkBingo(camera.dxr,"PetAnimal_"$Class.Name);
class'DXREvents'.static.MarkBingo("PetAnimal_"$Class.Name);
}
camera.player().bBlockAnimations=False;
camera.player().AnimEnd(); //Kicks the appropriate normal animations off again
Expand Down
55 changes: 52 additions & 3 deletions DXRFixes/DeusEx/Classes/ElevatorMover.uc
Original file line number Diff line number Diff line change
@@ -1,7 +1,50 @@
class ElevatorMover merges ElevatorMover;
// can't do injects because it uses a state

var float lastTime;
var float lastTime, moveSpeed, originalMoveTime;
var int numKeyPos;
var bool initialized;

function Initialize()
{
local SequenceTrigger st;
local float dist, maxDist, avgDist, distSum;
local int validKeyPos[8];
local int i, j;

if (initialized) return;

// calculate numKeyPos and make a list of valid KeyPos indices
foreach AllActors(class'SequenceTrigger', st) {
if (st.event != tag) continue;

// check if st.seqnum is already in the list
for (i = 0; i < numKeyPos; i++) {
if (validKeyPos[i] == st.seqnum) {
break;
}
}
// if not, add it and increment numKeyPos
if (i == numKeyPos) {
validKeyPos[numKeyPos++] = st.seqnum;
}
}

// do calculations using only valid KeyPos elements
for (i = 0; i < numKeyPos; i++) {
for (j = i + 1; j < numKeyPos; j++) {
dist = VSize(KeyPos[validKeyPos[i]] - KeyPos[validKeyPos[j]]);
maxDist = FMax(maxDist, dist);
distSum += dist;
}
}

avgDist = distSum / (numKeyPos * (numKeyPos - 1) / 2.0);
moveSpeed = (maxDist*0.33 + avgDist*0.67) / MoveTime;
originalMoveTime = MoveTime;

initialized = true;
}

function bool EncroachingOn( actor Other )
{
Expand All @@ -23,17 +66,23 @@ function SetSeq(int seqnum)
local int prevKeyNum;
local float dist;

if( MoveTime/2 < Level.TimeSeconds-lastTime )
Initialize();

if( MoveTime/10 < Level.TimeSeconds-lastTime )
oldSeq = true;

if ( bIsMoving && !oldSeq )
return;

dist = VSize(BasePos + KeyPos[seqnum] - Location);

if (numKeyPos > 2)
MoveTime = FMax(dist / moveSpeed, originalMoveTime / 2.5);

if (KeyNum != seqnum || oldSeq)
{
prevKeyNum = KeyNum;
KeyNum = seqnum;
dist = VSize(BasePos + KeyPos[seqnum] - Location);

GotoState('ElevatorMover', 'Next');

Expand Down
6 changes: 4 additions & 2 deletions DXRFixes/DeusEx/Classes/POVCorpse.uc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ function InitFor(DeusExCarcass carc)
MaxDamage = carc.MaxDamage;
CorpseItemName = carc.itemName;
CarcassName = carc.CarcassName;
ZombieTime = class'DXRHalloween'.static.GetZombieTime(carc);
if(!bNotDead)
ZombieTime = class'DXRHalloween'.static.GetZombieTime(carc);
}

static function POVCorpse Create(DeusExPlayer player, DeusExCarcass carc)
Expand Down Expand Up @@ -65,7 +66,8 @@ function DeusExCarcass Drop(vector dropVect)
carc.SetScaleGlow();
if (carc.SetLocation(dropVect))
{
class'DXRHalloween'.static.SetZombieTime(carc, ZombieTime);
if(!bNotDead)
class'DXRHalloween'.static.SetZombieTime(carc, ZombieTime);
Destroy();
return carc;
}
Expand Down
12 changes: 4 additions & 8 deletions DXRFixes/DeusEx/Classes/ScriptedPawn.uc
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ function TakeDamageBase(int Damage, Pawn instigatedBy, Vector hitlocation, Vecto
_TakeDamageBase(Damage,instigatedBy,hitLocation,momentum,baseDamageType,bPlayAnim);

if (!wasOnFire && bOnFire && instigatedBy==GetPlayerPawn()){
h = Human(GetPlayerPawn());
class'DXREvents'.static.MarkBingo(h.dxr,"IgnitedPawn");
class'DXREvents'.static.MarkBingo("IgnitedPawn");
}

if (bBurnedToDeath) {
Expand All @@ -225,11 +224,8 @@ function TakeDamageBase(int Damage, Pawn instigatedBy, Vector hitlocation, Vecto
}

if ((Health < -100) && !IsA('Robot') && !IsA('Animal'))
{
if (h==None){
h = Human(GetPlayerPawn());
class'DXREvents'.static.MarkBingo(h.dxr,"GibbedPawn");
}
{
class'DXREvents'.static.MarkBingo("GibbedPawn");
}
}

Expand Down Expand Up @@ -575,7 +571,7 @@ function EnableCheckDestLoc(bool bEnable)
if( loopCounter > 10 ) {
message = "EnableCheckDestLoc, bEnable: "$bEnable$", loopCounter: "$loopCounter$", destPoint: "$destPoint$", lastEnableCheckDestLocTime: "$lastEnableCheckDestLocTime;
log(self$": WARNING: "$message);
foreach AllActors(class'DXRando', dxr) break;
dxr = class'DXRando'.default.dxr;
if( dxr != None ) class'DXRTelemetry'.static.SendLog(dxr, Self, "WARNING", message);

//calling the BackOff() function also works and makes them attempt to patrol again after, but I expect it would always just fail over and over
Expand Down
8 changes: 0 additions & 8 deletions DXRMapFixups/DeusEx/Classes/DXRFixupM05.uc
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,9 @@ function BalanceJailbreak()
local DXRMissions missions;
local string PaulLocation;
local #var(prefix)DataLinkTrigger dlt;
local #var(prefix)AnnaNavarre anna;

SetSeed("BalanceJailbreak");

if(dxr.flags.settings.starting_map > 50) {
foreach AllActors(class'#var(prefix)AnnaNavarre', anna) {
anna.Destroy();
}
return;
}

// move the items instead of letting Mission05.uc do it
// Revision also removes ammo and credits, and spawns special weapons from Paul if you saved him
// This logic will cause that to not happen (for now)
Expand Down
18 changes: 9 additions & 9 deletions DXRMapFixups/DeusEx/Classes/DXRFixupM06.uc
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,6 @@ function PreFirstEntryMapFixes()
break;
}
}

if (dxr.flags.settings.starting_map > 66) {
// set Tong to patrol his control room, which is his correct behavior after talking to him after he deactivates your killswitch
foreach AllActors(class'#var(prefix)OrdersTrigger', ot, 'TracerWanders') {
ot.Trigger(self, None);
break;
}
}

break;
case "06_HONGKONG_WANCHAI_MARKET":
if (VanillaMaps) {
Expand Down Expand Up @@ -402,6 +393,15 @@ function PreFirstEntryMapFixes()
}
}

if (dxr.flagbase.GetBool('Meet_MJ12Lab_Supervisor_Played')) { // 70+ starts set this to true
foreach AllActors(class'#var(prefix)ScriptedPawn', p, 'Businessman1') {
if (p.BindName == "MJ12Lab_Supervisor") {
p.SetOrders('Wandering');
break;
}
}
}

Spawn(class'PlaceholderItem',,, vectm(-1.95,1223.1,810.3)); //Table over entrance
Spawn(class'PlaceholderItem',,, vectm(1022.24,-1344.15,450.3)); //Bathroom counter
Spawn(class'PlaceholderItem',,, vectm(1519.6,-1251,442.3)); //Conference room side table
Expand Down
20 changes: 16 additions & 4 deletions DXRMapFixups/DeusEx/Classes/DXRFixupM15.uc
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ function PreFirstEntryMapFixes_Bunker()
local #var(prefix)Fan1 fan;
local #var(prefix)WaltonSimons ws;

if (dxr.flags.settings.starting_map < 151) {
player().DeleteAllGoals();
}

// doors_lower is for backtracking
AddSwitch( vect(4309.076660, -1230.640503, -7522.298340), rot(0, 16384, 0), 'doors_lower');

Expand Down Expand Up @@ -448,6 +444,11 @@ function PreFirstEntryMapFixes_Page()
local #var(prefix)ScriptedPawn sp;
local vector cloneCubeLoc[4];
local string cloneCubeText[4];
local AmbientSound as;
local DXRAmbientSoundTrigger ast;
local bool VanillaMaps;

VanillaMaps = class'DXRMapVariants'.static.IsVanillaMaps(player());

// fix in-fighting
foreach AllActors(class'#var(prefix)ScriptedPawn', sp) {
Expand Down Expand Up @@ -531,6 +532,17 @@ function PreFirstEntryMapFixes_Page()
break;
}
}

if (VanillaMaps) {
foreach AllActors(class'AmbientSound', as) {
if (as.AmbientSound == Sound'Ambient.Ambient.GeigerLoop') {
ast = class'DXRAmbientSoundTrigger'.static.ReplaceAmbientSound(as, 'Gray_rad');
ast.CopyValsToUntriggered(ast);
ast.UntriggeredSoundVolume /= 3;
break;
}
}
}
}

function PreFirstEntryMapFixes()
Expand Down
Loading

0 comments on commit f6f04d2

Please sign in to comment.