public override void Draw(double frameTime) { AEntity player = WorldModel.Entities.GetPlayerEntity(); Position3D center = player.Position; if ((player as Mobile).IsAlive) { AEntityView.s_Technique = Techniques.Default; m_ShowingDeathEffect = false; if (m_YouAreDead != null) { m_YouAreDead.Dispose(); m_YouAreDead = null; } } else { if (!m_ShowingDeathEffect) { m_ShowingDeathEffect = true; m_DeathEffectTime = 0; m_LightingGlobal = Isometric.Lighting.OverallLightning; m_LightingPersonal = Isometric.Lighting.PersonalLightning; m_UI.AddControl(m_YouAreDead = new YouAreDeadGump(), 0, 0); } double msFade = 2000d; double msHold = 1000d; if (m_DeathEffectTime < msFade) { AEntityView.s_Technique = Techniques.Default; Isometric.Lighting.OverallLightning = (int)(m_LightingGlobal + (0x1f - m_LightingGlobal) * ((m_DeathEffectTime / msFade))); Isometric.Lighting.PersonalLightning = (int)(m_LightingPersonal * (1d - (m_DeathEffectTime / msFade))); } else if (m_DeathEffectTime < msFade + msHold) { Isometric.Lighting.OverallLightning = 0x1f; Isometric.Lighting.PersonalLightning = 0x00; } else { AEntityView.s_Technique = Techniques.Grayscale; Isometric.Lighting.OverallLightning = (int)m_LightingGlobal; Isometric.Lighting.PersonalLightning = (int)m_LightingPersonal; if (m_YouAreDead != null) { m_YouAreDead.Dispose(); m_YouAreDead = null; } } m_DeathEffectTime += frameTime; } Isometric.Update(Model.Map, center, Model.Input.MousePick); MiniMap.Update(Model.Map, center); }
public override void Draw(double frameTime) { var player = WorldModel.Entities.GetPlayerEntity(); if (player == null) { return; } if (Model.Map == null) { return; } var center = player.Position; if ((player as Mobile).IsAlive) { AEntityView.Technique = Techniques.Default; _showingDeathEffect = false; if (_youAreDead != null) { _youAreDead.Dispose(); _youAreDead = null; } } else { if (!_showingDeathEffect) { _showingDeathEffect = true; _deathEffectTime = 0; _lightingGlobal = Isometric.Lighting.OverallLightning; _lightingPersonal = Isometric.Lighting.PersonalLightning; _ui.AddControl(_youAreDead = new YouAreDeadGump(), 0, 0); } var msFade = 2000d; var msHold = 1000d; if (_deathEffectTime < msFade) { AEntityView.Technique = Techniques.Default; Isometric.Lighting.OverallLightning = (int)(_lightingGlobal + (0x1f - _lightingGlobal) * ((_deathEffectTime / msFade))); Isometric.Lighting.PersonalLightning = (int)(_lightingPersonal * (1d - (_deathEffectTime / msFade))); } else if (_deathEffectTime < msFade + msHold) { Isometric.Lighting.OverallLightning = 0x1f; Isometric.Lighting.PersonalLightning = 0x00; } else { AEntityView.Technique = Techniques.Grayscale; Isometric.Lighting.OverallLightning = (int)_lightingGlobal; Isometric.Lighting.PersonalLightning = (int)_lightingPersonal; if (_youAreDead != null) { _youAreDead.Dispose(); _youAreDead = null; } } _deathEffectTime += frameTime; } Isometric.Update(Model.Map, center, Model.Input.MousePick); MiniMap.Update(Model.Map, center); }