Skip to content

Latest commit

 

History

History
139 lines (131 loc) · 2.99 KB

Gooboo,耐玩文字放置.md

File metadata and controls

139 lines (131 loc) · 2.99 KB

Gooboo,耐玩文字放置

https://gityx.com/g8hh/yihanhua/778.html

https://gityxs.github.io/gooboo/

修改脚本

//初始化全局对象
VUE = $(".game-app")[0].__vue__;
//采矿 绿水晶
VUE.$store.state.currency.mining_crystalGreen.value+=1e9
//村庄 祝福
VUE.$store.state.currency.village_blessing.value+=1e9

//升级低消耗,村庄建筑低耗时
function hookupgradePrice(u)
{
    let t = 'price';
    let handler = {
      apply: function (target, thisArg, ...argumentsList) {
        let ret = Reflect.apply(...arguments);
        if(Array.isArray(ret))
        {
            for(let r of ret)
                for (let k in r)
                    r[k] = 1
        }else
        {
            for (let k in ret)
                ret[k] = 1
        }
        //console.log(ret)
        return ret;
      }
    };
    if(u[t])
    {    
        if(!u[`__${t}`]) u[`__${t}`] = u[t];
        u[t] = new Proxy(u[`__${t}`],handler);
    }
}

function hooktimeNeed(u)
{
    let t = 'timeNeeded';
    let handler = {
        apply: function (target, thisArg, ...argumentsList) {
            let ret = Reflect.apply(...arguments);
            if('number'==typeof(ret))
            {
                ret = 0.001;
            }
            return ret;
        }
    };
    if(u[t])
    {
        if(!u[`__${t}`]) u[`__${t}`] = u[t];
        u[t] = new Proxy(u[`__${t}`],handler);
    }
}
Object.values(VUE.$store.state.upgrade.item).forEach(u=>{
    hookupgradePrice(u)
    hooktimeNeed(u)
})

//村庄 供品低消耗
function hook_offering_cost(u)
{
    let t = 'cost';
    let handler = {
        apply: function (target, thisArg, ...argumentsList) {
            let ret = Reflect.apply(...arguments);
            if('number'==typeof(ret))
            {
                ret = 1;
            }
            return ret;
        }
    };
    if(u[t])
    {
    if(!u[`__${t}`]) u[`__${t}`] = u[t];
    u[t] = new Proxy(u[`__${t}`],handler);
    }
}
Object.values(VUE.$store.state.village.offering).forEach(o=>{
    hook_offering_cost(o);
    if(o.amount)o.amount = 0;
})

//村庄工人 低需求
Object.values(VUE.$store.state.village.job).forEach(j=>{
if(j.needed)
{
    j.needed = 1;
}
})

//部落 装备升级低价格 技能低冷却
function hook_horde_items_price(u)
{
    let t = 'price';
    let handler = {
        apply: function (target, thisArg, ...argumentsList) {
            let ret = Reflect.apply(...arguments);
            if('number'==typeof(ret))
            {
                ret = 0;
            }
            return ret;
        }
    };
    if(u[t])
    {
    if(!u[`__${t}`]) u[`__${t}`] = u[t];
    u[t] = new Proxy(u[`__${t}`],handler);
    }
}
Object.values(VUE.$store.state.horde.items).forEach(i=>{
    hook_horde_items_price(i);
    if(i.cooldown) i.cooldown = ()=>0.1;
});

//农场 快速成长 作物免费 稀有翻倍
Object.values(VUE.$store.state.farm.crop).forEach(c=>{
if(c.grow)
{
    c.grow = 0.001;
}
if(c.cost>0)
{
    c.cost = 0;
}
Object.values(c.rareDrop).forEach(d=>{
    d.chance = 10;
});
});