Talk:Overloaded

Add topic
Revision as of 02:19, 2 August 2021 by Teamtoto (talk | contribs) (Created page with "== Notes from decompilation == {{Code Reference|class=EnergyAmmoLoader.cs}} <pre>if (IsPowerLoadSensitive && E.Subject == ParentObject && E.BaseDamage != "0") { int num...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Notes from decompilation

[1]

if (IsPowerLoadSensitive && E.Subject == ParentObject && E.BaseDamage != "0")
			{
				int num = MyPowerLoadBonus(); // +=300 if overloaded, =100 by default {{Code Reference|class=IActivePart.cs|method=MyPowerLoadBonus}}
				if (num != 0)
				{
					E.GetDamageRoll()?.AdjustResult(num);
				}
			}
			return base.HandleEvent(E); load min value baseline 100 divisor 150 

IsPowerLoadSensitive is true by default, the only ones that are specified to be false is hypertractor, ganglionic teleprojector, and the overloaded laser pistol (presumably because it is already overloaded). i dont understand AdjustResult, but it always seems to add a +2 to the original damage.

[2]

int @for = GetOverloadChargeEvent.GetFor(Object, Amount);
			if (@for > 0)
			{
				GameObject gameObject = Object.Equipped ?? Object.Implantee ?? Object.InInventory;
				Object.TemperatureChange(1 + @for / 100, gameObject);
				gameObject?.TemperatureChange(1 + @for / 100, gameObject);
				if ((1 + @for / 10).in10000() && Object.ApplyEffect(new Broken(FromDamage: false, FromExamine: false, FromOverload: true)))
				{
					Messaging.XDidY(Object, "overheat", null, "!", null, null, null, UseFullNames: false, IndefiniteSubject: false, gameObject, null, DescribeSubjectDirection: false, DescribeSubjectDirectionLate: false, AlwaysVisible: false, FromDialog: false, UsePopup: false, gameObject);
				}
			}

I have no idea what number the event here is returning X_X if i learn what @for is here, I would be able to get everything. Teamtoto (talk) 02:19, 2 August 2021 (UTC)

  1. XRL.World.Parts.EnergyAmmoLoader.cs
  2. XRL.World.ChargeUsedEvent.cs
Return to "Overloaded" page.