public override bool TriggerAsCurrent(BasicMarker m)
        {
            LastMarker = m;
            if (ButtonEvent.get().Equals(""))
            {
                if (Event == null && TargetMenu == null)
                {
                    ErrorAlpha = 1;
                    return(false);
                }

                if (Event != null)
                {
                    bool Result = Event(this, m);

                    if (BasicMarker.SelectSound != null)
                    {
                        BasicMarker.SelectSound.Play(BasicMarker.SelectVolume, 0, 0);
                    }

                    if (Result)
                    {
                        FlashAlpha = 1;
                        return(true);
                    }
                    else
                    {
                        ErrorAlpha = 1;
                        return(false);
                    }
                }
                else if (ParentFrame != null)
                {
                    if (TargetMenu.Equals(""))
                    {
                        ParentFrame.DeActivate();
                    }
                    else
                    {
                        ParentFrame.Cycle(TargetMenu);
                    }

                    FlashAlpha = 1;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                ButtonEvent.Trigger();
                return(true);
            }
        }
示例#2
0
        public virtual void MarkerEnter(BasicMarker Marker)
        {
            for (int i = 0; i < 4; i++)
            {
                if (Marker == Markers[i])
                {
                    return;
                }
            }

            Markers[MarkerCount] = Marker;
            MarkerCount++;
        }
示例#3
0
 public virtual void MarkerLeave(BasicMarker Marker)
 {
     for (int i = 0; i < MarkerCount; i++)
     {
         if (Markers[i] == Marker)
         {
             BasicMarker temp = Markers[MarkerCount - 1];
             Markers[MarkerCount - 1] = Markers[i];
             Markers[i] = temp;
             MarkerCount--;
             Markers[MarkerCount] = null;
             return;
         }
     }
 }
        public override bool TriggerAsCurrent(BasicMarker m)
        {
            if (BasicMarker.SelectSound != null)
            {
                BasicMarker.SelectSound.Play(BasicMarker.SelectVolume, 0, 0);
            }

            Faction f = FactionManager.Factions[ParentShip.FactionNumber];

            FlashAlpha = 1;

            if (FactionManager.GetFaction(ParentShip.FactionNumber).PickingCards)
            {
                if (Selected)
                {
                    for (int i = 0; i < f.Cards.Count; i++)
                    {
                        if (f.Cards[i] == MyCard)
                        {
                            f.Cards[i] = null;
                            Selected   = false;
                            return(true);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < f.Cards.Count; i++)
                    {
                        if (f.Cards[i] == null)
                        {
                            f.Cards[i] = MyCard;
                            Selected   = true;
                            break;
                        }
                    }

                    if (!Selected)
                    {
                        f.Cards.Add(MyCard);
                        Selected = true;
                    }

                    if (Faction.MaxCards == f.Cards.Count)
                    {
                        for (int i = 0; i < f.Cards.Count; i++)
                        {
                            if (f.Cards[i] == null)
                            {
                                return(true);
                            }
                        }

                        ParentShip.ReadyMenu();
                    }
                }
            }
            else
            {
                int CardCost = MyCard.CardCellsCost;
                if (MyCard.FactionCostIncreases.ContainsKey(ParentShip.FactionNumber))
                {
                    CardCost += MyCard.CardCellsCostIncrease * MyCard.FactionCostIncreases[ParentShip.FactionNumber];
                }

                if (FactionManager.CanAfford(ParentShip.FactionNumber, CardCost) && ParentShip.CanPlaceTurret(MyCard.TurretSize))
                {
                    if (MyCard.FactionCostIncreases.ContainsKey(ParentShip.FactionNumber))
                    {
                        MyCard.FactionCostIncreases[ParentShip.FactionNumber]++;
                    }
                    else
                    {
                        MyCard.FactionCostIncreases.Add(ParentShip.FactionNumber, 1);
                    }

                    FactionManager.AddCells(ParentShip.FactionNumber, -CardCost);
                    UnitTurret u = (UnitTurret)MyCard.GetUnit(ParentShip.FactionNumber);
                    u.MyCard = MyCard;
                    ParentShip.PlaceTurret(u);
                    //ParentFrame.DeActivate();
                }
                else
                {
                    ErrorAlpha = 1;
                }
            }

            return(base.TriggerAsCurrent(m));
        }
示例#5
0
 public virtual bool TriggerAsCurrent(BasicMarker m)
 {
     return(false);
 }
示例#6
0
 public void Add(BasicMarker M)
 {
     M.AddToFrame(this);
 }
示例#7
0
 public void AddTarget(BasicMarker M)
 {
     M.AddToFrame(this);
     TargetMarkers.AddLast(M);
 }
示例#8
0
 public override bool TriggerAsCurrent(BasicMarker m)
 {
     return(true);
 }
        static bool DropPlayer(BasicGameForm form, BasicMarker trigger)
        {
            PlayerProfile.RemovePlayer(trigger.MyPlayer);

            return(true);
        }