예제 #1
0
bool Game_Interpreter::CommandShakeScreen(RPG::EventCommand const& com) { // code 11050
	Game_Screen* screen = Main_Data::game_screen.get();
	int strength = com.parameters[0];
	int speed = com.parameters[1];
	int tenths = com.parameters[2];
	bool wait = com.parameters[3] != 0;

	if (Player::engine == Player::EngineRpg2k) {
		screen->ShakeOnce(strength, speed, tenths);
		if (wait) {
			SetupWait(tenths);
		}
	} else {
		switch (com.parameters[4]) {
			case 0:
				screen->ShakeOnce(strength, speed, tenths);
				if (wait) {
					SetupWait(tenths);
				}
				break;
			case 1:
				screen->ShakeBegin(strength, speed);
				break;
			case 2:
				screen->ShakeEnd();
				break;
		}
	}

	return true;
}
예제 #2
0
bool Game_Interpreter::CommandFlashScreen(RPG::EventCommand const& com) { // code 11040
	Game_Screen* screen = Main_Data::game_screen.get();
	int r = com.parameters[0];
	int g = com.parameters[1];
	int b = com.parameters[2];
	int s = com.parameters[3];
	int tenths = com.parameters[4];
	bool wait = com.parameters[5] != 0;

	if (Player::engine == Player::EngineRpg2k3) {
		switch (com.parameters[6]) {
			case 0:
				screen->FlashOnce(r, g, b, s, tenths);
				if (wait)
					SetupWait(tenths);
				break;
			case 1:
				screen->FlashBegin(r, g, b, s, tenths);
				break;
			case 2:
				screen->FlashEnd();
				break;
		}
	} else {
		screen->FlashOnce(r, g, b, s, tenths);
		if (wait)
			SetupWait(tenths);
	}

	return true;
}
예제 #3
0
bool Game_Interpreter::CommandWait(RPG::EventCommand const& /* com */) {
	if (Player::engine == Player::EngineRpg2k || list[index].parameters[1] == 0) {
		SetupWait(list[index].parameters[0]);
		return true;
	} else
		return Input::IsAnyTriggered();
}
예제 #4
0
bool Game_Interpreter::CommandWait(RPG::EventCommand const& com) {
	if (com.parameters.size() <= 1 ||
		(com.parameters.size() > 1 && com.parameters[1] == 0)) {
		SetupWait(com.parameters[0]);
		return true;
	} else {
		return Input::IsAnyTriggered();
	}
}
예제 #5
0
bool Game_Interpreter::CommandTintScreen(RPG::EventCommand const& com) { // code 11030
	Game_Screen* screen = Main_Data::game_screen.get();
	int r = com.parameters[0];
	int g = com.parameters[1];
	int b = com.parameters[2];
	int s = com.parameters[3];
	int tenths = com.parameters[4];
	bool wait = com.parameters[5] != 0;

	screen->TintScreen(r, g, b, s, tenths);

	if (wait)
		SetupWait(tenths);

	return true;
}
예제 #6
0
bool Game_Interpreter_Map::CommandFlashSprite(RPG::EventCommand const& com) { // code 11320
	int event_id = com.parameters[0];
	Color color(com.parameters[1] * 255 / 31,
		com.parameters[2] * 255 / 31,
		com.parameters[3] * 255 / 31,
		com.parameters[4] * 255 / 31);

	int tenths = com.parameters[5];
	bool wait = com.parameters[6] > 0;
	Game_Character* event = GetCharacter(event_id);

	if (event != NULL) {
		event->Flash(color, tenths * DEFAULT_FPS / 10);

		if (wait)
			SetupWait(tenths);
	}

	return true;
}