Attached Files |
0001-Avoid-failed-book-acq-w-Trog-and-magic-skills.patch [^] (1,435 bytes) 2013-06-06 04:33 [Show Content] [Hide Content]From 79305ab66c593c76fb8797b769cdff140fcc163a Mon Sep 17 00:00:00 2001
From: Pekka Lampila <pekka.lampila@iki.fi>
Date: Thu, 6 Jun 2013 05:25:32 +0300
Subject: [PATCH] Avoid failed book acq w/ Trog and magic skills
Don't try to give spellbooks for Trog worshippers in acquirement. This
avoids acquirement failing if you are worshipping Trog, but have some
magic skills. Also weights non-magic manuals more.
---
crawl-ref/source/acquire.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc
index 6f80e31..36192fc 100644
--- a/crawl-ref/source/acquire.cc
+++ b/crawl-ref/source/acquire.cc
@@ -980,6 +980,9 @@ static bool _do_book_acquirement(item_def &book, int agent)
other_weights += weight;
}
+ if (you.religion == GOD_TROG)
+ magic_weights = 0;
+
// If someone has 25% or more magic skills, never give manuals.
// Otherwise, count magic skills double to bias against manuals
// for magic users.
@@ -1107,7 +1110,7 @@ static bool _do_book_acquirement(item_def &book, int agent)
// Are we too skilled to get any manuals?
if (total_weights == 0)
- return _do_book_acquirement(book, agent);
+ return false;
book.sub_type = BOOK_MANUAL;
book.plus = choose_random_weighted(weights, weights + NUM_SKILLS);
--
1.8.1.2
|