1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_ANIMATION_INTERVAL_OFFSET_S = 1.3
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_ANIMATION_INTERVAL_OFFSET_MAX_S = 12.1
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ALPHA_FACTOR = 1.1
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ALPHA_MAX = 0.25
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ALPHA_MAX_FOCUS = 0.25
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ANIMATION_INTERVAL_S = 2
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ANIMATION_INTERVAL_OFFSET_S = 0.75
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_COUNT = 2
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_SPEED_FACTOR = 1
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_SCALE_MAX = 1.5
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_SCALE_MIN = 1
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_UV_OFFSET_MAX = 0.1
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_BRIGHTNESS_FACTOR = 1.35
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_BRIGHTNESS_MAX = 1
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_BRIGHTNESS_MIN = 0.75
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_INTERVAL_S = 2.5
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_ALPHA_MAX = 0.7
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_ALPHA_MIN = 0.4
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_OFFSET = 0
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_ORIGIN_X = 0.5
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_ORIGIN_Y = 1.2
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_SAMPLES = 11
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_STRENGTH = 0.25
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_CROSSFADE_INTERVAL_S = 0.06
ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_SPEED_FACTOR = 1.5
local g_endlessDungeonAvatarVisionParticlePool = nil -- Initialized by ZO_EndlessDungeonAvatarVisionParticle_Shared.InitializeTopLevelWindow
end
g_endlessDungeonAvatarVisionParticlePool = ZO_ControlPool : New ( "ZO_EndDunAvatarVisionParticle_Shared" , control , "EndDunAvatarVisionParticle" )
end
-- Animates an Avatar Vision particle instance.
-- Adds variety when multiple Avatar Visions are visible at once.
-- Offsets the texture UV coordinates each time this instance fades in.
local progress = ( GetFrameTimeSeconds ( ) + instanceOffset ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_SPEED_FACTOR
local interval = ( progress % ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ANIMATION_INTERVAL_S ) / ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ANIMATION_INTERVAL_S
local randomOffsetX = zo_sin ( randomAngleRadians ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_UV_OFFSET_MAX
local left , right = 0 , 1
if randomOffsetX < 0 then
left = left + randomOffsetX
else
right = right + randomOffsetX
end
local randomOffsetY = zo_cos ( randomAngleRadians ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_UV_OFFSET_MAX
local top , bottom = 0 , 1
if randomOffsetY < 0 then
top = top + randomOffsetY
else
bottom = bottom + randomOffsetY
end
end
-- Expands the instance as it fades out.
local scale = zo_lerp ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_SCALE_MIN , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_SCALE_MAX , interval )
-- Fades the instance in and out.
local alphaFactor = parentControl . highlightTexture : IsHidden ( ) and ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ALPHA_MAX or ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ALPHA_MAX_FOCUS
local alpha = zo_min ( zo_sin ( interval * ZO_PI ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ALPHA_FACTOR , 1 ) * alphaFactor
end
end
end
-- Setup buff instance.
local stackCountString = ( data . stackCount and data . stackCount > 1 ) and tostring ( data . stackCount ) or ""
-- Defer creation of particle metapool for this instance until it is now necessary.
end
-- Setup particle instances.
local waveOffset = 0
for particleIndex = 1 , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_COUNT do
particleTexture . previousInterval = math . huge
particleTexture . instanceIntervalOffsetS = ( particleIndex - 1 ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PARTICLE_ANIMATION_INTERVAL_OFFSET_S
end
end
end
end
end
highlightTexture . alphaFactor = 0
highlightTexture . transitionFadeInEndTimeS = nil
highlightTexture . transitionFadeOutEndTimeS = nil
end
local alphaFactor = highlightTexture . alphaFactor or 0
highlightTexture . transitionAlphaFactor = alphaFactor
if hidden then
highlightTexture . transitionFadeOutEndTimeS = currentFrameTimeS + ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_CROSSFADE_INTERVAL_S * alphaFactor )
highlightTexture . transitionFadeInEndTimeS = nil
else
highlightTexture . transitionFadeOutEndTimeS = nil
highlightTexture . transitionFadeInEndTimeS = currentFrameTimeS + ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_CROSSFADE_INTERVAL_S * ( 1 - alphaFactor ) )
end
end
local interval = ( ( GetFrameTimeSeconds ( ) + self . instanceIntervalOffsetS ) % ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_INTERVAL_S ) / ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_INTERVAL_S
local progress = zo_min ( zo_sin ( interval * ZO_PI ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_BRIGHTNESS_FACTOR , 1 )
local brightness = zo_lerp ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_BRIGHTNESS_MIN , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_AVATAR_VISION_PULSE_BRIGHTNESS_MAX , progress )
end
do
local VERTEX_POINTS_BOTTOM = VERTEX_POINTS_BOTTOMLEFT + VERTEX_POINTS_BOTTOMRIGHT
local VERTEX_POINTS_ALL = VERTEX_POINTS_BOTTOM + VERTEX_POINTS_TOPLEFT + VERTEX_POINTS_TOPRIGHT
local alphaFactor = highlightTexture . alphaFactor
if highlightTexture . transitionFadeOutEndTimeS then
alphaFactor = zo_lerp ( highlightTexture . transitionAlphaFactor , 0 , 1 - zo_min ( ( highlightTexture . transitionFadeOutEndTimeS - GetFrameTimeSeconds ( ) ) / ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_CROSSFADE_INTERVAL_S , 1 ) )
if alphaFactor <= 0 then
highlightTexture . alphaFactor = 0
highlightTexture . transitionFadeOutEndTimeS = nil
return
end
highlightTexture . alphaFactor = alphaFactor
elseif highlightTexture . transitionFadeInEndTimeS then
alphaFactor = zo_lerp ( highlightTexture . transitionAlphaFactor , 1 , 1 - zo_min ( ( highlightTexture . transitionFadeInEndTimeS - GetFrameTimeSeconds ( ) ) / ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_CROSSFADE_INTERVAL_S , 1 ) )
if alphaFactor >= 1 then
alphaFactor = 1
highlightTexture . transitionFadeInEndTimeS = nil
end
highlightTexture . alphaFactor = alphaFactor
end
-- Animation interval offset for this particular buff instance (for visual variety).
local progress = ( GetFrameTimeSeconds ( ) + instanceIntervalOffsetS ) * ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_SPEED_FACTOR
highlightTexture : SetRadialBlur ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_ORIGIN_X , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_ORIGIN_Y , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_SAMPLES , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_STRENGTH , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_BLUR_OFFSET )
do
local alpha = zo_lerp ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_ALPHA_MIN , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_ALPHA_MAX , alphaCoefficient )
local intensityAndAlpha = alpha * alphaFactor
highlightTexture : SetVertexColors ( VERTEX_POINTS_TOPLEFT , intensityAndAlpha , intensityAndAlpha , intensityAndAlpha , intensityAndAlpha )
end
do
local alpha = zo_lerp ( ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_ALPHA_MAX , ZO_ENDLESS_DUNGEON_BUFF_GRID_ENTRY_HIGHLIGHT_ALPHA_MIN , alphaCoefficient )
local intensityAndAlpha = alpha * alphaFactor
highlightTexture : SetVertexColors ( VERTEX_POINTS_TOPRIGHT , intensityAndAlpha , intensityAndAlpha , intensityAndAlpha , intensityAndAlpha )
end
end
end |