This commit is contained in:
parent
5b2be54bd9
commit
d634fce921
7 changed files with 60 additions and 12 deletions
|
@ -68,6 +68,7 @@ static FunctionDef s_functionNames[]=
|
|||
{ "getAmmoCount", 1 }, // ammoId
|
||||
{ "setAmmoCount", 2 }, // ammoId,amount
|
||||
{ "isHoldingWeapon", 1 }, // weaponId
|
||||
{ "giveWeapon", 1 }, // weaponId
|
||||
};
|
||||
static int s_functionCount=sizeof(s_functionNames)/sizeof(FunctionDef);
|
||||
|
||||
|
|
|
@ -6,12 +6,16 @@
|
|||
#include data/scripts/defs/trans.scr
|
||||
|
||||
|
||||
_setText(CHAR_PATRICK,STR__INGAME__CH2__L2__PATRICK1);
|
||||
_setResponseOptions(QUESTION_OK);
|
||||
do
|
||||
if(_isHoldingWeapon(WEAPON_BALLOON)==FALSE)
|
||||
{
|
||||
_setText(CHAR_PATRICK,STR__INGAME__CH2__L2__PATRICK1);
|
||||
_setResponseOptions(QUESTION_OK);
|
||||
do
|
||||
{
|
||||
pause;
|
||||
}
|
||||
while(_getResponse()==ANSWER_NONE);
|
||||
_giveWeapon(WEAPON_BALLOON);
|
||||
}
|
||||
while(_getResponse()==ANSWER_NONE);
|
||||
|
||||
stop;
|
||||
|
|
|
@ -6,12 +6,16 @@
|
|||
#include data/scripts/defs/trans.scr
|
||||
|
||||
|
||||
_setText(CHAR_PATRICK,STR__INGAME__CH2__L2__PATRICK2);
|
||||
_setResponseOptions(QUESTION_OK);
|
||||
do
|
||||
if(_isHoldingWeapon(WEAPON_BALLOON)==FALSE)
|
||||
{
|
||||
_setText(CHAR_PATRICK,STR__INGAME__CH2__L2__PATRICK2);
|
||||
_setResponseOptions(QUESTION_OK);
|
||||
do
|
||||
{
|
||||
pause;
|
||||
}
|
||||
while(_getResponse()==ANSWER_NONE);
|
||||
_giveWeapon(WEAPON_BALLOON);
|
||||
}
|
||||
while(_getResponse()==ANSWER_NONE);
|
||||
|
||||
stop;
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
// For isHoldingWeapon()
|
||||
#define WEAPON_BUBBLEWAND 0
|
||||
|
||||
#define WEAPON_BALLOON 1
|
||||
|
|
|
@ -426,6 +426,8 @@ public:
|
|||
int getJellyFishAmmo() {return m_jellyfishAmmoCount;}
|
||||
int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;}
|
||||
|
||||
int isHoldingBalloon() {return m_currentMode==PLAYER_MODE_BALLOON;}
|
||||
|
||||
void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;}
|
||||
int getIsInWater() {return m_isInWater;}
|
||||
int getIsHelmetFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;}
|
||||
|
|
|
@ -65,6 +65,7 @@ enum
|
|||
enum
|
||||
{
|
||||
WEAPON_BUBBLEWAND,
|
||||
WEAPON_BALLOON,
|
||||
};
|
||||
|
||||
|
||||
|
@ -90,6 +91,7 @@ static signed short func_getResponse(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);
|
||||
static signed short func_giveWeapon(unsigned short *_args);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -105,6 +107,7 @@ static FunctionDef s_functionDefs[]=
|
|||
{ func_getAmmoCount, 1 }, // ammoId
|
||||
{ func_setAmmoCount, 2 }, // ammoId,amount
|
||||
{ func_isHoldingWeapon, 1 }, // weaponId
|
||||
{ func_giveWeapon, 1 }, // weaponId
|
||||
};
|
||||
static const int s_numFunctionDefs=sizeof(s_functionDefs)/sizeof(FunctionDef);
|
||||
|
||||
|
@ -244,8 +247,15 @@ static signed short func_isHoldingWeapon(unsigned short *_args)
|
|||
}
|
||||
break;
|
||||
|
||||
case WEAPON_BALLOON:
|
||||
if(GameScene.getPlayer()->isHoldingBalloon())
|
||||
{
|
||||
held=1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(!"BAD AMMO TYPE IN func_setAmmoCount()");
|
||||
ASSERT(!"BAD WEAPON TYPE IN func_isHoldingWeapon()");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -253,5 +263,32 @@ static signed short func_isHoldingWeapon(unsigned short *_args)
|
|||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params: weaponId
|
||||
Returns: true(1) or false(0)
|
||||
---------------------------------------------------------------------- */
|
||||
static signed short func_giveWeapon(unsigned short *_args)
|
||||
{
|
||||
switch(_args[0])
|
||||
{
|
||||
case WEAPON_BUBBLEWAND:
|
||||
GameScene.getPlayer()->setMode(PLAYER_MODE_BUBBLE_MIXTURE);
|
||||
break;
|
||||
|
||||
case WEAPON_BALLOON:
|
||||
GameScene.getPlayer()->setMode(PLAYER_MODE_BALLOON);
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(!"BAD WEAPON TYPE IN func_giveWeapon()");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue