From a700b89c1342ac9aed7902c6b58b087bee4c9079 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Tue, 15 Oct 2024 18:24:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=E8=BF=BD=E9=80=90=E6=88=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=AD=E5=9E=8B=E4=B8=8E=E5=A4=A7=E5=9E=8B?= =?UTF-8?q?=E6=89=AD=E6=9B=B2=E7=89=B9=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/chase/chase1.ts | 34 ++++++++++++++++++++++++++++++---- src/plugin/fx/pointShader.ts | 4 +++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/plugin/chase/chase1.ts b/src/plugin/chase/chase1.ts index 5ccac4a..06e6cc5 100644 --- a/src/plugin/chase/chase1.ts +++ b/src/plugin/chase/chase1.ts @@ -6,7 +6,6 @@ import { LayerGroup } from '@/core/render/preset/layer'; import { MotaRenderer } from '@/core/render/render'; import { Sprite } from '@/core/render/sprite'; import { bgm } from '@/core/audio/bgm'; -import { Shader, ShaderProgram, UniformType } from '@/core/render/shader'; import { PointEffect, PointEffectType } from '../fx/pointShader'; const path: Partial> = { @@ -369,12 +368,34 @@ function addCommonWarp(x: number, y: number) { PointEffectType.CircleWarp, Date.now(), 1000, - [x * 32 + 16, y * 32 + 16, 96, 16], + [x * 32 + 16, y * 32 + 16, 96, 20], [1 / 20, 1, 0.5, 0], [0, Math.PI * 2, 0, 0] ); } +function addMediuWarp(x: number, y: number) { + effect.addEffect( + PointEffectType.CircleWarp, + Date.now(), + 5000, + [x * 32 + 16, y * 32 + 16, 480, 24], + [1 / 20, 1, 0.5, 0], + [0, Math.PI * 2, 0, 0] + ); +} + +function addLargeWarp(x: number, y: number) { + effect.addEffect( + PointEffectType.CircleWarp, + Date.now(), + 10000, + [x * 32 + 16, y * 32 + 16, 1080, 32], + [1 / 15, 1, 0.5, 0], + [0, Math.PI * 2, 0, 0] + ); +} + function explode1(x: number, y: number) { core.setBlock(336, x, y); core.drawAnimate('explosion1', x, y); @@ -389,7 +410,7 @@ function para1(chase: Chase) { } } core.drawAnimate('explosion3', 55, 5); - core.drawAnimate('stone', 55, 5); + addMediuWarp(55, 5); }); chase.onFloorTime('MT15', 1080, () => { explode1(58, 9); @@ -428,6 +449,7 @@ function para2(chase: Chase) { }); chase.onceLoc(35, 3, 'MT15', () => { core.drawAnimate('explosion3', 37, 7); + addMediuWarp(37, 7); for (let tx = 36; tx < 42; tx++) { for (let ty = 4; ty < 11; ty++) { core.setBlock(336, tx, ty); @@ -543,6 +565,7 @@ function para3(chase: Chase, ani: Animation) { } } core.drawAnimate('explosion2', 119, 7); + addLargeWarp(119, 7); core.removeBlock(105, 7); core.drawAnimate('explosion1', 105, 7); addCommonWarp(105, 7); @@ -568,13 +591,14 @@ function para3(chase: Chase, ani: Animation) { explode1(73, 8); explode1(72, 4); }); - chase.onceLoc(71, 7, 'MT14', () => { + chase.onceLoc(72, 7, 'MT14', () => { for (let tx = 74; tx < 86; tx++) { for (let ty = 3; ty < 12; ty++) { core.setBlock(336, tx, ty); } } core.drawAnimate('explosion2', 79, 7); + addLargeWarp(79, 7); }); chase.onceLoc(68, 5, 'MT14', () => { explode1(68, 4); @@ -589,6 +613,7 @@ function para3(chase: Chase, ani: Animation) { core.setBlock(336, 72, 10); core.setBlock(336, 72, 11); core.drawAnimate('explosion3', 69, 5); + addMediuWarp(69, 5); }); chase.onceLoc(64, 11, 'MT14', () => { explode1(63, 9); @@ -602,6 +627,7 @@ function para3(chase: Chase, ani: Animation) { } } core.drawAnimate('explosion2', 61, 7); + addLargeWarp(61, 7); }); const exploded: Set = new Set(); chase.on('step', (x, y) => { diff --git a/src/plugin/fx/pointShader.ts b/src/plugin/fx/pointShader.ts index 13fb863..db749ef 100644 --- a/src/plugin/fx/pointShader.ts +++ b/src/plugin/fx/pointShader.ts @@ -69,7 +69,9 @@ export const enum PointEffectType { type EffectData = [x0: number, x1: number, x2: number, x3: number]; const warpEffect = new Set(); -warpEffect.add(PointEffectType.CircleWarp); +warpEffect + .add(PointEffectType.CircleWarp) + .add(PointEffectType.CircleWarpTangetial); export class PointEffect { /** 着色器程序 */