pull the player into deep water, but it's a scary enough effect.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7711 c06c8d41-db1a-0410-9941-cceddc491573
2UQXBHFFMTZG5M6NPB7KS7WNIH6VPBPVJFO4AN3YPCMZBT637ICAC LLA7OZDQJ3S2YKGNNDD6K3VP3FPMQLZX3IUO4WDJQVJHGKGCCUZQC ZJMTMMZBCXHCPFHBTI2PL3Q4XTJQUWMMHCCG6JDIEDMJYCC33TFQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC CIAIASCBKKV7VMYBL2CIFAYGFQTB6GIME4FSQGZNQGXO7FXQTA5AC AUXVWXWIFSTWFA6VZXN2FMG7FQEKRZVV6MD32VQQ7J2RKCXHAVGAC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC TGJZXTUIAKCFZQJ54ZQEBGFBVZSJCAX6AWDRSH3TP7UJRLGUM5SAC 7VCVH6XKT4L4PSCBF6XRYV3WQQDVGDMA73RHPV6IOWMQ2S7B5XAQC OEISFRW2B7E4YRJSWXNXBH2IAJO4O3LHNYFPFD3MBY57LYVRHMZQC KEANRIMF5CGFVZ2XJYNFPOAKLXOSOJUOVA73IWBWOG576265ERHAC LNCIVPGKO36VUODC5HDGIVJM4BSK5ONC3ANMZKDLWLYJGROEZWCQC X7X6JKZXOCG6NVLZLGNCQDFFXW4H3S77BVAJ5LS7ZHZ4GQVLMOMAC 3ZWALZFSTSIVYXY4BAY6ANGINTDACZC6RSSJTEMQSTSUIE66YOBQC CK7CT5TUFUL2AQY7FUHB5JI3FC2KSPWUWHXC6VEUJJ7G4OWUQFTAC GJAFXCDBIGFUMCD6IJ523WAT754VOJSUXPNN7ZBECYRRP76CARPAC MLF7O6GXUABY244PDOX3KYGEMIBCJW2Y42GVP4LRW2L5KVD3UF7AC S2LIBA2CLTZ6ZU66AUZ2CCNLCDOBSGWQGTZ6HFAFP2XSWAALGLSQC SKV6JBDAWUWTFECFSQARSNA3DDPUFCR7N3T7D5J35NYTEDMXLP3QC QUHEENPY2PYTEUS7C4R3CKE4FHSHGR2BIXB6EW676ESX3727PA3AC HUMRQOA7Y32XBXQNR5LUIWM2ZB57XDW4ZQHMZ4RDGDZATY6K73SQC NWUWP5QCMJ7ZZMLCVB74PW7HDEFB6ICEQHNDHCGG7UWDQNNLGVMQC EDGP3KBYHBZ62J6RSGWDMWG4AARB2D3ULKELML5H3S4EDWTWUD7QC SIDH2P7NBIG5KEOE27XHD3ZT2NQ2OJZFN6VZXWNWYFFY5YVXSSVQC IEWZIPFXN6HYTAD2XKL3LQ6GYQZQKLX7VDWVB3YE42ODZLSOTB4AC LHYTGOCNDWX3CVD2HSQ6LAYC6NLKKI6ZKKNWZ5IQWP6YP5PQEVWQC QKV56RZTWOX64VLWW52R2DEUM3HGGZNLRAJ2ZV2BHW5K422OPNJQC TJN537N2F5J7JWBCT2Z4VSTNXIMFCMEXTKTY7N2UCXIVUUQ3XJBQC HFZQADL3R7ITWM3VPW5G3NCB2AHRMAMKYZOI3STW5LWUCTV4FFFQC 5JS3QSE3EIXSBVI4DATH2EIFD7QN3POAFEUM7MK4NRMPH5JOPAAQC LJK4ZQATLSB4MKZG3ARZX5V6RFGTN3NLCN6GTCUGJQKU26SOXMUAC const cloud_type ctype = env.cloud[ cloud ].type;// Don't prompt if already in a cloud of the same type.if (is_damaging_cloud(ctype, true)&& (env.cgrid(you.pos()) == EMPTY_CLOUD|| ctype != env.cloud[ env.cgrid(you.pos()) ].type))
const int cloud = env.cgrid(p);if (cloud != EMPTY_CLOUD && !you.confused())
std::string prompt = make_stringf("Really step into that cloud of %s?",cloud_name(ctype).c_str());
const cloud_type ctype = env.cloud[ cloud ].type;// Don't prompt if already in a cloud of the same type.if (is_damaging_cloud(ctype, true)&& (env.cgrid(you.pos()) == EMPTY_CLOUD|| ctype != env.cloud[ env.cgrid(you.pos()) ].type)){std::string prompt = make_stringf("Really step into that cloud of %s?",cloud_name(ctype).c_str());
// If we're walking along, give a chance to avoid traps.if (stepped && !force && !you.confused()){if (new_grid == DNGN_UNDISCOVERED_TRAP)
// If we're walking along, give a chance to avoid traps.if (stepped && !you.confused())
const int skill = 4 + you.skills[SK_TRAPS_DOORS]+ player_mutation_level(MUT_ACUTE_VISION)- 2 * player_mutation_level(MUT_BLURRY_VISION);
if (new_grid == DNGN_UNDISCOVERED_TRAP){const int skill = 4 + you.skills[SK_TRAPS_DOORS]+ player_mutation_level(MUT_ACUTE_VISION)- 2 * player_mutation_level(MUT_BLURRY_VISION);
|| new_grid == DNGN_TRAP_NATURAL){const trap_type type = get_trap_type(p);if (type == TRAP_ZOT)
|| new_grid == DNGN_TRAP_NATURAL)
canned_msg(MSG_OK);stop_running();you.turn_is_over = false;return (false);
if (!yes_or_no("Do you really want to step into the Zot trap")){canned_msg(MSG_OK);stop_running();you.turn_is_over = false;return (false);}
}else if (new_grid != DNGN_TRAP_MAGICAL && you.airborne()){// No prompt (shaft and mechanical traps ineffective, if flying)}else
else if (new_grid != DNGN_TRAP_MAGICAL && you.airborne()){// No prompt (shaft and mechanical traps ineffective, if flying)}else
// Prompt for any trap where you might not have enough hp// as defined in init.txt (see trapwalk.lua)if (new_grid != DNGN_TRAP_MECHANICAL|| !clua.callbooleanfn(false, "ch_cross_trap","s", trap_name(p.x, p.y)))
// Prompt for any trap where you might not have enough hp// as defined in init.txt (see trapwalk.lua)if (new_grid != DNGN_TRAP_MECHANICAL|| !clua.callbooleanfn(false, "ch_cross_trap","s", trap_name(p.x, p.y)))
{std::string prompt = make_stringf("Really step %s that %s?",(type == TRAP_ALARM) ? "onto" : "into",feature_description(new_grid, type,false, DESC_BASENAME, false).c_str());
{std::string prompt = make_stringf("Really step %s that %s?",(type == TRAP_ALARM) ? "onto" : "into",feature_description(new_grid, type,false, DESC_BASENAME, false).c_str());
if (!yesno(prompt.c_str(), true, 'n')){canned_msg(MSG_OK);stop_running();you.turn_is_over = false;return (false);
if (!yesno(prompt.c_str(), true, 'n')){canned_msg(MSG_OK);stop_running();you.turn_is_over = false;return (false);}
for ( adjacent_iterator ai; ai; ++ai )if (mgrd(*ai) == NON_MONSTER && _habitat_okay( monster, grd(*ai)))if (one_chance_in(++num_found))loc = *ai;
for (adjacent_iterator ai; ai; ++ai)if (mgrd(*ai) == NON_MONSTER && _habitat_okay( monster, grd(*ai))&& one_chance_in(++num_found)){loc = *ai;}
} // end handle_nearby_ability()
}static bool _siren_movement_effect(const monsters *monster){bool do_resist = (you.attribute[ATTR_HELD] || you_resist_magic(70));if (!do_resist){coord_def dir(coord_def(0,0));if (monster->pos().x < you.pos().x)dir.x = -1;else if (monster->pos().x > you.pos().x)dir.x = 1;if (monster->pos().y < you.pos().y)dir.y = -1;else if (monster->pos().y > you.pos().y)dir.y = 1;const coord_def newpos = you.pos() + dir;if (!in_bounds(newpos) || is_grid_dangerous(grd(newpos))){do_resist = true;}else{bool swapping = false;monsters *mon;if (mgrd(newpos) != NON_MONSTER){mon = &menv[mgrd(newpos)];if (mons_wont_attack(mon)&& !mons_is_stationary(mon)&& !mons_cannot_act(mon)&& !mons_is_sleeping(mon)&& swap_check(mon, you.pos(), true)){swapping = true;}else if (!mons_is_submerged(mon))do_resist = true;}if (!do_resist){const coord_def oldpos = you.pos();mprf("The pull of her song draws you forwards.");if (swapping){int swap_mon = mgrd(newpos);// Pick the monster up.mgrd(newpos) = NON_MONSTER;mon->moveto(oldpos);// Plunk it down.mgrd(mon->pos()) = swap_mon;mprf("You swap places with %s.",mon->name(DESC_NOCAP_THE).c_str());}move_player_to_grid(newpos, true, true, true);