Exemplo n.º 1
0
        private void ProcessWeens(object o)
        {
            var sprite = AttackSpriteLoader.Instance.GetSprite(PATH);

            foreach (var hit in this._data.FatalHits)
            {
                if (hit.Data.Target.Current != null &&
                    hit.Data.Target.Current.GetType().Equals(typeof(CChar)))
                {
                    var tgt       = this._data.Target.Current as CChar;
                    var shakeData = new SXAxisShakeData();
                    shakeData.Duration    = FatalityParams.DEFAULT_DUR;
                    shakeData.MaxDistance = FatalityParams.DEFAULT_X_SHAKE_DIST;
                    shakeData.Speed       = FatalityParams.DEFAULT_X_SHAKE_SPEED;
                    shakeData.Target      = tgt.GameHandle;
                    var shake = tgt.GameHandle.AddComponent <SXAxisShake>();
                    shake.Init(shakeData);
                    var swarmData = new SSwarmOnTargetData();
                    swarmData.Dur       = FatalityParams.DEFAULT_DUR;
                    swarmData.Interval  = FatalityParams.WEEN_INTERVAL;
                    swarmData.MaxOffset = FatalityParams.WEEN_OFFSET;
                    swarmData.Speed     = FatalityParams.WEEN_SPEED;
                    swarmData.Sprite    = sprite;
                    swarmData.Target    = tgt.GameHandle.transform.position;
                    var weenSwarm = tgt.GameHandle.AddComponent <SSwarmOnTarget>();
                    weenSwarm.AddCallback(this.ProcessSwarm);
                    weenSwarm.Init(swarmData);
                }
            }
        }
Exemplo n.º 2
0
        private void ProcessArrows(object o)
        {
            var missile = AttackSpriteLoader.Instance.GetSprite(PATH + this.Data.Action.Data.ParentWeapon.SpriteFXPath);

            foreach (var hit in this._data.FatalHits)
            {
                if (hit.Data.Target.Current != null &&
                    hit.Data.Target.Current.GetType().Equals(typeof(CChar)))
                {
                    var tgt       = this._data.Target.Current as CChar;
                    var shakeData = new SXAxisShakeData();
                    shakeData.Duration    = FatalityParams.DEFAULT_DUR;
                    shakeData.MaxDistance = FatalityParams.DEFAULT_X_SHAKE_DIST;
                    shakeData.Speed       = FatalityParams.DEFAULT_X_SHAKE_SPEED;
                    shakeData.Target      = tgt.GameHandle;
                    var shake = tgt.GameHandle.AddComponent <SXAxisShake>();
                    shake.Init(shakeData);

                    var data = new SFireFatalityData();
                    data.Dur      = 6f;
                    data.FireDur  = 3f;
                    data.Hit      = hit;
                    data.Interval = FatalityParams.FIRE_INTERVAL;
                    data.Speed    = FatalityParams.FIRE_SPEED;
                    data.Sprite   = missile;
                    data.Target   = tgt.GameHandle.transform.position;
                    var script = tgt.GameHandle.AddComponent <SFireFatality>();
                    script.Init(data);
                    script.SetCallback(this.ProcessArrowed);
                }
            }
        }
Exemplo n.º 3
0
        private void ZoomDone(object o)
        {
            var shake = this._target.GameHandle.AddComponent <SXAxisShake>();

            shake.AddCallback(this.ShakeDone);
            var data = new SXAxisShakeData();

            data.Duration    = 3f;
            data.MaxDistance = 0.01f;
            data.Speed       = 1f;
            data.Target      = this._target.GameHandle;
            shake.Init(data);
        }
Exemplo n.º 4
0
        private void ProcessChop(object o)
        {
            foreach (var hit in this._data.FatalHits)
            {
                if (hit.Data.Target.Current != null &&
                    hit.Data.Target.Current.GetType().Equals(typeof(CChar)))
                {
                    var tgt      = this._data.Target.Current as CChar;
                    var position = tgt.GameHandle.transform.position;

                    var bonePath = StringUtil.PathBuilder(
                        CombatGUIParams.EFFECTS_PATH,
                        "ChopBoneFatality",
                        CombatGUIParams.PARTICLES_EXTENSION);
                    var bloodPath = StringUtil.PathBuilder(
                        CombatGUIParams.EFFECTS_PATH,
                        "ChopBloodFatality",
                        CombatGUIParams.PARTICLES_EXTENSION);


                    var bonePrefab    = Resources.Load(bonePath);
                    var boneParticles = GameObject.Instantiate(bonePrefab) as GameObject;
                    boneParticles.transform.position = position;
                    boneParticles.name = CombatGUIParams.CHOP_FATALITY + " Bone Particles";

                    var bloodPrefab    = Resources.Load(bloodPath);
                    var bloodParticles = GameObject.Instantiate(bloodPrefab) as GameObject;
                    bloodParticles.transform.position = position;
                    bloodParticles.name = CombatGUIParams.CHOP_FATALITY + " Blood Particles";

                    var boneLifetime = boneParticles.AddComponent <SDestroyByLifetime>();
                    boneLifetime.Init(boneParticles, 5f);
                    var bloodLifetime = bloodParticles.AddComponent <SDestroyByLifetime>();
                    bloodLifetime.Init(bloodParticles, 5f);

                    var data = new SXAxisShakeData();
                    data.Duration    = FatalityParams.DEFAULT_DUR;
                    data.MaxDistance = FatalityParams.DEFAULT_X_SHAKE_DIST;
                    data.Speed       = FatalityParams.DEFAULT_X_SHAKE_SPEED;
                    data.Target      = tgt.GameHandle;
                    var shake = tgt.GameHandle.AddComponent <SXAxisShake>();
                    shake.AddCallback(this.ProcessExplosion);
                    shake.Init(data);
                }
                else
                {
                    VHitController.Instance.ProcessDefenderHit(hit);
                }
            }
        }
Exemplo n.º 5
0
        private void ChargeDone(object o)
        {
            var raycast = o as SRaycastMove;
            var action  = raycast.GetObjectList()[0] as MAction;
            var tgt     = action.Data.Target.Current as CChar;
            var data    = new SXAxisShakeData();

            data.Duration    = 1.5f;
            data.MaxDistance = 0.01f;
            data.Speed       = 0.75f;
            data.Target      = tgt.GameHandle;
            var shake = tgt.GameHandle.AddComponent <SXAxisShake>();

            shake.Init(data);
            this.ProcessMove(action);
        }
Exemplo n.º 6
0
 private void ProcessSwarm(object o)
 {
     if (o.GetType().Equals(typeof(SSwarmOnTarget)))
     {
         var swarm = o as SSwarmOnTarget;
         foreach (var item in swarm.GetSwarm())
         {
             var shakeData = new SXAxisShakeData();
             shakeData.Duration    = FatalityParams.DEFAULT_DUR;
             shakeData.MaxDistance = FatalityParams.DEFAULT_X_SHAKE_DIST;
             shakeData.Speed       = FatalityParams.DEFAULT_X_SHAKE_SPEED;
             shakeData.Target      = item;
             var shake = item.AddComponent <SXAxisShake>();
             shake.Init(shakeData);
             shake.AddCallback(this.DeleteSwarm);
         }
     }
     this.ProcessTarget();
     this.CallbackStuff();
 }