diff --git a/.github/run-tests/action.yml b/.github/run-tests/action.yml index b21a9f7ce..90622d995 100644 --- a/.github/run-tests/action.yml +++ b/.github/run-tests/action.yml @@ -28,14 +28,14 @@ runs: curl -Lo installer/3rdParty/D3D9Drv.dll "https://github.com/Defaultplayer001/Deus-Ex-Universe-Community-Update-/raw/master/%5B1.0%5D%20Deus%20Ex%20-%20Windows-Linux-macOS-Android/DXCU%20Installer%20Source/Mods/Community%20Update/System/D3D9Drv.dll" shell: bash - - run: >- - curl -Lo installer/3rdParty/D3D9Drv.hut - "https://github.com/Defaultplayer001/Deus-Ex-Universe-Community-Update-/raw/master/%5B1.0%5D%20Deus%20Ex%20-%20Windows-Linux-macOS-Android/DXCU%20Installer%20Source/Mods/Community%20Update/System/D3D9Drv.hut" - shell: bash - - run: >- - curl -Lo installer/3rdParty/D3D9Drv.int - "https://github.com/Defaultplayer001/Deus-Ex-Universe-Community-Update-/raw/master/%5B1.0%5D%20Deus%20Ex%20-%20Windows-Linux-macOS-Android/DXCU%20Installer%20Source/Mods/Community%20Update/System/D3D9Drv.int" - shell: bash + #- run: >- + # curl -Lo installer/3rdParty/D3D9Drv.hut + # "https://github.com/Defaultplayer001/Deus-Ex-Universe-Community-Update-/raw/master/%5B1.0%5D%20Deus%20Ex%20-%20Windows-Linux-macOS-Android/DXCU%20Installer%20Source/Mods/Community%20Update/System/D3D9Drv.hut" + # shell: bash + #- run: >- + # curl -Lo installer/3rdParty/D3D9Drv.int + # "https://github.com/Defaultplayer001/Deus-Ex-Universe-Community-Update-/raw/master/%5B1.0%5D%20Deus%20Ex%20-%20Windows-Linux-macOS-Android/DXCU%20Installer%20Source/Mods/Community%20Update/System/D3D9Drv.int" + # shell: bash # download and extract OpenGL 2.0 https://github.com/Defaultplayer001/Deus-Ex-Universe-Community-Update-/tree/master/%5B1.0%5D%20Deus%20Ex%20-%20Windows-Linux-macOS-Android/CommunityUpdateFileArchiveDXPC/OpenGL - run: >- diff --git a/BingoDisplay.py b/BingoDisplay.py index 704930ef6..617721028 100644 --- a/BingoDisplay.py +++ b/BingoDisplay.py @@ -1,10 +1,7 @@ import argparse import time import sys -import json import os.path -import urllib.request -import urllib.parse import re from tkinter import filedialog as fd from tkinter import font @@ -144,7 +141,7 @@ def parseBingoLine(self,bingoLine): bingoMatches=self.bingoLineMatch.match(bingoLine) if (bingoMatches==None): return - + bingoNumber=int(bingoMatches.group('key')) bingoCoord = self.bingoNumberToCoord(bingoNumber) @@ -216,29 +213,29 @@ def generateBingoStateJson(self): square["possible"]=self.board[x][y]["active"]!=-1 #print(square) board.append(square) - #return json.dumps(board,indent=4) - return {"bingo":json.dumps({"bingo":board},indent=4)} + #return {"bingo":json.dumps({"bingo":board},indent=4)} def sendBingoState(self): - if not os.path.isfile(JSON_DEST_FILENAME): - return - - f = open(JSON_DEST_FILENAME,'r') - desturl=f.readline() - f.close() - - if (desturl==""): - print("Make sure to specify where you want to push your json!") - return - - bingoState = self.generateBingoStateJson() - #print(bingoState) - try: - r = urllib.request.urlopen(desturl,data=urllib.parse.urlencode(bingoState).encode('utf-8')) - #print(r.status) - #print(r.read().decode('utf-8')) - except Exception as e: - print("Couldn't push JSON to "+desturl+" - "+str(e)) + pass + # if not os.path.isfile(JSON_DEST_FILENAME): + # return + + # f = open(JSON_DEST_FILENAME,'r') + # desturl=f.readline() + # f.close() + + # if (desturl==""): + # print("Make sure to specify where you want to push your json!") + # return + + # bingoState = self.generateBingoStateJson() + # #print(bingoState) + # try: + # r = urllib.request.urlopen(desturl,data=urllib.parse.urlencode(bingoState).encode('utf-8')) + # #print(r.status) + # #print(r.read().decode('utf-8')) + # except Exception as e: + # print("Couldn't push JSON to "+desturl+" - "+str(e)) def saveLastUsedBingoFile(f): diff --git a/DXRCore/DeusEx/Classes/DXRVersion.uc b/DXRCore/DeusEx/Classes/DXRVersion.uc index db57a4784..4f3cc39ad 100644 --- a/DXRCore/DeusEx/Classes/DXRVersion.uc +++ b/DXRCore/DeusEx/Classes/DXRVersion.uc @@ -5,7 +5,7 @@ simulated static function CurrentVersion(optional out int major, optional out in major=2; minor=5; patch=3; - build=6;//build can't be higher than 99 + build=11;//build can't be higher than 99 } simulated static function string VersionString(optional bool full) @@ -13,7 +13,7 @@ simulated static function string VersionString(optional bool full) local int major,minor,patch,build; local string status; - status = "Beta"; + status = ""; if(status!="") { status = " " $ status; diff --git a/DXRFixes/DeusEx/Classes/ScriptedPawn.uc b/DXRFixes/DeusEx/Classes/ScriptedPawn.uc index 8c52fa490..5506180c4 100644 --- a/DXRFixes/DeusEx/Classes/ScriptedPawn.uc +++ b/DXRFixes/DeusEx/Classes/ScriptedPawn.uc @@ -210,7 +210,7 @@ function _TakeDamageBase(int Damage, Pawn instigatedBy, Vector hitlocation, Vect DrawShield(); } - if(damageType != 'Stunned' && damageType != 'TearGas' && damageType != 'HalonGas' && + if(!bInvincible && damageType != 'Stunned' && damageType != 'TearGas' && damageType != 'HalonGas' && damageType != 'PoisonGas' && damageType != 'Radiation' && damageType != 'EMP' && damageType != 'NanoVirus' && damageType != 'Drowned' && damageType != 'Poison' && damageType != 'PoisonEffect') diff --git a/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc b/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc index ec98fe172..562643a42 100644 --- a/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc +++ b/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc @@ -109,6 +109,8 @@ function MissionTimer() function AddMissionGoals() { local DeusExGoal newGoal; + local Inventory item; + if(dxr.localURL != "01_NYC_UNATCOISLAND") return; //The MeetPaul conversation would normally give you several goals. @@ -121,6 +123,12 @@ function AddMissionGoals() newGoal=player().AddGoal('MeetFilben',False); newGoal.SetText("Meet UNATCO informant Harley Filben at the North Docks. He has a key to the Statue doors."); + + if (player().FindInventoryType(class'Image01_LibertyIsland')==None){ + item = Spawn(class'Image01_LibertyIsland'); + item.Frob(player(), None); + } + } function AfterMoveGoalToLocation(Goal g, GoalLocation Loc) diff --git a/DXRModules/DeusEx/Classes/DXREvents.uc b/DXRModules/DeusEx/Classes/DXREvents.uc index d4a89a52c..97069c53b 100644 --- a/DXRModules/DeusEx/Classes/DXREvents.uc +++ b/DXRModules/DeusEx/Classes/DXREvents.uc @@ -139,6 +139,9 @@ function WatchActors() foreach AllActors(class'#var(prefix)WaterCooler',cooler){ AddWatchedActor(cooler,"Dehydrated"); } + foreach AllActors(class'#var(prefix)WaterFountain',fountain){ + AddWatchedActor(fountain,"Dehydrated"); + } foreach AllActors(class'#var(prefix)HangingChicken',chicken){ AddWatchedActor(chicken,"BeatTheMeat"); } @@ -432,15 +435,6 @@ function SetWatchFlags() { bt.MakeClassProximityTrigger(class'#var(prefix)JuanLebedevCarcass'); } - - if(RevisionMaps){ - - } else { - bt = class'BingoTrigger'.static.Create(self,'Cremation',vectm(-2983.597168,774.217407,312.100128),70,40); - bt.MakeClassProximityTrigger(class'#var(prefix)ChefCarcass'); - bt = class'BingoTrigger'.static.Create(self,'Cremation',vectm(-2984.404785,662.764954,312.100128),70,40); - bt.MakeClassProximityTrigger(class'#var(prefix)ChefCarcass'); - } foreach AllActors(class'#var(prefix)Female2',f) { if(f.BindName == "Shannon"){ f.bImportant = true; @@ -1655,7 +1649,7 @@ function _AddPawnDeath(ScriptedPawn victim, optional Actor Killer, optional coer _MarkBingo(classname$"_ClassDeadM" $ dxr.dxInfo.missionNumber); //Were they an ally? Skip on NSF HQ, because that's kind of a bait - if (!isInitialPlayerEnemy(victim) && //Must have not been an enemy initially + if (!isInitialPlayerEnemy(victim) && !IsCritter(victim) && //Must have not been an enemy initially (dxr.localURL!="04_NYC_NSFHQ" || (dxr.localURL=="04_NYC_NSFHQ" && dxr.flagbase.GetBool('DL_SimonsPissed_Played')==False)) //Not on the NSF HQ map, or if it is, before you send the signal (kludgy) ){ _MarkBingo("AlliesKilled"); @@ -1997,6 +1991,8 @@ simulated function _CreateBingoBoard(PlayerDataItem data) options[num_options++] = x; } + l("_CreateBingoBoard found " $ num_options $ " options"); + for(x=0; x max) { - i = min; - min = max; - max = i; - } else if(min == max) { - min--; - max++; - } -} - -function NewGamePlusVal(out int val, float curve, float exp, optional int max) -{ - if(val > 0) { - val = val * (curve ** exp);// int *= float doesn't give as good accuracy as int = int*float - if(val <= 0) val = 1; - } - if(max != 0 && val>max) { - val=max; - } -} - function RunTests() { local int i, t; diff --git a/DXRModules/DeusEx/Classes/DXRFlagsNGPMaxRando.uc b/DXRModules/DeusEx/Classes/DXRFlagsNGPMaxRando.uc index d2b00b85e..39a77f776 100644 --- a/DXRModules/DeusEx/Classes/DXRFlagsNGPMaxRando.uc +++ b/DXRModules/DeusEx/Classes/DXRFlagsNGPMaxRando.uc @@ -191,20 +191,20 @@ function NewGamePlus() SetGlobalSeed("NewGamePlus"); p.CombatDifficulty=FClamp(p.CombatDifficulty*1.3,0,15); //Anything over 15 is kind of unreasonably impossible - NewGamePlusVal(settings.minskill, 1.2, exp, 1000); - NewGamePlusVal(settings.maxskill, 1.2, exp, 1500); - NewGamePlusVal(settings.enemiesrandomized, 1.2, exp, 1500); - NewGamePlusVal(settings.enemystats, 1.2, exp, 100); - NewGamePlusVal(settings.hiddenenemiesrandomized, 1.2, exp, 1500); - NewGamePlusVal(settings.ammo, 0.9, exp); - NewGamePlusVal(settings.medkits, 0.8, exp); - NewGamePlusVal(settings.multitools, 0.8, exp); - NewGamePlusVal(settings.lockpicks, 0.8, exp); - NewGamePlusVal(settings.biocells, 0.8, exp); - NewGamePlusVal(settings.medbots, 0.8, exp); - NewGamePlusVal(settings.repairbots, 0.8, exp); - NewGamePlusVal(settings.turrets_add, 1.3, exp, 1000); - NewGamePlusVal(settings.merchants, 0.9, exp); + NewGamePlusVal(settings.minskill, 1.1, exp, 10, 1000); + NewGamePlusVal(settings.maxskill, 1.1, exp, 10, 1500); + NewGamePlusVal(settings.enemiesrandomized, 1.2, exp, 10, 1000); + NewGamePlusVal(settings.enemystats, 1.2, exp, 5, 100); + NewGamePlusVal(settings.hiddenenemiesrandomized, 1.2, exp, 10, 1000); + NewGamePlusVal(settings.ammo, 0.9, exp, 5, 100); + NewGamePlusVal(settings.medkits, 0.9, exp, 5, 100); + NewGamePlusVal(settings.multitools, 0.9, exp, 5, 100); + NewGamePlusVal(settings.lockpicks, 0.9, exp, 5, 100); + NewGamePlusVal(settings.biocells, 0.9, exp, 5, 100); + NewGamePlusVal(settings.medbots, 0.9, exp, 3, 100); + NewGamePlusVal(settings.repairbots, 0.9, exp, 3, 100); + NewGamePlusVal(settings.turrets_add, 1.3, exp, 3, 1000); + NewGamePlusVal(settings.merchants, 0.9, exp, 5, 100); settings.bingo_win = bingo_win; settings.bingo_freespaces = bingo_freespaces; if (randomStart!=0){ @@ -290,3 +290,62 @@ simulated function RemoveRandomWeapon(#var(PlayerPawn) p) p.DeleteInventory(weaps[slot]); weaps[slot].Destroy(); } + +simulated function MaxRandoVal(out int val) +{ + val = rngrecip(val, 2); +} + +simulated function MaxRandoValPair(out int min, out int max) +{ + local int i; + + MaxRandoVal(min); + MaxRandoVal(max); + + if(min > max) { + i = min; + min = max; + max = i; + } else if(min == max) { + min--; + max++; + } +} + +function NewGamePlusVal(out int val, float curve, float exp, int min, int max) +{ + val = val * (curve ** exp);// int *= float doesn't give as good accuracy as int = int*float + val = Self.Min(val, max); + val = Self.Max(val, min); +} + +function ExtendedTests() +{ + local int val; + Super.ExtendedTests(); + + val = 5; + NewGamePlusVal(val, 1.2, 3, 1, 100); + testint(val, 8, "NewGamePlusVal 1.2 goes up"); + + val = 5; + NewGamePlusVal(val, 0.8, 3, 1, 100); + testint(val, 2, "NewGamePlusVal 1.2 goes down"); + + val = 5; + NewGamePlusVal(val, 0.8, 3, 5, 100); + testint(val, 5, "NewGamePlusVal with minimum stays the same"); // can't explain that! + + val = 5; + NewGamePlusVal(val, 1.2, 3, 1, 5); + testint(val, 5, "NewGamePlusVal 1.2 with maximum"); + + val = 0; + NewGamePlusVal(val, 1.2, 3, -10, 100); + testint(val, 0, "NewGamePlusVal 1.2 val==0"); + + val = -5; + NewGamePlusVal(val, 1.2, 3, -6, 100); + testint(val, -6, "NewGamePlusVal 1.2 negative value"); +} diff --git a/DXRModules/DeusEx/Classes/DXRSkills.uc b/DXRModules/DeusEx/Classes/DXRSkills.uc index 16f1c8fe0..044e75db8 100644 --- a/DXRModules/DeusEx/Classes/DXRSkills.uc +++ b/DXRModules/DeusEx/Classes/DXRSkills.uc @@ -113,7 +113,7 @@ simulated function RandoSkills(Skill aSkill) SetGlobalSeed("RandoSkills"); else { if( dxr.dxInfo != None ) - mission_group = dxr.dxInfo.missionNumber; + mission_group = dxr.dxInfo.missionNumber;// TODO: new game screen should use the starting mission if it isn't 1 mission_group = Clamp(mission_group, 1, 1000) / dxr.flags.settings.skills_reroll_missions; SetGlobalSeed("RandoSkills " $ mission_group); } @@ -263,7 +263,7 @@ simulated function RandoSkillLevel(Skill aSkill, int i, float parent_percent) local SkillCostMultiplier scm; local class c; - if( chance_single(dxr.flags.settings.banned_skill_levels) ) { + if( i>0 && chance_single(dxr.flags.settings.banned_skill_levels) ) { l( aSkill.Class.Name $ " lvl: "$(i+1)$" is banned"); aSkill.Cost[i] = 99999; return; diff --git a/DXRModules/DeusEx/Classes/DXRStartMap.uc b/DXRModules/DeusEx/Classes/DXRStartMap.uc index c2f8ad09e..d1dd7f669 100644 --- a/DXRModules/DeusEx/Classes/DXRStartMap.uc +++ b/DXRModules/DeusEx/Classes/DXRStartMap.uc @@ -383,12 +383,14 @@ static function bool BingoGoalImpossible(string bingo_event, int start_map, int case "LouisBerates": case "IcarusCalls_Played": return start_map>100; //All these early Paris things - if we were to add a "Streets" starting location, this would need to be split more accurately + case "ManWhoWasThursday":// in 10_Paris_Catacombs, and then 12_Vandenberg_Cmd, but nothing in M11 + return start_map > 100 && end_mission <= 11; case "PresentForManderley": //Have to be able to get Juan from mission 3 and bring him to the start of mission 4 if (end_mission < 4){ return True; } - return start_map>40; + return start_map>=40; default: return False; } diff --git a/DXRModules/DeusEx/Classes/DXRStats.uc b/DXRModules/DeusEx/Classes/DXRStats.uc index 303d8f953..ce1ec2d29 100644 --- a/DXRModules/DeusEx/Classes/DXRStats.uc +++ b/DXRModules/DeusEx/Classes/DXRStats.uc @@ -498,7 +498,7 @@ function DrawLeaderboard(GC gc) gc.DrawBox(0, yPos, 650, 25, 0, 0, 1, Texture'Solid'); } gc.DrawText(2,yPos,30,50, "#"$runs[i].place$"."); - gc.DrawText(30,yPos,200,50, runs[i].name); + gc.DrawText(40,yPos,200,50, runs[i].name); gc.DrawText(250,yPos,100,50, IntCommas(runs[i].score)); gc.DrawText(350,yPos,100,50, fmtTimeToString(runs[i].time)); gc.DrawText(450,yPos,100,50, runs[i].flagshash); @@ -634,22 +634,22 @@ function TestScoring() bingo_win, bingos, bingo_spots, skill_points, nanokeys, cheats; dxr.flags.SetDifficulty(1); - testint(dxr.flags.ScoreFlags(), 4570, "score bonus for Normal"); + testint(dxr.flags.ScoreFlags(), 4870, "score bonus for Normal"); dxr.flags.SetDifficulty(2); - testint(dxr.flags.ScoreFlags(), 9980, "score bonus for Hard"); + testint(dxr.flags.ScoreFlags(), 10580, "score bonus for Hard"); dxr.flags.SetDifficulty(3); - testint(dxr.flags.ScoreFlags(), 12080, "score bonus for Extreme"); + testint(dxr.flags.ScoreFlags(), 12680, "score bonus for Extreme"); dxr.flags.SetDifficulty(4); - testint(dxr.flags.ScoreFlags(), 13745, "score bonus for Impossible"); + testint(dxr.flags.ScoreFlags(), 14645, "score bonus for Impossible"); names[num] = "1 Million Points!"; scores[num++] = 1000000; - names[num] = "130k Points"; - scores[num++] = 130000; + names[num] = "140k Points"; + scores[num++] = 140000; names[num] = "literal god: 1 hour, Impossible difficulty, full bingo, 5 saves, 5 loads"; time=72000; time_without_menus=36000; combat_difficulty=3; rando_difficulty=4; saves=5; loads=5; @@ -659,6 +659,9 @@ function TestScoring() scores[num++] = _ScoreRun(time, time_without_menus, combat_difficulty, flags_score, saves, loads, bingo_win, bingos, bingo_spots, skill_points, nanokeys, cheats); + names[num] = "130k Points"; + scores[num++] = 130000; + names[num] = "literal god: 1 hour, full bingo, 5 saves, 5 loads"; time=72000; time_without_menus=36000; combat_difficulty=2; rando_difficulty=2; saves=5; loads=5; bingo_win=0; bingos=12; bingo_spots=24; skill_points=10000; nanokeys=200; cheats=0; diff --git a/DeusEx.u b/DeusEx.u index a7b0594fb..48573234e 100644 Binary files a/DeusEx.u and b/DeusEx.u differ diff --git a/GMDXRandomizer.u b/GMDXRandomizer.u index 7cd4fa81b..c3cd25ece 100644 Binary files a/GMDXRandomizer.u and b/GMDXRandomizer.u differ diff --git a/GUI/DeusEx/Classes/BingoTile.uc b/GUI/DeusEx/Classes/BingoTile.uc index 88b6b4879..c3b8bb600 100644 --- a/GUI/DeusEx/Classes/BingoTile.uc +++ b/GUI/DeusEx/Classes/BingoTile.uc @@ -121,7 +121,7 @@ simulated function string GetHelpText() helpmsg=helpmsg$"|n|n"$GenerateMissionString(); if (max>1){ - helpmsg=helpmsg$"|n|n"; + helpmsg=helpmsg$"|n"; helpmsg=helpmsg$"Progress: "$progress$"/"$max; } diff --git a/GUI/DeusEx/Classes/HUDSpeedrunSplits.uc b/GUI/DeusEx/Classes/HUDSpeedrunSplits.uc index e0ca8043c..b47d5c17c 100644 --- a/GUI/DeusEx/Classes/HUDSpeedrunSplits.uc +++ b/GUI/DeusEx/Classes/HUDSpeedrunSplits.uc @@ -6,18 +6,29 @@ class HUDSpeedrunSplits expands HUDBaseWindow config(DXRSplits); var DeusExPlayer player; var DXRStats stats; +var config int version; var config Font textfont; -var config int windowWidth, windowHeight; + var config Color colorBackground, colorText, colorBehind, colorBehindLosingTime, colorBehindGainingTime, colorAhead, colorAheadLosingTime, colorAheadGainingTime, colorBest, colorBestBehind, colorBestAhead; -var config bool enabled, minimal; +var config bool enabled, showPrevprev, showPrev, showCurrentMission, showNext, showSeg, showCur, showPB, showSpeed; var config int PB[16]; var config int Golds[16]; +var config string title, subtitle, footer; +var string ttitle, tsubtitle, tfooter; + var int balanced_splits[16], balanced_splits_totals[16]; var int PB_total, sum_of_bests; -var float left_col, center_col, text_height, x_pos, y_pos; + +var config string split_names[16]; + +var float left_col, left_col_small, center_col, text_height, ty_pos; +var float windowWidth, windowHeight; + +var config float x_pos, y_pos; +var float prevSpeed, avgSpeed, lastTime; // ---------------------------------------------------------------------- // InitWindow() @@ -29,6 +40,59 @@ event InitWindow() player = DeusExPlayer(DeusExRootWindow(GetRootWindow()).parentPawn); Hide(); + + if(class'DXRVersion'.static.VersionOlderThan(version, 2,5,3,7)) { + version = class'DXRVersion'.static.VersionNumber(); + x_pos = 0; + y_pos = 0; + SaveConfig(); + } +} + +function string ReplaceVariables(string s) +{ + local string t; + local DXRando dxr; + local DXRFlags f; + local DXRLoadouts loadouts; + local int i, id; + + dxr = stats.dxr; + f = dxr.flags; + + t = f.DifficultyName(f.difficulty) $""; + s = f.ReplaceText(s, "%difficulty", t); + + t = stats.GetDataStorageStat(dxr, "DXRStats_loads") $""; + s = f.ReplaceText(s, "%loads", t); + + t = stats.GetDataStorageStat(dxr, "DXRStats_deaths") $""; + s = f.ReplaceText(s, "%deaths", t); + + t = stats.ToHex(f.FlagsHash()); + s = f.ReplaceText(s, "%flagshash", t); + + t = f.VersionString(true); + s = f.ReplaceText(s, "%version", t); + + t = f.seed $""; + s = f.ReplaceText(s, "%seed", t); + + t = f.mirroredmaps $ "%"; + s = f.ReplaceText(s, "%mirroredmaps", t); + + loadouts = DXRLoadouts(dxr.FindModule(class'DXRLoadouts')); + t = "All Items Allowed"; + if(loadouts != None) { + id = loadouts.GetIdForSlot(f.loadout); + t = loadouts.GetName(id); + } + s = f.ReplaceText(s, "%loadout", t); + + t = player.TruePlayerName; + s = f.ReplaceText(s, "%playername", t); + + return s; } function InitStats(DXRStats newstats) @@ -44,6 +108,9 @@ function InitStats(DXRStats newstats) return; } + ttitle = ReplaceVariables(title); + tsubtitle = ReplaceVariables(subtitle); + tfooter = ReplaceVariables(footer); curMission = stats.dxr.dxInfo.MissionNumber; for(i=1; i<=15; i++) { @@ -118,14 +185,41 @@ function UpdatePos() if (hud != None) { if(hud.belt != None) beltHeight = hud.belt.height; } - x_pos = 0; - y_pos = GetRootWindow().height - beltHeight - windowHeight - 8; + ty_pos = GetRootWindow().height - beltHeight - windowHeight - 8 - y_pos; +} + +function InitSizes(GC gc) +{ + local int i; + local float f; + local string s; + + for(i=0; i=1; i--) { + time = stats.missions_times[i]; + time += stats.missions_menu_times[i]; + if(time > 0) { + prevprev = i; + prevprevTime = time; + break; + } + } + for(i=cur+1; i<=15; i++) { if(balanced_splits[i] > 0) { next = i; @@ -168,82 +272,137 @@ function DrawWindow(GC gc) // drawing text x = 8; y = 4; + if(left_col == 0) { - gc.GetTextExtent(0, left_col, text_height, "MXXii"); - gc.GetTextExtent(0, center_col, text_height, "+00:00"); + InitSizes(gc); } h = text_height; + gc.SetTextColor(colorText); + gc.SetAlignments(HALIGN_Center, VALIGN_Center); + if(ttitle!="") { + gc.DrawText(x+x_pos, y+ty_pos, windowWidth - x, text_height, ttitle); + y += h; + } + if(tsubtitle!="") { + gc.DrawText(x+x_pos, y+ty_pos, windowWidth - x, text_height, tsubtitle); + y += h; + } + gc.SetAlignments(HALIGN_Left, VALIGN_Center); + + // prevprev split + if(prevprev > 0 && showPrevprev) { + time = cur_totals[prevprev] - balanced_splits_totals[prevprev]; + t = prevprevTime - balanced_splits[prevprev]; + msg = fmtTimeDiff(time); + + s = fmtTime(cur_totals[prevprev]); + DrawTextLine(gc, MissionName(prevprev), msg, GetCmpColor(time, t, prevprevTime, Golds[prevprev]), x, y, s); + y += h; + } + // previous split - if(prev > 0 && !minimal) { + if(prev > 0 && showPrev) { time = cur_totals[prev] - balanced_splits_totals[prev]; t = prevTime - balanced_splits[prev]; msg = fmtTimeDiff(time); s = fmtTime(cur_totals[prev]); DrawTextLine(gc, MissionName(prev), msg, GetCmpColor(time, t, prevTime, Golds[prev]), x, y, s); + y += h; } - y += h; // current/upcoming split, showing balanced PB time - if(!minimal) { + if(showCurrentMission) { msg = fmtTime(balanced_splits_totals[cur]); - DrawTextLine(gc, MissionName(cur), msg, colorText, x, y); + DrawTextLine(gc, MissionName(cur), "", colorText, x, y, msg); + y += h; } - y += h; // next split - if(next > 0 && !minimal) { + if(next > 0 && showNext) { msg = fmtTime(balanced_splits_totals[next]); - DrawTextLine(gc, MissionName(next), msg, colorText, x, y); + DrawTextLine(gc, MissionName(next), "", colorText, x, y, msg); + y += h; } - y += h; - if(minimal) y += h; // current segment time with comparison - msg = fmtTimeSeg(curTime); - s = "/ " $ fmtTimeSeg(balanced_splits[cur]); - t = curTime - balanced_splits[cur]; - DrawTextLine(gc, "SEG:", msg, GetCmpColor(t, t), x, y, s); - y += h; + if(showSeg) { + msg = fmtTimeSeg(curTime); + s = "/ " $ fmtTimeSeg(balanced_splits[cur]); + t = curTime - balanced_splits[cur]; + DrawTextLine(gc, "SEG:", msg, GetCmpColor(t, t), x, y, s, true); + y += h; + } // current overall time - time = cur_totals[prev] - balanced_splits_totals[prev]; - msg = fmtTime(total); - DrawTextLine(gc, "CUR:", msg, GetCmpColor(time, t), x, y); - y += h; + if(showCur) { + time = cur_totals[prev] - balanced_splits_totals[prev]; + msg = fmtTime(total); + DrawTextLine(gc, "CUR:", msg, GetCmpColor(time, t), x, y, "", true); + y += h; + } // PB time - if(!minimal) { + if(showPB) { msg = fmtTime(PB_total); - DrawTextLine(gc, "PB:", msg, colorText, x, y); + DrawTextLine(gc, "PB:", msg, colorText, x, y, "", true); + y += h; + } + + if(showSpeed) { + delta = player.Level.TimeSeconds - lastTime; + delta *= 4.0; + lastTime = player.Level.TimeSeconds; + + f = VSize(player.Velocity * vect(1,1,0)); + avgSpeed -= avgSpeed * delta; + avgSpeed += f * delta; + msg = stats.FloatToString(FMax(f, prevSpeed), 1); + s = stats.FloatToString(avgSpeed, 1); + prevSpeed = f; + DrawTextLine(gc, "SPD:", msg, colorText, x, y, s, true); + y += h; + } + + if(tfooter != "") { + gc.SetAlignments(HALIGN_Center, VALIGN_Center); + gc.SetTextColor(colorText); + gc.DrawText(x+x_pos, y+ty_pos, windowWidth - x, text_height, tfooter); + y += h; } - y += h; + windowHeight = y; } function string MissionName(int mission) { + if(split_names[mission] != "") return split_names[mission]; if(mission < 10) return "M0" $ mission; else return "M" $ mission; } -function DrawTextLine(GC gc, string header, string msg, Color c, int x, int y, optional string extra) +function DrawTextLine(GC gc, string header, string msg, Color c, int x, int y, optional string extra, optional bool small) { - local float w, h; + local float w, h, column; x += x_pos; - y += y_pos; + y += ty_pos; gc.SetTextColor(colorText); - gc.DrawText(x, y, windowWidth - x, text_height, header); + gc.DrawText(x, y, width - x, text_height, header); gc.SetTextColor(c); gc.GetTextExtent(0, w, h, header); - left_col = FMax(left_col, w); text_height = FMax(text_height, h); - x += left_col; + if(small) { + left_col_small = FMax(left_col_small, w); + x += left_col_small; + } else { + left_col = FMax(left_col, w); + x += left_col; + } - gc.DrawText(x, y, windowWidth - x, text_height, msg); + gc.DrawText(x, y, width - x, text_height, msg); if(extra == "") return; @@ -252,7 +411,7 @@ function DrawTextLine(GC gc, string header, string msg, Color c, int x, int y, o text_height = FMax(text_height, h); x += center_col; - gc.DrawText(x, y, windowWidth - x, text_height, " " $ extra); + gc.DrawText(x, y, width - x, text_height, " " $ extra); } function Color GetCmpColor(int overall_diff, int diff, optional int segtime, optional int gold) @@ -283,8 +442,8 @@ function string fmtTime(int time) function string fmtTimeDiff(int diff) { - if(diff <= 0) return "-" $ stats.fmtTimeToString(-diff, true, true); - return "+" $ stats.fmtTimeToString(diff, true, true); + if(diff <= 0) return "-" $ stats.fmtTimeToString(-diff, true, true, true); + return "+" $ stats.fmtTimeToString(diff, true, true, true); } function int BalancedSplit(int m) @@ -311,7 +470,7 @@ function DrawBackground(GC gc) { gc.SetStyle(backgroundDrawStyle); gc.SetTileColor(colorBackground); - gc.DrawPattern(x_pos, y_pos, windowWidth, windowHeight, 0, 0, Texture'Solid'); + gc.DrawPattern(x_pos, ty_pos, windowWidth, windowHeight, 0, 0, Texture'Solid'); } // ---------------------------------------------------------------------- @@ -320,8 +479,15 @@ function DrawBackground(GC gc) defaultproperties { enabled=true - windowWidth=165 - windowHeight=80 + showPrevprev=false + showPrev=true + showCurrentMission=true + showNext=true + showSeg=true + showCur=true + showPB=true + showSpeed=true + textfont=Font'DeusExUI.FontMenuHeaders_DS'; colorBackground=(R=0,G=0,B=0,A=100) colorText=(R=255,G=255,B=255,A=255) @@ -337,4 +503,22 @@ defaultproperties colorBest=(R=216,G=175,B=31,A=255) colorBestBehind=(R=216,G=175,B=31,A=255) colorBestAhead=(R=216,G=175,B=31,A=255) + + title="Deus Ex Randomizer" + subtitle="%version %difficulty Speedrun" + footer="" + + split_names(1)="Liberty Island" + split_names(2)="Generator" + split_names(3)="Airfield" + split_names(4)="Paul" + split_names(5)="Jail" + split_names(6)="Hong Kong" + split_names(8)="Finding Dowd" + split_names(9)="Ship" + split_names(10)="Paris" + split_names(11)="Cathedral" + split_names(12)="Vandenberg" + split_names(14)="Silo" + split_names(15)="Area 51" } diff --git a/HXRandomizer.u b/HXRandomizer.u index 3b831a799..03d774ed6 100644 Binary files a/HXRandomizer.u and b/HXRandomizer.u differ diff --git a/README.md b/README.md index 2e53f2450..943e53b1b 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ If you don't know what Deus Ex Randomizer is, then here's our old trailer which * Randomizer Lite - randomizes some things without interfering with the immersion and mood of the game. Great for players who haven't played Deus Ex in a long time, or if you're intimidated by the full Randomizer. * Serious Sam mode - same as the normal game but with 10x as many enemies. The player has increased health and takes reduced damage to compensate. * Walton Ware mode - Walton Ware mode: a game mode focused on quickly doing bingos and New Game+. - * Speedrun mode - speedrun with fewer resets while still being able to enjoy higher difficulties. + * Speedrun mode - speedrun with fewer resets while still being able to enjoy higher difficulties. And a built in splits viewers! * Challenge mode loadouts! [(Wiki page)](https://github.com/Die4Ever/deus-ex-randomizer/wiki/Loadouts) * Stick With the Prod Pure means the only weapon you get is the stun prod (hint: throw a crate straight up into the air to break it) * Stick With the Prod Plus also allows EMP grenades, gas grenades, scramble grenades, pepper gun, and tranq darts diff --git a/RevRandomizer.u b/RevRandomizer.u index 0177f5b10..daf732fec 100644 Binary files a/RevRandomizer.u and b/RevRandomizer.u differ diff --git a/VMDRandomizer.u b/VMDRandomizer.u index 608a28f51..b7bae7a57 100644 Binary files a/VMDRandomizer.u and b/VMDRandomizer.u differ diff --git a/installer/Configs/D3D9Drv.int b/installer/Configs/D3D9Drv.int new file mode 100644 index 000000000..dc00eeb13 --- /dev/null +++ b/installer/Configs/D3D9Drv.int @@ -0,0 +1,9 @@ +[Public] +Object=(Name=D3D9Drv.D3D9RenderDevice,Class=Class,MetaClass=Engine.RenderDevice,Autodetect=) +Preferences=(Caption="Rendering",Parent="Advanced Options") +Preferences=(Caption="Direct3D9 support",Parent="Rendering",Class=D3D9Drv.D3D9RenderDevice,Immediate=True) + +[D3D9RenderDevice] +ClassCaption="Direct3D9 Support" +AskInstalled=Do you have Direct3D installed? +AskUse=Do you want to use Direct3D? diff --git a/installer/Install/__init__.py b/installer/Install/__init__.py index 74bdc549c..b59e85a85 100644 --- a/installer/Install/__init__.py +++ b/installer/Install/__init__.py @@ -264,12 +264,14 @@ def ModifyConfig(defconfig:Path, config:Path, outdefconfig:Path, outconfig:Path, def CopyD3DRenderers(system:Path): - thirdparty = GetSourcePath() / '3rdParty' + source = GetSourcePath() + thirdparty = source / '3rdParty' info('CopyD3DRenderers from', thirdparty, ' to ', system) CopyTo(thirdparty/'D3D9Drv.dll', system/'D3D9Drv.dll', True) - CopyTo(thirdparty/'D3D9Drv.hut', system/'D3D9Drv.hut', True) - CopyTo(thirdparty/'D3D9Drv.int', system/'D3D9Drv.int', True) + #CopyTo(thirdparty/'D3D9Drv.hut', system/'D3D9Drv.hut', True) + (system/'D3D9Drv.hut').unlink(True)# this file seems to slow down opening the kentie config page? + CopyTo(source/'Configs'/'D3D9Drv.int', system/'D3D9Drv.int', True) CopyTo(thirdparty/'d3d10drv.dll', system/'d3d10drv.dll', True) CopyTo(thirdparty/'D3D10Drv.int', system/'D3D10Drv.int', True) @@ -290,6 +292,7 @@ def CopyDXVK(system:Path, install:bool): if install: CopyTo(f, dest) elif dest.exists(): + debug('DXVK deleting', dest) dest.unlink(True) num += 1 assert num > 0, 'Found '+str(num)+' DXVK files'