From d634fce9219ad1ab3b0f91d3dd11a498fc0cc6bb Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 18 Jul 2001 16:48:49 +0000 Subject: [PATCH] --- Utils/Scripter/function.cpp | 1 + data/Scripts/ch2l2_01.scr | 14 ++++++++----- data/Scripts/ch2l2_02.scr | 14 ++++++++----- data/Scripts/defs/items.scr | 2 +- source/player/player.h | 2 ++ source/script/function.cpp | 39 +++++++++++++++++++++++++++++++++++- tools/scripter.exe | Bin 254015 -> 254015 bytes 7 files changed, 60 insertions(+), 12 deletions(-) diff --git a/Utils/Scripter/function.cpp b/Utils/Scripter/function.cpp index 04c7e44b6..54bfcf08b 100644 --- a/Utils/Scripter/function.cpp +++ b/Utils/Scripter/function.cpp @@ -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); diff --git a/data/Scripts/ch2l2_01.scr b/data/Scripts/ch2l2_01.scr index 524354b07..82b90b68a 100644 --- a/data/Scripts/ch2l2_01.scr +++ b/data/Scripts/ch2l2_01.scr @@ -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) { - pause; + _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; diff --git a/data/Scripts/ch2l2_02.scr b/data/Scripts/ch2l2_02.scr index b4d598f08..21b33af9b 100644 --- a/data/Scripts/ch2l2_02.scr +++ b/data/Scripts/ch2l2_02.scr @@ -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) { - pause; + _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; diff --git a/data/Scripts/defs/items.scr b/data/Scripts/defs/items.scr index 093f1e350..ab5309144 100644 --- a/data/Scripts/defs/items.scr +++ b/data/Scripts/defs/items.scr @@ -4,4 +4,4 @@ // For isHoldingWeapon() #define WEAPON_BUBBLEWAND 0 - +#define WEAPON_BALLOON 1 diff --git a/source/player/player.h b/source/player/player.h index 7480c44cd..632a743d4 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -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;} diff --git a/source/script/function.cpp b/source/script/function.cpp index 33cea0149..4ea56b14c 100644 --- a/source/script/function.cpp +++ b/source/script/function.cpp @@ -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 */ diff --git a/tools/scripter.exe b/tools/scripter.exe index 41bbf64d8f506c9647621b26843728d65b696831..11918961c6de0b56a2bf402dd85f635cf0c80eee 100644 GIT binary patch delta 260 zcmdmgfPeo1{s|wLZgNFr^fL61X zXSKn;)v@pGW^F;Kn-l;+sJFqZjvF=Nd1%!|y5 gj5DTpUSu|5WZ1svBC`YEv-jb^i! zXSknSNZ8S#kOsO=gAZ0$R)}(?5tY8*F#bVpcGA+@R^q zzywse1WNY+X+|Kw21tWI4wN4QmG^-1*}<|vV*A2a=HtbT5z{j-0`2Iz$ZWj*;6-M8 UzKI4b(;hJMFfvZ(eZXu40Q=iWT>t<8