HYPNO: fixed rebase conflicts

This commit is contained in:
neuromancer 2022-02-22 08:55:39 +01:00
parent 2acb250dd9
commit 81478d8a9c
12 changed files with 860 additions and 531 deletions

View File

@ -45,8 +45,6 @@ void HypnoEngine::splitArcadeFile(const Common::String &filename, Common::String
break;
list += x;
}
if (list[1] == 'L')
list = "";
break; // No need to keep parsing
}
}
@ -72,8 +70,9 @@ void HypnoEngine::parseArcadeShooting(const Common::String &prefix, const Common
g_parsedArc->segments.clear();
}
ShootSequence HypnoEngine::parseShootList(const Common::String &filename, const Common::String &data) {
SegmentShootsSequence HypnoEngine::parseShootList(const Common::String &filename, const Common::String &data) {
debugC(1, kHypnoDebugParser, "Parsing %s", filename.c_str());
debugC(1, kHypnoDebugParser, "%s", data.c_str());
// Preparsing
Common::String pdata;
Common::StringTokenizer lines(data, "\n");
@ -86,29 +85,63 @@ ShootSequence HypnoEngine::parseShootList(const Common::String &filename, const
continue;
pdata += "\n" + t;
}
// Parsing
Common::StringTokenizer tok(pdata, " ,.\t");
Common::String n;
ShootInfo si;
ShootSequence seq;
while (!tok.empty()) {
t = tok.nextToken();
if (t[0] == '\n')
continue;
n = tok.nextToken();
if (t == "Z")
break;
SegmentShootsSequence seq;
// Parsing
if (pdata[1] == 'L') { // List of elements
SegmentShoots ss;
ss.segmentRepetition = 0;
Common::StringTokenizer tok(pdata, " ,.\n\t");
while (!tok.empty()) {
t = tok.nextToken();
while (t == "L") {
if (ss.segmentRepetition > 0)
seq.push_back(ss);
t = tok.nextToken();
ss.segmentRepetition = atoi(t.c_str());
ss.shootSequence.clear();
t = tok.nextToken();
}
n = tok.nextToken();
if (t == "Z") {
seq.push_back(ss);
break;
}
si.name = n;
si.timestamp = atoi(t.c_str());
if (si.timestamp == 0)
error("Error at parsing '%s' with timestamp: %s", n.c_str(), t.c_str());
ss.shootSequence.push_back(si);
debugC(1, kHypnoDebugParser, "%d -> %s", si.timestamp, si.name.c_str());
}
} else if (pdata[1] == 'S' ) { // Single element
SegmentShoots ss;
Common::StringTokenizer tok(pdata, " ,.\t");
while (!tok.empty()) {
t = tok.nextToken();
if (t[0] == '\n')
continue;
n = tok.nextToken();
if (t == "Z")
break;
Common::replace(n, "\nS", "");
Common::replace(n, "\nZ\n", "");
si.name = n;
si.timestamp = atoi(t.c_str());
if (si.timestamp == 0)
error("Error at parsing '%s' with timestamp: %s", n.c_str(), t.c_str());
ss.shootSequence.push_back(si);
debugC(1, kHypnoDebugParser, "%d -> %s", si.timestamp, si.name.c_str());
}
seq.push_back(ss);
} else
error("Invalid shoot sequence to parse: %c", pdata[1]);
Common::replace(n, "\nS", "");
Common::replace(n, "\nZ\n", "");
si.name = n;
si.timestamp = atoi(t.c_str());
if (si.timestamp == 0)
error("Error at parsing '%s' with timestamp: %s", n.c_str(), t.c_str());
seq.push_back(si);
debugC(1, kHypnoDebugParser, "%d -> %s", si.timestamp, si.name.c_str());
}
return seq;
}
@ -133,19 +166,24 @@ void HypnoEngine::hitPlayer() { error("Function \"%s\" not implemented", __FUNCT
void HypnoEngine::runBeforeArcade(ArcadeShooting *arc) {}
void HypnoEngine::initSegment(ArcadeShooting *arc) { error("Function \"%s\" not implemented", __FUNCTION__); }
void HypnoEngine::findNextSegment(ArcadeShooting *arc) { error("Function \"%s\" not implemented", __FUNCTION__); }
void HypnoEngine::runArcade(ArcadeShooting *arc) {
_arcadeMode = arc->mode;
Common::Point mousePos;
Common::List<uint32> shootsToRemove;
ShootSequence shootSequence = arc->shootSequence;
// segment/shoots
Segments segments = arc->segments;
initSegment(arc);
_levelId = arc->id;
_shootSound = arc->shootSound;
_hitSound = arc->hitSound;
_health = arc->health;
_maxHealth = _health;
Segments segments = arc->segments;
uint32 segmentIdx = 0;
debugC(1, kHypnoDebugArcade, "Starting segment of type %x", segments[segmentIdx].type);
debugC(1, kHypnoDebugArcade, "Starting segment of type %x", segments[_segmentIdx].type);
changeCursor("arcade");
_shoots.clear();
if (!arc->player.empty())
@ -179,7 +217,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
playVideo(background);
float rate = background.decoder->getFrameRate().toDouble();
if (rate < 10) {
debugC(1, kHypnoDebugArcade, "Using frame rate looks odd: %f, increasing x 10", rate);
debugC(1, kHypnoDebugArcade, "Used frame rate looks odd: %f, increasing x 10", rate);
background.decoder->setRate(10.0);
}
loadPalette(arc->backgroundPalette);
@ -187,12 +225,19 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
bool shootingSecondary = false;
bool needsUpdate = true;
bool transition = false;
_obj1KillsCount = 0;
_obj1MissesCount = 0;
_objIdx = 0;
_objKillsCount[0] = 0;
_objKillsCount[1] = 0;
_objMissesCount[0] = 0;
_objMissesCount[1] = 0;
debugC(1, kHypnoDebugArcade, "Using frame delay: %d", arc->frameDelay);
Common::Event event;
bool levelComplete = false;
while (!shouldQuit()) {
//debug("frame: %d", background.decoder->getCurFrame());
needsUpdate = background.decoder->needsUpdate();
while (g_system->getEventManager()->pollEvent(event)) {
mousePos = g_system->getEventManager()->getMousePos();
@ -287,45 +332,35 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
drawScreen();
}
if (background.decoder && background.decoder->getCurFrame() >= int(segments[segmentIdx].start + segments[segmentIdx].size - 1)) {
debugC(1, kHypnoDebugArcade, "Finished segment %d of type %x", segmentIdx, segments[segmentIdx].type);
if (background.decoder && background.decoder->getCurFrame() >= int(segments[_segmentIdx].start + segments[_segmentIdx].size - 1)) {
debugC(1, kHypnoDebugArcade, "Finished segment %d of type %x", _segmentIdx, segments[_segmentIdx].type);
if (segments[segmentIdx].type == 0xb3)
if (_rnd->getRandomBit() || segments.size() == 2)
segmentIdx = segmentIdx + 1;
else
segmentIdx = segmentIdx + 5;
else if (segments[segmentIdx].type == 0xc5) {
if (mousePos.x <= 100)
segmentIdx = segmentIdx + 1;
else if (mousePos.x >= 300)
segmentIdx = segmentIdx + 3;
else
segmentIdx = segmentIdx + 2;
} else if (segments[segmentIdx].type == 0xc2) {
if (mousePos.x <= 160)
segmentIdx = segmentIdx + 1;
else
segmentIdx = segmentIdx + 2;
} else {
segmentIdx = 0;
// Clear shoots
/*for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it) {
if (it->video && it->video->decoder)
skipVideo(*it->video);
delete it->video;
}
_shoots.clear();*/
findNextSegment(arc);
if (segmentIdx >= segments.size())
error("Invalid segment %d", segmentIdx);
if (_segmentIdx >= segments.size())
error("Invalid segment %d", _segmentIdx);
debugC(1, kHypnoDebugArcade, "Starting segment %d of type %x at %d", segmentIdx, segments[segmentIdx].type, segments[segmentIdx].start);
if (!segments[segmentIdx].end) { // If it is not the end segment
background.decoder->forceSeekToFrame(segments[segmentIdx].start);
debugC(1, kHypnoDebugArcade, "Starting segment %d of type %x at %d", _segmentIdx, segments[_segmentIdx].type, segments[_segmentIdx].start);
if (!segments[_segmentIdx].end) { // If it is not the end segment
background.decoder->forceSeekToFrame(segments[_segmentIdx].start+2);
needsUpdate = true;
continue;
}
} else
levelComplete = true;
}
if (segments[segmentIdx].end || checkArcadeLevelCompleted(background, segments[segmentIdx])) {
if (segments[_segmentIdx].end || levelComplete) {
skipVideo(background);
// Objectives
if ((arc->obj1KillsRequired > 0 || arc->obj1MissesAllowed) > 0 && !_skipLevel) {
if (_obj1KillsCount < arc->obj1KillsRequired || _obj1MissesCount > arc->obj1MissesAllowed) {
if ((_objKillsCount[_objIdx] > 0 || _objMissesCount[_objIdx] > 0) && !_skipLevel) {
if (_objKillsCount[_objIdx] < arc->objKillsRequired[_objIdx] || _objMissesCount[_objIdx] > arc->objMissesAllowed[_objIdx]) {
if (!arc->defeatMissBossVideo.empty()) {
MVideo video(arc->defeatMissBossVideo, Common::Point(0, 0), false, true, false);
runIntro(video);
@ -352,10 +387,14 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
break;
}
if (shootSequence.size() > 0) {
ShootInfo si = shootSequence.front();
if ((int)si.timestamp <= background.decoder->getCurFrame()) {
shootSequence.pop_front();
if (_shootSequence.size() > 0) {
ShootInfo si = _shootSequence.front();
int idx = (int)segments[_segmentIdx].size * _segmentRepetition \
+ background.decoder->getCurFrame() \
- (int)segments[_segmentIdx].start;
//debug("%d %d", si.timestamp, idx);
if ((int)si.timestamp <= idx) {
_shootSequence.pop_front();
for (Shoots::iterator it = arc->shoots.begin(); it != arc->shoots.end(); ++it) {
if (it->name == si.name) {
Shoot s = *it;
@ -504,13 +543,15 @@ void HypnoEngine::shoot(const Common::Point &mousePos) {
break;
explosionFrame = *it;
}
_objKillsCount[_objIdx] = _objKillsCount[_objIdx] + _shoots[i].objKillsCount;
if (_shoots[i].video->decoder->getFrameCount() < explosionFrame + 12)
explosionFrame = _shoots[i].video->decoder->getFrameCount() - 12;
_shoots[i].video->decoder->forceSeekToFrame(explosionFrame + 2);
} else {
byte p[3] = {0x00, 0x00, 0x00}; // Always black?
assert(_shoots[i].paletteSize == 1 || _shoots[i].paletteSize == 0);
loadPalette((byte *) &p, _shoots[i].paletteOffset, _shoots[i].paletteSize);
_obj1KillsCount = _obj1KillsCount + _shoots[i].obj1KillsCount;
_objKillsCount[_objIdx] = _objKillsCount[_objIdx] + _shoots[i].objKillsCount;
if (!_shoots[i].explosionAnimation.empty()) {
_shoots[i].video = new MVideo(_shoots[i].explosionAnimation, mousePos, true, false, false);
playVideo(*_shoots[i].video);

View File

@ -363,8 +363,8 @@ public:
attackWeight = 0;
paletteOffset = 0;
paletteSize = 0;
obj1KillsCount = 0;
obj1MissesCount = 0;
objKillsCount = 0;
objMissesCount = 0;
animation = "NONE";
explosionAnimation = "";
}
@ -378,8 +378,8 @@ public:
uint32 attackWeight;
// Objectives
uint32 obj1KillsCount;
uint32 obj1MissesCount;
uint32 objKillsCount;
uint32 objMissesCount;
// Palette
uint32 paletteOffset;
@ -405,6 +405,17 @@ public:
};
typedef Common::List<ShootInfo> ShootSequence;
class SegmentShoots {
public:
SegmentShoots() {
segmentRepetition = 0;
}
ShootSequence shootSequence;
uint32 segmentRepetition;
};
typedef Common::Array<SegmentShoots> SegmentShootsSequence;
typedef Common::Array<Common::String> Sounds;
enum SegmentType {
@ -442,10 +453,10 @@ public:
health = 100;
transitionTime = 0;
id = 0;
obj1KillsRequired = 0;
obj1MissesAllowed = 0;
obj2KillsRequired = 0;
obj2MissesAllowed = 0;
objKillsRequired[0] = 0;
objKillsRequired[1] = 0;
objMissesAllowed[0] = 0;
objMissesAllowed[1] = 0;
frameDelay = 0;
}
uint32 id;
@ -455,10 +466,8 @@ public:
Segments segments;
// Objectives
uint32 obj1KillsRequired;
uint32 obj1MissesAllowed;
uint32 obj2KillsRequired;
uint32 obj2MissesAllowed;
uint32 objKillsRequired [2];
uint32 objMissesAllowed [2];
// Videos
Filename transitionVideo;
@ -475,7 +484,7 @@ public:
Filename player;
int health;
Shoots shoots;
ShootSequence shootSequence;
SegmentShootsSequence shootSequence;
// Sounds
Filename targetSound;

File diff suppressed because it is too large Load Diff

View File

@ -60,7 +60,7 @@ using namespace Hypno;
%token<i> NUM BYTE
// header
%token COMMENT CTOK DTOK HTOK HETOK HLTOK HUTOK RETTOK QTOK RESTOK
%token PTOK FTOK TTOK TPTOK ATOK VTOK OTOK NTOK NSTOK RTOK R0TOK ITOK JTOK ZTOK
%token PTOK FTOK TTOK TPTOK ATOK VTOK OTOK NTOK NSTOK RTOK R01TOK ITOK I1TOK JTOK ZTOK
// body
%token NONETOK A0TOK P0TOK WTOK
@ -101,21 +101,29 @@ hline: CTOK NUM {
| VTOK NUM NUM { debugC(1, kHypnoDebugParser, "V %d %d", $2, $3); }
| VTOK RESTOK { debugC(1, kHypnoDebugParser, "V 320,200"); }
| OTOK NUM NUM {
g_parsedArc->obj1KillsRequired = $2;
g_parsedArc->obj1MissesAllowed = $3;
g_parsedArc->objKillsRequired[0] = $2;
g_parsedArc->objMissesAllowed[0] = $3;
debugC(1, kHypnoDebugParser, "O %d %d", $2, $3);
}
| ONTOK NUM NUM {
if (Common::String("O0") == $1) {
g_parsedArc->obj1KillsRequired = $2;
g_parsedArc->obj1MissesAllowed = $3;
g_parsedArc->objKillsRequired[0] = $2;
g_parsedArc->objMissesAllowed[0] = $3;
} else if (Common::String("O1") == $1) {
g_parsedArc->obj2KillsRequired = $2;
g_parsedArc->obj2MissesAllowed = $3;
g_parsedArc->objKillsRequired[1] = $2;
g_parsedArc->objMissesAllowed[1] = $3;
} else
error("Invalid objective: '%s'", $1);
debugC(1, kHypnoDebugParser, "ON %d %d", $2, $3); }
| ONTOK NUM { debugC(1, kHypnoDebugParser, "ON %d", $2); }
| ONTOK NUM {
if (Common::String("O0") == $1) {
g_parsedArc->objKillsRequired[0] = $2;
} else if (Common::String("O1") == $1) {
g_parsedArc->objKillsRequired[1] = $2;
} else
error("Invalid objective: '%s'", $1);
debugC(1, kHypnoDebugParser, "ON %d", $2);
}
| TPTOK FILENAME NUM FILENAME {
g_parsedArc->transitionVideo = $2;
g_parsedArc->transitionTime = $3;
@ -142,13 +150,16 @@ hline: CTOK NUM {
| ITOK FILENAME {
g_parsedArc->player = $2;
debugC(1, kHypnoDebugParser, "I %s", $2);
}
}
| I1TOK FILENAME {
debugC(1, kHypnoDebugParser, "I1 %s", $2);
}
| QTOK NUM NUM { debugC(1, kHypnoDebugParser, "Q %d %d", $2, $3); }
| BNTOK FILENAME {
if (Common::String("B0") == $1)
g_parsedArc->beforeVideo = $2;
//else if (Common::String("B1") == $1)
// g_parsedArc->nextLevelVideo = $2;
// g_parsedArc->beforeVideo = $2;
else if (Common::String("B2") == $1)
g_parsedArc->nextLevelVideo = $2;
else if (Common::String("B3") == $1)
@ -200,6 +211,27 @@ hline: CTOK NUM {
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "HU %x %d %d", $2, $3, $4);
}
| HTOK NAME NUM NUM {
assert(Common::String($2).size() == 1);
Segment segment($2[0], $4, $3);
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H %s %d %d", $2, $3, $4);
}
| HTOK RTOK NUM NUM { // Workaround for BYTE == R
Segment segment('R', $4, $3);
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H R %d %d", $3, $4);
}
| HTOK ATOK NUM NUM { // Workaround for BYTE == A
Segment segment('A', $4, $3);
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H A %d %d", $3, $4);
}
| HTOK PTOK NUM NUM { // Workaround for BYTE == P
Segment segment('P', $4, $3);
g_parsedArc->segments.push_back(segment);
debugC(1, kHypnoDebugParser, "H P %d %d", $3, $4);
}
| HTOK BYTE NUM NUM {
Segment segment($2, $4, $3);
g_parsedArc->segments.push_back(segment);
@ -306,11 +338,14 @@ bline: FNTOK FILENAME {
debugC(1, kHypnoDebugParser, "A0 %d %d", $2, $3);
}
| RTOK NUM NUM {
shoot->obj1KillsCount = $2;
shoot->obj1MissesCount = $3;
shoot->objKillsCount = $2;
shoot->objMissesCount = $3;
debugC(1, kHypnoDebugParser, "R %d %d", $2, $3);
}
| R0TOK NUM NUM { debugC(1, kHypnoDebugParser, "R0 %d %d", $2, $3); }
| R01TOK NUM NUM {
shoot->objKillsCount = $2;
shoot->objMissesCount = $3;
debugC(1, kHypnoDebugParser, "R0/1 %d %d", $2, $3); }
| BNTOK NUM NUM { debugC(1, kHypnoDebugParser, "BN %d %d", $2, $3); }
| KNTOK NUM NUM {
shoot->explosionFrames.push_front($3);
@ -327,6 +362,7 @@ bline: FNTOK FILENAME {
| HTOK NUM {
shoot->attackFrames.push_back($2);
debugC(1, kHypnoDebugParser, "H %d", $2); }
| VTOK NUM { debugC(1, kHypnoDebugParser, "V %d", $2); }
| WTOK NUM {
shoot->attackWeight = $2;
debugC(1, kHypnoDebugParser, "W %d", $2); }

View File

@ -55,7 +55,7 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
_countdown(0), _timerStarted(false), _score(0), _lives(0),
_defaultCursor(""), _checkpoint(""),
_currentPlayerPosition(kPlayerLeft), _lastPlayerPosition(kPlayerLeft),
_obj1KillsCount(0), _obj1MissesCount(0),
//_obj1KillsCount(0), _obj1MissesCount(0),
_screenW(0), _screenH(0) { // Every games initializes its own resolution
_rnd = new Common::RandomSource("hypno");

View File

@ -70,7 +70,6 @@ enum PlayerPosition {
class HypnoEngine : public Engine {
private:
Common::RandomSource *_rnd;
Image::ImageDecoder *_image;
public:
@ -111,7 +110,7 @@ public:
// Parsing
void splitArcadeFile(const Common::String &filename, Common::String &arc, Common::String &list);
void parseArcadeShooting(const Common::String &prefix, const Common::String &name, const Common::String &data);
ShootSequence parseShootList(const Common::String &name, const Common::String &data);
SegmentShootsSequence parseShootList(const Common::String &name, const Common::String &data);
void loadArcadeLevel(const Common::String &current, const Common::String &nextWin, const Common::String &nextLose, const Common::String &prefix);
void loadSceneLevel(const Common::String &current, const Common::String &next, const Common::String &prefix);
LibFile *loadLib(const Filename &prefix, const Filename &filename, bool encrypted);
@ -223,6 +222,17 @@ public:
virtual void drawShoot(const Common::Point &mousePos);
virtual void shoot(const Common::Point &mousePos);
virtual void hitPlayer();
// Segments
uint32 _segmentIdx;
uint32 _segmentOffset;
uint32 _segmentRepetition;
uint32 _segmentRepetitionMax;
uint32 _segmentShootSequenceOffset;
uint32 _segmentShootSequenceMax;
ShootSequence _shootSequence;
virtual void findNextSegment(ArcadeShooting *arc);
virtual void initSegment(ArcadeShooting *arc);
virtual bool checkArcadeLevelCompleted(MVideo &background, Segment segment);
Common::String _difficulty;
bool _skipLevel;
@ -242,8 +252,9 @@ public:
int _playerFrameSep;
// Objectives
uint32 _obj1KillsCount;
uint32 _obj1MissesCount;
uint32 _objIdx;
uint32 _objKillsCount[2];
uint32 _objMissesCount[2];
// Fonts
virtual void loadFonts();
@ -265,6 +276,9 @@ public:
bool startAlarm(uint32, Common::String *);
bool startCountdown(uint32);
void removeTimers();
// Random
Common::RandomSource *_rnd;
};
struct chapterEntry {
@ -296,7 +310,11 @@ public:
Common::String findNextLevel(const Common::String &level) override;
Common::String findNextLevel(const Transition *trans) override;
// Arcade
void runBeforeArcade(ArcadeShooting *arc) override;
void findNextSegment(ArcadeShooting *arc) override;
void initSegment(ArcadeShooting *arc) override;
private:
void runMainMenu(Code *code);
void runCheckLives(Code *code);
@ -318,6 +336,9 @@ public:
void drawPlayer() override;
void drawHealth() override;
void hitPlayer() override;
void findNextSegment(ArcadeShooting *arc) override;
void initSegment(ArcadeShooting *arc) override;
bool checkArcadeLevelCompleted(MVideo &background, Segment segment) override;
void drawBackToMenu(Hotspot *h) override;

View File

@ -633,8 +633,8 @@ static void yynoreturn yy_fatal_error ( const char* msg );
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 44
#define YY_END_OF_BUFFER 45
#define YY_NUM_RULES 45
#define YY_END_OF_BUFFER 46
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@ -642,16 +642,16 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static const flex_int16_t yy_accept[76] =
static const flex_int16_t yy_accept[77] =
{ 0,
0, 0, 45, 43, 42, 40, 40, 43, 35, 35,
35, 35, 43, 9, 36, 2, 3, 36, 26, 7,
17, 18, 36, 13, 11, 8, 19, 15, 36, 23,
10, 21, 22, 36, 20, 36, 42, 35, 38, 35,
35, 35, 35, 0, 37, 28, 36, 29, 25, 4,
5, 6, 30, 14, 36, 12, 31, 16, 27, 24,
32, 36, 34, 34, 33, 33, 35, 41, 36, 0,
1, 0, 0, 39, 0
0, 0, 46, 44, 43, 41, 41, 44, 36, 36,
36, 36, 44, 9, 37, 2, 3, 37, 27, 7,
17, 19, 37, 13, 11, 8, 20, 15, 37, 24,
10, 22, 23, 37, 21, 37, 43, 36, 39, 36,
36, 36, 36, 0, 38, 29, 37, 30, 26, 4,
5, 6, 18, 31, 14, 37, 12, 32, 16, 28,
25, 33, 37, 35, 35, 34, 34, 36, 42, 37,
0, 1, 0, 0, 40, 0
} ;
static const YY_CHAR yy_ec[256] =
@ -695,33 +695,33 @@ static const YY_CHAR yy_meta[45] =
4, 4, 4, 1
} ;
static const flex_int16_t yy_base[82] =
static const flex_int16_t yy_base[83] =
{ 0,
0, 0, 200, 201, 189, 201, 201, 36, 41, 46,
51, 56, 0, 62, 64, 178, 176, 175, 77, 83,
174, 173, 84, 93, 95, 91, 172, 98, 102, 100,
171, 170, 165, 108, 164, 0, 169, 113, 0, 118,
143, 93, 132, 166, 0, 161, 159, 158, 157, 156,
155, 154, 153, 201, 111, 152, 151, 139, 138, 137,
134, 0, 0, 201, 0, 201, 133, 136, 125, 125,
126, 123, 111, 201, 201, 185, 189, 191, 193, 74,
195
0, 0, 203, 204, 200, 204, 204, 36, 41, 46,
51, 56, 0, 62, 64, 185, 180, 178, 77, 83,
84, 177, 87, 96, 97, 102, 176, 104, 110, 85,
175, 174, 173, 95, 172, 0, 176, 120, 0, 130,
135, 83, 125, 172, 0, 167, 166, 165, 164, 163,
158, 157, 156, 155, 204, 141, 154, 153, 151, 150,
149, 148, 0, 0, 204, 0, 204, 145, 151, 107,
143, 145, 143, 107, 204, 204, 187, 191, 193, 195,
74, 197
} ;
static const flex_int16_t yy_def[82] =
static const flex_int16_t yy_def[83] =
{ 0,
75, 1, 75, 75, 75, 75, 75, 75, 76, 76,
76, 76, 77, 78, 78, 78, 78, 78, 78, 78,
78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
78, 78, 78, 79, 78, 80, 75, 75, 76, 76,
76, 41, 41, 77, 81, 78, 78, 78, 78, 78,
78, 78, 78, 75, 78, 78, 78, 78, 78, 78,
78, 80, 76, 75, 76, 75, 41, 77, 78, 75,
78, 75, 75, 75, 0, 75, 75, 75, 75, 75,
75
76, 1, 76, 76, 76, 76, 76, 76, 77, 77,
77, 77, 78, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 80, 79, 81, 76, 76, 77, 77,
77, 41, 41, 78, 82, 79, 79, 79, 79, 79,
79, 79, 79, 79, 76, 79, 79, 79, 79, 79,
79, 79, 81, 77, 76, 77, 76, 41, 78, 79,
76, 79, 76, 76, 76, 0, 76, 76, 76, 76,
76, 76
} ;
static const flex_int16_t yy_nxt[246] =
static const flex_int16_t yy_nxt[249] =
{ 0,
4, 5, 6, 7, 4, 4, 8, 4, 9, 10,
11, 12, 9, 13, 14, 15, 16, 17, 18, 19,
@ -730,29 +730,29 @@ static const flex_int16_t yy_nxt[246] =
18, 18, 18, 7, 38, 38, 38, 38, 38, 40,
40, 40, 40, 40, 40, 41, 40, 40, 40, 40,
40, 42, 40, 40, 40, 40, 43, 40, 40, 45,
46, 45, 48, 48, 48, 48, 48, 62, 48, 48,
46, 45, 48, 48, 48, 48, 48, 63, 48, 48,
48, 48, 48, 48, 45, 49, 49, 49, 49, 49,
45, 45, 53, 53, 53, 53, 53, 54, 45, 57,
45, 45, 45, 53, 45, 54, 54, 54, 54, 54,
45, 50, 45, 56, 56, 45, 58, 45, 51, 45,
59, 59, 59, 59, 59, 45, 52, 65, 45, 74,
55, 38, 38, 38, 38, 38, 40, 40, 40, 40,
40, 73, 45, 45, 65, 72, 66, 69, 70, 68,
67, 45, 60, 71, 45, 45, 45, 47, 47, 47,
47, 40, 40, 40, 40, 40, 39, 39, 45, 45,
45, 45, 45, 45, 45, 45, 45, 63, 45, 68,
37, 45, 45, 39, 39, 75, 75, 45, 45, 45,
45, 45, 45, 45, 63, 45, 64, 39, 39, 44,
37, 44, 44, 47, 47, 61, 61, 45, 45, 75,
55, 50, 45, 45, 45, 57, 57, 66, 51, 45,
58, 45, 59, 59, 45, 75, 52, 45, 60, 60,
60, 60, 60, 56, 66, 72, 67, 61, 38, 38,
38, 38, 38, 68, 47, 47, 47, 47, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 45, 39,
71, 74, 45, 73, 69, 45, 45, 45, 45, 64,
45, 45, 45, 45, 45, 45, 39, 70, 76, 39,
45, 45, 45, 45, 45, 69, 64, 37, 65, 45,
45, 45, 45, 45, 45, 45, 39, 45, 76, 39,
39, 44, 45, 44, 44, 47, 47, 62, 62, 45,
3, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75
45, 37, 76, 3, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76
} ;
static const flex_int16_t yy_chk[246] =
static const flex_int16_t yy_chk[249] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -761,34 +761,34 @@ static const flex_int16_t yy_chk[246] =
1, 1, 1, 1, 8, 8, 8, 8, 8, 9,
9, 9, 9, 9, 10, 10, 10, 10, 10, 11,
11, 11, 11, 11, 12, 12, 12, 12, 12, 14,
14, 15, 15, 15, 15, 15, 15, 80, 15, 15,
14, 15, 15, 15, 15, 15, 15, 81, 15, 15,
15, 15, 15, 15, 19, 19, 19, 19, 19, 19,
20, 23, 23, 23, 23, 23, 23, 24, 26, 26,
20, 21, 30, 21, 23, 23, 23, 23, 23, 23,
24, 20, 25, 25, 25, 28, 28, 30, 20, 29,
29, 29, 29, 29, 29, 34, 20, 42, 55, 73,
24, 38, 38, 38, 38, 38, 40, 40, 40, 40,
40, 72, 69, 71, 42, 70, 42, 55, 67, 68,
43, 61, 30, 69, 60, 59, 58, 34, 34, 34,
34, 41, 41, 41, 41, 41, 43, 67, 57, 56,
53, 52, 51, 50, 49, 48, 47, 41, 46, 44,
37, 35, 33, 43, 67, 43, 67, 32, 31, 27,
22, 21, 18, 17, 41, 16, 41, 76, 76, 77,
5, 77, 77, 78, 78, 79, 79, 81, 81, 3,
24, 20, 34, 24, 25, 25, 25, 42, 20, 26,
26, 28, 28, 28, 70, 74, 20, 29, 29, 29,
29, 29, 29, 24, 42, 70, 42, 30, 38, 38,
38, 38, 38, 43, 34, 34, 34, 34, 40, 40,
40, 40, 40, 41, 41, 41, 41, 41, 56, 43,
68, 73, 72, 71, 69, 62, 61, 60, 59, 41,
58, 57, 54, 53, 52, 51, 43, 56, 43, 68,
50, 49, 48, 47, 46, 44, 41, 37, 41, 35,
33, 32, 31, 27, 22, 18, 68, 17, 68, 77,
77, 78, 16, 78, 78, 79, 79, 80, 80, 82,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75
82, 5, 3, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76
} ;
/* Table of booleans, true if rule could match eol. */
static const flex_int32_t yy_rule_can_match_eol[45] =
static const flex_int32_t yy_rule_can_match_eol[46] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, };
0, 1, 0, 0, 0, 0, };
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
@ -1080,13 +1080,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 76 )
if ( yy_current_state >= 77 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 75 );
while ( yy_current_state != 76 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@ -1194,7 +1194,7 @@ return RTOK;
case 16:
YY_RULE_SETUP
#line 58 "engines/hypno/lexer_arc.l"
return R0TOK;
return R01TOK;
YY_BREAK
case 17:
YY_RULE_SETUP
@ -1204,82 +1204,82 @@ return ITOK;
case 18:
YY_RULE_SETUP
#line 60 "engines/hypno/lexer_arc.l"
return JTOK;
return I1TOK;
YY_BREAK
case 19:
YY_RULE_SETUP
#line 61 "engines/hypno/lexer_arc.l"
return QTOK;
return JTOK;
YY_BREAK
case 20:
YY_RULE_SETUP
#line 62 "engines/hypno/lexer_arc.l"
return ZTOK;
return QTOK;
YY_BREAK
case 21:
YY_RULE_SETUP
#line 63 "engines/hypno/lexer_arc.l"
return WTOK;
return ZTOK;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 64 "engines/hypno/lexer_arc.l"
return XTOK;
return WTOK;
YY_BREAK
case 23:
YY_RULE_SETUP
#line 65 "engines/hypno/lexer_arc.l"
return TTOK;
return XTOK;
YY_BREAK
case 24:
YY_RULE_SETUP
#line 66 "engines/hypno/lexer_arc.l"
return TPTOK;
return TTOK;
YY_BREAK
case 25:
YY_RULE_SETUP
#line 67 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FNTOK;
return TPTOK;
YY_BREAK
case 26:
YY_RULE_SETUP
#line 68 "engines/hypno/lexer_arc.l"
return FTOK;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FNTOK;
YY_BREAK
case 27:
YY_RULE_SETUP
#line 69 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return SNTOK;
return FTOK;
YY_BREAK
case 28:
YY_RULE_SETUP
#line 70 "engines/hypno/lexer_arc.l"
return A0TOK;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return SNTOK;
YY_BREAK
case 29:
YY_RULE_SETUP
#line 71 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return BNTOK;
return A0TOK;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 72 "engines/hypno/lexer_arc.l"
return KNTOK;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return BNTOK;
YY_BREAK
case 31:
YY_RULE_SETUP
#line 73 "engines/hypno/lexer_arc.l"
return P0TOK;
return KNTOK;
YY_BREAK
case 32:
YY_RULE_SETUP
#line 74 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return YXTOK;
return P0TOK;
YY_BREAK
case 33:
YY_RULE_SETUP
#line 75 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return ENCTOK;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return YXTOK;
YY_BREAK
case 34:
YY_RULE_SETUP
@ -1289,17 +1289,17 @@ HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return ENCTOK;
case 35:
YY_RULE_SETUP
#line 77 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.i = atoi(HYPNO_ARC_text); return NUM;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return ENCTOK;
YY_BREAK
case 36:
YY_RULE_SETUP
#line 78 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return NAME;
HYPNO_ARC_lval.i = atoi(HYPNO_ARC_text); return NUM;
YY_BREAK
case 37:
YY_RULE_SETUP
#line 79 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FILENAME;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return NAME;
YY_BREAK
case 38:
YY_RULE_SETUP
@ -1309,35 +1309,40 @@ HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FILENAME;
case 39:
YY_RULE_SETUP
#line 81 "engines/hypno/lexer_arc.l"
return RESTOK;
HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return FILENAME;
YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
#line 82 "engines/hypno/lexer_arc.l"
return RETTOK;
return RESTOK;
YY_BREAK
case 41:
/* rule 41 can match eol */
YY_RULE_SETUP
#line 83 "engines/hypno/lexer_arc.l"
/* ignore comment */
return RETTOK;
YY_BREAK
case 42:
YY_RULE_SETUP
#line 84 "engines/hypno/lexer_arc.l"
/* ignore whitespace */;
/* ignore comment */
YY_BREAK
case 43:
YY_RULE_SETUP
#line 85 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.i = HYPNO_ARC_text[0]; return BYTE;
/* ignore whitespace */;
YY_BREAK
case 44:
YY_RULE_SETUP
#line 86 "engines/hypno/lexer_arc.l"
HYPNO_ARC_lval.i = HYPNO_ARC_text[0]; return BYTE;
YY_BREAK
case 45:
YY_RULE_SETUP
#line 87 "engines/hypno/lexer_arc.l"
ECHO;
YY_BREAK
#line 1340 "engines/hypno/lexer_arc.cpp"
#line 1345 "engines/hypno/lexer_arc.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@ -1635,7 +1640,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 76 )
if ( yy_current_state >= 77 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@ -1663,11 +1668,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 76 )
if ( yy_current_state >= 77 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 75);
yy_is_jam = (yy_current_state == 76);
return yy_is_jam ? 0 : yy_current_state;
}
@ -2314,7 +2319,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 86 "engines/hypno/lexer_arc.l"
#line 87 "engines/hypno/lexer_arc.l"
namespace Hypno {

View File

@ -55,8 +55,9 @@ O[0-1] HYPNO_ARC_lval.s = scumm_strdup(HYPNO_ARC_text); return ONTOK;
N return NTOK;
N\* return NSTOK;
R return RTOK;
R0 return R0TOK;
R[0-1] return R01TOK;
I return ITOK;
I1 return I1TOK;
J return JTOK;
Q return QTOK;
Z return ZTOK;

View File

@ -33,6 +33,24 @@ static const int oIndexYE[9] = {4, 3, 2, 1, 0};
static const int shootOriginIndex[9][2] = {
{41, 3}, {51, 3}, {65, 6}, {68, 9}, {71, 22}, {57, 20}, {37, 14}, {37, 11}, {57, 20}};
void SpiderEngine::initSegment(ArcadeShooting *arc) {
_segmentShootSequenceOffset = 0;
_segmentShootSequenceMax = 0;
uint32 randomSegmentShootSequence = _segmentShootSequenceOffset + _rnd->getRandomNumber(_segmentShootSequenceMax);
SegmentShoots segmentShoots = arc->shootSequence[randomSegmentShootSequence];
_shootSequence = segmentShoots.shootSequence;
_segmentRepetitionMax = segmentShoots.segmentRepetition; // Usually zero
_segmentRepetition = 0;
_segmentOffset = 0;
_segmentIdx = _segmentOffset;
}
void SpiderEngine::findNextSegment(ArcadeShooting *arc) {
_segmentIdx = _segmentIdx + 1;
}
void SpiderEngine::hitPlayer() {
if (_playerFrameSep < (int)_playerFrames.size()) {
if (_playerFrameIdx < _playerFrameSep)

View File

@ -93,17 +93,18 @@ extern int HYPNO_ARC_debug;
NTOK = 286, /* NTOK */
NSTOK = 287, /* NSTOK */
RTOK = 288, /* RTOK */
R0TOK = 289, /* R0TOK */
R01TOK = 289, /* R01TOK */
ITOK = 290, /* ITOK */
JTOK = 291, /* JTOK */
ZTOK = 292, /* ZTOK */
NONETOK = 293, /* NONETOK */
A0TOK = 294, /* A0TOK */
P0TOK = 295, /* P0TOK */
WTOK = 296, /* WTOK */
XTOK = 297, /* XTOK */
CB3TOK = 298, /* CB3TOK */
C02TOK = 299 /* C02TOK */
I1TOK = 291, /* I1TOK */
JTOK = 292, /* JTOK */
ZTOK = 293, /* ZTOK */
NONETOK = 294, /* NONETOK */
A0TOK = 295, /* A0TOK */
P0TOK = 296, /* P0TOK */
WTOK = 297, /* WTOK */
XTOK = 298, /* XTOK */
CB3TOK = 299, /* CB3TOK */
C02TOK = 300 /* C02TOK */
};
typedef enum HYPNO_ARC_tokentype HYPNO_ARC_token_kind_t;
#endif
@ -117,7 +118,7 @@ union HYPNO_ARC_STYPE
char *s; /* string value */
int i; /* integer value */
#line 121 "engines/hypno/tokens_arc.h"
#line 122 "engines/hypno/tokens_arc.h"
};
typedef union HYPNO_ARC_STYPE HYPNO_ARC_STYPE;

View File

@ -27,6 +27,120 @@
namespace Hypno {
void WetEngine::initSegment(ArcadeShooting *arc) {
if (_arcadeMode == "Y1") {
_segmentShootSequenceOffset = 0;
_segmentShootSequenceMax = 3;
} else if (_arcadeMode == "Y5") {
_segmentShootSequenceOffset = 1;
_segmentShootSequenceMax = 9;
} else {
_segmentShootSequenceOffset = 0;
_segmentShootSequenceMax = 0;
}
uint32 randomSegmentShootSequence = _segmentShootSequenceOffset + _rnd->getRandomNumber(_segmentShootSequenceMax);
debugC(1, kHypnoDebugArcade, "Select random sequence %d", randomSegmentShootSequence);
SegmentShoots segmentShoots = arc->shootSequence[randomSegmentShootSequence];
_shootSequence = segmentShoots.shootSequence;
_segmentRepetitionMax = segmentShoots.segmentRepetition; // Usually zero
_segmentRepetition = 0;
_segmentOffset = 0;
_segmentIdx = _segmentOffset;
}
void WetEngine::findNextSegment(ArcadeShooting *arc) {
debugC(1, kHypnoDebugArcade, "Repetition %d of %d", _segmentRepetition, _segmentRepetitionMax);
Common::Point mousePos = g_system->getEventManager()->getMousePos();
Segments segments = arc->segments;
if (_segmentRepetition < _segmentRepetitionMax) {
_segmentRepetition = _segmentRepetition + 1;
} else {
_segmentRepetition = 0;
_segmentRepetitionMax = 0;
if (segments[_segmentIdx].type == 0xb3) {
if (_arcadeMode == "Y1") {
if (_rnd->getRandomBit())
_segmentIdx = _segmentIdx + 1;
else
_segmentIdx = _segmentIdx + 5;
} else if (_arcadeMode == "Y5") {
int r = _rnd->getRandomNumber(4);
if (r == 0)
_segmentIdx = 1;
else
_segmentIdx = r + 4;
if (segments[_segmentIdx].type == 'L') {
_shootSequence = arc->shootSequence[11].shootSequence;
_segmentRepetitionMax = 0;
} else if (segments[_segmentIdx].type == 'R') {
_shootSequence = arc->shootSequence[12].shootSequence;
_segmentRepetitionMax = 0;
} else if (segments[_segmentIdx].type == 'A') {
_shootSequence = arc->shootSequence[15].shootSequence;
_segmentRepetitionMax = 0;
} else if (segments[_segmentIdx].type == 'P') {
r = _rnd->getRandomNumber(1);
_shootSequence = arc->shootSequence[13 + r].shootSequence; //13-14
_segmentRepetitionMax = 0;
}
} else
_segmentIdx = _segmentIdx + 1;
} else if (segments[_segmentIdx].type == 0xc5) {
if (_arcadeMode == "Y1") {
if (mousePos.x <= 100)
_segmentIdx = _segmentIdx + 1;
else if (mousePos.x >= 300)
_segmentIdx = _segmentIdx + 3;
else
_segmentIdx = _segmentIdx + 2;
} else if (_arcadeMode == "Y5") {
if (mousePos.x <= 100)
_segmentIdx = _segmentIdx + 2;
else if (mousePos.x >= 300)
_segmentIdx = _segmentIdx + 3;
else
_segmentIdx = _segmentIdx + 1;
} else
error("Invalid segment type for mode: %s", _arcadeMode.c_str());
} else if (segments[_segmentIdx].type == 0xc2) {
if (mousePos.x <= 160)
_segmentIdx = _segmentIdx + 1;
else
_segmentIdx = _segmentIdx + 2;
} else {
// Objective checking
if (arc->objKillsRequired[_objIdx] > 0) {
if (_objKillsCount[_objIdx] >= arc->objKillsRequired[_objIdx] && _objMissesCount[_objIdx] <= arc->objMissesAllowed[_objIdx]) {
if (_objIdx == 0) {
_objIdx = 1;
if (_arcadeMode == "Y1") {
_segmentOffset = 8;
_segmentRepetition = 0;
_segmentShootSequenceOffset = 8;
}
} else {
_skipLevel = true; // RENAME
return;
}
}
}
_segmentIdx = _segmentOffset;
// select a new shoot sequence
uint32 randomSegmentShootSequence = _segmentShootSequenceOffset + _rnd->getRandomNumber(_segmentShootSequenceMax);
debugC(1, kHypnoDebugArcade, "Selected random sequence %d", randomSegmentShootSequence);
SegmentShoots segmentShoots = arc->shootSequence[randomSegmentShootSequence];
_shootSequence = segmentShoots.shootSequence;
_segmentRepetitionMax = segmentShoots.segmentRepetition; // Usually one
}
}
}
void WetEngine::runBeforeArcade(ArcadeShooting *arc) {
_checkpoint = _currentLevel;
MVideo *video;
@ -88,9 +202,11 @@ bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
}
void WetEngine::hitPlayer() {
assert( _playerFrameSep < (int)_playerFrames.size());
if (_playerFrameIdx < _playerFrameSep)
_playerFrameIdx = _playerFrameSep;
if (_arcadeMode != "Y1" && _arcadeMode != "Y5") {
assert( _playerFrameSep < (int)_playerFrames.size());
if (_playerFrameIdx < _playerFrameSep)
_playerFrameIdx = _playerFrameSep;
}
}
void WetEngine::drawShoot(const Common::Point &mousePos) {
@ -106,27 +222,27 @@ void WetEngine::drawShoot(const Common::Point &mousePos) {
}
void WetEngine::drawPlayer() {
// TARGET ACQUIRED frame
uint32 c = 251; // green
_compositeSurface->drawLine(113, 1, 119, 1, c);
_compositeSurface->drawLine(200, 1, 206, 1, c);
_compositeSurface->drawLine(113, 1, 113, 9, c);
_compositeSurface->drawLine(206, 1, 206, 9, c);
_compositeSurface->drawLine(113, 9, 119, 9, c);
_compositeSurface->drawLine(200, 9, 206, 9, c);
c = 250; // red ?
Common::Point mousePos = g_system->getEventManager()->getMousePos();
int i = detectTarget(mousePos);
if (i > 0)
drawString("block05.fgx", "TARGET ACQUIRED", 116, 3, 80, c);
if (_arcadeMode == "Y1")
return;
if (_playerFrameIdx < _playerFrameSep) {
// TARGET ACQUIRED frame
uint32 c = 251; // green
_compositeSurface->drawLine(113, 1, 119, 1, c);
_compositeSurface->drawLine(200, 1, 206, 1, c);
_compositeSurface->drawLine(113, 1, 113, 9, c);
_compositeSurface->drawLine(206, 1, 206, 9, c);
_compositeSurface->drawLine(113, 9, 119, 9, c);
_compositeSurface->drawLine(200, 9, 206, 9, c);
c = 250; // red ?
Common::Point mousePos = g_system->getEventManager()->getMousePos();
int i = detectTarget(mousePos);
if (i > 0)
drawString("block05.fgx", "TARGET ACQUIRED", 120, 1, 80, c);
_playerFrameIdx++;
_playerFrameIdx = _playerFrameIdx % _playerFrameSep;
} else {
@ -135,23 +251,26 @@ void WetEngine::drawPlayer() {
_playerFrameIdx = 0;
}
if (_arcadeMode == "Y5")
_playerFrameIdx = 1;
drawImage(*_playerFrames[_playerFrameIdx], 0, 200 - _playerFrames[_playerFrameIdx]->h + 1, true);
}
void WetEngine::drawHealth() {
if (_arcadeMode == "Y1")
return;
uint32 c = 253;
int p = (100 * _health) / _maxHealth;
int s = _score;
int mo = _objKillsCount[_objIdx];
if (_playerFrameIdx < _playerFrameSep) {
const chapterEntry *entry = _chapterTable[_levelId];
//uint32 id = _levelId;
drawString("block05.fgx", Common::String::format("ENERGY %d%%", p), entry->energyPos[0], entry->energyPos[1], 65, c);
drawString("block05.fgx", Common::String::format("SCORE %04d", s), entry->scorePos[0], entry->scorePos[1], 72, c);
drawString("block05.fgx", Common::String::format("ENERGY %d%%", p), entry->energyPos[0], entry->energyPos[1], 65, c);
drawString("block05.fgx", Common::String::format("SCORE %04d", s), entry->scorePos[0], entry->scorePos[1], 72, c);
// Objectives are always in the zero in the demo
//drawString("block05.fgx", Common::String::format("M.O. 0/0"), uiPos[id][2][0], uiPos[id][2][1], 60, c);
if (entry->objectivesPos[0] > 0 && entry->objectivesPos[1] > 0)
drawString("block05.fgx", Common::String::format("M.O. %d/X", mo), entry->objectivesPos[0], entry->objectivesPos[1], 60, c);
}
}

View File

@ -28,20 +28,22 @@
namespace Hypno {
static const chapterEntry rawChapterTable[] = {
{11, {44, 172}, {218, 172}, {0, 0}}, // c11
{20, {44, 172}, {218, 172}, {0, 0}}, // c20
{11, {44, 172}, {218, 172}, {0, 0}}, // c11
{10, {19, 3}, {246, 3}, {246, 11}}, // c10
{20, {44, 172}, {218, 172}, {0, 0}}, // c20
{21, {70, 160}, {180, 160}, {220, 185}}, // c21
{22, {70, 160}, {180, 160}, {220, 185}}, // c22
{23, {70, 160}, {180, 160}, {220, 185}}, // c23
{31, {70, 160}, {180, 160}, {220, 185}}, // c31
{32, {70, 160}, {180, 160}, {220, 185}}, // c32
{33, {70, 160}, {180, 160}, {220, 185}}, // c33
{41, {70, 160}, {180, 160}, {220, 185}}, // c41
{42, {70, 160}, {180, 160}, {220, 185}}, // c42
{43, {70, 160}, {180, 160}, {220, 185}}, // c43
{44, {70, 160}, {180, 160}, {220, 185}}, // c44
{51, {60, 167}, {190, 167}, {135, 187}}, // c51
{52, {60, 167}, {190, 167}, {135, 187}}, // c52
{50, {60, 167}, {190, 167}, {135, 187}}, // c50
{50, {19, 3}, {246, 3}, {246, 11}}, // c50 (fixed)
{61, {44, 172}, {218, 172}, {0, 0}}, // c61
{60, {44, 172}, {218, 172}, {0, 0}}, // c60
{0, {0, 0}, {0, 0}, {0, 0}} // NULL
@ -256,7 +258,6 @@ void WetEngine::loadAssetsFullGame() {
loadArcadeLevel("c111.mi_", "c10", "<check_lives>", "");
loadArcadeLevel("c112.mi_", "c10", "<check_lives>", "");
loadArcadeLevel("c100.mi_", "c21", "<check_lives>", "");
loadArcadeLevel("c101.mi_", "c21", "<check_lives>", "");
loadArcadeLevel("c102.mi_", "c21", "<check_lives>", "");
@ -285,11 +286,11 @@ void WetEngine::loadAssetsFullGame() {
loadArcadeLevel("c321.mi_", "c41", "<check_lives>", "");
loadArcadeLevel("c322.mi_", "c41", "<check_lives>", "");
//loadArcadeLevel("c330.mi_", "???", "");
//loadArcadeLevel("c330.mi_", "???", "", "");
//loadArcadeLevel("c331.mi_", "???", "");
//loadArcadeLevel("c332.mi_", "???", "");
//loadArcadeLevel("c300.mi_", "???", "");
//loadArcadeLevel("c300.mi_", "???", "", "");
//loadArcadeLevel("c301.mi_", "???", "");
//loadArcadeLevel("c302.mi_", "???", "");
@ -321,7 +322,10 @@ void WetEngine::loadAssetsFullGame() {
loadArcadeLevel("c521.mi_", "c61", "<check_lives>", "");
loadArcadeLevel("c522.mi_", "c61", "<check_lives>", "");
//loadArcadeLevel("c500.mi_", "???", "");
loadArcadeLevel("c500.mi_", "c61", "<check_lives>", "");
ArcadeShooting *arc = (ArcadeShooting*) _levels["c500.mi_"];
arc->id = 50; // Fixed from the original (5)
//loadArcadeLevel("c501.mi_", "???", "");
//loadArcadeLevel("c502.mi_", "???", "");