HumanBreak/public/libs/enemys.js

169 lines
5.2 KiB
JavaScript
Raw Normal View History

2022-12-29 23:08:44 +08:00
///<reference path="../../src/types/core.d.ts" />
2022-11-13 18:02:05 +08:00
2022-12-29 23:08:44 +08:00
'use strict';
2022-11-13 18:02:05 +08:00
2022-12-29 23:08:44 +08:00
function enemys() {
2022-11-13 18:02:05 +08:00
this._init();
}
////// 初始化 //////
enemys.prototype._init = function () {
this.enemys = enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80;
for (var enemyId in this.enemys) {
this.enemys[enemyId].id = enemyId;
}
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype.getEnemys = function () {
var enemys = core.clone(this.enemys);
var enemyInfo = core.getFlag('enemyInfo');
if (enemyInfo) {
for (var id in enemyInfo) {
for (var name in enemyInfo[id]) {
enemys[id][name] = core.clone(enemyInfo[id][name]);
}
}
}
// 将所有怪物的各项属性映射到朝下的
for (var id in enemys) {
if (enemys[id].faceIds) {
var downId = enemys[id].faceIds.down;
if (downId != null && downId != id && enemys[downId]) {
enemys[id] = { id: id };
for (var property in enemys[downId]) {
2022-12-29 23:08:44 +08:00
if (
property != 'id' &&
enemys[downId].hasOwnProperty(property)
) {
2022-11-13 18:02:05 +08:00
(function (id, downId, property) {
Object.defineProperty(enemys[id], property, {
2022-12-29 23:08:44 +08:00
get: function () {
return enemys[downId][property];
},
set: function (v) {
enemys[downId][property] = v;
},
2022-11-13 18:02:05 +08:00
enumerable: true
2022-12-29 23:08:44 +08:00
});
2022-11-13 18:02:05 +08:00
})(id, downId, property);
}
}
}
}
}
return enemys;
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 判断是否含有某特殊属性 //////
enemys.prototype.hasSpecial = function (special, test) {
2023-08-07 17:57:51 +08:00
// Deprecated. Use `Array.includes` instead.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype.getSpecials = function () {
2023-08-07 17:57:51 +08:00
// Deprecated. See src/plugin/game/enemy/special.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得所有特殊属性的名称 //////
enemys.prototype.getSpecialText = function (enemy) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得所有特殊属性的颜色 //////
enemys.prototype.getSpecialColor = function (enemy) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得所有特殊属性的额外标记 //////
enemys.prototype.getSpecialFlag = function (enemy) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得每个特殊属性的说明 //////
enemys.prototype.getSpecialHint = function (enemy, special) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype._calSpecialContent = function (enemy, content) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得某个点上某个怪物的某项属性 //////
enemys.prototype.getEnemyValue = function (enemy, name, x, y, floorId) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 能否获胜 //////
enemys.prototype.canBattle = function (enemy, x, y, floorId) {
2023-07-30 17:04:52 +08:00
// Deprecated. See src/plugin/game/enemy/battle.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
2023-01-11 09:45:18 +08:00
enemys.prototype.getDamageString = function (enemy, x, y, floorId, hero) {
2023-07-30 17:33:46 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 接下来N个临界值和临界减伤计算 //////
2023-01-11 09:45:18 +08:00
enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId, hero) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts DamageEnemy.calCritical.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
/// 未破防临界采用二分计算
2023-08-06 22:43:58 +08:00
enemys.prototype._nextCriticals_overAtk = function (enemy) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts DamageEnemy.calCritical.
2022-12-29 23:08:44 +08:00
};
2023-08-06 22:43:58 +08:00
enemys.prototype._nextCriticals_special = function (enemy) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts DamageEnemy.calCritical.
2022-12-29 23:08:44 +08:00
};
2023-08-06 22:43:58 +08:00
enemys.prototype._nextCriticals_useBinarySearch = function (enemy) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts DamageEnemy.calCritical.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// N防减伤计算 //////
2023-01-11 09:45:18 +08:00
enemys.prototype.getDefDamage = function (enemy, k, x, y, floorId, hero) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts DamageEnemy.calDefDamage.
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype.getEnemyInfo = function (enemy, hero, x, y, floorId) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得战斗伤害信息(实际伤害计算函数) //////
enemys.prototype.getDamageInfo = function (enemy, hero, x, y, floorId) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得在某个勇士属性下怪物伤害 //////
2023-01-11 09:45:18 +08:00
enemys.prototype.getDamage = function (enemy, x, y, floorId, hero) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype._getDamage = function (enemy, hero, x, y, floorId) {
2024-02-02 17:10:21 +08:00
// Deprecated. See src/game/enemy/damage.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
////// 获得当前楼层的怪物列表 //////
enemys.prototype.getCurrentEnemys = function (floorId) {
2023-07-31 16:49:04 +08:00
// Deprecated. See src/plugin/game/enemy/battle.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype._getCurrentEnemys_getEnemy = function (enemyId) {
2023-08-06 22:43:58 +08:00
// Deprecated. See src/plugin/game/enemy/battle.ts
2022-12-29 23:08:44 +08:00
};
2023-08-06 22:43:58 +08:00
enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId) {
// Deprecated. See src/plugin/game/enemy/battle.ts
2022-12-29 23:08:44 +08:00
};
2023-08-06 22:43:58 +08:00
enemys.prototype._getCurrentEnemys_addEnemy_defDamage = function (enemy) {
// Deprecated. See src/plugin/game/enemy/battle.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype._getCurrentEnemys_sort = function (enemys) {
2023-08-06 22:43:58 +08:00
// Deprecated. See src/plugin/game/enemy/battle.ts
2022-12-29 23:08:44 +08:00
};
2022-11-13 18:02:05 +08:00
enemys.prototype.hasEnemyLeft = function (enemyId, floorId) {
2023-08-07 17:57:51 +08:00
// Deprecated.
2022-12-29 23:08:44 +08:00
};