|
| 1 | +import { IFuncOrigin, IFuncOperatorOrigin, IFuncOperator } from '@/interface/IFunc'; |
| 2 | +import { Script } from '@/system/script'; |
| 3 | + |
| 4 | +// const normal = -1; //定义常量 |
| 5 | +const left = 0; |
| 6 | +const center = 1; |
| 7 | +const right = 2; |
| 8 | + |
| 9 | +export class Func318 implements IFuncOrigin { |
| 10 | + id = 318; |
| 11 | + name = '战斗内操作选项'; |
| 12 | + desc = ''; |
| 13 | + config = [{ |
| 14 | + desc: '', |
| 15 | + config: [{ |
| 16 | + name: 'xingMie', |
| 17 | + desc: '星灭切换', |
| 18 | + type: 'switch', |
| 19 | + default: false, |
| 20 | + }, { |
| 21 | + name: 'diSiTian', |
| 22 | + desc: '帝释天开局锁二,行动后切普攻(只支持"奚落天穹"皮肤)', |
| 23 | + type: 'switch', |
| 24 | + default: false, |
| 25 | + }, { |
| 26 | + name: 'time', |
| 27 | + desc: '计时退出(单位:秒,0为关闭)', |
| 28 | + type: 'number', |
| 29 | + default: 0, |
| 30 | + }] |
| 31 | + }] |
| 32 | + operator: IFuncOperatorOrigin[] = [{ // 0 阴阳师行动 |
| 33 | + desc: [ |
| 34 | + 1280, 720, |
| 35 | + [ |
| 36 | + [right, 1185, 644, 0xb17148], |
| 37 | + [right, 1261, 644, 0xa6694d], |
| 38 | + [right, 1216, 596, 0xfffbdf], |
| 39 | + [right, 1235, 592, 0xfffade], |
| 40 | + [right, 1207, 616, 0xffffe9], |
| 41 | + [right, 1239, 616, 0xffffe5], |
| 42 | + ] |
| 43 | + ], |
| 44 | + oper: [ |
| 45 | + [center, 1280, 720, 1194, 636, 1252, 695, 0], // 晴明 |
| 46 | + ], |
| 47 | + retest: 500 |
| 48 | + }, { // 1 开始战斗后的场景 |
| 49 | + desc: '战斗界面', |
| 50 | + }, { // 2 妖术二 |
| 51 | + desc: [ |
| 52 | + 1280, 720, |
| 53 | + [ |
| 54 | + [right, 1240, 684, 0xdeccbf], |
| 55 | + [right, 1245, 684, 0xe0cdc0], |
| 56 | + [right, 1253, 688, 0xd9c6ba], |
| 57 | + [right, 1247, 674, 0xe4d1c4], |
| 58 | + [right, 1242, 677, 0xdbc9bc], |
| 59 | + ] |
| 60 | + ] |
| 61 | + }, { // 3 技能框 |
| 62 | + desc: [ |
| 63 | + 1280, 720, |
| 64 | + [ |
| 65 | + [center, 940, 479, 0x1f2552], |
| 66 | + [right, 965, 506, 0x1f214e], |
| 67 | + [center, 928, 514, 0x383a91], |
| 68 | + [center, 938, 504, 0xf4feff], |
| 69 | + [center, 897, 445, 0xc79a54], |
| 70 | + [right, 1250, 442, 0xb38140], |
| 71 | + [right, 1263, 445, 0xb5864a], |
| 72 | + [right, 1266, 454, 0xac7f44], |
| 73 | + [right, 1265, 555, 0xbd9250], |
| 74 | + [center, 904, 546, 0xb18349], |
| 75 | + ] |
| 76 | + ] |
| 77 | + }, { // 4 未弹起的技能框和 技能坐标 |
| 78 | + desc: [ |
| 79 | + 1280, 720, |
| 80 | + [ |
| 81 | + [center, 895, 469, 0xbf9350], |
| 82 | + [right, 1266, 478, 0xbd8a49], |
| 83 | + [center, 895, 569, 0xaa7743], |
| 84 | + [center, 902, 577, 0xb08043], |
| 85 | + [right, 1154, 483, 0x473a32], |
| 86 | + [right, 1165, 462, 0x231a23], |
| 87 | + [right, 1172, 486, 0x473a30], |
| 88 | + [right, 1173, 471, 0x2b1d15], |
| 89 | + [right, 1189, 480, 0x2b3d36], |
| 90 | + ] |
| 91 | + ], |
| 92 | + oper: [ |
| 93 | + [center, 1280, 720, 1011, 481, 1051, 518, 1000], // 2技能 |
| 94 | + [center, 1280, 720, 1099, 482, 1145, 519, 1000], // 3技能 |
| 95 | + ] |
| 96 | + }, { // 5 非晴明阴阳师,并且单技能 |
| 97 | + desc: [1280, 720, |
| 98 | + [ |
| 99 | + [right, 996, 448, 0xbc914f], |
| 100 | + [right, 1267, 450, 0xb78347], |
| 101 | + [right, 1266, 555, 0xb38245], |
| 102 | + [right, 996, 546, 0xaa7743], |
| 103 | + ] |
| 104 | + ], |
| 105 | + oper: [ |
| 106 | + [center, 1280, 720, 1201, 643, 1245, 682, 0], |
| 107 | + ] |
| 108 | + }, { // 6 战字 |
| 109 | + desc: [ |
| 110 | + 1280, 720, |
| 111 | + [ |
| 112 | + [center, 528, 311, 0xe2ceba], |
| 113 | + [center, 593, 316, 0x030303], |
| 114 | + [center, 660, 332, 0x030303], |
| 115 | + [center, 749, 297, 0xe4d0b6], |
| 116 | + [center, 569, 523, 0x8e2214], |
| 117 | + [center, 709, 524, 0x881509], |
| 118 | + [center, 638, 472, 0xf3daaa], |
| 119 | + ] |
| 120 | + ] |
| 121 | + }, { // 7 帝释天行动条 |
| 122 | + desc: [1280, 720, |
| 123 | + [ |
| 124 | + [right, 1210, 480, 0xf8ec82], |
| 125 | + [right, 1277, 481, 0xf9e563], |
| 126 | + [right, 1242, 447, 0xe5c058], |
| 127 | + [right, 1242, 513, 0xf7ef89], |
| 128 | + [right, 1236, 465, 0xfbf6f2], |
| 129 | + [right, 1234, 490, 0x4a4a9c], |
| 130 | + [right, 1259, 483, 0x524b8a], |
| 131 | + [right, 1247, 489, 0xd6a696], |
| 132 | + ] |
| 133 | + ], |
| 134 | + }, { // 8 战斗退出 |
| 135 | + desc: '战斗界面', |
| 136 | + oper: [ |
| 137 | + [left, 1280, 720, 22, 19, 52, 47, 1500], // 左上角返回 |
| 138 | + [center, 1280, 720, 683, 401, 795, 442, 500], // 确认 |
| 139 | + ] |
| 140 | + }]; |
| 141 | + operatorFunc(thisScript: Script, thisOperator: IFuncOperator[]): boolean { |
| 142 | + const thisconf = thisScript.scheme.config['318']; |
| 143 | + if (!thisScript.global.fight_Swith) { |
| 144 | + thisScript.global.fight_Swith = { |
| 145 | + 'xingMie': thisconf.xingMie as boolean, |
| 146 | + 'diSiTian': thisconf.diSiTian as boolean, |
| 147 | + 'time': null, |
| 148 | + |
| 149 | + }; |
| 150 | + } |
| 151 | + if (thisconf.time != '0') { |
| 152 | + if (!thisScript.global.fight_Swith.time && thisScript.oper({ |
| 153 | + name: '战斗界面', |
| 154 | + operator: [{ |
| 155 | + desc: thisOperator[8].desc |
| 156 | + }] |
| 157 | + })) { |
| 158 | + thisScript.global.fight_Swith.time = new Date().getTime() + Number(thisconf.time) * 1000; |
| 159 | + } |
| 160 | + if (thisScript.global.fight_Swith.time && new Date().getTime() > (thisScript.global.fight_Swith.time as number)) { |
| 161 | + thisScript.global.fight_Swith.time = null; |
| 162 | + return thisScript.oper({ |
| 163 | + id: 320, |
| 164 | + name: '计时退出', |
| 165 | + operator: [thisOperator[8]] |
| 166 | + }); |
| 167 | + } |
| 168 | + if (thisScript.oper({ |
| 169 | + id: 320, |
| 170 | + name: '战字', |
| 171 | + operator: [{ |
| 172 | + desc: thisOperator[6].desc |
| 173 | + }] |
| 174 | + })) { |
| 175 | + thisScript.global.fight_Swith.time = new Date().getTime() + Number(thisconf.time) * 1000; |
| 176 | + } |
| 177 | + } |
| 178 | + if (thisScript.global.fight_Swith.xingMie) { |
| 179 | + if (thisScript.oper({ |
| 180 | + name: '战斗界面', |
| 181 | + operator: [thisOperator[1]] |
| 182 | + }) && thisScript.oper({ |
| 183 | + id: 318, |
| 184 | + name: '阴阳师行动', |
| 185 | + operator: [thisOperator[0]] |
| 186 | + })) { |
| 187 | + thisScript.keepScreen(); |
| 188 | + } |
| 189 | + if (thisScript.oper({ |
| 190 | + id: 318, |
| 191 | + name: '技能框', |
| 192 | + operator: [thisOperator[3]] |
| 193 | + })) { |
| 194 | + sleep(200); |
| 195 | + if (thisScript.oper({ |
| 196 | + id: 318, |
| 197 | + name: '锁定妖术二中,切换为妖术三', |
| 198 | + operator: [thisOperator[2]] |
| 199 | + })) { |
| 200 | + thisScript.regionClick([thisOperator[4].oper[1]]); |
| 201 | + } else { |
| 202 | + thisScript.regionClick([thisOperator[4].oper[0]]); |
| 203 | + } |
| 204 | + thisScript.keepScreen(); |
| 205 | + } |
| 206 | + if (thisScript.oper({ |
| 207 | + id: 318, |
| 208 | + name: '单技能框', |
| 209 | + operator: [thisOperator[5]] |
| 210 | + })) { |
| 211 | + thisScript.keepScreen(); |
| 212 | + } |
| 213 | + if (thisScript.oper({ |
| 214 | + id: 318, |
| 215 | + name: '未弹起的技能框', |
| 216 | + operator: [{ desc: thisOperator[4].desc }] |
| 217 | + })) { |
| 218 | + thisScript.regionClick([thisOperator[0].oper[0]]); |
| 219 | + thisScript.keepScreen(); |
| 220 | + } |
| 221 | + } |
| 222 | + if (thisScript.global.fight_Swith.diSiTian) { |
| 223 | + if (thisScript.oper({ |
| 224 | + id: 318, |
| 225 | + name: '战字', |
| 226 | + operator: [{ desc: thisOperator[6].desc }] |
| 227 | + })) { |
| 228 | + const point = thisScript.findMultiColor('帝释天', null, false, false) |
| 229 | + if (point) { |
| 230 | + console.log('开局查找到帝释天,锁二'); |
| 231 | + const oper = [[point.x, point.y, point.x + 10, point.y + 10, 500]]; |
| 232 | + thisScript.regionClick(oper); |
| 233 | + if (point.x < 1090) { |
| 234 | + const oper = [[point.x - 30, point.y - 130, point.x - 20, point.y - 120, 200]]; |
| 235 | + thisScript.regionClick(oper); |
| 236 | + } else { |
| 237 | + const oper = [[point.x - 80, point.y - 130, point.x - 70, point.y - 120, 200]]; |
| 238 | + thisScript.regionClick(oper); |
| 239 | + } |
| 240 | + return true; |
| 241 | + } |
| 242 | + } |
| 243 | + if (thisScript.oper({ |
| 244 | + id: 318, |
| 245 | + name: '帝释天行动', |
| 246 | + operator: [{ desc: thisOperator[7].desc }] |
| 247 | + })) { |
| 248 | + const point = thisScript.findMultiColor('帝释天', null, false, false) |
| 249 | + if (point) { |
| 250 | + console.log('开局查找到帝释天,锁普攻'); |
| 251 | + sleep(2000); |
| 252 | + const oper = [[point.x, point.y, point.x + 10, point.y + 10, 500]]; |
| 253 | + thisScript.regionClick(oper); |
| 254 | + if (point.x < 1090) { |
| 255 | + const oper = [[point.x - 120, point.y - 130, point.x - 110, point.y - 120, 200]]; |
| 256 | + thisScript.regionClick(oper); |
| 257 | + } else { |
| 258 | + const oper = [[point.x - 80, point.y - 170, point.x - 70, point.y - 160, 200]]; |
| 259 | + thisScript.regionClick(oper); |
| 260 | + } |
| 261 | + return true; |
| 262 | + } |
| 263 | + } |
| 264 | + } |
| 265 | + return false; |
| 266 | + } |
| 267 | +} |
0 commit comments