Files
oboe/osx/classes/scenario.h
Celtic Minstrel 5249c6eef7 Add a lot of stuff scraped from *i's version of the code, plus a couple of additional bits.
Adapted from *i:
- Show a confirm dialog when interrupting a special node sequence
- New monster special ability: call global special node (as an action, not on death)
- New item special ability: call global special node
- Check there's a monster death special before calling it (wasn't necessary before, might be now with the special queue changes)
- Queue specials that are triggered while another special is in progress, instead of ignoring them; they will be run after the current special in progress finishes.
- *i's version of petrification touch is currently active only for monster-on-monster combat; need to merge with my version for monster-on-pc combat.
- Pass party location to special in use special item context
- Fix set town visibility node (was checking wrong field and thus could not hide towns)
Special nodes:
- Town Hostile: change to Set Town Attitude
- Select PC node: option to select random PC
- Affect special nodes can now affect monsters
- Fix affect death node reviving non-existent PCs
- Affect Spells: Can remove spells, and can affect level 1-3 spells
- If Objects: Merged from If Barrels and If Crates
- If Species: Replaces If Cave Lore
- If Trait: Replaces If Woodsman
- If Statistic: Replaces If Enough Mage Lore
- Change Lighting: Can affect town's global lighting setting, player's light level, or both at once.
- Pointers! Actually, I'd already implemented the callbacks for setting and getting them, but they're now actually used, and the implementation has been tweaked a little.
- Campaign flags! Again, I'd already implemented them sorta, but I tweaked things and they ended up sort of halfway between the two implementations. Plus there's now a special node to set them.

Additional bits:
- Special queue now uses an std::queue instead of a basic array.
- Enum for town lighting levels
- Disease touch ability is now honoured for monster-on-monster combat
- See monster special context now passes the monster's location as the trigger location; also, removed the double-trigger from one circumstance.
- Along with the set town attitude change, there's now the possibility for making the town hostile to trigger a special node, which can cause the party to be slain.
- Select PC special node: option to select specific PC
- Spell IDs for use in shops and Affect Spell nodes have changed so that 0 is now the first level 1 spell, and so forth.
- add_string_to_buf can now auto-split the string over multiple lines, and the special node that uses it takes advantage of this
- Special node parser warns if a node type is missing a corresponding opcode
- Reserved "pointers" to access the special node's trigger location (this was *i's idea, but he never implemented it)
2014-12-08 01:08:30 -05:00

114 lines
2.8 KiB
C++

/*
* scenario.h
* BoE
*
* Created by Celtic Minstrel on 20/04/09.
*
*/
#ifndef BOE_DATA_SCENARIO_H
#define BOE_DATA_SCENARIO_H
#include <iosfwd>
#include <boost/filesystem/path.hpp>
#include "terrain.h"
#include "monster.h"
#include "vehicle.h"
#include "item.h"
#include "special.h"
#include "outdoors.h"
#include "town.h"
namespace fs = boost::filesystem; // TODO: Centralize this namespace alias?
namespace legacy{
struct scenario_data_type;
struct item_storage_shortcut_type;
struct scen_item_data_type;
};
struct scenario_header_flags {
unsigned char flag1, flag2, flag3, flag4;
unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
};
class cScenario {
public:
class cItemStorage {
public:
short ter_type;
short item_num[10];
short item_odds[10];
short property;
cItemStorage();
cItemStorage& operator = (legacy::item_storage_shortcut_type& old);
};
public:
//unsigned char flag1, flag2, flag3, flag4;
unsigned char num_towns;
unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
unsigned char town_size[200];
unsigned char town_hidden[200];
short flag_a; // TODO: Remove these flags
short intro_mess_pic,intro_mess_len;
location where_start,out_sec_start,out_start;
short which_town_start;
short flag_b;
short town_data_size[200][5];
short town_to_add_to[10];
short flag_to_add_to_town[10][2];
short flag_c;
short out_data_size[100][2];
rectangle store_item_rects[3];
short store_item_towns[3];
short flag_e;
cSpecItem special_items[50];
short rating,uses_custom_graphics;
short flag_f;
cMonster scen_monsters[256];
cVehicle boats[30];
cVehicle horses[30];
short flag_g;
cTerrain ter_types[256];
short scenario_timer_times[20];
short scenario_timer_specs[20];
short flag_h;
cSpecial scen_specials[256];
cItemStorage storage_shortcuts[10];
short flag_d;
unsigned char scen_str_len[300];
short flag_i;
location last_out_edited;
short last_town_edited;
scenario_header_flags format;
std::string campaign_id; // A hopefully unique identifier to specify the campaign this scenario is a part of.
// scen_item_data_type scen_item_list {
cItemRec scen_items[400];
//char monst_names[256][20];
//char ter_names[256][30];
// };
//char scen_strs[270][256];
char scen_name[256];
char who_wrote[2][256];
char contact_info[256];
char intro_strs[6][256];
char journal_strs[50][256];
char spec_strs[100][256];
char monst_strs[100][256];
bool adjust_diff : 1;
char : 7;
bool is_legacy;
fs::path scen_file; // transient
cOutdoors* outdoors;
cTown* towns;
__declspec(deprecated) char(& scen_strs(short i))[256];
cScenario& operator = (legacy::scenario_data_type& old);
void append(legacy::scen_item_data_type& old);
void writeTo(std::ostream& file);
};
// OBoE Current Version
const unsigned long long OBOE_CURRENT_VERSION = 0x010000; // MMmmff; M - major, m - minor, f - bugfix
#endif