Implement blocking of Bulk buying #143

This commit is contained in:
Daniel van Noord
2021-01-31 18:15:42 +01:00
parent 4e238e800c
commit 0e7880816e
2 changed files with 22 additions and 0 deletions

View File

@@ -4181,6 +4181,17 @@ CM.ReplaceNative = function() {
Game.CalculateGains();
};
/**
* This optiond adds a check to the purchase of a building to allow BulkBuyBlock to work.
* If the options is 1 (on) bulkPrice is under cookies you can't buy the building.
*/
CM.Backup.ClickProduct = Game.ClickProduct;
Game.ClickProduct = function(what) {
if (!CM.Options.BulkBuyBlock || Game.ObjectsById[what].bulkPrice < Game.cookies) {
CM.Backup.ClickProduct(what);
}
};
CM.Backup.DescribeDragonAura = Game.DescribeDragonAura;
/**
* This functions adds the function CM.Disp.AddAuraInfo() to Game.DescribeDragonAura()

View File

@@ -48,6 +48,17 @@ CM.ReplaceNative = function() {
Game.CalculateGains();
};
/**
* This optiond adds a check to the purchase of a building to allow BulkBuyBlock to work.
* If the options is 1 (on) bulkPrice is under cookies you can't buy the building.
*/
CM.Backup.ClickProduct = Game.ClickProduct;
Game.ClickProduct = function(what) {
if (!CM.Options.BulkBuyBlock || Game.ObjectsById[what].bulkPrice < Game.cookies) {
CM.Backup.ClickProduct(what);
}
};
CM.Backup.DescribeDragonAura = Game.DescribeDragonAura;
/**
* This functions adds the function CM.Disp.AddAuraInfo() to Game.DescribeDragonAura()