Modding:Effects: Difference between revisions

756 bytes added ,  02:28, 12 March 2021
add exclusions for effect types
mNo edit summary
(add exclusions for effect types)
Line 3: Line 3:


== Effect Types ==
== Effect Types ==
All effects inherit a virtual method called <code>GetEffectType()</code> which seems to return a nonsense integer. It's actually a set of binary flags compressed into an integer. Effects.cs helpfully notes which digit represents what flag and what the following table is based off:
All effects inherit a virtual method called <code>GetEffectType()</code> which seems to return a nonsense integer. It's actually a set of binary flags compressed into an integer. If this is not set, it will default to 1, which is just the generic category. Effects.cs helpfully notes which digit represents what flag and what the following table is based off:
{| class="wikitable"
{| class="wikitable"
! colspan="4" | Mechanisms
! colspan="5" | Mechanisms
|-
|-
! # bit from right
! # bit from right
Line 11: Line 11:
! Decimal
! Decimal
! Binary
! Binary
! Notes
|-
|-
| 1
| 1
Line 16: Line 17:
| 1
| 1
| 0000000000000000000000000001
| 0000000000000000000000000001
|
|-
|-
| 2
| 2
Line 21: Line 23:
| 2
| 2
| 0000000000000000000000000010
| 0000000000000000000000000010
|  cannot be applied to objects that lack a <code>pBrain</code>
|-
|-
| 3
| 3
Line 26: Line 29:
| 4
| 4
| 0000000000000000000000000100
| 0000000000000000000000000100
| cannot be applied to objects without stomachs
|-
|-
| 4
| 4
Line 31: Line 35:
| 8
| 8
| 0000000000000000000000001000
| 0000000000000000000000001000
| cannot be applied to objects without stomachs
|-
|-
| 5
| 5
Line 36: Line 41:
| 16
| 16
| 0000000000000000000000010000
| 0000000000000000000000010000
| cannot be applied to objects that cannot bleed
|-
|-
| 6
| 6
Line 41: Line 47:
| 32
| 32
| 0000000000000000000000100000
| 0000000000000000000000100000
|
|-
|-
| 7
| 7
Line 46: Line 53:
| 64
| 64
| 0000000000000000000001000000
| 0000000000000000000001000000
|
|-
|-
| 8
| 8
Line 51: Line 59:
| 128
| 128
| 0000000000000000000010000000
| 0000000000000000000010000000
| cannot be applied to objects without bodies
|-
|-
| 9
| 9
Line 56: Line 65:
| 256
| 256
| 0000000000000000000100000000
| 0000000000000000000100000000
|
|-
|-
| 10
| 10
Line 61: Line 71:
| 512
| 512
| 0000000000000000001000000000
| 0000000000000000001000000000
|
|-
|-
| 11
| 11
Line 66: Line 77:
| 1024
| 1024
| 0000000000000000010000000000
| 0000000000000000010000000000
|
|-
|-
| 12
| 12
Line 71: Line 83:
| 2048
| 2048
| 0000000000000000100000000000
| 0000000000000000100000000000
|
|-
|-
| 13
| 13
Line 76: Line 89:
| 4096
| 4096
| 0000000000000001000000000000
| 0000000000000001000000000000
|
|-
|-
| 14
| 14
Line 81: Line 95:
| 8192
| 8192
| 0000000000000010000000000000
| 0000000000000010000000000000
|
|-
|-
| 15
| 15
Line 86: Line 101:
| 16384
| 16384
| 0000000000000100000000000000
| 0000000000000100000000000000
|-
|
|}
{| class = "wikitable"
! colspan="4" | Class
! colspan="4" | Class
|-
|-
Line 138: Line 155:
|}
|}


If this is not set, it will default to 1, which is just the generic category.
There are also separate checks in Effect.cs which is checked every time Apply Event Effect is called. Objects that are considered solid will always return true.
{| class="wikitable"
! Effect
! Bits
|-
| Can be applied to liquids
| 6, 11(Contact or Structural)
|-
| Can be applied to gas
| 3, 6, 11 (Metabolic, Contact, or Structural)
|-
| Can be applied to Plasma
| 3, 6, 7, 10, 11, 12 (Metabolic, Contact, Field, Chemical, Structural, or Sonic)
|}
 
=== Methods of masking ===
=== Methods of masking ===
Effects have two methods of checking these masks:
Effects have two methods of checking these masks: