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

Updates to AIOFab and UpgradedVehicles for BelowZero #142

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DaWrecka
Copy link

AIOFabricator: implemented GetGameObjectAsync; no other modifications appear to be required, although LoadImageFiles was added to OnFinishedPatching as well as OnStartedPatching to deal with intermittent oddities.

CustomBatteries: more BelowZero modifications - GameObject modification was moved to its own method to minimise code duplication; GetGameObject() and GetGameObjectAsync() load the required prefab in their way, then pass control to ModifyPrefab(), which performs the modifications common to both versions.

UpgradedVehicles
*) Updated to work with BelowZero, including Seatruck
*) Implemented an API in the form of multiple public static methods in VehicleUpgrader to allow third-party mods to plug in to UpgradedVehicles;
AddEfficiencyBonus(): registers a TechType as one that modifies engine efficiency; a value of 1f is equal to the VehiclePowerUpgradeModule.
AddSpeedModifier(): registers a module as one that modifies vehicle speed. 1f provides a bonus equal to the Speed Module. efficiencyValue is the amount by which the module reduces engine efficiency
AddArmourModule(): registers module as one that reduces vehicle damage.
AddDepthModule(): registers module as a depth module. This does not actually modify depth limit; perhaps for a future version?

AIOFabricator: implemented GetGameObjectAsync; no other modifications appear to be required, although LoadImageFiles was added to OnFinishedPatching as well as OnStartedPatching to deal with intermittent oddities.

CustomBatteries: more BelowZero modifications - GameObject modification was moved to its own method to minimise code duplication; GetGameObject() and GetGameObjectAsync() load the required prefab in their way, then pass control to ModifyPrefab(), which performs the modifications common to both versions.

UpgradedVehicles
*) Updated to work with BelowZero, including Seatruck
*) Implemented an API in the form of multiple public static methods in VehicleUpgrader to allow third-party mods to plug in to UpgradedVehicles;
  AddEfficiencyBonus(): registers a TechType as one that modifies engine efficiency; a value of 1f is equal to the VehiclePowerUpgradeModule.
  AddSpeedModifier(): registers a module as one that modifies vehicle speed. 1f provides a bonus equal to the Speed Module. efficiencyValue is the amount by which the module reduces engine efficiency
  AddArmourModule(): registers module as one that reduces vehicle damage.
  AddDepthModule(): registers module as a depth module. This does not actually modify depth limit; perhaps for a future version?
Copy link
Collaborator

@MrPurple6411 MrPurple6411 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few questions. I am ok if the answer is no. other then these questions it looks good to me. at least nothing glaringly obvious. Will make a build and test after questions.

UpgradedVehicles/Patchers.cs Outdated Show resolved Hide resolved
UpgradedVehicles/QPatch.cs Outdated Show resolved Hide resolved
UpgradedVehicles/QPatch.cs Outdated Show resolved Hide resolved
UpgradedVehicles/SaveData/ConfigSaveData.cs Outdated Show resolved Hide resolved
UpgradedVehicles/SaveData/ConfigSaveData.cs Outdated Show resolved Hide resolved
UpgradedVehicles/SaveData/UpgradeOptions.cs Outdated Show resolved Hide resolved
UpgradedVehicles/VehicleUpgrader.cs Outdated Show resolved Hide resolved
_exosuitBonusSpeedMultiplier = upgradeOptions.ExosuitBonusSpeedMultiplier;
}

// Original values from the Vehicle class
private const float BaseSeamothSpeed = 11.5f;
#if SUBNAUTICA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

}

if (IsSeamoth)
#if SUBNAUTICA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

v.onGroundForceMultiplier = this.SpeedMultiplier * BaseExosuitWalkSpeed;
ErrorMessage.AddMessage($"Prawn Suit Land Speed: {v.onGroundForceMultiplier}m/s ({this.SpeedMultiplier * 100f:00}%)");

}
Copy link
Collaborator

@MrPurple6411 MrPurple6411 Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrmmm isnt the hoverbike a vehicle?? maybe if we are adding BZ support we should do something for it here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I think sn1 has custom vehicles now that might benefit from some cross mod support?

UpgradedVehicles/VehicleUpgrader.cs Show resolved Hide resolved
@@ -40,6 +42,7 @@ public AiOFab()
"Multi-fuction fabricator capable of synthesizing most blueprints.")
{
OnStartedPatching += LoadImageFiles;
OnFinishedPatching += LoadImageFiles;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to run the LoadImageFiles routine twice?
Would it be enough to only run on the OnFinishedPatching event?

UpgradedVehicles
*) Reinstated some blocks which had been locked out to SN1-only
*) Renamed VehicleUpgrader.EfficientyBonus to EfficiencyBonus
AiOFab.cs was changed to remove redundant image file loading

UpgradedVehicles:
*) Removed the "optional" part from efficiencyModifier argument in AddSpeedModifier method; adding a speed modifier *must* include an efficiency modifier. 0 remains a valid value, however. SpeedBooster.cs was modified to accommodate this change.
*) Minor modification to VehicleUpgrader.CalculateDepthModuleIndex(); there is no functional difference at present, but this will be used in a future update to allow for other vehicles to be registered.
*) VehicleUpgrader.GetEfficiencyPentalty() was renamed to GetEfficiencyPenalty
*) Fixed a bug whereby speed modules would only be counted once, regardless of how many were equipped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants