diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-05 16:54:50 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-05 16:54:50 +0000 |
commit | c8a3b79684f1fc090f4d389a49ec91e856c6a8de (patch) | |
tree | d1d088dbfe489cd80f741ffc16730e30252bdd1e | |
parent | 749f3027897c524569cd01cf0e7de7d5dceddeeb (diff) | |
download | crawl-ref-c8a3b79684f1fc090f4d389a49ec91e856c6a8de.tar.gz crawl-ref-c8a3b79684f1fc090f4d389a49ec91e856c6a8de.zip |
Merge from trunk: 1480, 1483, 1487, 1517, 1519, 1521, 1532-1535.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.2@1537 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/delay.cc | 60 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/it_use2.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/message.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 41 | ||||
-rw-r--r-- | crawl-ref/source/travel.cc | 8 |
11 files changed, 110 insertions, 77 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d083f087c8..546ad520ce 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2324,7 +2324,7 @@ static void world_reacts() you.attribute[ATTR_WAS_SILENCED] = its_quiet; } - viewwindow(1, false); + viewwindow(true, false); if (you.paralysis > 0 && any_messages()) more(); @@ -2343,6 +2343,7 @@ static void world_reacts() mons_place( WANDERING_MONSTER, BEH_HOSTILE, MHITNOT, false, 50, 50, LEVEL_DUNGEON, prox ); + viewwindow(true, false); } // place Abyss monsters. @@ -2350,11 +2351,15 @@ static void world_reacts() { mons_place( WANDERING_MONSTER, BEH_HOSTILE, MHITNOT, false, 50, 50, LEVEL_ABYSS, PROX_ANYWHERE ); + viewwindow(true, false); } // place Pandemonium monsters if (you.level_type == LEVEL_PANDEMONIUM && one_chance_in(50)) + { pandemonium_mons(); + viewwindow(true, false); + } // No monsters in the Labyrinth, or the Ecumenical Temple return; diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index a9335e2e72..0175fb29aa 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -144,6 +144,11 @@ void stop_delay( void ) delay_queue_item delay = you.delay_queue.front(); + const bool butcher_swap_warn = + delay.type == DELAY_BUTCHER + && (you.delay_queue.size() >= 2 + && you.delay_queue[1].type == DELAY_WEAPON_SWAP); + // At the very least we can remove any queued delays, right // now there is no problem with doing this... note that // any queuing here can only happen from a single command, @@ -156,7 +161,12 @@ void stop_delay( void ) { case DELAY_BUTCHER: // Corpse keeps track of work in plus2 field, see handle_delay() -- bwr - mpr( "You stop butchering the corpse." ); + if (butcher_swap_warn) + mpr("You stop butchering the corpse; not switching back to " + "primary weapon.", + MSGCH_WARN); + else + mpr( "You stop butchering the corpse." ); pop_delay(); break; @@ -320,7 +330,8 @@ void handle_delay( void ) { // special < 100 is the rottenness check if ( (mitm[delay.parm1].special < 100) && - (delay.parm2 >= 100) ) { + (delay.parm2 >= 100) ) + { mpr("The corpse rots.", MSGCH_ROTTEN_MEAT); delay.parm2 = 99; // don't give the message twice } @@ -330,9 +341,10 @@ void handle_delay( void ) } else { - // corpse is no longer valid! - stop_delay(); - return; + // corpse is no longer valid! End the butchering normally + // instead of using stop_delay() so that the player switches + // back to their main weapon if necessary. + delay.duration = 0; } } if ( delay.type == DELAY_MULTIDROP ) @@ -545,19 +557,28 @@ static void finish_delay(const delay_queue_item &delay) } case DELAY_BUTCHER: - snprintf(info, INFO_SIZE, "You finish %s the corpse into pieces.", - (you.species == SP_TROLL || - you.species == SP_GHOUL) ? "ripping" : "chopping" ); - mpr(info); + { + const item_def &item = mitm[delay.parm1]; + if (is_valid_item(item) && item.base_type == OBJ_CORPSES) + { + mprf("You finish %s the corpse into pieces.", + (you.species==SP_TROLL || you.species == SP_GHOUL) ? "ripping" + : "chopping"); - turn_corpse_into_chunks( mitm[ delay.parm1 ] ); + turn_corpse_into_chunks( mitm[ delay.parm1 ] ); - if (you.berserker && you.berserk_penalty != NO_BERSERK_PENALTY) + if (you.berserker && you.berserk_penalty != NO_BERSERK_PENALTY) + { + mpr("You enjoyed that."); + you.berserk_penalty = 0; + } + } + else { - mpr("You enjoyed that."); - you.berserk_penalty = 0; + mpr("You stop butchering the corpse."); } break; + } case DELAY_DROP_ITEM: // Note: checking if item is droppable is assumed to @@ -617,8 +638,10 @@ static void finish_delay(const delay_queue_item &delay) you.wield_change = true; print_stats(); // force redraw of the stats - you.turn_is_over = true; pop_delay(); + + // Chain onto the next delay. + handle_delay(); } static void armour_wear_effects(const int item_slot) @@ -799,7 +822,7 @@ static void handle_run_delays(const delay_queue_item &delay) return; } - if ( you.turn_is_over ) + if (you.turn_is_over) return; command_type cmd = CMD_NO_CMD; @@ -829,6 +852,13 @@ static void handle_run_delays(const delay_queue_item &delay) pop_delay(); update_turn_count(); } + + if (you.running && !you.turn_is_over + && you_are_delayed() + && !is_run_delay(current_delay_action())) + { + handle_delay(); + } } static void handle_macro_delay() diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index c0cb81063e..6a0c615b2a 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1389,7 +1389,7 @@ void melee_attack::calc_elemental_brand_damage( { special_damage = resist_adjust_damage(res, random2(damage_done) / 2 + 1); - if (special_damage > 0 && verb) + if (special_damage > 0 && verb && needs_message) { special_damage_message = make_stringf( "%s %s %s%s", diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 81da3e2164..cfef6af4aa 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -167,14 +167,6 @@ static bool find_butchering_implement() { mpr("Switching to a butchering implement."); wield_weapon( true, i, false ); - - // Account for the weapon switch...we're doing this here - // since the above switch may reveal information about the - // weapon (curse status, ego type). So even if the - // character fails to or decides not to butcher past this - // point, they have achieved something and there should be - // a cost. - start_delay( DELAY_UNINTERRUPTIBLE, 1 ); return true; } } @@ -233,7 +225,8 @@ bool butchery(void) // It makes more sense that you first find out if there's anything // to butcher, *then* decide to actually butcher it. // The old code did it the other way. - if ( !can_butcher && you.berserker ) { + if ( !can_butcher && you.berserker ) + { mpr ("You are too berserk to search for a butchering knife!"); return (false); } @@ -310,14 +303,19 @@ bool butchery(void) if (you.duration[DUR_PRAYER] && (you.religion == GOD_OKAWARU || you.religion == GOD_MAKHLEB || - you.religion == GOD_TROG)) + you.religion == GOD_TROG)) { offer_corpse(objl); destroy_item(objl); } else { - int work_req = 4 - (++mitm[objl].plus2); + // If we didn't switch weapons, we get in one turn of butchery; + // otherwise the work has to happen in the delay. + if (!wpn_switch) + ++mitm[objl].plus2; + + int work_req = 4 - mitm[objl].plus2; if (work_req < 0) work_req = 0; @@ -329,8 +327,7 @@ bool butchery(void) if (!new_cursed && wpn_switch) start_delay( DELAY_WEAPON_SWAP, 1, old_weapon ); - you.turn_is_over = true; - + you.turn_is_over = true; return true; } diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 74d60c78ad..2e62a2938b 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -124,10 +124,8 @@ bool potion_effect( char pot_eff, int pow ) break; case POT_LEVITATION: - strcpy(info, "You feel"); - strcat(info, (!player_is_levitating()) ? " very" : " more"); - strcat(info, " buoyant."); - mpr(info); + mprf("You feel %s buoyant.", + (!player_is_levitating()) ? "very" : "more"); if (!player_is_levitating()) mpr("You gently float upwards from the floor."); diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 2ec10821ea..7be033bfb1 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1348,16 +1348,13 @@ bool is_stackable_item( const item_def &item ) return (false); } -int ident_flags(const item_def &item) +unsigned long ident_flags(const item_def &item) { - const int identmask = full_ident_mask(item); - int flags = item.flags & identmask; + const unsigned long identmask = full_ident_mask(item); + unsigned long flags = item.flags & identmask; - if (identmask && (identmask & ISFLAG_KNOW_TYPE) - && !(flags & ISFLAG_KNOW_TYPE) && item_type_known(item)) - { + if ((identmask & ISFLAG_KNOW_TYPE) && item_type_known(item)) flags |= ISFLAG_KNOW_TYPE; - } return (flags); } diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index 5b4285a21f..f18e83d516 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -170,6 +170,10 @@ int channel_to_colour( int channel, int param ) ret = WHITE; break; + case MSGCH_MUTATION: + ret = LIGHTRED; + break; + case MSGCH_TUTORIAL: ret = MAGENTA; break; @@ -254,7 +258,8 @@ void mprf( int channel, const char *format, ... ) { va_list argp; va_start( argp, format ); - do_message_print( channel, 0, format, argp ); + do_message_print( channel, channel == MSGCH_GOD? you.religion : 0, + format, argp ); va_end( argp ); } diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 77e5a28acb..d6f2838ed8 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1180,7 +1180,7 @@ bool mutate(int which_mutation, bool failMsg) if ((!wearing_amulet(AMU_RESIST_MUTATION) && coinflip()) || one_chance_in(10)) { - mpr( "Your body decomposes!" ); + mpr( "Your body decomposes!", MSGCH_MUTATION ); if (coinflip()) lose_stat( STAT_RANDOM, 1 ); @@ -1194,7 +1194,7 @@ bool mutate(int which_mutation, bool failMsg) } if (failMsg) - mpr("You feel odd for a moment."); + mpr("You feel odd for a moment.", MSGCH_MUTATION); return (false); } @@ -1203,7 +1203,7 @@ bool mutate(int which_mutation, bool failMsg) && !force_mutation && !one_chance_in(10)) { if (failMsg) - mpr("You feel odd for a moment."); + mpr("You feel odd for a moment.", MSGCH_MUTATION); return (false); } @@ -1213,7 +1213,7 @@ bool mutate(int which_mutation, bool failMsg) && (you.mutation[MUT_MUTATION_RESISTANCE] == 3 || !one_chance_in(3))) { if (failMsg) - mpr("You feel odd for a moment."); + mpr("You feel odd for a moment.", MSGCH_MUTATION); return (false); } @@ -1321,9 +1321,6 @@ bool mutate(int which_mutation, bool failMsg) if (mutat == MUT_BIG_WINGS && !player_genus(GENPC_DRACONIAN)) return false; - //jmf: added some checks for new mutations - mpr("You mutate.", MSGCH_MUTATION); - // find where these things are actually changed // -- do not globally force redraw {dlb} you.redraw_hit_points = 1; @@ -1649,7 +1646,7 @@ bool delete_mutation(int which_mutation) if (you.mutation[MUT_MUTATION_RESISTANCE] > 1 && (you.mutation[MUT_MUTATION_RESISTANCE] == 3 || coinflip())) { - mpr("You feel rather odd for a moment."); + mpr("You feel rather odd for a moment.", MSGCH_MUTATION); return false; } @@ -1674,8 +1671,6 @@ bool delete_mutation(int which_mutation) if (you.demon_pow[mutat] >= you.mutation[mutat]) return false; - mpr("You mutate.", MSGCH_MUTATION); - switch (mutat) { case MUT_STRONG: diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index eb2c4767a4..79e3214e3b 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2761,7 +2761,14 @@ void level_change(void) if (you.experience_level == 5) mpr("You have gained the ability to fly.", MSGCH_INTRINSIC_GAIN); else if (you.experience_level == 15) + { mpr("You can now fly continuously.", MSGCH_INTRINSIC_GAIN); + if (you.levitation) + { + you.levitation = 100; + you.duration[DUR_CONTROLLED_FLIGHT] = 100; + } + } break; case SP_MERFOLK: diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 19a2ff0f22..b0d9d31bf7 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1895,10 +1895,7 @@ void cast_evaporate(int pow) if (potion == -1) { - snprintf( info, INFO_SIZE, "Wisps of steam play over your %s!", - your_hand(true) ); - - mpr(info); + mprf( "Wisps of steam play over your %s!", your_hand(true) ); return; } else if (you.inv[potion].base_type != OBJ_POTIONS) @@ -2068,59 +2065,59 @@ void cast_fulsome_distillation( int powc ) const bool big_monster = (mons_type_hit_dice( mitm[corpse].plus ) >= 5); const bool power_up = (rotten && big_monster); - int potion_type = POT_WATER; + potion_type pot_type = POT_WATER; switch (mitm[corpse].plus) { case MONS_GIANT_BAT: // extracting batty behaviour : 1 case MONS_UNSEEN_HORROR: // extracting batty behaviour : 7 case MONS_GIANT_BLOWFLY: // extracting batty behaviour : 5 - potion_type = POT_CONFUSION; + pot_type = POT_CONFUSION; break; case MONS_RED_WASP: // paralysis attack : 8 case MONS_YELLOW_WASP: // paralysis attack : 4 - potion_type = POT_PARALYSIS; + pot_type = POT_PARALYSIS; break; case MONS_SNAKE: // clean meat, but poisonous attack : 2 case MONS_GIANT_ANT: // clean meat, but poisonous attack : 3 - potion_type = (power_up ? POT_POISON : POT_CONFUSION); + pot_type = (power_up ? POT_POISON : POT_CONFUSION); break; case MONS_ORANGE_RAT: // poisonous meat, but draining attack : 3 - potion_type = (power_up ? POT_DECAY : POT_POISON); + pot_type = (power_up ? POT_DECAY : POT_POISON); break; case MONS_SPINY_WORM: // 12 - potion_type = (power_up ? POT_DECAY : POT_STRONG_POISON); + pot_type = (power_up ? POT_DECAY : POT_STRONG_POISON); break; default: switch (mons_corpse_effect( mitm[corpse].plus )) { case CE_CLEAN: - potion_type = (power_up ? POT_CONFUSION : POT_WATER); + pot_type = (power_up ? POT_CONFUSION : POT_WATER); break; case CE_CONTAMINATED: - potion_type = (power_up ? POT_DEGENERATION : POT_POISON); + pot_type = (power_up ? POT_DEGENERATION : POT_POISON); break; case CE_POISONOUS: - potion_type = (power_up ? POT_STRONG_POISON : POT_POISON); + pot_type = (power_up ? POT_STRONG_POISON : POT_POISON); break; case CE_MUTAGEN_RANDOM: case CE_MUTAGEN_GOOD: // unused case CE_RANDOM: // unused - potion_type = POT_MUTATION; + pot_type = POT_MUTATION; break; case CE_MUTAGEN_BAD: // unused case CE_ROTTEN: // actually this only occurs via mangling case CE_HCL: // necrophage - potion_type = (power_up ? POT_DECAY : POT_STRONG_POISON); + pot_type = (power_up ? POT_DECAY : POT_STRONG_POISON); break; case CE_NOCORPSE: // shouldn't occur @@ -2133,37 +2130,39 @@ void cast_fulsome_distillation( int powc ) // If not powerful enough, we downgrade the potion if (random2(50) > powc + 10 * rotten) { - switch (potion_type) + switch (pot_type) { case POT_DECAY: case POT_DEGENERATION: case POT_STRONG_POISON: - potion_type = POT_POISON; + pot_type = POT_POISON; break; case POT_MUTATION: case POT_POISON: - potion_type = POT_CONFUSION; + pot_type = POT_CONFUSION; break; case POT_PARALYSIS: - potion_type = POT_SLOWING; + pot_type = POT_SLOWING; break; case POT_CONFUSION: case POT_SLOWING: default: - potion_type = POT_WATER; + pot_type = POT_WATER; break; } } // We borrow the corpse's object to make our potion: mitm[corpse].base_type = OBJ_POTIONS; - mitm[corpse].sub_type = potion_type; + mitm[corpse].sub_type = pot_type; mitm[corpse].quantity = 1; mitm[corpse].plus = 0; mitm[corpse].plus2 = 0; + mitm[corpse].flags = 0; + mitm[corpse].inscription.clear(); item_colour( mitm[corpse] ); // sets special as well it_name( corpse, DESC_NOCAP_A, str_pass ); diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 2cc5d71c2b..44cf3b53c6 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -2425,6 +2425,10 @@ void start_travel(int x, int y) if (x == you.x_pos && y == you.y_pos) return ; + // Remember where we're going so we can easily go back if interrupted. + you.travel_x = x; + you.travel_y = y; + if (!i_feel_safe(true)) return; @@ -2433,10 +2437,6 @@ void start_travel(int x, int y) you.running.x = x; you.running.y = y; - // Remember where we're going so we can easily go back if interrupted. - you.travel_x = x; - you.travel_y = y; - // Check whether we can get to the square. find_travel_pos(you.x_pos, you.y_pos, NULL, NULL, NULL); |