Some other tweaks and fixes got pulled in along the way. Details: - Improved const-correctness - The scenario is now part of the universe, so now there's no global scenario object in the game or the PC editor. (Of course, the scenario editor has no universe, so it still has a global scenario object.) - Towns and outdoors now store a reference to the scenario; the party, current town, and current outdoors store a reference to the universe. Altogether this means that the data module has no need for global scenario or universe objects. - The fileio routines now take a scenario or universe reference as a parameter, so they don't need the global scenario or universe objects either. - cCurOut now has an arrow operator for accessing the current outdoor section, instead of a 2x2 subset of the outdoors; this replaces using i_w_c to index the 2x2 subset. (And it's much less verbose!) - cCurTown no longer stores a pointer to the town record, since it can simply access it through the universe instance which it stores a reference to. - Tweaked how the monster roster menu works (it now caches up to 60 monsters) - The operator= functions that convert from legacy to new scenario/save format are now ordinary functions rather than operators. - The bizarre use of assigning a cCreature to itself to populate certain fields has been nuked. - When at the corner of an outdoor sector, the scenario editor now shows the cornermost terrain in the diagonally adjacent sector. - There was a missing check to prevent horses entering dangerous terrain (eg, swamp) while in town. - Fix cancelling load party dialog causing a party to appear
109 lines
2.5 KiB
C++
109 lines
2.5 KiB
C++
/*
|
|
* item.h
|
|
* BoE
|
|
*
|
|
* Created by Celtic Minstrel on 20/04/09.
|
|
*
|
|
*/
|
|
|
|
#ifndef BOE_DATA_ITEM_H
|
|
#define BOE_DATA_ITEM_H
|
|
|
|
#include <string>
|
|
#include <iosfwd>
|
|
|
|
#include "location.h"
|
|
#include "simpletypes.h"
|
|
|
|
namespace legacy { struct item_record_type; };
|
|
|
|
class cItemRec {
|
|
public:
|
|
eItemType variety;
|
|
short item_level;
|
|
int awkward;
|
|
int bonus;
|
|
int protection;
|
|
int charges;
|
|
eSkill type;
|
|
int magic_use_type;
|
|
unsigned short graphic_num;
|
|
eItemAbil ability;
|
|
unsigned int ability_strength;
|
|
unsigned short type_flag;
|
|
unsigned int is_special;
|
|
short value;
|
|
unsigned int weight;
|
|
unsigned int special_class;
|
|
location item_loc;
|
|
std::string full_name;
|
|
std::string name;
|
|
unsigned int treas_class;
|
|
//unsigned char item_properties;
|
|
bool ident : 1;
|
|
bool property : 1;
|
|
bool magic : 1;
|
|
bool contained : 1;
|
|
bool cursed : 1;
|
|
bool concealed : 1;
|
|
bool enchanted : 1;
|
|
bool unsellable : 1;
|
|
private:
|
|
unsigned int reserved1;
|
|
unsigned int reserved2;
|
|
public:
|
|
//string desc; // for future use
|
|
unsigned char rec_treas_class() const;
|
|
// bool is_ident() const;
|
|
// bool is_property() const;
|
|
// bool is_magic() const;
|
|
// bool is_contained() const;
|
|
// bool is_cursed() const;
|
|
// bool is_concealed() const;
|
|
// bool is_enchanted() const;
|
|
// void set_ident(bool b);
|
|
// void set_property(bool b);
|
|
// void set_magic(bool b);
|
|
// void set_contained(bool b);
|
|
// void set_cursed(bool b);
|
|
// void set_concealed(bool b);
|
|
// void set_enchanted(bool b);
|
|
short item_weight() const;
|
|
|
|
cItemRec();
|
|
cItemRec(long preset);
|
|
void append(legacy::item_record_type& old);
|
|
void writeTo(std::ostream& file, std::string prefix = "") const;
|
|
void readFrom(std::istream& sin);
|
|
};
|
|
|
|
std::ostream& operator << (std::ostream& out, eItemType e);
|
|
std::ostream& operator << (std::ostream& out, eItemAbil e);
|
|
std::istream& operator >> (std::istream& in, eItemType& e);
|
|
std::istream& operator >> (std::istream& in, eItemAbil& e);
|
|
std::ostream& operator << (std::ostream& out, eSkill e);
|
|
std::istream& operator >> (std::istream& in, eSkill& e);
|
|
|
|
class cSpecItem {
|
|
public:
|
|
short flags;
|
|
short special;
|
|
std::string name;
|
|
std::string descr;
|
|
};
|
|
|
|
/*
|
|
typedef struct {
|
|
short variety, item_level;
|
|
char awkward, bonus, protection, charges, type;
|
|
unsigned char graphic_num,ability, type_flag, is_special;
|
|
short value;
|
|
bool identified, magic;
|
|
unsigned char weight, description_flag;
|
|
char full_name[25], name[15];
|
|
unsigned char reserved1,reserved2;
|
|
unsigned char magic_use_type, ability_strength, treas_class, real_abil;
|
|
} short_item_record_type;
|
|
*/
|
|
|
|
#endif |