This commit is contained in:
Paul 2001-02-01 21:55:22 +00:00
parent 94ca0d101b
commit 7566e24528
3 changed files with 26 additions and 16 deletions

View File

@ -175,7 +175,8 @@ PLAYER_ANIM_IN_DIR := $(ACTOR_IN_DIR)/SpongeBob/SbAnim/GinFiles
# DUFF_ANIMS deathfall runjumpend runjumpstart # DUFF_ANIMS deathfall runjumpend runjumpstart
PLAYER_ANIM_LIST := buttbounceend buttbouncestart deathbackwards deathdry deathforwards deathspin deathtar electricshock electricshockend electricshockstart faceback facefront \ PLAYER_ANIM_LIST := buttbounceend buttbouncestart deathbackwards deathdry deathforwards deathspin deathtar electricshock electricshockend electricshockstart faceback facefront \
fall getup getuprun hitground hover hoverend hoverstart idlebreathe idlehoola idlelook idlewigglearm jumpend karate knockback knockforward run \ fall getup getuprun hitground hover hoverend hoverstart idlebreathe idlehoola idlelook idlewigglearm jumpend karate knockback knockforward run \
runstart runstop soakup talk01 talk02 talk03 talk04 teeterback teeterfront runstart runstop soakup talk01 talk02 talk03 talk04 teeterback teeterfront \
idlewind
PLAYER_ANIM_IN := $(foreach FILE, $(PLAYER_ANIM_LIST),$(PLAYER_ANIM_IN_DIR)/$(FILE).gin) PLAYER_ANIM_IN := $(foreach FILE, $(PLAYER_ANIM_LIST),$(PLAYER_ANIM_IN_DIR)/$(FILE).gin)
PLAYER_ANIM_OUT := $(ANIM_OUT_DIR)/Player.Abk PLAYER_ANIM_OUT := $(ANIM_OUT_DIR)/Player.Abk

View File

@ -129,7 +129,13 @@ static const int s_runStopCount=sizeof(s_runStopSfx)/sizeof(CPlayer::AnimFrameSf
// ANIM_PLAYER_ANIM_TEETERBACK // ANIM_PLAYER_ANIM_TEETERBACK
// ANIM_PLAYER_ANIM_TEETERFRONT // ANIM_PLAYER_ANIM_TEETERFRONT
// ANIM_PLAYER_ANIM_IDLEWIND
static const CPlayer::AnimFrameSfx s_idleWindSfx[]=
{
{ 7, CSoundMediator::SFX_HAZARD__SWAMP_GAS, },
{ 24, CSoundMediator::SFX_SPONGEBOB_WALK_2, },
};
static const int s_idleWindCount=sizeof(s_idleWindSfx)/sizeof(CPlayer::AnimFrameSfx);
@ -175,6 +181,7 @@ const CPlayer::AnimSfx CPlayer::s_animSfx[]=
{ 0, NULL }, // ANIM_PLAYER_ANIM_TALK04 { 0, NULL }, // ANIM_PLAYER_ANIM_TALK04
{ 0, NULL }, // ANIM_PLAYER_ANIM_TEETERBACK { 0, NULL }, // ANIM_PLAYER_ANIM_TEETERBACK
{ 0, NULL }, // ANIM_PLAYER_ANIM_TEETERFRONT { 0, NULL }, // ANIM_PLAYER_ANIM_TEETERFRONT
{ s_idleWindCount, s_idleWindSfx }, // ANIM_PLAYER_ANIM_IDLEWIND
}; };

View File

@ -156,19 +156,16 @@ void CPlayerStateIdle::setNextIdleAnim(CPlayer *_player)
int animNo; int animNo;
if(m_idleTime<5) if(m_idleTime<5)
{ {
m_currentIdleAnim=0; // First anim in list is the default idle // Run the default idle anim a number of times before
// starting to do weird things..
m_currentIdleAnim=0;
} }
else else
{ {
if(getNumIdleAnims()>1) // Alternate random idle anims with the default one
{ if(m_currentIdleAnim==0&&getNumIdleAnims()>1)
// Randomly choose the next anim to run
int lastAnim;
lastAnim=m_currentIdleAnim;
do
{ {
m_currentIdleAnim=getRndRange(getNumIdleAnims()); m_currentIdleAnim=getRndRange(getNumIdleAnims());
}while(m_currentIdleAnim==lastAnim);
} }
else else
{ {
@ -195,7 +192,6 @@ void CPlayerStateIdle::setNextIdleAnim(CPlayer *_player)
m_idleTime++; m_idleTime++;
} }
} }
@ -208,12 +204,18 @@ void CPlayerStateIdle::setNextIdleAnim(CPlayer *_player)
static IdleAnims s_unarmedIdleAnims[]= static IdleAnims s_unarmedIdleAnims[]=
{ {
// start frame loop frame end frame loop count // start frame loop frame end frame loop count
{ -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 4 }, { -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 4 }, // default
{ -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 10 }, { -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 10 },
{ ANIM_PLAYER_ANIM_FACEFRONT, ANIM_PLAYER_ANIM_IDLEHOOLA, ANIM_PLAYER_ANIM_FACEBACK, 3 }, { ANIM_PLAYER_ANIM_FACEFRONT, ANIM_PLAYER_ANIM_IDLEHOOLA, ANIM_PLAYER_ANIM_FACEBACK, 5 },
{ ANIM_PLAYER_ANIM_FACEFRONT, ANIM_PLAYER_ANIM_IDLEWIGGLEARM, ANIM_PLAYER_ANIM_FACEBACK, 3 }, { ANIM_PLAYER_ANIM_FACEFRONT, ANIM_PLAYER_ANIM_IDLEWIGGLEARM, ANIM_PLAYER_ANIM_FACEBACK, 5 },
{ -1, ANIM_PLAYER_ANIM_IDLELOOK, -1, 1 }, { -1, ANIM_PLAYER_ANIM_IDLELOOK, -1, 1 },
{ -1, ANIM_PLAYER_ANIM_IDLEWIND, -1, 1 },
}; };
//idlekick
//idlescratch
//? - idlesleep* - wakeup
//idlestretch
//idlewind
static int s_numUnarmedIdleAnims=sizeof(s_unarmedIdleAnims)/sizeof(IdleAnims); static int s_numUnarmedIdleAnims=sizeof(s_unarmedIdleAnims)/sizeof(IdleAnims);
IdleAnims *CPlayerStateUnarmedIdle::getIdleAnimsDb(int _animNo) IdleAnims *CPlayerStateUnarmedIdle::getIdleAnimsDb(int _animNo)
{ {
@ -235,7 +237,7 @@ int CPlayerStateUnarmedIdle::getNumIdleAnims()
static IdleAnims s_coralBlowerIdleAnims[]= static IdleAnims s_coralBlowerIdleAnims[]=
{ {
// start frame loop frame end frame loop count // start frame loop frame end frame loop count
{ -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 4 }, { -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 4 }, // default
{ -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 10 }, { -1, ANIM_PLAYER_ANIM_IDLEBREATHE, -1, 10 },
{ -1, ANIM_PLAYER_ANIM_IDLELOOK, -1, 1 }, { -1, ANIM_PLAYER_ANIM_IDLELOOK, -1, 1 },
}; };