Exemplo n.º 1
0
        public void SetCurrentWeapon(ItemTemplateInfo item)
        {
            this.m_weapon = item;
            BallConfigInfo ballConfigInfo = BallConfigMgr.FindBall(this.m_weapon.TemplateID);

            this.m_mainBallId     = ballConfigInfo.Common;
            this.m_spBallId       = ballConfigInfo.Special;
            this.m_sp2BallId      = ballConfigInfo.SpecialII;
            this.m_AddWoundBallId = ballConfigInfo.CommonAddWound;
            this.m_MultiBallId    = ballConfigInfo.CommonMultiBall;
            this.SetBall(this.m_mainBallId);
        }
Exemplo n.º 2
0
        public override void Reset()
        {
            this.m_maxBlood = this.m_player.PlayerCharacter.hp;
            if (this.m_game.RoomType == eRoomType.Dungeon)
            {
                this.m_game.Cards = new int[21];
            }
            else
            {
                this.m_game.Cards = new int[9];
            }
            base.Dander         = 0;
            base.PetMP          = 10;
            base.psychic        = 40;
            this.m_energy       = this.m_player.PlayerCharacter.Agility / 30 + 240;
            base.IsLiving       = true;
            this.FinishTakeCard = false;
            this.m_DeputyWeapon = this.m_player.SecondWeapon;
            this.m_weapon       = this.m_player.MainWeapon;
            BallConfigInfo ballConfigInfo = BallConfigMgr.FindBall(this.m_weapon.TemplateID);

            this.m_mainBallId        = ballConfigInfo.Common;
            this.m_spBallId          = ballConfigInfo.Special;
            this.m_sp2BallId         = ballConfigInfo.SpecialII;
            this.m_AddWoundBallId    = ballConfigInfo.CommonAddWound;
            this.m_MultiBallId       = ballConfigInfo.CommonMultiBall;
            this.BaseDamage          = this.m_player.GetBaseAttack();
            this.BaseGuard           = this.m_player.GetBaseDefence();
            this.Attack              = (double)this.m_player.PlayerCharacter.Attack;
            this.Defence             = (double)this.m_player.PlayerCharacter.Defence;
            this.Agility             = (double)this.m_player.PlayerCharacter.Agility;
            this.Lucky               = (double)this.m_player.PlayerCharacter.Luck;
            this.m_currentBall       = BallMgr.FindBall(this.m_mainBallId);
            this.m_shootCount        = 1;
            this.m_ballCount         = 1;
            this.m_prop              = 0;
            this.CurrentIsHitTarget  = false;
            this.TotalCure           = 0;
            this.TotalHitTargetCount = 0;
            this.TotalHurt           = 0;
            this.TotalKill           = 0;
            this.TotalShootCount     = 0;
            this.LockDirection       = false;
            this.GainGP              = 0;
            this.GainOffer           = 0;
            this.Ready               = false;
            this.PlayerDetail.ClearTempBag();
            this.LoadingProcess = 0;
            this.skillcu        = 0;
            base.Reset();
        }
Exemplo n.º 3
0
 public Player(IGamePlayer player, int id, BaseGame game, int team, int maxBlood) : base(id, game, team, "", "", maxBlood, 0, 1)
 {
     this.m_rect   = new Rectangle(-15, -20, 30, 30);
     this.m_player = player;
     this.m_player.GamePlayerId = id;
     this.m_isActive            = true;
     this.m_canGetProp          = true;
     this.Grade    = player.PlayerCharacter.Grade;
     base.vaneOpen = player.PlayerCharacter.IsWeakGuildFinish(9);
     this.m_pet    = player.Pet;
     if (this.m_pet != null)
     {
         base.isPet      = true;
         base.PetBaseAtt = this.GetPetBaseAtt();
     }
     this.TotalAllHurt           = 0;
     this.TotalAllHitTargetCount = 0;
     this.TotalAllShootCount     = 0;
     this.TotalAllKill           = 0;
     this.TotalAllExperience     = 0;
     this.TotalAllScore          = 0;
     this.TotalAllCure           = 0;
     this.m_DeputyWeapon         = this.m_player.SecondWeapon;
     if (this.m_DeputyWeapon != null)
     {
         this.deputyWeaponResCount = this.m_DeputyWeapon.StrengthenLevel + 1;
     }
     else
     {
         this.deputyWeaponResCount = 1;
     }
     this.m_weapon = this.m_player.MainWeapon;
     if (this.m_weapon != null)
     {
         BallConfigInfo ballConfigInfo = BallConfigMgr.FindBall(this.m_weapon.TemplateID);
         this.m_mainBallId     = ballConfigInfo.Common;
         this.m_spBallId       = ballConfigInfo.Special;
         this.m_sp2BallId      = ballConfigInfo.SpecialII;
         this.m_AddWoundBallId = ballConfigInfo.CommonAddWound;
         this.m_MultiBallId    = ballConfigInfo.CommonMultiBall;
     }
     this.m_loadingProcess = 0;
     this.m_prop           = 0;
     this.InitBuffer(this.m_player.EquipEffect);
     this.m_energy   = this.m_player.PlayerCharacter.Agility / 30 + 240;
     this.m_maxBlood = this.m_player.PlayerCharacter.hp;
     this.skillcu    = 0;
 }
Exemplo n.º 4
0
        private static Dictionary <int, BallConfigInfo> LoadFromDatabase()
        {
            Dictionary <int, BallConfigInfo> dictionary = new Dictionary <int, BallConfigInfo>();

            using (ProduceBussiness produceBussiness = new ProduceBussiness())
            {
                BallConfigInfo[] allBallConfig = produceBussiness.GetAllBallConfig();
                BallConfigInfo[] array         = allBallConfig;
                for (int i = 0; i < array.Length; i++)
                {
                    BallConfigInfo ballConfigInfo = array[i];
                    if (!dictionary.ContainsKey(ballConfigInfo.TemplateID))
                    {
                        dictionary.Add(ballConfigInfo.TemplateID, ballConfigInfo);
                    }
                }
            }
            return(dictionary);
        }
Exemplo n.º 5
0
        public BallConfigInfo[] GetAllBallConfig()
        {
            List <BallConfigInfo> infos  = new List <BallConfigInfo>();
            SqlDataReader         reader = null;

            try
            {
                db.GetReader(ref reader, "[SP_Ball_Config_All]");
                while (reader.Read())
                {
                    BallConfigInfo info = new BallConfigInfo();
                    info.Common          = (int)reader["Common"];
                    info.TemplateID      = (int)reader["TemplateID"];
                    info.CommonAddWound  = (int)reader["CommonAddWound"];
                    info.CommonMultiBall = (int)reader["CommonMultiBall"];
                    info.Special         = (int)reader["Special"];
                    info.SpecialII       = (int)reader["SpecialII"];


                    infos.Add(info);
                }
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("Init", e);
                }
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
            return(infos.ToArray());
        }