From 9fcc7c41761ea968d0da075f2974a8908a2ef19b Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Thu, 24 Dec 2009 20:34:29 +1000 Subject: New (rakshasa) unique: Mara, Lord of Ilusions. This re-uses several ideas from the Emerald Eye FR, and implements the spell "Mislead": this grants the "Misled" status effect to the player, and causes on-level monsters to appear (glyph, name and tile) to be other monsters. Only their appearance is changed. Healing potions and rain remove this status effect. Mara also has a beefed-up version of the Rakshasa clone spell: it instead creates an "exact" clone (slightly altered spells list, and non-unique status for his clones). Only two will ever be created at once. Finally, he has the spell "Summon Player Ghost". This spell creates a ghost of the player (though marked as a summon, meaning that it (shouldn't) register a milestone, though it will be treated as a self-ghost kill) that is hostile. Only one of these should be existant at any one point in time. I'm pretty sure that I haven't broken anything, but would definitely appreciate someone sanity-checking this commit. Known minor issue: Kirke's summon ugly things being cast while having the Misled status causes them to show up with no glyph. --- crawl-ref/source/main.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/main.cc') diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index d3feb08c00..c1b4c6d615 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -1296,6 +1296,12 @@ static void _go_upstairs() if (_marker_vetoes_stair()) return; + if (you.duration[DUR_MISLED]) + { + mpr("Away from their source, illusions no longer mislead you.", MSGCH_DURATION); + you.duration[DUR_MISLED] = 0; + } + tag_followers(); // Only those beside us right now can follow. start_delay(DELAY_ASCENDING_STAIRS, 1 + (you.burden_state > BS_UNENCUMBERED)); @@ -1367,6 +1373,12 @@ static void _go_downstairs() if (!check_annotation_exclusion_warning()) return; + if (you.duration[DUR_MISLED]) + { + mpr("Away from their source, illusions no longer mislead you.", MSGCH_DURATION); + you.duration[DUR_MISLED] = 0; + } + if (shaft) { start_delay( DELAY_DESCENDING_STAIRS, 0, you.your_level ); @@ -2427,6 +2439,7 @@ static void _decrement_durations() _decrement_a_duration(DUR_LOWERED_MR, delay, "You feel more resistant to magic."); _decrement_a_duration(DUR_SLIMIFY, delay, "You feel less slimy.", coinflip(), "Your slime is starting to congeal."); + _decrement_a_duration(DUR_MISLED, delay, "Your thoughts are your own once more."); if (you.duration[DUR_PARALYSIS] || you.petrified()) { @@ -4618,7 +4631,7 @@ static void _compile_time_asserts() COMPILE_CHECK(SP_VAMPIRE == 30 , c3); COMPILE_CHECK(SPELL_DEBUGGING_RAY == 103 , c4); COMPILE_CHECK(SPELL_RETURNING_AMMUNITION == 162 , c5); - COMPILE_CHECK(NUM_SPELLS == 211 , c6); + COMPILE_CHECK(NUM_SPELLS == 215 , c6); //jmf: NEW ASSERTS: we ought to do a *lot* of these COMPILE_CHECK(NUM_SPECIES < SP_UNKNOWN , c7); -- cgit v1.2.3-54-g00ecf From caad029e611bb2eeedcab049d624a9e2be4e0dd5 Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 18:21:20 +0300 Subject: Unify wizard_create_feature_{name,number}. It works fine, but it does not show the verbose message about placing the feature, as wizard_create_feature_name used to. (This doesn't seem very necessary since debug-mode 'x' tends to give enough information.) --- crawl-ref/source/main.cc | 4 +- crawl-ref/source/wiz-dgn.cc | 91 ++++++++++++++++++--------------------------- crawl-ref/source/wiz-dgn.h | 3 +- 3 files changed, 39 insertions(+), 59 deletions(-) (limited to 'crawl-ref/source/main.cc') diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index c1b4c6d615..9dcd774a00 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -533,8 +533,8 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) case 'I': wizard_unidentify_pack(); break; case 'Z': case 'z': wizard_cast_spec_spell(); break; - case '(': wizard_create_feature_number(); break; - case ')': wizard_create_feature_name(); break; + case '(': + case ')': wizard_create_feature(); break; case ':': wizard_list_branches(); break; case '{': wizard_map_level(); break; case '}': wizard_reveal_traps(); break; diff --git a/crawl-ref/source/wiz-dgn.cc b/crawl-ref/source/wiz-dgn.cc index ea55dc9e56..8251e6c76e 100644 --- a/crawl-ref/source/wiz-dgn.cc +++ b/crawl-ref/source/wiz-dgn.cc @@ -269,70 +269,53 @@ void wizard_create_portal() } } -void wizard_create_feature_number() +void wizard_create_feature() { char specs[256]; int feat_num; - mpr("Create which feature (by number)? ", MSGCH_PROMPT); + dungeon_feature_type feat; + mpr("Create which feature? ", MSGCH_PROMPT); - if (!cancelable_get_line(specs, sizeof(specs)) - && (feat_num = atoi(specs))) + if (!cancelable_get_line(specs, sizeof(specs)) && specs[0] != 0) { - dungeon_feature_type feat = static_cast(feat_num); - if (feat == DNGN_ENTER_SHOP) + if ((feat_num = atoi(specs))) { - debug_make_shop(); - return; + feat = static_cast(feat_num); } - - dungeon_terrain_changed(you.pos(), feat, false); -#ifdef USE_TILE - env.tile_flv(you.pos()).special = 0; -#endif - } - else - canned_msg(MSG_OK); -} - -void wizard_create_feature_name() -{ - char specs[256]; - mpr("Create which feature (by name)? ", MSGCH_PROMPT); - if (!cancelable_get_line(specs, sizeof(specs)) && specs[0] != 0) - { - // Accept both "shallow_water" and "Shallow water" - std::string name = lowercase_string(specs); - name = replace_all(name, " ", "_"); - - dungeon_feature_type feat = dungeon_feature_by_name(name); - if (feat == DNGN_UNSEEN) // no exact match + else { - std::vector matches = dungeon_feature_matches(name); - - if (matches.empty()) + std::string name = lowercase_string(specs); + name = replace_all(name, " ", "_"); + feat = dungeon_feature_by_name(name); + if (feat == DNGN_UNSEEN) // no exact match { - mprf(MSGCH_DIAGNOSTICS, "No features matching '%s'", - name.c_str()); - return; - } + std::vector matches = dungeon_feature_matches(name); - // Only one possible match, use that. - if (matches.size() == 1) - { - name = matches[0]; - feat = dungeon_feature_by_name(name); - } - // Multiple matches, list them to wizard - else - { - std::string prefix = "No exact match for feature '" + - name + "', possible matches are: "; + if (matches.empty()) + { + mprf(MSGCH_DIAGNOSTICS, "No features matching '%s'", + name.c_str()); + return; + } - // Use mpr_comma_separated_list() because the list - // might be *LONG*. - mpr_comma_separated_list(prefix, matches, " and ", ", ", - MSGCH_DIAGNOSTICS); - return; + // Only one possible match, use that. + if (matches.size() == 1) + { + name = matches[0]; + feat = dungeon_feature_by_name(name); + } + // Multiple matches, list them to wizard + else + { + std::string prefix = "No exact match for feature '" + + name + "', possible matches are: "; + + // Use mpr_comma_separated_list() because the list + // might be *LONG*. + mpr_comma_separated_list(prefix, matches, " and ", ", ", + MSGCH_DIAGNOSTICS); + return; + } } } @@ -342,8 +325,6 @@ void wizard_create_feature_name() return; } - mprf(MSGCH_DIAGNOSTICS, "Setting (%d,%d) to %s (%d)", - you.pos().x, you.pos().y, name.c_str(), feat); dungeon_terrain_changed(you.pos(), feat, false); #ifdef USE_TILE env.tile_flv(you.pos()).special = 0; diff --git a/crawl-ref/source/wiz-dgn.h b/crawl-ref/source/wiz-dgn.h index c8561dcb1f..3db62ceb1b 100644 --- a/crawl-ref/source/wiz-dgn.h +++ b/crawl-ref/source/wiz-dgn.h @@ -10,8 +10,7 @@ #include void wizard_create_portal(); -void wizard_create_feature_number(); -void wizard_create_feature_name(); +void wizard_create_feature(); void wizard_list_branches(); void wizard_reveal_traps(); void wizard_map_level(); -- cgit v1.2.3-54-g00ecf