[Scummvm-git-logs] scummvm master -> 383124994e3a5b765e1b1b0be6653cad2504499b

peterkohaut peterkohaut at users.noreply.github.com
Thu Mar 8 22:24:13 CET 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0a3f022a53 BLADERUNNER: Fixed dialogue menu colors
383124994e BLADERUNNER: Added Grigorian actor


Commit: 0a3f022a53ba419da0817b42bd16ddbae1b8c3a0
    https://github.com/scummvm/scummvm/commit/0a3f022a53ba419da0817b42bd16ddbae1b8c3a0
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2018-03-08T22:20:55+01:00

Commit Message:
BLADERUNNER: Fixed dialogue menu colors

Changed paths:
    engines/bladerunner/dialogue_menu.cpp


diff --git a/engines/bladerunner/dialogue_menu.cpp b/engines/bladerunner/dialogue_menu.cpp
index f5a63e0..685c845 100644
--- a/engines/bladerunner/dialogue_menu.cpp
+++ b/engines/bladerunner/dialogue_menu.cpp
@@ -312,7 +312,7 @@ void DialogueMenu::draw(Graphics::Surface &s) {
 	for (int i = 0; i != _listSize; ++i) {
 		_shapes[1].draw(s, x1, y);
 		_shapes[4].draw(s, x2, y);
-		uint16 color = ((_items[i].colorIntensity >> 1) << 10) | ((_items[i].colorIntensity >> 1) << 6) | _items[i].colorIntensity;
+		uint16 color = ((_items[i].colorIntensity >> 1) << 10) | ((_items[i].colorIntensity >> 1) << 5) | _items[i].colorIntensity;
 		_vm->_mainFont->drawColor(_items[i].text, s, x, y, color);
 		y += kLineHeight;
 	}
@@ -402,7 +402,7 @@ void DialogueMenu::darkenRect(Graphics::Surface &s, int x1, int y1, int x2, int
 		for (int y = y1; y != y2; ++y) {
 			for (int x = x1; x != x2; ++x) {
 				uint16 *p = (uint16 *)s.getBasePtr(x, y);
-				*p = (*p & 0x739C) >> 1; // 0 11100 11100 11100
+				*p = (*p & 0x739C) >> 2; // 0 11100 11100 11100
 			}
 		}
 	}


Commit: 383124994e3a5b765e1b1b0be6653cad2504499b
    https://github.com/scummvm/scummvm/commit/383124994e3a5b765e1b1b0be6653cad2504499b
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2018-03-08T22:20:56+01:00

Commit Message:
BLADERUNNER: Added Grigorian actor

Changed paths:
  A engines/bladerunner/script/ai/grigorian.cpp
    engines/bladerunner/module.mk
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/ai_script.h


diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk
index 2dff113..5826b8e 100644
--- a/engines/bladerunner/module.mk
+++ b/engines/bladerunner/module.mk
@@ -54,6 +54,7 @@ MODULE_OBJS = \
 	script/ai/generic_walker_a.o \
 	script/ai/generic_walker_b.o \
 	script/ai/generic_walker_c.o \
+	script/ai/grigorian.o \
 	script/ai/howie_lee.o \
 	script/ai/hysteria_patron1.o \
 	script/ai/hysteria_patron2.o \
diff --git a/engines/bladerunner/script/ai/grigorian.cpp b/engines/bladerunner/script/ai/grigorian.cpp
new file mode 100644
index 0000000..daebdcf
--- /dev/null
+++ b/engines/bladerunner/script/ai/grigorian.cpp
@@ -0,0 +1,271 @@
+/* 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ */
+
+#include "bladerunner/script/ai_script.h"
+
+namespace BladeRunner {
+
+AIScriptGrigorian::AIScriptGrigorian(BladeRunnerEngine *vm) : AIScriptBase(vm) {
+	var_45CA10 = 0;
+	var_45CA14 = 0;
+}
+
+void AIScriptGrigorian::Initialize() {
+	var_45CA10 = 0;
+	var_45CA14 = 0;
+	_animationStateNext = 0;
+	_animationFrame = 0;
+	_animationState = 0;
+}
+
+bool AIScriptGrigorian::Update() {
+	if (Actor_Query_Friendliness_To_Other(kActorGrigorian, kActorMcCoy) < 30 && !Game_Flag_Query(51)) {
+		Game_Flag_Set(51);
+		return true;
+	}
+	return false;
+}
+
+void AIScriptGrigorian::TimerExpired(int timer) {
+	//return false;
+}
+
+void AIScriptGrigorian::CompletedMovementTrack() {
+	//return false;
+}
+
+void AIScriptGrigorian::ReceivedClue(int clueId, int fromActorId) {
+	//return false;
+}
+
+void AIScriptGrigorian::ClickedByPlayer() {
+	//return false;
+}
+
+void AIScriptGrigorian::EnteredScene(int sceneId) {
+	// return false;
+}
+
+void AIScriptGrigorian::OtherAgentEnteredThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptGrigorian::OtherAgentExitedThisScene(int otherActorId) {
+	// return false;
+}
+
+void AIScriptGrigorian::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {
+	// return false;
+}
+
+void AIScriptGrigorian::ShotAtAndMissed() {
+	// return false;
+}
+
+bool AIScriptGrigorian::ShotAtAndHit() {
+	return false;
+}
+
+void AIScriptGrigorian::Retired(int byActorId) {
+	// return false;
+}
+
+int AIScriptGrigorian::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) {
+	return 0;
+}
+
+bool AIScriptGrigorian::GoalChanged(int currentGoalNumber, int newGoalNumber) {
+	return false;
+}
+
+bool AIScriptGrigorian::UpdateAnimation(int *animation, int *frame) {
+	switch (_animationState) {
+	case 0:
+		if (var_45CA10 == 0) {
+			*animation = 478;
+			if (var_45CA14) {
+				var_45CA14--;
+			} else {
+				_animationFrame++;
+				if (_animationFrame == 5 || _animationFrame == 13) {
+					var_45CA14 = Random_Query(2, 4);
+				}
+				if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(478)) {
+					_animationFrame = 0;
+					var_45CA10 = Random_Query(0, 2);
+				}
+			}
+		} else if (var_45CA10 == 1) {
+			*animation = 479;
+			_animationFrame++;
+			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(479)) {
+				*animation = 478;
+				_animationFrame = 0;
+				var_45CA10 = 0;
+			}
+		} else if (var_45CA10 == 2) {
+			*animation = 480;
+			if (var_45CA14) {
+				var_45CA14--;
+			} else {
+				_animationFrame++;
+				if (_animationFrame >= 8 && _animationFrame <= 10) {
+					var_45CA14 = Random_Query(2, 4);
+				}
+				if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(478)) {
+					*animation = 478;
+					_animationFrame = 0;
+					var_45CA10 = 0;
+				}
+			}
+		}
+		break;
+	case 1:
+		*animation = 479;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(479)) {
+			_animationFrame = 0;
+		}
+		break;
+	case 2:
+		*animation = 481;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(481)) {
+			_animationFrame = 0;
+		}
+		break;
+	case 3:
+		*animation = 482;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(482)) {
+			_animationState = 2;
+			_animationFrame = 0;
+			*animation = 481;
+		}
+		break;
+	case 4:
+		*animation = 483;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(483)) {
+			_animationState = 2;
+			_animationFrame = 0;
+			*animation = 481;
+		}
+		break;
+	case 5:
+		*animation = 484;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(484)) {
+			_animationState = 2;
+			_animationFrame = 0;
+			*animation = 481;
+		}
+		break;
+	case 6:
+		*animation = 485;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(485)) {
+			_animationState = 2;
+			_animationFrame = 0;
+			*animation = 481;
+		}
+		break;
+	case 7:
+		*animation = 486;
+		_animationFrame++;
+		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(486)) {
+			_animationState = 2;
+			_animationFrame = 0;
+			*animation = 481;
+		}
+		break;
+	default:
+		*animation = 399;
+		break;
+	}
+	*frame = _animationFrame;
+	return true;
+}
+
+bool AIScriptGrigorian::ChangeAnimationMode(int mode) {
+	switch (mode) {
+	case kAnimationModeIdle:
+		_animationState = 0;
+		_animationFrame = 0;
+		break;
+	case kAnimationModeWalk:
+		if (_animationState != 1) {
+			_animationState = 1;
+			_animationFrame = 0;
+		}
+		break;
+	case kAnimationModeTalk:
+		_animationState = 2;
+		_animationFrame = 0;
+		break;
+	case 12:
+		_animationState = 3;
+		_animationFrame = 0;
+		break;
+	case 13:
+		_animationState = 4;
+		_animationFrame = 0;
+		break;
+	case 14:
+		_animationState = 5;
+		_animationFrame = 0;
+		break;
+	case 15:
+		_animationState = 6;
+		_animationFrame = 0;
+		break;
+	case 16:
+		_animationState = 7;
+		_animationFrame = 0;
+		break;
+	}
+	return true;
+}
+
+void AIScriptGrigorian::QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
+	*animationState     = _animationState;
+	*animationFrame     = _animationFrame;
+	*animationStateNext = _animationStateNext;
+	*animationNext      = _animationNext;
+}
+
+void AIScriptGrigorian::SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
+	_animationState     = animationState;
+	_animationFrame     = animationFrame;
+	_animationStateNext = animationStateNext;
+	_animationNext      = animationNext;
+}
+
+bool AIScriptGrigorian::ReachedMovementTrackWaypoint(int waypointId) {
+	return true;
+}
+
+void AIScriptGrigorian::FledCombat() {
+	// return false;
+}
+
+} // End of namespace BladeRunner
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index 2780e41..ddf2ee5 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -40,6 +40,7 @@ AIScripts::AIScripts(BladeRunnerEngine *vm, int actorCount) {
 	}
 
 	_AIScripts[kActorMcCoy] = new AIScriptMcCoy(_vm);
+	_AIScripts[kActorGrigorian] = new AIScriptGrigorian(_vm);
 	_AIScripts[kActorRunciter] = new AIScriptRunciter(_vm);
 	_AIScripts[kActorZuben] = new AIScriptZuben(_vm);
 	_AIScripts[kActorOfficerLeary] = new AIScriptOfficerLeary(_vm);
diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h
index 54385d0..e418e85 100644
--- a/engines/bladerunner/script/ai_script.h
+++ b/engines/bladerunner/script/ai_script.h
@@ -120,6 +120,11 @@ DECLARE_SCRIPT(McCoy)
 	void sub_4059D0(float a1);
 END_SCRIPT
 
+DECLARE_SCRIPT(Grigorian)
+	int var_45CA10;
+	int var_45CA14;
+END_SCRIPT
+
 DECLARE_SCRIPT(Runciter)
 	int var_45CD78;
 	int var_45CD7C;





More information about the Scummvm-git-logs mailing list