예제 #1
0
 public void SetBombData(int x, int z, int radius, BombBag playerBag)     //set the bobmData...
 {
     this.x            = x;
     this.z            = z;
     this.explodeRange = radius;
     this.playerBag    = playerBag;
 }
예제 #2
0
        protected override void AnnounceWinner()
        {
            base.AnnounceWinner();
            if (Players.Count == 1)
            {
                Players[0].SendGump(new BoardGameWonGump(Players[0], this));

                BoardGameData.ChangeScore(GameName, Players[0], BombermanSettings.WIN_SCORE);
                BoardGameData.AddWin(GameName, Players[0]);

                BombBag bag = (BombBag)Players[0].Backpack.FindItemByType(typeof(BombBag));

                if (bag != null)
                {
                    //don't let players run around blowing stuff up outside the game while they wait for others to finish
                    bag.Active = false;
                }

                PublicOverheadMessage(MessageType.Regular, 1153, false, Players[0].Name + " wins the game!");
            }
            else
            {
                PublicOverheadMessage(MessageType.Regular, 1153, false, "It's a draw!");
            }
        }
예제 #3
0
 public void SetBombData(int x, int z, int radius, BombBag playerBag)
 {
     this.x = x;
     this.z = z;
     this.explodeRange = radius;
     this.playerBag = playerBag;
 }
예제 #4
0
    public AudioClip[] powerUpSound;                                                                                            //audio array

    void OnTriggerEnter(Collider collision)                                                                                     // Activates function when game object collides with player trigger
    {
        BombBag bag = collision.collider.gameObject.GetComponent <BombBag>();                                                   // Retrieves info from BombBag.cs

        bag.IncreaseMaxBombs(1);                                                                                                // Increases amount of bombs by adding 1 to IncreaseMaxBombs in BombBag.cs
        AudioSource.PlayClipAtPoint(powerUpSound [Random.Range(0, powerUpSound.Length)], Camera.main.transform.position, .50F); // playes a random sound from powerUpSound array
        Destroy(this.gameObject);                                                                                               // Power-up is removed from scene
    }
예제 #5
0
        public void CheckForMobileVictims(Point3D location, Map map, BombBag sourcebag)
        {
            IPooledEnumerable ie = map.GetMobilesInRange(location, 0);

            List <Mobile> tomove = new List <Mobile>();

            foreach (Mobile m in ie)
            {
                if (Players.IndexOf(m) > -1)
                {
                    if (m != sourcebag.Owner)
                    {
                        m.SendMessage("You've been blown up by " + sourcebag.Owner.Name + "'s blast!");

                        //handle scoring
                        BoardGameData.ChangeScore(GameName, sourcebag.Owner, BombermanSettings.KILL_SCORE);

                        BoardGameData.ChangeScore(GameName, m, BombermanSettings.DEATH_SCORE);
                        BoardGameData.AddLose(GameName, m);
                    }
                    else
                    {
                        m.SendMessage("You just blew yourself up!!");

                        BoardGameData.ChangeScore(GameName, m, BombermanSettings.SUICIDE_SCORE);
                    }


                    m.PlaySound(m.Female? 0x32E : 0x549);
                    //0x54A - yelp1

                    tomove.Add(m);
                }
            }
            ie.Free();

            foreach (Mobile m in tomove)
            {
                m.MoveToWorld(new Point3D(X - 1, Y - 1, Z), Map);
                m.SendGump(new BoardGameLostGump(m, this));

                Players.Remove(m);

                BombBag bag = (BombBag)m.Backpack.FindItemByType(typeof(BombBag));

                if (bag != null)
                {
                    //don't let players run around blowing stuff up outside the game while they wait for others to finish
                    bag.Active = false;
                }

                //start the timer to check for endgame, delay for 1s
            }
            //test big bomb chain!
            StartEndGameTimer(TimeSpan.FromSeconds(1));
        }
예제 #6
0
    //===============================================================
    //===================  MonoBehaviour methods  ===================
    //===============================================================

    /// <summary>
    /// Start is called when the object is instantiated and is ready to be used.
    /// </summary>
    void Start()
    {
        if (this.levelControl == null)
        {
            this.levelControl = GameObject.FindWithTag("LevelControl").GetComponent <LevelGenerator>();
        }
        if (this.bombBag == null)
        {
            MonoBehaviour[] scripts = this.GetComponents <MonoBehaviour>();
            foreach (MonoBehaviour elem in scripts)
            {
                if (elem.GetType() == typeof(BombBag))
                {
                    this.bombBag = (BombBag)elem;
                }
            }
        }
        this.isMoving = false;
        this.target   = this.transform.position;
    }
예제 #7
0
    private void Update()
    {
        if (IsSquareOpen(new Vector2(0f, -1f), RaycastPoint.position, 1f) && !IsAnimating)
        {
            IsFalling = true;
        }
        else
        {
            if (IsFalling && !IsOnLadder(Vector2.zero, RaycastPoint.position, 1f))
            {
                AudioSource.PlayOneShot(LandAudioClip);
                LandingParticle.Play();
            }
            IsFalling = false;
        }

        RaycastHit2D raycast = Physics2D.Raycast(RaycastPoint.position, Vector2.zero, 1f, LayerMask.GetMask("bomb bag", "health pickup"));

        if (raycast.transform != null)
        {
            BombBag bombBag = raycast.transform.GetComponent <BombBag>();
            if (bombBag != null)
            {
                AudioSource.PlayOneShot(PickupClip);
                BombCount       += bombBag.CollectBombBag();
                BombCountUI.text = BombCount.ToString();
            }
            HealthPickup healthPickup = raycast.transform.GetComponent <HealthPickup>();
            if (healthPickup != null)
            {
                AudioSource.PlayOneShot(PickupClip);
                Health            += healthPickup.CollectHealth();
                HealthValueUI.text = Health.ToString();
            }
        }

        if (Health <= 0)
        {
            StartCoroutine(DeathAnimation());
        }
    }
예제 #8
0
        protected override void PrimePlayers()
        {
            base.PrimePlayers();

            for (int i = 0; i < Players.Count; i++)
            {
                Mobile player = Players[i];

                Point3D movepoint;
                switch (i)
                {
                case 0:
                {
                    movepoint = new Point3D(X + BoardOffset.X + 1, Y + BoardOffset.Y + 1, Z + BoardOffset.Z);
                    break;
                }

                case 1:
                {
                    movepoint = new Point3D(X + BoardOffset.X + BoardWidth - 2, Y + BoardOffset.Y + 1, Z + BoardOffset.Z);
                    break;
                }

                case 2:
                {
                    movepoint = new Point3D(X + BoardOffset.X + 1, Y + BoardOffset.Y + BoardHeight - 2, Z + BoardOffset.Z);
                    break;
                }

                case 3:
                {
                    movepoint = new Point3D(X + BoardOffset.X + +BoardWidth - 2, Y + BoardOffset.Y + +BoardHeight - 2, Z + BoardOffset.Z);
                    break;
                }

                case 4:
                {
                    movepoint = new Point3D(X + BoardOffset.X + BoardWidth / 2, Y + BoardOffset.Y + 1, Z + BoardOffset.Z);
                    break;
                }

                case 5:
                {
                    movepoint = new Point3D(X + BoardOffset.X + BoardWidth - 2, Y + BoardOffset.Y + BoardHeight / 2, Z + BoardOffset.Z);
                    break;
                }

                case 6:
                {
                    movepoint = new Point3D(X + BoardOffset.X + BoardWidth / 2, Y + BoardOffset.Y + BoardHeight - 2, Z + BoardOffset.Z);
                    break;
                }

                case 7:
                default:
                {
                    movepoint = new Point3D(X + BoardOffset.X + 1, Y + BoardOffset.Y + BoardHeight / 2, Z + BoardOffset.Z);
                    break;
                }
                }

                player.MoveToWorld(movepoint, BoardMap);



                BombBag bag = new BombBag(this, _DefaultMaxBombs, _DefaultBombStrength);


                BombBags.Add(bag);
                bag.Owner = player;
                player.Backpack.DropItem(bag);



                if (_DefaultDetonatorMode)
                {
                    BombDetonator detonator = new BombDetonator(bag);

                    bag.Detonator = detonator;
                    player.Backpack.DropItem(detonator);
                }


                bag.BaddaBoom = _DefaultBaddaBoom;
            }
        }
예제 #9
0
 //===============================================================
 //===================  MonoBehaviour methods  ===================
 //===============================================================
 /// <summary>
 /// Start is called when the object is instantiated and is ready to be used.
 /// </summary>
 void Start()
 {
     if (this.levelControl == null){
         this.levelControl = GameObject.FindWithTag("LevelControl");
     }
     this.bombBag = new BombBag();
     this.isMoving = false;
 }