Inheritance: BaseAction
Exemplo n.º 1
0
        private void onPieceBuff(PieceBuffModel pieceBuff)
        {
            var piece = CopyPiece(pieces.Piece(pieceBuff.pieceId));
            var currentItem = GetCurrent(pieceBuff.activatingPieceId, HistoryItemType.Event, piece.playerId);

            if (currentItem.triggeringPiece == null && pieceBuff.activatingPieceId.HasValue)
            {
                currentItem.triggeringPiece = CopyPiece(pieces.Piece(pieceBuff.activatingPieceId.Value));
            }

            currentItem.pieceChanges.Add(new HistoryBuff()
            {
                type = HistoryPieceChangeType.HistoryBuff,
                originalPiece = piece,
                buff = pieceBuff
            });
        }
Exemplo n.º 2
0
        public void onBuffed(PieceBuffModel pieceBuff)
        {
            var piece = pieces.Piece(pieceBuff.pieceId);
            if(piece == null) return;

            var view = piece.pieceView;

            if (pieceBuff.attack != null)
            {
                animationQueue.Add(
                    new PieceView.UpdateTextAnim()
                    {
                        text = view.attackText,
                        textGO = view.attackGO,
                        current = view.piece.attack,
                        original = view.piece.baseAttack,
                        change = pieceBuff.attack.Value,
                        animFinished = pieceTextAnimFinished,
                        piece = view.piece
                    }
                );
            }

            if (pieceBuff.health != null)
            {
                animationQueue.Add(
                    new PieceView.UpdateTextAnim()
                    {
                        text = view.healthText,
                        textGO = view.healthGO,
                        current = view.piece.health,
                        original = view.piece.baseHealth,
                        change = pieceBuff.health.Value,
                        animFinished = pieceTextAnimFinished,
                        piece = view.piece
                    }
                );
            }

            animationQueue.Add(
                new PieceView.UpdateHpBarAnim()
                {
                    piece = view
                }
            );
        }