feat: 同化属性

This commit is contained in:
unanmed 2024-09-21 19:48:36 +08:00
parent 0a9ace7ab2
commit b9ae439cd9
12 changed files with 89 additions and 16 deletions

View File

@ -22,9 +22,9 @@
### 机制 ### 机制
[x] 苍蓝之殿 1: 红蓝黄门转换 [x] 苍蓝之殿 1: 红蓝黄门转换
[x] 苍蓝之殿 2: 乾坤挪移、杀戮光环、同化、光环范围扩大 [x] 苍蓝之殿 2: 乾坤挪移、杀戮光环等
[] 苍蓝之殿 3: 传送门 [] 苍蓝之殿 3: 传送门
[] 苍蓝之殿 4: 地形变换,如平移、翻转、旋转等 [] 苍蓝之殿 4: 同化、阻击
[] 苍蓝之殿中: 让我们把这些东西结合起来... [] 苍蓝之殿中: 让我们把这些东西结合起来...
### 成就 ### 成就

View File

@ -297,6 +297,12 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "再生光环", "_docs": "再生光环",
"_data": "再生光环" "_data": "再生光环"
}, },
"assimilateRange": {
"_leaf": true,
"_type": "textarea",
"_docs": "同化范围",
"_data": "同化范围"
},
"specialHalo": { "specialHalo": {
"_leaf": true, "_leaf": true,
"_type": "popCheckboxSet", "_type": "popCheckboxSet",
@ -305,10 +311,10 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
var b = [], var b = [],
c = []; c = [];
for (var index = 0; index < array.length; index++) { for (var index = 0; index < array.length; index++) {
b.push(index) b.push(index);
var name = array[index].name; var name = array[index].name;
if (name instanceof Function) name = name({}); if (name instanceof Function) name = name({});
c.push(name + "(" + index + ")") c.push(name + "(" + index + ")");
} }
return { return {
"prefix": c, "prefix": c,

View File

@ -1045,6 +1045,7 @@ maps.prototype._canMoveDirectly_checkNextPoint = function (blocksObj, x, y) {
if (damage) { if (damage) {
if (damage.damage !== 0) return false; if (damage.damage !== 0) return false;
if (damage.mockery) return false; if (damage.mockery) return false;
if (damage.hunt) return false;
} }
return true; return true;
@ -1138,7 +1139,8 @@ maps.prototype._automaticRoute_deepAdd = function (x, y, blocks) {
const damage = core.status.thisMap.enemy.mapDamage[`${x},${y}`]; const damage = core.status.thisMap.enemy.mapDamage[`${x},${y}`];
if (damage) { if (damage) {
deepAdd += damage.damage * 100; deepAdd += damage.damage * 100;
deepAdd += !!damage.mockery ? 1e5 : 0; deepAdd += !!damage.mockery ? 1e8 : 0;
deepAdd += !!damage.hunt ? 1e8 : 0;
} }
return deepAdd; return deepAdd;

View File

@ -168,7 +168,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
"E617": {"name":"冰封雕像","hp":12500,"atk":2750,"def":2000,"money":2,"exp":150,"point":0,"special":[]}, "E617": {"name":"冰封雕像","hp":12500,"atk":2750,"def":2000,"money":2,"exp":150,"point":0,"special":[]},
"E618": {"name":"圣殿守卫","hp":30000,"atk":12500,"def":7500,"money":10,"exp":1000,"point":0,"special":[]}, "E618": {"name":"圣殿守卫","hp":30000,"atk":12500,"def":7500,"money":10,"exp":1000,"point":0,"special":[]},
"E643": {"name":"苍蓝史莱姆","hp":17500,"atk":2800,"def":2000,"money":3,"exp":175,"point":0,"special":[28],"paleShield":30}, "E643": {"name":"苍蓝史莱姆","hp":17500,"atk":2800,"def":2000,"money":3,"exp":175,"point":0,"special":[28],"paleShield":30},
"E644": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E644": {"name":"苍蓝融合怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[32],"assimilateRange":2},
"E645": {"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":[]}, "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},
@ -186,7 +186,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
"E673": {"name":"苍蓝之灵-域","hp":250000,"atk":12000,"def":3000,"money":10,"exp":2500,"point":0,"special":[]}, "E673": {"name":"苍蓝之灵-域","hp":250000,"atk":12000,"def":3000,"money":10,"exp":2500,"point":0,"special":[]},
"E674": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E674": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E675": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E675": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E676": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E676": {"name":"冲锋骷髅","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[12]},
"E677": {"name":"骷髅巫师","hp":150000,"atk":2000,"def":5000,"money":5,"exp":600,"point":0,"special":[13],"crit":null}, "E677": {"name":"骷髅巫师","hp":150000,"atk":2000,"def":5000,"money":5,"exp":600,"point":0,"special":[13],"crit":null},
"E678": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E678": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E679": {"name":"剑盾之卫","hp":30000,"atk":10000,"def":6000,"money":7,"exp":700,"point":0,"special":[1],"crit":600}, "E679": {"name":"剑盾之卫","hp":30000,"atk":10000,"def":6000,"money":7,"exp":700,"point":0,"special":[1],"crit":600},

View File

@ -43,11 +43,11 @@ main.floors.MT75=
"map": [ "map": [
[648,648,648,648,648,648,648,648,648,648,648,648,648,648,648], [648,648,648,648,648,648,648,648,648,648,648,648,648,648,648],
[648,491,491,494,491,494, 0, 0, 0,494,491,494,491,491,648], [648,491,491,494,491,494, 0, 0, 0,494,491,494,491,491,648],
[648,648,648,648,648,648, 0,682,659,648,648,648,648,648,648], [648,648,648,648,648,648,644,682,659,648,648,648,648,648,648],
[648,484,484,492,484,492,578,677,679,492,484,492,484,484,648], [648,484,484,492,484,492,578,677,679,492,484,492,484,484,648],
[648,648,648,648,648,648,618,249,513,648,648,648,648,648,648], [648,648,648,648,648,648,618,249,513,648,648,648,648,648,648],
[648, 0, 0, 0, 0,103,232,658,671,103, 0, 0, 0, 0,648], [648, 0, 0, 0, 0,103,232,658,671,103, 0, 0, 0, 0,648],
[648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,648], [648, 0, 0, 0, 0,676, 0, 0, 0, 0, 0, 0, 0, 0,648],
[ 92, 0, 0,672, 0, 0, 0, 0, 0, 0, 0,599, 0, 0, 94], [ 92, 0, 0,672, 0, 0, 0, 0, 0, 0, 0,599, 0, 0, 94],
[648, 0, 0, 0, 0, 0, 0,657, 0, 0, 0, 0, 0, 0,648], [648, 0, 0, 0, 0, 0, 0,657, 0, 0, 0, 0, 0, 0,648],
[648, 0, 0, 0, 0,103, 0, 0, 0,103, 0, 0, 0, 0,648], [648, 0, 0, 0, 0,103, 0, 0, 0,103, 0, 0, 0, 0,648],

View File

@ -75,7 +75,11 @@ interface CriticalDamageDelta extends Omit<DamageDelta, 'info'> {
type HaloFn = (info: EnemyInfo, enemy: EnemyInfo) => void; type HaloFn = (info: EnemyInfo, enemy: EnemyInfo) => void;
/** 光环属性 */ /** 光环属性 */
export const haloSpecials: Set<number> = new Set([8, 21, 25, 26, 27, 29, 31]); export const haloSpecials: Set<number> = new Set([
8, 21, 25, 26, 27, 29, 31, 32
]);
export const unassimilatable: Set<number> = new Set(haloSpecials);
unassimilatable.add(8).add(30);
/** 特殊属性对应 */ /** 特殊属性对应 */
export const specialValue: Map<number, SelectKey<Enemy, number | undefined>[]> = export const specialValue: Map<number, SelectKey<Enemy, number | undefined>[]> =
new Map(); new Map();
@ -95,7 +99,8 @@ specialValue
.set(25, ['melt']) .set(25, ['melt'])
.set(26, ['iceCore']) .set(26, ['iceCore'])
.set(27, ['fireCore']) .set(27, ['fireCore'])
.set(28, ['paleShield']); .set(28, ['paleShield'])
.set(31, ['hpHalo']);
interface EnemyCollectionEvent { interface EnemyCollectionEvent {
extract: []; extract: [];
@ -508,6 +513,8 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
let [dx, dy] = [0, 0]; let [dx, dy] = [0, 0];
if (col) [dx, dy] = col.translation; if (col) [dx, dy] = col.translation;
// e 是被加成怪的属性enemy 是施加光环的怪
for (const halo of special) { for (const halo of special) {
switch (halo) { switch (halo) {
case 29: { case 29: {
@ -660,6 +667,52 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
}); });
} }
// 同化,它不会被光环类属性影响,因此放到这
if (special.includes(32)) {
const e = this.info;
const type = 'square';
const r = Math.floor(e.assimilateRange!);
const d = r * 2 + 1;
const range = { x: this.x, y: this.y, d };
col.applyHalo(type, range, this, (e, enemy) => {
// 如果是自身,就不进行特殊属性数值处理了
if (e === this.info) return;
const s = e.special;
for (const spe of s) {
if (unassimilatable.has(spe)) continue;
// 防止重复
if (!enemy.special.includes(spe)) {
enemy.special.push(spe);
}
}
// 然后计算特殊属性数值
for (const spec of s) {
if (unassimilatable.has(spec)) continue;
const toChange = specialValue.get(spec);
if (!toChange) continue;
for (const key of toChange) {
// 这种光环应该获取怪物的原始数值,而不是真实数值
if (enemy.enemy.specialMultiply) {
enemy[key] ??= 1;
enemy[key] *= e[key] ?? 1;
} else {
enemy[key] ??= 0;
enemy[key] += e[key] ?? 0;
}
}
}
});
col.haloList.push({
type: 'square',
data: range,
special: 32,
from: this
});
}
col.applyHalo( col.applyHalo(
'square', 'square',
{ x: this.x + dx, y: this.y + dy, d: 7 }, { x: this.x + dx, y: this.y + dy, d: 7 },
@ -1120,7 +1173,7 @@ export function calDamageWith(
// 连击 // 连击
if (special.includes(4)) enemyPerDamage *= 2; if (special.includes(4)) enemyPerDamage *= 2;
if (special.includes(5)) enemyPerDamage *= 3; if (special.includes(5)) enemyPerDamage *= 3;
if (special.includes(6)) enemyPerDamage *= enemy.n!; if (special.includes(6)) enemyPerDamage *= info.n!;
// 勇士学习霜冻 // 勇士学习霜冻
if (heroSpec.num.includes(20)) { if (heroSpec.num.includes(20)) {
@ -1192,7 +1245,7 @@ export function calDamageWith(
if (flags.hard === 1) damage *= 0.9; if (flags.hard === 1) damage *= 0.9;
if (flags.chapter > 1 && damage < 0) { if (flags.chapter > 1 && damage < 0) {
const dm = -enemy.hp * 0.25; const dm = -info.hp * 0.25;
if (damage < dm) damage = dm; if (damage < dm) damage = dm;
} }

View File

@ -254,5 +254,13 @@ export const specials: SpecialDeclaration[] = [
desc: enemy => desc: enemy =>
`怪物周围7*7范围内的所有怪物包括自身生命值提高${enemy.hpHalo}%`, `怪物周围7*7范围内的所有怪物包括自身生命值提高${enemy.hpHalo}%`,
color: '#85FF99' color: '#85FF99'
},
{
code: 32,
name: '同化',
desc: enemy =>
`怪物会获得自身周围方形${enemy.assimilateRange}格范围内怪物的特殊属性(光环类属性除外),` +
`特殊属性数值间为${enemy.specialMultiply ? '乘算' : '加算'}关系`,
color: '#ffd366'
} }
]; ];

View File

@ -27,6 +27,7 @@ const MAX_ROTATE = 0.5;
const FRAG_TIMING = linear(); const FRAG_TIMING = linear();
export function init() { export function init() {
return;
Mota.rewrite(core.events, 'afterBattle', 'add', (_, enemy, x, y) => { Mota.rewrite(core.events, 'afterBattle', 'add', (_, enemy, x, y) => {
// 打怪特效 // 打怪特效
const setting = Mota.require('var', 'mainSetting'); const setting = Mota.require('var', 'mainSetting');

View File

@ -47,7 +47,8 @@ const haloColor: Record<number, string[]> = {
26: ['blue'], 26: ['blue'],
27: ['red'], 27: ['red'],
31: ['#3CFF49'], 31: ['#3CFF49'],
29: ['#51E9FF'] 29: ['#51E9FF'],
32: ['#fff966']
}; };
class Halo extends Sprite { class Halo extends Sprite {

View File

@ -51,6 +51,7 @@ export {};
else core.setWeather(); else core.setWeather();
} }
core.status.maps[data].enemy?.extract(); core.status.maps[data].enemy?.extract();
core.status.maps[data].enemy?.calRealAttribute();
core.updateStatusBar(true, true); core.updateStatusBar(true, true);
} }
Mota.require('module', 'Shadow').Shadow.update(true); Mota.require('module', 'Shadow').Shadow.update(true);

View File

@ -300,7 +300,7 @@ interface Control {
* *
* @param steps * @param steps
*/ */
setAutoHeroMove(steps: CompressedStep[]): void; setAutoHeroMove(steps?: CompressedStep[]): void;
/** /**
* @deprecated * @deprecated

View File

@ -30,7 +30,8 @@ type PartialNumbericEnemyProperty =
| 'day' | 'day'
| 'night' | 'night'
| 'melt' | 'melt'
| 'hpHalo'; | 'hpHalo'
| 'assimilateRange';
type BooleanEnemyProperty = type BooleanEnemyProperty =
| 'zoneSquare' | 'zoneSquare'