Ejemplo n.º 1
0
        private void ProcessEnd(object o)
        {
            var tgt      = this._data.Target.Current as CChar;
            var position = tgt.GameHandle.transform.position;
            var move     = o as SRaycastMoveThenDelete;
            var jolt     = move.GetObjectList()[0] as SAttackerJolt;

            var slimePath = StringUtil.PathBuilder(
                CombatGUIParams.EFFECTS_PATH,
                "SlimeCrushSlimeFatality",
                CombatGUIParams.PARTICLES_EXTENSION);

            var bloodPath = StringUtil.PathBuilder(
                CombatGUIParams.EFFECTS_PATH,
                "SlimeCrushBloodFatality",
                CombatGUIParams.PARTICLES_EXTENSION);

            var slimePrefab    = Resources.Load(slimePath);
            var slimeParticles = GameObject.Instantiate(slimePrefab) as GameObject;

            slimeParticles.transform.position = position;
            slimeParticles.name = CombatGUIParams.SLIME_FATALITY + " Slime Particles";

            var bloodPrefab    = Resources.Load(bloodPath);
            var bloodParticles = GameObject.Instantiate(bloodPrefab) as GameObject;

            bloodParticles.transform.position = position;
            bloodParticles.name = CombatGUIParams.SLIME_FATALITY + " Blood Particles";

            var slimeLifetime = slimeParticles.AddComponent <SDestroyByLifetime>();

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

            bloodLifetime.Init(bloodParticles, 5f);
            bloodLifetime.AddCallback(this.CallbackHandler);
            foreach (var hit in jolt.Action.Data.Hits)
            {
                bloodLifetime.AddCallback(hit.CallbackHandler);
            }

            for (int i = 0; i < 5; i++)
            {
                var sprite = MapSpriteLoader.Instance.GetSlimeSplatter(3);
                this.LayFatalityDecoRandomPosition(sprite, tgt);
            }

            var data = new EvSplatterData();

            data.DmgPercent = 1.0;
            data.Fatality   = true;
            data.Target     = tgt.GameHandle;
            var e = new EvSplatter(data);

            e.TryProcess();

            VCharUtil.Instance.ProcessDeadChar(this._data.Target.Current as CChar);
        }
Ejemplo n.º 2
0
        public void AssignDeathSplatter(CChar c)
        {
            var data = new EvSplatterData();

            data.DmgPercent = 0.50;
            data.Target     = c.GameHandle;
            var e = new EvSplatter(data);

            e.TryProcess();
        }
Ejemplo n.º 3
0
        private void ProcessBloodHelper(CChar target, double percent, bool fatality = false)
        {
            var data = new EvSplatterData();

            data.DmgPercent = percent;
            data.Fatality   = fatality;
            data.Target     = target.GameHandle;
            var e = new EvSplatter(data);

            e.TryProcess();
        }
Ejemplo n.º 4
0
 private void AddBloodPool(object o)
 {
     if (o.GetType().Equals(typeof(SRaycastMove)))
     {
         var script = o as SRaycastMove;
         var data   = new EvSplatterData();
         data.DmgPercent = 1;
         data.Fatality   = true;
         data.Target     = script.GetData().Handle;
         var e = new EvSplatter(data);
         e.TryProcess();
     }
 }
Ejemplo n.º 5
0
 private void DisplaySplatter(MHit hit)
 {
     if (hit.Data.Target.Current != null &&
         hit.Data.Target.Current.GetType().Equals(typeof(CChar)))
     {
         var tgt = hit.Data.Target.Current as CChar;
         if (hit.Data.Dmg > 0 && !hit.Data.IsFatality)
         {
             var data = new EvSplatterData();
             data.DmgPercent =
                 (hit.Data.Dmg /
                  tgt.Proxy.GetStat(ESecondaryStat.HP));
             data.Target = tgt.Tile.Handle;
             var e = new EvSplatter(data);
             e.TryProcess();
         }
     }
 }