Talk:Overloaded: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Notes from decompilation == {{Code Reference|class=EnergyAmmoLoader.cs}} <pre>if (IsPowerLoadSensitive && E.Subject == ParentObject && E.BaseDamage != "0") { int num...") |
(respond) |
||
Line 29: | Line 29: | ||
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. | 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. | ||
[[User:Teamtoto|Teamtoto]] ([[User talk:Teamtoto|talk]]) 02:19, 2 August 2021 (UTC) | [[User:Teamtoto|Teamtoto]] ([[User talk:Teamtoto|talk]]) 02:19, 2 August 2021 (UTC) | ||
:<li>The name of the variable you're decompiling as <code>@for</code> is just <code>charge</code>. It's the amount of charge to use for heat/breakage calculations. <code>GetOverloadChargeEvent</code> allows that to be modified; it's unused at the moment and just passes back the actual amount of charge consumed.</li> | |||
:<li><code>IsPowerLoadSensitive</code> is a field on <code>IActivePart</code> and only controls applicability of <code>ModOverloaded</code> to <code>IActivePart</code> inheritors; the actual control is <code>IsOverloadableEvent</code>, which <code>IActivePart</code> responds to in a fashion defined by <code>IsPowerLoadSensitive</code> but can also be responded to independently, and two parts do so, <code>Teleprojector</code> and <code>GeomagneticDisk</code>. (So the indication in the page that ganglionic teleprojectors can't be overloaded is incorrect, and it's not that <code>IsPowerLoadSensitive</code> is set to false for it, it's that that field doesn't even exist in <code>Teleprojector</code> because <code>Teleprojector</code> is not an <code>IActivePart</code>.)</li> | |||
:<li>FWIW I don't think becoming tech scannable or EMPable is worth highlighting; it's not clear to me that there's a case where <code>ModOverloaded</code> could be applied where those weren't already the case.</li> | |||
:<li>Also FWIW, the original line for that message is <code>Messaging.XDidY(Object, "overheat", terminalPunctuation: "!", SubjectPossessedBy: who, UseVisibilityOf: who);</code>. What the decompiler is doing to it is pretty hideous. --[[User:Chaos|Chaos]] ([[User talk:Chaos|talk]]) 03:30, 2 August 2021 (UTC)</li> |
Revision as of 03:31, 2 August 2021
Notes from decompilation
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.
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)
- The name of the variable you're decompiling as
@for
is justcharge
. It's the amount of charge to use for heat/breakage calculations.GetOverloadChargeEvent
allows that to be modified; it's unused at the moment and just passes back the actual amount of charge consumed.- The name of the variable you're decompiling as
IsPowerLoadSensitive
is a field onIActivePart
and only controls applicability ofModOverloaded
toIActivePart
inheritors; the actual control isIsOverloadableEvent
, whichIActivePart
responds to in a fashion defined byIsPowerLoadSensitive
but can also be responded to independently, and two parts do so,Teleprojector
andGeomagneticDisk
. (So the indication in the page that ganglionic teleprojectors can't be overloaded is incorrect, and it's not thatIsPowerLoadSensitive
is set to false for it, it's that that field doesn't even exist inTeleprojector
becauseTeleprojector
is not anIActivePart
.)- FWIW I don't think becoming tech scannable or EMPable is worth highlighting; it's not clear to me that there's a case where
ModOverloaded
could be applied where those weren't already the case.- FWIW I don't think becoming tech scannable or EMPable is worth highlighting; it's not clear to me that there's a case where
- Also FWIW, the original line for that message is
Messaging.XDidY(Object, "overheat", terminalPunctuation: "!", SubjectPossessedBy: who, UseVisibilityOf: who);
. What the decompiler is doing to it is pretty hideous. --Chaos (talk) 03:30, 2 August 2021 (UTC)- Also FWIW, the original line for that message is