protected override void TurnBegin() { base.TurnBegin(); m_PunishmentCountThisRound = 0; m_RewardCountThisRound = 0; State = GlobalState.IDLE; if (m_Turn > 1 && LevelDataIndex.CurrentLevel.SpecificPocket) { //generate punitive pocket and reward pocket //punishment PocketIndexes punishment = PocketIndexes.None; if (Random.Range(0, 100) > ConstantData.SpecialPocketProbability) { punishment |= (PocketIndexes)(1 << Random.Range(0, 5)); if (Random.Range(0, 1) == 1) { punishment |= (PocketIndexes)(1 << Random.Range(0, 5)); } } //reward PocketIndexes reward = PocketIndexes.None; if (Random.Range(0, 100) > ConstantData.SpecialPocketProbability) { reward |= (PocketIndexes)(1 << Random.Range(0, 5)); if (Random.Range(0, 1) == 1) { reward |= (PocketIndexes)(1 << Random.Range(0, 5)); } } PocketTrigger.MarkPocketType(punishment, reward); } }
public static PocketTrigger GetPocketWithIndexes(PocketIndexes index) { for(int i = 0, count = Pools.PocketTriggers.Count; i < count; i++) { if((Pools.PocketTriggers[i].m_PocketIndex & index) != 0x0) return Pools.PocketTriggers[i]; } return null; }
public static void Block(PocketIndexes pockets) { for (int i = 0, length = Pools.PocketTriggers.Count; i < length; i++) { PocketTrigger trigger = Pools.PocketTriggers[i]; if ((trigger.PocketIndex & pockets) != 0x0) trigger.BlockOff(); } }
public override void PotBall(PoolBall ball, PocketIndexes pocket) { base.PotBall(ball, pocket); if (ball.ballType != BallType.WHITE) { m_Player.AddBall(ball.GetBallID()); m_Player.AddScore(ConstantData.QuickFireBallPottedPoint); m_Time += 10; m_Player.PlayTime += 10; } }
public static void Block(PocketIndexes pockets) { for (int i = 0, length = Pools.PocketTriggers.Count; i < length; i++) { PocketTrigger trigger = Pools.PocketTriggers[i]; if ((trigger.PocketIndex & pockets) != 0x0) { trigger.BlockOff(); } } }
public static PocketTrigger GetPocketWithIndexes(PocketIndexes index) { for (int i = 0, count = Pools.PocketTriggers.Count; i < count; i++) { if ((Pools.PocketTriggers[i].m_PocketIndex & index) != 0x0) { return(Pools.PocketTriggers[i]); } } return(null); }
public override void PotBall(PoolBall ball, PocketIndexes pocket) { base.PotBall(ball, pocket); if(ball.ballType != BallType.WHITE) { m_Player.AddBall(ball.GetBallID()); m_Player.AddScore(ConstantData.QuickFireBallPottedPoint); m_Time += 10; m_Player.PlayTime += 10; } }
public override void Potted(PocketIndexes pocketIndex) { base.Potted(pocketIndex); if (GameManager.Rules.State == GlobalState.GAMEOVER) return; GameManager.Rules.State = GlobalState.GAMEOVER; if (GameOverWithPotted != null) GameOverWithPotted(null); }
public override void PotBall(PoolBall ball, PocketIndexes pocket) { base.PotBall(ball, pocket); if (CurrentPlayer.TargetBallType == BallType.NONE && ball.ballType != BallType.WHITE && ball.ballType != BallType.BLACK && !firstRound) { CurrentPlayer.TargetBallType = ball.ballType; OpponentPlayer.TargetBallType = ball.ballType == BallType.SOLID ? BallType.STRIPE : BallType.SOLID; } BallType b = ball.ballType; if (b != BallType.WHITE) { CurrentPlayer.combo++; } }
public override void Potted(PocketIndexes pocketIndex) { if (m_rigidbody) { m_state = State.POTTED; m_rigidbody.velocity = Vector3.zero; m_rigidbody.angularVelocity = Vector3.zero; CloseDrag(); CloseRenderer(); enabled = false; RemovePhysicalMaterial(); GameStatistics.MarkCueballPotted(1); } }
public override void Potted(PocketIndexes pocketIndex) { if (m_rigidbody) { m_state = State.POTTED; m_rigidbody.velocity = Vector3.zero; m_rigidbody.angularVelocity = Vector3.zero; CloseDrag(); CloseRenderer(); enabled = false; RemovePhysicalMaterial(); GameStatistics.MarkPottedJiangyouBallCount(1); } }
public static void MarkPocketType(PocketIndexes punishmentIndex, PocketIndexes rewardIndex) { for(int i = 0, length = Pools.PocketTriggers.Count; i < length; i++) { PocketTrigger trigger = Pools.PocketTriggers[i]; if((trigger.PocketIndex & punishmentIndex) != 0x0) trigger.Punishment(); else if((trigger.PocketIndex & rewardIndex) != 0x0) trigger.Reward(); else trigger.Clear(); } PunitivePocket = punishmentIndex; RewardPocket = rewardIndex; }
public override void Potted(PocketIndexes pocketIndex) { base.Potted(pocketIndex); if (GameManager.Rules.State == GlobalState.GAMEOVER) { return; } GameManager.Rules.State = GlobalState.GAMEOVER; if (GameOverWithPotted != null) { GameOverWithPotted(null); } }
public virtual void PotBall(PoolBall ball, PocketIndexes pocket) { ball.Potted(pocket); if (ball.ballType == BallType.WHITE) { m_WhiteBallPotted = true; if (onCueballPotted != null) { onCueballPotted(); } } else if (ball.ballType != BallType.JIANGYOU && ball.ballType != BallType.DEMON) { m_PottedBallListThisRound.Add(ball); } }
public Pocket(Rect _rect, Texture2D _texture, GameObject _pocketGameObject, PocketIndexes _Index) { rect = _rect; texture = _texture; pocketGameObject = _pocketGameObject; m_Index = _Index; (punishmentObject = pocketGameObject.transform.FindChild("PunishmentSprite").gameObject).SetActive(false); (rewardObject = pocketGameObject.transform.FindChild("RewardSprite").gameObject).SetActive(false); (blockObject = pocketGameObject.transform.FindChild("BlockOff").gameObject).SetActive(false); punishmentColor = Color.red; rewardColor = Color.green; blockColor = Color.white; m_Type = PocketType.None; }
public static void MarkPocketType(PocketIndexes punishmentIndex, PocketIndexes rewardIndex) { for (int i = 0, length = Pools.PocketTriggers.Count; i < length; i++) { PocketTrigger trigger = Pools.PocketTriggers[i]; if ((trigger.PocketIndex & punishmentIndex) != 0x0) { trigger.Punishment(); } else if ((trigger.PocketIndex & rewardIndex) != 0x0) { trigger.Reward(); } else { trigger.Clear(); } } PunitivePocket = punishmentIndex; RewardPocket = rewardIndex; }
public override void PotBall(PoolBall ball, PocketIndexes pocket) { base.PotBall(ball, pocket); if ((pocket & PocketTrigger.PunitivePocket) != 0) { //m_PunishmentCountThisRound++; m_Player.AddCues(ConstantData.PunitiveShots, PocketTrigger.GetPocketWithIndexes(pocket)); } if ((pocket & PocketTrigger.RewardPocket) != 0) { //m_RewardCountThisRound++; m_Player.AddCues(ConstantData.RewardShots, PocketTrigger.GetPocketWithIndexes(pocket)); } int score = 0; if (ball.ballType == BallType.WHITE) { m_Player.Combo = 0; m_Player.AddCues(ConstantData.MissionCueballPottedPunishment, PocketTrigger.GetPocketWithIndexes(pocket)); return; } else if (ball.ballType == BallType.BOMB) score = ConstantData.MissionBombPottedPoint; else if (ball.ballType == BallType.SINGULARITY) score = ConstantData.MissionSingularityPottedPoint; else if (ball.ballType == BallType.ABSORB) { score = ConstantData.MissionAbsorbPottedPoint; AbsorbBall b = (AbsorbBall)ball; for (int i = 0, count = b.AbsorbList.Count; i < count; i++) { PotBall(b.AbsorbList[i], pocket); Pools.StorageRack.Add(b.AbsorbList[i]); } b.AbsorbList.Clear(); } else if (ball.ballType == BallType.REDCUSTOM) score = ConstantData.MissionRedBallPoint; else if (ball.ballType == BallType.BLUECUSTOM) score = ConstantData.MissionBlueBallPoint; else if (ball.ballType == BallType.YELLOWCUSTOM) score = ConstantData.MissionYellowBallPoint; else if (ball.ballType == BallType.JIANGYOU) score = ConstantData.MissionJiangYouBallPoint; else if (ball.ballType == BallType.DEMON) score = ConstantData.MissionDemonBallPoint; if(score > 0) { m_Player.Combo++; m_Player.AddScore(score, PocketTrigger.GetPocketWithIndexes(pocket)); m_ScoreThisRound = score; } if (m_Player.Combo >= 5) { BaseUIController.GenerateTips("Great!"); } m_Player.Pot(); if (m_TargetBalls.Contains(ball.GetBallID())) m_TargetBalls.Remove(ball.GetBallID()); }
public override void PotBall(PoolBall ball, PocketIndexes pocket) { base.PotBall(ball, pocket); if ((pocket & PocketTrigger.PunitivePocket) != 0) { //m_PunishmentCountThisRound++; m_Player.AddCues(ConstantData.PunitiveShots, PocketTrigger.GetPocketWithIndexes(pocket)); } if ((pocket & PocketTrigger.RewardPocket) != 0) { //m_RewardCountThisRound++; m_Player.AddCues(ConstantData.RewardShots, PocketTrigger.GetPocketWithIndexes(pocket)); } int score = 0; if (ball.ballType == BallType.WHITE) { m_Player.Combo = 0; m_Player.AddCues(ConstantData.MissionCueballPottedPunishment, PocketTrigger.GetPocketWithIndexes(pocket)); return; } else if (ball.ballType == BallType.BOMB) { score = ConstantData.MissionBombPottedPoint; } else if (ball.ballType == BallType.SINGULARITY) { score = ConstantData.MissionSingularityPottedPoint; } else if (ball.ballType == BallType.ABSORB) { score = ConstantData.MissionAbsorbPottedPoint; AbsorbBall b = (AbsorbBall)ball; for (int i = 0, count = b.AbsorbList.Count; i < count; i++) { PotBall(b.AbsorbList[i], pocket); Pools.StorageRack.Add(b.AbsorbList[i]); } b.AbsorbList.Clear(); } else if (ball.ballType == BallType.REDCUSTOM) { score = ConstantData.MissionRedBallPoint; } else if (ball.ballType == BallType.BLUECUSTOM) { score = ConstantData.MissionBlueBallPoint; } else if (ball.ballType == BallType.YELLOWCUSTOM) { score = ConstantData.MissionYellowBallPoint; } else if (ball.ballType == BallType.JIANGYOU) { score = ConstantData.MissionJiangYouBallPoint; } else if (ball.ballType == BallType.DEMON) { score = ConstantData.MissionDemonBallPoint; } if (score > 0) { m_Player.Combo++; m_Player.AddScore(score, PocketTrigger.GetPocketWithIndexes(pocket)); m_ScoreThisRound = score; } if (m_Player.Combo >= 5) { BaseUIController.GenerateTips("Great!"); } m_Player.Pot(); if (m_TargetBalls.Contains(ball.GetBallID())) { m_TargetBalls.Remove(ball.GetBallID()); } }
public virtual void PotBall(PoolBall ball, PocketIndexes pocket) { ball.Potted(pocket); if (ball.ballType == BallType.WHITE) { m_WhiteBallPotted = true; if (onCueballPotted != null) onCueballPotted(); } else if (ball.ballType != BallType.JIANGYOU && ball.ballType != BallType.DEMON) { m_PottedBallListThisRound.Add(ball); } }