This commit is contained in:
parent
da36f846ae
commit
131369d2f4
7 changed files with 120 additions and 87 deletions
|
@ -63,13 +63,11 @@ static FunctionDef s_functionNames[]=
|
||||||
{
|
{
|
||||||
{ "setCharacterAnimation", 2 }, // characterId,animationId
|
{ "setCharacterAnimation", 2 }, // characterId,animationId
|
||||||
{ "setText", 2 }, // characterId,textId
|
{ "setText", 2 }, // characterId,textId
|
||||||
{ "giveItem", 1 }, // itemId
|
|
||||||
{ "gotItem", 1 }, // itemId
|
|
||||||
{ "setResponseOptions", 1 }, // optionsId
|
{ "setResponseOptions", 1 }, // optionsId
|
||||||
{ "getResponse", 0 }, //
|
{ "getResponse", 0 }, //
|
||||||
|
{ "getAmmoCount", 1 }, // ammoId
|
||||||
{ "drawSprite", 4 }, // frame,x,y,ot
|
{ "setAmmoCount", 2 }, // ammoId,amount
|
||||||
{ "getFrameTime", 0 }, //
|
{ "isHoldingWeapon", 1 }, // weaponId
|
||||||
};
|
};
|
||||||
static int s_functionCount=sizeof(s_functionNames)/sizeof(FunctionDef);
|
static int s_functionCount=sizeof(s_functionNames)/sizeof(FunctionDef);
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,19 @@
|
||||||
#include data/scripts/defs/trans.scr
|
#include data/scripts/defs/trans.scr
|
||||||
|
|
||||||
|
|
||||||
_setText(CHAR_PATRICK,STR__INGAME__CH3__L3__PATRICK1);
|
if(_isHoldingWeapon(WEAPON_BUBBLEWAND)==TRUE)
|
||||||
_setResponseOptions(QUESTION_OK);
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
pause;
|
if(_getAmmoCount(AMMO_BUBBLEWAND)<10)
|
||||||
|
{
|
||||||
|
_setText(CHAR_PATRICK,STR__INGAME__CH3__L3__PATRICK1);
|
||||||
|
_setResponseOptions(QUESTION_OK);
|
||||||
|
do
|
||||||
|
{
|
||||||
|
pause;
|
||||||
|
}
|
||||||
|
while(_getResponse()==ANSWER_NONE);
|
||||||
|
_setAmmoCount(AMMO_BUBBLEWAND,10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while(_getResponse()==ANSWER_NONE);
|
|
||||||
|
|
||||||
stop;
|
stop;
|
||||||
|
|
|
@ -6,12 +6,19 @@
|
||||||
#include data/scripts/defs/trans.scr
|
#include data/scripts/defs/trans.scr
|
||||||
|
|
||||||
|
|
||||||
_setText(CHAR_PATRICK,STR__INGAME__CH3__L3__PATRICK2);
|
if(_isHoldingWeapon(WEAPON_BUBBLEWAND)==TRUE)
|
||||||
_setResponseOptions(QUESTION_OK);
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
pause;
|
if(_getAmmoCount(AMMO_BUBBLEWAND)<10)
|
||||||
|
{
|
||||||
|
_setText(CHAR_PATRICK,STR__INGAME__CH3__L3__PATRICK2);
|
||||||
|
_setResponseOptions(QUESTION_OK);
|
||||||
|
do
|
||||||
|
{
|
||||||
|
pause;
|
||||||
|
}
|
||||||
|
while(_getResponse()==ANSWER_NONE);
|
||||||
|
_setAmmoCount(AMMO_BUBBLEWAND,10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while(_getResponse()==ANSWER_NONE);
|
|
||||||
|
|
||||||
stop;
|
stop;
|
||||||
|
|
|
@ -1,21 +1,7 @@
|
||||||
// Item numbers
|
// For getAmmoCount(), setAmmoCount()
|
||||||
|
#define AMMO_BUBBLEWAND 0
|
||||||
|
|
||||||
#define ITEM_BALLOON 0
|
|
||||||
#define ITEM_BUBBLE_MIXTURE 1
|
// For isHoldingWeapon()
|
||||||
#define ITEM_DIVING_HELMET 2
|
#define WEAPON_BUBBLEWAND 0
|
||||||
#define ITEM_CORAL_BLOWER 3
|
|
||||||
#define ITEM_NET 4
|
|
||||||
#define ITEM_JELLY_LAUNCHER 5
|
|
||||||
#define ITEM_GLASSES 6
|
|
||||||
#define ITEM_SQUEAKY_BOOTS 7
|
|
||||||
#define ITEM_SUPERHERO_RING 8
|
|
||||||
#define ITEM_GARY_THE_SNAIL 9
|
|
||||||
#define ITEM_DISGUISE 10
|
|
||||||
#define ITEM_100_HEALTH 11
|
|
||||||
#define ITEM_50_HEALTH 12
|
|
||||||
#define ITEM_25_HEALTH 13
|
|
||||||
#define ITEM_JELLYFISH_1 14
|
|
||||||
#define ITEM_JELLYFISH_2 15
|
|
||||||
#define ITEM_JELLYFISH_3 16
|
|
||||||
#define ITEM_JAM_JAR 17
|
|
||||||
|
|
||||||
|
|
|
@ -409,8 +409,10 @@ public:
|
||||||
int isWearingDivingHelmet() {return m_divingHelmet;}
|
int isWearingDivingHelmet() {return m_divingHelmet;}
|
||||||
|
|
||||||
void giveBubbleAmmo() {m_bubbleAmmo+=INITIAL_BUBBLE_BLOWER_AMMO;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
|
void giveBubbleAmmo() {m_bubbleAmmo+=INITIAL_BUBBLE_BLOWER_AMMO;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
|
||||||
|
void setBubbleAmmo(int _amount) {m_bubbleAmmo=_amount;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
|
||||||
void useOneBubble() {m_bubbleAmmo--;}
|
void useOneBubble() {m_bubbleAmmo--;}
|
||||||
int getBubbleAmmo() {return m_bubbleAmmo;}
|
int getBubbleAmmo() {return m_bubbleAmmo;}
|
||||||
|
int isHoldingBubbleWand() {return m_currentMode==PLAYER_MODE_BUBBLE_MIXTURE;}
|
||||||
|
|
||||||
void giveJellyAmmo() {m_jellyAmmo+=JELLY_LAUNCHER_AMMO_IN_PICKUP;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;}
|
void giveJellyAmmo() {m_jellyAmmo+=JELLY_LAUNCHER_AMMO_IN_PICKUP;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;}
|
||||||
void useOneJelly() {m_jellyAmmo--;}
|
void useOneJelly() {m_jellyAmmo--;}
|
||||||
|
@ -420,14 +422,13 @@ public:
|
||||||
void useOneJellyFishAmmo() {m_jellyfishAmmoCount--;}
|
void useOneJellyFishAmmo() {m_jellyfishAmmoCount--;}
|
||||||
int isJellyFishAmmoFull() {return m_jellyfishAmmoCount==MAX_JELLFISH_IN_NET;}
|
int isJellyFishAmmoFull() {return m_jellyfishAmmoCount==MAX_JELLFISH_IN_NET;}
|
||||||
int getJellyFishAmmo() {return m_jellyfishAmmoCount;}
|
int getJellyFishAmmo() {return m_jellyfishAmmoCount;}
|
||||||
|
int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;}
|
||||||
|
|
||||||
void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;}
|
void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;}
|
||||||
int getIsInWater() {return m_isInWater;}
|
int getIsInWater() {return m_isInWater;}
|
||||||
int getIsHelmetFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;}
|
int getIsHelmetFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;}
|
||||||
int getIsHelmetSoFullThatIDontNeedToSoakUp(){return m_healthWaterLevel>=WATERMINSOAKUPLEVEL;}
|
int getIsHelmetSoFullThatIDontNeedToSoakUp(){return m_healthWaterLevel>=WATERMINSOAKUPLEVEL;}
|
||||||
|
|
||||||
int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;}
|
|
||||||
|
|
||||||
void justButtBouncedABadGuy(); // Also fugly.. :/
|
void justButtBouncedABadGuy(); // Also fugly.. :/
|
||||||
|
|
||||||
void setFloating();
|
void setFloating();
|
||||||
|
|
|
@ -35,6 +35,15 @@ question/response
|
||||||
#include "game\convo.h"
|
#include "game\convo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GAME_GAME_H__
|
||||||
|
#include "game\game.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLAYER_PLAYER_H__
|
||||||
|
#include "player\player.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -46,6 +55,19 @@ question/response
|
||||||
Tyepdefs && Defines
|
Tyepdefs && Defines
|
||||||
------------------- */
|
------------------- */
|
||||||
|
|
||||||
|
// For getAmmoCount(), setAmmoCount()
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
AMMO_BUBBLEWAND,
|
||||||
|
};
|
||||||
|
|
||||||
|
// For isHoldingWeapon()
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
WEAPON_BUBBLEWAND,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Structure defintions
|
Structure defintions
|
||||||
-------------------- */
|
-------------------- */
|
||||||
|
@ -63,13 +85,11 @@ typedef struct
|
||||||
|
|
||||||
static signed short func_setCharacterAnimation(unsigned short *_args);
|
static signed short func_setCharacterAnimation(unsigned short *_args);
|
||||||
static signed short func_setText(unsigned short *_args);
|
static signed short func_setText(unsigned short *_args);
|
||||||
static signed short func_giveItem(unsigned short *_args);
|
|
||||||
static signed short func_gotItem(unsigned short *_args);
|
|
||||||
static signed short func_setResponseOptions(unsigned short *_args);
|
static signed short func_setResponseOptions(unsigned short *_args);
|
||||||
static signed short func_getResponse(unsigned short *_args);
|
static signed short func_getResponse(unsigned short *_args);
|
||||||
|
static signed short func_getAmmoCount(unsigned short *_args);
|
||||||
static signed short func_drawSprite(unsigned short *_args);
|
static signed short func_setAmmoCount(unsigned short *_args);
|
||||||
static signed short func_getFrameTime(unsigned short *_args);
|
static signed short func_isHoldingWeapon(unsigned short *_args);
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -80,13 +100,11 @@ static FunctionDef s_functionDefs[]=
|
||||||
{
|
{
|
||||||
{ func_setCharacterAnimation, 2 }, // characterId,animationId
|
{ func_setCharacterAnimation, 2 }, // characterId,animationId
|
||||||
{ func_setText, 2 }, // characterId,textId
|
{ func_setText, 2 }, // characterId,textId
|
||||||
{ func_giveItem, 1 }, // itemId
|
|
||||||
{ func_gotItem, 1 }, // itemId
|
|
||||||
{ func_setResponseOptions, 1 }, // optionsId
|
{ func_setResponseOptions, 1 }, // optionsId
|
||||||
{ func_getResponse, 0 }, //
|
{ func_getResponse, 0 }, //
|
||||||
|
{ func_getAmmoCount, 1 }, // ammoId
|
||||||
{ func_drawSprite, 4 }, // frame,x,y,ot
|
{ func_setAmmoCount, 2 }, // ammoId,amount
|
||||||
{ func_getFrameTime, 0 }, //
|
{ func_isHoldingWeapon, 1 }, // weaponId
|
||||||
};
|
};
|
||||||
static const int s_numFunctionDefs=sizeof(s_functionDefs)/sizeof(FunctionDef);
|
static const int s_numFunctionDefs=sizeof(s_functionDefs)/sizeof(FunctionDef);
|
||||||
|
|
||||||
|
@ -135,31 +153,6 @@ static signed short func_setText(unsigned short *_args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose: Flag item as collected
|
|
||||||
Params: itemId
|
|
||||||
Returns: 0
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
static signed short func_giveItem(unsigned short *_args)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose: Test whether an item has been collected or not
|
|
||||||
Params: itemId
|
|
||||||
Returns: true/false
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
static signed short func_gotItem(unsigned short *_args)
|
|
||||||
{
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose: Sets the allowable responses for a question
|
Purpose: Sets the allowable responses for a question
|
||||||
|
@ -188,21 +181,46 @@ static signed short func_getResponse(unsigned short *_args)
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
Params: frame,x,y,ot
|
Params: ammoId
|
||||||
|
Returns: ammoCount
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
static signed short func_getAmmoCount(unsigned short *_args)
|
||||||
|
{
|
||||||
|
int ammo=0;
|
||||||
|
|
||||||
|
switch(_args[0])
|
||||||
|
{
|
||||||
|
case AMMO_BUBBLEWAND:
|
||||||
|
ammo=GameScene.getPlayer()->getBubbleAmmo();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ASSERT(!"BAD AMMO TYPE IN func_getAmmoCount()");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ammo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params: ammoId,amount
|
||||||
Returns: 0
|
Returns: 0
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
#include "gfx\sprbank.h"
|
static signed short func_setAmmoCount(unsigned short *_args)
|
||||||
SpriteBank *sb=NULL;
|
|
||||||
static signed short func_drawSprite(unsigned short *_args)
|
|
||||||
{
|
{
|
||||||
sFrameHdr *fh;
|
switch(_args[0])
|
||||||
if(!sb)
|
|
||||||
{
|
{
|
||||||
sb=new ("sb") SpriteBank;
|
case AMMO_BUBBLEWAND:
|
||||||
sb->load(SPRITES_SPRITES_SPR);
|
GameScene.getPlayer()->setBubbleAmmo(_args[1]);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ASSERT(!"BAD AMMO TYPE IN func_setAmmoCount()");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
fh=sb->getFrameHeader(_args[0]);
|
|
||||||
sb->printFT4(_args[0],_args[1]-(fh->W/2),_args[2]-(fh->H/2),0,0,_args[3]);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,12 +228,28 @@ static signed short func_drawSprite(unsigned short *_args)
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
Params: 0
|
Params: weaponId
|
||||||
Returns: frameCount
|
Returns: true(1) or false(0)
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
static signed short func_getFrameTime(unsigned short *_args)
|
static signed short func_isHoldingWeapon(unsigned short *_args)
|
||||||
{
|
{
|
||||||
return GameState::getFramesSinceLast();
|
int held=0;
|
||||||
|
|
||||||
|
switch(_args[0])
|
||||||
|
{
|
||||||
|
case WEAPON_BUBBLEWAND:
|
||||||
|
if(GameScene.getPlayer()->isHoldingBubbleWand())
|
||||||
|
{
|
||||||
|
held=1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ASSERT(!"BAD AMMO TYPE IN func_setAmmoCount()");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return held;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue