Add three more map features to the map parser

This commit is contained in:
2015-01-22 20:23:49 -05:00
parent 34ee2b2c29
commit 5e21b8d4be
8 changed files with 26 additions and 9 deletions

View File

@@ -15,11 +15,13 @@
# add * to specify a wandering monster loc; 2*4 indicates all four locs are here
# 2*1 would be more normal if you have wandering monsters
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2@17,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
# @17 means that preset item number 17 is on this space; it can be applied multiple times, eg 2@17@9
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2&10,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
# use & to indicate a field is on the space; &10 specifies webs; it can be applied multiple times
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
@@ -38,10 +40,11 @@
2,2,2,2,2,2,2,2,2,2,2,2,2,122,122,122,122,122,122,122,122,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2~h2,2~H7,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2~h2,2~H7,2,2,2,2,2,2,2$12,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
# add a ~ to specify a boat or horse; following character is h for horse, b for boat
# uppercase indicates it's not the party's property, lowercase indicates it is
# the number is the horse number in the global list
# $12 means that preset creature number 12 is on the space
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2

View File

@@ -545,7 +545,7 @@ void pc_attack(short who_att,short target) {
dam_adj += 10;
}
// TODO: These should check abil_data[0], not item_level
if((skill_item = univ.party[who_att].has_abil_equip(eItemAbil::SKILL)) < 24) {
hit_adj += 5 * (univ.party[who_att].items[skill_item].item_level / 2 + 1);
dam_adj += univ.party[who_att].items[skill_item].item_level / 2;

View File

@@ -540,6 +540,8 @@ static void display_pc_info(cDialog& me, const short pc) {
if(!univ.party[pc].traits[eTrait::AMBIDEXTROUS] && weap2 < 24)
hit_adj -= 25;
// TODO: These should check abil_data[0] instead of item_level
// TODO: Perhaps dam_adj and hit_adj calculation should be moved into a function somewhere?
dam_adj = stat_adj(pc,eSkill::STRENGTH) + minmax(-8,8,univ.party[pc].status[eStatus::BLESS_CURSE]);
if((skill_item = univ.party[pc].has_abil_equip(eItemAbil::SKILL)) < 24) {
hit_adj += 5 * (univ.party[pc].items[skill_item].item_level / 2 + 1);

View File

@@ -73,6 +73,7 @@ void create_wand_monst() {
p_loc = univ.town->wandering_locs[r2];
p_loc.x += get_ran(1,0,4) - 2;
p_loc.y += get_ran(1,0,4) - 2;
// TODO: This contradicts the documentation which says only 1-2 are placed of the last monster
r3 = get_ran(1,0,3);
if(r3 >= 2 && !is_blocked(p_loc)) // place extra monsters?
place_monster(univ.town->wandering[r1].monst[3],p_loc);

View File

@@ -406,6 +406,8 @@ void start_town_mode(short which_town, short entry_dir) {
break;
}
}
// TODO: charges are unused! (Also, they're currently stored in ability, not in charges.)
if(town_toast)
univ.town.items[j].property = false;

View File

@@ -371,7 +371,7 @@ bool load_town(fs::path town_base, short which_town, cTown*& the_town) {
fname = base_fname + ".xml";
// Next, load in the town map.
fname = base_fname + ".map";
map_data map = load_map(town_base/fname);
map_data map = load_map(town_base/fname, true);
// Then load the town's special nodes.
fname = base_fname + ".spec";
// Load the town's special encounter strings
@@ -468,7 +468,7 @@ bool load_outdoors(fs::path out_base, location which_out,cOutdoors& the_out) {
fname = base_fname + ".xml";
// Next, load in the sector map.
fname = base_fname + ".map";
map_data map = load_map(out_base/fname);
map_data map = load_map(out_base/fname, false);
// Then load the sector's special nodes.
fname = base_fname + ".spec";
// Load the sector's special encounter strings

View File

@@ -13,7 +13,7 @@
using namespace std;
map_data load_map(fs::path path) {
map_data load_map(fs::path path, bool isTown) {
map_data data;
ifstream fin(path.string());
int row = 0;
@@ -53,8 +53,14 @@ map_data load_map(fs::path path) {
curFeature = eMapFeature::SPECIAL_NODE;
} else if(c == '!') {
curFeature = eMapFeature::SIGN;
} else if(c == '@') {
} else if(c == '@' && !isTown) {
curFeature = eMapFeature::TOWN;
} else if(c == '@' && isTown) {
curFeature = eMapFeature::ITEM;
} else if(c == '&' && isTown) {
curFeature = eMapFeature::FIELD;
} else if(c == '$') {
curFeature = eMapFeature::CREATURE;
} else if(c == '~') {
curFeature = eMapFeature::VEHICLE;
} else if(c == 'h' && curFeature == eMapFeature::VEHICLE) {

View File

@@ -29,6 +29,9 @@ enum class eMapFeature {
ENTRANCE_WEST,
ENTRANCE_SOUTH,
ENTRANCE_EAST,
ITEM,
CREATURE,
FIELD,
};
struct loc_compare {
@@ -43,6 +46,6 @@ struct map_data {
void addFeature(unsigned int x, unsigned int y, eMapFeature feature, int val = 0);
};
map_data load_map(fs::path path);
map_data load_map(fs::path path, bool isTown);
#endif