Merge branch 'master' into octopus, fix breakage.
authorAdam Borowski <kilobyte@angband.pl>
Thu, 3 Feb 2011 16:52:42 +0000 (17:52 +0100)
committerAdam Borowski <kilobyte@angband.pl>
Thu, 3 Feb 2011 16:52:42 +0000 (17:52 +0100)
25 files changed:
1  2 
crawl-ref/source/aptitudes.h
crawl-ref/source/command.cc
crawl-ref/source/describe.cc
crawl-ref/source/enum.h
crawl-ref/source/fight.cc
crawl-ref/source/godpassive.cc
crawl-ref/source/invent.cc
crawl-ref/source/item_use.cc
crawl-ref/source/itemname.cc
crawl-ref/source/items.cc
crawl-ref/source/l_item.cc
crawl-ref/source/misc.cc
crawl-ref/source/mutation-data.h
crawl-ref/source/mutation.cc
crawl-ref/source/ng-setup.cc
crawl-ref/source/output.cc
crawl-ref/source/player-act.cc
crawl-ref/source/player-equip.cc
crawl-ref/source/player.cc
crawl-ref/source/player.h
crawl-ref/source/skills2.cc
crawl-ref/source/species.cc
crawl-ref/source/spl-cast.cc
crawl-ref/source/wiz-item.cc
crawl-ref/source/xom.cc

@@@ -1133,40 -1166,6 +1166,41 @@@ static const species_skill_aptitude spe
      APT(SP_CAT,             SK_POISON_MAGIC,   -1),
      APT(SP_CAT,             SK_INVOCATIONS,    -1),
      APT(SP_CAT,             SK_EVOCATIONS,     -2),
 +
 +    // SP_OCTOPUS
 +    APT(SP_OCTOPUS,         SK_FIGHTING,       -1),
 +    APT(SP_OCTOPUS,         SK_SHORT_BLADES,   -1),
 +    APT(SP_OCTOPUS,         SK_LONG_BLADES,    -1),
 +    APT(SP_OCTOPUS,         SK_AXES,            0),
 +    APT(SP_OCTOPUS,         SK_MACES_FLAILS,    0),
 +    APT(SP_OCTOPUS,         SK_POLEARMS,        1),
 +    APT(SP_OCTOPUS,         SK_STAVES,          1),
 +    APT(SP_OCTOPUS,         SK_SLINGS,         -3),
 +    APT(SP_OCTOPUS,         SK_BOWS,           -3),
 +    APT(SP_OCTOPUS,         SK_CROSSBOWS,      -3),
 +    APT(SP_OCTOPUS,         SK_THROWING,       -3),
 +    APT(SP_OCTOPUS,         SK_ARMOUR,         -4),
 +    APT(SP_OCTOPUS,         SK_DODGING,        -1),
 +    APT(SP_OCTOPUS,         SK_STEALTH,         2),
 +    APT(SP_OCTOPUS,         SK_STABBING,        0),
 +    APT(SP_OCTOPUS,         SK_SHIELDS,        -3),
 +    APT(SP_OCTOPUS,         SK_TRAPS_DOORS,     2),
 +    APT(SP_OCTOPUS,         SK_UNARMED_COMBAT,  0),
 +    APT(SP_OCTOPUS,         SK_SPELLCASTING,    0),
 +    APT(SP_OCTOPUS,         SK_CONJURATIONS,   -4),
-     APT(SP_OCTOPUS,         SK_ENCHANTMENTS,    0),
++    APT(SP_OCTOPUS,         SK_HEXES,           0),
++    APT(SP_OCTOPUS,         SK_CHARMS,          0),
 +    APT(SP_OCTOPUS,         SK_SUMMONINGS,      0),
 +    APT(SP_OCTOPUS,         SK_NECROMANCY,      0),
 +    APT(SP_OCTOPUS,         SK_TRANSLOCATIONS,  0),
 +    APT(SP_OCTOPUS,         SK_TRANSMUTATIONS,  0),
 +    APT(SP_OCTOPUS,         SK_FIRE_MAGIC,     -2),
 +    APT(SP_OCTOPUS,         SK_ICE_MAGIC,       1),
 +    APT(SP_OCTOPUS,         SK_AIR_MAGIC,      -2),
 +    APT(SP_OCTOPUS,         SK_EARTH_MAGIC,    -1),
 +    APT(SP_OCTOPUS,         SK_POISON_MAGIC,    2),
 +    APT(SP_OCTOPUS,         SK_INVOCATIONS,     0),
 +    APT(SP_OCTOPUS,         SK_EVOCATIONS,      2),
  };
  
  #endif
Simple merge
Simple merge
Simple merge
@@@ -1073,14 -1073,8 +1073,14 @@@ void melee_attack::player_aux_setup(una
          noise_factor = 125;
          break;
  
 +    case UNAT_TENTACLES:
 +        aux_attack = aux_verb = "tentacle-slap";
 +        aux_damage += 4 * you.has_usable_tentacles();
 +        noise_factor = 125;
 +        break;
 +
      default:
-         ASSERT(false);
+         die("unknown aux attack type");
          break;
      }
  }
@@@ -1092,14 -1086,11 +1092,14 @@@ static bool _tran_forbid_aux_attack(una
      case UNAT_KICK:
      case UNAT_HEADBUTT:
      case UNAT_PUNCH:
-         return (you.attribute[ATTR_TRANSFORMATION] == TRAN_ICE_BEAST
-                 || you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON
-                 || you.attribute[ATTR_TRANSFORMATION] == TRAN_SPIDER
-                 || you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT);
+         return (you.form == TRAN_ICE_BEAST
+                 || you.form == TRAN_DRAGON
+                 || you.form == TRAN_SPIDER
+                 || you.form == TRAN_BAT);
  
 +    case UNAT_TENTACLES:
-         return (you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE);
++        return (you.form != TRAN_NONE);
 +
      default:
          return (false);
      }
Simple merge
@@@ -1621,18 -1616,23 +1616,24 @@@ bool check_warning_inscriptions(const i
                  equip = you.equip[EQ_AMULET];
              else
              {
 -                equip = you.equip[EQ_LEFT_RING];
 -                if (equip != -1 && item.link == equip)
 -                    return (check_old_item_warning(item, oper));
  
 -                // Or maybe the other ring?
 -                equip = you.equip[EQ_RIGHT_RING];
 -            }
 +                for (int slots = EQ_LEFT_RING; slots < NUM_EQUIP; ++slots)
 +                {
 +                    if (slots == EQ_AMULET)
 +                    continue;
  
 -            if (equip != -1 && item.link == equip)
 -                return (check_old_item_warning(item, oper));
 +                    equip = you.equip[slots];
 +                    if (equip != -1 && item.link == equip)
 +                        return (check_old_item_warning(item, oper));
 +                }
 +            }
          }
+         else if (oper == OPER_REMOVE || oper == OPER_TAKEOFF)
+         {
+             // Don't ask if it will fail anyway.
+             if (item.cursed())
+                 return (true);
+         }
  
          std::string prompt = "Really " + _operation_verb(oper) + " ";
          prompt += (in_inventory(item) ? item.name(DESC_INVENTORY)
Simple merge
@@@ -267,24 -269,10 +271,23 @@@ std::string item_def::name(description_
                                                     : " (right paw)");
                      break;
                  case EQ_AMULET:
 -                    buff << " (around neck)";
 +                    if (you.species == SP_OCTOPUS)
 +                        buff << " (around mantle)";
 +                    else
 +                        buff << " (around neck)";
                      break;
 +                case EQ_RING_ONE:
 +                case EQ_RING_TWO:
 +                case EQ_RING_THREE:
 +                case EQ_RING_FOUR:
 +                case EQ_RING_FIVE:
 +                case EQ_RING_SIX:
 +                case EQ_RING_SEVEN:
 +                case EQ_RING_EIGHT:
 +                    buff << " (on tentacle)";
 +                break;
                  default:
-                     ASSERT(false);
-                     break;
+                     die("Item in an invalid slot");
                  }
              }
          }
Simple merge
@@@ -172,8 -172,8 +172,8 @@@ static int l_item_do_remove(lua_State *
  
      bool result = false;
      if (eq == EQ_WEAPON)
-         result = wield_weapon(true, -1);
+         result = wield_weapon(true, SLOT_BARE_HANDS);
 -    else if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET)
 +    else if (eq >= EQ_LEFT_RING && eq < NUM_EQUIP)
          result = remove_ring(item->link);
      else
          result = takeoff_armour(item->link);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -119,9 -120,12 +120,12 @@@ static void _equip_effect(equipment_typ
          return;
  
      ASSERT(slot == eq
 -           || eq == EQ_RINGS
 -              && (slot == EQ_LEFT_RING || slot == EQ_RIGHT_RING));
 +           || eq == EQ_RINGS && (slot == EQ_LEFT_RING || slot == EQ_RIGHT_RING)
 +           || eq == EQ_RINGS && you.species == SP_OCTOPUS);
  
+     if (msg)
+         _equip_use_warning(item);
      if (slot == EQ_WEAPON)
          _equip_weapon_effect(item, msg);
      else if (slot >= EQ_CLOAK && slot <= EQ_BODY_ARMOUR)
@@@ -6528,23 -6558,6 +6578,23 @@@ int player::has_usable_pseudopods(bool 
      return (has_pseudopods(allow_tran));
  }
  
 +int player::has_tentacles(bool allow_tran) const
 +{
 +    if (allow_tran)
 +    {
-         if (attribute[ATTR_TRANSFORMATION] != TRAN_NONE)
++        if (you.form != TRAN_NONE)
 +            return (0);
 +    }
 +
 +    return (player_mutation_level(MUT_TENTACLES));
 +}
 +
 +int player::has_usable_tentacles(bool allow_tran) const
 +{
 +    return (has_tentacles(allow_tran));
 +}
 +
 +
  bool player::sicken(int amount)
  {
      ASSERT(!crawl_state.game_is_arena());
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge