Upload from upload_mods.ps1
This commit is contained in:
64
Scripts/MinEvents/MinEventActionInjectDNA.cs
Normal file
64
Scripts/MinEvents/MinEventActionInjectDNA.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class MinEventActionInjectDNA : MinEventActionTargetedBase
|
||||
{
|
||||
public string cvarName { get; private set; }
|
||||
|
||||
public override void Execute(MinEventParams _params)
|
||||
{
|
||||
//Log.Out("MinEventActionInjectDNA-Execute START");
|
||||
if (_params.Self.isEntityRemote && !_params.IsLocal)
|
||||
{
|
||||
//Log.Out("MinEventActionInjectDNA-Execute 1");
|
||||
return;
|
||||
}
|
||||
|
||||
string cvar = "$varFuriousRamsay" + this.genetic + "PercUnit";
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute cvar: " + cvar);
|
||||
|
||||
float geneticsMultiplierOption = float.Parse(RebirthVariables.customGeneticsXPMultiplier) / 100;
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute geneticsMultiplierOption: " + geneticsMultiplierOption);
|
||||
|
||||
float increase = RebirthVariables.localConstants["$varFuriousRamsay" + this.genetic + "UnitPercIncrease_Cst"];
|
||||
|
||||
float currentValue = RebirthVariables.localVariables[cvar];
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute currentValue: " + currentValue);
|
||||
|
||||
increase = RebirthUtilities.GetModifiedIncrease(currentValue, increase);
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute increase: " + increase);
|
||||
|
||||
float newValue = currentValue + increase * geneticsMultiplierOption;
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute BEFORE newValue: " + newValue);
|
||||
|
||||
RebirthUtilities.GetMaxGeneticsProgression(ref newValue, this.genetic);
|
||||
|
||||
//Log.Out("MinEventActionInjectDNA-Execute AFTER newValue: " + newValue);
|
||||
|
||||
RebirthVariables.localVariables[cvar] = newValue;
|
||||
|
||||
RebirthUtilities.ProcessAttribute(_params.Self, cvar);
|
||||
}
|
||||
|
||||
public override bool ParseXmlAttribute(XAttribute _attribute)
|
||||
{
|
||||
bool flag = base.ParseXmlAttribute(_attribute);
|
||||
if (!flag)
|
||||
{
|
||||
string localName = _attribute.Name.LocalName;
|
||||
if (localName == "genetic")
|
||||
{
|
||||
this.genetic = _attribute.Value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
private string genetic = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user