Add three more map features to the map parser
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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) {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user