From 6346b53cc0d9fbcb5484e41967e5ae7ffb16cc71 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 22 Aug 2007 11:02:10 +0000 Subject: s/CAUGHT/HELD/ Gladiators now start with 4 nets. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2026 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 12 ++++++------ crawl-ref/source/beam.cc | 2 +- crawl-ref/source/describe.cc | 3 ++- crawl-ref/source/direct.cc | 2 +- crawl-ref/source/enum.h | 4 ++-- crawl-ref/source/items.cc | 2 +- crawl-ref/source/misc.cc | 34 ++++++++++++++++++++-------------- crawl-ref/source/mon-util.cc | 14 +++++++------- crawl-ref/source/monspeak.cc | 2 +- crawl-ref/source/monstuff.cc | 12 ++++++------ crawl-ref/source/mstuff2.cc | 4 ++-- crawl-ref/source/newgame.cc | 4 ++-- crawl-ref/source/output.cc | 4 ++-- crawl-ref/source/player.cc | 4 ++-- crawl-ref/source/spells1.cc | 8 ++++---- crawl-ref/source/spells4.cc | 2 +- crawl-ref/source/travel.cc | 2 +- 17 files changed, 61 insertions(+), 54 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 4bacfd7e37..12d395d6a2 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1011,7 +1011,7 @@ static void go_upstairs() } - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { mpr("You're held in a net!"); return; @@ -1044,7 +1044,7 @@ static void go_downstairs() return; } - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { mpr("You're held in a net!"); return; @@ -1256,7 +1256,7 @@ void process_command( command_type cmd ) canned_msg(MSG_PRESENT_FORM); break; } - else if (you.attribute[ATTR_CAUGHT]) + else if (you.attribute[ATTR_HELD]) { mpr("You cannot throw anything while held in a net!"); break; @@ -1272,7 +1272,7 @@ void process_command( command_type cmd ) canned_msg(MSG_PRESENT_FORM); break; } - else if (you.attribute[ATTR_CAUGHT]) + else if (you.attribute[ATTR_HELD]) { mpr("You cannot shoot anything while held in a net!"); break; @@ -2594,7 +2594,7 @@ static void open_door(int move_x, int move_y, bool check_confused) struct dist door_move; int dx, dy; // door x, door y - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { // struggles against net, damaging it free_self_from_net(true); @@ -2978,7 +2978,7 @@ static void move_player(int move_x, int move_y) bool moving = true; // used to prevent eventual movement (swap) bool swap = false; - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { // tries to escape from net (without damaging it, takes longer) free_self_from_net(false); diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 2176e67b6b..94c86b620f 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2394,7 +2394,7 @@ void beam_drop_object( bolt &beam, item_def *item, int x, int y ) { copy_item_to_grid( *item, x, y, 1 ); - if (you.x_pos == x && you.y_pos == y && !you.attribute[ATTR_CAUGHT] + if (you.x_pos == x && you.y_pos == y && !you.attribute[ATTR_HELD] || mgrd[x][y] == NON_MONSTER || !mons_is_caught(&menv[mgrd[x][y]])) { return; diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 3bebee1834..cea8925088 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1377,7 +1377,8 @@ static std::string describe_ammo( const item_def &item ) case MI_THROWING_NET: description += "A throwing net as used by gladiators. "; if (!is_throwable(item, you.body_size())) - description += "Unfortunately, it is too large for you to throw. "; + description += "Unfortunately, it is too large and awkward " + "for you to use. "; if (item.plus < 0) { std::string how; diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index 5ccf1ce023..60d8dd1e96 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -1550,7 +1550,7 @@ static std::string describe_mons_enchantment(const monsters &mons, return "in your thrall"; case ENCH_STICKY_FLAME: return "covered in liquid flames"; - case ENCH_CAUGHT: + case ENCH_HELD: return "entangled in a net"; default: return ""; diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index cfffdf0567..d93fe664f2 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -253,7 +253,7 @@ enum attribute_type ATTR_WAS_SILENCED, //jmf: added for silenced messages ATTR_GOD_GIFT_COUNT, //jmf: added to help manage god gift giving ATTR_DELAYED_FIREBALL, // bwr: reserve fireballs - ATTR_CAUGHT, // caught in a net + ATTR_HELD, // caught in a net NUM_ATTRIBUTES }; @@ -1289,7 +1289,7 @@ enum enchant_type ENCH_SICK, ENCH_SLEEPY, // Monster can't wake until this wears off. ENCH_FATIGUE, // Post-berserk fatigue. - ENCH_CAUGHT, // caught in a net + ENCH_HELD, // caught in a net NUM_ENCHANTMENTS }; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 871ee6af21..8e31712f24 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1301,7 +1301,7 @@ int find_free_slot(const item_def &i) // the player's inventory is full. int move_item_to_player( int obj, int quant_got, bool quiet ) { - if (you.attribute[ATTR_CAUGHT] && mitm[obj].base_type == OBJ_MISSILES + if (you.attribute[ATTR_HELD] && mitm[obj].base_type == OBJ_MISSILES && mitm[obj].sub_type == MI_THROWING_NET && item_is_stationary(mitm[obj])) { mpr("You cannot pick up the net that holds you!"); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 57c56cfb55..ce5b05956f 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -895,7 +895,13 @@ void monster_caught_in_net(monsters *mon, bolt &pbolt) return; } - if (!mons_is_caught(mon) && mon->add_ench(ENCH_CAUGHT)) + if (mons->type == MONS_OOZE || mons->type == MONS_PULSATING_LUMP) + { + simple_monster_message(mon, " oozes right through the net!"); + return; + } + + if (!mons_is_caught(mon) && mon->add_ench(ENCH_HELD)) { if (mons_near(mon) && !player_monster_visible(mon)) mpr("Something gets caught in the net!"); @@ -921,9 +927,9 @@ void player_caught_in_net() return; } - if (!you.attribute[ATTR_CAUGHT]) + if (!you.attribute[ATTR_HELD]) { - you.attribute[ATTR_CAUGHT] = 10; + you.attribute[ATTR_HELD] = 10; mpr("You become entangled in the net!"); // I guess levitation works differently, keeping both you @@ -1810,7 +1816,7 @@ void handle_traps(char trt, int i, bool trap_known) } trap_item( OBJ_MISSILES, MI_THROWING_NET, env.trap[i].x, env.trap[i].y ); - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) mark_net_trapping(you.x_pos, you.y_pos); grd[env.trap[i].x][env.trap[i].y] = DNGN_FLOOR; @@ -1928,7 +1934,7 @@ void remove_net_from(monsters *mon) if (net == NON_ITEM) { - mon->del_ench(ENCH_CAUGHT, true); + mon->del_ench(ENCH_HELD, true); return; } @@ -1952,7 +1958,7 @@ void remove_net_from(monsters *mon) if (mitm[net].plus < -7) { mpr("Whoops! The net comes apart in your hands!"); - mon->del_ench(ENCH_CAUGHT, true); + mon->del_ench(ENCH_HELD, true); destroy_item(net); net_destroyed = true; } @@ -1974,7 +1980,7 @@ void remove_net_from(monsters *mon) return; } - mon->del_ench(ENCH_CAUGHT, true); + mon->del_ench(ENCH_HELD, true); remove_item_stationary(mitm[net]); if (player_monster_visible(mon)) @@ -1990,7 +1996,7 @@ void free_self_from_net(bool damage_net) if (net == NON_ITEM) // really shouldn't happen! { - you.attribute[ATTR_CAUGHT] = 0; + you.attribute[ATTR_HELD] = 0; return; } int hold = mitm[net].plus; @@ -2023,25 +2029,25 @@ void free_self_from_net(bool damage_net) mpr("You rip the net and break free!"); dec_mitm_item_quantity( net, 1 ); - you.attribute[ATTR_CAUGHT] = 0; + you.attribute[ATTR_HELD] = 0; return; } } else // you try to escape { mpr("You struggle to escape from the net."); - you.attribute[ATTR_CAUGHT]--; + you.attribute[ATTR_HELD]--; if (you.body_size(PSIZE_BODY) < SIZE_MEDIUM) - you.attribute[ATTR_CAUGHT]--; + you.attribute[ATTR_HELD]--; if (hold < 0 && !one_chance_in(-hold/2)) - you.attribute[ATTR_CAUGHT]--; + you.attribute[ATTR_HELD]--; - if (you.attribute[ATTR_CAUGHT] <= 0) + if (you.attribute[ATTR_HELD] <= 0) { mpr("You break free from the net!"); - you.attribute[ATTR_CAUGHT] = 0; + you.attribute[ATTR_HELD] = 0; remove_item_stationary(mitm[net]); return; } diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index ae41883f15..dd656a3f26 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1723,7 +1723,7 @@ bool mons_is_confused(const monsters *m) bool mons_is_caught(const monsters *m) { - return (m->has_ench(ENCH_CAUGHT)); + return (m->has_ench(ENCH_HELD)); } bool mons_is_fleeing(const monsters *m) @@ -3696,7 +3696,7 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet) simple_monster_message(this, " is no longer rotting."); break; - case ENCH_CAUGHT: + case ENCH_HELD: { int net = get_trapping_net(x,y); if (net != NON_ITEM) @@ -3825,7 +3825,7 @@ void monsters::timeout_enchantments(int levels) blink(); break; - case ENCH_CAUGHT: + case ENCH_HELD: del_ench(i->first); break; @@ -3931,7 +3931,7 @@ void monsters::apply_enchantment(const mon_enchant &me) decay_enchantment(me); break; - case ENCH_CAUGHT: + case ENCH_HELD: { if (mons_is_paralysed(this) || this->behaviour == BEH_SLEEP) break; @@ -3940,7 +3940,7 @@ void monsters::apply_enchantment(const mon_enchant &me) if (net == NON_ITEM) // really shouldn't happen! { - del_ench(ENCH_CAUGHT); + del_ench(ENCH_HELD); break; } @@ -4040,7 +4040,7 @@ void monsters::apply_enchantment(const mon_enchant &me) } destroy_item(net); - del_ench(ENCH_CAUGHT, true); + del_ench(ENCH_HELD, true); } } @@ -4582,7 +4582,7 @@ int mon_enchant::calc_duration(const monsters *mons, case ENCH_CONFUSION: cturn = 120 / modded_speed(mons, 5); break; - case ENCH_CAUGHT: + case ENCH_HELD: cturn = 90 / mod_speed(25, mons->speed); break; case ENCH_POISON: diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc index 8fd4e5e108..267bab53e6 100644 --- a/crawl-ref/source/monspeak.cc +++ b/crawl-ref/source/monspeak.cc @@ -373,7 +373,7 @@ bool mons_speaks(const monsters *monster) } } - else if (monster->has_ench(ENCH_CAUGHT)) + else if (monster->has_ench(ENCH_HELD)) { if (mons_friendly(monster)) { diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index ba7a4cd0a8..25f1fc1513 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1189,7 +1189,7 @@ bool monster_polymorph( monsters *monster, monster_type targetc, } } else - monster->add_ench(ENCH_CAUGHT); + monster->add_ench(ENCH_HELD); } return (player_messaged); @@ -1217,8 +1217,8 @@ bool monster_blink(monsters *monster) monster->check_redraw(oldplace); monster->apply_location_effects(); - if (monster->has_ench(ENCH_CAUGHT)) - monster->del_ench(ENCH_CAUGHT, true); + if (monster->has_ench(ENCH_HELD)) + monster->del_ench(ENCH_HELD, true); return (true); } // end monster_blink() @@ -2715,7 +2715,7 @@ static bool handle_scroll(monsters *monster) case SCR_TELEPORTATION: if (!monster->has_ench(ENCH_TP)) { - if (monster->behaviour == BEH_FLEE || monster->has_ench(ENCH_CAUGHT)) + if (monster->behaviour == BEH_FLEE || monster->has_ench(ENCH_HELD)) { simple_monster_message(monster, " reads a scroll."); monster_teleport(monster, false); @@ -2725,7 +2725,7 @@ static bool handle_scroll(monsters *monster) break; case SCR_BLINKING: - if (monster->behaviour == BEH_FLEE || monster->has_ench(ENCH_CAUGHT)) + if (monster->behaviour == BEH_FLEE || monster->has_ench(ENCH_HELD)) { if (mons_near(monster)) { @@ -4097,7 +4097,7 @@ static bool handle_pickup(monsters *monster) if (mons_is_caught(monster) && mitm[item].base_type == OBJ_MISSILES && mitm[item].sub_type == MI_THROWING_NET) { - monster->del_ench(ENCH_CAUGHT, true); + monster->del_ench(ENCH_HELD, true); eaten_net = true; } } diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index d63534a425..e456590f99 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -933,8 +933,8 @@ void monster_teleport(struct monsters *monster, bool instan, bool silent) monster->check_redraw(oldplace); monster->apply_location_effects(); - if (monster->has_ench(ENCH_CAUGHT)) - monster->del_ench(ENCH_CAUGHT, true); + if (monster->has_ench(ENCH_HELD)) + monster->del_ench(ENCH_HELD, true); // Teleporting mimics change form - if they reappear out of LOS, they are // no longer known. diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 3998423eb2..fc37123db9 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -3820,9 +3820,9 @@ bool give_items_skills() you.inv[2].special = 0; } - you.inv[3].quantity = 1; + you.inv[3].quantity = 4; you.inv[3].base_type = OBJ_MISSILES; - you.inv[3].sub_type = MI_JAVELIN; + you.inv[3].sub_type = MI_THROWING_NET; you.inv[3].plus = 0; you.inv[3].special = 0; diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index eab28314be..011f2b3a18 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -556,7 +556,7 @@ void print_stats(void) cprintf( "Rot " ); } - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { textcolor( RED ); cprintf( "Held " ); @@ -1478,7 +1478,7 @@ std::string status_mut_abilities() text += "non-regenerating, "; } - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) text += "held, "; const int mr = player_res_magic(); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 7d34b2f318..be70ca81cd 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3295,7 +3295,7 @@ void display_char_status() if (player_is_levitating()) mpr( "You are hovering above the floor." ); - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) mpr( "You are held in a net." ); if (you.duration[DUR_POISONING]) @@ -5345,7 +5345,7 @@ bool player::confused() const bool player::caught() const { - return (attribute[ATTR_CAUGHT]); + return (attribute[ATTR_HELD]); } int player::shield_block_penalty() const diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 8a003323f0..16323f0035 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -117,13 +117,13 @@ int blink(int pow, bool high_level_controlled_blink) } else { - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { int net = get_trapping_net(you.x_pos, you.y_pos); if (net != NON_ITEM) remove_item_stationary(mitm[net]); - you.attribute[ATTR_CAUGHT] = 0; + you.attribute[ATTR_HELD] = 0; } move_player_to_grid(beam.tx, beam.ty, false, true, true); @@ -174,13 +174,13 @@ void random_blink(bool allow_partial_control, bool override_abyss) { mpr("You blink."); - if (you.attribute[ATTR_CAUGHT]) + if (you.attribute[ATTR_HELD]) { int net = get_trapping_net(you.x_pos, you.y_pos); if (net != NON_ITEM) remove_item_stationary(mitm[net]); - you.attribute[ATTR_CAUGHT] = 0; + you.attribute[ATTR_HELD] = 0; } succ = true; diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 9309cbdb5e..7773c3efda 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -3002,7 +3002,7 @@ int cast_apportation(int pow) remove_item_stationary(mitm[item]); if (mon != NON_MONSTER) - (&menv[mon])->del_ench(ENCH_CAUGHT, true); + (&menv[mon])->del_ench(ENCH_HELD, true); } } else diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index efce606277..3eb0f53c5d 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -910,7 +910,7 @@ command_type travel() // Abort travel/explore if you're confused or a key was pressed. // Or if you got caught in a net. - if (kbhit() || you.duration[DUR_CONF] || you.attribute[ATTR_CAUGHT]) + if (kbhit() || you.duration[DUR_CONF] || you.attribute[ATTR_HELD]) { stop_running(); return CMD_NO_CMD; -- cgit v1.2.3-54-g00ecf