diff --git a/src/boe.combat.cpp b/src/boe.combat.cpp index 6a74a18f..3c5b35f5 100644 --- a/src/boe.combat.cpp +++ b/src/boe.combat.cpp @@ -50,7 +50,7 @@ short missile_inv_slot, ammo_inv_slot; short force_wall_position = 10; // 10 -> no force wall bool processing_fields = true; short futzing; -m_num_t store_sum_monst; +mon_num_t store_sum_monst; short store_sum_monst_cost; extern cUniverse univ; @@ -871,7 +871,7 @@ void do_combat_cast(location target) { CLOUD_STINK,CLOUD_STINK, WALL_ICE,WALL_ICE,WALL_BLADES, }; - m_num_t summon; + mon_num_t summon; location ashes_loc; diff --git a/src/boe.dlgutil.cpp b/src/boe.dlgutil.cpp index 8355e5ec..c2df5232 100644 --- a/src/boe.dlgutil.cpp +++ b/src/boe.dlgutil.cpp @@ -68,7 +68,7 @@ sf::RenderTexture talk_gworld; bool talk_end_forced; rectangle talk_area_rect = {5,5,420,284}, word_place_rect = {44,7,372,257},talk_help_rect = {5,254,21,272}; std::string title_string; -m_num_t store_monst_type; +mon_num_t store_monst_type; short store_m_num; rectangle dummy_rect = {0,0,0,0}; short strnum1,strnum2,oldstrnum1,oldstrnum2; @@ -421,7 +421,7 @@ void set_up_shop_array(eShopType store_shop_type, short store_shop_min, short st shop_sbar->setMaximum(active_shop.size() - 8); } -void start_talk_mode(short m_num,short personality,m_num_t monst_type,short store_face_pic) { +void start_talk_mode(short m_num,short personality,mon_num_t monst_type,short store_face_pic) { rectangle area_rect; std::string place_string1; diff --git a/src/boe.dlgutil.h b/src/boe.dlgutil.h index 4f060fdb..ef16dad7 100644 --- a/src/boe.dlgutil.h +++ b/src/boe.dlgutil.h @@ -12,7 +12,7 @@ void handle_shop_event(location p); void handle_sale(cShopItem item, int i); void handle_info_request(cShopItem item); void set_up_shop_array(eShopType shop_type, short shop_min, short shop_max); -void start_talk_mode(short m_num,short personality,m_num_t monst_type,short store_face_pic); +void start_talk_mode(short m_num,short personality,mon_num_t monst_type,short store_face_pic); void end_talk_mode(); void handle_talk_event(location p); void handle_talk_spec(short ttype,char* place_string1,char* place_string2); diff --git a/src/boe.items.cpp b/src/boe.items.cpp index 047dc5ca..0430e2a1 100644 --- a/src/boe.items.cpp +++ b/src/boe.items.cpp @@ -1154,7 +1154,7 @@ void make_cursor_watch() { set_cursor(watch_curs); } -void place_glands(location where,m_num_t m_type) { +void place_glands(location where,mon_num_t m_type) { cItem store_i; cMonster monst; diff --git a/src/boe.items.h b/src/boe.items.h index 124e30c4..1e27b23a 100644 --- a/src/boe.items.h +++ b/src/boe.items.h @@ -46,7 +46,7 @@ void put_pc_effects_on_dialog(cDialog& dialog,short item); void draw_help_dialog_item_buttons(cDialog& dialog,short item); void draw_help_dialog_forcefields(cDialog& dialog,short item); void make_cursor_watch() ; -void place_glands(location where,m_num_t m_type); +void place_glands(location where,mon_num_t m_type); short party_total_level() ; void reset_item_max(); short item_val(cItem item); diff --git a/src/boe.monster.cpp b/src/boe.monster.cpp index e554fe6b..d0fa5933 100644 --- a/src/boe.monster.cpp +++ b/src/boe.monster.cpp @@ -125,12 +125,12 @@ location get_monst_head(short m_num) { return l; } -short get_monst_picnum(m_num_t monst) { +short get_monst_picnum(mon_num_t monst) { if(monst >= 10000) return univ.party.summons[monst - 10000].picture_num; return univ.scenario.scen_monsters[monst].picture_num; } -ePicType get_monst_pictype(m_num_t monst) { +ePicType get_monst_pictype(mon_num_t monst) { ePicType type = PIC_MONST; short n; if(monst >= 10000) @@ -157,7 +157,7 @@ ePicType get_monst_pictype(m_num_t monst) { return type; } -void get_monst_dims(m_num_t monst,short *width, short *height) { +void get_monst_dims(mon_num_t monst,short *width, short *height) { cMonster& the_monst = monst >= 10000 ? univ.party.summons[monst - 10000] : univ.scenario.scen_monsters[monst]; *width = the_monst.x_width; *height = the_monst.y_width; @@ -165,7 +165,7 @@ void get_monst_dims(m_num_t monst,short *width, short *height) { // Used to set up monsters for outdoor wandering encounters. //mode; // 0 - unfriendly 1 - friendly & fightin' -void set_up_monst(short mode,m_num_t m_num) { +void set_up_monst(short mode,mon_num_t m_num) { short which; for(which = 0; which < univ.town->max_monst(); which++) @@ -571,7 +571,7 @@ short switch_target_to_adjacent(short which_m,short orig_target) { } -bool rand_move(m_num_t i) { +bool rand_move(mon_num_t i) { bool acted_yet = false; short j; location store_loc; @@ -1074,7 +1074,7 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon return can_enter; } -void forced_place_monster(m_num_t which,location where) { +void forced_place_monster(mon_num_t which,location where) { // TODO: Windows version has logic to destroy unimportant monsters to make room, but the real issue here is the non-dynamic nature of the monster array, so a better fix would be to use an std::vector in cPopulation... and then this function wouldn't even be needed. bool free_spot = false; short i = 0,r1; @@ -1281,7 +1281,7 @@ void record_monst(cCreature *which_m) { } // returns 90 is no placement, OW returns # of spot -short place_monster(m_num_t which,location where) { +short place_monster(mon_num_t which,location where) { short i = 0; while((i < univ.town->max_monst()) && ((univ.town.monst[i].active != 0) || @@ -1315,7 +1315,7 @@ short place_monster(m_num_t which,location where) { // returns true if placement was successful //which; // if in town, this is caster loc., if in combat, this is where to try // to put monster -bool summon_monster(m_num_t which,location where,short duration,short given_attitude) { +bool summon_monster(mon_num_t which,location where,short duration,short given_attitude) { location loc; short which_m,spot; @@ -1394,7 +1394,7 @@ short get_encumberance(short pc_num) { return store; } -m_num_t get_summon_monster(short summon_class) { +mon_num_t get_summon_monster(short summon_class) { short i,j; for(i = 0; i < 200; i++) { diff --git a/src/boe.monster.h b/src/boe.monster.h index 2d79485f..aa8ed0b7 100644 --- a/src/boe.monster.h +++ b/src/boe.monster.h @@ -5,10 +5,10 @@ short out_enc_lev_tot(short which); void create_wand_monst(); void place_outd_wand_monst(location where,cOutdoors::cWandering group,short forced); location get_monst_head(short m_num); -short get_monst_picnum(m_num_t monst); -ePicType get_monst_pictype(m_num_t monst); -void get_monst_dims(m_num_t monst,short *width, short *height); -void set_up_monst(short mode,m_num_t m_num); +short get_monst_picnum(mon_num_t monst); +ePicType get_monst_pictype(mon_num_t monst); +void get_monst_dims(mon_num_t monst,short *width, short *height); +void set_up_monst(short mode,mon_num_t m_num); void do_monsters(); bool monst_hate_spot(short which_m,location *good_loc); short monst_pick_target(short which_m); @@ -18,7 +18,7 @@ short select_active_pc(); short closest_pc(location where); short closest_monst(location where,short mode); short switch_target_to_adjacent(short which_m,short orig_target); -bool rand_move(m_num_t i); +bool rand_move(mon_num_t i); bool seek_party(short i,location l1,location l2); bool flee_party(short i,location l1,location l2); bool try_move(short i,location start,short x,short y); @@ -31,7 +31,7 @@ bool town_move_monster(short num,location dest); bool monster_placid(short m_num); void monst_inflict_fields(short which_monst); bool monst_check_special_terrain(location where_check,short mode,short which_monst); -void forced_place_monster(m_num_t which,location where); +void forced_place_monster(mon_num_t which,location where); void magic_adjust(cCreature *which_m,short *how_much); void poison_monst(cCreature *which_m,short how_much); void acid_monst(cCreature *which_m,short how_much); @@ -43,8 +43,8 @@ void disease_monst(cCreature *which_m,short how_much); void dumbfound_monst(cCreature *which_m,short how_much); void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amount); void record_monst(cCreature *which_m); -short place_monster(m_num_t which,location where); -bool summon_monster(m_num_t which,location where,short duration,short given_attitude); +short place_monster(mon_num_t which,location where); +bool summon_monster(mon_num_t which,location where,short duration,short given_attitude); void activate_monsters(short code,short attitude); short get_encumberance(short pc_num); -m_num_t get_summon_monster(short summon_class); +mon_num_t get_summon_monster(short summon_class); diff --git a/src/boe.newgraph.cpp b/src/boe.newgraph.cpp index d8b0d3ac..5cb22b28 100644 --- a/src/boe.newgraph.cpp +++ b/src/boe.newgraph.cpp @@ -75,7 +75,7 @@ extern bool talk_end_forced; extern std::string old_str1,old_str2,one_back1,one_back2; extern rectangle talk_area_rect, word_place_rect,talk_help_rect; extern std::string title_string; -extern m_num_t store_monst_type; +extern mon_num_t store_monst_type; std::vector talk_words; // Shop vars diff --git a/src/boe.party.cpp b/src/boe.party.cpp index 06f7e8e6..e8345760 100644 --- a/src/boe.party.cpp +++ b/src/boe.party.cpp @@ -2485,8 +2485,6 @@ static bool pc_name_event_filter(cDialog& me, short store_train_pc) { return true; } -//town_num; // Will be 0 - 200 for town, 200 - 290 for outdoors -//short sign_type; // terrain type bool pick_pc_name(short pc_num,cDialog* parent) { using namespace std::placeholders; make_cursor_sword(); @@ -2500,7 +2498,7 @@ bool pick_pc_name(short pc_num,cDialog* parent) { return 1; } -m_num_t pick_trapped_monst() { +mon_num_t pick_trapped_monst() { short i; std::string sp; cMonster get_monst; @@ -2515,7 +2513,7 @@ m_num_t pick_trapped_monst() { soulCrystal->getControl("pick" + n).hide(); } else { - m_num_t which = univ.party.imprisoned_monst[i]; + mon_num_t which = univ.party.imprisoned_monst[i]; sp = get_m_name(which); soulCrystal->getControl("slot" + n).setText(sp); get_monst = which >= 10000 ? univ.party.summons[which - 10000] : univ.scenario.scen_monsters[which]; diff --git a/src/boe.party.h b/src/boe.party.h index 1a0df9c2..4e51b27a 100644 --- a/src/boe.party.h +++ b/src/boe.party.h @@ -44,7 +44,7 @@ void do_alchemy(); short alch_choice(short pc_num); bool pick_pc_graphic(short pc_num,short mode,cDialog* parent_num); bool pick_pc_name(short pc_num,cDialog* parent) ; -m_num_t pick_trapped_monst() ; +mon_num_t pick_trapped_monst(); bool flying() ; void acid_pc(short which_pc,short how_much); void poison_pc(short which_pc,short how_much); diff --git a/src/boe.text.cpp b/src/boe.text.cpp index c5b108c7..c1bdd825 100644 --- a/src/boe.text.cpp +++ b/src/boe.text.cpp @@ -908,7 +908,7 @@ void notify_out_combat_began(cOutdoors::cWandering encounter,short *nums) { } } -std::string get_m_name(m_num_t num) { +std::string get_m_name(mon_num_t num) { if(num >= 10000) return univ.party.summons[num - 10000].m_name; return univ.scenario.scen_monsters[num].m_name; } @@ -922,13 +922,13 @@ std::string get_ter_name(ter_num_t num) { return store_name; } -void print_monst_name(m_num_t m_type) { +void print_monst_name(mon_num_t m_type) { std::string msg = get_m_name(m_type) + ':'; add_string_to_buf((char *) msg.c_str()); } //short target; // < 100 - pc >= 100 monst -void print_monst_attacks(m_num_t m_type,short target) { +void print_monst_attacks(mon_num_t m_type,short target) { std::string msg = get_m_name(m_type); msg += " attacks "; if(target < 100) @@ -946,13 +946,13 @@ void damaged_message(short damage,short type) { } // This prepares the monster's string for the text bar -std::string print_monster_going(m_num_t m_num,short ap) { +std::string print_monster_going(mon_num_t m_num,short ap) { std::ostringstream sout(get_m_name(m_num)); sout << " (ap: " << ap << ')'; return sout.str(); } -void monst_spell_note(m_num_t number,short which_mess) { +void monst_spell_note(mon_num_t number,short which_mess) { std::string msg = get_m_name(number); switch(which_mess) { case 1: @@ -1125,7 +1125,7 @@ void monst_spell_note(m_num_t number,short which_mess) { } //short type; // 0 - mage 1- priest -void monst_cast_spell_note(m_num_t number,eSpell spell) { +void monst_cast_spell_note(mon_num_t number,eSpell spell) { short spell_num = short(spell); std::string msg = get_m_name(number); msg += " casts:"; @@ -1135,14 +1135,14 @@ void monst_cast_spell_note(m_num_t number,eSpell spell) { add_string_to_buf((char *) msg.c_str()); } -void monst_breathe_note(m_num_t number) { +void monst_breathe_note(mon_num_t number) { std::string msg = get_m_name(number); msg += " breathes."; add_string_to_buf((char *) msg.c_str()); } -void monst_damaged_mes(short which_m,short how_much,short how_much_spec) { +void monst_damaged_mes(mon_num_t which_m,short how_much,short how_much_spec) { std::string msg = get_m_name(univ.town.monst[which_m].number); msg = " " + msg + " takes "; std::ostringstream sout(msg); @@ -1153,7 +1153,7 @@ void monst_damaged_mes(short which_m,short how_much,short how_much_spec) { add_string_to_buf((char *) msg.c_str()); } -void monst_killed_mes(short which_m) { +void monst_killed_mes(mon_num_t which_m) { std::string msg = get_m_name(univ.town.monst[which_m].number); msg = " " + msg + " dies."; add_string_to_buf((char *) msg.c_str()); diff --git a/src/boe.text.h b/src/boe.text.h index 8f61d0ee..14e1cdd7 100644 --- a/src/boe.text.h +++ b/src/boe.text.h @@ -17,17 +17,17 @@ short out_boat_there(location where); short town_horse_there(location where); short out_horse_there(location where); void notify_out_combat_began(cOutdoors::cWandering encounter,short *nums) ; -std::string get_m_name(m_num_t num); +std::string get_m_name(mon_num_t num); std::string get_ter_name(ter_num_t num); -void print_monst_name(m_num_t m_type); -void print_monst_attacks(m_num_t m_type,short target); +void print_monst_name(mon_num_t m_type); +void print_monst_attacks(mon_num_t m_type,short target); void damaged_message(short damage,short type); -std::string print_monster_going(m_num_t m_num,short ap); -void monst_spell_note(m_num_t number,short which_mess); -void monst_cast_spell_note(m_num_t number,eSpell spell); -void monst_breathe_note(m_num_t number); -void monst_damaged_mes(short which_m,short how_much,short how_much_spec); -void monst_killed_mes(short which_m); +std::string print_monster_going(mon_num_t m_num,short ap); +void monst_spell_note(mon_num_t number,short which_mess); +void monst_cast_spell_note(mon_num_t number,eSpell spell); +void monst_breathe_note(mon_num_t number); +void monst_damaged_mes(mon_num_t which_m,short how_much,short how_much_spec); +void monst_killed_mes(mon_num_t which_m); void print_nums(short a,short b,short c); short print_terrain(location space); void add_string_to_buf(std::string str, unsigned short indent = 0); // Set second paramater to nonzero to auto-split the line if it's too long diff --git a/src/classes/monster.h b/src/classes/monster.h index aab157cd..bf1ee986 100644 --- a/src/classes/monster.h +++ b/src/classes/monster.h @@ -177,7 +177,7 @@ public: class cCreature : public cMonster { public: unsigned long id; - m_num_t number; + mon_num_t number; short active, attitude; unsigned char start_attitude; location start_loc, cur_loc; diff --git a/src/classes/outdoors.h b/src/classes/outdoors.h index 2a380100..dd75ff28 100644 --- a/src/classes/outdoors.h +++ b/src/classes/outdoors.h @@ -31,8 +31,8 @@ class cOutdoors { public: class cWandering { // formerly out_wandering_type public: - m_num_t monst[7]; - m_num_t friendly[3]; + mon_num_t monst[7]; + mon_num_t friendly[3]; short spec_on_meet,spec_on_win,spec_on_flee,cant_flee; short end_spec1,end_spec2; diff --git a/src/classes/party.h b/src/classes/party.h index 6fc4b256..dba47aad 100644 --- a/src/classes/party.h +++ b/src/classes/party.h @@ -84,7 +84,7 @@ public: short in_horse; cOutdoors::cCreature out_c[10]; std::array,5> magic_store_items; - m_num_t imprisoned_monst[4]; // Soul Crystal + mon_num_t imprisoned_monst[4]; // Soul Crystal char m_noted[256]; // has the monster been scried? char m_seen[256]; // has the monster ever been seen? (this used to have the above meaning) std::vector journal; diff --git a/src/classes/simpletypes.h b/src/classes/simpletypes.h index 26280ea2..d3c1d727 100644 --- a/src/classes/simpletypes.h +++ b/src/classes/simpletypes.h @@ -9,7 +9,7 @@ #ifndef BOE_DATA_SIMPLETYPES_H #define BOE_DATA_SIMPLETYPES_H -typedef unsigned short m_num_t; +typedef unsigned short mon_num_t; typedef unsigned short ter_num_t; typedef signed short spec_num_t; typedef signed short item_num_t; diff --git a/src/classes/town.h b/src/classes/town.h index a9f0a14d..c64dd1b1 100644 --- a/src/classes/town.h +++ b/src/classes/town.h @@ -59,7 +59,7 @@ public: // }; class cWandering { // formerly wandering_type public: - m_num_t monst[4]; + mon_num_t monst[4]; bool isNull(); void append(legacy::wandering_type old); diff --git a/src/classes/universe.cpp b/src/classes/universe.cpp index 10114ef5..bcec7762 100644 --- a/src/classes/universe.cpp +++ b/src/classes/universe.cpp @@ -876,7 +876,7 @@ void cUniverse::check_item(cItem& item) { else if(item.graphic_num >= 1000) update_items[item.graphic_num - 1000].insert(&item); if(item.ability == eItemAbil::SUMMONING || item.ability == eItemAbil::MASS_SUMMONING) { - m_num_t monst = item.abil_data[0]; + mon_num_t monst = item.abil_data[0]; if(monst >= 10000) check_monst(party.summons[monst - 10000]); else check_monst(scenario.scen_monsters[monst]); @@ -978,15 +978,15 @@ void cUniverse::exportGraphics() { } void cUniverse::exportSummons() { - std::set used_monsters, need_monsters; - std::map> update_items; + std::set used_monsters, need_monsters; + std::map> update_items; for(int i = 0; i < 6; i++) { if(party[i].main_status == eMainStatus::ABSENT) continue; for(size_t j = 0; j < party[i].items.size(); j++) { if(party[i].items[j].variety == eItemType::NO_ITEM) continue; if(party[i].items[j].ability == eItemAbil::SUMMONING || party[i].items[j].ability == eItemAbil::MASS_SUMMONING) { - m_num_t monst = party[i].items[j].abil_data[0]; + mon_num_t monst = party[i].items[j].abil_data[0]; if(monst >= 10000) used_monsters.insert(monst - 10000); else { @@ -1000,7 +1000,7 @@ void cUniverse::exportSummons() { for(size_t j = 0; j < party.stored_items[i].size(); j++) { if(party.stored_items[i][j].variety == eItemType::NO_ITEM) continue; if(party.stored_items[i][j].ability == eItemAbil::SUMMONING||party.stored_items[i][j].ability == eItemAbil::MASS_SUMMONING) { - m_num_t monst = party.stored_items[i][j].abil_data[0]; + mon_num_t monst = party.stored_items[i][j].abil_data[0]; if(monst >= 10000) used_monsters.insert(monst - 10000); else { @@ -1023,8 +1023,8 @@ void cUniverse::exportSummons() { auto max = std::max_element(used_monsters.begin(), used_monsters.end()); party.summons.resize(*max + 1); } - for(m_num_t monst : need_monsters) { - m_num_t dest = -1; + for(mon_num_t monst : need_monsters) { + mon_num_t dest = -1; while(used_monsters.count(++dest)); used_monsters.insert(dest); if(dest < party.summons.size()) diff --git a/src/scenedit/scen.core.cpp b/src/scenedit/scen.core.cpp index d080b7f8..9791b9f7 100644 --- a/src/scenedit/scen.core.cpp +++ b/src/scenedit/scen.core.cpp @@ -348,7 +348,7 @@ short edit_ter_type(ter_num_t which_ter) { return 0; } -static void put_monst_info_in_dlog(cDialog& me, m_num_t which_monst) { +static void put_monst_info_in_dlog(cDialog& me, mon_num_t which_monst) { char str[256]; cMonster& store_monst = scenario.scen_monsters[which_monst];