diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-11-04 17:18:19 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-11-04 17:18:19 +0100 |
commit | 2d0488338ac2a0388167c9e8b73766ae8af1e8d4 (patch) | |
tree | c92aa786daa5e2f0782de9234d70fcb0fdfaf700 /crawl-ref/source/wiz-mon.cc | |
parent | 177cfa8d1158dd7c2ed8c995cf1ee706f1492f80 (diff) | |
parent | 59910180e554e796fe4a8b1f095f88dccbe0ac89 (diff) | |
download | crawl-ref-2d0488338ac2a0388167c9e8b73766ae8af1e8d4.tar.gz crawl-ref-2d0488338ac2a0388167c9e8b73766ae8af1e8d4.zip |
Merge branch 'master' into mon-pick
Merge commits instead of rerere suck, but not being able to comfortably use
the test rig sucks even more.
Diffstat (limited to 'crawl-ref/source/wiz-mon.cc')
-rw-r--r-- | crawl-ref/source/wiz-mon.cc | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc index beb8866fee..1d9713ca3f 100644 --- a/crawl-ref/source/wiz-mon.cc +++ b/crawl-ref/source/wiz-mon.cc @@ -14,14 +14,17 @@ #include "colour.h" #include "dbg-util.h" #include "delay.h" +#include "describe.h" #include "directn.h" #include "dungeon.h" #include "env.h" #include "files.h" #include "ghost.h" #include "invent.h" +#include "itemprop.h" #include "items.h" #include "jobs.h" +#include "libutil.h" #include "macro.h" #include "mapdef.h" #include "message.h" @@ -38,7 +41,10 @@ #include "showsymb.h" #include "spl-miscast.h" #include "spl-util.h" +#include "state.h" +#include "stuff.h" #include "terrain.h" +#include "unwind.h" #include "view.h" #include "viewmap.h" #include "wiz-dgn.h" @@ -178,11 +184,11 @@ void wizard_create_spec_monster_name() } mons_list mlist; - std::string err = mlist.add_mons(specs); + string err = mlist.add_mons(specs); if (!err.empty()) { - std::string newerr; + string newerr; // Try for a partial match, but not if the user accidentally entered // only a few letters. monster_type partial = get_monster_by_name(specs); @@ -377,7 +383,7 @@ static bool _sort_monster_list(int a, int b) void debug_list_monsters() { - std::vector<std::string> mons; + vector<string> mons; int nfound = 0; int mon_nums[MAX_MONSTERS]; @@ -385,12 +391,12 @@ void debug_list_monsters() for (int i = 0; i < MAX_MONSTERS; ++i) mon_nums[i] = i; - std::sort(mon_nums, mon_nums + MAX_MONSTERS, _sort_monster_list); + sort(mon_nums, mon_nums + MAX_MONSTERS, _sort_monster_list); int total_exp = 0, total_adj_exp = 0, total_nonuniq_exp = 0; - std::string prev_name = ""; - int count = 0; + string prev_name = ""; + int count = 0; for (int i = 0; i < MAX_MONSTERS; ++i) { @@ -402,7 +408,7 @@ void debug_list_monsters() if (!mi->alive()) continue; - std::string name = mi->name(DESC_PLAIN, true); + string name = mi->name(DESC_PLAIN, true); if (prev_name != name && count > 0) { @@ -502,7 +508,7 @@ void wizard_spawn_control() if (!cancelable_get_line(specs, sizeof(specs))) { - const int num = std::min(atoi(specs), max_spawn); + const int num = min(atoi(specs), max_spawn); if (num > 0) { int curr_rate = env.spawn_random_rate; @@ -579,7 +585,7 @@ void debug_stethoscope(int mon) // Print stats and other info. mprf(MSGCH_DIAGNOSTICS, "HD=%d (%u) HP=%d/%d AC=%d(%d) EV=%d MR=%d SP=%d " - "energy=%d%s%s mid=%u num=%d stealth=%d flags=%04"PRIx64, + "energy=%d%s%s mid=%u num=%d stealth=%d flags=%04" PRIx64, mons.hit_dice, mons.experience, mons.hit_points, mons.max_hit_points, @@ -647,7 +653,7 @@ void debug_stethoscope(int mon) mprf(MSGCH_DIAGNOSTICS, "ench: %s", mons.describe_enchantments().c_str()); - std::ostringstream spl; + ostringstream spl; const monster_spells &hspell_pass = mons.spells; bool found_spell = false; for (int k = 0; k < NUM_MONSTER_SPELL_SLOTS; ++k) @@ -824,7 +830,7 @@ void wizard_give_monster_item(monster* mon) int player_slot = prompt_invent_item("Give which item to monster?", MT_DROP, -1); - if (player_slot == PROMPT_ABORT) + if (prompt_failed(player_slot)) return; for (int i = 0; i < NUM_EQUIP; ++i) @@ -844,15 +850,15 @@ void wizard_give_monster_item(monster* mon) case OBJ_RODS: // Let wizard specify which slot to put weapon into via // inscriptions. - if (item.inscription.find("first") != std::string::npos - || item.inscription.find("primary") != std::string::npos) + if (item.inscription.find("first") != string::npos + || item.inscription.find("primary") != string::npos) { mpr("Putting weapon into primary slot by inscription"); mon_slot = MSLOT_WEAPON; break; } - else if (item.inscription.find("second") != std::string::npos - || item.inscription.find("alt") != std::string::npos) + else if (item.inscription.find("second") != string::npos + || item.inscription.find("alt") != string::npos) { mpr("Putting weapon into alt slot by inscription"); mon_slot = MSLOT_ALT_WEAPON; @@ -1271,8 +1277,8 @@ void debug_pathfind(int idx) bool success = mp.init_pathfind(&mon, dest, true, true); if (success) { - std::vector<coord_def> path = mp.backtrack(); - std::string path_str; + vector<coord_def> path = mp.backtrack(); + string path_str; mpr("Here's the shortest path: "); for (unsigned int i = 0; i < path.size(); ++i) { @@ -1393,7 +1399,7 @@ void debug_miscast(int target_index) if (strchr(specs, ',')) { - std::vector<std::string> nums = split_string(",", specs); + vector<string> nums = split_string(",", specs); pow = atoi(nums[0].c_str()); fail = atoi(nums[1].c_str()); |