Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.6.3.1 Alpha #684

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions DXRCore/DeusEx/Classes/DXRBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ simulated function bool RandoLevelValues(Actor a, float min, float max, float we
len += removals;

oldseed = SetGlobalSeed(" RandoLevelValues " $ a.class.name );

// choose random points within the 0-1 range, with an extra point so we can remove the median
for(i=0; i < len; i++) {
v = rngexp(0, 100, 1.4) / 100.0;// should this be using a 1.4 curve?
points[i] = v;
}
ReapplySeed( oldseed );

// sort the values
for(i=1; i < len; i++) {
Expand All @@ -285,8 +285,8 @@ simulated function bool RandoLevelValues(Actor a, float min, float max, float we
for(i=0; i < len; i++) {
v = points[i];

if( aug != None ) aug.LevelValues[i] = WeightedLevelValue(aug.LevelValues[i], v, d_max, d_min, wet, i, len);
else if( sk != None ) sk.LevelValues[i] = WeightedLevelValue(sk.LevelValues[i], v, d_max, d_min, wet, i, len);
if( aug != None ) aug.LevelValues[i] = WeightedLevelValue(aug.default.LevelValues[i], v, d_max, d_min, wet, i, len);
else if( sk != None ) sk.LevelValues[i] = WeightedLevelValue(sk.default.LevelValues[i], v, d_max, d_min, wet, i, len);

if( i>0 ) s = s $ ", ";
s = s $ DescriptionLevel(a, i, word);
Expand All @@ -303,7 +303,6 @@ simulated function bool RandoLevelValues(Actor a, float min, float max, float we
#endif

l("RandoLevelValues "$a$" = "$s);
ReapplySeed( oldseed );

if(add_desc != "") {
s = s $ "|n|n" $ add_desc;
Expand Down
4 changes: 2 additions & 2 deletions DXRCore/DeusEx/Classes/DXRInfo.uc
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ static function int _SystemTime(LevelInfo Level)

function bool IsAprilFools()
{
// April Fools! (and the 2nd, because of Jesus_On_Wheels' timezone, and the Randothon 2023 schedule)
return Level.Month == 4 && (Level.Day == 1 || Level.Day == 2) && class'MenuChoice_ToggleMemes'.static.IsEnabled(GetDXR().flags);
// April Fools!
return Level.Month == 4 && Level.Day == 1 && class'MenuChoice_ToggleMemes'.static.IsEnabled(GetDXR().flags);
}

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

simulated static function bool VersionIsStable()
{
return true;
return false;
}

simulated static function string VersionString(optional bool full)
{
local int major,minor,patch,build;
local string status;

status = "";
status = "Alpha";

if(status!="") {
status = " " $ status;
Expand Down
26 changes: 12 additions & 14 deletions DXRModules/DeusEx/Classes/DXRSkills.uc
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,12 @@ simulated function PlayerAnyEntry(#var(PlayerPawn) player)

simulated function RandoSkills(Skill aSkill)
{
local int mission_group;
if( dxr == None ) {
warning("RandoSkills dxr is None");
return;
}

l("randomizing skills with seed " $ dxr.seed $ ", min: "$dxr.flags.settings.minskill$", max: "$dxr.flags.settings.maxskill $", reroll_missions: "$ dxr.flags.settings.skills_reroll_missions $", independent_levels: "$ dxr.flags.settings.skills_independent_levels );
if( dxr.flags.settings.skills_reroll_missions == 0 )
SetGlobalSeed("RandoSkills");
else {
if( dxr.dxInfo != None )
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);
}

if( dxr.flags.settings.minskill > dxr.flags.settings.maxskill ) dxr.flags.settings.maxskill = dxr.flags.settings.minskill;

Expand All @@ -130,10 +121,17 @@ simulated function RandoSkills(Skill aSkill)
simulated function RandoSkill(Skill aSkill)
{
local float percent;
local int i;
local int i, mission_group;
local bool banned;
if( dxr == None ) return;

if( dxr.dxInfo != None && dxr.dxInfo.missionNumber > 0 ) {
// TODO: new game screen should use the starting mission if it isn't 1, but it needs to work even when doing a new game while already in a game
i = dxr.dxInfo.missionNumber;
}
mission_group = Clamp(i, 1, 1000) / dxr.flags.settings.skills_reroll_missions;
SetGlobalSeed("RandoSkills " $ mission_group @ aSkill.class.name);

percent = rngexp(dxr.flags.settings.minskill, dxr.flags.settings.maxskill, skill_cost_curve);
banned = chance_single(dxr.flags.settings.banned_skills);
l( aSkill.Class.Name $ " percent: "$percent$"%, banned: " $ banned );
Expand Down Expand Up @@ -264,7 +262,6 @@ simulated function RandoSkillLevel(Skill aSkill, int i, float parent_percent)
local int m;
local float f, perk;
local SkillCostMultiplier scm;
local class<Skill> c;

if( i>0 && chance_single(dxr.flags.settings.banned_skill_levels) ) {
l( aSkill.Class.Name $ " lvl: "$(i+1)$" is banned");
Expand All @@ -287,9 +284,8 @@ simulated function RandoSkillLevel(Skill aSkill, int i, float parent_percent)
#endif
for(m=0; m < ArrayCount(SkillCostMultipliers); m++) {
scm = SkillCostMultipliers[m];
if( scm.type == "" ) continue;
c = class<Skill>(GetClassFromString(scm.type, class'Skill'));
if( aSkill.IsA(c.name) && i+1 >= scm.minLevel && i < scm.maxLevel ) {
if( scm.type != string(aSkill.class.name) ) continue;
if( i+1 >= scm.minLevel && i < scm.maxLevel ) {
f *= float(scm.percent) / 100.0;
perk *= float(scm.percent) / 100.0;
}
Expand Down Expand Up @@ -368,6 +364,8 @@ function ExtendedTests()

TestWeightedLevelValues(0.008089, 0.052143);

testint(10/0, 0, "divide by 0? 10/0 == 0");

for(f=0.01; f<2; f+=0.02) {
TestWeightedLevelValues(f, f+0.01);
}
Expand Down
2 changes: 1 addition & 1 deletion DXRNonVanilla/DeusEx/Classes/VMDMenuSelectSkills.uc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function String BuildSkillString( Skill aSkill )
local String levelCost, AddStr;
local VMDBufferPlayer VMP;

if ( aSkill.GetCurrentLevel() == 3 )
if ( aSkill.GetCurrentLevel() == ArrayCount(aSkill.Cost) )
levelCost = "--";
else if( aSkill.GetCost() > 98999 )// VMD adjusts skill costs so we need to be more lenient
levelCost = "BANNED";
Expand Down
Binary file modified DeusEx.u
Binary file not shown.
Binary file modified GMDXRandomizer.u
Binary file not shown.
2 changes: 1 addition & 1 deletion GUI/DeusEx/Classes/DXRMenuScreenNewGame.uc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function String BuildSkillString( Skill aSkill )
local String skillString;
local String levelCost;

if ( aSkill.GetCurrentLevel() == 3 )
if ( aSkill.GetCurrentLevel() == ArrayCount(aSkill.Cost) )
levelCost = "--";
else if( aSkill.GetCost() >= 99999 )
levelCost = "BANNED";
Expand Down
3 changes: 1 addition & 2 deletions GUI/DeusEx/Classes/PersonaScreenSkills.uc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ function UpdateSkillBanned(PersonaSkillButtonWindow b)
b.winPointsNeeded.SetPos(260, 0);
b.winPointsNeeded.SetSize(38, 27);
b.winPointsNeeded.SetTextAlignments(HALIGN_Left, VALIGN_Center);
if( s.GetCost() >= 98999 ) {// VMD adjusts skill costs so we need to be more lenient
//b.winPointsNeeded.SetText(b.NotAvailableLabel);
if( s.CurrentLevel < ArrayCount(s.Cost) && s.GetCost() >= 98999 ) {// VMD adjusts skill costs so we need to be more lenient
b.winPointsNeeded.SetText("BANNED");
}
}
Expand Down
Binary file modified HXRandomizer.u
Binary file not shown.
Binary file modified RevRandomizer.u
Binary file not shown.
Binary file modified VMDRandomizer.u
Binary file not shown.