From 942c1a162beee95884649cd9931af36c1c8c0bc7 Mon Sep 17 00:00:00 2001 From: Jaka Kranjc Date: Fri, 29 Oct 2010 14:21:43 +0200 Subject: [PATCH] added configurable hiding of the hardcoded overlays when npcs are invisible also fixes the omnipotent rat observer in brynlaw --- gemrb/core/Scriptable/Actor.cpp | 22 ++++++++++--- gemrb/override/bg1/overlay.2da | 71 ++++++++++++++++++++--------------------- gemrb/override/bg2/overlay.2da | 71 ++++++++++++++++++++--------------------- gemrb/override/how/overlay.2da | 70 ++++++++++++++++++++-------------------- gemrb/override/iwd/overlay.2da | 70 ++++++++++++++++++++-------------------- gemrb/override/iwd2/overlay.2da | 70 ++++++++++++++++++++-------------------- gemrb/override/pst/overlay.2da | 70 ++++++++++++++++++++-------------------- 7 files changed, 227 insertions(+), 217 deletions(-) rewrite gemrb/override/bg1/overlay.2da (98%) rewrite gemrb/override/bg2/overlay.2da (98%) rewrite gemrb/override/how/overlay.2da (98%) rewrite gemrb/override/iwd/overlay.2da (98%) rewrite gemrb/override/iwd2/overlay.2da (98%) rewrite gemrb/override/pst/overlay.2da (98%) diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index a47a5ebdb..53c665dc0 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -246,6 +246,8 @@ static ieResRef hc_overlays[OVERLAY_COUNT]={"SANCTRY","SPENTACI","SPMAGGLO","SPS "GREASED","WEBENTD","MINORGLB","","","","","","","","","","","","","","", "","","","SPTURNI2","SPTURNI","","","","","",""}; static ieDword hc_locations=0x2ba80030; +static int hc_flags[OVERLAY_COUNT]; +#define HC_INVISIBLE 1 static int *mxsplwis = NULL; static int spllevels; @@ -975,12 +977,20 @@ static void handle_overlay(Actor *actor, ieDword idx) return; ieDword flag = hc_locations&(1<GetScriptedAnimation(hc_overlays[idx], false); - if (sca) { - if (flag) { - sca->ZPos=-1; - } - actor->AddVVCell(sca); + if (!sca) { + return; + } + + // always draw it for party members; the rest must not be invisible to have it; + // this is just a guess, maybe there are extra conditions (MC_HIDDEN? IE_AVATARREMOVAL?) + if (hc_flags[idx] & HC_INVISIBLE && (!actor->InParty && actor->Modified[IE_STATE_ID] & STATE_INVISIBLE)) { + return; + } + + if (flag) { + sca->ZPos=-1; } + actor->AddVVCell(sca); } //de/activates the entangle overlay @@ -1497,6 +1507,8 @@ static void InitActorTables() if (atoi(tm->QueryField( i, 1))) { hc_locations|=mask; } + tmp = tm->QueryField( i, 2 ); + hc_flags[i] = atoi(tmp); mask<<=1; } } diff --git a/gemrb/override/bg1/overlay.2da b/gemrb/override/bg1/overlay.2da dissimilarity index 98% index ad60ffd0f..84a944eba 100644 --- a/gemrb/override/bg1/overlay.2da +++ b/gemrb/override/bg1/overlay.2da @@ -1,36 +1,35 @@ -2DA V1.0 -* - VVC UNDER -SANCTUARY SANCTRY 0 -ENTANGLE SPENTACI 0 -SPELLTRAP SPMAGGLO 0 -SHIELDGLOBE SPSHIELD 0 -GREASE GREASED 1 -WEB WEBENTD 1 -MINORGLOBE MINORGLB 0 -GLOBE GOINVUC 0 -FLAMESHROUD SOFLAMC 0 -ANTIMAGIC AMSHELC 0 -RESILIENT ORSPHEC 0 -PROTFROMMISS PFNMISC 0 -CLOAKOFFEAR COFEARC 0 -ENTROPY ESHIELC 0 -FIREAURA FIAURAC 0 -FROSTAURA FRAURAC 0 -INSECT IPLAGUC 0 -STORMSHELL SSHELLC 0 -LATHANDER1 SOLATC1 0 -LATHANDER2 SOLATC2 1 -GLATHANDER1 GSOLAC1 0 -GLATHANDER2 GSOLAC2 1 -SEVENEYES1 SEYESC1 0 -SEVENEYES2 SEYESC2 1 -BOUNCE SPTURNI2 1 -BOUNCE2 SPTURNI 1 -FIRESHIELD1 FSHIRC1 0 -FIRESHIELD2 FSHIRC2 1 -ICESHIELD1 FSHIBC1 0 -ICESHIELD2 FSHIBC2 1 -TORTOISE TSHELLC 0 -DEATHARMOR DARMORC 0 - +2DA V1.0 +* + VVC UNDER FLAGS +SANCTUARY SANCTRY 0 1 +ENTANGLE SPENTACI 0 0 +SPELLTRAP SPMAGGLO 0 0 +SHIELDGLOBE SPSHIELD 0 1 +GREASE GREASED 1 0 +WEB WEBENTD 1 0 +MINORGLOBE MINORGLB 0 1 +GLOBE GOINVUC 0 1 +FLAMESHROUD SOFLAMC 0 0 +ANTIMAGIC AMSHELC 0 0 +RESILIENT ORSPHEC 0 0 +PROTFROMMISS PFNMISC 0 0 +CLOAKOFFEAR COFEARC 0 0 +ENTROPY ESHIELC 0 0 +FIREAURA FIAURAC 0 0 +FROSTAURA FRAURAC 0 0 +INSECT IPLAGUC 0 0 +STORMSHELL SSHELLC 0 0 +LATHANDER1 SOLATC1 0 0 +LATHANDER2 SOLATC2 1 0 +GLATHANDER1 GSOLAC1 0 0 +GLATHANDER2 GSOLAC2 1 0 +SEVENEYES1 SEYESC1 0 0 +SEVENEYES2 SEYESC2 1 0 +BOUNCE SPTURNI2 1 0 +BOUNCE2 SPTURNI 1 0 +FIRESHIELD1 FSHIRC1 0 0 +FIRESHIELD2 FSHIRC2 1 0 +ICESHIELD1 FSHIBC1 0 0 +ICESHIELD2 FSHIBC2 1 0 +TORTOISE TSHELLC 0 0 +DEATHARMOR DARMORC 0 0 diff --git a/gemrb/override/bg2/overlay.2da b/gemrb/override/bg2/overlay.2da dissimilarity index 98% index ad60ffd0f..84a944eba 100644 --- a/gemrb/override/bg2/overlay.2da +++ b/gemrb/override/bg2/overlay.2da @@ -1,36 +1,35 @@ -2DA V1.0 -* - VVC UNDER -SANCTUARY SANCTRY 0 -ENTANGLE SPENTACI 0 -SPELLTRAP SPMAGGLO 0 -SHIELDGLOBE SPSHIELD 0 -GREASE GREASED 1 -WEB WEBENTD 1 -MINORGLOBE MINORGLB 0 -GLOBE GOINVUC 0 -FLAMESHROUD SOFLAMC 0 -ANTIMAGIC AMSHELC 0 -RESILIENT ORSPHEC 0 -PROTFROMMISS PFNMISC 0 -CLOAKOFFEAR COFEARC 0 -ENTROPY ESHIELC 0 -FIREAURA FIAURAC 0 -FROSTAURA FRAURAC 0 -INSECT IPLAGUC 0 -STORMSHELL SSHELLC 0 -LATHANDER1 SOLATC1 0 -LATHANDER2 SOLATC2 1 -GLATHANDER1 GSOLAC1 0 -GLATHANDER2 GSOLAC2 1 -SEVENEYES1 SEYESC1 0 -SEVENEYES2 SEYESC2 1 -BOUNCE SPTURNI2 1 -BOUNCE2 SPTURNI 1 -FIRESHIELD1 FSHIRC1 0 -FIRESHIELD2 FSHIRC2 1 -ICESHIELD1 FSHIBC1 0 -ICESHIELD2 FSHIBC2 1 -TORTOISE TSHELLC 0 -DEATHARMOR DARMORC 0 - +2DA V1.0 +* + VVC UNDER FLAGS +SANCTUARY SANCTRY 0 1 +ENTANGLE SPENTACI 0 0 +SPELLTRAP SPMAGGLO 0 0 +SHIELDGLOBE SPSHIELD 0 1 +GREASE GREASED 1 0 +WEB WEBENTD 1 0 +MINORGLOBE MINORGLB 0 1 +GLOBE GOINVUC 0 1 +FLAMESHROUD SOFLAMC 0 0 +ANTIMAGIC AMSHELC 0 0 +RESILIENT ORSPHEC 0 0 +PROTFROMMISS PFNMISC 0 0 +CLOAKOFFEAR COFEARC 0 0 +ENTROPY ESHIELC 0 0 +FIREAURA FIAURAC 0 0 +FROSTAURA FRAURAC 0 0 +INSECT IPLAGUC 0 0 +STORMSHELL SSHELLC 0 0 +LATHANDER1 SOLATC1 0 0 +LATHANDER2 SOLATC2 1 0 +GLATHANDER1 GSOLAC1 0 0 +GLATHANDER2 GSOLAC2 1 0 +SEVENEYES1 SEYESC1 0 0 +SEVENEYES2 SEYESC2 1 0 +BOUNCE SPTURNI2 1 0 +BOUNCE2 SPTURNI 1 0 +FIRESHIELD1 FSHIRC1 0 0 +FIRESHIELD2 FSHIRC2 1 0 +ICESHIELD1 FSHIBC1 0 0 +ICESHIELD2 FSHIBC2 1 0 +TORTOISE TSHELLC 0 0 +DEATHARMOR DARMORC 0 0 diff --git a/gemrb/override/how/overlay.2da b/gemrb/override/how/overlay.2da dissimilarity index 98% index b44740b8c..229ff10c5 100644 --- a/gemrb/override/how/overlay.2da +++ b/gemrb/override/how/overlay.2da @@ -1,35 +1,35 @@ -2DA V1.0 -* - VVC UNDER -SANCTUARY SANCTUC 0 -ENTANGLE ENTANGC 0 -WISP WISP 0 -SHIELDGLOBE SHIELDC 0 -GREASE GREASEC 1 -WEB WEBC 1 -MINORGLOBE MGOINVC 0 -GLOBE GOINVUC 0 -FLAMESHROUD SOFLAMC 0 -ANTIMAGIC AMSHELC 0 -RESILIENT ORSPHEC 0 -PROTFROMMISS PFNMISC 0 -CLOAKOFFEAR COFEARC 0 -ENTROPY ESHIELC 0 -FIREAURA FIAURAC 0 -FROSTAURA FRAURAC 0 -INSECT IPLAGUC 0 -STORMSHELL SSHELLC 0 -LATHANDER1 SOLATC1 0 -LATHANDER2 SOLATC2 1 -GLATHANDER1 GSOLAC1 0 -GLATHANDER2 GSOLAC2 1 -SEVENEYES1 SEYESC1 0 -SEVENEYES2 SEYESC2 1 -BOUNCE SPTURNI2 1 -BOUNCE2 SPTURNI 1 -FIRESHIELD1 FSHIRC1 0 -FIRESHIELD2 FSHIRC2 1 -ICESHIELD1 FSHIBC1 0 -ICESHIELD2 FSHIBC2 1 -TORTOISE TSHELLC 0 -DEATHARMOR DARMORC 0 +2DA V1.0 +* + VVC UNDER FLAGS +SANCTUARY SANCTUC 0 1 +ENTANGLE ENTANGC 0 0 +WISP WISP 0 0 +SHIELDGLOBE SHIELDC 0 1 +GREASE GREASEC 1 0 +WEB WEBC 1 0 +MINORGLOBE MGOINVC 0 1 +GLOBE GOINVUC 0 1 +FLAMESHROUD SOFLAMC 0 0 +ANTIMAGIC AMSHELC 0 0 +RESILIENT ORSPHEC 0 0 +PROTFROMMISS PFNMISC 0 0 +CLOAKOFFEAR COFEARC 0 0 +ENTROPY ESHIELC 0 0 +FIREAURA FIAURAC 0 0 +FROSTAURA FRAURAC 0 0 +INSECT IPLAGUC 0 0 +STORMSHELL SSHELLC 0 0 +LATHANDER1 SOLATC1 0 0 +LATHANDER2 SOLATC2 1 0 +GLATHANDER1 GSOLAC1 0 0 +GLATHANDER2 GSOLAC2 1 0 +SEVENEYES1 SEYESC1 0 0 +SEVENEYES2 SEYESC2 1 0 +BOUNCE SPTURNI2 1 0 +BOUNCE2 SPTURNI 1 0 +FIRESHIELD1 FSHIRC1 0 0 +FIRESHIELD2 FSHIRC2 1 0 +ICESHIELD1 FSHIBC1 0 0 +ICESHIELD2 FSHIBC2 1 0 +TORTOISE TSHELLC 0 0 +DEATHARMOR DARMORC 0 0 diff --git a/gemrb/override/iwd/overlay.2da b/gemrb/override/iwd/overlay.2da dissimilarity index 98% index b44740b8c..0c05b4ddc 100644 --- a/gemrb/override/iwd/overlay.2da +++ b/gemrb/override/iwd/overlay.2da @@ -1,35 +1,35 @@ -2DA V1.0 -* - VVC UNDER -SANCTUARY SANCTUC 0 -ENTANGLE ENTANGC 0 -WISP WISP 0 -SHIELDGLOBE SHIELDC 0 -GREASE GREASEC 1 -WEB WEBC 1 -MINORGLOBE MGOINVC 0 -GLOBE GOINVUC 0 -FLAMESHROUD SOFLAMC 0 -ANTIMAGIC AMSHELC 0 -RESILIENT ORSPHEC 0 -PROTFROMMISS PFNMISC 0 -CLOAKOFFEAR COFEARC 0 -ENTROPY ESHIELC 0 -FIREAURA FIAURAC 0 -FROSTAURA FRAURAC 0 -INSECT IPLAGUC 0 -STORMSHELL SSHELLC 0 -LATHANDER1 SOLATC1 0 -LATHANDER2 SOLATC2 1 -GLATHANDER1 GSOLAC1 0 -GLATHANDER2 GSOLAC2 1 -SEVENEYES1 SEYESC1 0 -SEVENEYES2 SEYESC2 1 -BOUNCE SPTURNI2 1 -BOUNCE2 SPTURNI 1 -FIRESHIELD1 FSHIRC1 0 -FIRESHIELD2 FSHIRC2 1 -ICESHIELD1 FSHIBC1 0 -ICESHIELD2 FSHIBC2 1 -TORTOISE TSHELLC 0 -DEATHARMOR DARMORC 0 +2DA V1.0 +* + VVC UNDER FLAGS +SANCTUARY SANCTUC 0 1 +ENTANGLE ENTANGC 0 0 +WISP WISP 0 0 +SHIELDGLOBE SHIELDC 0 1 +GREASE GREASEC 1 0 +WEB WEBC 1 0 +MINORGLOBE MGOINVC 0 1 +GLOBE GOINVUC 0 1 +FLAMESHROUD SOFLAMC 0 0 +ANTIMAGIC AMSHELC 0 0 +RESILIENT ORSPHEC 0 0 +PROTFROMMISS PFNMISC 0 0 +CLOAKOFFEAR COFEARC 0 0 +ENTROPY ESHIELC 0 0 +FIREAURA FIAURAC 0 0 +FROSTAURA FRAURAC 0 0 +INSECT IPLAGUC 0 0 +STORMSHELL SSHELLC 0 0 +LATHANDER1 SOLATC1 0 0 +LATHANDER2 SOLATC2 1 0 +GLATHANDER1 GSOLAC1 0 0 +GLATHANDER2 GSOLAC2 1 0 +SEVENEYES1 SEYESC1 0 0 +SEVENEYES2 SEYESC2 1 0 +BOUNCE SPTURNI2 1 0 +BOUNCE2 SPTURNI 1 0 +FIRESHIELD1 FSHIRC1 0 0 +FIRESHIELD2 FSHIRC2 1 0 +ICESHIELD1 FSHIBC1 0 0 +ICESHIELD2 FSHIBC2 1 0 +TORTOISE TSHELLC 0 0 +DEATHARMOR DARMORC 0 0 diff --git a/gemrb/override/iwd2/overlay.2da b/gemrb/override/iwd2/overlay.2da dissimilarity index 98% index bbf57050d..c5432e0b3 100644 --- a/gemrb/override/iwd2/overlay.2da +++ b/gemrb/override/iwd2/overlay.2da @@ -1,35 +1,35 @@ -2DA V1.0 -* - VVC UNDER -SANCTUARY SANCTUC 0 -ENTANGLE ENTANGC 0 -WISP WISP 0 -SHIELDGLOBE SHIELDC 0 -GREASE GREASEC 1 -WEB WEBC 1 -MINORGLOBE MGOINVC 0 -GLOBE GOINVUC 0 -FLAMESHROUD SOFLAMC 0 -ANTIMAGIC AMSHELC 0 -RESILIENT ORSPHEC 0 -PROTFROMMISS PFNMISC 0 -CLOAKOFFEAR COFEARC 0 -ENTROPY ESHIELC 0 -FIREAURA FIAURAC 0 -FROSTAURA FRAURAC 0 -INSECT IPLAGUC 0 -STORMSHELL SSHELLC 0 -LATHANDER1 SOLATC1 0 -LATHANDER2 SOLATC2 1 -GLATHANDER1 GSOLAC1 0 -GLATHANDER2 GSOLAC2 1 -SEVENEYES1 SEYESC1 0 -SEVENEYES2 SEYESC2 1 -BOUNCE SPTURNI2 1 -BOUNCE2 SPTURNI 1 -FIRESHIELD1 FSHIRC1 0 -FIRESHIELD2 FSHIRC2 1 -ICESHIELD1 FSHIBC1 0 -ICESHIELD2 FSHIBC2 1 -TORTOISE TSHELLC 0 -DEATHARMOR DARMORC 0 +2DA V1.0 +* + VVC UNDER FLAGS +SANCTUARY SANCTUC 0 1 +ENTANGLE ENTANGC 0 0 +WISP WISP 0 0 +SHIELDGLOBE SHIELDC 0 1 +GREASE GREASEC 1 0 +WEB WEBC 1 0 +MINORGLOBE MGOINVC 0 1 +GLOBE GOINVUC 0 1 +FLAMESHROUD SOFLAMC 0 0 +ANTIMAGIC AMSHELC 0 0 +RESILIENT ORSPHEC 0 0 +PROTFROMMISS PFNMISC 0 0 +CLOAKOFFEAR COFEARC 0 0 +ENTROPY ESHIELC 0 0 +FIREAURA FIAURAC 0 0 +FROSTAURA FRAURAC 0 0 +INSECT IPLAGUC 0 0 +STORMSHELL SSHELLC 0 0 +LATHANDER1 SOLATC1 0 0 +LATHANDER2 SOLATC2 1 0 +GLATHANDER1 GSOLAC1 0 0 +GLATHANDER2 GSOLAC2 1 0 +SEVENEYES1 SEYESC1 0 0 +SEVENEYES2 SEYESC2 1 0 +BOUNCE SPTURNI2 1 0 +BOUNCE2 SPTURNI 1 0 +FIRESHIELD1 FSHIRC1 0 0 +FIRESHIELD2 FSHIRC2 1 0 +ICESHIELD1 FSHIBC1 0 0 +ICESHIELD2 FSHIBC2 1 0 +TORTOISE TSHELLC 0 0 +DEATHARMOR DARMORC 0 0 diff --git a/gemrb/override/pst/overlay.2da b/gemrb/override/pst/overlay.2da dissimilarity index 98% index c26d686a7..d972ec79c 100644 --- a/gemrb/override/pst/overlay.2da +++ b/gemrb/override/pst/overlay.2da @@ -1,35 +1,35 @@ -2DA V1.0 -* - VVC UNDER -SANCTUARY SANCTRY 0 -ENTANGLE WEBENTD 1 -WISP WISP 0 -SHIELDGLOBE SPSHIELD 0 -GREASE GREASED 1 -WEB WEBENTD 1 -MINORGLOBE MINORGLB 0 -GLOBE GOINVUC 0 -FLAMESHROUD SOFLAMC 0 -ANTIMAGIC AMSHELC 0 -RESILIENT ORSPHEC 0 -PROTFROMMISS PFNMISC 0 -CLOAKOFFEAR COFEARC 0 -ENTROPY ESHIELC 0 -FIREAURA FIAURAC 0 -FROSTAURA FRAURAC 0 -INSECT IPLAGUC 0 -STORMSHELL SSHELLC 0 -LATHANDER1 SOLATC1 0 -LATHANDER2 SOLATC2 1 -GLATHANDER1 GSOLAC1 0 -GLATHANDER2 GSOLAC2 1 -SEVENEYES1 SEYESC1 0 -SEVENEYES2 SEYESC2 1 -BOUNCE SPTURNI2 1 -BOUNCE2 SPTURNI 1 -FIRESHIELD1 FSHIRC1 0 -FIRESHIELD2 FSHIRC2 1 -ICESHIELD1 FSHIBC1 0 -ICESHIELD2 FSHIBC2 1 -TORTOISE TSHELLC 0 -DEATHARMOR DARMORC 0 +2DA V1.0 +* + VVC UNDER FLAGS +SANCTUARY SANCTRY 0 1 +ENTANGLE WEBENTD 1 0 +WISP WISP 0 0 +SHIELDGLOBE SPSHIELD 0 1 +GREASE GREASED 1 0 +WEB WEBENTD 1 0 +MINORGLOBE MINORGLB 0 1 +GLOBE GOINVUC 0 1 +FLAMESHROUD SOFLAMC 0 0 +ANTIMAGIC AMSHELC 0 0 +RESILIENT ORSPHEC 0 0 +PROTFROMMISS PFNMISC 0 0 +CLOAKOFFEAR COFEARC 0 0 +ENTROPY ESHIELC 0 0 +FIREAURA FIAURAC 0 0 +FROSTAURA FRAURAC 0 0 +INSECT IPLAGUC 0 0 +STORMSHELL SSHELLC 0 0 +LATHANDER1 SOLATC1 0 0 +LATHANDER2 SOLATC2 1 0 +GLATHANDER1 GSOLAC1 0 0 +GLATHANDER2 GSOLAC2 1 0 +SEVENEYES1 SEYESC1 0 0 +SEVENEYES2 SEYESC2 1 0 +BOUNCE SPTURNI2 1 0 +BOUNCE2 SPTURNI 1 0 +FIRESHIELD1 FSHIRC1 0 0 +FIRESHIELD2 FSHIRC2 1 0 +ICESHIELD1 FSHIBC1 0 0 +ICESHIELD2 FSHIBC2 1 0 +TORTOISE TSHELLC 0 0 +DEATHARMOR DARMORC 0 0 -- 2.11.4.GIT