Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if !Gamemode then
- Gamemode = {
- score = 0,
- combos = {},
- }
- end
- function addCombo( data )
- Gamemode.combos[ #Gamemode.combos ] = data
- end
- function getCombosBonus()
- local retval = 0
- for index=1,#Gamemode.combos do
- retval = retval + Gamemode.combos[index].value
- end
- return retval
- end
- function OnPuzzleCollecting()
- local points = 0
- local puzzle = GetPuzzle()
- local cells = puzzle["cells"]
- for colnum=1,#cells do
- local col = cells[colnum]
- for rownum=1,#col do
- local cell = col[rownum]
- if cell["matched"] then
- local cellPoints = 10 * ((cell["type"]+1) * cell["matchsize"])
- points = points + cellPoints
- -- combo stuff
- addCombo { value = cellPoints }
- end
- end
- end
- Gamemode.score = Gamemode.score + points
- SetGlobalScore{ score = Gamemode.score, showdelta = true }
- -- copied from mono_classic.lua
- end
- function OnRequestFinalScoring()
- return {
- rawscore = Gamemode.score,
- bonuses = {
- "Combos: " .. #Gamemode.combos,
- "Score:" .. Gamemode.score
- },
- finalscore = Gamemode.score + getCombosBonus()
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment