You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB

1 month ago
// using System;
// using GAS.Runtime;
// using xFrame;
//
// namespace CoreGame.Render
// {
// // 给持枪人触发的Task, 给发射的子弹添加可弹射的天赋,并初始化可弹射次数
// [Serializable]
// public class TaskMakeBulletsBouncy : InstantAbilityTask
// {
// public int abilityId;
// public string bounceCountStr;
//
// public override void OnExecute(in TaskSpec self)
// {
// var ctx = self.abilitySpec.ctx;
// var bulletEntities = ctx.castTarget;
// var bounceCount = ExpressionEvaluator.CalcVal_WithCtx(bounceCountStr, ctx);
// for (var index = 0; index < bulletEntities.Count; index++)
// {
// var bulletEnt = Contexts.Combat.GetEntity(bulletEntities[index]);
// if (bulletEnt == null)
// {
// XLog.LogWarning("bulletEnt is null");
// return;
// }
// var context = AbilitySrv.GrantTransferAbility(bulletEnt, abilityId, ctx.abilitySpec.gaInitCfg, null, ctx.level);
// if (context == null)
// {
// XLog.LogWarning("AttachActiveAbility failed: " + abilityId);
// return;
// }
//
// bulletEnt.property.SetProperty(PropertyDef.BulletBounceCount, bounceCount, true);
// bulletEnt.property.SetProperty(PropertyDef.MaxBulletBounceCount, bounceCount, true);
// }
// }
// }
// }