mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 12:49:25 +08:00
fix: 杀戮光环 & feat: 注册新图块
This commit is contained in:
parent
3b064b6322
commit
32f57cafec
8
components.d.ts
vendored
8
components.d.ts
vendored
@ -7,6 +7,14 @@ export {}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
AButton: typeof import('ant-design-vue/es')['Button']
|
||||
ADivider: typeof import('ant-design-vue/es')['Divider']
|
||||
AInput: typeof import('ant-design-vue/es')['Input']
|
||||
AProgress: typeof import('ant-design-vue/es')['Progress']
|
||||
ASelect: typeof import('ant-design-vue/es')['Select']
|
||||
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
|
||||
ASlider: typeof import('ant-design-vue/es')['Slider']
|
||||
ASwitch: typeof import('ant-design-vue/es')['Switch']
|
||||
Box: typeof import('./src/components/box.vue')['default']
|
||||
BoxAnimate: typeof import('./src/components/boxAnimate.vue')['default']
|
||||
Colomn: typeof import('./src/components/colomn.vue')['default']
|
||||
|
2
idea.md
2
idea.md
@ -22,7 +22,7 @@
|
||||
### 机制
|
||||
|
||||
[] 苍蓝之殿 1: 红蓝黄门转换
|
||||
[] 苍蓝之殿 2:
|
||||
[] 苍蓝之殿 2: 乾坤挪移、杀戮光环、同化
|
||||
[] 苍蓝之殿 3: 传送门
|
||||
[] 苍蓝之殿 4:
|
||||
[] 苍蓝之殿中: 让我们把这些东西结合起来...
|
||||
|
@ -285,6 +285,38 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
||||
"_docs": "苍蓝刻",
|
||||
"_data": "苍蓝刻"
|
||||
},
|
||||
"specialHalo": {
|
||||
"_leaf": true,
|
||||
"_type": "popCheckboxSet",
|
||||
"_checkboxSet": function () {
|
||||
var array = Mota.require('var', 'enemySpecials');
|
||||
var b = [],
|
||||
c = [];
|
||||
for (var index = 0; index < array.length; index++) {
|
||||
b.push(index)
|
||||
var name = array[index].name;
|
||||
if (name instanceof Function) name = name({});
|
||||
c.push(name + "(" + index + ")")
|
||||
}
|
||||
return {
|
||||
"prefix": c,
|
||||
"key": b
|
||||
}
|
||||
},
|
||||
"_data": "杀戮光环"
|
||||
},
|
||||
"specialMultiply": {
|
||||
"_leaf": true,
|
||||
"_type": "checkbox",
|
||||
"_docs": "光环叠加",
|
||||
"_data": "光环叠加是否为乘算"
|
||||
},
|
||||
"haloRange": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_docs": "光环范围",
|
||||
"_data": "光环范围"
|
||||
},
|
||||
"value": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
|
@ -60,7 +60,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
||||
"grayRock": {"name":"林间巨石","hp":100,"atk":60,"def":0,"money":0,"exp":12,"point":0,"special":[3],"description":"貌似比山洞里面的那些家伙硬了一些?哼,那又能有什么用呢?"},
|
||||
"yellowPriest": {"name":"中级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"evilPrincess": {"name":"痛苦魔女","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"blademaster": {"name":"剑圣","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"blademaster": {"name":"苍蓝之剑","hp":5000,"atk":10000,"def":5000,"money":0,"exp":0,"point":0,"special":[1,5],"courage":null,"crit":250},
|
||||
"evilFairy": {"name":"黑暗仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"blueRock": {"name":"勇气之石","hp":2000,"atk":450,"def":230,"money":1,"exp":30,"point":0,"special":[],"description":"巨石,这本身是一种不可怕的怪物。而可怕的是,当这些巨石拥有了勇气,或许就很少有人敢于直面他们了。"},
|
||||
"skeletonLite": {"name":"骷髅精英","hp":2000,"atk":275,"def":240,"money":1,"exp":35,"point":0,"special":[9],"description":"骷髅们总是说,没有防御力,让我怎么去攻击别人?呵,这防御力不就来了吗?可是,这又有何用呢?"},
|
||||
@ -125,7 +125,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
||||
"E557": {"name":"智慧之神","hp":10000,"atk":2000,"def":800,"money":10,"exp":500,"point":0,"special":[]},
|
||||
"E561": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E562": {"name":"嘲讽剑客","hp":5000,"atk":1600,"def":500,"money":1,"exp":60,"point":0,"special":[19]},
|
||||
"E563": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E563": {"name":"嘲讽剑圣","hp":15000,"atk":6000,"def":3000,"money":0,"exp":0,"point":0,"special":[19]},
|
||||
"E564": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E566": {"name":"智慧史莱姆","hp":6000,"atk":1200,"def":600,"money":1,"exp":50,"point":0,"special":[8],"together":25},
|
||||
"E567": {"name":"精明史莱姆","hp":5000,"atk":1200,"def":550,"money":0,"exp":0,"point":0,"special":[8],"together":30},
|
||||
@ -145,7 +145,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
||||
"E593": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E594": {"name":"苍蓝骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E595": {"name":"寒冰兽人","hp":12500,"atk":1800,"def":800,"money":2,"exp":100,"point":0,"special":[7],"hungry":25},
|
||||
"E596": {"name":"苍蓝兽人","hp":10000,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E596": {"name":"苍蓝兽人","hp":20000,"atk":5000,"def":3000,"money":4,"exp":250,"point":0,"special":[1,28],"paleShield":30,"specialHalo":[],"iceHalo":20,"haloRange":2,"value":1000,"melt":50,"together":20,"fireCore":20,"crit":500},
|
||||
"E597": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E598": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E599": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
@ -160,7 +160,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
||||
"E609": {"name":"具形雪人","hp":7500,"atk":2250,"def":1250,"money":2,"exp":90,"point":0,"special":[25],"melt":15},
|
||||
"E610": {"name":"高冷雪人","hp":10000,"atk":2500,"def":1500,"money":2,"exp":150,"point":0,"special":[25],"melt":25},
|
||||
"E611": {"name":"具形雪人法师","hp":15000,"atk":2500,"def":1750,"money":2,"exp":175,"point":0,"special":[13,25],"melt":30},
|
||||
"E612": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E612": {"name":"苍蓝雪人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E613": {"name":"寒冰核心","hp":20000,"atk":2750,"def":1500,"money":3,"exp":150,"point":0,"special":[26],"iceCore":20},
|
||||
"E614": {"name":"火焰核心","hp":15000,"atk":2750,"def":1750,"money":3,"exp":140,"point":0,"special":[27],"fireCore":20},
|
||||
"E615": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
@ -171,5 +171,9 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
|
||||
"E644": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E645": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E646": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E647": {"name":"苍蓝之灵-虚","hp":30000,"atk":5000,"def":3000,"money":10,"exp":2500,"point":0,"special":[28],"paleShield":10}
|
||||
"E647": {"name":"苍蓝之灵-虚","hp":30000,"atk":5000,"def":3000,"money":10,"exp":2500,"point":0,"special":[28],"paleShield":10},
|
||||
"E656": {"name":"触手史莱姆","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[8]},
|
||||
"E657": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E658": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
|
||||
"E659": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}
|
||||
}
|
@ -33,12 +33,12 @@ main.floors.MT50=
|
||||
"9,13": [
|
||||
"在你刚进入苍蓝之殿时,你只能先前往左下角部分(本地图的左面),右下角暂时不能前往。"
|
||||
],
|
||||
"5,1": [
|
||||
"左边两个机关门在打完左下角区域的boss后开启,右边同理。"
|
||||
],
|
||||
"9,1": [
|
||||
"建议优先点出学习技能,对于特定场景将会非常有帮助",
|
||||
"本区域可以使用跳跃技能,不要忘记了。"
|
||||
],
|
||||
"5,1": [
|
||||
"左边两个机关门在打完左下角区域的boss后开启,右边同理。"
|
||||
]
|
||||
},
|
||||
"changeFloor": {
|
||||
@ -60,7 +60,7 @@ main.floors.MT50=
|
||||
"map": [
|
||||
[648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648],
|
||||
[648, 0, 0, 0, 0,129, 0, 0, 0,129, 0, 0, 0, 0,648],
|
||||
[648, 0, 0, 0, 0,648, 0, 0, 0,648, 0, 0, 0, 0,648],
|
||||
[648, 0, 0, 0, 0,648,596,563,249,648, 0, 0, 0, 0,648],
|
||||
[648, 0, 0, 0, 0,648, 0, 0, 0,648, 0, 0, 0, 0,648],
|
||||
[648, 0, 0, 0,103,648, 0, 0, 0,648,103, 0, 0, 0,648],
|
||||
[648, 85,648,648,648,648, 0, 0, 0,648,648,648,648, 85,648],
|
||||
|
@ -134,7 +134,10 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
|
||||
"T652": 74,
|
||||
"T653": 75,
|
||||
"T654": 76,
|
||||
"T655": 77
|
||||
"T655": 77,
|
||||
"T660": 78,
|
||||
"T661": 79,
|
||||
"T662": 80
|
||||
},
|
||||
"animates": {
|
||||
"star": 0,
|
||||
@ -416,7 +419,11 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
|
||||
"E644": 164,
|
||||
"E645": 165,
|
||||
"E646": 166,
|
||||
"E647": 167
|
||||
"E647": 167,
|
||||
"E656": 168,
|
||||
"E657": 169,
|
||||
"E658": 170,
|
||||
"E659": 171
|
||||
},
|
||||
"enemy48": {
|
||||
"angel": 0,
|
||||
|
@ -165,7 +165,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"text": "真的是一把很普通的银剑,哦不,铁剑。攻击+180,额外攻击+50",
|
||||
"equip": {
|
||||
"type": 0,
|
||||
"animate": "sword",
|
||||
"animate": "jianji",
|
||||
"value": {
|
||||
"mana": 50,
|
||||
"atk": 180
|
||||
@ -349,7 +349,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"name": "查看技能",
|
||||
"text": "查看勇士的技能",
|
||||
"canUseItemEffect": true,
|
||||
"useItemEffect": "Mota.Plugin.require('gameUi_g').openSkill();"
|
||||
"useItemEffect": "Mota.require('var', 'mainUi').open('skill');"
|
||||
},
|
||||
"dagger": {
|
||||
"cls": "constants",
|
||||
|
@ -584,6 +584,12 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
|
||||
"653": {"cls":"terrains","id":"T653"},
|
||||
"654": {"cls":"terrains","id":"T654"},
|
||||
"655": {"cls":"terrains","id":"T655"},
|
||||
"656": {"cls":"enemys","id":"E656"},
|
||||
"657": {"cls":"enemys","id":"E657"},
|
||||
"658": {"cls":"enemys","id":"E658"},
|
||||
"659": {"cls":"enemys","id":"E659"},
|
||||
"660": {"cls":"terrains","id":"T660"},
|
||||
"661": {"cls":"terrains","id":"T661"},
|
||||
"20032": {"cls":"tileset","id":"X20032","cannotOut":["up","left"],"cannotIn":["up","left"]},
|
||||
"20033": {"cls":"tileset","id":"X20033","cannotOut":["up"],"cannotIn":["up"]},
|
||||
"20034": {"cls":"tileset","id":"X20034","cannotOut":["up","right"],"cannotIn":["up","right"]},
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 171 KiB |
Binary file not shown.
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 67 KiB |
@ -156,6 +156,116 @@ function init() {
|
||||
core.battle(ex, ey, true, core.doAction);
|
||||
}
|
||||
};
|
||||
|
||||
core.events.afterBattle = function afterBattle(
|
||||
enemy: DamageEnemy,
|
||||
x?: number,
|
||||
y?: number
|
||||
) {
|
||||
const floorId = core.status.floorId;
|
||||
const special = enemy.info.special;
|
||||
|
||||
// 播放战斗动画
|
||||
let animate: AnimationIds = 'hand';
|
||||
// 检查当前装备是否存在攻击动画
|
||||
const equipId = core.getEquip(0);
|
||||
if (equipId && (core.material.items[equipId].equip || {}).animate)
|
||||
animate = core.material.items[equipId].equip.animate;
|
||||
|
||||
// 检查该动画是否存在SE,如果不存在则使用默认音效
|
||||
if (!core.material.animates[animate]?.se) core.playSound('attack.mp3');
|
||||
|
||||
// 战斗伤害
|
||||
const info = enemy.calDamage(core.status.hero);
|
||||
const damage = info.damage;
|
||||
// 判定是否致死
|
||||
if (damage >= core.status.hero.hp) {
|
||||
core.status.hero.hp = 0;
|
||||
core.updateStatusBar(false, true);
|
||||
core.events.lose('战斗失败');
|
||||
return;
|
||||
}
|
||||
|
||||
// 扣减体力值并记录统计数据
|
||||
core.status.hero.hp -= damage;
|
||||
core.status.hero.statistics.battleDamage += damage;
|
||||
core.status.hero.statistics.battle++;
|
||||
|
||||
// 智慧之源
|
||||
if (special.includes(14) && flags.hard === 2) {
|
||||
core.addFlag(
|
||||
'inte_' + floorId,
|
||||
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10
|
||||
);
|
||||
core.status.hero.mdef -=
|
||||
Math.ceil((core.status.hero.mdef / 10) * 0.3) * 10;
|
||||
}
|
||||
|
||||
// 极昼永夜
|
||||
if (special.includes(22)) {
|
||||
flags[`night_${floorId}`] ??= 0;
|
||||
flags[`night_${floorId}`] -= enemy.info.night!;
|
||||
}
|
||||
if (special.includes(23)) {
|
||||
flags[`night_${floorId}`] ??= 0;
|
||||
flags[`night_${floorId}`] += enemy.info.day;
|
||||
}
|
||||
|
||||
// if (core.plugin.skillTree.getSkillLevel(11) > 0) {
|
||||
// core.plugin.study.declineStudiedSkill();
|
||||
// }
|
||||
|
||||
// 如果是融化怪,需要特殊标记一下
|
||||
if (special.includes(25) && has(x) && has(y)) {
|
||||
flags[`melt_${floorId}`] ??= {};
|
||||
flags[`melt_${floorId}`][`${x},${y}`] = enemy.info.melt;
|
||||
}
|
||||
|
||||
// 获得金币
|
||||
const money = enemy.info.money!;
|
||||
core.status.hero.money += money;
|
||||
core.status.hero.statistics.money += money;
|
||||
|
||||
// 获得经验
|
||||
const exp = enemy.info.exp!;
|
||||
core.status.hero.exp += exp;
|
||||
core.status.hero.statistics.exp += exp;
|
||||
|
||||
const hint =
|
||||
'打败 ' + enemy.enemy.name + ',金币+' + money + ',经验+' + exp;
|
||||
core.drawTip(hint, enemy.id);
|
||||
|
||||
if (core.getFlag('bladeOn') && core.getFlag('blade')) {
|
||||
core.setFlag('blade', false);
|
||||
}
|
||||
if (core.getFlag('shieldOn') && core.getFlag('shield')) {
|
||||
core.setFlag('shield', false);
|
||||
}
|
||||
|
||||
// 事件的处理
|
||||
const todo: MotaEvent = [];
|
||||
|
||||
// 战后事件
|
||||
if (has(core.status.floorId)) {
|
||||
const loc = `${x},${y}` as LocString;
|
||||
todo.push(
|
||||
...(core.floors[core.status.floorId].afterBattle[loc] ?? [])
|
||||
);
|
||||
}
|
||||
todo.push(...(enemy.enemy.afterBattle ?? []));
|
||||
|
||||
// 如果事件不为空,将其插入
|
||||
if (todo.length > 0) core.insertAction(todo, x, y);
|
||||
|
||||
if (has(x) && has(y)) {
|
||||
core.drawAnimate(animate, x, y);
|
||||
core.removeBlock(x, y);
|
||||
} else core.drawHeroAnimate(animate);
|
||||
|
||||
// 如果已有事件正在处理中
|
||||
if (core.status.event.id == null) core.continueAutomaticRoute();
|
||||
else core.clearContinueAutomaticRoute();
|
||||
};
|
||||
}
|
||||
loading.once('coreInit', init);
|
||||
|
||||
|
@ -8,15 +8,22 @@ import {
|
||||
manhattan
|
||||
} from '@/plugin/game/utils';
|
||||
|
||||
// todo: 光环划分优先级,从而可以实现光环的多级运算
|
||||
|
||||
interface HaloType {
|
||||
square: {
|
||||
x: number;
|
||||
y: number;
|
||||
d: number;
|
||||
};
|
||||
manhattan: {
|
||||
x: number;
|
||||
y: number;
|
||||
d: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface EnemyInfo extends Partial<Enemy> {
|
||||
export interface EnemyInfo extends Partial<Enemy> {
|
||||
atk: number;
|
||||
def: number;
|
||||
hp: number;
|
||||
@ -62,10 +69,30 @@ interface CriticalDamageDelta extends Omit<DamageDelta, 'info'> {
|
||||
atkDelta: number;
|
||||
}
|
||||
|
||||
type HaloFn = (info: EnemyInfo, enemy: Enemy) => void;
|
||||
type HaloFn = (info: EnemyInfo, enemy: EnemyInfo) => void;
|
||||
|
||||
/** 光环属性 */
|
||||
export const haloSpecials: Set<number> = new Set([8, 21, 25, 26, 27]);
|
||||
export const haloSpecials: Set<number> = new Set([8, 21, 25, 26, 27, 29]);
|
||||
/** 特殊属性对应 */
|
||||
export const specialValue: Map<number, SelectKey<Enemy, number | undefined>[]> =
|
||||
new Map();
|
||||
specialValue
|
||||
.set(1, ['crit'])
|
||||
.set(6, ['n'])
|
||||
.set(7, ['hungry'])
|
||||
.set(8, ['together'])
|
||||
.set(10, ['courage'])
|
||||
.set(11, ['charge'])
|
||||
.set(15, ['value'])
|
||||
.set(18, ['value'])
|
||||
.set(20, ['ice'])
|
||||
.set(21, ['iceHalo'])
|
||||
.set(22, ['night'])
|
||||
.set(23, ['day'])
|
||||
.set(25, ['melt'])
|
||||
.set(26, ['iceCore'])
|
||||
.set(27, ['fireCore'])
|
||||
.set(28, ['paleShield']);
|
||||
|
||||
export class EnemyCollection implements RangeCollection<DamageEnemy> {
|
||||
floorId: FloorIds;
|
||||
@ -107,6 +134,8 @@ export class EnemyCollection implements RangeCollection<DamageEnemy> {
|
||||
this.haloList = [];
|
||||
this.list.forEach(v => {
|
||||
v.reset();
|
||||
});
|
||||
this.list.forEach(v => {
|
||||
v.preProvideHalo();
|
||||
});
|
||||
this.list.forEach(v => {
|
||||
@ -150,21 +179,22 @@ export class EnemyCollection implements RangeCollection<DamageEnemy> {
|
||||
applyHalo<K extends keyof HaloType>(
|
||||
type: K,
|
||||
data: HaloType[K],
|
||||
enemy: DamageEnemy,
|
||||
halo: HaloFn | HaloFn[],
|
||||
recursion: boolean = false
|
||||
) {
|
||||
const arr = ensureArray(halo);
|
||||
const enemy = this.range.scan(type, data);
|
||||
const enemys = this.range.scan(type, data);
|
||||
if (!recursion) {
|
||||
arr.forEach(v => {
|
||||
enemy.forEach(e => {
|
||||
e.injectHalo(v, e.enemy);
|
||||
enemys.forEach(e => {
|
||||
e.injectHalo(v, enemy.info);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
enemy.forEach(e => {
|
||||
enemys.forEach(e => {
|
||||
arr.forEach(v => {
|
||||
e.injectHalo(v, e.enemy);
|
||||
e.injectHalo(v, enemy.info);
|
||||
e.preProvideHalo();
|
||||
});
|
||||
});
|
||||
@ -429,6 +459,66 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
||||
preProvideHalo() {
|
||||
if (this.progress !== 0) return;
|
||||
this.progress = 1;
|
||||
if (!this.floorId) return;
|
||||
if (!has(this.x) || !has(this.y)) return;
|
||||
const special = this.getHaloSpecials();
|
||||
const col = this.col ?? core.status.maps[this.floorId!].enemy;
|
||||
|
||||
for (const halo of special) {
|
||||
switch (halo) {
|
||||
case 29: {
|
||||
// 特殊光环
|
||||
const e = this.enemy;
|
||||
const type = 'square';
|
||||
const r = Math.floor(e.haloRange!);
|
||||
const d = r * 2 + 1;
|
||||
const range = { x: this.x, y: this.y, d };
|
||||
|
||||
// 这一句必须放到applyHalo之前
|
||||
this.providedHalo.add(29);
|
||||
|
||||
col.applyHalo(
|
||||
type,
|
||||
range,
|
||||
this,
|
||||
(e, enemy) => {
|
||||
const s = enemy.specialHalo!;
|
||||
|
||||
for (const spe of s) {
|
||||
// 防止重复
|
||||
if (!e.special.includes(spe))
|
||||
e.special.push(spe);
|
||||
}
|
||||
// 如果是自身,就不进行特殊属性数值处理了
|
||||
if (e === this.info) return;
|
||||
// 然后计算特殊属性数值
|
||||
for (const spec of s) {
|
||||
const toChange = specialValue.get(spec);
|
||||
if (!toChange) continue;
|
||||
for (const key of toChange) {
|
||||
// 这种光环应该获取怪物的原始数值,而不是真实数值
|
||||
if (enemy.enemy.specialMultiply) {
|
||||
e[key] ??= 1;
|
||||
e[key] *= enemy[key] ?? 1;
|
||||
} else {
|
||||
e[key] ??= 0;
|
||||
e[key] += enemy[key] ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// true表示递归计算,视为第一类光环
|
||||
true
|
||||
);
|
||||
col.haloList.push({
|
||||
type: 'square',
|
||||
data: { x: this.x, y: this.y, d },
|
||||
special: 29,
|
||||
from: this
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -504,14 +594,14 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
||||
});
|
||||
}
|
||||
|
||||
col.applyHalo('square', { x: this.x, y: this.y, d: 7 }, square7);
|
||||
col.applyHalo('square', { x: this.x, y: this.y, d: 5 }, square5);
|
||||
col.applyHalo('square', { x: this.x, y: this.y, d: 7 }, this, square7);
|
||||
col.applyHalo('square', { x: this.x, y: this.y, d: 5 }, this, square5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接受其他怪的光环
|
||||
*/
|
||||
injectHalo(halo: HaloFn, enemy: Enemy) {
|
||||
injectHalo(halo: HaloFn, enemy: EnemyInfo) {
|
||||
halo(this.info, enemy);
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,17 @@
|
||||
import { getHeroStatusOn } from '@/game/hero';
|
||||
import { EnemyInfo } from './damage';
|
||||
|
||||
export interface SpecialDeclaration {
|
||||
code: number;
|
||||
name: string | ((enemy: Enemy) => string);
|
||||
desc: string | ((enemy: Enemy) => string);
|
||||
name: string | ((enemy: EnemyInfo) => string);
|
||||
desc: string | ((enemy: EnemyInfo) => string);
|
||||
color: string;
|
||||
}
|
||||
|
||||
const fromFunc = (func: string | ((enemy: Enemy) => string), enemy: Enemy) => {
|
||||
const fromFunc = (
|
||||
func: string | ((enemy: EnemyInfo) => string),
|
||||
enemy: EnemyInfo
|
||||
) => {
|
||||
return typeof func === 'string' ? func : func(enemy);
|
||||
};
|
||||
|
||||
@ -209,18 +213,24 @@ export const specials: SpecialDeclaration[] = [
|
||||
code: 29,
|
||||
name: '杀戮光环',
|
||||
desc: enemy => {
|
||||
const special = enemy.special;
|
||||
let str = '<div style="margin-left: 10px">';
|
||||
|
||||
special.forEach(v => {
|
||||
const { name, desc, color } = specials[v];
|
||||
str += `<span style="color:${color}">${fromFunc(
|
||||
name,
|
||||
enemy
|
||||
)}</span><span>${fromFunc(desc, enemy)}</span>`;
|
||||
let content = '';
|
||||
enemy.specialHalo?.forEach((v, i) => {
|
||||
content +=
|
||||
' '.repeat(8) +
|
||||
`${i + 1}. <span style="color: ${
|
||||
specials[v].color
|
||||
}">${fromFunc(specials[v].name, enemy)}</span>: ${fromFunc(
|
||||
specials[v].desc,
|
||||
enemy
|
||||
)}<br />`;
|
||||
});
|
||||
|
||||
return str;
|
||||
return (
|
||||
`怪物周围九宫格${enemy.haloRange}格范围内所有怪物获得以下特殊属性(包括自身),` +
|
||||
`特殊属性数值间为${
|
||||
enemy.specialMultiply ? '相乘' : '相加'
|
||||
}关系:<br />` +
|
||||
content
|
||||
);
|
||||
},
|
||||
color: '#F721F7'
|
||||
}
|
||||
|
@ -28,8 +28,6 @@ export function init() {
|
||||
Mota.rewrite(core.events, 'afterBattle', 'add', (_, enemy, x, y) => {
|
||||
// 打怪特效
|
||||
const setting = Mota.require('var', 'mainSetting');
|
||||
console.log(setting.getValue('fx.frag'));
|
||||
|
||||
if (setting.getValue('fx.frag') && has(x) && has(y)) {
|
||||
const frame = core.status.globalAnimateStatus % 2;
|
||||
const canvas = document.createElement('canvas');
|
||||
|
@ -2,7 +2,8 @@ const haloColor: Record<number, string[]> = {
|
||||
21: ['cyan'],
|
||||
25: ['purple'],
|
||||
26: ['blue'],
|
||||
27: ['red']
|
||||
27: ['red'],
|
||||
29: ['#BD0D0D']
|
||||
};
|
||||
|
||||
export function drawHalo(
|
||||
|
@ -20,7 +20,7 @@ export function init() {
|
||||
ensureFloorDamage(floorId);
|
||||
|
||||
floor.enemy.extract();
|
||||
floor.enemy.calDamage(true);
|
||||
floor.enemy.calRealAttribute();
|
||||
floor.enemy.calMapDamage();
|
||||
core.status.damage.data = [];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { getDamageColor } from '../utils';
|
||||
import { ToShowEnemy } from './book';
|
||||
import type { DamageEnemy } from '../../game/enemy/damage';
|
||||
import type { DamageEnemy, EnemyInfo } from '../../game/enemy/damage';
|
||||
import { isMobile } from '../use';
|
||||
|
||||
export function getLocFromMouseLoc(x: number, y: number): LocArr {
|
||||
@ -23,19 +23,21 @@ export function getDetailedEnemy(
|
||||
const damage = core.formatBigNumber(dam);
|
||||
|
||||
const fromFunc = (
|
||||
func: string | ((enemy: Enemy) => string),
|
||||
enemy: Enemy
|
||||
func: string | ((enemy: EnemyInfo) => string),
|
||||
enemy: EnemyInfo
|
||||
) => {
|
||||
return typeof func === 'string' ? func : func(enemy);
|
||||
};
|
||||
const special: [string, string, string][] = enemy.enemy.special.map(vv => {
|
||||
const s = Mota.require('var', 'enemySpecials')[vv];
|
||||
return [
|
||||
fromFunc(s.name, enemy.enemy),
|
||||
fromFunc(s.desc, enemy.enemy),
|
||||
s.color as string
|
||||
];
|
||||
});
|
||||
const special: [string, string, string][] = enemy.info.special
|
||||
.filter(v => !enemy.info.specialHalo?.includes(v))
|
||||
.map(vv => {
|
||||
const s = Mota.require('var', 'enemySpecials')[vv];
|
||||
return [
|
||||
fromFunc(s.name, enemy.info),
|
||||
fromFunc(s.desc, enemy.info),
|
||||
s.color as string
|
||||
];
|
||||
});
|
||||
const l = isMobile ? 1 : 2;
|
||||
const showSpecial =
|
||||
special.length > l
|
||||
|
7
src/source/cls.d.ts
vendored
7
src/source/cls.d.ts
vendored
@ -582,6 +582,13 @@ interface IdToCls {
|
||||
T652: 'terrains';
|
||||
T653: 'terrains';
|
||||
T654: 'terrains';
|
||||
T655: 'terrains';
|
||||
E656: 'enemys';
|
||||
E657: 'enemys';
|
||||
E658: 'enemys';
|
||||
E659: 'enemys';
|
||||
T660: 'terrains';
|
||||
T661: 'terrains';
|
||||
X20032: 'tileset';
|
||||
X20033: 'tileset';
|
||||
X20034: 'tileset';
|
||||
|
14
src/source/maps.d.ts
vendored
14
src/source/maps.d.ts
vendored
@ -582,6 +582,13 @@ interface IdToNumber {
|
||||
T652: 652;
|
||||
T653: 653;
|
||||
T654: 654;
|
||||
T655: 655;
|
||||
E656: 656;
|
||||
E657: 657;
|
||||
E658: 658;
|
||||
E659: 659;
|
||||
T660: 660;
|
||||
T661: 661;
|
||||
X20032: 20032;
|
||||
X20033: 20033;
|
||||
X20034: 20034;
|
||||
@ -1249,6 +1256,13 @@ interface NumberToId {
|
||||
652: 'T652';
|
||||
653: 'T653';
|
||||
654: 'T654';
|
||||
655: 'T655';
|
||||
656: 'E656';
|
||||
657: 'E657';
|
||||
658: 'E658';
|
||||
659: 'E659';
|
||||
660: 'T660';
|
||||
661: 'T661';
|
||||
20032: 'X20032';
|
||||
20033: 'X20033';
|
||||
20034: 'X20034';
|
||||
|
7
src/types/enemy.d.ts
vendored
7
src/types/enemy.d.ts
vendored
@ -36,7 +36,8 @@ type BooleanEnemyProperty =
|
||||
| 'haloSquare'
|
||||
| 'notBomb'
|
||||
| 'add'
|
||||
| 'haloAdd';
|
||||
| 'haloAdd'
|
||||
| 'specialMultiply';
|
||||
|
||||
type DetailedEnemy<I extends EnemyIds = EnemyIds> = {
|
||||
specialText: string[];
|
||||
@ -85,10 +86,12 @@ type Enemy<I extends EnemyIds = EnemyIds> = {
|
||||
* 战后事件
|
||||
*/
|
||||
afterBattle: MotaEvent;
|
||||
|
||||
specialHalo?: number[];
|
||||
} & {
|
||||
[P in PartialNumbericEnemyProperty]?: number;
|
||||
} & {
|
||||
[P in BooleanEnemyProperty]: boolean;
|
||||
[P in BooleanEnemyProperty]?: boolean;
|
||||
} & EnemyInfoBase;
|
||||
|
||||
/**
|
||||
|
@ -68,8 +68,8 @@ const detail = ((): [number, string, string][] => {
|
||||
[enemy.enemy.money, '金币', 'lightyellow'],
|
||||
[enemy.enemy.exp, '经验', 'lawgreen'],
|
||||
[data?.atkDelta ?? 0, '临界', 'lightsalmon'],
|
||||
[data?.delta ?? 0, '临界减伤', 'lightpink'],
|
||||
[enemy.calDefDamage(ratio).delta, `${ratio}防`, 'cyan']
|
||||
[-data?.delta ?? 0, '临界减伤', 'lightpink'],
|
||||
[-enemy.calDefDamage(ratio).delta, `${ratio}防`, 'cyan']
|
||||
];
|
||||
})();
|
||||
const special = (() => {
|
||||
|
Loading…
Reference in New Issue
Block a user