Advertisement
Guest User

Untitled

a guest
Jul 13th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private function onShowEffect(showEffect:ShowEffect) : void
  2.       {
  3.          var go:GameObject = null;
  4.          var e:ParticleEffect = null;
  5.          var start:Point = null;
  6.          var duration:uint = 0;
  7.          if(Parameters.data_.noParticlesMaster && (showEffect.effectType_ == ShowEffect.HEAL_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.TELEPORT_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.STREAM_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.POISON_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.LINE_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.FLOW_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.COLLAPSE_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.CONEBLAST_EFFECT_TYPE || showEffect.effectType_ == ShowEffect.NOVA_NO_AOE_EFFECT_TYPE))
  8.          {
  9.             return;
  10.          }
  11.          var map:AbstractMap = gs_.map;
  12.          switch(showEffect.effectType_)
  13.          {
  14.             case ShowEffect.HEAL_EFFECT_TYPE:
  15.                go = map.goDict_[showEffect.targetObjectId_];
  16.                if(go == null || !this.canShowEffect(go))
  17.                {
  18.                   break;
  19.                }
  20.                map.addObj(new HealEffect(go,showEffect.color_),go.x_,go.y_);
  21.                break;
  22.             case ShowEffect.TELEPORT_EFFECT_TYPE:
  23.                map.addObj(new TeleportEffect(),showEffect.pos1_.x_,showEffect.pos1_.y_);
  24.                break;
  25.             case ShowEffect.STREAM_EFFECT_TYPE:
  26.                e = new StreamEffect(showEffect.pos1_,showEffect.pos2_,showEffect.color_);
  27.                map.addObj(e,showEffect.pos1_.x_,showEffect.pos1_.y_);
  28.                break;
  29.             case ShowEffect.THROW_EFFECT_TYPE:
  30.                go = map.goDict_[showEffect.targetObjectId_];
  31.                start = go != null?new Point(go.x_,go.y_):showEffect.pos2_.toPoint();
  32.                if(go != null && !this.canShowEffect(go))
  33.                {
  34.                   break;
  35.                }
  36.                e = new ThrowEffect(start,showEffect.pos1_.toPoint(),showEffect.color_,showEffect.duration_ * 1000);
  37.                map.addObj(e,start.x,start.y);
  38.                break;
  39.             case ShowEffect.NOVA_EFFECT_TYPE:
  40.             case ShowEffect.NOVA_NO_AOE_EFFECT_TYPE:
  41.                go = map.goDict_[showEffect.targetObjectId_];
  42.                if(go == null || !this.canShowEffect(go))
  43.                {
  44.                   break;
  45.                }
  46.                e = new NovaEffect(go,showEffect.pos1_.x_,showEffect.color_);
  47.                map.addObj(e,go.x_,go.y_);
  48.                break;
  49.             case ShowEffect.POISON_EFFECT_TYPE:
  50.                go = map.goDict_[showEffect.targetObjectId_];
  51.                if(go == null || !this.canShowEffect(go))
  52.                {
  53.                   break;
  54.                }
  55.                e = new PoisonEffect(go,showEffect.color_);
  56.                map.addObj(e,go.x_,go.y_);
  57.                break;
  58.             case ShowEffect.LINE_EFFECT_TYPE:
  59.                go = map.goDict_[showEffect.targetObjectId_];
  60.                if(go == null || !this.canShowEffect(go))
  61.                {
  62.                   break;
  63.                }
  64.                e = new LineEffect(go,showEffect.pos1_,showEffect.color_);
  65.                map.addObj(e,showEffect.pos1_.x_,showEffect.pos1_.y_);
  66.                break;
  67.             case ShowEffect.BURST_EFFECT_TYPE:
  68.                go = map.goDict_[showEffect.targetObjectId_];
  69.                if(go == null || !this.canShowEffect(go))
  70.                {
  71.                   break;
  72.                }
  73.                e = new BurstEffect(go,showEffect.pos1_,showEffect.pos2_,showEffect.color_);
  74.                map.addObj(e,showEffect.pos1_.x_,showEffect.pos1_.y_);
  75.                break;
  76.             case ShowEffect.FLOW_EFFECT_TYPE:
  77.                go = map.goDict_[showEffect.targetObjectId_];
  78.                if(go == null || !this.canShowEffect(go))
  79.                {
  80.                   break;
  81.                }
  82.                e = new FlowEffect(showEffect.pos1_,go,showEffect.color_);
  83.                map.addObj(e,showEffect.pos1_.x_,showEffect.pos1_.y_);
  84.                break;
  85.             case ShowEffect.RING_EFFECT_TYPE:
  86.                go = map.goDict_[showEffect.targetObjectId_];
  87.                if(go == null || !this.canShowEffect(go))
  88.                {
  89.                   break;
  90.                }
  91.                e = new RingEffect(go,showEffect.pos1_.x_,showEffect.color_);
  92.                map.addObj(e,go.x_,go.y_);
  93.                break;
  94.             case ShowEffect.LIGHTNING_EFFECT_TYPE:
  95.                go = map.goDict_[showEffect.targetObjectId_];
  96.                if(go == null || !this.canShowEffect(go))
  97.                {
  98.                   break;
  99.                }
  100.                e = new LightningEffect(go,showEffect.pos1_,showEffect.color_,showEffect.pos2_.x_);
  101.                map.addObj(e,go.x_,go.y_);
  102.                break;
  103.             case ShowEffect.COLLAPSE_EFFECT_TYPE:
  104.                go = map.goDict_[showEffect.targetObjectId_];
  105.                if(go == null || !this.canShowEffect(go))
  106.                {
  107.                   break;
  108.                }
  109.                e = new CollapseEffect(go,showEffect.pos1_,showEffect.pos2_,showEffect.color_);
  110.                map.addObj(e,showEffect.pos1_.x_,showEffect.pos1_.y_);
  111.                break;
  112.             case ShowEffect.CONEBLAST_EFFECT_TYPE:
  113.                go = map.goDict_[showEffect.targetObjectId_];
  114.                if(go == null || !this.canShowEffect(go))
  115.                {
  116.                   break;
  117.                }
  118.                e = new ConeBlastEffect(go,showEffect.pos1_,showEffect.pos2_.x_,showEffect.color_);
  119.                map.addObj(e,go.x_,go.y_);
  120.                break;
  121.             case ShowEffect.JITTER_EFFECT_TYPE:
  122.                gs_.camera_.startJitter();
  123.                break;
  124.             case ShowEffect.FLASH_EFFECT_TYPE:
  125.                go = map.goDict_[showEffect.targetObjectId_];
  126.                if(go == null || !this.canShowEffect(go))
  127.                {
  128.                   break;
  129.                }
  130.                go.flash_ = new FlashDescription(getTimer(),showEffect.color_,showEffect.pos1_.x_,showEffect.pos1_.y_);
  131.                break;
  132.             case ShowEffect.THROW_PROJECTILE_EFFECT_TYPE:
  133.                start = showEffect.pos1_.toPoint();
  134.                if(go != null && !this.canShowEffect(go))
  135.                {
  136.                   break;
  137.                }
  138.                e = new ThrowProjectileEffect(showEffect.color_,showEffect.pos2_.toPoint(),showEffect.pos1_.toPoint(),showEffect.duration_ * 1000);
  139.                map.addObj(e,start.x,start.y);
  140.                break;
  141.             case ShowEffect.SHOCKER_EFFECT_TYPE:
  142.                go = map.goDict_[showEffect.targetObjectId_];
  143.                if(go == null || !this.canShowEffect(go))
  144.                {
  145.                   break;
  146.                }
  147.                if(go && go.shockEffect)
  148.                {
  149.                   go.shockEffect.destroy();
  150.                }
  151.                e = new ShockerEffect(go);
  152.                go.shockEffect = ShockerEffect(e);
  153.                gs_.map.addObj(e,go.x_,go.y_);
  154.                break;
  155.             case ShowEffect.SHOCKEE_EFFECT_TYPE:
  156.                go = map.goDict_[showEffect.targetObjectId_];
  157.                if(go == null || !this.canShowEffect(go))
  158.                {
  159.                   break;
  160.                }
  161.                e = new ShockeeEffect(go);
  162.                gs_.map.addObj(e,go.x_,go.y_);
  163.                break;
  164.             case ShowEffect.RISING_FURY_EFFECT_TYPE:
  165.                go = map.goDict_[showEffect.targetObjectId_];
  166.                if(go == null || !this.canShowEffect(go))
  167.                {
  168.                   break;
  169.                }
  170.                duration = showEffect.pos1_.x_ * 1000;
  171.                e = new RisingFuryEffect(go,duration);
  172.                gs_.map.addObj(e,go.x_,go.y_);
  173.                break;
  174.             default:
  175.                trace("ERROR: Unknown Effect type: " + showEffect.effectType_);
  176.          }
  177.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement