Commit aaa597dd authored by nanahira's avatar nanahira

add doron

parent 7c461248
Pipeline #80 failed with stages
......@@ -82,6 +82,7 @@ var assets = {
"badge_s1.png",
"badge_s0.25.png",
"badge_s0.5.png",
"badge_doron.png",
"touch_pause.png",
"touch_fullscreen.png",
"mimizu.png",
......
......@@ -300,6 +300,8 @@ class Controller{
return "badge_x" + this.mods.speed.toString();
} else if (this.mods.shuffle > 0) {
return "badge_s" + this.mods.shuffle.toString();
} else if (this.mods.doron) {
return "badge_doron";
}
return null;
}
......
......@@ -56,7 +56,8 @@ class ParseOsu{
this.stars = stars
this.mods = mods || {
speed: 1,
shuffle: 0
shuffle: 0,
doron: false
};
if(!metaOnly){
this.timingPoints = this.parseTiming()
......
......@@ -12,7 +12,8 @@
this.offset = (offset || 0) * -1000
this.mods = mods || {
speed: 1,
shuffle: 0
shuffle: 0,
doron: false
};
this.soundOffset = 0
this.noteTypes = {
......
......@@ -213,7 +213,7 @@ class SongSelect{
iconFill: "#d9f19f",
letterSpacing: 0
}]
this.optionsList = [strings.none, strings.auto, strings.netplay, strings.songMods.x2, strings.songMods.x3, strings.songMods.x4, strings.songMods.reverse, strings.songMods.half_shuffle, strings.songMods.shuffle]
this.optionsList = [strings.none, strings.auto, strings.netplay, strings.songMods.x2, strings.songMods.x3, strings.songMods.x4,strings.songMods.doron, strings.songMods.reverse, strings.songMods.half_shuffle, strings.songMods.shuffle]
this.draw = new CanvasDraw(noSmoothing)
this.songTitleCache = new CanvasCache(noSmoothing)
......@@ -688,7 +688,8 @@ class SongSelect{
var multiplayer = false
var mods = {
speed: 1,
shuffle: 0
shuffle: 0,
doron: false
}
if(p2.session || this.state.options === 2){
multiplayer = true
......@@ -702,12 +703,14 @@ class SongSelect{
if (this.state.options > 2 && this.state.options < 6) {
mods.speed = this.state.options - 1;
} else if (this.state.options === 6) {
mods.shuffle = 1;
} else if (this.state.options === 7) {
mods.shuffle = 0.25;
mods.shuffle = 1;
} else if (this.state.options === 8) {
mods.shuffle = 0.25;
} else if (this.state.options === 9) {
mods.shuffle = 0.5;
} else if (this.state.options === 6) {
mods.doron = true;
}
new LoadSong({
......
......@@ -971,7 +971,6 @@
ctx.beginPath()
ctx.rect(this.slotPos.paddingLeft, 0, winW - this.slotPos.paddingLeft, winH)
ctx.clip()
this.drawCircles(this.controller.getCircles())
if(this.controller.game.calibrationState === "video"){
if(ms % this.beatInterval < 1000 / 60 * 5){
......@@ -1526,7 +1525,7 @@
if(circle.isPlayed <= 0 || circle.score === 0){
if((!circle.branch || circle.branch.active) && ms >= startingTime && ms <= finishTime && circle.isPlayed !== -1){
this.drawCircle(circle)
this.drawCircle(circle, null, null, this.controller.mods && this.controller.mods.doron)
}
}else if(!circle.animating){
// Start animation to gauge
......@@ -1540,7 +1539,7 @@
}
}
}
drawAnimatedCircles(circles){
drawAnimatedCircles(circles) {
var ms = this.getMS()
for(var i = 0; i < circles.length; i++){
......@@ -1583,7 +1582,7 @@
}
return data[0]
}
drawCircle(circle, circlePos, fade){
drawCircle(circle, circlePos, fade, doron){
var ctx = this.ctx
var mul = this.slotPos.size / 106
......@@ -1616,93 +1615,96 @@
}else{
var noteFace = this.noteFace
}
if(type === "don" || type === "daiDon" && played === 1){
fill = "#f34728"
size = circleSize
faceID = noteFace.small
}else if(type === "ka" || type === "daiKa" && played === 1){
fill = "#65bdbb"
size = circleSize
faceID = noteFace.small
}else if(type === "daiDon"){
fill = "#f34728"
size = bigCircleSize
faceID = noteFace.big
}else if(type === "daiKa"){
fill = "#65bdbb"
size = bigCircleSize
faceID = noteFace.big
}else if(type === "balloon"){
if(animated){
if (!doron) {
if (type === "don" || type === "daiDon" && played === 1) {
fill = "#f34728"
size = bigCircleSize * 0.8
faceID = noteFace.big
}else{
fill = "#f87700"
size = circleSize
faceID = noteFace.small
var h = size * 1.8
if(circleMs + this.controller.audioLatency < ms && ms <= endTime + this.controller.audioLatency){
circlePos.x = this.slotPos.x
}else if(ms > endTime + this.controller.audioLatency){
circlePos.x = this.slotPos.x + this.msToPos(endTime - ms + this.controller.audioLatency, speed)
}
ctx.drawImage(assets.image["balloon"],
circlePos.x + size - 4,
circlePos.y - h / 2 + 2,
h / 61 * 115,
h
)
}
}else if(type === "drumroll" || type === "daiDrumroll"){
fill = "#f3b500"
if(type == "drumroll"){
} else if (type === "ka" || type === "daiKa" && played === 1) {
fill = "#65bdbb"
size = circleSize
faceID = noteFace.small
}else{
} else if (type === "daiDon") {
fill = "#f34728"
size = bigCircleSize
faceID = noteFace.big
} else if (type === "daiKa") {
fill = "#65bdbb"
size = bigCircleSize
faceID = noteFace.big
} else if (type === "balloon") {
if (animated) {
fill = "#f34728"
size = bigCircleSize * 0.8
faceID = noteFace.big
} else {
fill = "#f87700"
size = circleSize
faceID = noteFace.small
var h = size * 1.8
if (circleMs + this.controller.audioLatency < ms && ms <= endTime + this.controller.audioLatency) {
circlePos.x = this.slotPos.x
} else if (ms > endTime + this.controller.audioLatency) {
circlePos.x = this.slotPos.x + this.msToPos(endTime - ms + this.controller.audioLatency, speed)
}
ctx.drawImage(assets.image["balloon"],
circlePos.x + size - 4,
circlePos.y - h / 2 + 2,
h / 61 * 115,
h
)
}
} else if (type === "drumroll" || type === "daiDrumroll") {
fill = "#f3b500"
if (type == "drumroll") {
size = circleSize
faceID = noteFace.small
} else {
size = bigCircleSize
faceID = noteFace.big
}
endX = this.msToPos(endTime - circleMs, speed)
drumroll = endX > 50 ? 2 : 1
ctx.fillStyle = fill
ctx.strokeStyle = "#000"
ctx.lineWidth = 3
ctx.beginPath()
ctx.moveTo(circlePos.x, circlePos.y - size + 1.5)
ctx.arc(circlePos.x + endX, circlePos.y, size - 1.5, Math.PI / -2, Math.PI / 2)
ctx.lineTo(circlePos.x, circlePos.y + size - 1.5)
ctx.fill()
ctx.stroke()
}
if (!fade || fade < 1) {
// Main circle
ctx.fillStyle = fill
ctx.beginPath()
ctx.arc(circlePos.x, circlePos.y, size - 1, 0, Math.PI * 2)
ctx.fill()
// Face on circle
var drawSize = size
if (faceID < 2) {
drawSize *= bigCircleSize / circleSize
}
ctx.drawImage(assets.image[drumroll ? "notes_drumroll" : "notes"],
0, 172 * faceID,
172, 172,
circlePos.x - drawSize - 4,
circlePos.y - drawSize - 4,
drawSize * 2 + 8,
drawSize * 2 + 8
)
}
if (fade && !this.touchEnabled) {
ctx.globalAlpha = this.draw.easeOut(fade < 1 ? fade : 2 - fade)
ctx.fillStyle = "#fff"
ctx.beginPath()
ctx.arc(circlePos.x, circlePos.y, size - 1, 0, Math.PI * 2)
ctx.fill()
ctx.globalAlpha = 1
}
endX = this.msToPos(endTime - circleMs, speed)
drumroll = endX > 50 ? 2 : 1
ctx.fillStyle = fill
ctx.strokeStyle = "#000"
ctx.lineWidth = 3
ctx.beginPath()
ctx.moveTo(circlePos.x, circlePos.y - size + 1.5)
ctx.arc(circlePos.x + endX, circlePos.y, size - 1.5, Math.PI / -2, Math.PI / 2)
ctx.lineTo(circlePos.x, circlePos.y + size - 1.5)
ctx.fill()
ctx.stroke()
}
if(!fade || fade < 1){
// Main circle
ctx.fillStyle = fill
ctx.beginPath()
ctx.arc(circlePos.x, circlePos.y, size - 1, 0, Math.PI * 2)
ctx.fill()
// Face on circle
var drawSize = size
if(faceID < 2){
drawSize *= bigCircleSize / circleSize
}
ctx.drawImage(assets.image[drumroll ? "notes_drumroll" : "notes"],
0, 172 * faceID,
172, 172,
circlePos.x - drawSize - 4,
circlePos.y - drawSize - 4,
drawSize * 2 + 8,
drawSize * 2 + 8
)
}
if(fade && !this.touchEnabled){
ctx.globalAlpha = this.draw.easeOut(fade < 1 ? fade : 2 - fade)
ctx.fillStyle = "#fff"
ctx.beginPath()
ctx.arc(circlePos.x, circlePos.y, size - 1, 0, Math.PI * 2)
ctx.fill()
ctx.globalAlpha = 1
}
if(!circle.animating && circle.text){
// Text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment