-
Notifications
You must be signed in to change notification settings - Fork 1
/
js 练手.js
398 lines (339 loc) · 10.1 KB
/
js 练手.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
http://www.gityx.com/hanhua/hanhuazhong/643.html
http://idlegame.gitee.io/proto23/
//阅读速度
you.mods.rdgrt=1e6
//有效技能快速升级
Object.values(skl).forEach(v=>{
if(v.expnext){
if(typeof expnext_b=='undefined') v.expnext_b = v.expnext;
if(v.mlstn){
let max = Math.max(...v.mlstn.map(r=>r.lv));
v.expnext = ()=>{
if(v.lvl<max) return 1;
return v.expnext_b();
};
}
}
if(v.expnext_t){
v.expnext_t = 1;
}
});
//制作无消耗
Object.values(rcp).forEach(v=>{
if(v.rec){
v.rec.forEach(vv=>{
if(vv.amount>0) vv.amount = 0-vv.amount;
})
}
});
大数塔(Towers of Googology)
http://www.gityx.com/hanhua/yihanhua/645.html
http://likexia.gitee.io/towers-of-googology/
function autoFight(){
let pPos = getPlayerPos();
if (!pPos) return;
let pTile = getTile(pPos);
let player = pTile[0];
function check(offset){
let tile = getTile([pPos[0] + offset[0], pPos[1] + offset[1]]); console.log('tile',tile);
if(tile){
if (tile[0][0] == "enemy"){
if(player[1].gte(tile[0][1])|| game.spells.ice > 0){
movePlayer(offset);
}
}
else if (tile[0][0] == "loot"){
movePlayer(offset);
}
}else if(!tile && pPos[1]==0) {
movePlayer([1, 0]);
return true;
}
return false;
}
if(check([0,1]))return;
if(check([0,-1]))return;
}
clearInterval(typeof stopAutoFight=='undefined' ? 0 : stopAutoFight)
stopAutoFight = setInterval(()=>autoFight(),200);
//自动游戏
function autoFight(){
let pPos = getPlayerPos();
if (pPos) {
if (getTower(pPos[0]).length <= 1) movePlayer([1, 0]);
else {
let tUp = getTile([pPos[0], pPos[1] + 1]);
let tDown = getTile([pPos[0], pPos[1] - 1]);
if (tDown && (!tUp || tDown[0][1].lt(tUp[0][1]))) movePlayer([0, -1]);
else movePlayer([0, 1]);
}
}
}
clearInterval(typeof stopAutoFight=='undefined' ? 0 : stopAutoFight)
stopAutoFight = setInterval(()=>autoFight(),100);
//升级低消耗
Object.values(upgrades).forEach(v=>{
v.cost=(x)=>(EN(1));
})
怪物饲养员(Monster Breeder)
http://www.gityx.com/hanhua/hanhuazhong/646.html#J_download
http://idlegame.gitee.io/monster-breeder/
//无限钱
Cash = Infinity;
//无限容量
TruckCap = Infinity;
格子王国(Grid land)
http://www.gityx.com/hanhua/hanhuazhong/647.html
http://idlegame.gitee.io/gridland/
//创建简易消除脚本 左边会出现一个 单选框
//勾上后 匹配模式会很简单 但是夜晚难度也会增加
//夜晚记得使用道具
//简易模式会导致白天时间走的慢,差不多后就自行关闭吧
//执行前置脚本 触发断点
debug(window.tiles);window.tiles();undebug(window.tiles);
//断点触发后执行下面脚本 新增功能
typeof ii != 'undefined' ? ii.remove():null;
ii=document.createElement('input');
ii.type = 'checkbox';
ii.onclick = function(){
if(this.checked){
c=/([^X])\1{1,}/g;
}else{
c=/([^X])\1{2,}/g;
}
};
document.body.append(ii);
//F8继续游戏
//道具无限
require("app/loot").useItem = function (t) {
var e=require("app/eventmanager");
var n=require("app/gamestate");
var r=require("app/gamecontent");
var i = 3;
require("app/world").canMove() && (n.items[t] = i, e.trigger("lootUsed", [t, i]), r.LootType[t].onUse())
}
gamestate=require("app/gamestate");
gamestate.stores
灵魂建造者(Soul Builder)
http://www.gityx.com/hanhua/yihanhua/649.html
o.onMouseMove(n)
document.onkeydown = function(k){
o.onKey(k);
}
杀鸡(Chickens)
http://www.gityx.com/hanhua/yihanhua/650.html#J_download
http://likexia.gitee.io/chickens/
//无冷却
if(typeof _cd == 'undefined'){
_cd = cd;
}
cd = function(countdown,id,val) {
countdown=0;
_cd(countdown,id,val);
}
if(typeof _cdb == 'undefined'){
_cdb = cdb;
}
cdb = function(countdown,id) {
countdown=0;
_cdb(countdown,id);
}
if(typeof _cdc == 'undefined') {
_cdc = cdc;
}
cdc = function (countdown,id,val) {
countdown=0;
_cdc(countdown,id,val)
}
//战斗后自动拾取
function cdi(countdown,id) {
takedrop(id)
}
//物品不减反增
itemNoCostHandle = {
set(target, key, value) {
let oval = target[key];
if(key=='owned' && target['name']!='robots'){
if(value<oval){
value = oval+(oval-value);
}
}
return Reflect.set(target, key, value);
}
}
items.forEach((v,i,arr)=>{
arr[i]=new Proxy(v,itemNoCostHandle);
});
材料勇士(Material Warrior)
http://www.gityx.com/hanhua/hanhuazhong/653.html
http://likexia.gitee.io/material-warrior/
Object.entries(Game.save.entities).filter(([k,v])=> v&&v.name=='package')
var boxlist = Object.entries(Game.save.entities).filter(([k,v])=> v&&v.name=='package').map(([k,v])=>k);
var t = boxlist.shift();
if(t){
var pt = t.split(',').map(it=>it-0)
Player.takePackage(pt[0],pt[1])
}
//所有箱子坐标
console.table(Object.entries(Game.save.entities).filter(([k,v])=> v&&v.name=='package').map(([k,v])=>(k)))
//神装套件
Player.save.inventory.head.push("magic-hat");
Player.save.inventory.body.push("heart-armor");
Player.save.inventory.weapon.push("hammer");
UI.update();
React RPG
http://www.gityx.com/hanhua/hanhuazhong/658.html
https://react-rpg.com/
main.866c681f.chunk.js 格式化代码后世 搜索 he = ye 然后下断点。
刷新游戏 触发断点。控制台 输入 GG = ye 回车 F8继续游戏。
//加攻击和防御
GG.getState().stats.damage+=100
GG.getState().stats.defence+=1e6
弹珠放置(Pachinkremental)
http://www.gityx.com/hanhua/yihanhua/518.html
http://idlegame.gitee.io/pachinkremental/
//升级低消耗
state.machines.forEach(m=>{
Object.values(m.upgrades).forEach(u=>{
u.GetCost = ()=>(1);
})
});
u.cost_func = ()=>(1);
克隆军队点击器(Clone Armies Clicker)
http://www.gityx.com/hanhua/yihanhua/675.html
http://idlegame.gitee.io/clone-armies-clicker/
[hide]
[code]
[/code]
[/hide]
game.player.spendCookies = function (amount) {
this.cookies += amount;
this.cookieStats.Spent += amount;
return true;
}
https://bbs.gityx.com/forum.php?mod=post&action=newthread&fid=39
合并个球(Yet Another Merge Game)
http://www.gityx.com/hanhua/yihanhua/530.html
http://idlegame.gitee.io/yet-another-merge-game/
Object.values(game.matter.upgrades).forEach(u=>{
u.getPrice = (lv)=>(new Decimal(lv));
u.updatePrice();
});
Object.values(game.prestige.upgrades).forEach(u=>{
u.getPrice = (lv)=>(new Decimal(lv));
u.updatePrice();
});
Object.values(game.molecules.upgrades).forEach(u=>{
u.getPrice = (lv)=>(new Decimal(lv));
u.updatePrice();
});
//数量不减,进度条需求低
amountNotCostHandle = {
set(target, key, value) {
if(key=='amount'||key=='quantumFoam'){
let oval = target[key];
if(value.lt(oval)){
value = oval.add(oval.sub(value));
}
}
return Reflect.set(target, key, value);
}
}
game.matter = new Proxy(game.matter,amountNotCostHandle);
game.prestige = new Proxy(game.prestige,amountNotCostHandle);
game.molecules = new Proxy(game.molecules,amountNotCostHandle);
game.isotopes = new Proxy(game.isotopes,amountNotCostHandle);
game.energyCores.cores.forEach(c=>{
c.getBaseNeededMerges = (lv)=>(lv);
});
game.molecules.molecules.forEach(c=>{
c.getMergesNeeded = ()=>(5);
});
文物发掘放置(Relics)
http://www.gityx.com/hanhua/yihanhua/676.html
http://idlegame.gitee.io/relics/
main.708c1e38.chunk.js
key: "onTick"
//资源不减
resourceNotCostHandle = {
set(target, key, value) {
let oval = target[key];
if(key=='relics'){
oval = target['relicCap'];
}
if(key=='money'){
oval = target['moneyCap'];
}
if(key=='knowledge'){
oval = target['knowledgeCap'];
}
if(value<oval){
value = oval+(oval-value);
}
return Reflect.set(target, key, value);
}
}
GG.state.gameState.resourceState = new Proxy(GG.state.gameState.resourceState,resourceNotCostHandle)
//H5魔塔 相关修改
//H5魔塔商店不减反增
if(typeof _useShopHandle=='undefined'){
_useShopHandle = {
apply:function(target, thisArgument, args){
let shop = args[0];
let index = args[1];
let cost = core.calValue(shop.need || shop.choices[index],null,null,shop.times);
if(cost > 0){
core.setStatus(shop.use, core.getStatus(shop.use) + cost*2);
}
return Reflect.apply(...arguments);
}
}
typeof _useShop == 'undefined'? (_useShop = events.prototype._useShop) :null;
events.prototype._useShop = new Proxy(_useShop,_useShopHandle);
}
//英雄特殊属性不减
if(typeof heroStateNotCostHandle=='undefined'){
heroStateNotCostHandle={
set:function(target, key, value) {
var needKeys = ["hpmax", "hp", "mana", "atk", "def", "mdef", "money", "exp"];
if(needKeys.includes(key)){
if(key=='mana'){
let oval = target[key];
if(value < oval){
value = oval+(oval-value);
}
}
}
return Reflect.set(...arguments);
}
}
core.status.hero = new Proxy(core.status.hero,heroStateNotCostHandle);
}
//身上钥匙类道具不减
if(typeof heroToolsItemsNotCostHandle=='undefined'){
heroToolsItemsNotCostHandle={
set:function(target, key, value) {
let oval = target[key];
if(value < oval){
value = oval+(oval-value);
}
return Reflect.set(...arguments);
}
}
core.status.hero.items.tools = new Proxy(core.status.hero.items.tools,heroToolsItemsNotCostHandle);
}
r.updateTech(t);
stamina
["hp", "stamina", "rage", "bf", "unease", "weary", "rage", "madness"]
["herbs",
"gold",
"scrolls",
"exp",
"stamina",
"hp",
"sp",
"mana",
"codices",
"arcana",
"research",
"wizardhall"]