DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ApplyBuildingCheckModifier()

void ScriptedSandstormController::ApplyBuildingCheckModifier ( inout float intensity,
PlayerBase player,
PlayerSandstormData playerData )
inlineprivate

См. определение в файле ScriptedSandstormController.c строка 213

214 {
215 if (!player)
216 return;
217
218 if (intensity <= 0)
219 return;
220
221 Object roofHitObj;
222 bool isUnderRoof = MiscGameplayFunctions.IsUnder(player, EXCLUDED_SHELTER_TYPES, roofHitObj, GameConstants.ROOF_CHECK_RAYCAST_DIST, ObjIntersectIFire);
223 bool isInInterior = player.IsSoundInsideBuilding();
224
225 //ErrorEx(string.Format("Under roof=%1 | In Interior=%2", isUnderRoof, isInInterior), ErrorExSeverity.INFO);
226
227 // Determine if player is currently "inside"
228 bool isCurrentlyInside = (isUnderRoof && isInInterior);
229 bool wasInside = (playerData.GetWasUnderRoof() && playerData.GetWasInInterior());
230 float currentTime = g_Game.GetTime();
231
232 // Initialize transition ONLY if building state actually changed
233 if (isCurrentlyInside != wasInside)
234 {
235 playerData.m_InteriorTransitionTimer = currentTime; // Only reset timer on state change
236 playerData.SetWasUnderRoof(isUnderRoof);
237 playerData.SetWasInInterior(isInInterior);
238 }
239
240 // If not inside and never was inside, no modification needed
241 if (!isCurrentlyInside && !wasInside)
242 return;
243
244 float elapsedTime = currentTime - playerData.m_InteriorTransitionTimer;
245 float transitionProgress = Math.Clamp(elapsedTime * INTERIOR_TRANSITION_DURATON_FRACTION, INTERIOR_TRANSITION_MIN, INTERIOR_TRANSITION_MAX);
246
247 ApplyShelterFade(intensity, isCurrentlyInside, transitionProgress);
248 }
DayZGame g_Game
Определения DayZGame.c:4074
bool GetWasUnderRoof()
Определения PlayerSandstormData.c:38
void SetWasInInterior(bool value)
Определения PlayerSandstormData.c:53
bool GetWasInInterior()
Определения PlayerSandstormData.c:48
void SetWasUnderRoof(bool value)
Определения PlayerSandstormData.c:43
float m_InteriorTransitionTimer
Определения PlayerSandstormData.c:11
const ref array< typename > EXCLUDED_SHELTER_TYPES
Определения ScriptedSandstormController.c:20
void ApplyShelterFade(inout float intensity, bool isCurrentlySheltered, float transitionProgress)
Определения ScriptedSandstormController.c:129
const float INTERIOR_TRANSITION_MAX
Определения ScriptedSandstormController.c:17
const float INTERIOR_TRANSITION_MIN
Определения ScriptedSandstormController.c:16
static const float INTERIOR_TRANSITION_DURATON_FRACTION
Определения ScriptedSandstormController.c:18
class LOD Object

Перекрестные ссылки ApplyShelterFade(), Math::Clamp(), EXCLUDED_SHELTER_TYPES, g_Game, PlayerSandstormData::GetWasInInterior(), PlayerSandstormData::GetWasUnderRoof(), INTERIOR_TRANSITION_DURATON_FRACTION, INTERIOR_TRANSITION_MAX, INTERIOR_TRANSITION_MIN, PlayerSandstormData::m_InteriorTransitionTimer, GameConstants::ROOF_CHECK_RAYCAST_DIST, PlayerSandstormData::SetWasInInterior() и PlayerSandstormData::SetWasUnderRoof().

Используется в GetIntensityForPlayer().