Exemple #1
0
        public bool Shoot(int x, int y, int force, int angle)
        {
            if (m_shootCount > 0)
            {
                EffectTrigger = false;
                OnPlayerShoot();
                if (EffectTrigger)
                {
                    Game.SendMessage(PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success"), LanguageMgr.GetTranslation("PlayerEquipEffect.Success1", PlayerDetail.PlayerCharacter.NickName), 3);
                }

                if (ShootImp(m_currentBall.ID, x, y, force, angle, m_ballCount))
                {
                    m_shootCount--;

                    if (m_shootCount <= 0 || IsLiving == false)
                    {
                        StopAttacking();

                        AddDelay(m_currentBall.Delay + m_weapon.Property8);
                        AddDander(20);
                        if (CanGetProp)
                        {
                            int             gold       = 0;
                            int             money      = 0;
                            int             giftToken  = 0;
                            int             templateID = 0;
                            List <ItemInfo> infos      = null;
                            if (DropInventory.FireDrop(m_game.RoomType, ref infos))
                            {
                                if (infos != null)
                                {
                                    foreach (ItemInfo info in infos)
                                    {
                                        ItemInfo.FindSpecialItemInfo(info, ref gold, ref money, ref giftToken);
                                        if (info != null)
                                        {
                                            templateID = info.TemplateID;
                                            PlayerDetail.AddTemplate(info, eBageType.FightBag, info.Count);
                                        }
                                    }
                                    PlayerDetail.AddGold(gold);
                                    PlayerDetail.AddMoney(money);
                                    PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_Shoot, PlayerDetail.PlayerCharacter.ID, money, PlayerDetail.PlayerCharacter.Money);
                                    PlayerDetail.AddGiftToken(giftToken);
                                }
                            }
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }
Exemple #2
0
        public bool Shoot(int x, int y, int force, int angle)
        {
            bool result;

            if (this.m_shootCount > 0)
            {
                if (this.CurrentBall.ID != 1 && this.CurrentBall.ID != 64 && this.CurrentBall.ID != 3)
                {
                    this.OnBeforePlayerShoot(this.CurrentBall.ID);
                }
                if (base.ShootImp(this.m_currentBall.ID, x, y, force, angle, this.m_ballCount))
                {
                    this.m_shootCount--;
                    if (this.m_shootCount <= 0 || !base.IsLiving)
                    {
                        this.StopAttacking();
                        base.AddDelay(this.m_currentBall.Delay + this.m_weapon.Property8);
                        base.AddDander(20);
                        if (this.CanGetProp)
                        {
                            int             gold      = 0;
                            int             money     = 0;
                            int             giftToken = 0;
                            List <ItemInfo> infos     = null;
                            if (DropInventory.FireDrop(this.m_game.RoomType, ref infos))
                            {
                                if (infos != null)
                                {
                                    foreach (ItemInfo info in infos)
                                    {
                                        ItemInfo tempInfo = ItemInfo.FindSpecialItemInfo(info, ref gold, ref money, ref giftToken);
                                        if (tempInfo != null)
                                        {
                                            int templateID = tempInfo.TemplateID;
                                            this.PlayerDetail.AddTemplate(tempInfo, eBageType.FightBag, tempInfo.Count);
                                        }
                                    }
                                    this.PlayerDetail.AddGold(gold);
                                    this.PlayerDetail.AddMoney(money, LogMoneyType.Game, LogMoneyType.Game_Shoot);
                                    this.PlayerDetail.AddGiftToken(giftToken);
                                }
                            }
                        }
                    }
                    this.SendAttackInformation();
                    this.OnAfterPlayerShoot();
                    result = true;
                    return(result);
                }
                Player.log.Error(string.Format("Player Shoot method call ShootImpl renturn false. m_currentBall.ID : {0}, x : {1}, y : {2}, force : {3}, angle : {4}, m_ballCount : {5}", new object[]
                {
                    this.m_currentBall.ID,
                    x,
                    y,
                    force,
                    angle,
                    this.m_ballCount
                }));
            }
            else
            {
                Player.log.Error("Player Shoot method m_shootCount < 0");
            }
            result = false;
            return(result);
        }
Exemple #3
0
 public bool Shoot(int x, int y, int force, int angle)
 {
     if (this.m_shootCount == 1)
     {
         base.activePetHit = true;
     }
     if (this.m_shootCount > 0)
     {
         this.EffectTrigger = false;
         this.OnPlayerShoot();
         if (this.EffectTrigger)
         {
             base.Game.SendMessage(this.PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success", new object[0]), LanguageMgr.GetTranslation("PlayerEquipEffect.Success1", new object[]
             {
                 this.PlayerDetail.PlayerCharacter.NickName
             }), 3);
         }
         int bombId = this.m_currentBall.ID;
         if (this.m_ballCount == 1 && !this.IsSpecialSkill)
         {
             if (this.Prop == 20002)
             {
                 bombId = this.m_MultiBallId;
             }
             if (this.Prop == 20008)
             {
                 bombId = this.m_AddWoundBallId;
             }
         }
         if (base.ShootImp(bombId, x, y, force, angle, this.m_ballCount, this.ShootCount))
         {
             this.m_shootCount--;
             if (this.m_shootCount <= 0 || !base.IsLiving)
             {
                 this.StopAttacking();
                 base.AddDelay(this.m_currentBall.Delay + this.m_weapon.Property8);
                 base.AddDander(20);
                 base.AddPetMP();
                 this.m_prop = 0;
                 if (this.CanGetProp)
                 {
                     int             value  = 0;
                     int             num    = 0;
                     int             value2 = 0;
                     int             value3 = 0;
                     List <ItemInfo> list   = null;
                     if (DropInventory.FireDrop(this.m_game.RoomType, ref list) && list != null)
                     {
                         foreach (ItemInfo current in list)
                         {
                             ItemInfo.FindSpecialItemInfo(current, ref value, ref num, ref value2, ref value3);
                             if (current != null)
                             {
                                 this.PlayerDetail.AddTemplate(current, eBageType.FightBag, current.Count);
                             }
                         }
                         this.PlayerDetail.AddGold(value);
                         this.PlayerDetail.AddMoney(num);
                         this.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_Shoot, this.PlayerDetail.PlayerCharacter.ID, num, this.PlayerDetail.PlayerCharacter.Money);
                         this.PlayerDetail.AddGiftToken(value2);
                         this.PlayerDetail.AddMedal(value3);
                     }
                 }
             }
             return(true);
         }
     }
     return(false);
 }
Exemple #4
0
        public bool Shoot(int x, int y, int force, int angle)
        {
            if (m_shootCount > 0)
            {
                EffectTrigger = false;
                OnPlayerShoot();
                if (EffectTrigger)
                {
                    Game.SendMessage(PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success"), LanguageMgr.GetTranslation("PlayerEquipEffect.Success1", PlayerDetail.PlayerCharacter.NickName), 3);
                }

                //trminhpc +2=110; +50=85; +40=80; +30=70; +20=55; +10=50
                int max_energy     = m_player.PlayerCharacter.Agility / 30 + 240;
                int energy_use     = (max_energy - Energy);
                int currentBall_id = m_currentBall.ID;
                if (m_ballCount == 1 && !IsSpecialSkill &&
                    (energy_use == 220 || energy_use == 270 || energy_use == 275 || energy_use == 290 || energy_use == 300 || energy_use == 305) &&
                    (ShootCount > 3 || (m_shootCountUp > 2 && ShootCount == 3) ||
                     (m_shootCountUp > 3 && ShootCount == 2) ||
                     (m_shootCountUp > 4 && ShootCount == 1)))
                {
                    currentBall_id = m_MultiBallId;
                }
                else if (m_ballCount == 1 && !IsSpecialSkill && ShootCount == 1 && m_shootCountUp == 1 &&
                         (energy_use == 170 || energy_use == 220 || energy_use == 225 || energy_use == 240 || energy_use == 250 || energy_use == 255 || energy_use == 305))
                {
                    currentBall_id = m_AddWoundBallId;
                }
                //End Special Effect ^^

                if (ShootImp(currentBall_id, x, y, force, angle, m_ballCount, ShootCount))
                {
                    m_shootCount--;
                    m_shootCountUp++;
                    if (m_shootCount <= 0 || IsLiving == false)
                    {
                        StopAttacking();
                        m_shootCountUp = 1;
                        AddDelay(m_currentBall.Delay + m_weapon.Property8);
                        AddDander(20);
                        if (CanGetProp)
                        {
                            int             gold      = 0;
                            int             money     = 0;
                            int             giftToken = 0;
                            int             medal     = 0;
                            List <ItemInfo> infos     = null;
                            if (DropInventory.FireDrop(m_game.RoomType, ref infos))
                            {
                                if (infos != null)
                                {
                                    foreach (ItemInfo info in infos)
                                    {
                                        ItemInfo.FindSpecialItemInfo(info, ref gold, ref money, ref giftToken, ref medal);
                                        if (info != null)
                                        {
                                            //medal = info.TemplateID;
                                            PlayerDetail.AddTemplate(info, eBageType.FightBag, info.Count);
                                        }
                                    }
                                    PlayerDetail.AddGold(gold);
                                    PlayerDetail.AddMoney(money);
                                    PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_Shoot, PlayerDetail.PlayerCharacter.ID, money, PlayerDetail.PlayerCharacter.Money);
                                    PlayerDetail.AddGiftToken(giftToken);
                                    PlayerDetail.AddMedal(medal); //trminhpc
                                }
                            }
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }