public override void Explode() { ErrorHandler.Parse( SkillDetails.CreateCreationAround(mBullet.FirerAttr, mBullet.CreationOnArrive, mBullet.GetPosition(), mBullet.GetDirection()), "failed to create creature on bullet arrived" ); // 爆炸特效, 仅在子弹到达终点时播放, 即, 子弹没有命中足够的人. if (mBullet.CurrentHittedCount < mBullet.MaxHitCount) { SkillClientBehaviour.AddSceneEffect(mBullet.ExplodeEffect, mBullet.GetPosition(), mBullet.GetDirection()); } // 用碰撞来模拟爆炸, 从而使得技能效果的方向沿着子弹的飞行方向. if (mBullet.TargetSelectionOnArrive != uint.MaxValue && mBullet.SkillEffectOnArrive != uint.MaxValue) { TargetSelectionTableItem targetSel = DataManager.TargetSelectionTable[mBullet.TargetSelectionOnArrive] as TargetSelectionTableItem; ArrayList targets = SkillUtilities.SelectTargets(mBullet.FirerAttr, mBullet.GetPosition(), mBullet.GetDirection(), targetSel); AttackerAttr other = mBullet.FirerAttr; other.SetEffectStartLocation(mBullet.GetPosition(), mBullet.GetDirection()); foreach (BattleUnit t in targets) { SkillDetails.AddSkillEffectByResource(other, t, mBullet.SkillEffectOnArrive); } } }
protected override void onStopped(SkillEffectStopReason stopReason) { if (getState(StateEnabled)) { ErrorHandler.Parse(enable(false, stopReason)); } // buff被回收时, 不会再继续触发效果. if (stopReason != SkillEffectStopReason.Recycled) { // 消失时的特效. SkillClientBehaviour.AddEffect2Object(mOwner, mBuffRes.endEffectID, mBuffRes.endEffectBindpoint, 0f); // buff死亡创建. // 对buff拥有者产生效果. SkillDetails.AddSkillEffectByResource(mAttackerAttr, mOwner, mBuffRes.effect2OwnerOnExpired); // 对buff拥有者周围产生效果. SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr, mOwner.GetPosition(), mOwner.GetDirection(), mBuffRes.targetSelectionOnExpired, mBuffRes.effect2OthersOnExpired ); // 在buff拥有者周围进行创建. SkillDetails.CreateCreationAround(mAttackerAttr, mBuffRes.creationAroundOwnerOnExpired, mOwner.GetPosition(), mOwner.GetDirection()); } base.onStopped(stopReason); }
// 加effect private void AddPickerEffect() { if (mPicker == null || mPicker.IsDead() || mRes.skillEffect2Picker == uint.MaxValue) { return; } SkillDetails.AddSkillEffectByResource(new AttackerAttr(mPicker), mPicker, mRes.skillEffect2Picker); }
public override bool RunScript(RandEventArg argument) { ErrorHandler.Parse( SkillDetails.AddSkillEffectByResource(OwnerAttribute, mOwner, skillEffectID), "SkillEffectGenerator: failed to add skill effect" ); return(true); }
public override bool RunScript(RandEventArg argument) { AtkOthersEventArg atkOthersArg = argument as AtkOthersEventArg; ErrorHandler.Parse( SkillDetails.AddSkillEffectByResource(OwnerAttribute, atkOthersArg.Target, skillEffectID), "failed to run script SS_SkillEffectPlacer" ); return(true); }
/// <summary> /// 从graphCenter, 沿dirRadian方向, 通过targetSel选择目标, 并给选择到的目标添加skillEffectID标识的技能效果. /// </summary> /// <returns>命中目标个数</returns> private uint collideAt(Vector3 graphCenter, float dirRadian, TargetSelectionTableItem targetSel, uint skillEffectID) { ArrayList targets = SkillUtilities.SelectTargets(mFirerAttr, graphCenter, dirRadian, targetSel); SkillUtilities.FilterTargetsBy(targets, checkHitObject); AttackerAttr other = mFirerAttr; other.SetEffectStartLocation(graphCenter, dirRadian); foreach (BattleUnit t in targets) { SkillDetails.AddSkillEffectByResource(other, t, skillEffectID); } return((uint)targets.Count); }
/// <summary> /// buff的dot效果, 每隔指定时间, 产生一次效果. /// </summary> /// <param name="param"></param> private void buffDotEffect(object param) { // dot的计时不会停止, 但是到了产生效果的时间时, 需要检查当前buff是否启用. if (getState(StateEnabled)) { ErrorHandler.Parse( SkillDetails.AddSkillEffectByResource(mAttackerAttr, mOwner, mBuffRes.dotEffect2Owner), "failed to add dot effect to buff owner" ); SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr, mOwner.GetPosition(), mOwner.GetDirection(), mBuffRes.dotEffectTargetSelection, mBuffRes.dotEffect2Others ); } }
protected override void onStopped(bool finished) { base.onStopped(finished); if (finished) { // 结束时给自己的效果. SkillDetails.AddSkillEffectByResource(mAttackerAttr, mOwner, mDisplacementResource.skillEffect2SelfOnArrive); // 结束时给目标的效果. SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr, mOwner.GetPosition(), mOwner.GetDirection(), mDisplacementResource.targetSelectionOnArrive, mDisplacementResource.skillEffect2OthersOnArrive); // 在位移目标的周围创建. SkillDetails.CreateCreationAround(mAttackerAttr, mDisplacementResource.creationOnArrive, mOwner.GetPosition(), mOwner.GetDirection()); } }