[Scummvm-git-logs] scummvm master -> 549b90481acf1f252ef05014df42372fc703f54b
dreammaster
dreammaster at scummvm.org
Sat Feb 10 01:24:50 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:
8d4230df21 XEEN: Reduce code duplication in Clouds ending
549b90481a XEEN: Fix MonsterStruct _accuracy to be _armorClass
Commit: 8d4230df21a2221d5faaa3402fa4dd1139122b13
https://github.com/scummvm/scummvm/commit/8d4230df21a2221d5faaa3402fa4dd1139122b13
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-09T19:13:56-05:00
Commit Message:
XEEN: Reduce code duplication in Clouds ending
Changed paths:
engines/xeen/worldofxeen/clouds_cutscenes.cpp
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
index e3082b9..56ffe96 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
@@ -29,7 +29,9 @@ namespace WorldOfXeen {
#define ROTATE_BG screen.horizMerge(_mergeX); \
_mergeX = (_mergeX + 1) % SCREEN_WIDTH
-
+#define LOAD_VORTEX loadScreen(Common::String::format("vort%02u.frm", cloudsCtr)); \
+ if (cloudsCtr++ > 20) \
+ cloudsCtr = 1
bool CloudsCutscenes::showCloudsTitle() {
EventsManager &events = *_vm->_events;
@@ -370,14 +372,13 @@ bool CloudsCutscenes::showCloudsEnding1() {
loadScreen(Common::String::format("prec00%02u.frm", 1));
prec.draw(0, 0);
prec.draw(0, 1, Common::Point(160, 0));
- screen.update();
screen.fadeIn();
WAIT(15);
sound.playFX(1);
sound.playFX(34);
- // prec loop
+ // Initial animation of vortex & lightning in the sky
for (int idx = 1; idx < 42; ++idx) {
// Load up the background frame of swirling clouds
loadScreen(Common::String::format("prec00%02u.frm", idx));
@@ -417,7 +418,7 @@ bool CloudsCutscenes::showCloudsEnding1() {
// First vortex loop
int cloudsCtr = 1;
for (int idx = 1; idx < 16; ++idx) {
- loadScreen(Common::String::format("vort%02u.frm", cloudsCtr++));
+ LOAD_VORTEX;
cast[0].draw(0, 0);
cast[0].draw(0, 0, Common::Point(0, 100));
WAIT(3);
@@ -430,10 +431,6 @@ bool CloudsCutscenes::showCloudsEnding1() {
bool flag = false;
for (int idx1 = 1; idx1 < 7; ++idx1) {
for (int idx2 = 0; idx2 < COUNTS1[idx1 - 1]; ++idx2) {
- loadScreen(Common::String::format("vort%02u.frm", cloudsCtr));
- if (cloudsCtr++ > 20)
- cloudsCtr = 1;
-
if (flag && !sound.isPlaying()) {
flag = false;
sound.playFX(34);
@@ -460,6 +457,7 @@ bool CloudsCutscenes::showCloudsEnding1() {
break;
}
+ LOAD_VORTEX;
cast[idx1 - 1].draw(0, idx2, Common::Point(0, 0));
cast[idx1 - 1].draw(0, idx2, Common::Point(0, 100));
WAIT(3);
@@ -467,9 +465,7 @@ bool CloudsCutscenes::showCloudsEnding1() {
}
for (int idx = 0; idx < 16; ++idx) {
- loadScreen(Common::String::format("vort%02u.frm", cloudsCtr));
- if (cloudsCtr++ > 20)
- cloudsCtr = 1;
+ LOAD_VORTEX;
if (idx < 7)
darkLord[0].draw(0, idx);
@@ -513,10 +509,7 @@ bool CloudsCutscenes::showCloudsEnding1() {
}
do {
- loadScreen(Common::String::format("vort%02u.frm", cloudsCtr));
- if (cloudsCtr++ > 20)
- cloudsCtr = 1;
-
+ LOAD_VORTEX;
darkLord[2].draw(0, getSpeakingFrame(2, 6));
switch (cloudsCtr - 1) {
@@ -545,9 +538,7 @@ bool CloudsCutscenes::showCloudsEnding1() {
sound.setMusicVolume(95);
for (int idx = 12; idx >= 0; --idx) {
- loadScreen(Common::String::format("vort%02u.frm", cloudsCtr));
- if (cloudsCtr++ > 20)
- cloudsCtr = 1;
+ LOAD_VORTEX;
if (idx < 7)
darkLord[0].draw(0, idx);
@@ -753,7 +744,7 @@ bool CloudsCutscenes::showCloudsEnding3() {
ROTATE_BG;
counter1 = (counter1 + 1) % 8;
Common::Point monPos(31, 10);
- if (mon._loopAnimation) {
+ if (mon._flying) {
monPos.x += XARRAY[counter1];
monPos.y += YARRAY[counter1];
}
@@ -773,7 +764,7 @@ bool CloudsCutscenes::showCloudsEnding3() {
ROTATE_BG;
counter1 = (counter1 + 1) % 8;
Common::Point monPos(31, 10);
- if (mon._loopAnimation) {
+ if (mon._flying) {
monPos.x += XARRAY[counter1];
monPos.y += YARRAY[counter1];
}
@@ -791,7 +782,7 @@ bool CloudsCutscenes::showCloudsEnding3() {
ROTATE_BG;
counter1 = (counter1 + 1) % 8;
Common::Point monPos(31, 10);
- if (mon._loopAnimation) {
+ if (mon._flying) {
monPos.x += XARRAY[counter1];
monPos.y += YARRAY[counter1];
}
@@ -816,7 +807,7 @@ bool CloudsCutscenes::showCloudsEnding3() {
ROTATE_BG;
counter1 = (counter1 + 1) % 8;
Common::Point monPos(31, 10);
- if (mon._loopAnimation) {
+ if (mon._flying) {
monPos.x += XARRAY[counter1];
monPos.y += YARRAY[counter1];
}
Commit: 549b90481acf1f252ef05014df42372fc703f54b
https://github.com/scummvm/scummvm/commit/549b90481acf1f252ef05014df42372fc703f54b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-02-09T19:17:19-05:00
Commit Message:
XEEN: Fix MonsterStruct _accuracy to be _armorClass
Thanks to Leprosy57 in the GOG forums for pointing it out
Changed paths:
engines/xeen/combat.cpp
engines/xeen/dialogs_spells.cpp
engines/xeen/map.cpp
engines/xeen/map.h
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index c60a55a..1d8b0db 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -1670,7 +1670,7 @@ bool Combat::hitMonster(Character &c, RangeType rangeType) {
if (monster._damageType != DT_PHYSICAL)
chance += 20;
- return chance >= (monsterData._accuracy + 10);
+ return chance >= (monsterData._armorClass + 10);
}
void Combat::getWeaponDamage(Character &c, RangeType rangeType) {
diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp
index ab0347e..e00fa13 100644
--- a/engines/xeen/dialogs_spells.cpp
+++ b/engines/xeen/dialogs_spells.cpp
@@ -1019,7 +1019,7 @@ void IdentifyMonster::execute() {
monsterDesc[monIndex] = Common::String::format(Res.MONSTER_DETAILS,
monsterData._name.c_str(),
_vm->printK2(monster._hp).c_str(),
- monsterData._accuracy, monsterData._numberOfAttacks,
+ monsterData._armorClass, monsterData._numberOfAttacks,
Res.MONSTER_SPECIAL_ATTACKS[monsterData._specialAttack]
);
}
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 5aa2198..aab806f 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -59,7 +59,7 @@ const char *const MUSIC_FILES2[6][7] = {
MonsterStruct::MonsterStruct() {
_experience = 0;
_hp = 0;
- _accuracy = 0;
+ _armorClass = 0;
_speed = 0;
_numberOfAttacks = 0;
_hatesClass = CLASS_KNIGHT;
@@ -88,7 +88,7 @@ MonsterStruct::MonsterStruct() {
_fx = 0;
}
-MonsterStruct::MonsterStruct(Common::String name, int experience, int hp, int accuracy,
+MonsterStruct::MonsterStruct(Common::String name, int experience, int hp, int armorClass,
int speed, int numberOfAttacks, CharacterClass hatesClass, int strikes,
int dmgPerStrike, DamageType attackType, SpecialAttack specialAttack,
int hitChance, int rangeAttack, MonsterType monsterType,
@@ -97,7 +97,7 @@ MonsterStruct::MonsterStruct(Common::String name, int experience, int hp, int ac
int phsyicalResistence, int field29, int gold, int gems, int itemDrop,
bool flying, int imageNumber, int loopAnimation, int animationEffect,
int fx, Common::String attackVoc):
- _name(name), _experience(experience), _hp(hp), _accuracy(accuracy),
+ _name(name), _experience(experience), _hp(hp), _armorClass(armorClass),
_speed(speed), _numberOfAttacks(numberOfAttacks), _hatesClass(hatesClass),
_strikes(strikes), _dmgPerStrike(dmgPerStrike), _attackType(attackType),
_specialAttack(specialAttack), _hitChance(hitChance), _rangeAttack(rangeAttack),
@@ -118,7 +118,7 @@ void MonsterStruct::synchronize(Common::SeekableReadStream &s) {
_experience = s.readUint32LE();
_hp = s.readUint16LE();
- _accuracy = s.readByte();
+ _armorClass = s.readByte();
_speed = s.readByte();
_numberOfAttacks = s.readByte();
_hatesClass = (CharacterClass)s.readByte();
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index 71af89e..1f17954 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -52,7 +52,7 @@ public:
Common::String _name;
int _experience;
int _hp;
- int _accuracy;
+ int _armorClass;
int _speed;
int _numberOfAttacks;
int _hatesClass;
More information about the Scummvm-git-logs
mailing list