Beispiel #1
0
            public override float ApplyToProperties(Unit.Properties property)
            {
                Unit unit;

                if (!_triggered)
                {
                    switch (_golemSize)
                    {
                    case GolemSize.Small:
                        unit = FigureManager.CreateUnit("EarthSmallGolem");
                        break;

                    case GolemSize.Big:
                        unit = FigureManager.CreateUnit("EarthBigGolem");
                        break;

                    default:
                        return(0);
                    }

                    _figure    = FigureManager.CreateFigure(unit, Enums.Piece.Pawn);
                    _triggered = true;

                    OnFigureSpawn(_figure, _source);
                }
                return(0);
            }
Beispiel #2
0
        public static bool SpawnFigure(PlayerServiceReference.BaseUnitPackage unit, Enums.Piece piece)
        {
            for (int i = 0; i < 8; ++i)
            {
                if (Figures[-1, i] == null)
                {
                    Figure figureOnBoard = FigureManager.CreateFigure(unit, piece);

                    //if (CheckForUpgrades(figureOnBoard, true).Count != 0)
                    //    return true;

                    figureOnBoard.Untargetable = true;
                    figureOnBoard.Owner        = Owner;
                    figureOnBoard.OnDeath     += f =>
                    {
                        Figures[f.Position.Row, f.Position.Column] = null;
                        _activeAllyFigures.Remove(f);
                        if (_activeAllyFigures.Count == 0)
                        {
                            TakeDamage();
                        }
                    };
                    figureOnBoard.OnMove += MoveFigure;
                    figureOnBoard.OnSell += figure => SellFigure(figure);

                    AllFigures.Add(figureOnBoard);
                    SpawnChessFigure(AllFigures.Count - 1, -1, i);
                    return(true);
                }
            }
            return(false);
        }
Beispiel #3
0
            public override float ApplyToProperties(Unit.Properties property)
            {
                Unit unit = ((Units.ICloneable)_source.Unit).Clone();

                Figure figure = FigureManager.CreateFigure(unit, Enums.Piece.Pawn);

                OnFigureSpawn(figure, _source);

                return(0);
            }