diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-30 20:31:38 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-30 20:31:38 +0000 |
commit | e864f4d3b84c1efe09175652a9830dddbc0bd6a5 (patch) | |
tree | 7322d1cc0393f62adb256204a714cdcd976a2d62 /crawl-ref/source/acr.cc | |
parent | 7554b6525e58b192f168e50233479f3fb1d19f5e (diff) | |
download | crawl-ref-e864f4d3b84c1efe09175652a9830dddbc0bd6a5.tar.gz crawl-ref-e864f4d3b84c1efe09175652a9830dddbc0bd6a5.zip |
A completely reworked version of Zin as per the lengthy
discussion in October/November.
Zin effects:
- protection from harm (like all good gods)
- feeding when starving (as before)
- mutation resistance (chance of piety/200)
Zin restrictions:
- no cannibalism (like all good gods)
- no attacking friends
- no eating of intelligent beings' corpses
- no deliberate mutating
Zin invocations:
- Smiting (general priestly ability?)
- Revitalisation (Minor Healing + 5 mp)
- Sanctuary (protection from attacks)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3164 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 117f9bd7df..c0b18b5ee3 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2749,6 +2749,16 @@ static void check_shafts() } } +static void check_sanctuary() +{ + if (env.sanctuary_time <= 0) + return; + + env.sanctuary_time--; + if (env.sanctuary_time == 0) + remove_sanctuary(); +} + static void world_reacts() { crawl_state.clear_god_acting(); @@ -2764,6 +2774,8 @@ static void world_reacts() check_banished(); check_shafts(); + + check_sanctuary(); run_environment_effects(); @@ -3684,10 +3696,17 @@ static void move_player(int move_x, int move_y) const unsigned short targ_monst = mgrd[ targ_x ][ targ_y ]; const bool targ_pass = you.can_pass_through(targ_x, targ_y); + // you can swap places with a friendly monster if you're not confused + // or if both of you are inside a sanctuary + const bool can_swap_places = targ_monst != NON_MONSTER + && (mons_friendly(&menv[targ_monst]) + && !you.duration[DUR_CONF] + || is_sanctuary(you.x_pos, you.y_pos) + && is_sanctuary(targ_x, targ_y)); + // cannot move away from mermaid but you CAN fight neighbouring squares if (you.duration[DUR_BEHELD] && !you.duration[DUR_CONF] - && (targ_monst == NON_MONSTER || mons_friendly(&menv[targ_monst]) - || mons_is_submerged(&menv[targ_monst]))) + && (!can_swap_places || mons_is_submerged(&menv[targ_monst]))) { for (unsigned int i = 0; i < you.beheld_by.size(); i++) { @@ -3722,8 +3741,7 @@ static void move_player(int move_x, int move_y) { struct monsters *mon = &menv[targ_monst]; - // you can swap places with a friendly monster if you're not confused - if (mons_friendly( mon ) && !you.duration[DUR_CONF]) + if (can_swap_places) { if (swap_places( mon )) swap = true; @@ -3732,6 +3750,17 @@ static void move_player(int move_x, int move_y) } else // attack! { + if (is_sanctuary(you.x_pos, you.y_pos) + || is_sanctuary(mon->x, mon->y)) + { + snprintf(info, INFO_SIZE, + "Really attack %s, despite your sanctuary? ", + mon->name(DESC_NOCAP_THE).c_str()); + + if (!yesno(info, true, 'n')) + return; + } + // XXX: Moving into a normal wall does nothing and uses no // turns or energy, but moving into a wall which contains // an invisible monster attacks the monster, thus allowing |