Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: Improved Cinderella skill
Browse files Browse the repository at this point in the history
mcs committed Jan 26, 2025

Verified

This commit was signed with the committer’s verified signature.
mcs Marcus
1 parent 00384c7 commit 9df076d
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions scripts/com.r2studio.TsumBeta/src/index.js
Original file line number Diff line number Diff line change
@@ -1789,7 +1789,8 @@ Tsum.prototype.goTsumTsumStorePage = function() {
}
}

Tsum.prototype.clearAllBubbles = function(startDelay, endDelay, fromY) {
Tsum.prototype.clearAllBubbles = function(startDelay, endDelay, fromY, delayBetweenLines) {
delayBetweenLines = delayBetweenLines || 0;
if (typeof startDelay === 'number' && startDelay > 0) {
this.sleep(startDelay);
}
@@ -1803,26 +1804,37 @@ Tsum.prototype.clearAllBubbles = function(startDelay, endDelay, fromY) {
for (var bx = Button.gameBubblesFrom.x; bx <= Button.gameBubblesTo.x; bx += 140) {
this.tap({x: bx, y: by}, 10);
}
this.sleep(delayBetweenLines);
}

if (typeof endDelay === 'number' && endDelay > 0) {
this.sleep(endDelay);
}
}

Tsum.prototype.useCinderellaSkill = function(board) {
var size = this.skillLevel + 6;
board.sort(function(a, b) {
return a.y - b.y;
});
var paths = convertTo2DArray(board, size);
for (var i = 0; i < paths.length - 1; i++) {
var path = paths[i];
path.sort(function(a, b) {
return a.x - b.x;
});
this.linkTsums(path);
Tsum.prototype.useCinderellaSkill = function() {
var path, offset, y;
for (var i = 0; i < 5; i += 1) {
for (offset = 0; offset <= 200; offset += 200) {
path = [];
for (y = 170; y >= 70; y -= 20)
path.push({x: Math.abs(offset - 10), y: y});

for (y = 60; y <= 180; y += 20)
path.push({x: Math.abs(offset - 40), y: y});

for (y = 180; y >= 60; y -= 20)
path.push({x: Math.abs(offset - 70), y: y});

for (y = 60; y <= 180; y += 20)
path.push({x: Math.abs(offset - 100), y: y});

debug("Cinderella i =", i, ", offset =", offset);
this.linkTsums(path);
}
}
this.sleep(3000);
this.clearAllBubbles(10, 50, (Button.gameBubblesFrom.y + Button.gameBubblesTo.y) / 2, 200);
}

Tsum.prototype.useSkill = function(board) {
@@ -1956,10 +1968,6 @@ Tsum.prototype.useSkill = function(board) {
} else if(this.skillType === 'block_cinderella_s') {
this.sleep(1500);
this.useCinderellaSkill(board);
this.sleep(500);
board = this.scanBoardQuick();
this.useCinderellaSkill(board);
this.clearAllBubbles(2500, 50);
} else if(this.skillType === 'block_woody2_s'){
this.sleep(1800);
this.tapDown({x: 540, y: 960}, 20);

0 comments on commit 9df076d

Please sign in to comment.