This commit is contained in:
Paul 2001-05-02 20:27:49 +00:00
parent 9a98cc496e
commit b04a30bcb8
6 changed files with 56 additions and 30 deletions

View File

@ -579,6 +579,16 @@ if(newmode!=-1)
m_allowConversation=false;
if(m_healthReactFrames)
{
m_healthReactFrames-=_frames;
if(m_healthReactFrames<0)
{
m_healthReactFrames=0;
}
}
for(i=0;i<_frames;i++)
{
// Think
@ -796,11 +806,6 @@ else if(Pos.vy>m_mapEdge.vy-64)Pos.vy=m_mapEdge.vy-64;
---------------------------------------------------------------------- */
int panim=-1;
#include "gfx\prim.h" // (pkg)
int healthx=40;
int healthy=40;
int healthr=128;
int healthg=0;
int healthb=0;
#ifdef _STATE_DEBUG_
int stateDebugX=280;
@ -817,6 +822,12 @@ static int lastposnum=0;
int mouth=-1,eyes=-1;
#endif
int itembaseX=110;
int itembaseY=60;
int itemgap=40;
void CPlayer::render()
{
CPlayerThing::render();
@ -880,14 +891,10 @@ for(int i=0;i<NUM_LASTPOS;i++)
POLY_FT4 *ft4;
int *frames;
x=healthx;
y=healthy;
x=HEALTH_ICONX;
y=HEALTH_ICONY;
if(m_health==0||m_healthReactFrames)
{
if(m_healthReactFrames)
{
m_healthReactFrames--;
}
frames=s_emptyHealthFrames;
}
else
@ -900,16 +907,32 @@ for(int i=0;i<NUM_LASTPOS;i++)
for(i=5;i>0;i--)
{
ft4=m_spriteBank->printFT4(*frames++,x,y,0,0,0);
if(i>m_health)
{
setRGB0(ft4,healthr,healthg,healthb);
}
setSemiTrans(ft4,i>m_health);
y+=ygap;
}
}
// Mode specific ui
int itemX=itembaseX;
// Pickups
m_currentPlayerModeClass->renderModeUi();
if(isWearingBoots())
{
int x,y;
sFrameHdr *fh=m_spriteBank->getFrameHeader(FRM__SHOE);
x=itemX-(fh->W/2);
y=itembaseY-(fh->H/2);
m_spriteBank->printFT4(fh,x+2,y+2,0,0,0);
m_spriteBank->printFT4(fh,x-2,y-2,0,0,0);
itemX+=itemgap;
}
if(isWearingHelmet())
{
sFrameHdr *fh=m_spriteBank->getFrameHeader(FRM__HELMET);
m_spriteBank->printFT4(fh,itemX-(fh->W/2),itembaseY-(fh->H/2),0,0,0);
itemX+=itemgap;
}
}
@ -1354,7 +1377,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage)
if(m_health)
{
m_invincibleFrameCount=INVINCIBLE_FRAMES__HIT;
m_healthReactFrames=10;
m_healthReactFrames=25;
m_health--;
}
else

View File

@ -302,6 +302,7 @@ public:
int isWearingGlasses() {return m_glassesFlag;}
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
int isWearingBoots() {return m_squeakyBootsTimer;}
int isWearingHelmet() {return false;}
void giveInvincibilityRing() {m_invincibilityRingTimer=INVINCIBILITY_RING_TIME;}
void giveDivingHelmet() {m_divingHelmet=true;}
@ -355,10 +356,12 @@ public:
enum
{
POWERUPUI_ICONX=40,
POWERUPUI_ICONY=200,
POWERUPUI_TEXTX=60,
POWERUPUI_TEXTY=200,
HEALTH_ICONX=40,
HEALTH_ICONY=40,
POWERUPUI_ICONX=400,
POWERUPUI_ICONY=40,
POWERUPUI_TEXTX=440,
POWERUPUI_TEXTY=37,
POWERUPUI_OT=0,
};

View File

@ -172,11 +172,11 @@ void CPlayerModeBubbleMixture::renderModeUi()
sb=m_player->getSpriteBank();
fh=sb->getFrameHeader(FRM__BUBBLEWAND);
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT);
fb=m_player->getFontBank();
sprintf(buf,"x%d",m_player->getBubbleAmmo());
fb->print(CPlayer::POWERUPUI_TEXTX,CPlayer::POWERUPUI_TEXTY-(fb->getCharHeight()/2),buf);
fb->print(CPlayer::POWERUPUI_TEXTX,CPlayer::POWERUPUI_TEXTY,buf);
}
/*----------------------------------------------------------------------

View File

@ -191,11 +191,11 @@ void CPlayerModeCoralBlower::renderModeUi()
if(m_blowerState==BLOWER_STATE__FULL||m_blowerState==BLOWER_STATE__AIMING)
{
// Blower has a creature/object inside
sb->printFT4Scaled(FRM__BLOWER,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT,256+128);
sb->printFT4Scaled(FRM__BLOWER,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT,256+128);
}
else
{
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT);
}
}

View File

@ -157,26 +157,26 @@ void CPlayerModeJellyLauncher::renderModeUi()
{
case FIRING_STATE__NONE:
case FIRING_STATE__FIRING:
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT);
break;
case FIRING_STATE__POWERINGUP:
{
int rotRange,scaleBase,scaleRange;
int xs,ys,rot;
rotRange=m_firingTime;
scaleBase=4096+(m_firingTime*10);
scaleBase=4500+(m_firingTime*10);
scaleRange=m_firingTime*2;
rot=(getRndRange(rotRange*2)-rotRange)&4095;
xs=scaleBase+getRndRange(scaleRange);
ys=scaleBase+getRndRange(scaleRange);
sb->printRotatedScaledSprite(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,xs,ys,rot,CPlayer::POWERUPUI_OT);
sb->printRotatedScaledSprite(fh,CPlayer::POWERUPUI_ICONX+(fh->W/2),CPlayer::POWERUPUI_ICONY+(fh->H/2),xs,ys,rot,CPlayer::POWERUPUI_OT);
}
break;
}
fb=m_player->getFontBank();
sprintf(buf,"x%d",m_player->getJellyAmmo());
fb->print(CPlayer::POWERUPUI_TEXTX,CPlayer::POWERUPUI_TEXTY-(fb->getCharHeight()/2),buf);
fb->print(CPlayer::POWERUPUI_TEXTX,CPlayer::POWERUPUI_TEXTY,buf);
}
/*----------------------------------------------------------------------

View File

@ -246,11 +246,11 @@ void CPlayerModeNet::renderModeUi()
{
// Net has a jellyfish inside
int size=256+128+((msin(m_netSin)*npsize)>>12);
sb->printFT4Scaled(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT,size);
sb->printFT4Scaled(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT,size);
}
else
{
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX-(fh->W/2),CPlayer::POWERUPUI_ICONY-(fh->H/2),0,0,CPlayer::POWERUPUI_OT);
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT);
}
}