From f0aeeafc65985539635097a345fc5ecd75beb2a5 Mon Sep 17 00:00:00 2001 From: INeedAUniqueUsername Date: Tue, 29 Aug 2017 13:54:54 -0700 Subject: [PATCH 1/2] Update disadvantage/degradation tag colors --- Transcendence/CGSelectorArea.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Transcendence/CGSelectorArea.cpp b/Transcendence/CGSelectorArea.cpp index b62bb1b4..f5c58662 100644 --- a/Transcendence/CGSelectorArea.cpp +++ b/Transcendence/CGSelectorArea.cpp @@ -870,10 +870,10 @@ void CGSelectorArea::PaintInstalledItem (CG32bitImage &Dest, const RECT &rcRect, if (Entry.pItemCtx->GetEnhancementDisplayAttributes(&Attribs)) { const CString &sMods = Attribs[0].sText; - bool bIsDisadvantage = (Attribs[0].iType == attribWeakness); + bool bIsDisadvantage = (Attribs[0].iType == attribDegradation); - CG32bitPixel rgbBackColor = (bIsDisadvantage ? m_VI.GetColor(colorAreaDisadvantage) : m_VI.GetColor(colorAreaAdvantage)); - CG32bitPixel rgbTextColor = (bIsDisadvantage ? m_VI.GetColor(colorTextDisadvantage) : m_VI.GetColor(colorTextAdvantage)); + CG32bitPixel rgbBackColor = (bIsDisadvantage ? m_VI.GetColor(colorAreaDegradation) : m_VI.GetColor(colorAreaEnhancement)); + CG32bitPixel rgbTextColor = (bIsDisadvantage ? m_VI.GetColor(colorAreaDegradation) : m_VI.GetColor(colorAreaEnhancement)); PaintModifier(Dest, x, y, sMods, rgbTextColor, rgbBackColor, &y); } @@ -937,10 +937,10 @@ void CGSelectorArea::PaintInstalledItem (CG32bitImage &Dest, const RECT &rcRect, // Damaged if (pDevice->IsDamaged()) - PaintModifier(Dest, x, y, CONSTLIT("damaged"), m_VI.GetColor(colorTextDisadvantage), m_VI.GetColor(colorAreaDisadvantage), &y); + PaintModifier(Dest, x, y, CONSTLIT("damaged"), m_VI.GetColor(colorTextDisadvantage), m_VI.GetColor(colorAreaDegradation), &y); if (pDevice->IsDisrupted()) - PaintModifier(Dest, x, y, CONSTLIT("ionized"), m_VI.GetColor(colorTextDisadvantage), m_VI.GetColor(colorAreaDisadvantage), &y); + PaintModifier(Dest, x, y, CONSTLIT("ionized"), m_VI.GetColor(colorTextDisadvantage), m_VI.GetColor(colorAreaDegradation), &y); // Modifiers @@ -950,8 +950,8 @@ void CGSelectorArea::PaintInstalledItem (CG32bitImage &Dest, const RECT &rcRect, if (!sMods.IsBlank()) { bool bIsDisadvantage = *sMods.GetASCIIZPointer() == '-'; - CG32bitPixel rgbBackColor = (bIsDisadvantage ? m_VI.GetColor(colorAreaDisadvantage) : m_VI.GetColor(colorAreaAdvantage)); - CG32bitPixel rgbTextColor = (bIsDisadvantage ? m_VI.GetColor(colorTextDisadvantage) : m_VI.GetColor(colorTextAdvantage)); + CG32bitPixel rgbBackColor = (bIsDisadvantage ? m_VI.GetColor(colorAreaDegradation) : m_VI.GetColor(colorAreaEnhancement)); + CG32bitPixel rgbTextColor = (bIsDisadvantage ? m_VI.GetColor(colorAreaDegradation) : m_VI.GetColor(colorAreaEnhancement)); PaintModifier(Dest, x, y, sMods, rgbTextColor, rgbBackColor, &y); } From 363306b1cad4b3c849f673f48a3e26d675e72594 Mon Sep 17 00:00:00 2001 From: INeedAUniqueUsername Date: Tue, 29 Aug 2017 13:59:47 -0700 Subject: [PATCH 2/2] Mention extra conditions (radiation, blinding, paralysis, disarming) in epitaph --- Transcendence/CTranscendenceModel.cpp | 31 +++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Transcendence/CTranscendenceModel.cpp b/Transcendence/CTranscendenceModel.cpp index f5b2cc0b..f9da0945 100644 --- a/Transcendence/CTranscendenceModel.cpp +++ b/Transcendence/CTranscendenceModel.cpp @@ -188,9 +188,7 @@ CString CTranscendenceModel::CalcEpitaph (SDestroyCtx &Ctx) ASSERT(Ctx.pObj == (CSpaceObject *)pShip); ASSERT(pShip->GetSystem()); CString sSystemName = pShip->GetSystem()->GetName(); - // Figure out who killed us - CString sCause; CSpaceObject *pAttacker = Ctx.Attacker.GetObj(); if (pAttacker) @@ -214,8 +212,34 @@ CString CTranscendenceModel::CalcEpitaph (SDestroyCtx &Ctx) else sCause = CONSTLIT("by unknown forces"); - // Generat based on cause + //Let's mention any extra conditions that the player had before dying + CString sEffects; + TArray Effects; + + if (pShip->IsRadioactive()) + Effects.Insert("radioactive"); //Doesn't seem to work for some reason + if (pShip->IsBlind()) + Effects.Insert("blind"); + if (pShip->IsParalyzed()) + Effects.Insert("paralyzed"); + if (pShip->IsDisarmed()) + Effects.Insert("disarmed"); + + if (Effects.GetCount() == 1) + sEffects = Effects.GetAt(0); + else if (Effects.GetCount() == 2) + sEffects = strPatternSubst(CONSTLIT("%s and %s"), Effects.GetAt(0), Effects.GetAt(1)); + else { + sEffects = Effects.GetAt(0); + for (int i = 1; i < Effects.GetCount() - 1; i++) { + sEffects = strPatternSubst(CONSTLIT("%s, %s"), sEffects, Effects.GetAt(i)); + } + sEffects = strPatternSubst(CONSTLIT("%s, and %s"), sEffects, Effects.GetAt(Effects.GetCount() - 1)); + } + sCause = strPatternSubst(CONSTLIT("%s while %s"), sCause, sEffects); + // Generate based on cause + CString sText; switch (Ctx.iCause) { @@ -1591,7 +1615,6 @@ void CTranscendenceModel::OnPlayerDestroyed (SDestroyCtx &Ctx, CString *retsEpit Ctx.bResurrectPending = (m_pResurrectType != NULL); // Generate epitaph - CString sText = CalcEpitaph(Ctx); if (retsEpitaph) *retsEpitaph = sText;