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); } }
public virtual void MarkerEnter(BasicMarker Marker) { for (int i = 0; i < 4; i++) { if (Marker == Markers[i]) { return; } } Markers[MarkerCount] = Marker; MarkerCount++; }
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)); }
public virtual bool TriggerAsCurrent(BasicMarker m) { return(false); }
public void Add(BasicMarker M) { M.AddToFrame(this); }
public void AddTarget(BasicMarker M) { M.AddToFrame(this); TargetMarkers.AddLast(M); }
public override bool TriggerAsCurrent(BasicMarker m) { return(true); }
static bool DropPlayer(BasicGameForm form, BasicMarker trigger) { PlayerProfile.RemovePlayer(trigger.MyPlayer); return(true); }