Skip to content

Instantly share code, notes, and snippets.

@Mailaender
Created September 28, 2014 19:37
Show Gist options
  • Save Mailaender/d5e5b39289f8f551ddb6 to your computer and use it in GitHub Desktop.
Save Mailaender/d5e5b39289f8f551ddb6 to your computer and use it in GitHub Desktop.
OpenRA.Mods.RA.dll decompiled with ikdasm
.class public auto ansi beforefieldinit OpenRA.Mods.RA.SpreadDamageWarhead
extends [OpenRA.Game]OpenRA.GameRules.DamageWarhead
{
.field public initonly valuetype [OpenRA.Game]OpenRA.WRange Spread
.custom instance void [OpenRA.Game]OpenRA.DescAttribute::.ctor(string[]) = ( 01 00 01 00 00 00 1C 52 61 6E 67 65 20 62 65 74 // .......Range bet
77 65 65 6E 20 66 61 6C 6C 6F 66 66 20 73 74 65 // ween falloff ste
70 73 2E 00 00 ) // ps...
.field public valuetype [OpenRA.Game]OpenRA.WRange[] Range
.custom instance void [OpenRA.Game]OpenRA.DescAttribute::.ctor(string[]) = ( 01 00 01 00 00 00 3F 52 61 6E 67 65 73 20 61 74 // ......?Ranges at
20 77 68 69 63 68 20 65 61 63 68 20 46 61 6C 6C // which each Fall
6F 66 66 20 73 74 65 70 20 69 73 20 64 65 66 69 // off step is defi
6E 65 64 2E 20 4F 76 65 72 72 69 64 65 73 20 53 // ned. Overrides S
70 72 65 61 64 2E 00 00 ) // pread...
.field public initonly int32[] Falloff
.custom instance void [OpenRA.Game]OpenRA.DescAttribute::.ctor(string[]) = ( 01 00 01 00 00 00 24 44 61 6D 61 67 65 20 70 65 // ......$Damage pe
72 63 65 6E 74 61 67 65 20 61 74 20 65 61 63 68 // rcentage at each
20 72 61 6E 67 65 20 73 74 65 70 00 00 ) // range step..
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 50 (0x32)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldc.i4.s 43
IL_0003: newobj instance void [OpenRA.Game]OpenRA.WRange::.ctor(int32)
IL_0008: stfld valuetype [OpenRA.Game]OpenRA.WRange OpenRA.Mods.RA.SpreadDamageWarhead::Spread
IL_000d: ldarg.0
IL_000e: ldnull
IL_000f: stfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0014: ldarg.0
IL_0015: ldc.i4.7
IL_0016: newarr [mscorlib]System.Int32
IL_001b: dup
IL_001c: ldtoken field valuetype '<PrivateImplementationDetails>{87516a99-6892-497b-b463-09b35cc57030}'/'$ArrayType=28' '<PrivateImplementationDetails>{87516a99-6892-497b-b463-09b35cc57030}'::'$field-0'
IL_0021: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_0026: stfld int32[] OpenRA.Mods.RA.SpreadDamageWarhead::Falloff
IL_002b: ldarg.0
IL_002c: call instance void [OpenRA.Game]OpenRA.GameRules.DamageWarhead::.ctor()
IL_0031: ret
} // end of method SpreadDamageWarhead::.ctor
.method public hidebysig instance void
InitializeRange() cil managed
{
// Code size 178 (0xb2)
.maxstack 7
.locals init (int32 V_0)
IL_0000: ldarg.0
IL_0001: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0006: brfalse IL_0092
IL_000b: ldarg.0
IL_000c: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0011: ldlen
IL_0012: conv.i4
IL_0013: ldc.i4.1
IL_0014: beq IL_0039
IL_0019: ldarg.0
IL_001a: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_001f: ldlen
IL_0020: conv.i4
IL_0021: ldarg.0
IL_0022: ldfld int32[] OpenRA.Mods.RA.SpreadDamageWarhead::Falloff
IL_0027: ldlen
IL_0028: conv.i4
IL_0029: beq IL_0039
IL_002e: ldstr "Number of range values must be 1 or equal to the n"
+ "umber of Falloff values."
IL_0033: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string)
IL_0038: throw
IL_0039: ldc.i4.0
IL_003a: stloc.0
IL_003b: br IL_007d
IL_0040: ldarg.0
IL_0041: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0046: ldloc.0
IL_0047: ldelema [OpenRA.Game]OpenRA.WRange
IL_004c: ldobj [OpenRA.Game]OpenRA.WRange
IL_0051: ldarg.0
IL_0052: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0057: ldloc.0
IL_0058: ldc.i4.1
IL_0059: add
IL_005a: ldelema [OpenRA.Game]OpenRA.WRange
IL_005f: ldobj [OpenRA.Game]OpenRA.WRange
IL_0064: call bool [OpenRA.Game]OpenRA.WRange::op_GreaterThan(valuetype [OpenRA.Game]OpenRA.WRange,
valuetype [OpenRA.Game]OpenRA.WRange)
IL_0069: brfalse IL_0079
IL_006e: ldstr "Range values must be specified in an increasing or"
+ "der."
IL_0073: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string)
IL_0078: throw
IL_0079: ldloc.0
IL_007a: ldc.i4.1
IL_007b: add
IL_007c: stloc.0
IL_007d: ldloc.0
IL_007e: ldarg.0
IL_007f: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0084: ldlen
IL_0085: conv.i4
IL_0086: ldc.i4.1
IL_0087: sub
IL_0088: blt IL_0040
IL_008d: br IL_00b1
IL_0092: ldarg.0
IL_0093: ldarg.0
IL_0094: ldfld int32[] OpenRA.Mods.RA.SpreadDamageWarhead::Falloff
IL_0099: ldlen
IL_009a: conv.i4
IL_009b: ldarg.0
IL_009c: ldftn instance valuetype [OpenRA.Game]OpenRA.WRange OpenRA.Mods.RA.SpreadDamageWarhead::'<InitializeRange>m__4C9'(int32)
IL_00a2: newobj instance void class [mscorlib]System.Func`2<int32,valuetype [OpenRA.Game]OpenRA.WRange>::.ctor(object,
native int)
IL_00a7: call !!0[] [OpenRA.Game]OpenRA.Exts::MakeArray<valuetype [OpenRA.Game]OpenRA.WRange>(int32,
class [mscorlib]System.Func`2<int32,!!0>)
IL_00ac: stfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_00b1: ret
} // end of method SpreadDamageWarhead::InitializeRange
.method public hidebysig virtual instance void
DoImpact(valuetype [OpenRA.Game]OpenRA.WPos pos,
class [OpenRA.Game]OpenRA.Actor firedBy,
class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> damageModifiers) cil managed
{
// Code size 235 (0xeb)
.maxstack 26
.locals init (class [OpenRA.Game]OpenRA.World V_0,
class [mscorlib]System.Collections.Generic.IEnumerable`1<class [OpenRA.Game]OpenRA.Actor> V_1,
class [mscorlib]System.Collections.Generic.IEnumerator`1<class [OpenRA.Game]OpenRA.Actor> V_2,
class [OpenRA.Game]OpenRA.Actor V_3,
class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> V_4,
class [OpenRA.Game]OpenRA.Traits.HealthInfo V_5,
int32 V_6,
valuetype [OpenRA.Game]OpenRA.WVec V_7,
valuetype [OpenRA.Game]OpenRA.WRange V_8)
IL_0000: ldarg.0
IL_0001: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0006: brtrue IL_0011
IL_000b: ldarg.0
IL_000c: call instance void OpenRA.Mods.RA.SpreadDamageWarhead::InitializeRange()
IL_0011: ldarg.2
IL_0012: ldfld class [OpenRA.Game]OpenRA.World [OpenRA.Game]OpenRA.Actor::World
IL_0017: stloc.0
IL_0018: ldloc.0
IL_0019: ldarg.1
IL_001a: ldarg.0
IL_001b: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0020: ldarg.0
IL_0021: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0026: ldlen
IL_0027: conv.i4
IL_0028: ldc.i4.1
IL_0029: sub
IL_002a: ldelema [OpenRA.Game]OpenRA.WRange
IL_002f: ldobj [OpenRA.Game]OpenRA.WRange
IL_0034: call class [mscorlib]System.Collections.Generic.IEnumerable`1<class [OpenRA.Game]OpenRA.Actor> [OpenRA.Game]OpenRA.WorldUtils::FindActorsInCircle(class [OpenRA.Game]OpenRA.World,
valuetype [OpenRA.Game]OpenRA.WPos,
valuetype [OpenRA.Game]OpenRA.WRange)
IL_0039: stloc.1
IL_003a: ldloc.1
IL_003b: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<class [OpenRA.Game]OpenRA.Actor>::GetEnumerator()
IL_0040: stloc.2
.try
{
IL_0041: br IL_00cd
IL_0046: ldloc.2
IL_0047: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<class [OpenRA.Game]OpenRA.Actor>::get_Current()
IL_004c: stloc.3
IL_004d: ldarg.0
IL_004e: ldloc.3
IL_004f: ldarg.2
IL_0050: call instance bool [OpenRA.Game]OpenRA.GameRules.Warhead::IsValidAgainst(class [OpenRA.Game]OpenRA.Actor,
class [OpenRA.Game]OpenRA.Actor)
IL_0055: brtrue IL_005f
IL_005a: br IL_00cd
IL_005f: ldarg.3
IL_0060: stloc.s V_4
IL_0062: ldloc.3
IL_0063: ldfld class [OpenRA.Game]OpenRA.ActorInfo [OpenRA.Game]OpenRA.Actor::Info
IL_0068: ldfld class [OpenRA.Game]OpenRA.Primitives.TypeDictionary [OpenRA.Game]OpenRA.ActorInfo::Traits
IL_006d: callvirt instance !!0 [OpenRA.Game]OpenRA.Primitives.TypeDictionary::GetOrDefault<class [OpenRA.Game]OpenRA.Traits.HealthInfo>()
IL_0072: stloc.s V_5
IL_0074: ldloc.s V_5
IL_0076: brfalse IL_00c3
IL_007b: ldc.i4.0
IL_007c: ldloc.3
IL_007d: callvirt instance valuetype [OpenRA.Game]OpenRA.WPos [OpenRA.Game]OpenRA.Actor::get_CenterPosition()
IL_0082: ldarg.1
IL_0083: call valuetype [OpenRA.Game]OpenRA.WVec [OpenRA.Game]OpenRA.WPos::op_Subtraction(valuetype [OpenRA.Game]OpenRA.WPos,
valuetype [OpenRA.Game]OpenRA.WPos)
IL_0088: stloc.s V_7
IL_008a: ldloca.s V_7
IL_008c: call instance int32 [OpenRA.Game]OpenRA.WVec::get_Length()
IL_0091: ldloc.s V_5
IL_0093: ldfld valuetype [OpenRA.Game]OpenRA.WRange [OpenRA.Game]OpenRA.Traits.HealthInfo::Radius
IL_0098: stloc.s V_8
IL_009a: ldloca.s V_8
IL_009c: ldfld int32 [OpenRA.Game]OpenRA.WRange::Range
IL_00a1: sub
IL_00a2: call int32 [mscorlib]System.Math::Max(int32,
int32)
IL_00a7: stloc.s V_6
IL_00a9: ldloc.s V_4
IL_00ab: ldc.i4.1
IL_00ac: newarr [mscorlib]System.Int32
IL_00b1: dup
IL_00b2: ldc.i4.0
IL_00b3: ldarg.0
IL_00b4: ldloc.s V_6
IL_00b6: call instance int32 OpenRA.Mods.RA.SpreadDamageWarhead::GetDamageFalloff(int32)
IL_00bb: stelem.i4
IL_00bc: call class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0> [OpenRA.Game]OpenRA.Exts::Append<int32>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0>,
!!0[])
IL_00c1: stloc.s V_4
IL_00c3: ldarg.0
IL_00c4: ldloc.3
IL_00c5: ldarg.2
IL_00c6: ldloc.s V_4
IL_00c8: callvirt instance void [OpenRA.Game]OpenRA.GameRules.DamageWarhead::DoImpact(class [OpenRA.Game]OpenRA.Actor,
class [OpenRA.Game]OpenRA.Actor,
class [mscorlib]System.Collections.Generic.IEnumerable`1<int32>)
IL_00cd: ldloc.2
IL_00ce: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext()
IL_00d3: brtrue IL_0046
IL_00d8: leave IL_00ea
} // end .try
finally
{
IL_00dd: ldloc.2
IL_00de: brfalse IL_00e9
IL_00e3: ldloc.2
IL_00e4: callvirt instance void [mscorlib]System.IDisposable::Dispose()
IL_00e9: endfinally
} // end handler
IL_00ea: ret
} // end of method SpreadDamageWarhead::DoImpact
.method private hidebysig instance int32
GetDamageFalloff(int32 distance) cil managed
{
// Code size 102 (0x66)
.maxstack 6
.locals init (int32 V_0,
int32 V_1,
int32 V_2)
IL_0000: ldarg.0
IL_0001: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_0006: ldc.i4.0
IL_0007: ldelema [OpenRA.Game]OpenRA.WRange
IL_000c: ldfld int32 [OpenRA.Game]OpenRA.WRange::Range
IL_0011: stloc.0
IL_0012: ldc.i4.1
IL_0013: stloc.1
IL_0014: br IL_0056
IL_0019: ldarg.0
IL_001a: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_001f: ldloc.1
IL_0020: ldelema [OpenRA.Game]OpenRA.WRange
IL_0025: ldfld int32 [OpenRA.Game]OpenRA.WRange::Range
IL_002a: stloc.2
IL_002b: ldloc.2
IL_002c: ldarg.1
IL_002d: ble IL_0050
IL_0032: ldarg.0
IL_0033: ldfld int32[] OpenRA.Mods.RA.SpreadDamageWarhead::Falloff
IL_0038: ldloc.1
IL_0039: ldc.i4.1
IL_003a: sub
IL_003b: ldelem.i4
IL_003c: ldarg.0
IL_003d: ldfld int32[] OpenRA.Mods.RA.SpreadDamageWarhead::Falloff
IL_0042: ldloc.1
IL_0043: ldelem.i4
IL_0044: ldarg.1
IL_0045: ldloc.0
IL_0046: sub
IL_0047: ldloc.2
IL_0048: ldloc.0
IL_0049: sub
IL_004a: call int32 [OpenRA.Game]OpenRA.int2::Lerp(int32,
int32,
int32,
int32)
IL_004f: ret
IL_0050: ldloc.2
IL_0051: stloc.0
IL_0052: ldloc.1
IL_0053: ldc.i4.1
IL_0054: add
IL_0055: stloc.1
IL_0056: ldloc.1
IL_0057: ldarg.0
IL_0058: ldfld valuetype [OpenRA.Game]OpenRA.WRange[] OpenRA.Mods.RA.SpreadDamageWarhead::Range
IL_005d: ldlen
IL_005e: conv.i4
IL_005f: blt IL_0019
IL_0064: ldc.i4.0
IL_0065: ret
} // end of method SpreadDamageWarhead::GetDamageFalloff
.method private hidebysig instance valuetype [OpenRA.Game]OpenRA.WRange
'<InitializeRange>m__4C9'(int32 i) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.1
IL_0001: ldarg.0
IL_0002: ldfld valuetype [OpenRA.Game]OpenRA.WRange OpenRA.Mods.RA.SpreadDamageWarhead::Spread
IL_0007: call valuetype [OpenRA.Game]OpenRA.WRange [OpenRA.Game]OpenRA.WRange::op_Multiply(int32,
valuetype [OpenRA.Game]OpenRA.WRange)
IL_000c: ret
} // end of method SpreadDamageWarhead::'<InitializeRange>m__4C9'
} // end of class OpenRA.Mods.RA.SpreadDamageWarhead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment