This commit is contained in:
parent
9a98cc496e
commit
b04a30bcb8
6 changed files with 56 additions and 30 deletions
|
@ -579,6 +579,16 @@ if(newmode!=-1)
|
||||||
|
|
||||||
|
|
||||||
m_allowConversation=false;
|
m_allowConversation=false;
|
||||||
|
|
||||||
|
if(m_healthReactFrames)
|
||||||
|
{
|
||||||
|
m_healthReactFrames-=_frames;
|
||||||
|
if(m_healthReactFrames<0)
|
||||||
|
{
|
||||||
|
m_healthReactFrames=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(i=0;i<_frames;i++)
|
for(i=0;i<_frames;i++)
|
||||||
{
|
{
|
||||||
// Think
|
// Think
|
||||||
|
@ -796,11 +806,6 @@ else if(Pos.vy>m_mapEdge.vy-64)Pos.vy=m_mapEdge.vy-64;
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int panim=-1;
|
int panim=-1;
|
||||||
#include "gfx\prim.h" // (pkg)
|
#include "gfx\prim.h" // (pkg)
|
||||||
int healthx=40;
|
|
||||||
int healthy=40;
|
|
||||||
int healthr=128;
|
|
||||||
int healthg=0;
|
|
||||||
int healthb=0;
|
|
||||||
|
|
||||||
#ifdef _STATE_DEBUG_
|
#ifdef _STATE_DEBUG_
|
||||||
int stateDebugX=280;
|
int stateDebugX=280;
|
||||||
|
@ -817,6 +822,12 @@ static int lastposnum=0;
|
||||||
int mouth=-1,eyes=-1;
|
int mouth=-1,eyes=-1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
int itembaseX=110;
|
||||||
|
int itembaseY=60;
|
||||||
|
int itemgap=40;
|
||||||
|
|
||||||
|
|
||||||
void CPlayer::render()
|
void CPlayer::render()
|
||||||
{
|
{
|
||||||
CPlayerThing::render();
|
CPlayerThing::render();
|
||||||
|
@ -880,14 +891,10 @@ for(int i=0;i<NUM_LASTPOS;i++)
|
||||||
POLY_FT4 *ft4;
|
POLY_FT4 *ft4;
|
||||||
int *frames;
|
int *frames;
|
||||||
|
|
||||||
x=healthx;
|
x=HEALTH_ICONX;
|
||||||
y=healthy;
|
y=HEALTH_ICONY;
|
||||||
if(m_health==0||m_healthReactFrames)
|
if(m_health==0||m_healthReactFrames)
|
||||||
{
|
{
|
||||||
if(m_healthReactFrames)
|
|
||||||
{
|
|
||||||
m_healthReactFrames--;
|
|
||||||
}
|
|
||||||
frames=s_emptyHealthFrames;
|
frames=s_emptyHealthFrames;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -900,16 +907,32 @@ for(int i=0;i<NUM_LASTPOS;i++)
|
||||||
for(i=5;i>0;i--)
|
for(i=5;i>0;i--)
|
||||||
{
|
{
|
||||||
ft4=m_spriteBank->printFT4(*frames++,x,y,0,0,0);
|
ft4=m_spriteBank->printFT4(*frames++,x,y,0,0,0);
|
||||||
if(i>m_health)
|
setSemiTrans(ft4,i>m_health);
|
||||||
{
|
|
||||||
setRGB0(ft4,healthr,healthg,healthb);
|
|
||||||
}
|
|
||||||
y+=ygap;
|
y+=ygap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mode specific ui
|
// Mode specific ui
|
||||||
|
int itemX=itembaseX;
|
||||||
|
|
||||||
|
// Pickups
|
||||||
m_currentPlayerModeClass->renderModeUi();
|
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)
|
if(m_health)
|
||||||
{
|
{
|
||||||
m_invincibleFrameCount=INVINCIBLE_FRAMES__HIT;
|
m_invincibleFrameCount=INVINCIBLE_FRAMES__HIT;
|
||||||
m_healthReactFrames=10;
|
m_healthReactFrames=25;
|
||||||
m_health--;
|
m_health--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -302,6 +302,7 @@ public:
|
||||||
int isWearingGlasses() {return m_glassesFlag;}
|
int isWearingGlasses() {return m_glassesFlag;}
|
||||||
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
|
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
|
||||||
int isWearingBoots() {return m_squeakyBootsTimer;}
|
int isWearingBoots() {return m_squeakyBootsTimer;}
|
||||||
|
int isWearingHelmet() {return false;}
|
||||||
void giveInvincibilityRing() {m_invincibilityRingTimer=INVINCIBILITY_RING_TIME;}
|
void giveInvincibilityRing() {m_invincibilityRingTimer=INVINCIBILITY_RING_TIME;}
|
||||||
void giveDivingHelmet() {m_divingHelmet=true;}
|
void giveDivingHelmet() {m_divingHelmet=true;}
|
||||||
|
|
||||||
|
@ -355,10 +356,12 @@ public:
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
POWERUPUI_ICONX=40,
|
HEALTH_ICONX=40,
|
||||||
POWERUPUI_ICONY=200,
|
HEALTH_ICONY=40,
|
||||||
POWERUPUI_TEXTX=60,
|
POWERUPUI_ICONX=400,
|
||||||
POWERUPUI_TEXTY=200,
|
POWERUPUI_ICONY=40,
|
||||||
|
POWERUPUI_TEXTX=440,
|
||||||
|
POWERUPUI_TEXTY=37,
|
||||||
POWERUPUI_OT=0,
|
POWERUPUI_OT=0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -172,11 +172,11 @@ void CPlayerModeBubbleMixture::renderModeUi()
|
||||||
|
|
||||||
sb=m_player->getSpriteBank();
|
sb=m_player->getSpriteBank();
|
||||||
fh=sb->getFrameHeader(FRM__BUBBLEWAND);
|
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();
|
fb=m_player->getFontBank();
|
||||||
sprintf(buf,"x%d",m_player->getBubbleAmmo());
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
|
|
@ -191,11 +191,11 @@ void CPlayerModeCoralBlower::renderModeUi()
|
||||||
if(m_blowerState==BLOWER_STATE__FULL||m_blowerState==BLOWER_STATE__AIMING)
|
if(m_blowerState==BLOWER_STATE__FULL||m_blowerState==BLOWER_STATE__AIMING)
|
||||||
{
|
{
|
||||||
// Blower has a creature/object inside
|
// 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
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,26 +157,26 @@ void CPlayerModeJellyLauncher::renderModeUi()
|
||||||
{
|
{
|
||||||
case FIRING_STATE__NONE:
|
case FIRING_STATE__NONE:
|
||||||
case FIRING_STATE__FIRING:
|
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;
|
break;
|
||||||
case FIRING_STATE__POWERINGUP:
|
case FIRING_STATE__POWERINGUP:
|
||||||
{
|
{
|
||||||
int rotRange,scaleBase,scaleRange;
|
int rotRange,scaleBase,scaleRange;
|
||||||
int xs,ys,rot;
|
int xs,ys,rot;
|
||||||
rotRange=m_firingTime;
|
rotRange=m_firingTime;
|
||||||
scaleBase=4096+(m_firingTime*10);
|
scaleBase=4500+(m_firingTime*10);
|
||||||
scaleRange=m_firingTime*2;
|
scaleRange=m_firingTime*2;
|
||||||
rot=(getRndRange(rotRange*2)-rotRange)&4095;
|
rot=(getRndRange(rotRange*2)-rotRange)&4095;
|
||||||
xs=scaleBase+getRndRange(scaleRange);
|
xs=scaleBase+getRndRange(scaleRange);
|
||||||
ys=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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fb=m_player->getFontBank();
|
fb=m_player->getFontBank();
|
||||||
sprintf(buf,"x%d",m_player->getJellyAmmo());
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
|
|
@ -246,11 +246,11 @@ void CPlayerModeNet::renderModeUi()
|
||||||
{
|
{
|
||||||
// Net has a jellyfish inside
|
// Net has a jellyfish inside
|
||||||
int size=256+128+((msin(m_netSin)*npsize)>>12);
|
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
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue