Example #1
0
        //private int zM;

        public ObjectInstance(ObjectInfo baseInfo, Layer layer, Board board, int x, int y, int z, MapleBool r, MapleBool hide, MapleBool reactor, MapleBool flow, int? rx, int? ry, int? cx, int? cy, string name, string tags, List<ObjectInstanceQuest> questInfo, bool flip, bool beforeAdding)
            : base(board, layer, x, y, z, beforeAdding)
        {
            this.baseInfo = baseInfo;
            this.flip = flip;
            this._r = r;
            this.name = name;
            this._hide = hide;
            this._reactor = reactor;
            this._flow = flow;
            this._rx = rx;
            this._ry = ry;
            this._cx = cx;
            this._cy = cy;
            this._tags = tags;
            this.questInfo = questInfo;
            //this.zM = zM;
            if (flip)
                X -= Width - 2 * Origin.X;
        }
Example #2
0
 public override BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding)
 {
     ObjectInstance instance = new ObjectInstance(this, layer, board, x, y, z, false, false, false, false, null, null, null, null, null, null, null, flip, beforeAdding);
     ParseOffsets(instance, layer, board, x, y);
     return instance;
 }
Example #3
0
 public void ParseOffsets(ObjectInstance instance, Layer layer, Board board, int x, int y)
 {
     List<FootholdAnchor> anchors = new List<FootholdAnchor>();
     bool ladder = l0 == "ladder";
     if (footholdOffsets != null || footholdFullOffsets != null)
     {
         if (!fullFootholdInfo)
         {
             foreach (XNA.Point foothold in footholdOffsets)
             {
                 FootholdAnchor anchor = new FootholdAnchor(board, x + foothold.X, y + foothold.Y, layer.LayerNumber, false);
                 board.BoardItems.FHAnchors.Add(anchor);
                 instance.BindItem(anchor, foothold);
                 anchors.Add(anchor);
             }
             CreateFootholdsFromAnchorList(board, anchors);
         }
         else
         {
             foreach (List<XNA.Point> anchorList in footholdFullOffsets)
             {
                 foreach (XNA.Point foothold in anchorList)
                 {
                     FootholdAnchor anchor = new FootholdAnchor(board, x + foothold.X, y + foothold.Y, layer.LayerNumber, false);
                     board.BoardItems.FHAnchors.Add(anchor);
                     instance.BindItem(anchor, foothold);
                     anchors.Add(anchor);
                 }
                 CreateFootholdsFromAnchorList(board, anchors);
                 anchors.Clear();
             }
         }
     }
     if  (chairOffsets != null) foreach (XNA.Point chairPos in chairOffsets)
     {
         Chair chair = new Chair(board, x + chairPos.X, y + chairPos.Y, false);
         board.BoardItems.Chairs.Add(chair);
         instance.BindItem(chair, chairPos);
     }
     /*foreach (XNA.Point rope in ropeOffsets) //second thought: what the f**k is this even good for? rope origins aren't multilined anyway, why add them as board items?
     {
         RopeLadderAnchor ropeAnchor = new RopeLadderAnchor(board, x + rope.X, y + rope.Y, layer.LayerNumber, ladder, false);
         board.BoardItems.RopeAnchors.Add(ropeAnchor);
         instance.BindItem(ropeAnchor, rope);
     }*/
 }
Example #4
0
 public void AttachToLayer(Layer layer)
 {
     if (layer.tS != null && layer.tS != baseInfo.tS)
     {
         Board.BoardItems.TileObjs.Remove(this);
         layer.Items.Remove(this);
         throw new Exception("tile added to a layer with different tS");
     }
     else layer.tS = baseInfo.tS;
 }
Example #5
0
 public override BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding)
 {
     if (Image == null) ParseImage();
     return new LifeInstance(this, "n", board, x, y, x - UserSettings.Npcrx0Offset, x + UserSettings.Npcrx1Offset, null, 0, flip, false, null, null, beforeAdding);
 }
Example #6
0
 public override BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding)
 {
     if (Image == null) ParseImage();
     return new ReactorInstance(this, board, x, y, UserSettings.defaultReactorTime, "", flip, beforeAdding);
 }
Example #7
0
 public LayeredItem(Board board, Layer layer, int x, int y, int z, bool beforeAdding)
     : base(board, x, y, z, beforeAdding)
 {
     this.layer = layer;
     layer.Items.Add(this);
 }
Example #8
0
 public BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding, bool parseOffsets)
 {
     TileInstance instance = new TileInstance(this, layer, board, x, y, z, beforeAdding);
     if (parseOffsets) ParseOffsets(instance, board, layer, x, y);
     return instance;
 }
Example #9
0
 public LayeredItem(Board board, Layer layer, int x, int y, int z, bool beforeAdding)
     : base(board, x, y, z, beforeAdding)
 {
     this.layer = layer;
     layer.Items.Add(this);
 }
Example #10
0
 void MultiBoard_OnLayerTSChanged(Layer layer)
 {
     ribbon.SetLayer(layer);
 }
Example #11
0
 public void LayerTSChanged(Layer layer)
 {
     if (OnLayerTSChanged != null) OnLayerTSChanged.Invoke(layer);
 }
Example #12
0
 public TileInstance(TileInfo baseInfo, Layer layer, Board board, int x, int y, int z, bool beforeAdding)
     : base(board, layer, x, y, z, beforeAdding)
 {
     this.baseInfo = baseInfo;
     AttachToLayer(layer);
     //baseInfo.ParseOffsets(this, Board, Layer, X, Y);
 }
 void multiBoard_OnLayerTSChanged(Layer layer)
 {
     ribbon.SetLayer(layer);
 }
Example #14
0
 public BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, MapleBool r, MapleBool hide, MapleBool reactor, MapleBool flow, int? rx, int? ry, int? cx, int? cy, string name, string tags, List<ObjectInstanceQuest> questInfo, bool flip, bool beforeAdding, bool parseOffsets)
 {
     ObjectInstance instance = new ObjectInstance(this, layer, board, x, y, z, r, hide, reactor, flow, rx, ry, cx, cy, name, tags, questInfo, flip, beforeAdding);
     if (parseOffsets) ParseOffsets(instance, layer, board, x, y);
     return instance;
 }
Example #15
0
 private void multiBoard_OnLayerTSChanged(Layer layer)
 {
     ((ComboItem)layersComboBox.Items[layer.LayerNumber]).Text = layer.LayerNumber.ToString() + (layer.tS != null ? " - " + layer.tS : "");
 }
Example #16
0
 public void ParseOffsets(TileInstance instance, Board board, Layer layer, int x, int y)
 {
     List<FootholdAnchor> anchors = new List<FootholdAnchor>();
     foreach (XNA.Point foothold in footholdOffsets)
     {
         FootholdAnchor anchor = new FootholdAnchor(board, x + foothold.X, y + foothold.Y, layer.LayerNumber, false);
         anchors.Add(anchor);
         board.BoardItems.FHAnchors.Add(anchor);
         instance.BindItem(anchor, foothold);
     }
     for (int i = 0; i < anchors.Count - 1; i++)
     {
         FootholdLine fh = new FootholdLine(board, anchors[i], anchors[i + 1]);
         board.BoardItems.FootholdLines.Add(fh);
     }
 }
Example #17
0
 public void LayerTSChanged(Layer layer)
 {
     if (OnLayerTSChanged != null) OnLayerTSChanged.Invoke(layer);
 }
Example #18
0
 public abstract BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding);
Example #19
0
 private bool LayerCapableOfHoldingSelectedItems(Layer layer)
 {
     if (layer.tS == null) return true;
     foreach (BoardItem item in items)
         if (item is TileInstance && ((TileInfo)item.BaseInfo).tS != layer.tS) return false;
     return true;
 }
Example #20
0
 public override BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding)
 {
     switch (type)
     {
         case PortalType.PORTALTYPE_STARTPOINT:
             return new PortalInstance(this, board, x, y, beforeAdding, "sp", type, "", 999999999, null, null, null, null, null, null, null, null, null);
         case PortalType.PORTALTYPE_INVISIBLE:
         case PortalType.PORTALTYPE_VISIBLE:
         case PortalType.PORTALTYPE_COLLISION:
         case PortalType.PORTALTYPE_CHANGABLE:
         case PortalType.PORTALTYPE_CHANGABLE_INVISIBLE:
             return new PortalInstance(this, board, x, y, beforeAdding, "portal", type, "", 999999999, null, null, null, null, null, null, null, null, null);
         case PortalType.PORTALTYPE_TOWNPORTAL_POINT:
             return new PortalInstance(this, board, x, y, beforeAdding, "tp", type, "", 999999999, null, null, null, null, null, null, null, null, null);
         case PortalType.PORTALTYPE_SCRIPT:
         case PortalType.PORTALTYPE_SCRIPT_INVISIBLE:
         case PortalType.PORTALTYPE_COLLISION_SCRIPT:
             return new PortalInstance(this, board, x, y, beforeAdding, "portal", type, "", 999999999, "script", null, null, null, null, null, null, null, null);
         case PortalType.PORTALTYPE_HIDDEN:
             return new PortalInstance(this, board, x, y, beforeAdding, "portal", type, "", 999999999, null, null, null, null, null, null, "", null, null);
         case PortalType.PORTALTYPE_SCRIPT_HIDDEN:
             return new PortalInstance(this, board, x, y, beforeAdding, "portal", type, "", 999999999, "script", null, null, null, null, null, "", null, null);
         case PortalType.PORTALTYPE_COLLISION_VERTICAL_JUMP:
         case PortalType.PORTALTYPE_COLLISION_CUSTOM_IMPACT:
         case PortalType.PORTALTYPE_COLLISION_UNKNOWN_PCIG:
             return new PortalInstance(this, board, x, y, beforeAdding, "portal", type, "", 999999999, "script", null, null, null, null, null, "", null, null);
         default:
             throw new Exception("unknown pt @ CreateInstance");
     }
 }
Example #21
0
 public TileInstance(TileInfo baseInfo, Layer layer, Board board, int x, int y, int z, bool beforeAdding, string realName = "")
     : base(board, layer, x, y, z, beforeAdding)
 {
     this.baseInfo = baseInfo;
     if (realName != "") this.realName = realName;
     AttachToLayer(layer);
     //baseInfo.ParseOffsets(this, Board, Layer, X, Y);
 }
Example #22
0
 public override BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding)
 {
     return new BackgroundInstance(this, board, x, y, z, -100, -100, 0, 0, 0, 255, false, flip, beforeAdding);
 }
Example #23
0
 public void AddMapLayer(Layer layer)
 {
     lock (parent)
         mapLayers.Add(layer);
 }