public override void PlayCard(Card card, bool isForcePlay) { if ((IsHuman && card.GetStandardValue() == 1 && MyGameLogic.GetCurrentScore() + 11 <= 99) && !isForcePlay) { SelectedAce = card; MyGameLogic.SetIsPaused(true); MyGameLogic.SetIsWaitingForAceSelection(true); } else { if (MyGameLogic.CanPlayCard(card)) { card.MoveCard(PlayStack, true, BaseCardPlaySpeed * MyGameLogic.GetCardSpeedMultiplier(), true); MyGameLogic.AddScore(card.GetValueIn99()); Invoke("InvokedRequestNewCard", 0.3f); Invoke("FanCards", 0.4f); if (card.GetStandardValue() == 4) { MyGameLogic.ReverseOrder(); } MyDealer.Invoke("StartNextPlayersTurn", 0.5f); AudioSource.PlayClipAtPoint(PlayCardSound, transform.position); } } }
//Triggers upon collision, explodes, kills stuff, increments score void OnTriggerEnter(Collider other) { if (other.tag == "powerup") { return; } else if (other.tag == "earth") { Destroy(gameObject); gameLogic.gameOver(); } else if (other.tag == "Player") { gameLogic.gameOver(); Destroy(other.gameObject); Destroy(gameObject); } //Debug.Log("ded"); gameLogic.AddScore(); Instantiate(explosion, transform.position, transform.rotation); Destroy(other.gameObject); Destroy(gameObject); }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { pop(); GameLogic.AddScore(3); } }
public void DropOff() { _gameLogic.AddScore(Followers.Count); foreach (var follower in Followers) { follower.DropOff(); } Followers.Clear(); }
private void eat(Vector2 i_RivalLocation, Vector.Vector2 i_Destinition, GameBoard io_GameBoard) { GameLogic.AddScore(io_GameBoard[i_RivalLocation]); io_GameBoard[i_RivalLocation] = null; if (!isNewKing(i_Destinition, io_GameBoard)) { io_GameBoard[i_Destinition] = new Piece(this.m_Type, i_Destinition); } else { io_GameBoard.OnNewKing(io_GameBoard[i_Destinition]); } io_GameBoard.OnMove(io_GameBoard[i_Destinition]); io_GameBoard[this.m_Location] = null; }
public void Take() { instances.Remove(this); GameLogic.AddScore(score); if (energizer) { foreach (var e in Enemy.instances) { if (e.state == StateEnemy.Death) { continue; } e.ChangeState(StateEnemy.Afraid); } } Destroy(gameObject); AudioManager.PlayAudio(AudioManager._singleton.clipChomp); }
private void OnTriggerEnter(Collider other) { switch (other.transform.tag) { case "Point": other.transform.GetComponent <Point>().Take(); break; case "Enemy": Enemy enemy = other.transform.GetComponent <Enemy>(); switch (enemy.state) { case StateEnemy.Normal: GameLogic.KillPlayer(); break; case StateEnemy.Chase: GameLogic.KillPlayer(); break; case StateEnemy.Afraid: GameLogic.AddScore(300); enemy.ChangeState(StateEnemy.Death); AudioManager.PlayAudio(AudioManager._singleton.clipEatGhost); break; } break; } }
public void OnHit() { int damage = gl.buffedDamage; HitPoints -= damage; if (HitPoints <= 0) { OnDeath(); } else { hpDisplay.text = HitPoints + ""; for (int i = 0; i < damage; i++) { Destroy(tower.Pop()); } } ColorChange(); gl.AddScore(damage); }
public void createNewBalloon() { GameLogic.AddScore(1); createBalloon(); }
public void PopBubble() { if (transform.childCount > 0) { foreach (Transform child in transform) { if (!killZoned) { switch (child.gameObject.name) { case "bomb": gameLogic.Gameover(); break; case "star": gameLogic.AddScore(value); gameLogic.stars.Push(child.gameObject); child.transform.SetParent(starsParent.transform); break; case "plus": gameLogic.AddTime(value); gameLogic.plusses.Push(child.gameObject); child.transform.SetParent(plussesParent.transform); break; case "random": PopRandom(); gameLogic.randoms.Push(child.gameObject); child.transform.SetParent(randomsParent.transform); break; } } if (killZoned) { switch (child.gameObject.name) { case "bomb": gameLogic.bombs.Push(child.gameObject); child.transform.SetParent(bombsParent.transform); break; case "star": gameLogic.stars.Push(child.gameObject); child.transform.SetParent(starsParent.transform); break; case "plus": gameLogic.plusses.Push(child.gameObject); child.transform.SetParent(plussesParent.transform); break; case "random": gameLogic.randoms.Push(child.gameObject); child.transform.SetParent(randomsParent.transform); break; } } gameObject.SetActive(false); gameLogic.bubbles.Push(gameObject); gameLogic.activeBubbles -= 1; child.gameObject.SetActive(false); } } }