예제 #1
0
    // Token: 0x06000396 RID: 918 RVA: 0x0001C030 File Offset: 0x0001A230
    public void paint(mGraphics g)
    {
        if (!this.isActive)
        {
            return;
        }
        int num       = MonsterDart.findDirIndexFromAngle(360 - this.angle);
        int num2      = (int)MonsterDart.FRAME[num];
        int transform = MonsterDart.TRANSFORM[num];

        for (int i = this.darts.size() / 2; i < this.darts.size(); i++)
        {
            SmallDart smallDart = (SmallDart)this.darts.elementAt(i);
            SmallImage.drawSmallImage(g, (int)this.info.tailBorder[smallDart.index], smallDart.x, smallDart.y, 0, 3);
        }
        int num3 = GameCanvas.gameTick % this.info.headBorder.Length;

        SmallImage.drawSmallImage(g, (int)this.info.headBorder[num3][num2], this.x, this.y, transform, 3);
        for (int j = 0; j < this.darts.size(); j++)
        {
            SmallDart smallDart2 = (SmallDart)this.darts.elementAt(j);
            SmallImage.drawSmallImage(g, (int)this.info.tail[smallDart2.index], smallDart2.x, smallDart2.y, 0, 3);
        }
        SmallImage.drawSmallImage(g, (int)this.info.head[num3][num2], this.x, this.y, transform, 3);
        for (int k = 0; k < this.darts.size(); k++)
        {
            SmallDart smallDart3 = (SmallDart)this.darts.elementAt(k);
            if (Res.abs(MonsterDart.r.nextInt(100)) < (int)this.info.xdPercent)
            {
                SmallImage.drawSmallImage(g, (int)((GameCanvas.gameTick % 2 != 0) ? this.info.xd2[smallDart3.index] : this.info.xd1[smallDart3.index]), smallDart3.x, smallDart3.y, 0, 3);
            }
        }
        g.setColor(16711680);
    }
예제 #2
0
 // Token: 0x06000394 RID: 916 RVA: 0x0001BB48 File Offset: 0x00019D48
 public void update()
 {
     if (!this.isActive)
     {
         return;
     }
     if (this.charBelong.mobFocus == null && this.charBelong.charFocus == null)
     {
         this.endMe();
     }
     else
     {
         IMapObject mapObject;
         if (this.charBelong.mobFocus == null)
         {
             IMapObject charFocus = this.charBelong.charFocus;
             mapObject = charFocus;
         }
         else
         {
             mapObject = this.charBelong.mobFocus;
         }
         IMapObject mapObject2 = mapObject;
         for (int i = 0; i < (int)this.info.nUpdate; i++)
         {
             if (this.info.tail.Length > 0)
             {
                 this.darts.addElement(new SmallDart(this.x, this.y));
             }
             int num = (this.charBelong.getX() <= mapObject2.getX()) ? -10 : 10;
             this.dx = mapObject2.getX() + num - this.x;
             this.dy = mapObject2.getY() - mapObject2.getH() / 2 - this.y;
             this.life++;
             if (Res.abs(this.dx) < 20 && Res.abs(this.dy) < 20)
             {
                 if (this.charBelong.charFocus != null && this.charBelong.charFocus.me)
                 {
                     this.charBelong.charFocus.doInjure(this.charBelong.charFocus.damHP, 0, this.charBelong.charFocus.isCrit, this.charBelong.charFocus.isMob);
                 }
                 this.endMe();
                 return;
             }
             int num2 = Res.angle(this.dx, this.dy);
             if (global::Math.abs(num2 - this.angle) < 90 || this.dx * this.dx + this.dy * this.dy > 4096)
             {
                 if (global::Math.abs(num2 - this.angle) < 15)
                 {
                     this.angle = num2;
                 }
                 else if ((num2 - this.angle >= 0 && num2 - this.angle < 180) || num2 - this.angle < -180)
                 {
                     this.angle = Res.fixangle(this.angle + 15);
                 }
                 else
                 {
                     this.angle = Res.fixangle(this.angle - 15);
                 }
             }
             if (!this.isSpeedUp && this.va < 8192)
             {
                 this.va += 1024;
             }
             this.vx  = this.va * Res.cos(this.angle) >> 10;
             this.vy  = this.va * Res.sin(this.angle) >> 10;
             this.dx += this.vx;
             int num3 = this.dx >> 10;
             this.x  += num3;
             this.dx &= 1023;
             this.dy += this.vy;
             int num4 = this.dy >> 10;
             this.y  += num4;
             this.dy &= 1023;
         }
         for (int j = 0; j < this.darts.size(); j++)
         {
             SmallDart smallDart = (SmallDart)this.darts.elementAt(j);
             smallDart.index++;
             if (smallDart.index >= this.info.tail.Length)
             {
                 this.darts.removeElementAt(j);
             }
         }
     }
 }
 // Token: 0x06000282 RID: 642 RVA: 0x00013BA8 File Offset: 0x00011DA8
 public override void update()
 {
     for (int i = 0; i < (int)this.info.nUpdate; i++)
     {
         if (this.info.tail.Length > 0)
         {
             this.darts.addElement(new SmallDart(this.x, this.y));
         }
         this.dx = ((this.c == null) ? this.xTo : this.c.cx) - this.x;
         this.dy = ((this.c == null) ? this.yTo : this.c.cy) - 10 - this.y;
         int num = 60;
         if (TileMap.mapID == 0)
         {
             num = 600;
         }
         this.life++;
         if ((this.c != null && (this.c.statusMe == 5 || this.c.statusMe == 14)) || this.c == null)
         {
             this.x += (((this.c == null) ? this.xTo : this.c.cx) - this.x) / 2;
             this.y += (((this.c == null) ? this.yTo : this.c.cy) - this.y) / 2;
         }
         if ((Res.abs(this.dx) < 16 && Res.abs(this.dy) < 16) || this.life > num)
         {
             if (this.c != null && this.c.charID >= 0 && this.dameMp != -1)
             {
                 if (this.dameMp != -100)
                 {
                     this.c.doInjure(this.dame, this.dameMp, false, true);
                 }
                 else
                 {
                     ServerEffect.addServerEffect(80, this.c, 1);
                 }
             }
             Effect2.vEffect2.removeElement(this);
             if (this.dameMp != -100)
             {
                 ServerEffect.addServerEffect(81, this.c, 1);
                 if (this.x >= GameScr.cmx && this.x <= GameScr.cmx + GameCanvas.w)
                 {
                     SoundMn.gI().explode_2();
                 }
             }
         }
         int num2 = Res.angle(this.dx, this.dy);
         if (global::Math.abs(num2 - this.angle) < 90 || this.dx * this.dx + this.dy * this.dy > 4096)
         {
             if (global::Math.abs(num2 - this.angle) < 15)
             {
                 this.angle = num2;
             }
             else if ((num2 - this.angle >= 0 && num2 - this.angle < 180) || num2 - this.angle < -180)
             {
                 this.angle = Res.fixangle(this.angle + 15);
             }
             else
             {
                 this.angle = Res.fixangle(this.angle - 15);
             }
         }
         if (!this.isSpeedUp && this.va < 8192)
         {
             this.va += 1024;
         }
         this.vx  = this.va * Res.cos(this.angle) >> 10;
         this.vy  = this.va * Res.sin(this.angle) >> 10;
         this.dx += this.vx;
         int num3 = this.dx >> 10;
         this.x  += num3;
         this.dx &= 1023;
         this.dy += this.vy;
         int num4 = this.dy >> 10;
         this.y  += num4;
         this.dy &= 1023;
     }
     for (int j = 0; j < this.darts.size(); j++)
     {
         SmallDart smallDart = (SmallDart)this.darts.elementAt(j);
         smallDart.index++;
         if (smallDart.index >= this.info.tail.Length)
         {
             this.darts.removeElementAt(j);
         }
     }
 }