标记todo

This commit is contained in:
unanmed 2023-07-28 12:17:20 +08:00
parent 26f74f9415
commit e8e6b202af
8 changed files with 13 additions and 0 deletions

View File

@ -203,12 +203,14 @@ enemys.prototype.getEnemyValue = function (enemy, name, x, y, floorId) {
////// 能否获胜 ////// ////// 能否获胜 //////
enemys.prototype.canBattle = function (enemy, x, y, floorId) { enemys.prototype.canBattle = function (enemy, x, y, floorId) {
// todo: 重写这个函数
if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
var damage = this.getDamage(enemy, x, y, floorId); var damage = this.getDamage(enemy, x, y, floorId);
return damage != null && damage < core.status.hero.hp; return damage != null && damage < core.status.hero.hp;
}; };
enemys.prototype.getDamageString = function (enemy, x, y, floorId, hero) { enemys.prototype.getDamageString = function (enemy, x, y, floorId, hero) {
// todo: 重写这个函数
if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
var damage = this.getDamage(enemy, x, y, floorId, hero); var damage = this.getDamage(enemy, x, y, floorId, hero);
@ -399,6 +401,7 @@ enemys.prototype._nextCriticals_useBinarySearch = function (
////// N防减伤计算 ////// ////// N防减伤计算 //////
enemys.prototype.getDefDamage = function (enemy, k, x, y, floorId, hero) { enemys.prototype.getDefDamage = function (enemy, k, x, y, floorId, hero) {
// todo: 删除这个函数
if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
k = k || 1; k = k || 1;
var nowDamage = this._getDamage(enemy, hero, x, y, floorId); var nowDamage = this._getDamage(enemy, hero, x, y, floorId);
@ -488,6 +491,7 @@ enemys.prototype._getCurrentEnemys_addEnemy = function (
y, y,
floorId floorId
) { ) {
// todo: 删除这个函数
var enemy = this._getCurrentEnemys_getEnemy(enemyId); var enemy = this._getCurrentEnemys_getEnemy(enemyId);
if (enemy == null) return; if (enemy == null) return;

View File

@ -471,6 +471,7 @@ events.prototype._sys_battle = function (data, callback) {
////// 战斗 ////// ////// 战斗 //////
events.prototype.battle = function (id, x, y, force, callback) { events.prototype.battle = function (id, x, y, force, callback) {
// todo: 重写这个函数的一部分,修改参数
core.saveAndStopAutomaticRoute(); core.saveAndStopAutomaticRoute();
id = id || core.getBlockId(x, y); id = id || core.getBlockId(x, y);
if (!id) return core.clearContinueAutomaticRoute(callback); if (!id) return core.clearContinueAutomaticRoute(callback);

View File

@ -3531,6 +3531,7 @@ maps.prototype.resetMap = function (floorId) {
////// 初始化独立的block canvas ////// ////// 初始化独立的block canvas //////
maps.prototype._initDetachedBlock = function (blockInfo, x, y, displayDamage) { maps.prototype._initDetachedBlock = function (blockInfo, x, y, displayDamage) {
// todo: 不使用 nextCriticals
var headCanvas = null, var headCanvas = null,
bodyCanvas = '__body_' + x + '_' + y, bodyCanvas = '__body_' + x + '_' + y,
damageCanvas = null; damageCanvas = null;

View File

@ -266,10 +266,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
// 战斗前触发的事件,可以加上一些战前特效(详见下面支援的例子) // 战斗前触发的事件,可以加上一些战前特效(详见下面支援的例子)
// 此函数在“检测能否战斗和自动存档”【之后】执行。如果需要更早的战前事件,请在插件中覆重写 core.events.doSystemEvent 函数。 // 此函数在“检测能否战斗和自动存档”【之后】执行。如果需要更早的战前事件,请在插件中覆重写 core.events.doSystemEvent 函数。
// 返回true则将继续战斗返回false将不再战斗。 // 返回true则将继续战斗返回false将不再战斗。
// todo: 重写
return true; return true;
}, },
afterBattle: function (enemyId, x, y) { afterBattle: function (enemyId, x, y) {
// todo: 重写
// 战斗结束后触发的事件 // 战斗结束后触发的事件
const floorId = core.status.floorId; const floorId = core.status.floorId;

View File

@ -49,6 +49,7 @@ const enemy = core.plugin.bookDetailEnemy;
const info = getSpecialHint(enemy); const info = getSpecialHint(enemy);
// todo: 使 nextCriticals
const criticals = core.nextCriticals(enemy, isMobile ? 4 : 8, mx, my); const criticals = core.nextCriticals(enemy, isMobile ? 4 : 8, mx, my);
const format = core.formatBigNumber; const format = core.formatBigNumber;

View File

@ -18,6 +18,7 @@ const enemyDamageInfo: Partial<Record<EnemyIds, Record<number, boolean>>> = {};
* @param id id * @param id id
*/ */
export function markEnemy(id: EnemyIds) { export function markEnemy(id: EnemyIds) {
// todo: 不使用 nextCriticals
if (hasMarkedEnemy(id)) return; if (hasMarkedEnemy(id)) return;
markedEnemy.push(id); markedEnemy.push(id);
markInfo[id] = { markInfo[id] = {
@ -64,6 +65,7 @@ export function getMarkedEnemy() {
* @param id id * @param id id
*/ */
export function getMarkInfo(id: EnemyIds, noMessage: boolean = false) { export function getMarkInfo(id: EnemyIds, noMessage: boolean = false) {
// todo: 不使用 nextCriticals
const reached = criticalReached[id]!; const reached = criticalReached[id]!;
const info = markInfo[id]!; const info = markInfo[id]!;
if (core.status.hero.atk >= info.nextCritical) { if (core.status.hero.atk >= info.nextCritical) {

View File

@ -54,6 +54,7 @@ export function getDetailedEnemy<I extends EnemyIds>(
floorId: FloorIds = core.status.floorId floorId: FloorIds = core.status.floorId
): DetailedEnemy<I> { ): DetailedEnemy<I> {
// todo: 删除 getDamageInfo // todo: 删除 getDamageInfo
// todo: 不使用 nextCriticals
const ratio = core.status.maps[floorId].ratio; const ratio = core.status.maps[floorId].ratio;
const enemyInfo = Object.assign( const enemyInfo = Object.assign(
{}, {},

View File

@ -111,6 +111,7 @@ function getDamage(id: EnemyIds) {
} }
function getCritical(id: EnemyIds) { function getCritical(id: EnemyIds) {
// todo: 使 nextCriticals
return ( return (
core core
.nextCriticals(id, 1, void 0, void 0, 'empty')[0] .nextCriticals(id, 1, void 0, void 0, 'empty')[0]