Anonymous | Login | 2024-04-20 03:26 CEST |
Main | My View | View Issues | Change Log | Wiki | Tavern | News |
Viewing Issue Simple Details [ Jump to Notes ] [ Wiki ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
0002674 | [DCSS] Patches | minor | N/A | 2010-10-04 17:53 | 2010-10-06 15:39 | ||
Reporter | galehar | View Status | public | ||||
Assigned To | KiloByte | ||||||
Priority | normal | Resolution | done | ||||
Status | closed | Product Branch | 0.8 ancient branch | ||||
Summary | 0002674: Merfolk tail and transforms overhaul | ||||||
Description |
changes and bugfixes: * Make the merfolk tail compatible with blade hands. * Entering water doesn't cancel transformations. (Mantis 2110) * Trying to enter deep water with a non-swimming form as a merfolk prints: "You cannot swim in your current form.". You have to manually cancel the transformation. * Merfolk can cast all transformations in shallow water and blade hands and ice form in deep water. (Mantis 2384) * Prevent turning into non-flying form (and being porkalated to death) when in a flying form above lava/deep water. * Fix some messages (Mantis 1784, 2312, 2667). * Fix some special cases where the merfolk doesn't untransform (Mantis 1104). * When you change from one flying form to another over deep water, you no longer drown (extremly rare). * Add new functions so that it should be much easier to add new swimming and flying forms. bug not fixed: * If you fly/levitate out of water, the player doll isn't updated properly and keeps its tail. I have no idea how to fix this, but if someone does, it now should be much easier to fix. internals: * A new boolean has been added to the player struct to track the status of the fishtail. Currently, it isn't saved (to preserve save compatibility), but as the status is checked after each step, this shouldn't be a problem. I put preprocessor directives so that it will be saved when the TAG_MAJOR_VERSION changes. * Add 2 functions transform_can_fly and transform_can_swim and use them wherever possible. transformation_can_wield has been renamed to transform_can_wield for consistency with all the other transform functions. * replaced (you.species == SP_MERFOLK && you.swimming()) (and similar conditionals) by you.fishtail wherever possible. |
||||||
Additional Information | |||||||
Tags | No tags attached. | ||||||
Attached Files |
0001-Merfolk-tail-and-transforms-overhaul.patch [^] (28,358 bytes) 2010-10-04 17:53 [Show Content] [Hide Content]From 819ef23bf08aa1eef45183463f96eef0c63cde13 Mon Sep 17 00:00:00 2001 From: Raphael Langella <raphael.langella@gmail.com> Date: Mon, 4 Oct 2010 17:49:37 +0200 Subject: [PATCH] Merfolk tail and transforms overhaul changes and bugfixes: * Make the merfolk tail compatible with blade hands. * Entering water doesn't cancel transformations. (Mantis 2110) * Trying to enter deep water with a non-swimming form as a merfolk prints: "You cannot swim in your current form.". You have to manually cancel the transformation. * Merfolk can cast all transformations in shallow water and blade hands and ice form in deep water. (Mantis 2384) * Prevent turning into non-flying form (and being porkalated to death) when in a flying form above lava/deep water. * Fix some messages (Mantis 1784, 2312, 2667). * Fix some special cases where the merfolk doesn't untransform (Mantis 1104). * When you change from one flying form to another over deep water, you no longer drown (extremly rare). * Add new functions so that it should be much easier to add new swimming and flying forms. bug not fixed: * If you fly/levitate out of water, the player doll isn't updated properly and keeps its tail. I have no idea how to fix this, but if someone does, it now should be much easier to fix. internals: * A new boolean has been added to the player struct to track the status of the fishtail. Currently, it isn't saved (to preserve save compatibility), but as the status is checked after each step, this shouldn't be a problem. I put preprocessor directives so that it will be saved when the TAG_MAJOR_VERSION changes. * Add 2 functions transform_can_fly and transform_can_swim and use them wherever possible. transformation_can_wield has been renamed to transform_can_wield for consistency with all the other transform functions. * replaced (you.species == SP_MERFOLK && you.swimming()) (and similar conditionals) by you.fishtail wherever possible. --- crawl-ref/source/delay.cc | 2 +- crawl-ref/source/describe.cc | 3 +- crawl-ref/source/item_use.cc | 10 +--- crawl-ref/source/misc.cc | 17 ++++- crawl-ref/source/mon-cast.cc | 3 +- crawl-ref/source/player-act.cc | 2 +- crawl-ref/source/player-equip.cc | 6 +- crawl-ref/source/player.cc | 53 ++++++++-------- crawl-ref/source/player.h | 1 + crawl-ref/source/spl-selfench.cc | 11 ++-- crawl-ref/source/spl-transloc.cc | 6 ++- crawl-ref/source/tags.cc | 6 ++ crawl-ref/source/terrain.cc | 4 +- crawl-ref/source/transform.cc | 128 ++++++++++++++++++++++++++++---------- crawl-ref/source/transform.h | 7 ++- crawl-ref/source/xom.cc | 6 +-- 16 files changed, 172 insertions(+), 93 deletions(-) diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 1400303..ebd1f31 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -387,7 +387,7 @@ void stop_butcher_delay() void maybe_clear_weapon_swap() { - if (transformation_can_wield(static_cast<transformation_type>( + if (transform_can_wield(static_cast<transformation_type>( you.attribute[ATTR_TRANSFORMATION]))) { you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0; diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 9b9133f..a833ef6 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -4079,8 +4079,7 @@ std::string get_skill_description(int skill, bool need_title) unarmed_attacks.push_back("kick with your hooves"); else if (player_mutation_level(MUT_TALONS)) unarmed_attacks.push_back("claw with your talons"); - else if (you.species != SP_NAGA - && (you.species != SP_MERFOLK || !you.swimming())) + else if (you.species != SP_NAGA && !you.fishtail) { unarmed_attacks.push_back("deliver a kick"); } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 68345b3..87f9ed0 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -634,7 +634,7 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) } if (!ignore_temporary - && you.species == SP_MERFOLK && you.swimming()) + && you.fishtail) { if (verbose) mpr("You don't currently have feet!"); @@ -1164,14 +1164,8 @@ static bool _fire_validate_item(int slot, std::string &err) // Returns true if warning is given. static bool _fire_warn_if_impossible() { - // FIXME: merge this into transform_can_equip_slot() - const int trans = you.attribute[ATTR_TRANSFORMATION]; // If you can't wield it, you can't throw it. - if (trans == TRAN_SPIDER - || trans == TRAN_BLADE_HANDS - || trans == TRAN_ICE_BEAST - || trans == TRAN_DRAGON - || trans == TRAN_BAT) + if (!transform_can_wield()) { canned_msg(MSG_PRESENT_FORM); return (true); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 8f20e30..aca1a40 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1321,17 +1321,25 @@ void search_around(bool only_adjacent) void merfolk_start_swimming(bool stepped) { - if (you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE) - untransform(false, true); // We're already entering the water. + if (you.fishtail) + return; - if (stepped) + if (you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE + && you.attribute[ATTR_TRANSFORMATION] != TRAN_BLADE_HANDS) + { + mpr("You quickly transform back into your natural form."); + untransform(false, true); // We're already entering the water. + } + else if (stepped) mpr("Your legs become a tail as you enter the water."); else mpr("Your legs become a tail as you dive into the water."); + you.fishtail = true; remove_one_equip(EQ_BOOTS); you.redraw_evasion = true; +// FIXME: player doll isn't updated properly when player flies out of water #ifdef USE_TILE init_player_doll(); #endif @@ -1339,6 +1347,9 @@ void merfolk_start_swimming(bool stepped) void merfolk_stop_swimming() { + if (!you.fishtail) + return; + you.fishtail = false; unmeld_one_equip(EQ_BOOTS); you.redraw_evasion = true; diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index 0572c1f..8432dca 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -1838,8 +1838,7 @@ static void _do_high_level_summon(monster* mons, bool monsterNearby, // Returns true if a message referring to the player's legs makes sense. static bool _legs_msg_applicable() { - return (you.species != SP_NAGA - && (you.species != SP_MERFOLK || !you.swimming())); + return (you.species != SP_NAGA && !you.fishtail); } void mons_cast_haunt(monster* mons) diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc index adeb7eb..190bb01 100644 --- a/crawl-ref/source/player-act.cc +++ b/crawl-ref/source/player-act.cc @@ -397,7 +397,7 @@ std::string player::foot_name(bool plural, bool *can_plural) const str = "underbelly"; *can_plural = false; } - else if (species == SP_MERFOLK && swimming()) + else if (fishtail) { str = "tail"; *can_plural = false; diff --git a/crawl-ref/source/player-equip.cc b/crawl-ref/source/player-equip.cc index fbe7257..f80166f 100644 --- a/crawl-ref/source/player-equip.cc +++ b/crawl-ref/source/player-equip.cc @@ -813,7 +813,8 @@ static void _equip_armour_effect(item_def& arm, bool unmeld) switch (ego) { case SPARM_RUNNING: - mpr("You feel quick."); + if (!you.fishtail) + mpr("You feel quick."); break; case SPARM_FIRE_RESISTANCE: @@ -949,7 +950,8 @@ static void _unequip_armour_effect(item_def& item) switch (get_armour_ego_type(item)) { case SPARM_RUNNING: - mpr("You feel rather sluggish."); + if (!you.fishtail) + mpr("You feel rather sluggish."); break; case SPARM_FIRE_RESISTANCE: diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 48e240d..65fa4ed 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -250,8 +250,10 @@ static bool _check_moveto_dangerous(const coord_def& p, { return (true); } - - canned_msg(MSG_UNTHINKING_ACT); + else if (you.species == SP_MERFOLK && feat_is_water(env.grid(p))) + mpr("You cannot swim in your current form."); + else + canned_msg(MSG_UNTHINKING_ACT); return (false); } @@ -293,15 +295,15 @@ void moveto_location_effects(dungeon_feature_type old_feat, { if (you.species == SP_MERFOLK) { - if (feat_is_water(new_grid) && !feat_is_water(old_feat)) + if (feat_is_water(new_grid) // We're entering water + // We're not transformed, or with a form compatible with tail + && (you.attribute[ATTR_TRANSFORMATION] == TRAN_NONE + || you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS)) { - merfolk_start_swimming(); + merfolk_start_swimming(stepped); } - else if (!feat_is_water(new_grid) && feat_is_water(old_feat) - && !is_feat_dangerous(new_grid)) - { + else if (!feat_is_water(new_grid) && !is_feat_dangerous(new_grid)) merfolk_stop_swimming(); - } } if (new_grid == DNGN_SHALLOW_WATER && !player_likes_water()) @@ -688,8 +690,7 @@ bool you_can_wear(int eq, bool special_armour) bool player_has_feet() { - if (you.species == SP_NAGA - || (you.species == SP_MERFOLK && you.swimming())) + if (you.species == SP_NAGA || you.fishtail) { return (false); } @@ -764,7 +765,7 @@ bool you_tran_can_wear(int eq, bool check_mutation) return (false); if (eq == EQ_BOOTS - && (you.swimming() && you.species == SP_MERFOLK + && (you.fishtail || player_mutation_level(MUT_HOOVES) >= 3 || player_mutation_level(MUT_TALONS) >= 3)) { @@ -1959,7 +1960,7 @@ int player_movement_speed(bool ignore_burden) mv = 5; // but allowed minimum is six else if (you.attribute[ATTR_TRANSFORMATION] == TRAN_PIG) mv = 7; - else if (you.swimming() && you.species == SP_MERFOLK) + else if (you.fishtail) mv = 6; // armour @@ -2280,7 +2281,7 @@ int player_scale_evasion(const int prescaled_ev, const int scale) { case SP_MERFOLK: // Merfolk get an evasion bonus in water. - if (you.swimming()) + if (you.fishtail) { const int ev_bonus = std::min(9 * scale, @@ -3399,7 +3400,7 @@ int check_stealth(void) else if (you.in_water()) { // Merfolk can sneak up on monsters underwater -- bwr - if (you.species == SP_MERFOLK) + if (you.fishtail) stealth += 50; else if ( !you.can_swim() && !you.extra_balanced() ) stealth /= 2; // splashy-splashy @@ -4904,7 +4905,13 @@ void levitate_player(int pow) "You feel %s buoyant.", standing ? "very" : "more"); if (standing) - mpr("You gently float upwards from the floor."); + if (you.fishtail) + { + mpr("Your tail turns into legs as you levitate out of the water."); + merfolk_stop_swimming(); + } + else + mpr("You gently float upwards from the floor."); // Amulet of Controlled Flight can auto-ID. if (!you.duration[DUR_LEVITATION] @@ -4923,13 +4930,6 @@ void levitate_player(int pow) you.increase_duration(DUR_LEVITATION, 25 + random2(pow), 100); - // Merfolk boots unmeld if levitation takes us out of water. - if (standing && you.species == SP_MERFOLK - && feat_is_water(grd(you.pos()))) - { - unmeld_one_equip(EQ_BOOTS); - } - burden_change(); } @@ -5047,6 +5047,7 @@ void player::init() opened_zot = false; royal_jelly_dead = false; transform_uncancellable = false; + fishtail = false; pet_target = MHITNOT; @@ -5295,9 +5296,7 @@ bool player::can_swim(bool permanently) const { // Transforming could be fatal if it would cause unequipment of // stat-boosting boots or heavy armour. - return (species == SP_MERFOLK - || (!permanently - && you.attribute[ATTR_TRANSFORMATION] == TRAN_ICE_BEAST)); + return ((species == SP_MERFOLK || !permanently) && transform_can_swim()); } int player::visible_igrd(const coord_def &where) const @@ -6137,7 +6136,7 @@ int player::has_talons(bool allow_tran) const } // XXX: Do merfolk in water belong under allow_tran? - if (you.species == SP_MERFOLK && you.swimming()) + if (you.fishtail) return (0); return (player_mutation_level(MUT_TALONS)); @@ -6200,7 +6199,7 @@ int player::has_tail(bool allow_tran) const // XXX: Do merfolk in water belong under allow_tran? if (player_genus(GENPC_DRACONIAN) - || you.species == SP_MERFOLK && you.swimming() + || you.fishtail || player_mutation_level(MUT_STINGER)) { return (1); diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 784c488..b5a983e 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -95,6 +95,7 @@ public: bool opened_zot; bool royal_jelly_dead; bool transform_uncancellable; + bool fishtail; // Merfolk fishtail transformation unsigned short pet_target; diff --git a/crawl-ref/source/spl-selfench.cc b/crawl-ref/source/spl-selfench.cc index f3f58b2..78c8256 100644 --- a/crawl-ref/source/spl-selfench.cc +++ b/crawl-ref/source/spl-selfench.cc @@ -391,14 +391,15 @@ void cast_fly(int power) if (!was_levitating) { - if (you.light_flight()) + if (you.fishtail) + { + mpr("Your tail turns into legs as you fly out of the water."); + merfolk_stop_swimming(); + } + else if (you.light_flight()) mpr("You swoop lightly up into the air."); else mpr("You fly up into the air."); - - // Merfolk boots unmeld if flight takes us out of water. - if (you.species == SP_MERFOLK && feat_is_water(grd(you.pos()))) - unmeld_one_equip(EQ_BOOTS); } else mpr("You feel more buoyant."); diff --git a/crawl-ref/source/spl-transloc.cc b/crawl-ref/source/spl-transloc.cc index 2eba20f..08d2b3b 100644 --- a/crawl-ref/source/spl-transloc.cc +++ b/crawl-ref/source/spl-transloc.cc @@ -37,6 +37,7 @@ #include "stuff.h" #include "teleport.h" #include "terrain.h" +#include "transform.h" #include "traps.h" #include "travel.h" #include "view.h" @@ -312,8 +313,11 @@ static bool _cell_vetoes_teleport (const coord_def cell, bool check_monsters = return (false); case DNGN_DEEP_WATER: - if (you.species == SP_MERFOLK) + if (you.species == SP_MERFOLK && (transform_can_swim() + || !you.transform_uncancellable)) + { return (false); + } else return (true); diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index fd0df19..f975fa8 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1028,6 +1028,9 @@ static void tag_construct_you(writer &th) marshallShort(th, you.hp); marshallShort(th, you.hunger); +#if TAG_MAJOR_VERSION > 31 + marshallBoolean(th, you.fishtail); +#endif // how many you.equip? marshallByte(th, NUM_EQUIP); @@ -1602,6 +1605,9 @@ static void tag_read_you(reader &th, int minorVersion) you.hp = unmarshallShort(th); you.hunger = unmarshallShort(th); +#if TAG_MAJOR_VERSION > 31 + you.fishtail = unmarshallBoolean(th); +#endif // How many you.equip? count = unmarshallByte(th); diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index f5e042d..f8f8892 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -1283,7 +1283,9 @@ bool fall_into_a_pool( const coord_def& entry, bool allow_shift, bool escape = false; coord_def empty; - if (you.species == SP_MERFOLK && terrain == DNGN_DEEP_WATER) + if (you.species == SP_MERFOLK && terrain == DNGN_DEEP_WATER + && you.attribute[ATTR_TRANSFORMATION] != TRAN_ICE_BEAST + && !you.transform_uncancellable) { // These can happen when we enter deep water directly -- bwr merfolk_start_swimming(); diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc index 7bb2fda..c4c0ac3 100644 --- a/crawl-ref/source/transform.cc +++ b/crawl-ref/source/transform.cc @@ -35,13 +35,43 @@ static void _extra_hp(int amount_extra); -bool transformation_can_wield(transformation_type trans) +bool transform_can_wield(transformation_type trans) { return (trans == TRAN_NONE || trans == TRAN_STATUE || trans == TRAN_LICH); } +bool transform_can_wield() +{ + return (transform_can_wield(static_cast<transformation_type>( + you.attribute[ATTR_TRANSFORMATION]))); +} + +bool transform_can_fly(transformation_type trans) +{ + return (trans == TRAN_DRAGON || trans == TRAN_BAT); +} + +bool transform_can_fly() +{ + return (transform_can_fly(static_cast<transformation_type>( + you.attribute[ATTR_TRANSFORMATION]))); +} + +bool transform_can_swim(transformation_type trans) +{ + return(trans == TRAN_ICE_BEAST + || you.species == SP_MERFOLK + && (trans == TRAN_NONE || trans == TRAN_BLADE_HANDS)); +} + +bool transform_can_swim() +{ + return (transform_can_swim(static_cast<transformation_type>( + you.attribute[ATTR_TRANSFORMATION]))); +} + bool transform_allows_wearing_item(const item_def& item) { return ( @@ -118,7 +148,7 @@ static std::set<equipment_type> _init_equipment_removal(transformation_type trans) { std::set<equipment_type> result; - if (!transformation_can_wield(trans) && you.weapon()) + if (!transform_can_wield(trans) && you.weapon()) result.insert(EQ_WEAPON); // Liches can't wield holy weapons. @@ -390,6 +420,7 @@ static bool _abort_or_fizzle(bool just_check) if (!just_check && you.turn_is_over) { canned_msg(MSG_SPELL_FIZZLES); + move_player_to_grid(you.pos(), false, true); return (true); // pay the necessary costs } return (false); // SPRET_ABORT @@ -428,6 +459,12 @@ monster_type transform_mons() bool transform(int pow, transformation_type which_trans, bool force, bool just_check) { + transformation_type previous_trans = static_cast<transformation_type>( + you.attribute[ATTR_TRANSFORMATION]); + bool was_swimming = you.swimming(); + const flight_type was_flying = you.flight_mode(); + + if (!force && crawl_state.is_god_acting()) force = true; @@ -439,22 +476,28 @@ bool transform(int pow, transformation_type which_trans, bool force, return (false); } - if (you.species == SP_MERFOLK && you.swimming() - && which_trans != TRAN_DRAGON && which_trans != TRAN_BAT) + dungeon_feature_type feat = env.grid(you.pos()); + + if (feat == DNGN_DEEP_WATER && you.swimming() + && !transform_can_fly(which_trans) && !transform_can_swim(which_trans)) + { + if (!force) + mpr("You would drown in your new form."); + return (false); + } + + if ((feat == DNGN_DEEP_WATER && !transform_can_swim(which_trans) + || feat == DNGN_LAVA) + && transform_can_fly() && !transform_can_fly(which_trans)) { - // This might be overkill, but it's okay because obviously - // whatever magical ability that lets them walk on land is - // removed when they're in water (in this case, their natural - // form is completely over-riding any other... goes well with - // the forced transform when entering water)... but merfolk can - // transform into flying forms. if (!force) - mpr("You cannot transform out of your normal form while in water."); + mprf("You would %s in your new form.", + feat == DNGN_DEEP_WATER ? "drown" : "burn"); return (false); } // This must occur before the untransform() and the is_undead check. - if (you.attribute[ATTR_TRANSFORMATION] == which_trans) + if (previous_trans == which_trans) { if (you.duration[DUR_TRANSFORMATION] < 100 * BASELINE_DELAY) { @@ -481,7 +524,7 @@ bool transform(int pow, transformation_type which_trans, bool force, // equipment). Ideally, untransforming should cost a turn but nothing // else (as does the "End Transformation" ability). As it is, you // pay with mana and hunger if you already untransformed. - if (!just_check && you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE) + if (!just_check && previous_trans != TRAN_NONE) { bool skip_wielding = false; switch (which_trans) @@ -494,7 +537,7 @@ bool transform(int pow, transformation_type which_trans, bool force, break; } // Skip wielding weapon if it gets unwielded again right away. - untransform(skip_wielding); + untransform(skip_wielding, true); } // Catch some conditions which prevent transformation. @@ -527,14 +570,24 @@ bool transform(int pow, transformation_type which_trans, bool force, int str = 0, dex = 0, xhp = 0, dur = 0; const char* tran_name = "buggy"; - const char* msg = "You transform into something buggy!"; + std::string msg; + + if (was_swimming && transform_can_fly(which_trans)) + msg = "You fly out of the water as you turn into "; + else if (transform_can_fly(previous_trans) + && transform_can_swim(which_trans) + && feat_is_water(grd(you.pos()))) + msg = "As you dive into the water, you turn into "; + else + msg = "You turn into "; + switch (which_trans) { case TRAN_SPIDER: tran_name = "spider"; dex = 5; dur = std::min(10 + random2(pow) + random2(pow), 60); - msg = "You turn into a venomous arachnid creature."; + msg += "a venomous arachnid creature."; break; case TRAN_BLADE_HANDS: @@ -552,14 +605,14 @@ bool transform(int pow, transformation_type which_trans, bool force, if (player_genus(GENPC_DWARVEN) && one_chance_in(10)) msg = "You inwardly fear your resemblance to a lawn ornament."; else - msg = "You turn into a living statue of rough stone."; + msg += "a living statue of rough stone."; break; case TRAN_ICE_BEAST: tran_name = "ice beast"; xhp = 12; dur = std::min(30 + random2(pow) + random2(pow), 100); - msg = "You turn into a creature of crystalline ice."; + msg += "a creature of crystalline ice."; break; case TRAN_DRAGON: @@ -567,13 +620,7 @@ bool transform(int pow, transformation_type which_trans, bool force, str = 10; xhp = 16; dur = std::min(20 + random2(pow) + random2(pow), 100); - if (you.species == SP_MERFOLK && you.swimming()) - { - msg = "You fly out of the water as you turn into " - "a fearsome dragon!"; - } - else - msg = "You turn into a fearsome dragon!"; + msg += "a fearsome dragon!"; break; case TRAN_LICH: @@ -589,9 +636,9 @@ bool transform(int pow, transformation_type which_trans, bool force, dex = 5; dur = std::min(20 + random2(pow) + random2(pow), 100); if (you.species == SP_VAMPIRE) - msg = "You turn into a vampire bat."; + msg += "a vampire bat."; else - msg = "You turn into a bat."; + msg += "a bat."; break; case TRAN_PIG: @@ -604,6 +651,8 @@ bool transform(int pow, transformation_type which_trans, bool force, case TRAN_NONE: case NUM_TRANSFORMATIONS: break; + default: + msg += "something buggy!"; } // If we're just pretending return now. @@ -617,6 +666,8 @@ bool transform(int pow, transformation_type which_trans, bool force, you.redraw_evasion = true; you.redraw_armour_class = true; you.wield_change = true; + if (which_trans != TRAN_BLADE_HANDS) + you.fishtail = false; // Most transformations conflict with stone skin. if (which_trans != TRAN_NONE @@ -707,6 +758,15 @@ bool transform(int pow, transformation_type which_trans, bool force, if (you.species != SP_VAMPIRE || which_trans != TRAN_BAT) transformation_expiration_warning(); + // Re-check terrain now that be may no longer be swimming or flying. + if (was_flying && you.flight_mode() == FL_NONE + || feat_is_water(grd(you.pos())) + && which_trans == TRAN_BLADE_HANDS + && you.species == SP_MERFOLK) + { + move_player_to_grid(you.pos(), false, true); + } + return (true); } @@ -786,11 +846,6 @@ void untransform(bool skip_wielding, bool skip_move) you.duration[DUR_ICY_ARMOUR] = 1; hp_downscale = 12; - - // Re-enter the terrain, it might kill us. - if (!skip_move && feat_is_water(grd(you.pos()))) - move_player_to_grid(you.pos(), false, true); - break; case TRAN_DRAGON: @@ -817,9 +872,14 @@ void untransform(bool skip_wielding, bool skip_move) _unmeld_equipment(melded); - // Re-check terrain now that be may no longer be flying. - if (!skip_move && old_flight && you.flight_mode() == FL_NONE) + // Re-check terrain now that be may no longer be swimming or flying. + if (!skip_move && (old_flight && you.flight_mode() == FL_NONE + || (feat_is_water(grd(you.pos())) + && (old_form == TRAN_ICE_BEAST + || you.species == SP_MERFOLK)))) + { move_player_to_grid(you.pos(), false, true); + } if (transform_can_butcher_barehanded(old_form)) stop_butcher_delay(); diff --git a/crawl-ref/source/transform.h b/crawl-ref/source/transform.h index 3c20620..fc34d36 100644 --- a/crawl-ref/source/transform.h +++ b/crawl-ref/source/transform.h @@ -26,8 +26,13 @@ enum transformation_type NUM_TRANSFORMATIONS // must remain last member {dlb} }; -bool transformation_can_wield(transformation_type trans); +bool transform_can_wield(transformation_type trans); +bool transform_can_wield(); bool transform_can_butcher_barehanded(transformation_type tt); +bool transform_can_fly(transformation_type trans); +bool transform_can_fly(); +bool transform_can_swim(transformation_type trans); +bool transform_can_swim(); // skip_move: don't make player re-enter current cell void untransform(bool skip_wielding = false, bool skip_move = false); diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 5de345a..33a47d1 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -2666,12 +2666,8 @@ static void _xom_zero_miscast() messages.push_back("Your eyebrows wriggle."); } - if (you.species != SP_NAGA - && (you.species != SP_MERFOLK || !you.swimming()) - && !you.airborne()) - { + if (you.species != SP_NAGA && !you.fishtail && !you.airborne()) messages.push_back("You do an impromptu tapdance."); - } /////////////////////////// // Equipment related stuff. -- 1.7.3-rc1 |
||||||
|
Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |