diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-09-24 05:39:14 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-09-24 05:39:14 +0000 |
commit | e64018ae71e39de8db326ceaf32eea44c73363c1 (patch) | |
tree | c28da9aa3aeaacfe64d2c503ffd370913482f644 /crawl-ref | |
parent | 319a19300a717f47ebb88ebdee27000dfc3ff896 (diff) | |
download | crawl-ref-e64018ae71e39de8db326ceaf32eea44c73363c1.tar.gz crawl-ref-e64018ae71e39de8db326ceaf32eea44c73363c1.zip |
Fixed Lua macro weirdness.
Clear messages before each travel move so that accumulated messages don't interrupt travel.
Refixed silly throwing penalty for needles. Finally put the code in the right place. :-)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@96 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/acr.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 27 |
2 files changed, 24 insertions, 16 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index e8b5d42c1e..4cbe25c13d 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -963,7 +963,11 @@ static void input() { } command_type cmd = get_next_cmd(); - do_action( cmd ); + + // [dshaligram] If get_next_cmd encountered a Lua macro binding, your turn + // may be ended by the first invoke of the macro. + if (!you.turn_is_over) + do_action( cmd ); if ( you.turn_is_over ) { @@ -2378,7 +2382,12 @@ static command_type get_next_cmd() { if (you.running < 0) { // Travel and explore command_type result = travel(); if ( result != CMD_NO_CMD ) + { + // Clear messages before each round of travel so that more prompts + // don't interrupt. + mesclr(); return result; + } } if (you.running > 0) { command_type result = get_running_command(); @@ -2399,7 +2408,7 @@ static command_type get_next_cmd() { if (is_userfunction(keyin)) { run_macro(get_userfunction(keyin)); - //return get_next_cmd(); + return (CMD_REST); } return keycode_to_command(keyin); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 65f7ee2d58..27031419f0 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1698,20 +1698,6 @@ bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target) exercise(SK_DARTS, 1 + random2avg(3, 2)); } - if (wepClass == OBJ_MISSILES && wepType == MI_NEEDLE) - { - // Throwing needles is now seriously frowned upon; it's difficult - // to grip a fiddly little needle, and not penalising it cheapens - // blowguns. [ds] Increased the penalty further after rgrmisc - // reports of being able to use thrown needles. - exHitBonus -= (30 - you.skills[SK_DARTS]); - baseHit -= (45 - you.skills[SK_DARTS]) / 2; -#ifdef DEBUG_DIAGNOSTICS - mprf(MSGCH_DIAGNOSTICS, "Needle base hit = %d, exHitBonus = %d", - baseHit, exHitBonus); -#endif - } - // exercise skill if (coinflip()) exercise(SK_RANGED_COMBAT, 1); @@ -1763,6 +1749,19 @@ bool throw_it(struct bolt &pbolt, int throw_2, monsters *dummy_target) exercise(SK_RANGED_COMBAT, 1); exHitBonus = you.dex / 4; + + if (wepClass == OBJ_MISSILES && wepType == MI_NEEDLE) + { + // Throwing needles is now seriously frowned upon; it's difficult + // to grip a fiddly little needle, and not penalising it cheapens + // blowguns. + exHitBonus -= (30 - you.skills[SK_DARTS]) / 3; + baseHit -= (30 - you.skills[SK_DARTS]) / 3; +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Needle base hit = %d, exHitBonus = %d", + baseHit, exHitBonus); +#endif + } } // FINALIZE tohit and damage |