コード例 #1
0
ファイル: Player.cs プロジェクト: uvbs/DDTank-3.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);
        }
コード例 #2
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);
        }