Fix random note selection in entity scripts.
This patch corrects the logic used in some entity scripts for random
note selection so that any note can be chosen. Previously, note 0
(low C) could not be selected due to a logic bug.
--- a/game_scripts/scripts/entities/forestgod.lua Tue Nov 02 13:49:46 2010 +0900
+++ b/game_scripts/scripts/entities/forestgod.lua Sun Jan 30 01:24:31 2011 +0900
@@ -586,7 +586,7 @@
fadeOutMusic(4)
elseif entity_isState(me, STATE_SINGNOTE) then
- v.sungNote = math.random(7)
+ v.sungNote = math.random(8)-1
entity_sound(me, string.format("Note%d", v.sungNote), 500, entity_getStateTime(me))
v.noteQuad = createQuad(string.format("Song/NoteSymbol%d", v.sungNote), 6)
quad_alpha(v.noteQuad, 0)
--- a/game_scripts/scripts/entities/simon.lua Tue Nov 02 13:49:46 2010 +0900
+++ b/game_scripts/scripts/entities/simon.lua Sun Jan 30 01:24:31 2011 +0900
@@ -47,10 +47,9 @@
v.idolWeight = 200
--- note: check this against creatorform5 when its done
function generateSong()
for i=1, 10 do
- v.song[i] = math.random(7)
+ v.song[i] = math.random(8)-1
end
end