void ActivateBuffer(SkillPO dataPO) { // 固定伤害输出 if (dataPO.IsHarm == 1) { if (dataPO.FixedDamage > 0) { self.OnAttrChange(AttrType.ATTR_HP, -dataPO.FixedDamage); } if (dataPO.PercentDamage > 0) { self.OnAttrChange(AttrType.ATTR_HP, (int)(self.HP * ((float)dataPO.PercentDamage / -10000.0f))); } } // Buffer效果 if (dataPO.CanTriggerBuff > 0) { for (int index = 0; index < dataPO.MethodList.Length; ++index) { self.AddBuffer(dataPO.MethodList[index]); } } // 震频效果(目前震频的幅度和速度参数暂时先固定,看需求是否从技能表中配置后读取) if (dataPO.UseShake.Length > 0) { int shakeType = dataPO.UseShake[0].ToInt(); if (shakeType > 0) { EventDispatcher.TriggerEvent(GameEventDef.EVNET_PLAY_SHAKE, shakeType); if (dataPO.UseShake.Length == 2) { string shakeBindName = dataPO.UseShake[1]; Transform transformObject = self.FindParentBone(shakeBindName); if (transformObject != null) { EventDispatcher.TriggerEvent(GameEventDef.EVNET_PLAY_CRACK_SCREEN, transformObject.position); } } else { EventDispatcher.TriggerEvent(GameEventDef.EVNET_PLAY_CRACK_SCREEN, self.transform.position); } Main.SoundController.PlayCrashScreenSound(); } } if (dataPO.DamageLifeTime > 0) { EventDispatcher.TriggerEvent(GameEventDef.EVNET_DAMAGE_LIFE_TIME, dataPO.DamageLifeTime); } // 是否自爆 if (dataPO.ImpactBomb == 1) { self.SetBodyActive(false); } // 召唤怪物 if (dataPO.SummonMonsterList.Length % 6 == 0) { for (int index = 0; index < dataPO.SummonMonsterList.Length;) { int monsterId = dataPO.SummonMonsterList[index++].ToInt(); float posX = dataPO.SummonMonsterList[index++].ToFloat(); float posY = dataPO.SummonMonsterList[index++].ToFloat(); float posZ = dataPO.SummonMonsterList[index++].ToFloat(); string bindName = dataPO.SummonMonsterList[index++]; float delay = dataPO.SummonMonsterList[index++].ToFloat() / 1000.0f; if (bindName != "None") { Transform transformObject = self.FindParentBone(bindName); if (transformObject == null) { // 不合法的绑定点 continue; } SceneManager.instance.CreateMonster(monsterId, Vector3.zero, transformObject, delay); } else { SceneManager.instance.CreateMonster(monsterId, new Vector3(posX, posY, posZ), null, delay); } } } }