/// <summary>
    /// 落下演出のため、0.1秒間を置いて、イメージ画像を変更する
    /// </summary>
    /// <param name="piecetype"></param>
    /// <returns></returns>
    IEnumerator ChangePiece(Piece_Type piecetype)
    {
        this.GetComponent <Image>().enabled = true;
        yield return(new WaitForSeconds(0.1f));

        _pieceImage.sprite = Sprites[(int)piecetype];
    }
    /// <summary>
    /// 敵の属性と破壊したピースの属性によって攻撃を振り分ける
    /// </summary>
    /// <param name="piece">3マッチしたパズル</param>
    /// <param name="enemy"></param>
    /// <param name="comboCount"></param>
    public void PieceAttack(Piece_Type piece, Enemy enemy, int comboCount)
    {
        switch (piece)
        {
        case Piece_Type.RED:
            enemy.EnemyDamage(RedPiece_Attack(comboCount, enemy.GetEnemyType));
            break;

        case Piece_Type.GREEN:
            enemy.EnemyDamage(Green_Piece_Attack(comboCount, enemy.GetEnemyType));
            break;

        case Piece_Type.YELLOW:
            enemy.EnemyDamage(Yellow_Piece_Attack(comboCount, enemy.GetEnemyType));
            break;

        case Piece_Type.BLUE:
            enemy.EnemyDamage(Blue_Piece_Attack(comboCount, enemy.GetEnemyType));
            break;

        default:
            NoDamageAttack();
            break;
        }
    }
 public General_Piece(General_Piece temp)
 {
     this._Player = temp._Player;
     this._picBox = null;
     this._X      = temp._X;
     this._Y      = temp._Y;
     this._Type   = temp._Type;
 }
        protected Piece_Type _Type;         // the type of the piece

        public General_Piece(int which_player, PictureBox PicBox_location, int x_location, int y_location, Piece_Type type)
        {
            this._Player = which_player;
            this._picBox = PicBox_location;
            this._X      = x_location;
            this._Y      = y_location;
            this._Type   = type;
        }
        public General_Piece Swap_Pieces(General_Piece temp)
        {
            General_Piece this_piece = new General_Piece(this._Player, this._picBox, this._X, this._Y, this._Type);

            this._Player = temp._Player;
            this._picBox = temp._picBox;
            //this._X = temp._X;
            //this._Y = temp._Y;
            this._Type = temp._Type;

            return(this_piece);
        }
    /// <summary>
    /// 緑属性の攻撃、敵属性に対して有利だった場合は300、不利だったら25、それ以外だったら50とコンボしただけ掛けた攻撃数値を返す
    /// </summary>
    /// <param name="comboCount">コンボ数</param>
    /// <param name="piece">敵の属性</param>
    /// <returns></returns>
    public int Green_Piece_Attack(int comboCount, Piece_Type piece)
    {
        int attackPoint;

        if (piece == Piece_Type.YELLOW)
        {
            attackPoint = _advantageousPoint * comboCount;
        }
        else if (piece == Piece_Type.RED)
        {
            attackPoint = _disadvantagePoint * comboCount;
        }
        else
        {
            attackPoint = _nomalPoint * comboCount;
        }
        Debug.Log(attackPoint);
        return(attackPoint);
    }
    /// <summary>
    /// 赤属性の攻撃、敵属性に対して有利だった場合は300、不利だったら25、それ以外だったら50とコンボしただけ掛けた攻撃数値を返す
    /// </summary>
    /// <param name="comboCount">コンボ数</param>
    /// <param name="piece">敵の属性</param>
    /// <returns></returns>
    public int RedPiece_Attack(int comboCount, Piece_Type piece)
    {
        int attackPoint;

        if (piece == Piece_Type.GREEN)
        {
            attackPoint = _advantageousPoint * comboCount;
        }
        else if (piece == Piece_Type.BLUE)
        {
            attackPoint = _disadvantagePoint * comboCount;
        }
        else
        {
            attackPoint = _nomalPoint * comboCount;
        }
        Debug.Log(attackPoint);
        return(attackPoint);
    }
Beispiel #8
0
 public Bishop(int which_player, PictureBox PicBox_location, int x_location, int y_location, Piece_Type type)
     : base(which_player, PicBox_location, x_location, y_location, type)
 {
 }
 //コンストラクタ
 public Blocks(int x, int y, Piece_Type pieceType)
 {
     this.x         = x;
     this.y         = y;
     this.pieceType = pieceType;
 }
 // Setters
 public void SetType(Piece_Type type)
 {
     this._Type = type;
 }