local tShoes = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}
function randomShoes()
if Conditions["cond_no_more_shoes"].ConditionValue == false then
local shoeNum = math.random(1, #(tShoes))
print('shoe index number '..shoeNum..' is called: '..tShoes[shoeNum])
print('max numbers of shoes: '..#(tShoes))
if #(tShoes) <= 1 then
Conditions["cond_no_more_shoes"].ConditionValue = true
print('the shoe seller has nothing left in stock')
end
table.remove(tShoes, shoeNum)
end
end
--this randomize fabians shoes
tShoes = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
local cNoShoes = Conditions["cond_no_more_shoes"]
local vShoeCounter = Characters["char_fabian"].Values["count_fabians_shoes"]
function randomShoes()
if cNoShoes.ConditionValue == false then
if #(tShoes) >= 1 then
local shoeNum = math.random(1, #(tShoes))
print('shoe index number '..shoeNum..' is called: '..tShoes[shoeNum])
print('max numbers of shoes: '..#(tShoes))
vShoeCounter.Int = tonumber(tShoes[shoeNum])
table.remove(tShoes, shoeNum)
else
cNoShoes.ConditionValue = true
print('the shoe seller has nothing left in stock')
end
end
end
--clears shoe table before load a savegame
function clearShoeTable()
tShoes = {}
print('the shoe table has '..#(tShoes)..' entries')
end
--play the correct animation when showing scene
function playShoesAnimation()
local numShoes = vShoeCounter.Int
if numShoes <= 42 and cNoShoes.ConditionValue == false then
startAnimation("Scenes[room_03_lounge].Objects[set_fabian_legs].Animations[shoes_"..numShoes.."]")
print('play animation shoes_'..numShoes)
end
end