Adjust some more artefact restrictions
authorKate <601195+semitonal@users.noreply.github.com>
Tue, 27 Apr 2021 20:19:49 +0000 (21:19 +0100)
committerKate <601195+semitonal@users.noreply.github.com>
Tue, 27 Apr 2021 20:52:19 +0000 (21:52 +0100)
Prevents -Cast and +MP on the same artefact, and prevents Trog from
gifting items with +Int. Also adjusts which item types can be named after
which gods - quick blades can now be named after Chei (since they're no
longer a hated item), and non-weapons can't be named after Trog.

crawl-ref/source/artefact.cc
crawl-ref/source/god-item.cc

index 441ed68..88fbfcd 100644 (file)
@@ -138,8 +138,11 @@ static bool _god_fits_artefact(const god_type which_god, const item_def &item,
             return false;
         }
 
-        if (artefact_property(item, ARTP_MAGICAL_POWER) > 0)
+        if (artefact_property(item, ARTP_MAGICAL_POWER) > 0
+            || artefact_property(item, ARTP_INTELLIGENCE) > 0)
+        {
             return false;
+        }
         break;
 
     case GOD_CHEIBRIADOS:
@@ -1512,8 +1515,11 @@ static bool _randart_is_conflicting(const item_def &item,
 {
     // see also _artp_can_go_on_item
 
-    if (proprt[ARTP_PREVENT_SPELLCASTING] && proprt[ARTP_INTELLIGENCE] > 0)
+    if (proprt[ARTP_PREVENT_SPELLCASTING]
+        && proprt[ARTP_INTELLIGENCE] > 0 || proprt[ARTP_MAGICAL_POWER] > 0)
+    {
         return true;
+    }
 
     if (item.base_type == OBJ_WEAPONS
         && get_weapon_brand(item) == SPWPN_HOLY_WRATH
index 3de566d..c713107 100644 (file)
@@ -416,36 +416,16 @@ bool god_likes_item_type(const item_def &item, god_type which_god)
     // XXX: also check god_hates_item()?
     switch (which_god)
     {
-        case GOD_ELYVILON:
-            // Peaceful healer god: no weapons, no berserking.
-            if (item.base_type == OBJ_WEAPONS)
-                return false;
-            break;
-
-        case GOD_SIF_MUNA:
+        case GOD_ELYVILON: // Peaceful healer god: no weapons.
+        case GOD_SIF_MUNA: // The magic gods: no weapons.
         case GOD_VEHUMET:
-            // The magic gods: no weapons, no preventing spellcasting.
             if (item.base_type == OBJ_WEAPONS)
                 return false;
             break;
 
         case GOD_TROG:
-            // Anti-magic god: no spell use, no enhancing magic.
-            if (item.base_type == OBJ_BOOKS)
-                return false;
-
-            if (item.base_type == OBJ_JEWELLERY
-                && (item.sub_type == RING_WIZARDRY
-                    || item.sub_type == RING_ICE
-                    || item.sub_type == RING_MAGICAL_POWER))
-            {
-                return false;
-            }
-            break;
-
-        case GOD_CHEIBRIADOS:
-            // Slow god: no quick blades, no berserking.
-            if (item.is_type(OBJ_WEAPONS, WPN_QUICK_BLADE))
+            // Berserker god: weapons only.
+            if (item.base_type != OBJ_WEAPONS)
                 return false;
             break;