From 1983cf8df5d6e8647abd223e513df5fbe35dd13f Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Tue, 17 Dec 2024 09:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=89=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqr/User/Asset/AssetManager.nut | 12 +++++++ sqr/User/Asset/Character/Animation.nut | 32 ++++++++++++++++--- sqr/User/Asset/Item/Equipment.nut | 4 +++ .../ActiveObject/CharacterObjectClass.nut | 3 ++ 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/sqr/User/Asset/AssetManager.nut b/sqr/User/Asset/AssetManager.nut index 1bb7ce0..94b9f13 100644 --- a/sqr/User/Asset/AssetManager.nut +++ b/sqr/User/Asset/AssetManager.nut @@ -191,6 +191,18 @@ class _AssetManager_ { Ret = Data.Get(); DataTable.type.index <- Ret.tointeger(); } + //光环效果 + else if (Pack == "[aurora graphic effects]") { + DataTable.aurora_effects <- []; + local Count = Data.Get(); + for (local i = 0; i< Count; i++) { + local T = { + type = Data.Get(), + path = Data.Get().tolower() + } + DataTable.aurora_effects.push(T); + } + } //Ani else if (Pack == "[animation job]") { local Job = Data.Get().slice(1, -1); diff --git a/sqr/User/Asset/Character/Animation.nut b/sqr/User/Asset/Character/Animation.nut index cbc46d8..e04ef43 100644 --- a/sqr/User/Asset/Character/Animation.nut +++ b/sqr/User/Asset/Character/Animation.nut @@ -50,6 +50,9 @@ class Character_Animation extends Actor { //普通攻击Ani AttackAni = null; + //光环 + AuroraAni = null; + constructor() { base.constructor(); @@ -57,7 +60,6 @@ class Character_Animation extends Actor { //同步单部位动画 function SyncAnimationBySlot(Type, AniObj, Src) { - this[AniObj][Type] <- []; //如果有时装就初始化Ani @@ -113,8 +115,6 @@ class Character_Animation extends Actor { } } } - - return this[AniObj][Type]; } //读取并设置Ani @@ -275,6 +275,30 @@ class Character_Animation extends Actor { // ReadAndSetAttackAni(); } + function InitAuroa() { + //光环 + local Info = Parent.aurora; + //如果有光环 + if (AuroraAni) { + foreach(Ani in AuroraAni) { + Removechild(Ani); + } + } + AuroraAni = []; + + foreach(Effect in Info.Aurora_effects) { + local AniBuf = Animation(Effect.path); + AuroraAni.append(AniBuf); + Addchild(AniBuf); + //front + if (Effect.type == 1) { + AniBuf.SetZOrder(100000); + } else { + AniBuf.SetZOrder(-100000); + } + } + } + //设置Ani function SetAnimation(Ani) { @@ -295,7 +319,7 @@ class Character_Animation extends Actor { CurrentAni = this[Ani]; } //重置Ani 并添加子对象 - foreach(AniGroup in CurrentAni) { + foreach(Key, AniGroup in CurrentAni) { foreach(AniObj in AniGroup) { AniObj.Reset(); Addchild(AniObj); diff --git a/sqr/User/Asset/Item/Equipment.nut b/sqr/User/Asset/Item/Equipment.nut index 9f242f4..7e5ca96 100644 --- a/sqr/User/Asset/Item/Equipment.nut +++ b/sqr/User/Asset/Item/Equipment.nut @@ -27,6 +27,8 @@ class GameItem.Equipment extends GameItem.Item { Description = ""; //文件路径 DirPath = null; + //光环特效 + Aurora_effects = null; //装备属性 Property = null; @@ -51,6 +53,7 @@ class GameItem.Equipment extends GameItem.Item { if (EquInfo.rawin("icon")) Icon = EquInfo["icon"]; if (EquInfo.rawin("Ani")) Animation_Job = EquInfo["Ani"]; if (EquInfo.rawin("DirPath")) DirPath = EquInfo["DirPath"]; + if (EquInfo.rawin("aurora_effects")) Aurora_effects = EquInfo["aurora_effects"]; } } } @@ -73,6 +76,7 @@ class GameItem.Equipment extends GameItem.Item { else if (EType == "shoes avatar") SetRealEquipmentType("shoes", "avatar"); else if (EType == "breast avatar") SetRealEquipmentType("breast", "avatar"); else if (EType == "face avatar") SetRealEquipmentType("face", "avatar"); + else if (EType == "aurora avatar") SetRealEquipmentType("aurora", "aurora"); } //穿戴装备回调 diff --git a/sqr/User/Object/ActiveObject/CharacterObjectClass.nut b/sqr/User/Object/ActiveObject/CharacterObjectClass.nut index 8aa3eda..65c52c6 100644 --- a/sqr/User/Object/ActiveObject/CharacterObjectClass.nut +++ b/sqr/User/Object/ActiveObject/CharacterObjectClass.nut @@ -16,6 +16,7 @@ class GameObject.Character extends GameObject.ActiveObject { pants = null; //下装 shoes = null; //鞋子 weapon = null; //武器 + aurora = null; //光环 //动画对象管理器 AnimationManager = null; @@ -100,6 +101,8 @@ class GameObject.Character extends GameObject.ActiveObject { //如果是武器或者时装则同步动画 if (Equ.SlotType == "weapon" || Equ.Type == "avatar") { AnimationManager.Init(Equ.SlotType); + } else if (Equ.Type == "aurora") { + AnimationManager.InitAuroa(); } } //切换装备列表