public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;
            uint nextNonSyncedRuntimeID = Singleton <RuntimeIDManager> .Instance.GetNextNonSyncedRuntimeID(6);

            this.CreateBullet(abilityArgument, nextNonSyncedRuntimeID, evt.otherID);
        }
Ejemplo n.º 2
0
        protected virtual void CreateBullet(HitExplodeTracingBulletMixinArgument arg, uint bulletRuntimeID, uint otherID)
        {
            string bulletTypeName = this.baseConfig.BulletTypeName;
            float  speed          = base.instancedAbility.Evaluate(this.baseConfig.BulletSpeed);

            if (arg != null)
            {
                if (arg.BulletName != null)
                {
                    bulletTypeName = arg.BulletName;
                }
                if (arg.RandomBulletNames != null)
                {
                    bulletTypeName = arg.RandomBulletNames[UnityEngine.Random.Range(0, arg.RandomBulletNames.Length)];
                }
                if (arg.BulletSpeed != null)
                {
                    speed = base.instancedAbility.Evaluate(arg.BulletSpeed);
                }
            }
            AbilityTriggerBullet bullet = Singleton <DynamicObjectManager> .Instance.CreateAbilityLinearTriggerBullet(bulletTypeName, base.actor, speed, this.baseConfig.Targetting, this.baseConfig.IgnoreTimeScale, bulletRuntimeID, base.instancedAbility.Evaluate(this.baseConfig.AliveDuration));

            if ((this.baseConfig.BulletEffect != null) && (this.baseConfig.BulletEffect.EffectPattern != null))
            {
                Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(this.baseConfig.BulletEffect.EffectPattern, bullet.triggerBullet, this.baseConfig.BulletEffectGround);
            }
            this.InitBulletForward(bullet);
            this.InitBulletForwardWithArgument(bullet, arg, otherID);
            this._bulletAttackDatas.Add(bullet.runtimeID, DamageModelLogic.CreateAttackDataFromAttackerAnimEvent(base.actor, this.baseConfig.HitAnimEventID));
        }
 private void RemoteHandleInvokeEntry(AbilityInvokeEntry invokeEntry, int fromPeerID)
 {
     this._mixinArg = invokeEntry.GetArgument <MixinArg_HitExplodeMixin>(this._mixinArg);
     if (this._mixinArg.Action == HitExplodeBulletAction.Trigger)
     {
         HitExplodeTracingBulletMixinArgument arg = null;
         if (this._mixinArg.ArgMappingID != 0)
         {
             arg = IndexedConfig <HitExplodeTracingBulletMixinArgument> .Mapping.Get(this._mixinArg.ArgMappingID);
         }
         this.CreateBullet(arg, this._mixinArg.BulletID, this._mixinArg.OtherID);
     }
 }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            if (base.selfIdentity.isAuthority)
            {
                RecordInvokeEntryContext             context;
                HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;
                uint nextRuntimeID = Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(6);

                base.StartRecordMixinInvokeEntry(out context, 0);
                Offset <MixinArg_HitExplodeMixin> offset = MixinArg_HitExplodeMixin.CreateMixinArg_HitExplodeMixin(context.builder, HitExplodeBulletAction.Trigger, (abilityArgument == null) ? ((ushort)0) : ((ushort)IndexedConfig <HitExplodeTracingBulletMixinArgument> .Mapping.Get(abilityArgument)), nextRuntimeID, evt.otherID);
                context.Finish <MixinArg_HitExplodeMixin>(offset, AbilityInvokeArgument.MixinArg_HitExplodeMixin);
                this.CreateBullet(abilityArgument, nextRuntimeID, evt.otherID);
            }
        }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

            if (localAvatar != null)
            {
                int count = localAvatar.SubAttackTargetList.Count;
                for (int i = 0; i < count; i++)
                {
                    string bulletTypeName = this.config.BulletTypeName;
                    HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;
                    if (abilityArgument != null)
                    {
                        if (abilityArgument.BulletName != null)
                        {
                            bulletTypeName = abilityArgument.BulletName;
                        }
                        if (abilityArgument.RandomBulletNames != null)
                        {
                            bulletTypeName = abilityArgument.RandomBulletNames[UnityEngine.Random.Range(0, abilityArgument.RandomBulletNames.Length)];
                        }
                    }
                    AbilityTriggerBullet bullet = Singleton <DynamicObjectManager> .Instance.CreateAbilityLinearTriggerBullet(bulletTypeName, base.actor, base.instancedAbility.Evaluate(this.config.BulletPostionLinearSpeed), this.config.Targetting, this.config.IgnoreTimeScale, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), -1f);

                    if ((this.config.BulletEffect != null) && (this.config.BulletEffect.EffectPattern != null))
                    {
                        Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(this.config.BulletEffect.EffectPattern, bullet.triggerBullet, this.config.BulletEffectGround);
                    }
                    base._bulletAttackDatas.Add(bullet.runtimeID, DamageModelLogic.CreateAttackDataFromAttackerAnimEvent(base.actor, this.config.HitAnimEventID));
                    float   angle    = (180 / (count + 1)) * (i + 1);
                    float   num4     = base.instancedAbility.Evaluate(this.config.BulletPositionRadius);
                    float   duration = base.instancedAbility.Evaluate(this.config.BulletPositionDuration);
                    Vector3 vector   = Vector3.Cross(Vector3.up, base.entity.transform.forward);
                    vector = (Vector3)(Quaternion.AngleAxis(angle, base.entity.transform.forward) * vector);
                    Vector3 vector2  = (Vector3)(vector.normalized * num4);
                    Vector3 position = localAvatar.SubAttackTargetList[i].transform.position;
                    Vector3 up       = Vector3.up;
                    position += up;
                    bullet.triggerBullet.SetupPositioning(bullet.triggerBullet.transform.position, bullet.triggerBullet.transform.position + vector2, duration, base.instancedAbility.Evaluate(this.config.BulletSpeed), this.config.TracingLerpCoef, this.config.TracingLerpCoefAcc, position, this.config.PassBy);
                    this.InitBulletForward(bullet);
                }
            }
        }
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            this._bulletNum      = (this.config.Type != HitExplodeRandomPosBulletMixin.CreateType.CreateOne) ? this.config.RandomPosPool.Length : 1;
            this._bulletNumCount = 0;
            this._bulletName     = this.config.BulletTypeName;
            HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;

            if (abilityArgument != null)
            {
                if (abilityArgument.BulletName != null)
                {
                    this._bulletName = abilityArgument.BulletName;
                }
                if (abilityArgument.RandomBulletNames != null)
                {
                    this._bulletName = abilityArgument.RandomBulletNames[UnityEngine.Random.Range(0, abilityArgument.RandomBulletNames.Length)];
                }
            }
            this._internalTimer = 0f;
            this.GeneralPosIndexOrderList(this.config.NeedShuffle);
        }
        protected override void InitBulletForwardWithArgument(AbilityTriggerBullet bullet, HitExplodeTracingBulletMixinArgument arg, uint otherID)
        {
            base.InitBulletForwardWithArgument(bullet, arg, otherID);
            if (this.config.IsRandomInit)
            {
                if (this.config.IsRandomInitCone)
                {
                    bullet.triggerBullet.transform.forward = (Vector3)((Quaternion.AngleAxis((float)UnityEngine.Random.Range(-40, 40), base.entity.transform.up) * Quaternion.AngleAxis((float)-UnityEngine.Random.Range(-10, 40), base.entity.transform.right)) * base.entity.transform.forward);
                }
                else
                {
                    bullet.triggerBullet.transform.forward = (Vector3)(Quaternion.AngleAxis((float)-UnityEngine.Random.Range(20, 0x2d), base.entity.transform.right) * base.entity.transform.forward);
                }
            }
            BaseMonoEntity entity = null;

            if (otherID != 0)
            {
                entity = Singleton <EventManager> .Instance.GetEntity(otherID);
            }
            int        num   = this._traceBullets.SeekAddPosition <TraceDelay>();
            TraceDelay delay = new TraceDelay {
                lineTimer       = this.config.TurnStartDelay,
                turnTimer       = this.config.TraceStartDelay,
                bulletID        = bullet.runtimeID,
                subAttackTarget = entity
            };

            this._traceBullets[num] = delay;
        }
Ejemplo n.º 8
0
        public override void OnAbilityTriggered(EvtAbilityStart evt)
        {
            HitExplodeTracingBulletMixinArgument abilityArgument = evt.abilityArgument as HitExplodeTracingBulletMixinArgument;

            this.CreateBullet(abilityArgument, Singleton <DynamicObjectManager> .Instance.GetNextSyncedDynamicObjectRuntimeID(), evt.otherID);
        }
Ejemplo n.º 9
0
 protected virtual void InitBulletForwardWithArgument(AbilityTriggerBullet bullet, HitExplodeTracingBulletMixinArgument arg, uint otherID)
 {
     if ((arg != null) && (arg.XZAngleOffset != 0f))
     {
         bullet.triggerBullet.transform.Rotate(new Vector3(0f, arg.XZAngleOffset, 0f));
     }
 }