Example #1
0
void ScummEngine_v0::verbExec() {
	_sentenceNum = 0;
	_sentenceNestedCount = 0;

	if (_activeVerb == kVerbWhatIs)
		return;

	if (!(_activeVerb == kVerbWalkTo && _activeObject == 0)) {
		doSentence(_activeVerb, _activeObject, _activeObject2);
		if (_activeVerb != kVerbWalkTo) {
			_activeVerb = kVerbWalkTo;
			_activeObject = 0;
			_activeObject2 = 0;
		}
		_walkToObjectState = kWalkToObjectStateDone;
		return;
	}

	Actor_v0 *a = (Actor_v0 *)derefActor(VAR(VAR_EGO), "verbExec");
	int x = _virtualMouse.x / V12_X_MULTIPLIER;
	int y = _virtualMouse.y / V12_Y_MULTIPLIER;
	//actorSetPosInBox();

	// 0xB31
	VAR(6) = x;
	VAR(7) = y;

	if (a->_miscflags & kActorMiscFlagFreeze)
		return;

	a->stopActorMoving();
	a->startWalkActor(VAR(6), VAR(7), -1);
}
Example #2
0
void ScummEngine_v0::o_animateActor() {
	int act = getVarOrDirectByte(PARAM_1);
	int anim = getVarOrDirectByte(PARAM_2);
	int8 repeat = (int8) fetchScriptByte();

	Actor_v0 *a = (Actor_v0*) derefActor(act, "o_animateActor");

	a->_animFrameRepeat = repeat;

	switch (anim) {

		case 0xFE:
			// 0x6993
			a->_speaking = 0x80;	// Enabled, but not switching
			return;

		case 0xFD:
			// 0x69A3
			a->_speaking = 0x00;
			return;

		case 0xFF:
			a->stopActorMoving();
			return;
	}

	a->animateActor(anim);
}
Example #3
0
void ScummEngine_v0::o_loadRoomWithEgo() {
	Actor_v0 *a;
	int obj, room, x, y, dir;

	obj = fetchScriptByte();
	room = fetchScriptByte();

	a = (Actor_v0 *)derefActor(VAR(VAR_EGO), "o_loadRoomWithEgo");

	//0x634F
	if (a->_miscflags & kActorMiscFlagFreeze) {
		stopObjectCode();
		return;
	}

	// The original interpreter sets the actors new room X/Y to the last rooms X/Y
	// This fixes a problem with MM: script 158 in room 12, the 'Oomph!' script
	// This scripts runs before the actor position is set to the correct room entry location
	a->putActor(a->getPos().x, a->getPos().y, room);
	_egoPositioned = false;

	startScene(a->_room, a, obj);

	getObjectXYPos(obj, x, y, dir);
	AdjustBoxResult r = a->adjustXYToBeInBox(x, y);
	x = r.x;
	y = r.y;
	a->putActor(x, y, _currentRoom);

	camera._dest.x = camera._cur.x = a->getPos().x;
	setCameraAt(a->getPos().x, a->getPos().y);
	setCameraFollows(a);

	_fullRedraw = true;

	resetSentence();

	if (x >= 0 && y >= 0) {
		a->startWalkActor(x, y, -1);
	}
}
Example #4
0
void ScummEngine_v0::o_setActorBitVar() {
	byte act = getVarOrDirectByte(PARAM_1);
	byte mask = getVarOrDirectByte(PARAM_2);
	byte mod = getVarOrDirectByte(PARAM_3);

	// 0x63ED
	if (act >= _numActors)
		return;

	Actor_v0 *a = (Actor_v0 *)derefActor(act, "o_setActorBitVar");

	if (mod)
		a->_miscflags |= mask;
	else
		a->_miscflags &= ~mask;

	// This flag causes the actor to stop moving (used by script #158, Green Tentacle 'Oomph!')
	if (a->_miscflags & kActorMiscFlagFreeze)
		a->stopActorMoving();

	debug(0, "o_setActorBitVar(%d, %d, %d)", act, mask, mod);
}