mirror of
https://github.com/unknownworlds/NS.git
synced 2024-11-10 15:21:43 +00:00
o Added alien cloaking indicator.
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@424 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
6c3f031cf1
commit
11803fda5c
5 changed files with 32 additions and 2 deletions
|
@ -65,6 +65,7 @@ const int kAlienStructureCloakAmount = 0;
|
||||||
// :puzl
|
// :puzl
|
||||||
|
|
||||||
const int kAlienSelfCloakingBaseOpacity = 130;
|
const int kAlienSelfCloakingBaseOpacity = 130;
|
||||||
|
const int kAlienSelfCloakingMinOpacity = 186;
|
||||||
|
|
||||||
const int kAlienCloakViewModelRenderMode = kRenderTransAdd;
|
const int kAlienCloakViewModelRenderMode = kRenderTransAdd;
|
||||||
const int kAlienCloakViewModelAmount = 35;
|
const int kAlienCloakViewModelAmount = 35;
|
||||||
|
|
|
@ -6382,12 +6382,12 @@ void AvHHud::UpdateViewModelEffects()
|
||||||
theRenderMode = kAlienCloakViewModelRenderMode;
|
theRenderMode = kAlienCloakViewModelRenderMode;
|
||||||
theRenderAmount = 10;
|
theRenderAmount = 10;
|
||||||
}
|
}
|
||||||
else if( theRenderAmount > kAlienSelfCloakingBaseOpacity && theRenderAmount < 186)
|
else if( theRenderAmount > kAlienSelfCloakingBaseOpacity && theRenderAmount < kAlienSelfCloakingMinOpacity)
|
||||||
{
|
{
|
||||||
theRenderMode = kAlienCloakViewModelRenderMode;
|
theRenderMode = kAlienCloakViewModelRenderMode;
|
||||||
theRenderAmount = 40;
|
theRenderAmount = 40;
|
||||||
}
|
}
|
||||||
else if ( theRenderAmount == 186 ) {
|
else if ( theRenderAmount == kAlienSelfCloakingMinOpacity ) {
|
||||||
theRenderMode = kAlienCloakViewModelRenderMode;
|
theRenderMode = kAlienCloakViewModelRenderMode;
|
||||||
theRenderAmount = 50;
|
theRenderAmount = 50;
|
||||||
}
|
}
|
||||||
|
|
|
@ -702,6 +702,7 @@ private:
|
||||||
HSPRITE mMarineUIJetpackSprite;
|
HSPRITE mMarineUIJetpackSprite;
|
||||||
|
|
||||||
HSPRITE mAlienUIEnergySprite;
|
HSPRITE mAlienUIEnergySprite;
|
||||||
|
HSPRITE mAlienUICloakSprite;
|
||||||
|
|
||||||
HSPRITE mMembraneSprite;
|
HSPRITE mMembraneSprite;
|
||||||
HSPRITE mDigestingSprite;
|
HSPRITE mDigestingSprite;
|
||||||
|
|
|
@ -138,6 +138,7 @@
|
||||||
#include "mod/AvHServerVariables.h"
|
#include "mod/AvHServerVariables.h"
|
||||||
#include "mod/AvHSpriteAPI.h"
|
#include "mod/AvHSpriteAPI.h"
|
||||||
#include "mod/AvHParticleEditorHandler.h"
|
#include "mod/AvHParticleEditorHandler.h"
|
||||||
|
#include "mod/AvHAlienAbilityConstants.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
#include "common/entity_types.h"
|
#include "common/entity_types.h"
|
||||||
|
|
||||||
|
@ -3725,6 +3726,30 @@ void AvHHud::RenderAlienUI()
|
||||||
AvHSpriteDraw(mAlienUIEnergySprite, 0, theX, theY, theX + theWidth, theY + theHeight * theFactor, 0, 0, 1, theFactor);
|
AvHSpriteDraw(mAlienUIEnergySprite, 0, theX, theY, theX + theWidth, theY + theHeight * theFactor, 0, 0, 1, theFactor);
|
||||||
AvHSpriteDraw(mAlienUIEnergySprite, 1, theX, theY + theHeight * theFactor, theX + theWidth, theY + theHeight, 0, theFactor, 1, 1);
|
AvHSpriteDraw(mAlienUIEnergySprite, 1, theX, theY + theHeight * theFactor, theX + theWidth, theY + theHeight, 0, theFactor, 1, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mAlienUICloakSprite)
|
||||||
|
{
|
||||||
|
cl_entity_s* theLocalPlayer = GetVisiblePlayer();
|
||||||
|
if(theLocalPlayer ) {
|
||||||
|
theX = mViewport[2] - theWidth + mViewport[0];
|
||||||
|
|
||||||
|
int theAmount=kAlienSelfCloakingMinOpacity;
|
||||||
|
if ( theLocalPlayer->curstate.renderamt > 0 ) {
|
||||||
|
theAmount=min(kAlienSelfCloakingMinOpacity, max(kAlienSelfCloakingBaseOpacity,theLocalPlayer->curstate.renderamt));
|
||||||
|
}
|
||||||
|
float theFactor = 1.0f -(float)(theAmount-kAlienSelfCloakingBaseOpacity)/float(kAlienSelfCloakingMinOpacity-kAlienSelfCloakingBaseOpacity);
|
||||||
|
|
||||||
|
AvHSpriteSetColor(1,1,1);
|
||||||
|
AvHSpriteSetRenderMode(kRenderTransTexture);
|
||||||
|
|
||||||
|
AvHSpriteDraw(mAlienUICloakSprite, 0, theX, theY, theX + theWidth, theY + theHeight * theFactor, 0, 0, 1, theFactor);
|
||||||
|
AvHSpriteDraw(mAlienUICloakSprite, 1, theX, theY + theHeight * theFactor, theX + theWidth, theY + theHeight, 0, theFactor, 1, 1);
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// int a=0;
|
||||||
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw hive indicators.
|
// Draw hive indicators.
|
||||||
|
@ -4281,6 +4306,8 @@ void AvHHud::VidInit(void)
|
||||||
// Load alien energy sprite
|
// Load alien energy sprite
|
||||||
theSpriteName = UINameToSprite(kAlienEnergySprite, theScreenWidth);
|
theSpriteName = UINameToSprite(kAlienEnergySprite, theScreenWidth);
|
||||||
this->mAlienUIEnergySprite = Safe_SPR_Load(theSpriteName.c_str());
|
this->mAlienUIEnergySprite = Safe_SPR_Load(theSpriteName.c_str());
|
||||||
|
theSpriteName = UINameToSprite(kAlienCloakSprite, theScreenWidth);
|
||||||
|
this->mAlienUICloakSprite = Safe_SPR_Load(theSpriteName.c_str());
|
||||||
|
|
||||||
// Load background for topdown mode
|
// Load background for topdown mode
|
||||||
this->mBackgroundSprite = Safe_SPR_Load(kTopDownBGSprite);
|
this->mBackgroundSprite = Safe_SPR_Load(kTopDownBGSprite);
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#define kJetpackSprite "jetpack"
|
#define kJetpackSprite "jetpack"
|
||||||
|
|
||||||
#define kAlienEnergySprite "a-energy"
|
#define kAlienEnergySprite "a-energy"
|
||||||
|
#define kAlienCloakSprite "a-cloak"
|
||||||
#define kAlienResourceSprite "a-resources"
|
#define kAlienResourceSprite "a-resources"
|
||||||
|
|
||||||
#define kCombatExperienceSprite "experience"
|
#define kCombatExperienceSprite "experience"
|
||||||
|
|
Loading…
Reference in a new issue