Skip to content
Snippets Groups Projects
Commit 08604400 authored by dg's avatar dg
Browse files

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@4280 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5bcb6897
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ function _M:init(file)
end
self.min_syl = 2
self.max_syl = 4
self.max_syl = 3
self.forbidden = {}
end
......@@ -71,7 +71,7 @@ function _M:generate(no_repeat, min_syl, max_syl)
max_syl = max_syl or self.max_syl
-- Random number of syllables, the last one is always appended
local num_syl = rng.range(min_syl, max_syl - 1)
local num_syl = rng.range(min_syl, max_syl)
-- Turn ends list of tuples into a dictionary
local ends_dict = table.from_list(self.ends, 's', 'c')
......@@ -87,7 +87,7 @@ function _M:generate(no_repeat, min_syl, max_syl)
word = {self.syllables[syl]}
local done_end = false
for i = 1, num_syl do
for i = 1, num_syl - 2 do
-- don't end yet if we don't have the minimum number of syllables
local eend
if i < min_syl then eend = 0
......@@ -107,7 +107,8 @@ function _M:generate(no_repeat, min_syl, max_syl)
word[#word+1] = self.syllables[syl]
end
word_str = word_str..table.concat(word)
print("Make word from", table.concat(word, ", "), num_syl)
word_str = table.concat(word)
end
-- to ensure the word doesn't repeat, add it to the forbidden words
......@@ -116,8 +117,9 @@ function _M:generate(no_repeat, min_syl, max_syl)
return word_str:capitalize()
end
function _M:selectSyllable(counts, end_count, used)
if not counts or #counts == 0 then return end
function _M:selectSyllable(counts, end_count, used, tries)
tries = tries or 50
if not counts or #counts == 0 or tries <= 0 then return end
-- "counts" holds cumulative counts, so take the last element in the list
-- (and 2nd in that tuple) to get the sum of all counts
......@@ -125,7 +127,7 @@ function _M:selectSyllable(counts, end_count, used)
for _, d in ipairs(counts) do
if d.c >= chosen then
if used[d.s] then return self:selectSyllable(counts, end_count, used) end
if used[d.s] then return self:selectSyllable(counts, end_count, used, tries - 1) end
used[d.s] = true
return d.s
end
......
......@@ -136,6 +136,7 @@ function _M:pickupFloor(i, vocal, no_sort)
local letter = ShowPickupFloor:makeKeyChar(self:itemPosition(self.INVEN_INVEN, o) or 1)
if vocal then game.logSeen(self, "%s picks up (%s.): %s.", self.name:capitalize(), letter, o:getName{do_color=true}) end
return true
elseif not prepickup then
if vocal then game.logSeen(self, "%s has no room for: %s.", self.name:capitalize(), o:getName{do_color=true}) end
end
......
......@@ -1122,6 +1122,15 @@ game.player:learnTalent('T_DREDGE_FRENZY',true)
game.player:learnTalent('T_SEVER_LIFELINE',true)
game.player:learnTalent('T_CALL_OF_AMAKTHEL',true)
game.player:learnTalent('T_GIFT_OF_AMAKTHEL',true)
game.player:learnTalent('T_ABYSSAL_SHROUD',true)
game.player:learnTalent('T_ECHOES_FROM_THE_VOID',true)
game.player:learnTalent('T_FRENZIED_BITE',true)
game.player:learnTalent('T_FRENZIED_LEAP',true)
game.player:learnTalent('T_GNASHING_TEETH',true)
game.player:learnTalent('T_INNER_DEMONS',true)
game.player:learnTalent('T_VOID_SHARDS',true)
game.player:learnTalent('T_WAKING_NIGHTMARE',true)
game.player:learnTalent('T_WORM_ROT',true)
end end,
}
......
......@@ -158,9 +158,7 @@ function _M:describeFloor(x, y)
local i, nb = 1, 0
local obj = game.level.map:getObject(x, y, i)
while obj do
if obj.auto_pickup then
self:pickupFloor(i, true)
else
if not (obj.auto_pickup and self:pickupFloor(i, true)) then
if self:attr("auto_id") and obj:getPowerRank() <= self.auto_id then obj:identify(true) end
nb = nb + 1
i = i + 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment