public SimpleBomb(int id,BombType type, Player owner,BaseGame game,BallInfo info, Tile shape,bool controled) :base(id,info.Mass,info.Weight,info.Wind,info.DragIndex) { m_owner = owner; m_game = game; m_info = info; m_shape = shape; m_type = type; m_power = info.Power; m_radius = info.Radii; m_controled = controled; m_lifeTime = 0; }
public static XElement CreateBallInfo(BallInfo b) { return new XElement("Item", new XAttribute("ID", b.ID), new XAttribute("Power", b.Power), new XAttribute("Radii", b.Radii), new XAttribute("FlyingPartical", b.FlyingPartical == null ? "" : b.FlyingPartical), new XAttribute("BombPartical", b.BombPartical == null ? "" : b.BombPartical), new XAttribute("Crater", b.Crater == null ? "" : b.Crater), new XAttribute("AttackResponse", b.AttackResponse), new XAttribute("IsSpin", b.IsSpin), new XAttribute("SpinV", b.SpinV), new XAttribute("SpinVA", b.SpinVA), new XAttribute("Amount", b.Amount), new XAttribute("Wind", b.Wind), new XAttribute("DragIndex", b.DragIndex), new XAttribute("Weight", b.Weight), new XAttribute("Shake", b.Shake), new XAttribute("ShootSound", b.ShootSound == null ? "" : b.ShootSound), new XAttribute("BombSound", b.BombSound == null ? "" : b.BombSound), new XAttribute("ActionType", b.ActionType), new XAttribute("Mass", b.Mass)); }
public override void Reset() { m_maxBlood = (int)((950 + m_player.PlayerCharacter.Grade * 50 + LevelPlusBlood + m_player.PlayerCharacter.Defence / 10) * m_player.GetBaseBlood()); if (m_game.RoomType == eRoomType.Treasure || m_game.RoomType == eRoomType.Boss) { m_game.Cards = new int[21]; } else { m_game.Cards = new int[8]; } Dander = 0; m_energy = (m_player.PlayerCharacter.Agility / 30 + 240); IsLiving = true; FinishTakeCard = false; m_weapon = m_player.MainWeapon; //m_mainBallId = m_weapon.Property1; //m_spBallId = m_weapon.Property2; var ballConfig = BallConfigMgr.FindBall(m_weapon.TemplateID); m_mainBallId = ballConfig.Common; m_spBallId = ballConfig.Special; BaseDamage = m_player.GetBaseAttack(); BaseGuard = m_player.GetBaseDefence(); Attack = m_player.PlayerCharacter.Attack; Defence = m_player.PlayerCharacter.Defence; Agility = m_player.PlayerCharacter.Agility; Lucky = m_player.PlayerCharacter.Luck; m_currentBall = BallMgr.FindBall(m_mainBallId); m_shootCount = 1; m_ballCount = 1; CurrentIsHitTarget = false; TotalCure = 0; TotalHitTargetCount = 0; TotalHurt = 0; TotalKill = 0; TotalShootCount = 0; LockDirection = false; GainGP = 0; GainOffer = 0; Ready = false; PlayerDetail.ClearTempBag(); LoadingProcess = 0; base.Reset(); }
public override void PrepareNewTurn() { if (CurrentIsHitTarget == true) { TotalHitTargetCount++; //Console.WriteLine("TotalHitTargetCount + 1 ------>>>> p.TotalHitTargetCount : {0}", TotalHitTargetCount); } //Game.SendUpdateUiData(this, game); // BufferMgr.BufferList.Clear(); m_energy = m_player.PlayerCharacter.Agility / 30 + 240; m_shootCount = 1; m_ballCount = 1; m_flyCoolDown--; m_secondWeapon--; //if(m_currentBall.ID!=PlayerDetail.MainWeapon) //SetCurrentWeapon(PlayerDetail.MainWeapon); SetCurrentWeapon(PlayerDetail.MainWeapon); if (m_currentBall.ID != m_mainBallId) { m_currentBall = BallMgr.FindBall(m_mainBallId); } if (IsLiving == false) { StartGhostMoving(); TargetPoint = Point.Empty; } base.PrepareNewTurn(); }
public void SetBall(int ballId, bool special) { if (ballId != m_currentBall.ID) { if(BallMgr.FindBall(ballId)!=null) m_currentBall = BallMgr.FindBall(ballId); BallCount = m_currentBall.Amount; if (!special) ShootCount = 1; m_game.SendGameUpdateBall(this, special); } }
public void SetCurrentBall(BallInfo info, bool stunt) { _currentBall = info; GSPacketIn pkg = _currentIndex.Out.SendCurrentBall(stunt); _currentIndex.CurrentGame.SendToPlayerExceptSelf(pkg, _currentIndex); }
public void SetBall(int ballId) { if (ballId != m_currentBall.ID) { m_currentBall = BallMgr.FindBall(ballId); GSPacketIn pkg = m_player.Out.SendGameUpdateBall(this); m_game.SendToAll(pkg, m_player); BallCount = m_currentBall.Amount; } }
public void Reset() { m_maxBlood = (int)((950 + m_player.PlayerCharacter.Grade * 50) * m_player.BaseBlood); if (m_isCaptain) m_maxBlood *= 2; m_blood = m_maxBlood; m_dander = 0; m_delay = (int)(1000 * m_player.BaseAgility); m_energy = 240; m_isCaptain = false; m_isFrost = false; m_isHide = false; m_isNoHole = false; m_isLiving = true; m_currentBall = BallMgr.FindBall(m_mainBallId); m_shootCount = 1; m_ballCount = 1; TurnNum = 0; TotalHurt = 0; TotalKill = 0; TotalShootCount = 0; TotalHitTargetCount = 0; GainGP = 0; GainOffer = 0; }
public void BeginNextTurn() { if (CurrentIsHitTarget == true) TotalHitTargetCount++; CurrentIsHitTarget = false; m_energy = 240; m_shootCount = 1; m_ballCount = 1; m_flyCoolDown--; CurrentDamagePlus = 1; CurrentShootMinus = 1; if (m_currentBall.ID != m_mainBallId) { m_currentBall = BallMgr.FindBall(m_mainBallId); } if (IsLiving == false) { StartGhostMoving(); TargetPoint = Point.Empty; } }
public override void PrepareNewTurn() { if (CurrentIsHitTarget == true) { TotalHitTargetCount++; } m_energy = m_player.PlayerCharacter.Agility / 30 + 240; m_shootCount = 1; m_ballCount = 1; m_flyCoolDown--; m_secondWeapon--; SetCurrentWeapon(PlayerDetail.MainWeapon); if (m_currentBall.ID != m_mainBallId) { m_currentBall = BallMgr.FindBall(m_mainBallId); } if (IsLiving == false) { StartGhostMoving(); TargetPoint = Point.Empty; } base.PrepareNewTurn(); }
public BallInfo[] GetAllBall() { List<BallInfo> infos = new List<BallInfo>(); SqlDataReader reader = null; try { db.GetReader(ref reader, "SP_Ball_All"); while (reader.Read()) { BallInfo info = new BallInfo(); info.Amount = (int)reader["Amount"]; info.ID = (int)reader["ID"]; info.Name = reader["Name"].ToString(); info.Crater = reader["Crater"] == null ? "" : reader["Crater"].ToString(); info.Power = (double)reader["Power"]; info.Radii = (int)reader["Radii"]; info.AttackResponse = (int)reader["AttackResponse"]; info.BombPartical = reader["BombPartical"].ToString(); info.FlyingPartical = reader["FlyingPartical"].ToString(); info.IsSpin = (bool)reader["IsSpin"]; info.Mass = (int)reader["Mass"]; info.SpinV = (int)reader["SpinV"]; info.SpinVA = (double)reader["SpinVA"]; info.Wind = (int)reader["Wind"]; info.DragIndex = (int)reader["DragIndex"]; info.Weight = (int)reader["Weight"]; info.Shake = (bool)reader["Shake"]; info.Delay = (int)reader["Delay"]; info.ShootSound = reader["ShootSound"] == null ? "" : reader["ShootSound"].ToString(); info.BombSound = reader["BombSound"] == null ? "" : reader["BombSound"].ToString(); info.ActionType = (int)reader["ActionType"]; info.HasTunnel = (bool)reader["HasTunnel"]; infos.Add(info); } } catch (Exception e) { if (log.IsErrorEnabled) log.Error("Init", e); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } return infos.ToArray(); }
private static bool LoadBall(Dictionary<int, BallInfo> balls,Dictionary<int, Tile> ballTile) { using (ProduceBussiness db = new ProduceBussiness()) { BallInfo[] ballInfos = db.GetAllBall(); foreach (BallInfo b in ballInfos) { if (!balls.ContainsKey(b.ID)) { balls.Add(b.ID, b); Tile shape = null; string file = string.Format("bomb\\{0}.bomb", b.ID); if (File.Exists(file)) { shape = new Tile(file,false); } if (shape != null) { ballTile.Add(b.ID, shape); } else { if (b.ID != 1 && b.ID != 2 && b.ID != 3) { if (log.IsErrorEnabled) log.Error("Ball's file is not exist!"); return false; } } } } } if (!balls.ContainsKey(0)) { BallInfo temp = new BallInfo(); temp.ID = 0; temp.Power = 1; temp.Radii = 60; temp.Amount = 1; balls.Add(0, temp); } return true; }