2012-05-01 13:44:02 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 01:34:26 +00:00
|
|
|
*
|
2012-05-01 13:44:02 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 01:34:26 +00:00
|
|
|
*
|
2012-05-01 13:44:02 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
2012-05-14 05:43:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on original Tony Tough source code
|
|
|
|
*
|
|
|
|
* Copyright (c) 1997-2003 Nayma Software
|
|
|
|
*/
|
2012-05-01 13:44:02 +00:00
|
|
|
|
|
|
|
#include "tony/mpal/memory.h"
|
|
|
|
#include "tony/mpal/mpalutils.h"
|
|
|
|
#include "tony/game.h"
|
|
|
|
#include "tony/tonychar.h"
|
|
|
|
#include "tony/tony.h"
|
|
|
|
|
|
|
|
namespace Tony {
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
bool RMTony::_bAction = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-05 06:39:55 +00:00
|
|
|
void RMTony::initStatics() {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bAction = false;
|
2012-05-13 13:05:41 +00:00
|
|
|
}
|
|
|
|
|
2012-05-12 00:34:52 +00:00
|
|
|
RMTony::RMTony() {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bShow = false;
|
2012-06-13 06:00:37 +00:00
|
|
|
_bShowShadow = false;
|
|
|
|
_bBodyFront = false;
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
_actionItem = NULL;
|
|
|
|
_action = 0;
|
|
|
|
_actionParm = 0;
|
2012-06-13 06:00:37 +00:00
|
|
|
_bShepherdess = false;
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsStaticTalk = false;
|
|
|
|
_bIsTalking = false;
|
|
|
|
_nPatB4Talking = 0;
|
|
|
|
_nTalkType = TALK_NORMAL;
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = UP;
|
2012-06-07 05:58:01 +00:00
|
|
|
_nTimeLastStep = 0;
|
2012-06-11 19:43:04 +00:00
|
|
|
_hActionThread = CORO_INVALID_PID_VALUE;
|
2012-05-12 00:34:52 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::waitEndOfAction(CORO_PARAM, const void *param) {
|
2012-05-06 05:18:03 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
uint32 pid = *(const uint32 *)param;
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
2012-05-11 13:15:59 +00:00
|
|
|
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, pid, CORO_INFINITE);
|
2012-05-06 05:18:03 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bAction = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-06 05:18:03 +00:00
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
RMGfxSourceBuffer *RMTony::newItemSpriteBuffer(int dimx, int dimy, bool bPreRLE) {
|
2012-05-01 13:44:02 +00:00
|
|
|
RMGfxSourceBuffer8RLE *spr;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
assert(_cm == CM_256);
|
2012-05-01 13:44:02 +00:00
|
|
|
spr = new RMGfxSourceBuffer8RLEByteAA;
|
2012-06-05 06:39:55 +00:00
|
|
|
spr->setAlphaBlendColor(1);
|
2012-05-01 13:44:02 +00:00
|
|
|
if (bPreRLE)
|
2012-06-05 06:39:55 +00:00
|
|
|
spr->setAlreadyCompressed();
|
2012-05-01 13:44:02 +00:00
|
|
|
return spr;
|
|
|
|
}
|
|
|
|
|
2012-06-18 06:24:33 +00:00
|
|
|
void RMTony::init() {
|
2012-05-01 13:44:02 +00:00
|
|
|
RMRes tony(0);
|
|
|
|
RMRes body(9999);
|
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Tony is shown by default
|
2012-06-13 06:00:37 +00:00
|
|
|
_bShow = _bShowShadow = true;
|
2012-05-04 23:31:21 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// No action pending
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
|
|
|
_bAction = false;
|
2012-05-04 23:31:21 +00:00
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
_bShepherdess = false;
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsTalking = false;
|
|
|
|
_bIsStaticTalk = false;
|
2012-05-04 23:31:21 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Opens the buffer
|
2012-08-28 12:26:00 +00:00
|
|
|
Common::SeekableReadStream *ds = tony.getReadStream();
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Reads his details from the stream
|
2012-08-28 12:26:00 +00:00
|
|
|
readFromStream(*ds, true);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Closes the buffer
|
2012-08-28 12:26:00 +00:00
|
|
|
delete ds;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Reads Tony's body
|
2012-08-28 12:26:00 +00:00
|
|
|
ds = body.getReadStream();
|
|
|
|
_body.readFromStream(*ds, true);
|
|
|
|
delete ds;
|
2012-06-07 05:58:01 +00:00
|
|
|
_body.setPattern(0);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-08-22 12:00:46 +00:00
|
|
|
_nTimeLastStep = g_vm->getTime();
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-18 06:24:33 +00:00
|
|
|
void RMTony::close() {
|
2012-06-17 17:39:58 +00:00
|
|
|
// Deallocation of missing item
|
2012-11-12 00:39:20 +00:00
|
|
|
//_shadow.destroy();
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::doFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) {
|
2012-05-10 14:09:34 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
int time;
|
2012-05-10 14:09:34 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (!_nInList && _bShow)
|
2012-06-05 06:39:55 +00:00
|
|
|
bigBuf->addPrim(new RMGfxPrimitive(this));
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-08 22:52:38 +00:00
|
|
|
setSpeed(GLOBALS._nCfgTonySpeed);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Runs the normal character movement
|
2012-08-22 12:00:46 +00:00
|
|
|
_ctx->time = g_vm->getTime();
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-03 13:08:19 +00:00
|
|
|
do {
|
2012-06-07 05:58:01 +00:00
|
|
|
_nTimeLastStep += (1000 / 40);
|
|
|
|
CORO_INVOKE_2(RMCharacter::doFrame, bigBuf, curLoc);
|
|
|
|
} while (_ctx->time > _nTimeLastStep + (1000 / 40));
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Check if we are at the end of a path
|
2012-06-07 05:58:01 +00:00
|
|
|
if (endOfPath() && _bActionPending) {
|
2012-05-20 03:54:59 +00:00
|
|
|
// Must perform the action on which we clicked
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (_bIsTalking || _bIsStaticTalk)
|
|
|
|
_body.doFrame(bigBuf, false);
|
2012-05-10 14:09:34 +00:00
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-18 06:24:33 +00:00
|
|
|
void RMTony::show() {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bShow = true;
|
2012-06-13 06:00:37 +00:00
|
|
|
_bShowShadow = true;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
void RMTony::hide(bool bShowShadow) {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bShow = false;
|
2012-06-13 06:00:37 +00:00
|
|
|
_bShowShadow = bShowShadow;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-05 06:39:55 +00:00
|
|
|
void RMTony::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
2012-05-12 10:49:36 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
2012-05-20 06:03:09 +00:00
|
|
|
// Call the Draw() of the parent class if Tony is visible
|
2012-06-10 21:56:37 +00:00
|
|
|
if (_bShow && _bDrawNow) {
|
2012-06-13 06:00:37 +00:00
|
|
|
if (_bBodyFront) {
|
2012-06-07 19:14:59 +00:00
|
|
|
prim->getDst().setEmpty();
|
|
|
|
prim->getDst().offset(-44, -134);
|
2012-06-13 06:00:37 +00:00
|
|
|
if (_bShepherdess)
|
2012-06-07 19:14:59 +00:00
|
|
|
prim->getDst().offset(1, 4);
|
2012-06-05 06:39:55 +00:00
|
|
|
CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (_bIsTalking || _bIsStaticTalk) {
|
2012-05-20 06:03:09 +00:00
|
|
|
// Offest direction from scrolling
|
2012-06-07 19:14:59 +00:00
|
|
|
prim->getDst().setEmpty();
|
|
|
|
prim->getDst().offset(-_curScroll);
|
|
|
|
prim->getDst().offset(_pos);
|
|
|
|
prim->getDst().offset(-44, -134);
|
|
|
|
prim->getDst() += _nBodyOffset;
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_2(_body.draw, bigBuf, prim);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
if (!_bBodyFront) {
|
2012-06-07 19:14:59 +00:00
|
|
|
prim->getDst().setEmpty();
|
|
|
|
prim->getDst().offset(-44, -134);
|
2012-06-13 06:00:37 +00:00
|
|
|
if (_bShepherdess)
|
2012-06-07 19:14:59 +00:00
|
|
|
prim->getDst().offset(0, 3);
|
2012-06-05 06:39:55 +00:00
|
|
|
CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
}
|
2012-05-12 10:49:36 +00:00
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::moveAndDoAction(CORO_PARAM, RMPoint dst, RMItem *item, int nAction, int nActionParm) {
|
2012-05-10 14:09:34 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
bool result;
|
2012-05-10 14:09:34 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
2012-05-20 06:03:09 +00:00
|
|
|
// Makes normal movement, but remember if you must then perform an action
|
2012-05-01 13:44:02 +00:00
|
|
|
if (item == NULL) {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
_actionItem = NULL;
|
2012-05-01 13:44:02 +00:00
|
|
|
} else {
|
2012-06-11 19:43:04 +00:00
|
|
|
_actionItem = item;
|
|
|
|
_action = nAction;
|
|
|
|
_actionParm = nActionParm;
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = true;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_2(RMCharacter::move, dst, &_ctx->result);
|
2012-05-10 14:09:34 +00:00
|
|
|
if (!_ctx->result) {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
_actionItem = NULL;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
2012-05-10 14:09:34 +00:00
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::executeAction(int nAction, int nActionItem, int nParm) {
|
2012-05-06 05:18:03 +00:00
|
|
|
uint32 pid;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
if (nAction == TA_COMBINE) {
|
2012-05-09 13:15:41 +00:00
|
|
|
pid = mpalQueryDoAction(TA_COMBINE, nParm, nActionItem);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// If you failed the combine, we have RECEIVECOMBINE as a fallback
|
2012-05-11 13:15:59 +00:00
|
|
|
if (pid == CORO_INVALID_PID_VALUE) {
|
2012-05-21 21:53:13 +00:00
|
|
|
pid = mpalQueryDoAction(TA_RECEIVECOMBINE, nActionItem, nParm);
|
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// If you failed with that, go with the generic
|
2012-05-01 13:44:02 +00:00
|
|
|
// @@@ CombineGive!
|
2012-05-11 13:15:59 +00:00
|
|
|
if (pid == CORO_INVALID_PID_VALUE) {
|
2012-05-09 13:15:41 +00:00
|
|
|
pid = mpalQueryDoAction(TA_COMBINE, nParm, 0);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
|
|
|
if (pid == CORO_INVALID_PID_VALUE) {
|
2012-05-09 13:15:41 +00:00
|
|
|
pid = mpalQueryDoAction(TA_RECEIVECOMBINE, nActionItem, 0);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2012-05-06 02:21:29 +00:00
|
|
|
// Perform the action
|
2012-05-21 21:53:13 +00:00
|
|
|
pid = mpalQueryDoAction(nAction, nActionItem, 0);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-11 13:15:59 +00:00
|
|
|
if (pid != CORO_INVALID_PID_VALUE) {
|
2012-06-07 05:58:01 +00:00
|
|
|
_bAction = true;
|
|
|
|
CoroScheduler.createProcess(waitEndOfAction, &pid, sizeof(uint32));
|
2012-06-11 19:43:04 +00:00
|
|
|
_hActionThread = pid;
|
2012-05-01 13:44:02 +00:00
|
|
|
} else if (nAction != TA_GOTO) {
|
|
|
|
if (nAction == TA_TALK) {
|
2012-05-21 21:53:13 +00:00
|
|
|
pid = mpalQueryDoAction(6, 1, 0);
|
2012-06-07 05:58:01 +00:00
|
|
|
_bAction = true;
|
|
|
|
CoroScheduler.createProcess(waitEndOfAction, &pid, sizeof(uint32));
|
2012-06-11 19:43:04 +00:00
|
|
|
_hActionThread = pid;
|
2012-06-11 22:07:50 +00:00
|
|
|
} else if (nAction == TA_PERORATE) {
|
2012-05-09 13:15:41 +00:00
|
|
|
pid = mpalQueryDoAction(7, 1, 0);
|
2012-06-07 05:58:01 +00:00
|
|
|
_bAction = true;
|
|
|
|
CoroScheduler.createProcess(waitEndOfAction, &pid, sizeof(uint32));
|
2012-06-11 19:43:04 +00:00
|
|
|
_hActionThread = pid;
|
2012-05-01 13:44:02 +00:00
|
|
|
} else {
|
2012-05-21 21:53:13 +00:00
|
|
|
pid = mpalQueryDoAction(5, 1, 0);
|
2012-06-07 05:58:01 +00:00
|
|
|
_bAction = true;
|
|
|
|
CoroScheduler.createProcess(waitEndOfAction, &pid, sizeof(uint32));
|
2012-06-11 19:43:04 +00:00
|
|
|
_hActionThread = pid;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::stopNoAction(CORO_PARAM) {
|
2012-05-08 14:42:27 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (_bAction)
|
2012-06-11 19:43:04 +00:00
|
|
|
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _hActionThread, CORO_INFINITE);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
_actionItem = NULL;
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(stop);
|
2012-05-08 14:42:27 +00:00
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::stop(CORO_PARAM) {
|
2012-05-08 14:42:27 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
uint32 pid;
|
2012-05-08 14:42:27 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-11 19:43:04 +00:00
|
|
|
if (_actionItem != NULL) {
|
2012-05-20 03:54:59 +00:00
|
|
|
// Call MPAL to choose the direction
|
2012-06-11 19:43:04 +00:00
|
|
|
_ctx->pid = mpalQueryDoAction(21, _actionItem->mpalCode(), 0);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-11 13:15:59 +00:00
|
|
|
if (_ctx->pid == CORO_INVALID_PID_VALUE)
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(RMCharacter::stop);
|
2012-05-01 13:44:02 +00:00
|
|
|
else {
|
2012-06-10 21:56:37 +00:00
|
|
|
_bNeedToStop = false; // If we make the OnWhichDirection, we don't need at least after the Stop().
|
|
|
|
_bMoving = false;
|
2012-05-20 03:54:59 +00:00
|
|
|
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->pid, CORO_INFINITE); // @@@ Put an assert after 10 seconds
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
} else {
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(RMCharacter::stop);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (!_bActionPending)
|
2012-05-01 13:44:02 +00:00
|
|
|
return;
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bActionPending = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-11 19:43:04 +00:00
|
|
|
executeAction(_action, _actionItem->mpalCode(), _actionParm);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-11 19:43:04 +00:00
|
|
|
_actionItem = NULL;
|
2012-05-08 14:42:27 +00:00
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-18 06:24:33 +00:00
|
|
|
int RMTony::getCurPattern() {
|
2012-06-07 05:58:01 +00:00
|
|
|
int nPatt = RMCharacter::getCurPattern();
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
if (!_bShepherdess)
|
2012-05-01 13:44:02 +00:00
|
|
|
return nPatt;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
switch (nPatt) {
|
|
|
|
case PAT_PAST_STANDUP:
|
|
|
|
return PAT_STANDUP;
|
|
|
|
case PAT_PAST_STANDDOWN:
|
|
|
|
return PAT_STANDDOWN;
|
|
|
|
case PAT_PAST_STANDLEFT:
|
|
|
|
return PAT_STANDLEFT;
|
|
|
|
case PAT_PAST_STANDRIGHT:
|
|
|
|
return PAT_STANDRIGHT;
|
|
|
|
case PAT_PAST_WALKUP:
|
|
|
|
return PAT_WALKUP;
|
|
|
|
case PAT_PAST_WALKDOWN:
|
|
|
|
return PAT_WALKDOWN;
|
|
|
|
case PAT_PAST_WALKLEFT:
|
|
|
|
return PAT_WALKLEFT;
|
|
|
|
case PAT_PAST_WALKRIGHT:
|
|
|
|
return PAT_WALKRIGHT;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nPatt;
|
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::setPattern(int nPatt, bool bPlayP0) {
|
2012-06-13 06:00:37 +00:00
|
|
|
if (_bShepherdess) {
|
2012-05-01 13:44:02 +00:00
|
|
|
switch (nPatt) {
|
|
|
|
case PAT_STANDUP:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_STANDUP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_STANDDOWN:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_STANDDOWN;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_STANDLEFT:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_STANDLEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_STANDRIGHT:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_STANDRIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_WALKUP:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_WALKUP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_WALKDOWN:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_WALKDOWN;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_WALKLEFT:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_WALKLEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case PAT_WALKRIGHT:
|
2012-05-21 21:53:13 +00:00
|
|
|
nPatt = PAT_PAST_WALKRIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
RMCharacter::setPattern(nPatt, bPlayP0);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::take(int nWhere, int nPart) {
|
2012-05-01 13:44:02 +00:00
|
|
|
if (nPart == 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
switch (getCurPattern()) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDDOWN:
|
2012-05-21 21:53:13 +00:00
|
|
|
assert(0); // Not while you're doing a StandDown
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_STANDUP:
|
|
|
|
switch (nWhere) {
|
|
|
|
case 0:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKEUP_UP1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKEUP_MID1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKEUP_DOWN1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_STANDRIGHT:
|
|
|
|
switch (nWhere) {
|
|
|
|
case 0:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKERIGHT_UP1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKERIGHT_MID1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKERIGHT_DOWN1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_STANDLEFT:
|
|
|
|
switch (nWhere) {
|
|
|
|
case 0:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKELEFT_UP1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKELEFT_MID1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_TAKELEFT_DOWN1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (nPart == 1) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(getCurPattern() + 1);
|
2012-05-01 13:44:02 +00:00
|
|
|
} else if (nPart == 2) {
|
2012-06-07 05:58:01 +00:00
|
|
|
switch (getCurPattern()) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_TAKEUP_UP2:
|
|
|
|
case PAT_TAKEUP_MID2:
|
|
|
|
case PAT_TAKEUP_DOWN2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_STANDUP);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_TAKELEFT_UP2:
|
|
|
|
case PAT_TAKELEFT_MID2:
|
|
|
|
case PAT_TAKELEFT_DOWN2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_STANDLEFT);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_TAKERIGHT_UP2:
|
|
|
|
case PAT_TAKERIGHT_MID2:
|
|
|
|
case PAT_TAKERIGHT_DOWN2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_STANDRIGHT);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::put(int nWhere, int nPart) {
|
2012-05-01 13:44:02 +00:00
|
|
|
if (nPart == 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
switch (getCurPattern()) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDDOWN:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_STANDUP:
|
|
|
|
switch (nWhere) {
|
|
|
|
case 0:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTUP_UP1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTUP_MID1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTUP_DOWN1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_STANDRIGHT:
|
|
|
|
switch (nWhere) {
|
|
|
|
case 0:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTRIGHT_UP1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTRIGHT_MID1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTRIGHT_DOWN1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_STANDLEFT:
|
|
|
|
switch (nWhere) {
|
|
|
|
case 0:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTLEFT_UP1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTLEFT_MID1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PUTLEFT_DOWN1);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (nPart == 1) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(getCurPattern() + 1);
|
2012-05-01 13:44:02 +00:00
|
|
|
} else if (nPart == 2) {
|
2012-06-07 05:58:01 +00:00
|
|
|
switch (getCurPattern()) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_PUTUP_UP2:
|
|
|
|
case PAT_PUTUP_MID2:
|
|
|
|
case PAT_PUTUP_DOWN2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_STANDUP);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_PUTLEFT_UP2:
|
|
|
|
case PAT_PUTLEFT_MID2:
|
|
|
|
case PAT_PUTLEFT_DOWN2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_STANDLEFT);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_PUTRIGHT_UP2:
|
|
|
|
case PAT_PUTRIGHT_MID2:
|
|
|
|
case PAT_PUTRIGHT_DOWN2:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_STANDRIGHT);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-16 09:09:08 +00:00
|
|
|
bool RMTony::startTalkCalculate(CharacterTalkType nTalkType, int &headStartPat, int &bodyStartPat,
|
2012-05-21 21:53:13 +00:00
|
|
|
int &headLoopPat, int &bodyLoopPat) {
|
2012-06-07 05:58:01 +00:00
|
|
|
assert(!_bIsTalking);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsTalking = true;
|
|
|
|
_nPatB4Talking = getCurPattern();
|
|
|
|
_nTalkType = nTalkType;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Set the direction of speech ONLY if we are not in a static animation (since it would have already been done)
|
2012-06-07 05:58:01 +00:00
|
|
|
if (!_bIsStaticTalk) {
|
|
|
|
switch (_nPatB4Talking) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDDOWN:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = DOWN;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_TAKELEFT_UP2:
|
|
|
|
case PAT_TAKELEFT_MID2:
|
|
|
|
case PAT_TAKELEFT_DOWN2:
|
2012-06-13 06:00:37 +00:00
|
|
|
case PAT_GETUPLEFT:
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDLEFT:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = LEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_TAKERIGHT_UP2:
|
|
|
|
case PAT_TAKERIGHT_MID2:
|
|
|
|
case PAT_TAKERIGHT_DOWN2:
|
2012-06-13 06:00:37 +00:00
|
|
|
case PAT_GETUPRIGHT:
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDRIGHT:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = RIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_TAKEUP_UP2:
|
|
|
|
case PAT_TAKEUP_MID2:
|
|
|
|
case PAT_TAKEUP_DOWN2:
|
|
|
|
case PAT_STANDUP:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = UP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Puts the body in front by default
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = true;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
if (_bShepherdess) {
|
2012-05-20 03:54:59 +00:00
|
|
|
// Talking whilst a shepherdess
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PAST_TALKUP);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PAST_TALKDOWN);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PAST_TALKLEFT);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(PAT_PAST_TALKRIGHT);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-05-07 22:25:33 +00:00
|
|
|
return false;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
headStartPat = bodyStartPat = 0;
|
|
|
|
bodyLoopPat = 0;
|
|
|
|
|
|
|
|
switch (nTalkType) {
|
2012-05-21 21:53:13 +00:00
|
|
|
case TALK_NORMAL:
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
headStartPat = 0;
|
|
|
|
bodyStartPat = 0;
|
|
|
|
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case DOWN:
|
|
|
|
headLoopPat = PAT_TALK_DOWN;
|
|
|
|
bodyLoopPat = BPAT_STANDDOWN;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(4, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_STANDLEFT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
|
|
|
bodyLoopPat = BPAT_STANDRIGHT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case UP:
|
|
|
|
headLoopPat = PAT_TALK_UP;
|
|
|
|
bodyLoopPat = BPAT_STANDUP;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_HIPS:
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(2, 42);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_UP;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyStartPat = BPAT_HIPSUP_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_UP;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyLoopPat = BPAT_HIPSUP_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(2, 48);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_DOWN;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyStartPat = BPAT_HIPSDOWN_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_DOWN;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyLoopPat = BPAT_HIPSDOWN_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-3, 53);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_LEFT;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyStartPat = BPAT_HIPSLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyLoopPat = BPAT_HIPSLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(2, 53);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_RIGHT;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyStartPat = BPAT_HIPSRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyLoopPat = BPAT_HIPSRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
case TALK_SING:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-10, 25);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_LEFT;
|
|
|
|
bodyStartPat = BPAT_SINGLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-13 06:00:37 +00:00
|
|
|
bodyLoopPat = BPAT_SINGLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_LAUGH:
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case DOWN:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-20 22:20:16 +00:00
|
|
|
headStartPat = PAT_LAUGHLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
2012-06-20 22:20:16 +00:00
|
|
|
headLoopPat = PAT_LAUGHLEFT_LOOP;
|
|
|
|
bodyLoopPat = BPAT_LAUGHLEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-20 22:20:16 +00:00
|
|
|
headStartPat = PAT_LAUGHRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
2012-06-20 22:20:16 +00:00
|
|
|
headLoopPat = PAT_LAUGHRIGHT_LOOP;
|
|
|
|
bodyLoopPat = BPAT_LAUGHRIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_LAUGH2:
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case DOWN:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-20 22:20:16 +00:00
|
|
|
headStartPat = PAT_LAUGHLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
2012-06-20 22:20:16 +00:00
|
|
|
headLoopPat = PAT_LAUGHLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-20 22:20:16 +00:00
|
|
|
headStartPat = PAT_LAUGHRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
2012-06-20 22:20:16 +00:00
|
|
|
headLoopPat = PAT_LAUGHRIGHT_LOOP;
|
|
|
|
bodyLoopPat = BPAT_LAUGHRIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
case TALK_INDICATE:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case DOWN:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, 40);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-13 06:00:37 +00:00
|
|
|
bodyLoopPat = BPAT_INDICATELEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(5, 40);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-13 06:00:37 +00:00
|
|
|
bodyLoopPat = BPAT_INDICATERIGHT;
|
2012-05-21 21:53:13 +00:00
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCARED:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, -11);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_UP;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_SCAREDUP_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_UP;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_SCAREDUP_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-5, 45);
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDDOWN_START;
|
|
|
|
bodyStartPat = BPAT_SCAREDDOWN_START;
|
|
|
|
headLoopPat = PAT_SCAREDDOWN_LOOP;
|
|
|
|
bodyLoopPat = BPAT_SCAREDDOWN_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, 41);
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDRIGHT_START;
|
|
|
|
bodyStartPat = BPAT_SCAREDRIGHT_START;
|
|
|
|
headLoopPat = PAT_SCAREDRIGHT_LOOP;
|
|
|
|
bodyLoopPat = BPAT_SCAREDRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-10, 41);
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDLEFT_START;
|
|
|
|
bodyStartPat = BPAT_SCAREDLEFT_START;
|
|
|
|
headLoopPat = PAT_SCAREDLEFT_LOOP;
|
|
|
|
bodyLoopPat = BPAT_SCAREDLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCARED2:
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
bodyStartPat = BPAT_STANDUP;
|
|
|
|
bodyLoopPat = BPAT_STANDUP;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_HEAD_UP;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_UP;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
bodyStartPat = BPAT_STANDDOWN;
|
|
|
|
bodyLoopPat = BPAT_STANDDOWN;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(4, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDDOWN_START;
|
|
|
|
headLoopPat = PAT_SCAREDDOWN_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
|
|
|
bodyLoopPat = BPAT_STANDRIGHT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDRIGHT_START;
|
|
|
|
headLoopPat = PAT_SCAREDRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
|
|
|
bodyLoopPat = BPAT_STANDLEFT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDLEFT_START;
|
|
|
|
headLoopPat = PAT_SCAREDLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHGLASSES:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(4, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_DOWN;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_GLASS;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHWORM:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(9, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WORM;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHHAMMER:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_HAMMER;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHROPE:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-3, 38);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_ROPE;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSECRETARY:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-17, 12);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHSECRETARY;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRABBIT:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-21, -5);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRABBITLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHRABBITLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, -5);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRABBITRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHRABBITRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRECIPE:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-61, -7);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRECIPELEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHRECIPELEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-5, -7);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRECIPERIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHRECIPERIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHCARDS:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-34, -2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHCARDSLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHCARDSLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, -2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHCARDSRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHCARDSRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSNOWMAN:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-35, 2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHSNOWMANLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHSNOWMANLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-14, 2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHSNOWMANRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyLoopPat = BPAT_WITHSNOWMANRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSNOWMANSTATIC:
|
|
|
|
case TALK_WITHRECIPESTATIC:
|
|
|
|
case TALK_WITHRABBITSTATIC:
|
|
|
|
case TALK_WITHCARDSSTATIC:
|
2012-06-10 14:24:52 +00:00
|
|
|
case TALK_WITH_NOTEBOOK:
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHMEGAPHONESTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
|
|
|
headLoopPat = PAT_TALK_RIGHT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-05-21 21:53:13 +00:00
|
|
|
// The beard is the only case in which the head is animated separately while the body is the standard
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHBEARDSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_TALKBEARD_LEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDLEFT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_TALKBEARD_RIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDRIGHT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
case TALK_DISGUSTED:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_DISGUSTEDLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
2012-06-13 06:00:37 +00:00
|
|
|
headLoopPat = PAT_DISGUSTEDLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-13 06:00:37 +00:00
|
|
|
headStartPat = PAT_DISGUSTEDRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
2012-06-13 06:00:37 +00:00
|
|
|
headLoopPat = PAT_DISGUSTEDRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_SARCASTIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
|
|
|
case UP:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-20 22:20:16 +00:00
|
|
|
headStartPat = PAT_SARCASTICLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
2012-06-20 22:20:16 +00:00
|
|
|
headLoopPat = PAT_SARCASTICLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-06-20 22:20:16 +00:00
|
|
|
headStartPat = PAT_SARCASTICRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
2012-06-20 22:20:16 +00:00
|
|
|
headLoopPat = PAT_SARCASTICRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TALK_MACBETH1:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH1;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH2:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH2;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH3:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH3;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH4:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH4;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH5:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH5;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH6:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH6;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH7:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH7;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH8:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH8;
|
|
|
|
break;
|
|
|
|
case TALK_MACBETH9:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-33, -1);
|
2012-05-01 13:44:02 +00:00
|
|
|
headLoopPat = PAT_TALK_LEFT;
|
|
|
|
bodyLoopPat = BPAT_MACBETH9;
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCAREDSTATIC:
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = false;
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case DOWN:
|
|
|
|
bodyStartPat = BPAT_STANDDOWN;
|
|
|
|
bodyLoopPat = BPAT_STANDDOWN;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(4, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDDOWN_STAND;
|
|
|
|
headLoopPat = PAT_SCAREDDOWN_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
|
|
|
bodyLoopPat = BPAT_STANDRIGHT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDRIGHT_STAND;
|
|
|
|
headLoopPat = PAT_SCAREDRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
|
|
|
bodyLoopPat = BPAT_STANDLEFT;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
headStartPat = PAT_SCAREDLEFT_STAND;
|
|
|
|
headLoopPat = PAT_SCAREDLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-05-04 12:58:42 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
break;
|
2012-05-07 23:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2012-05-07 22:25:33 +00:00
|
|
|
}
|
|
|
|
|
2012-06-16 09:09:08 +00:00
|
|
|
void RMTony::startTalk(CORO_PARAM, CharacterTalkType nTalkType) {
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
int headStartPat, bodyStartPat;
|
|
|
|
int headLoopPat, bodyLoopPat;
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
|
|
_ctx->headStartPat = _ctx->bodyStartPat = 0;
|
|
|
|
_ctx->headLoopPat = _ctx->bodyLoopPat = 0;
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (!startTalkCalculate(nTalkType, _ctx->headStartPat, _ctx->bodyStartPat,
|
2012-05-21 21:53:13 +00:00
|
|
|
_ctx->headLoopPat, _ctx->bodyLoopPat))
|
2012-05-07 22:25:33 +00:00
|
|
|
return;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Perform the set pattern
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->headStartPat != 0 || _ctx->bodyStartPat != 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headStartPat);
|
|
|
|
_body.setPattern(_ctx->bodyStartPat);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->bodyStartPat != 0)
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->headStartPat != 0)
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headLoopPat);
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->bodyLoopPat)
|
2012-06-07 05:58:01 +00:00
|
|
|
_body.setPattern(_ctx->bodyLoopPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CODE;
|
|
|
|
}
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
bool RMTony::endTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPat, int &finalPat, bool &bStatic) {
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
headEndPat = 0;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
finalPat = PAT_STANDUP;
|
2012-06-13 06:00:37 +00:00
|
|
|
headStandPat = PAT_HEAD_UP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
finalPat = PAT_STANDDOWN;
|
2012-06-13 06:00:37 +00:00
|
|
|
headStandPat = PAT_HEAD_DOWN;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
|
|
|
finalPat = PAT_STANDLEFT;
|
2012-06-13 06:00:37 +00:00
|
|
|
headStandPat = PAT_HEAD_LEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
finalPat = PAT_STANDRIGHT;
|
2012-06-13 06:00:37 +00:00
|
|
|
headStandPat = PAT_HEAD_RIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
if (_bShepherdess) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(finalPat);
|
|
|
|
_bIsTalking = false;
|
2012-05-07 22:25:33 +00:00
|
|
|
return false;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bStatic = false;
|
2012-06-07 05:58:01 +00:00
|
|
|
switch (_nTalkType) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case TALK_NORMAL:
|
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_HIPS:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyEndPat = BPAT_HIPSUP_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyEndPat = BPAT_HIPSDOWN_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyEndPat = BPAT_HIPSLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
2012-05-21 21:53:13 +00:00
|
|
|
case RIGHT:
|
2012-06-20 22:20:16 +00:00
|
|
|
bodyEndPat = BPAT_HIPSRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
case TALK_SING:
|
|
|
|
bodyEndPat = BPAT_SINGLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_LAUGH:
|
|
|
|
case TALK_LAUGH2:
|
2012-06-11 19:43:04 +00:00
|
|
|
if (_talkDirection == LEFT)
|
2012-06-20 22:20:16 +00:00
|
|
|
headEndPat = PAT_LAUGHLEFT_END;
|
2012-06-11 19:43:04 +00:00
|
|
|
else if (_talkDirection == RIGHT)
|
2012-06-20 22:20:16 +00:00
|
|
|
headEndPat = PAT_LAUGHRIGHT_END;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
case TALK_DISGUSTED:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-13 06:00:37 +00:00
|
|
|
headEndPat = PAT_DISGUSTEDLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-13 06:00:37 +00:00
|
|
|
headEndPat = PAT_DISGUSTEDRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
case TALK_SARCASTIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-20 22:20:16 +00:00
|
|
|
headEndPat = PAT_SARCASTICLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-20 22:20:16 +00:00
|
|
|
headEndPat = PAT_SARCASTICRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
case TALK_INDICATE:
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCARED:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_SCAREDUP_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDDOWN_END;
|
|
|
|
bodyEndPat = BPAT_SCAREDDOWN_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDRIGHT_END;
|
|
|
|
bodyEndPat = BPAT_SCAREDRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDLEFT_END;
|
|
|
|
bodyEndPat = BPAT_SCAREDLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCARED2:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDDOWN_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRABBIT:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
|
|
|
finalPat = PAT_STANDLEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRABBITLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
case DOWN:
|
|
|
|
finalPat = PAT_STANDRIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRABBITRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRECIPE:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
|
|
|
finalPat = PAT_STANDLEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRECIPELEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
case DOWN:
|
|
|
|
finalPat = PAT_STANDRIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRECIPERIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHCARDS:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
|
|
|
finalPat = PAT_STANDLEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHCARDSLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
case DOWN:
|
|
|
|
finalPat = PAT_STANDRIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHCARDSRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSNOWMAN:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
|
|
|
finalPat = PAT_STANDLEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHSNOWMANLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
case DOWN:
|
|
|
|
finalPat = PAT_STANDRIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHSNOWMANRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHWORM:
|
|
|
|
finalPat = PAT_WITHWORM;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHROPE:
|
|
|
|
finalPat = PAT_WITHROPE;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSECRETARY:
|
|
|
|
finalPat = PAT_WITHSECRETARY;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHHAMMER:
|
|
|
|
finalPat = PAT_WITHHAMMER;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHGLASSES:
|
|
|
|
finalPat = PAT_WITHGLASSES;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TALK_MACBETH1:
|
|
|
|
case TALK_MACBETH2:
|
|
|
|
case TALK_MACBETH3:
|
|
|
|
case TALK_MACBETH4:
|
|
|
|
case TALK_MACBETH5:
|
|
|
|
case TALK_MACBETH6:
|
|
|
|
case TALK_MACBETH7:
|
|
|
|
case TALK_MACBETH8:
|
|
|
|
finalPat = 0;
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCAREDSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case DOWN:
|
2012-06-12 19:42:46 +00:00
|
|
|
headStandPat = PAT_SCAREDDOWN_STAND;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headStandPat = PAT_SCAREDRIGHT_STAND;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headStandPat = PAT_SCAREDLEFT_STAND;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyEndPat = 0;
|
|
|
|
break;
|
2012-05-04 12:58:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
break;
|
2012-05-04 12:28:51 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
void RMTony::endTalk(CORO_PARAM) {
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
int headStandPat, headEndPat;
|
|
|
|
int bodyEndPat, finalPat;
|
|
|
|
bool bStatic;
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
|
|
_ctx->headStandPat = _ctx->headEndPat = 0;
|
|
|
|
_ctx->bodyEndPat = _ctx->finalPat = 0;
|
|
|
|
_ctx->bStatic = false;
|
|
|
|
|
|
|
|
_ctx->bodyEndPat = 0;
|
|
|
|
_ctx->headEndPat = 0;
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
if (!endTalkCalculate(_ctx->headStandPat, _ctx->headEndPat, _ctx->bodyEndPat, _ctx->finalPat, _ctx->bStatic))
|
2012-05-07 22:25:33 +00:00
|
|
|
return;
|
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Handles the end of an animated and static, leaving everything unchanged
|
2012-06-07 05:58:01 +00:00
|
|
|
if (_bIsStaticTalk) {
|
2012-06-12 19:42:46 +00:00
|
|
|
if (_nTalkType == TALK_WITHBEARDSTATIC) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(0);
|
2012-06-11 19:43:04 +00:00
|
|
|
if (_talkDirection == UP || _talkDirection == LEFT) {
|
2012-06-12 19:42:46 +00:00
|
|
|
_body.setPattern(BPAT_WITHBEARDLEFT_STATIC);
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-41, -14);
|
2012-06-11 19:43:04 +00:00
|
|
|
} else if (_talkDirection == DOWN || _talkDirection == RIGHT) {
|
2012-06-12 19:42:46 +00:00
|
|
|
_body.setPattern(BPAT_WITHBEARDRIGHT_STATIC);
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-26, -14);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
} else {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headStandPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsTalking = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-05-20 03:54:59 +00:00
|
|
|
// Set the pattern
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->headEndPat != 0 && _ctx->bodyEndPat != 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headEndPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_body.setPattern(_ctx->bodyEndPat);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(waitForEndPattern);
|
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-07 22:25:33 +00:00
|
|
|
} else if (_ctx->bodyEndPat != 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headStandPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_body.setPattern(_ctx->bodyEndPat);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-07 22:25:33 +00:00
|
|
|
} else if (_ctx->headEndPat != 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headEndPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
} else {
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->finalPat != 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
_body.setPattern(0);
|
|
|
|
setPattern(_ctx->finalPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsTalking = false;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CODE;
|
|
|
|
}
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-16 09:09:08 +00:00
|
|
|
void RMTony::startStaticCalculate(CharacterTalkType nTalk, int &headPat, int &headLoopPat,
|
2012-05-21 21:53:13 +00:00
|
|
|
int &bodyStartPat, int &bodyLoopPat) {
|
2012-06-07 05:58:01 +00:00
|
|
|
int nPat = getCurPattern();
|
2012-05-01 13:44:02 +00:00
|
|
|
|
|
|
|
headLoopPat = -1;
|
|
|
|
|
|
|
|
switch (nPat) {
|
|
|
|
case PAT_STANDDOWN:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = DOWN;
|
2012-06-13 06:00:37 +00:00
|
|
|
headPat = PAT_HEAD_RIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_TAKELEFT_UP2:
|
|
|
|
case PAT_TAKELEFT_MID2:
|
|
|
|
case PAT_TAKELEFT_DOWN2:
|
2012-06-13 06:00:37 +00:00
|
|
|
case PAT_GETUPLEFT:
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDLEFT:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = LEFT;
|
2012-06-13 06:00:37 +00:00
|
|
|
headPat = PAT_HEAD_LEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_TAKERIGHT_UP2:
|
|
|
|
case PAT_TAKERIGHT_MID2:
|
|
|
|
case PAT_TAKERIGHT_DOWN2:
|
2012-06-13 06:00:37 +00:00
|
|
|
case PAT_GETUPRIGHT:
|
2012-05-01 13:44:02 +00:00
|
|
|
case PAT_STANDRIGHT:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = RIGHT;
|
2012-06-13 06:00:37 +00:00
|
|
|
headPat = PAT_HEAD_RIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PAT_TAKEUP_UP2:
|
|
|
|
case PAT_TAKEUP_MID2:
|
|
|
|
case PAT_TAKEUP_DOWN2:
|
|
|
|
case PAT_STANDUP:
|
2012-06-11 19:43:04 +00:00
|
|
|
_talkDirection = UP;
|
2012-06-13 06:00:37 +00:00
|
|
|
headPat = PAT_HEAD_LEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-06-13 06:00:37 +00:00
|
|
|
_bBodyFront = true;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
|
|
|
switch (nTalk) {
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRABBITSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-21, -5);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRABBITLEFT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHRABBITLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, -5);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRABBITRIGHT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHRABBITRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHCARDSSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-34, -2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHCARDSLEFT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHCARDSLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-4, -2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHCARDSRIGHT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHCARDSRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRECIPESTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-61, -7);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRECIPELEFT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHRECIPELEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-5, -7);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHRECIPERIGHT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHRECIPERIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSNOWMANSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-35, 2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHSNOWMANLEFT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHSNOWMANLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-14, 2);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHSNOWMANRIGHT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHSNOWMANRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-10 14:24:52 +00:00
|
|
|
case TALK_WITH_NOTEBOOK:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-16, -9);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHNOTEBOOKLEFT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHNOTEBOOKLEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-6, -9);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHNOTEBOOKRIGHT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHNOTEBOOKRIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHMEGAPHONESTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-41, -8);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHMEGAPHONELEFT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHMEGAPHONELEFT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-14, -8);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHMEGAPHONERIGHT_START;
|
|
|
|
bodyLoopPat = BPAT_WITHMEGAPHONERIGHT_LOOP;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHBEARDSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-41, -14);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHBEARDLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDLEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_TALKBEARD_LEFT;
|
2012-05-01 13:44:02 +00:00
|
|
|
headPat = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(-26, -14);
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyStartPat = BPAT_WITHBEARDRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDRIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_TALKBEARD_RIGHT;
|
2012-05-01 13:44:02 +00:00
|
|
|
headPat = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCAREDSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case DOWN:
|
2012-06-12 19:42:46 +00:00
|
|
|
headPat = PAT_SCAREDDOWN_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDDOWN;
|
|
|
|
bodyStartPat = BPAT_STANDDOWN;
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_SCAREDDOWN_STAND;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(4, 53);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headPat = PAT_SCAREDLEFT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDLEFT;
|
|
|
|
bodyStartPat = BPAT_STANDLEFT;
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_SCAREDLEFT_STAND;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headPat = PAT_SCAREDRIGHT_START;
|
2012-05-01 13:44:02 +00:00
|
|
|
bodyLoopPat = BPAT_STANDRIGHT;
|
|
|
|
bodyStartPat = BPAT_STANDRIGHT;
|
2012-06-12 19:42:46 +00:00
|
|
|
headLoopPat = PAT_SCAREDRIGHT_STAND;
|
2012-06-07 06:42:35 +00:00
|
|
|
_nBodyOffset.set(6, 56);
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-05-04 12:58:42 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
2012-05-04 12:28:51 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
2012-05-07 22:25:33 +00:00
|
|
|
}
|
|
|
|
|
2012-06-16 09:09:08 +00:00
|
|
|
void RMTony::startStatic(CORO_PARAM, CharacterTalkType nTalk) {
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
int headPat, headLoopPat;
|
|
|
|
int bodyStartPat, bodyLoopPat;
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
|
|
_ctx->headPat = _ctx->headLoopPat = 0;
|
|
|
|
_ctx->bodyStartPat = _ctx->bodyLoopPat = 0;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-10 14:24:52 +00:00
|
|
|
startStaticCalculate(nTalk, _ctx->headPat, _ctx->headLoopPat,
|
|
|
|
_ctx->bodyStartPat, _ctx->bodyLoopPat);
|
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
// e vai con i pattern
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsStaticTalk = true;
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headPat);
|
|
|
|
_body.setPattern(_ctx->bodyStartPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
|
|
|
CORO_INVOKE_0(waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
if (_ctx->headLoopPat != -1)
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headLoopPat);
|
|
|
|
_body.setPattern(_ctx->bodyLoopPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CODE;
|
|
|
|
}
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-16 09:09:08 +00:00
|
|
|
void RMTony::endStaticCalculate(CharacterTalkType nTalk, int &bodyEndPat, int &finalPat, int &headEndPat) {
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
|
|
|
finalPat = PAT_STANDLEFT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
|
|
|
case DOWN:
|
|
|
|
finalPat = PAT_STANDRIGHT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (nTalk) {
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHSNOWMANSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-21 21:53:13 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHSNOWMANLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHSNOWMANRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRECIPESTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRECIPELEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRECIPERIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHRABBITSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRABBITLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHRABBITRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHCARDSSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHCARDSLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHCARDSRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-10 14:24:52 +00:00
|
|
|
case TALK_WITH_NOTEBOOK:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHNOTEBOOKLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHNOTEBOOKRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHMEGAPHONESTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHMEGAPHONELEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHMEGAPHONERIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_WITHBEARDSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case UP:
|
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHBEARDLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
bodyEndPat = BPAT_WITHBEARDRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2012-06-12 19:42:46 +00:00
|
|
|
case TALK_SCAREDSTATIC:
|
2012-06-11 19:43:04 +00:00
|
|
|
switch (_talkDirection) {
|
2012-05-01 13:44:02 +00:00
|
|
|
case LEFT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDLEFT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DOWN:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDDOWN_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIGHT:
|
2012-06-12 19:42:46 +00:00
|
|
|
headEndPat = PAT_SCAREDRIGHT_END;
|
2012-05-01 13:44:02 +00:00
|
|
|
break;
|
2012-05-04 12:28:51 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
break;
|
2012-05-04 12:28:51 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
2012-05-07 22:25:33 +00:00
|
|
|
}
|
|
|
|
|
2012-06-16 09:09:08 +00:00
|
|
|
void RMTony::endStatic(CORO_PARAM, CharacterTalkType nTalk) {
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-21 21:53:13 +00:00
|
|
|
int bodyEndPat;
|
|
|
|
int finalPat;
|
|
|
|
int headEndPat;
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_END_CONTEXT(_ctx);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-05-07 22:25:33 +00:00
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
|
|
_ctx->bodyEndPat = 0;
|
|
|
|
_ctx->finalPat = 0;
|
|
|
|
_ctx->headEndPat = 0;
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
endStaticCalculate(nTalk, _ctx->bodyEndPat, _ctx->finalPat, _ctx->headEndPat);
|
2012-05-07 22:25:33 +00:00
|
|
|
|
|
|
|
if (_ctx->headEndPat != 0) {
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->headEndPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
} else {
|
|
|
|
// Play please
|
2012-06-07 05:58:01 +00:00
|
|
|
_body.setPattern(_ctx->bodyEndPat);
|
2012-05-01 13:44:02 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
CORO_INVOKE_0(_body.waitForEndPattern);
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
setPattern(_ctx->finalPat);
|
|
|
|
_body.setPattern(0);
|
2012-05-21 21:53:13 +00:00
|
|
|
|
2012-06-07 05:58:01 +00:00
|
|
|
_bIsStaticTalk = false;
|
2012-05-07 22:25:33 +00:00
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2012-08-31 23:05:22 +00:00
|
|
|
/**
|
|
|
|
* Waits until the end of a pattern
|
|
|
|
*/
|
|
|
|
void RMTony::waitForEndPattern(CORO_PARAM, uint32 hCustomSkip) {
|
|
|
|
RMCharacter::waitForEndPattern(coroParam, hCustomSkip);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if currently in an action
|
|
|
|
*/
|
|
|
|
bool RMTony::inAction() {
|
|
|
|
return (_bActionPending && _action != 0) | _bAction;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if there needs to be an update for scrolling movement
|
|
|
|
*/
|
|
|
|
bool RMTony::mustUpdateScrolling() {
|
|
|
|
return ((!inAction()) || (isMoving()));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns Tony's position
|
|
|
|
*/
|
|
|
|
RMPoint RMTony::position() {
|
|
|
|
return _pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the scrolling position
|
|
|
|
*/
|
|
|
|
void RMTony::setScrollPosition(const RMPoint &pt) {
|
|
|
|
RMCharacter::setScrollPosition(pt);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tony disguises himself!
|
|
|
|
*/
|
|
|
|
void RMTony::setShepherdess(bool bIsPast) {
|
|
|
|
_bShepherdess = bIsPast;
|
|
|
|
}
|
|
|
|
|
|
|
|
int RMTony::getShepherdess() {
|
|
|
|
return _bShepherdess;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RMTony::playSfx(int nSfx) {
|
|
|
|
RMItem::playSfx(nSfx);
|
|
|
|
}
|
|
|
|
|
2012-05-01 13:44:02 +00:00
|
|
|
} // End of namespace Tony
|