Code: Select all
function checkAlcoveForItems()
local firstSolutionFound = false
local secondSolutionFound = false
local firstBlueRight = false
local firstGreenRight = false
local firstRedRight = false
local secondBlueRight = false
local secondGreenRight = false
local secondRedRight = false
for i in dungeon_alcove_1:containedItems() do
if i.name == "blue_gem" then
firstBlueRight = true
break
else
firstBlueRight = false
break
end
end
for i in dungeon_alcove_4:containedItems() do
if i.name == "red_gem" then
firstRedRight = true
break
else
firstRedRight = false
break
end
end
for i in dungeon_alcove_5:containedItems() do
if i.name == "green_gem" then
firstGreenRight = true
break
else
firstGreenRight = false
break
end
end
if firstSolutionFound then
playSound("level_up")
exitdoor:open()
else
exitdoor:close()
end
if secondSolutionFound then
playSound("level_up")
prizedoor:open()
else
prizedoor:close()
end
Code: Select all
function checkForSolution()
for i in dungeon_alcove_1:containedItems() do
if i.name == "blue_gem" and
for i in dungeon_alcove_4:containedItems() do
if i.name == "red_gem" and
for i in dungeon_alcove_5:containedItems() do
if i.name == "green_gem" then
exitdoor:open()
break
else
spawn("poison_cloud", party.level, party.x, party.y, 0)
or
for i in dungeon_alcove_2:containedItems() do
if i.name == "green_gem" and
for i in dungeon_alcove_3:containedItems() do
if i.name == "red_gem" and
for i in dungeon_alcove_5:containedItems() do
if i.name == "blue_gem" then
prizedoor:open()
break
else
spawn("poison_cloud", party.level, party.x, party.y, 0)
end
end
end
end
end
end
end
how many of these ends do I need?
Does that work with an "OR" in it? Does that part after the "OR" need to be nested before the damage, so it looks for the first half, then if not true, checks the second set, THEN if both aren't true, damage.
Code: Select all
function checkForSolution()
for i in dungeon_alcove_1:containedItems() do
if i.name == "blue_gem" and
for i in dungeon_alcove_4:containedItems() do <-- unexpected symbol near "for"
if i.name == "red_gem" and
for i in dungeon_alcove_5:containedItems() do
if i.name == "green_gem" then
exitdoor:open()
break
else
for i in dungeon_alcove_2:containedItems() do
if i.name == "green_gem" and
for i in dungeon_alcove_3:containedItems() do
if i.name == "red_gem" and
for i in dungeon_alcove_5:containedItems() do
if i.name == "blue_gem" then
prizedoor:open()
break
else
spawn("poison_cloud", party.level, party.x, party.y, 0)
end
end
end
end
end
end
end
end
end
end
end
end
Oh, and I still need to know how to recolor the lights from the temple_ceiling_light.