MM: MM1: Change Temple to use PartyView base, drawing improvements

This commit is contained in:
Paul Gilbert 2023-02-25 21:26:52 -08:00
parent ca8b77e341
commit 4c6a82ba02
5 changed files with 138 additions and 163 deletions

View File

@ -146,8 +146,8 @@ dialogs:
1: " Are you ready? "
2: "Then press Enter!"
search:
search: "search: "
you_found: "you found..."
search: "Search: "
you_found: "You found..."
nothing: "nothing"
containers:
0: " cloth sack "
@ -167,16 +167,16 @@ dialogs:
bad_class: "*** bad class ***"
no_sp: "*** no spell points ***"
magic_trap: "magic (%c) trap (%c)"
who_will_try: "who will try '1'-'%c'"
check_condition: "*** check condition ***"
it_opens: "it opens!"
who_will_try: "Who will try '1'-'%c'"
check_condition: "*** Check condition ***"
it_opens: "It opens!"
receives: "receives"
each_share: "each share is worth %d gold"
found_gems: "%s found %d gems"
found_item: "%s found %s"
statues:
stone: "on this stone statue of "
plaque: "a plaque reads..."
stone: "On this stone statue of "
plaque: "A plaque reads..."
names:
0: "a human knight"
1: "an elven wizard"
@ -186,106 +186,106 @@ dialogs:
5: "a blue dragon"
6: "a gray minotaur"
messages:
0: "services rendered, secrets unfold\nthe brothers together\nlead to treasures untold\n\nfive towns you must travel\nfor this quest to unravel"
1: "seek the wizard ranalou\nin his lair at the korin bluffs\nsix castles he will send you to\nbut doom will be quite tough!\ncruelty and kindness\nmeasured throughout\njudgement day is then sought out"
2: "one by water, one by land\none by air, and one by sand\nthe wheel of luck\nwill favorably pay, the more of these\nmenacing beasts you slay!\nalthough wishes may come true\nall the beasts will become anew"
3: "there are many dungeons like me\nfind the right pair\nand you'll discover the key\nthe ancient seer og has lost his sight\nthe idols will help to end his plight"
4: "in honor of corak...\n\nfor his mapping expedition\nof the land of varn and rediscovery\nof the lost town of dusk"
5: "in honor of gala...\n\nfor her brave attempt to work with the\nsavages of the volcanic isles"
6: "in memory of a time long ago...\n\nbefore the days when the towns\nmoved underground, dragons were\nfew and far between"
7: "this beast once roamed the\nenchanted forest and now rules\na great fortress there"
0: "Services rendered, secrets unfold\nthe brothers together\nlead to treasures untold\n\nfive towns you must travel\nfor this quest to unravel"
1: "Seek the wizard ranalou\nin his lair at the korin bluffs\nsix castles he will send you to\nbut doom will be quite tough!\ncruelty and kindness\nmeasured throughout\njudgement day is then sought out"
2: "One by water, one by land\none by air, and one by sand\nthe wheel of luck\nwill favorably pay, the more of these\nmenacing beasts you slay!\nalthough wishes may come true\nall the beasts will become anew"
3: "There are many dungeons like me\nfind the right pair\nand you'll discover the key\nthe ancient seer og has lost his sight\nthe idols will help to end his plight"
4: "In honor of corak...\n\nfor his mapping expedition\nof the land of varn and rediscovery\nof the lost town of dusk"
5: "In honor of gala...\n\nfor her brave attempt to work with the\nsavages of the volcanic isles"
6: "In memory of a time long ago...\n\nbefore the days when the towns\nmoved underground, dragons were\nfew and far between"
7: "This beast once roamed the\nenchanted forest and now rules\na great fortress there"
tavern:
drink: "a) have a drink\r"
tip: "b) tip bartender\r"
listen: "c) listen for rumors"
no_rumors: "no rumors today."
great_stuff: "great stuff!"
you_feel_sick: "you feel sick!!"
have_a_drink: "have a drink, then we'll talk."
have_another_round: "thanks a lot, have another round!"
go_see_clerics: "you look terrible, go see the clerics."
drink: "a) Have a drink\r"
tip: "b) Tip bartender\r"
listen: "c) Listen for rumors"
no_rumors: "No rumors today."
great_stuff: "Great stuff!"
you_feel_sick: "You feel sick!!"
have_a_drink: "Have a drink, then we'll talk."
have_another_round: "Thanks a lot, have another round!"
go_see_clerics: "You look terrible, go see the clerics."
rumors:
none: "no rumors today."
0: "all portals are connected"
1: "sorpigal has 8 statues"
2: "the brothers live by docks"
3: "some caves have more than one exit"
4: "the ice princess has the key"
5: "the desert has many oases"
6: "the swamp was once a city of gold"
7: "portsmith and men don't mix"
8: "most towns have caverns below"
9: "varn is not what it appears to be"
10: "kilburn is near the wyvern peaks"
11: "a dragons breath is only as strong\x8bas it's condition"
12: "the king is in seclusion"
14: "the inner sanctum is a myth"
15: "the canine has the key"
16: "scummvm is totally awesome!"
none: "No rumors today."
0: "All portals are connected"
1: "Sorpigal has 8 statues"
2: "The brothers live by docks"
3: "Some caves have more than one exit"
4: "The ice princess has the key"
5: "The desert has many oases"
6: "The swamp was once a city of gold"
7: "Portsmith and men don't mix"
8: "Most towns have caverns below"
9: "Varn is not what it appears to be"
10: "Kilburn is near the wyvern peaks"
11: "A dragons breath is only as strong\x8bas it's condition"
12: "The king is in seclusion"
14: "The inner sanctum is a myth"
15: "The canine has the key"
16: "ScummVM is totally awesome!"
tips:
1_1: "see man in cave below (1,2)"
1_2: "check walls near (12,3)"
1_3: "statue at (2,4) is your first job"
1_4: "similar pieces of a puzzle may not\8dbelong to the same puzzle"
2_1: "seek quests behind moons"
2_2: "the queen can be helpful"
2_3: "the beasts are on the map"
2_4: "islands like colors are unknown\x8duntil discovered"
3_1: "attacks should be concentrated"
3_2: "due north is the cave of square magic"
3_3: "secret doors are abundant"
3_4: "the demon and the maze are one"
4_1: "telgoran is in s.e. maze"
4_2: "some items give protection"
4_3: "dragadune holds many gems"
4_4: "donations help on judgement day"
5_1: "agar lives behind the inn"
5_2: "find the prisoner"
5_3: "barriers guard wealth"
5_4: "the magic total is 34"
1_1: "See man in cave below (1,2)"
1_2: "Check walls near (12,3)"
1_3: "Statue at (2,4) is your first job"
1_4: "Similar pieces of a puzzle may not\8dbelong to the same puzzle"
2_1: "Seek quests behind moons"
2_2: "The queen can be helpful"
2_3: "The beasts are on the map"
2_4: "Islands like colors are unknown\x8duntil discovered"
3_1: "Attacks should be concentrated"
3_2: "Due north is the cave of square magic"
3_3: "Secret doors are abundant"
3_4: "The demon and the maze are one"
4_1: "Telgoran is in s.e. maze"
4_2: "Some items give protection"
4_3: "Dragadune holds many gems"
4_4: "Donations help on judgement day"
5_1: "Agar lives behind the inn"
5_2: "Find the prisoner"
5_3: "Barriers guard wealth"
5_4: "The magic total is 34"
temple:
service_cost: "service cost"
a: "a) restore health"
b: "b) uncurse items"
c: "c) restore align"
d: "d) make donation"
thankyou: "thank you!"
protected: "*** today you shall be protected!"
a: "A) Restore health"
b: "B) Uncurse items"
c: "C) Restore align"
d: "D) Make donation"
thankyou: "Thank you!"
protected: "*** Today you shall be protected!"
training:
for_level: "training for level "
no_way: "no way!"
need: "need %d more"
cost: "cost %d gold"
for_level: "Training for level "
no_way: "No way!"
need: "Need %d more"
cost: "Cost %d gold"
xp: "experience points"
commence: "a) commence training"
congrats: "congratulations! you are now level "
hp: "you gained %d hit points"
new_spells: "you gained new spells!"
commence: "A) Commence training"
congrats: "Congratulations! you are now level "
hp: "You gained %d hit points"
new_spells: "You gained new spells!"
trap:
oops: "oops a trap!"
0: "darts!! a swarm of poisonous darts\n fill the air!"
1: "spikes!! deadly spikes spring forth!"
2: "arrows!! a sudden onslaught of poisonous arrows permeate the party!"
3: "blades!! razor sharp blades slice\n through the party!"
4: "boiling oil!! streams of boiling oil\n cover the party!"
5: "gas!! a faint hiss can be heard as\n noxious fumes fill the air!"
6: "fireball!! a fiery explosion engulfs\n the area!"
7: "lightning bolt!! electric currents\n singe the party!"
8: "acid!! a fine mist of volatile acid\n sprays the party!"
9: "ice storm!! particles of splintered ice\n hail through the air!"
10: "death ray!! a blinding light sears\n through the party!"
oops: "Oops a trap!"
0: "Darts!! a swarm of poisonous darts\n fill the air!"
1: "Spikes!! Deadly spikes spring forth!"
2: "Arrows!! A sudden onslaught of poisonous arrows permeate the party!"
3: "Blades!! Razor sharp blades slice\n through the party!"
4: "Boiling oil!! Streams of boiling oil\n cover the party!"
5: "Gas!! A faint hiss can be heard as\n noxious fumes fill the air!"
6: "Fireball!! A fiery explosion engulfs\n the area!"
7: "Lightning bolt!! Electric currents\n singe the party!"
8: "Acid!! A fine mist of volatile acid\n sprays the party!"
9: "Ice storm!! Particles of splintered ice\n hail through the air!"
10: "Death ray!! A blinding light sears\n through the party!"
unlock:
who_will_try: "who will try '1'-'%c'?"
success: "success!"
failed: "unlock failed!"
who_will_try: "Who will try '1'-'%c'?"
success: "Success!"
failed: "Unlock failed!"
view_characters:
title: "view all characters"
title: "View all characters"
legend1: "'a'-'%c' to view a character"
view_character:
rename: "(ctrl)-'n' re-name character"
delete: "(ctrl)-'d' delete character"
are_you_sure: " are you sure (Y/N)? "
name: "name: "
rename: "(Ctrl)-'N' Re-name character"
delete: "(Ctrl)-'D' Delete character"
are_you_sure: " Are you sure (Y/N)? "
name: "Name: "
game:
commands:
1: " commands"
@ -305,14 +305,14 @@ dialogs:
15: "q quikref"
16: "# view ch"
rest:
too_dangerous: "*** too dangerous to rest here!"
rest_here: "rest here (Y/N)?"
rest_complete: "rest complete: no encounters!"
too_dangerous: "*** Too dangerous to rest here!"
rest_here: "Rest here (Y/N)?"
rest_complete: "Rest complete: no encounters!"
misc:
go_back: "'esc' to go back"
no_characters: "no available characters"
some_characters: "available characters"
full: "*** backpack full ***"
go_back: "'Esc' to go back"
no_characters: "No available characters"
some_characters: "Available characters"
full: "*** Backpack full ***"
spells:
detect_charges: "magic (charges)"
fly_to_x: "fly to (a-e): "
@ -485,7 +485,8 @@ enhdialogs:
store: "store"
options: "options"
options_for: "options for"
gold: "gold"
gold: "Gold"
esc: "Esc"
map:
north: "North"
south: "South"
@ -514,11 +515,11 @@ enhdialogs:
exit: "Exit"
non_caster: "Not a spell caster..."
temple:
title: "temple"
heal: "\x01""37heal"
donate: "\x01""37donate"
uncurse: "\x01""37uncurse"
realign: "\x01""37re-align"
title: "Temple"
heal: "\x01""37Heal"
donate: "\x01""37Donate"
uncurse: "\x01""37Uncurse"
realign: "\x01""37Re-align"
stats:
none: "None"
inventory: "-----<Equipped>----------<Backpack>----"
@ -1094,7 +1095,7 @@ maps:
blacksmith_inside: "A man wearing a leather apron speaks:\n\"Distinguished travelers, you've come to\nthe right place. Can I help you (Y/N)?\""
inn_inside: "The innekeeper asks: \"Would you like to sign in (Y/N)?\""
market_inside: "Behind the counter, an overweight dwarf\nexclaims: \"You look like a hungry bunch!\nWould you like to buy some food (Y/N)?\""
temple_inside: "Several orantely robed clerics approach\nthe party and ask, \"Do you seek our help (Y/N)?\""
temple_inside: "Several ornately robed clerics approach\nthe party and ask, \"Do you seek our help (Y/N)?\""
training_inside: "Before you are various groups engaged in\ntraining exercises. Worg,the guildmaster\nasks, \"Do you require training (Y/N)?\""
leprechaun: "A tenacious leprechaun appears saying,\n\"Traveling the roads is quite dangerous\nsave for the strong and courageous,\nonly 1 gem you lose and i'll send you\nto the town you choose.\"\n\n'ESC' to go back Which town (1-5)?"

View File

@ -29,9 +29,9 @@ namespace MM1 {
namespace ViewsEnh {
namespace Locations {
Location::Location(const Common::String &name) :
ScrollView(name) {
Location::Location(const Common::String &name) : PartyView(name) {
_bounds = Common::Rect(232, 0, 320, 146);
_escSprite.load("esc.icn");
}
void Location::leave() {
@ -46,14 +46,6 @@ void Location::displayMessage(const Common::String &msg) {
writeLine(3, msg, ALIGN_MIDDLE);
}
void Location::changeCharacter(uint index) {
if (index >= g_globals->_party.size())
return;
g_globals->_currCharacter = &g_globals->_party[index];
redraw();
}
bool Location::subtractGold(uint amount) {
if (g_globals->_currCharacter->_gold < amount) {
notEnoughGold();

View File

@ -22,14 +22,18 @@
#ifndef MM1_VIEWS_ENH_LOCATIONS_LOCATION_H
#define MM1_VIEWS_ENH_LOCATIONS_LOCATION_H
#include "mm/mm1/views_enh/scroll_view.h"
#include "mm/mm1/views_enh/party_view.h"
#include "mm/shared/xeen/sprites.h"
namespace MM {
namespace MM1 {
namespace ViewsEnh {
namespace Locations {
class Location : public ScrollView {
class Location : public PartyView {
protected:
Shared::Xeen::SpriteResource _escSprite;
protected:
/**
* Called when an active timeout countdown expired
@ -38,11 +42,6 @@ protected:
leave();
}
/**
* Change character
*/
virtual void changeCharacter(uint index);
/**
* Subtract gold from current character
*/

View File

@ -31,28 +31,21 @@ namespace ViewsEnh {
namespace Locations {
Temple::Temple() : Location("Temple") {
addButton(&g_globals->_confirmIcons,
Common::Point(_innerBounds.width() / 2 - 24,
_innerBounds.height() - 32),
0, Common::KEYCODE_y);
addButton(&_escSprite, Common::Point(24, 100), 0, KEYBIND_ESCAPE);
}
bool Temple::msgFocus(const FocusMessage &msg) {
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_PARTY_MENUS);
(void)Location::msgFocus(msg);
send("View", ValueMessage(LOC_TEMPLE));
changeCharacter(0);
updateCosts();
return true;
}
bool Temple::msgUnfocus(const UnfocusMessage &msg) {
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
return true;
}
void Temple::draw() {
Location::draw();
setReduced(false);
writeLine(0, STRING["enhdialogs.temple.title"], ALIGN_MIDDLE);
writeLine(1, STRING["enhdialogs.location.options_for"], ALIGN_MIDDLE);
writeLine(3, camelCase(g_globals->_currCharacter->_name), ALIGN_MIDDLE);
@ -74,11 +67,14 @@ void Temple::draw() {
ALIGN_RIGHT);
writeLine(8, Common::String::format("%d", _donateCost).c_str(),
ALIGN_RIGHT);
setReduced(false);
setReduced(false);
writeLine(10, STRING["enhdialogs.location.gold"]);
writeLine(10, Common::String::format("%d",
g_globals->_currCharacter->_gold), ALIGN_RIGHT);
setReduced(true);
writeString(27, 122, STRING["enhdialogs.location.esc"]);
}
bool Temple::msgKeypress(const KeypressMessage &msg) {
@ -100,7 +96,7 @@ bool Temple::msgKeypress(const KeypressMessage &msg) {
redraw();
break;
default:
break;
return Location::msgKeypress(msg);
}
return true;
@ -111,29 +107,21 @@ bool Temple::msgAction(const ActionMessage &msg) {
case KEYBIND_ESCAPE:
leave();
return true;
case KEYBIND_VIEW_PARTY1:
case KEYBIND_VIEW_PARTY2:
case KEYBIND_VIEW_PARTY3:
case KEYBIND_VIEW_PARTY4:
case KEYBIND_VIEW_PARTY5:
case KEYBIND_VIEW_PARTY6:
changeCharacter(msg._action - KEYBIND_VIEW_PARTY1);
return true;
default:
break;
return Location::msgAction(msg);;
}
return false;
}
void Temple::changeCharacter(uint index) {
bool Temple::msgGame(const GameMessage &msg) {
Location::msgGame(msg);
if (msg._name == "UPDATE")
updateCosts();
return true;
}
void Temple::updateCosts() {
Maps::Map &map = *g_maps->_currentMap;
int i;
if (index >= g_globals->_party.size())
return;
Location::changeCharacter(index);
_isEradicated = false;
int townNum = map[Maps::MAP_ID];

View File

@ -37,25 +37,20 @@ private:
int _healCost = 0, _uncurseCost = 0;
int _alignmentCost = 0, _donateCost = 0;
private:
void updateCosts();
void restoreHealth();
void uncurseItems();
void restoreAlignment();
void donate();
protected:
/**
* Change character
*/
void changeCharacter(uint index) override;
public:
Temple();
bool msgFocus(const FocusMessage &msg) override;
bool msgUnfocus(const UnfocusMessage &msg) override;
void draw() override;
bool msgKeypress(const KeypressMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
bool msgGame(const GameMessage &msg) override;
};
} // namespace Locations