TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ GetWeight()

virtual float Terraria.ModLoader.ModSceneEffect.GetWeight ( Player player)
inlinevirtual

Is invoked when two or more modded SceneEffect layers are active within the same P:Terraria.ModLoader.ModSceneEffect.Priority group to attempt to determine which one should take precedence, if it matters. It's uncommon to have the need to assign a weight - you'd have to specifically believe that you don't need higher SceneEffectPriority, but do need to be the active SceneEffect within the priority you designated. Analogously, if SceneEffect were competing in a wrestling match, this would be how likely the SceneEffect should win within its weight class. Is intentionally bounded at a max of 100% (1) to reduce complexity. Defaults to 50% (0.5). Typical calculations may include: 1) how many tiles are present as a percentage of target amount; 2) how far away you are from the cause of the SceneEffect.

Definition at line 71 of file ModSceneEffect.cs.

72 {
73 return 0.5f;
74 }

Referenced by Terraria.ModLoader.ModSceneEffect.GetCorrWeight().

+ Here is the caller graph for this function: