ULTIMA1: Added Merchant widget class

This commit is contained in:
Paul Gilbert 2020-01-19 08:08:59 -08:00 committed by Paul Gilbert
parent 9402c70150
commit 49b5e97268
10 changed files with 102 additions and 13 deletions

View File

@ -79,6 +79,7 @@ MODULE_OBJS += \
ultima1/widgets/guard.o \
ultima1/widgets/hit.o \
ultima1/widgets/king.o \
ultima1/widgets/merchant.o \
ultima1/widgets/overworld_monster.o \
ultima1/widgets/person.o \
ultima1/widgets/princess.o \

View File

@ -27,6 +27,7 @@
#include "ultima/ultima1/widgets/bard.h"
#include "ultima/ultima1/widgets/guard.h"
#include "ultima/ultima1/widgets/king.h"
#include "ultima/ultima1/widgets/merchant.h"
#include "ultima/ultima1/widgets/princess.h"
#include "ultima/ultima1/widgets/wench.h"
@ -68,6 +69,9 @@ void MapCityCastle::loadWidgets() {
case 20:
person = new Widgets::King(_game, this, lp[3]);
break;
case 21:
person = new Widgets::Merchant(_game, this, lp[3]);
break;
case 22:
person = new Widgets::Princess(_game, this, lp[3]);
break;

View File

@ -20,8 +20,8 @@
*
*/
#ifndef ULTIMA_ULTIMA1_PEOPLE_BARD_H
#define ULTIMA_ULTIMA1_PEOPLE_BARD_H
#ifndef ULTIMA_ULTIMA1_WIDGETS_BARD_H
#define ULTIMA_ULTIMA1_WIDGETS_BARD_H
#include "ultima/ultima1/widgets/person.h"

View File

@ -20,8 +20,8 @@
*
*/
#ifndef ULTIMA_ULTIMA1_PEOPLE_GUARD_H
#define ULTIMA_ULTIMA1_PEOPLE_GUARD_H
#ifndef ULTIMA_ULTIMA1_WIDGETS_GUARD_H
#define ULTIMA_ULTIMA1_WIDGETS_GUARD_H
#include "ultima/ultima1/widgets/person.h"

View File

@ -20,8 +20,8 @@
*
*/
#ifndef ULTIMA_ULTIMA1_PEOPLE_KING_H
#define ULTIMA_ULTIMA1_PEOPLE_KING_H
#ifndef ULTIMA_ULTIMA1_WIDGETS_KING_H
#define ULTIMA_ULTIMA1_WIDGETS_KING_H
#include "ultima/ultima1/widgets/person.h"

View File

@ -0,0 +1,32 @@
/* 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 "ultima/ultima1/widgets/merchant.h"
namespace Ultima {
namespace Ultima1 {
namespace Widgets {
} // End of namespace Widgets
} // End of namespace Ultima1
} // End of namespace Ultima

View File

@ -0,0 +1,52 @@
/* 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.
*
*/
#ifndef ULTIMA_ULTIMA1_WIDGETS_MERCHANT_H
#define ULTIMA_ULTIMA1_WIDGETS_MERCHANT_H
#include "ultima/ultima1/widgets/person.h"
namespace Ultima {
namespace Ultima1 {
namespace Widgets {
class Merchant : public Person {
public:
/**
* Constructor
*/
Merchant(Ultima1Game *game, Map::Ultima1Map::MapBase *map, int hitPoints) :
Person(game, map, 50, hitPoints) {}
Merchant(Ultima1Game *game, Map::Ultima1Map::MapBase *map, uint tileNum, int hitPoints) :
Person(game, map, tileNum, hitPoints) {}
/**
* Destructor
*/
virtual ~Merchant() {}
};
} // End of namespace Widgets
} // End of namespace Ultima1
} // End of namespace Ultima
#endif

View File

@ -20,8 +20,8 @@
*
*/
#ifndef ULTIMA_ULTIMA1_PEOPLE_PERSON_H
#define ULTIMA_ULTIMA1_PEOPLE_PERSON_H
#ifndef ULTIMA_ULTIMA1_WIDGETS_PERSON_H
#define ULTIMA_ULTIMA1_WIDGETS_PERSON_H
#include "ultima/ultima1/map/map.h"
#include "ultima/ultima1/game.h"
@ -66,7 +66,7 @@ public:
* Constructor
*/
Person(Ultima1Game *game, Map::Ultima1Map::MapBase *map, uint tileNum, int hitPoints) :
Shared::Creature(game, map, hitPoints), _tileNum(tileNum) {}
Shared::Creature(game, map, hitPoints), _game(game), _map(map), _tileNum(tileNum) {}
/**
* Destructor

View File

@ -20,8 +20,8 @@
*
*/
#ifndef ULTIMA_ULTIMA1_PEOPLE_PRINCESS_H
#define ULTIMA_ULTIMA1_PEOPLE_PRINCESS_H
#ifndef ULTIMA_ULTIMA1_WIDGETS_PRINCESS_H
#define ULTIMA_ULTIMA1_WIDGETS_PRINCESS_H
#include "ultima/ultima1/widgets/wench.h"

View File

@ -20,8 +20,8 @@
*
*/
#ifndef ULTIMA_ULTIMA1_PEOPLE_WENCH_H
#define ULTIMA_ULTIMA1_PEOPLE_WENCH_H
#ifndef ULTIMA_ULTIMA1_WIDGETS_WENCH_H
#define ULTIMA_ULTIMA1_WIDGETS_WENCH_H
#include "ultima/ultima1/widgets/person.h"