disableShopOnDamage & consoleOpened isPC

This commit is contained in:
oc 2019-04-14 13:11:55 +08:00
parent 822a0deb5b
commit 12fe714703
2 changed files with 11 additions and 0 deletions

View File

@ -919,6 +919,7 @@ control.prototype.checkBlock = function () {
core.status.hero.hp -= damage;
core.drawTip("受到"+(core.status.checkBlock.type[loc]||"伤害")+damage+"点");
this._checkBlock_soundAndAnimate(x, y);
this._checkBlock_disableQuickShop();
if (core.status.hero.hp <= 0) {
core.status.hero.hp=0;
core.updateStatusBar();
@ -935,6 +936,15 @@ control.prototype._checkBlock_soundAndAnimate = function (x,y) {
core.drawAnimate("zone", x, y);
}
control.prototype._checkBlock_disableQuickShop = function () {
// 禁用快捷商店
if (core.flags.disableShopOnDamage) {
for (var shopId in core.status.shops) {
core.status.shops[shopId].visited = false;
}
}
}
////// 阻击 //////
control.prototype._checkBlock_snipe = function (snipe) {
if (!snipe || snipe.length == 0) return;

View File

@ -1005,6 +1005,7 @@ utils.prototype.consoleOpened = function () {
if (!core.flags.checkConsole) return false;
if (window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized)
return true;
if (!core.platform.isPC) return false;
var threshold = 160;
var zoom = Math.min(window.outerWidth / window.innerWidth, window.outerHeight / window.innerHeight);
return window.outerWidth - zoom * window.innerWidth > threshold