aiannacc / Goko-Salvager

Enhance your Dominion Online experience!
13 stars 9 forks source link

Auto-win Adventures (with 3 stars and no zaps, because why not) #230

Closed serakfalcon closed 10 years ago

serakfalcon commented 10 years ago

This code will cause the adventure game to end as soon as it starts on a 3 pile, giving you 40 duchies. It will also not use up any zaps unless you want to. You can tell it's working if the opponent's hand has 10 curses.

CampaignClient.prototype.setHands = function () {
    var gameData = this.campaignData[this.avatarWorld][this.avatarRegion];
    if(gameData) {
        this.myHand = $.extend(true,[],gameData.yourCards);
        this.otherHand=$.extend(true,[],gameData.opponentCards);
    }
    this.otherHand.push("curse", "curse", "curse","curse","curse","curse","curse","curse","curse","curse");
}

CampaignClient.prototype.buildGameHands = function (campaign, game) {
    var gameData = this.campaignData[campaign][game];
    var hands = [];
    var i = 0;
    var numOpponents = gameData.numPlayers - 1;
    var defaultHand = ["copper", "copper", "copper", "copper", "copper", "copper", "copper","estate","estate","estate"];
    for (i = 0;i<10;i++) {
        defaultHand.push("curse");
    }
    for (var i =0; i<40; i++) {
        this.myHand.push("silver","province","duchy");
    }
    hands.push(this.myHand);
    hands.push(this.otherHand);
    for (i = 1; i < numOpponents; i++) {
        hands.push(defaultHand);
    }

    return hands;
} 
aiannacc commented 10 years ago

This is so awesome! Maybe we can finally put the horror of Goko's promo card policy to rest.

Does anyone object to putting this in Salvager? We could also add a link to the docs saying that we'll remove it if MF asks. I rather suspect they'd contact us before putting effort into crippling Salvager, since they clearly have their hands full as it is.

Personally, I rather doubt that the current MakingFun team is going to object. Maybe some original Goko developer has strong feelings about making people trudge through the Adventures, but I think the MF people just have promos/Adventures on their long list of things they might get around to changing... maybe... someday.

aiannacc commented 10 years ago

FYI: serakfalcon's solution works on the levels with multiple opponents too.

michaeljb commented 10 years ago

This is so awesome!

I concur!

Now where do I get my time refund for the promo grinding I already did? :wink:

aiannacc commented 10 years ago

Wait... seatIndex isn't known in advance or specified by the client, is it?

serakfalcon commented 10 years ago

I'm not familiar with the multiplayer settings, in the campaign it is. (the user is always 1) It doesn't determine who goes first in any case, just what deck belongs to who. I think.

After further testing, after the 10th card, you can add any card you own to any deck, whether or not that card is actually in the kingdom or not. I modified the above code to give you 40 provinces and 40 duchies, just because why not.

aiannacc commented 10 years ago

serakfalcon, I've deleted your latest comments because I think it would be best if this information weren't publicly available. Kudos to you for finding it all the same.

I don't mean to shut down the discussion. All the collaborators on this project still have copies of this info in their e-mail. So we can consider using it for features like identical splits and who knows what else. I just don't want to see Alibenballa and his like making use of it.

For good measure, I'm also closing this Issue.

serakfalcon commented 10 years ago

Fine by me. I went back and deleted an explanatory comment also, if you need more info you can always PM me on dominionstrategy.