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
|
||||
{ "setText", 2 }, // characterId,textId
|
||||
{ "giveItem", 1 }, // itemId
|
||||
{ "gotItem", 1 }, // itemId
|
||||
{ "setResponseOptions", 1 }, // optionsId
|
||||
{ "getResponse", 0 }, //
|
||||
|
||||
{ "drawSprite", 4 }, // frame,x,y,ot
|
||||
{ "getFrameTime", 0 }, //
|
||||
{ "getAmmoCount", 1 }, // ammoId
|
||||
{ "setAmmoCount", 2 }, // ammoId,amount
|
||||
{ "isHoldingWeapon", 1 }, // weaponId
|
||||
};
|
||||
static int s_functionCount=sizeof(s_functionNames)/sizeof(FunctionDef);
|
||||
|
||||
|
|
|
@ -6,12 +6,19 @@
|
|||
#include data/scripts/defs/trans.scr
|
||||
|
||||
|
||||
_setText(CHAR_PATRICK,STR__INGAME__CH3__L3__PATRICK1);
|
||||
_setResponseOptions(QUESTION_OK);
|
||||
do
|
||||
if(_isHoldingWeapon(WEAPON_BUBBLEWAND)==TRUE)
|
||||
{
|
||||
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;
|
||||
|
|
|
@ -6,12 +6,19 @@
|
|||
#include data/scripts/defs/trans.scr
|
||||
|
||||
|
||||
_setText(CHAR_PATRICK,STR__INGAME__CH3__L3__PATRICK2);
|
||||
_setResponseOptions(QUESTION_OK);
|
||||
do
|
||||
if(_isHoldingWeapon(WEAPON_BUBBLEWAND)==TRUE)
|
||||
{
|
||||
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;
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
// Item numbers
|
||||
// For getAmmoCount(), setAmmoCount()
|
||||
#define AMMO_BUBBLEWAND 0
|
||||
|
||||
#define ITEM_BALLOON 0
|
||||
#define ITEM_BUBBLE_MIXTURE 1
|
||||
#define ITEM_DIVING_HELMET 2
|
||||
#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
|
||||
|
||||
// For isHoldingWeapon()
|
||||
#define WEAPON_BUBBLEWAND 0
|
||||
|
||||
|
|
|
@ -409,8 +409,10 @@ public:
|
|||
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 setBubbleAmmo(int _amount) {m_bubbleAmmo=_amount;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
|
||||
void useOneBubble() {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 useOneJelly() {m_jellyAmmo--;}
|
||||
|
@ -420,14 +422,13 @@ public:
|
|||
void useOneJellyFishAmmo() {m_jellyfishAmmoCount--;}
|
||||
int isJellyFishAmmoFull() {return m_jellyfishAmmoCount==MAX_JELLFISH_IN_NET;}
|
||||
int getJellyFishAmmo() {return m_jellyfishAmmoCount;}
|
||||
int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;}
|
||||
|
||||
void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;}
|
||||
int getIsInWater() {return m_isInWater;}
|
||||
int getIsHelmetFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;}
|
||||
int getIsHelmetSoFullThatIDontNeedToSoakUp(){return m_healthWaterLevel>=WATERMINSOAKUPLEVEL;}
|
||||
|
||||
int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;}
|
||||
|
||||
void justButtBouncedABadGuy(); // Also fugly.. :/
|
||||
|
||||
void setFloating();
|
||||
|
|
|
@ -35,6 +35,15 @@ question/response
|
|||
#include "game\convo.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PLAYER_H__
|
||||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -46,6 +55,19 @@ question/response
|
|||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
||||
// For getAmmoCount(), setAmmoCount()
|
||||
enum
|
||||
{
|
||||
AMMO_BUBBLEWAND,
|
||||
};
|
||||
|
||||
// For isHoldingWeapon()
|
||||
enum
|
||||
{
|
||||
WEAPON_BUBBLEWAND,
|
||||
};
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Structure defintions
|
||||
-------------------- */
|
||||
|
@ -63,13 +85,11 @@ typedef struct
|
|||
|
||||
static signed short func_setCharacterAnimation(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_getResponse(unsigned short *_args);
|
||||
|
||||
static signed short func_drawSprite(unsigned short *_args);
|
||||
static signed short func_getFrameTime(unsigned short *_args);
|
||||
static signed short func_getAmmoCount(unsigned short *_args);
|
||||
static signed short func_setAmmoCount(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_setText, 2 }, // characterId,textId
|
||||
{ func_giveItem, 1 }, // itemId
|
||||
{ func_gotItem, 1 }, // itemId
|
||||
{ func_setResponseOptions, 1 }, // optionsId
|
||||
{ func_getResponse, 0 }, //
|
||||
|
||||
{ func_drawSprite, 4 }, // frame,x,y,ot
|
||||
{ func_getFrameTime, 0 }, //
|
||||
{ func_getAmmoCount, 1 }, // ammoId
|
||||
{ func_setAmmoCount, 2 }, // ammoId,amount
|
||||
{ func_isHoldingWeapon, 1 }, // weaponId
|
||||
};
|
||||
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:
|
||||
Purpose: Sets the allowable responses for a question
|
||||
|
@ -188,21 +181,46 @@ static signed short func_getResponse(unsigned short *_args)
|
|||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
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
|
||||
---------------------------------------------------------------------- */
|
||||
#include "gfx\sprbank.h"
|
||||
SpriteBank *sb=NULL;
|
||||
static signed short func_drawSprite(unsigned short *_args)
|
||||
static signed short func_setAmmoCount(unsigned short *_args)
|
||||
{
|
||||
sFrameHdr *fh;
|
||||
if(!sb)
|
||||
switch(_args[0])
|
||||
{
|
||||
sb=new ("sb") SpriteBank;
|
||||
sb->load(SPRITES_SPRITES_SPR);
|
||||
case AMMO_BUBBLEWAND:
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -210,12 +228,28 @@ static signed short func_drawSprite(unsigned short *_args)
|
|||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params: 0
|
||||
Returns: frameCount
|
||||
Params: weaponId
|
||||
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