Exemplo n.º 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);
    }
Exemplo n.º 2
0
 // Token: 0x06000550 RID: 1360 RVA: 0x0003D3F4 File Offset: 0x0003B5F4
 public new void updateMobAttack()
 {
     if ((int)this.type == 0)
     {
         if (this.tick == this.attack1.Length - 1)
         {
             this.status = 2;
         }
         this.dir = ((this.x >= this.charAttack[0].cx) ? -1 : 1);
         this.checkFrameTick(this.attack1);
         this.x  += (this.charAttack[0].cx - this.x) / 4;
         this.y  += (this.charAttack[0].cy - this.y) / 4;
         this.xTo = this.x;
         if (this.tick == 8)
         {
             for (int i = 0; i < this.charAttack.Length; i++)
             {
                 this.charAttack[i].doInjure(this.dameHP[i], 0, false, false);
                 ServerEffect.addServerEffect(102, this.charAttack[i].cx, this.charAttack[i].cy, 1);
             }
         }
     }
     if ((int)this.type == 1)
     {
         if (this.tick == this.attack2.Length - 1)
         {
             this.status = 2;
         }
         this.dir = ((this.x >= this.charAttack[0].cx) ? -1 : 1);
         this.checkFrameTick(this.attack2);
         if (this.tick == 8)
         {
             for (int j = 0; j < this.charAttack.Length; j++)
             {
                 MonsterDart.addMonsterDart(this.x + ((this.dir != 1) ? -45 : 45), this.y - 25, true, this.dameHP[j], 0, this.charAttack[j], 24);
             }
         }
     }
     if ((int)this.type == 2)
     {
         if (this.tick == this.fly.Length - 1)
         {
             this.status = 2;
         }
         this.dir = ((this.x >= this.charAttack[0].cx) ? -1 : 1);
         this.checkFrameTick(this.fly);
         this.x  += (this.charAttack[0].cx - this.x) / 4;
         this.xTo = this.x;
         this.yTo = this.y;
         if (this.tick == 12)
         {
             for (int k = 0; k < this.charAttack.Length; k++)
             {
                 this.charAttack[k].doInjure(this.dameHP[k], 0, false, false);
                 ServerEffect.addServerEffect(102, this.charAttack[k].cx, this.charAttack[k].cy, 1);
             }
         }
     }
 }
Exemplo n.º 3
0
 // Token: 0x0600074C RID: 1868 RVA: 0x00061E60 File Offset: 0x00060060
 public void updateMobAttack()
 {
     if (this.tick < 2)
     {
         this.checkFrameTick((this.p3 != 0) ? this.attack2 : this.attack1);
         if (this.x >= GameScr.cmx && this.x <= GameScr.cmx + GameCanvas.w && this.p3 == 0 && GameCanvas.gameTick % 2 == 0)
         {
             SoundMn.gI().charPunch(false, 0.05f);
         }
     }
     if (this.p1 == 0)
     {
         int num  = (this.cFocus == null) ? this.mobToAttack.x : this.cFocus.cx;
         int num2 = (this.cFocus == null) ? this.mobToAttack.y : this.cFocus.cy;
         if (this.x > this.xFirst + (int)Mob.arrMobTemplate[this.templateId].rangeMove)
         {
             this.p1 = 1;
         }
         if (this.x < this.xFirst - (int)Mob.arrMobTemplate[this.templateId].rangeMove)
         {
             this.p1 = 1;
         }
         if (((int)Mob.arrMobTemplate[this.templateId].type == 4 || (int)Mob.arrMobTemplate[this.templateId].type == 5) && !this.isDontMove)
         {
             this.y += (num2 - this.y) / 20;
         }
         this.p2++;
         if (this.p2 > 3 || this.p1 == 1)
         {
             this.p1 = 1;
             if (this.p3 == 0)
             {
                 if (this.cFocus != null)
                 {
                     this.cFocus.doInjure(this.dame, this.dameMp, false, true);
                 }
                 else
                 {
                     this.mobToAttack.setInjure();
                 }
                 this.isBusyAttackSomeOne = false;
             }
             else
             {
                 if (this.cFocus != null)
                 {
                     MonsterDart.addMonsterDart(this.x + this.dir * this.w, this.y, this.checkIsBoss(), this.dame, this.dameMp, this.cFocus, (int)this.getTemplate().dartType);
                 }
                 else
                 {
                     global::Char @char = new global::Char();
                     @char.cx     = this.mobToAttack.x;
                     @char.cy     = this.mobToAttack.y;
                     @char.charID = -100;
                     MonsterDart.addMonsterDart(this.x + this.dir * this.w, this.y, this.checkIsBoss(), this.dame, this.dameMp, @char, (int)this.getTemplate().dartType);
                 }
                 this.isBusyAttackSomeOne = false;
             }
         }
         this.dir = ((this.x >= num) ? -1 : 1);
     }
     else if (this.p1 == 1)
     {
         if ((int)Mob.arrMobTemplate[this.templateId].type != 0 && !this.isDontMove && !this.isIce && !this.isWind)
         {
             this.x += (this.xFirst - this.x) / 4;
             this.y += (this.yFirst - this.y) / 4;
         }
         if (Res.abs(this.xFirst - this.x) < 5 && Res.abs(this.yFirst - this.y) < 5 && this.tick == 2)
         {
             this.status = 2;
             this.p1     = 0;
             this.p2     = 0;
             this.tick   = 0;
         }
     }
 }
Exemplo n.º 4
0
    // Token: 0x06000743 RID: 1859 RVA: 0x00060FC4 File Offset: 0x0005F1C4
    public virtual void update()
    {
        if (this.blindEff && GameCanvas.gameTick % 5 == 0)
        {
            ServerEffect.addServerEffect(113, this.x, this.y, 1);
        }
        if (this.sleepEff && GameCanvas.gameTick % 10 == 0)
        {
            EffecMn.addEff(new Effect(41, this.x, this.y, 3, 1, 1));
        }
        if (!GameCanvas.lowGraphic && this.status != 1 && this.status != 0 && !GameCanvas.lowGraphic && GameCanvas.gameTick % (15 + this.mobId * 2) == 0)
        {
            for (int i = 0; i < GameScr.vCharInMap.size(); i++)
            {
                global::Char @char = (global::Char)GameScr.vCharInMap.elementAt(i);
                if (@char != null && @char.isFlyAndCharge && @char.cf == 32)
                {
                    global::Char char2 = new global::Char();
                    char2.cx = @char.cx;
                    char2.cy = @char.cy - @char.ch;
                    if (@char.cgender == 0)
                    {
                        MonsterDart.addMonsterDart(this.x + this.dir * this.w, this.y, this.checkIsBoss(), -100, -100, char2, 25);
                    }
                }
            }
            if (global::Char.myCharz().isFlyAndCharge&& global::Char.myCharz().cf == 32)
            {
                global::Char char3 = new global::Char();
                char3.cx = global::Char.myCharz().cx;
                char3.cy = global::Char.myCharz().cy - global::Char.myCharz().ch;
                if (global::Char.myCharz().cgender == 0)
                {
                    MonsterDart.addMonsterDart(this.x + this.dir * this.w, this.y, this.checkIsBoss(), -100, -100, char3, 25);
                }
            }
        }
        if (this.holdEffID != 0 && GameCanvas.gameTick % 5 == 0)
        {
            EffecMn.addEff(new Effect(this.holdEffID, this.x, this.y + 24, 3, 5, 1));
        }
        if (this.isFreez)
        {
            if (GameCanvas.gameTick % 5 == 0)
            {
                ServerEffect.addServerEffect(113, this.x, this.y, 1);
            }
            long num = mSystem.currentTimeMillis();
            if (num - this.last >= 1000L)
            {
                this.seconds--;
                this.last = num;
                if (this.seconds < 0)
                {
                    this.isFreez = false;
                    this.seconds = 0;
                }
            }
            if (this.templateId >= 58 && this.templateId <= 65)
            {
                if (GameCanvas.gameTick % 20 > 5)
                {
                    this.frame = 1;
                }
                else
                {
                    this.frame = 15;
                }
            }
            else if (GameCanvas.gameTick % 20 > 5)
            {
                this.frame = 11;
            }
            else
            {
                this.frame = 10;
            }
        }
        if (!this.isUpdate())
        {
            return;
        }
        if (this.isShadown)
        {
            this.updateShadown();
        }
        if (this.vMobMove == null && (int)Mob.arrMobTemplate[this.templateId].rangeMove != 0)
        {
            return;
        }
        if (this.status != 3 && this.isBusyAttackSomeOne)
        {
            if (this.cFocus != null)
            {
                this.cFocus.doInjure(this.dame, this.dameMp, false, true);
            }
            else if (this.mobToAttack != null)
            {
                this.mobToAttack.setInjure();
            }
            this.isBusyAttackSomeOne = false;
        }
        if ((int)this.levelBoss > 0)
        {
            this.updateSuperEff();
        }
        switch (this.status)
        {
        case 1:
            this.isDisable  = false;
            this.isDontMove = false;
            this.isFire     = false;
            this.isIce      = false;
            this.isWind     = false;
            this.y         += this.p1;
            if (GameCanvas.gameTick % 2 == 0)
            {
                if (this.p2 > 1)
                {
                    this.p2--;
                }
                else if (this.p2 < -1)
                {
                    this.p2++;
                }
            }
            this.x += this.p2;
            if (this.templateId >= 58 && this.templateId <= 65)
            {
                this.frame = 15;
            }
            else
            {
                this.frame = 11;
            }
            if (this.isDie)
            {
                this.isDie = false;
                if (this.isMobMe)
                {
                    for (int j = 0; j < GameScr.vMob.size(); j++)
                    {
                        if (((Mob)GameScr.vMob.elementAt(j)).mobId == this.mobId)
                        {
                            GameScr.vMob.removeElementAt(j);
                        }
                    }
                }
                this.p1         = 0;
                this.p2         = 0;
                this.x          = (this.y = 0);
                this.hp         = this.getTemplate().hp;
                this.status     = 0;
                this.timeStatus = 0;
                return;
            }
            if ((TileMap.tileTypeAtPixel(this.x, this.y) & 2) == 2)
            {
                this.p1 = ((this.p1 <= 4) ? (-this.p1) : -4);
                if (this.p3 == 0)
                {
                    this.p3 = 16;
                }
            }
            else
            {
                this.p1++;
            }
            if (this.p3 > 0)
            {
                this.p3--;
                if (this.p3 == 0)
                {
                    this.isDie = true;
                }
            }
            break;

        case 2:
            if (this.holdEffID != 0)
            {
                return;
            }
            if (this.isFreez)
            {
                return;
            }
            if (this.blindEff)
            {
                return;
            }
            if (this.sleepEff)
            {
                return;
            }
            this.timeStatus = 0;
            this.updateMobStandWait();
            break;

        case 3:
            if (this.holdEffID != 0)
            {
                return;
            }
            if (this.blindEff)
            {
                return;
            }
            if (this.sleepEff)
            {
                return;
            }
            if (this.isFreez)
            {
                return;
            }
            this.updateMobAttack();
            break;

        case 4:
            if (this.holdEffID != 0)
            {
                return;
            }
            if (this.blindEff)
            {
                return;
            }
            if (this.sleepEff)
            {
                return;
            }
            if (this.isFreez)
            {
                return;
            }
            this.timeStatus = 0;
            this.p1++;
            if (this.p1 > 40 + this.mobId % 5)
            {
                this.y     -= 2;
                this.status = 5;
                this.p1     = 0;
            }
            break;

        case 5:
            if (this.holdEffID != 0)
            {
                return;
            }
            if (this.blindEff)
            {
                return;
            }
            if (this.sleepEff)
            {
                return;
            }
            if (this.isFreez)
            {
                if ((int)Mob.arrMobTemplate[this.templateId].type == 4)
                {
                    this.ty++;
                    this.wt++;
                    this.fy += (this.wy ? -1 : 1);
                    if (this.wt == 10)
                    {
                        this.wt = 0;
                        this.wy = !this.wy;
                    }
                }
                return;
            }
            this.timeStatus = 0;
            this.updateMobWalk();
            break;

        case 6:
            this.timeStatus = 0;
            this.p1++;
            this.y += this.p1;
            if (this.y >= this.yFirst)
            {
                this.y      = this.yFirst;
                this.p1     = 0;
                this.status = 5;
            }
            break;

        case 7:
            this.updateInjure();
            break;
        }
    }
 // Token: 0x06000285 RID: 645 RVA: 0x00004A10 File Offset: 0x00002C10
 public static void addMonsterDart(int x2, int y2, bool checkIsBoss, int dame2, int dameMp2, Mob mobToAttack, sbyte dartType)
 {
     MonsterDart.addMonsterDart(x2, y2, checkIsBoss, dame2, dameMp2, mobToAttack.x, mobToAttack.y, (int)dartType);
 }
Exemplo n.º 6
0
 // Token: 0x0600052A RID: 1322 RVA: 0x0003C5D8 File Offset: 0x0003A7D8
 public new void updateMobAttack()
 {
     if ((int)this.type == 7)
     {
         if (this.tick > 8)
         {
             this.tick = 8;
         }
         this.checkFrameTick(this.attack1);
         if (GameCanvas.gameTick % 4 == 0)
         {
             ServerEffect.addServerEffect(70, this.x + ((this.dir != 1) ? -15 : 15), this.y - 40, 1);
         }
     }
     if ((int)this.type == 0)
     {
         if (this.tick == this.attack1.Length - 1)
         {
             this.status = 2;
         }
         this.dir = ((this.x >= this.charAttack[0].cx) ? -1 : 1);
         this.checkFrameTick(this.attack1);
         if (this.tick == 8)
         {
             for (int i = 0; i < this.charAttack.Length; i++)
             {
                 MonsterDart.addMonsterDart(this.x + ((this.dir != 1) ? -45 : 45), this.y - 30, true, this.dameHP[i], 0, this.charAttack[i], 24);
             }
         }
     }
     if ((int)this.type == 1)
     {
         if (this.tick == ((!this.haftBody) ? (this.attack2.Length - 1) : (this.attack2_1.Length - 1)))
         {
             this.status = 2;
         }
         this.dir = ((this.x >= this.charAttack[0].cx) ? -1 : 1);
         this.checkFrameTick((!this.haftBody) ? this.attack2 : this.attack2_1);
         this.x += (this.charAttack[0].cx - this.x) / 4;
         this.y += (this.charAttack[0].cy - this.y) / 4;
         if (this.tick == 18)
         {
             for (int j = 0; j < this.charAttack.Length; j++)
             {
                 this.charAttack[j].doInjure(this.dameHP[j], 0, false, false);
                 ServerEffect.addServerEffect(102, this.charAttack[j].cx, this.charAttack[j].cy, 1);
             }
         }
     }
     if ((int)this.type == 8)
     {
     }
     if ((int)this.type == 2)
     {
         if (this.tick == ((!this.haftBody) ? (this.attack3.Length - 1) : (this.attack3_1.Length - 1)))
         {
             this.status = 2;
         }
         this.dir = ((this.x >= this.charAttack[0].cx) ? -1 : 1);
         this.checkFrameTick((!this.haftBody) ? this.attack3 : this.attack3_1);
         if (this.tick == 13)
         {
             GameScr.shock_scr = 10;
             this.shock        = true;
             for (int k = 0; k < this.charAttack.Length; k++)
             {
                 this.charAttack[k].doInjure(this.dameHP[k], 0, false, false);
             }
         }
     }
 }