Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OJ_gameplay(pn)
- SOUND:PlayOnce(songName..'lua/p'..pn..'.ogg')
- if effect[pn] == 2 then
- roll1[pn] = math.random(1,6)
- roll3[pn] = math.random(1,6)
- roll = roll1[pn]+roll3[pn]
- rspace[pn] = '+'
- effect[pn] = 0
- else
- roll1[pn] = math.random(1,6)
- roll3[pn] = ''
- roll = roll1[pn]
- rspace[pn] = ''
- end
- if pn == 1 then
- pn2 = 2
- stars[1] = stars[1] + 5
- stars[2] = stars[2] + 5
- battlestars[1] = stars[1]
- battlestars[2] = stars[2]
- stars1:settext(stars[1])
- stars2:settext(stars[2])
- else
- pn2 = 1
- stars1:settext(stars[1])
- stars2:settext(stars[2])
- end
- dice[1]:settext(roll..'\n\n'..roll1[pn]..rspace[pn]..roll3[pn])
- sdice('sleep',bl*4)
- sdice('queuecommand','empty')
- spn('sleep',bl*4)
- croll = 0
- local sroll = roll
- local fite = false
- local wait = {}
- repeat
- lastpos[pn] = lastpos[pn] + 1
- croll = croll + 1
- if lastpos[pn] == 9 then lastpos[pn] = 1 end
- Player[pn]:linear(bl)
- Player[pn]:x(platpos[lastpos[pn]][1])
- Player[pn]:y(platpos[lastpos[pn]][2])
- roll = roll - 1
- panel = true
- if lastpos[pn] == lastpos[pn2] then
- soundfile2 = songName..'lua/battle.ogg'
- sdice('sleep',bl*(croll+2))
- dice[1]:queuecommand('playsound2')
- Player[pn2]:sleep(bl*croll)
- spn('sleep',bl*2)
- spn('linear',0.000001)
- spn('x',{SCREEN_CENTER_X-180,SCREEN_CENTER_X+180})
- spn('y',SCREEN_CENTER_Y)
- spn('zoom',.75)
- sdice('x',{SCREEN_CENTER_X-32,SCREEN_CENTER_X+32})
- if charmode[pn] or charmode[pn2] then
- charidle:sleep(bl*(croll+6))
- charattack:sleep(bl*(croll+6))
- charhurt:sleep(bl*(croll+6))
- end
- if pn == 1 then
- KO = false
- OJ_battle(pn,pn2,45,3,7,100)
- if KO then
- wait[1] = 4+croll
- wait[2] = 2+10
- wait[3] = 2
- else
- OJ_battle(pn2,pn,-45,7,3,200)
- wait[1] = 4+croll
- wait[2] = 2+10+10
- wait[3] = 2
- if KO then
- panel = false
- end
- end
- else
- KO = false
- OJ_battle(pn,pn2,-45,7,3,100)
- if KO then
- wait[1] = 4+croll
- wait[2] = 2+10
- wait[3] = 2
- else
- OJ_battle(pn2,pn,45,3,7,200)
- wait[1] = 4+croll
- wait[2] = 2+10+10
- wait[3] = 2
- if KO then
- panel = false
- end
- end
- end
- sdice('x',SCREEN_CENTER_X)
- spn('sleep',bl*6)
- spn('x',{platpos[lastpos[1]][1],platpos[lastpos[2]][1]})
- spn('y',{platpos[lastpos[1]][2],platpos[lastpos[2]][2]})
- spn('zoom',.5)
- stars1:sleep(bl*((wait[1]*2)+wait[2]-5))
- stars2:sleep(bl*((wait[1]*2)+wait[2]-5))
- stars1:queuecommand('bstars')
- stars2:queuecommand('bstars')
- stars1:sleep(bl*5)
- stars2:sleep(bl*5)
- roll = 0
- fite = true
- else
- wait[1] = 4+croll
- wait[2] = -croll
- wait[3] = croll
- end
- until roll == 0
- if panel == true then
- soundfile = songName..'lua/'..platfuc[lastpos[pn]]..'.ogg'
- dice[1]:sleep(bl*wait[1])
- dice[1]:queuecommand('playsound')
- roll4 = math.random(1,6)
- if platfuc[lastpos[pn]] == 'bonus' then
- stars[pn] = stars[pn] + roll4
- dice[1]:sleep(bl*5)
- dice[1]:queuecommand('texts')
- elseif platfuc[lastpos[pn]] == 'drop' then
- stars[pn] = stars[pn] - roll4
- dice[1]:sleep(bl*5)
- dice[1]:queuecommand('texts')
- elseif platfuc[lastpos[pn]] == 'warp' then
- if lastpos[pn] == 4 then
- lastpos[pn] = 8
- else
- lastpos[pn] = 4
- end
- dice[1]:sleep(bl*5)
- Player[pn]:sleep(bl*(wait[3]+1))
- Player[pn]:linear(bl)
- Player[pn]:rotationy(180*4)
- Player[pn]:linear(.000001)
- Player[pn]:rotationy(0)
- Player[pn]:x(platpos[lastpos[pn]][1])
- Player[pn]:y(platpos[lastpos[pn]][2])
- elseif platfuc[lastpos[pn]] == 'draw' then
- local drawcard = math.random(1,2)
- dice[1]:sleep(bl*5)
- card[drawcard]:sleep(bl*((wait[1]*2)+wait[2]))
- card[drawcard]:linear(.000001)
- card[drawcard]:diffusealpha(1)
- card[drawcard]:linear(bl/2)
- card[drawcard]:y(SCREEN_CENTER_Y-100)
- card[drawcard]:rotationy(180*2)
- card[drawcard]:linear(bl/2)
- card[drawcard]:y(SCREEN_CENTER_Y)
- card[drawcard]:rotationy(0)
- card[drawcard]:linear(bl/2)
- card[drawcard]:zoom(.5)
- card[drawcard]:linear(.000001)
- card[drawcard]:sleep(bl)
- card[drawcard]:diffusealpha(0)
- card[drawcard]:zoom(.25)
- effect[pn] = drawcard
- end
- else
- dice[1]:sleep(bl*(wait[1]+5))
- end
- if stars[pn] < 0 then stars[pn] = 0 end
- if fite == true then
- stars1:sleep(bl*(5))
- stars2:sleep(bl*(5))
- else
- stars1:sleep(bl*((wait[1]*2)+wait[2]+5))
- stars2:sleep(bl*((wait[1]*2)+wait[2]+5))
- end
- stars1:queuecommand('stars')
- stars2:queuecommand('stars')
- dice[1]:sleep(bl*4)
- dice[1]:queuecommand('GameLoop')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement