private void GenHWarp(AegisHiddenWarp ai) { curNpc = ai; if (ai.spanx != "0" || ai.spany != "0") { WriteNewLine("{0},{1},{2},{3}\tscript\t{4}\t{5},{6},{7},{8}", ai.MapName, ai.x, ai.y, 0, ai.name, "-1", ai.spanx, ai.spany, "{"); } else { WriteNewLine("{0},{1},{2},{3}\tscript\t{4}\t{5},{6}", ai.MapName, ai.x, ai.y, 0, ai.name, "-1", "{"); } foreach (AegisLabel al in ai.Items) { if (al.Name == "OnClick") { GenLabel(al); break; } } foreach (AegisLabel al in ai.Items) { if (al.Name == "OnClick") { continue; } GenLabel(al); } WriteNewLine("{0}\n", "}"); }
private AegisItem MatchBlock() { var ai = new AegisItem(); PushNode(ai); while (tk.Type != TokenType.Label && tk.Type != TokenType.npc && tk.Type != TokenType.trader && tk.Type != TokenType.warp && tk.Type != TokenType.putmob && tk.Type != TokenType.putboss && tk.Type != TokenType.hiddenwarp && tk.Type != TokenType.EOF) { MatchNewline(); if (tk.Type == TokenType.Return) { MatchNewline(); curNode.Items.Add(new AegisFunc { Name = "return", Items = new List <AegisItem>() }); Match(TokenType.Return); } else { AegisItem aii = MatchStmt(); if (fallback) { fallback = false; continue; } curNode.Items.Add(aii); } MatchNewline(); } ai = PopNode(); return(ai); }
public AegisItem PopNode() { AegisItem ret = curNode; curNode = sai.Pop(); return(ret); }
private void GenNpc(AegisNpc ai) { curNpc = ai; if (ai.W != "0" || ai.H != "0") { WriteNewLine("{0},{1},{2},{3}\tscript\t{4}\t{5},{6},{7},{8}", ai.Map, ai.X, ai.Y, ai.Dir, ai.Name, ai.Sprite, ai.W, ai.H, "{"); } else { WriteNewLine("{0},{1},{2},{3}\tscript\t{4}\t{5},{6}", ai.Map, ai.X, ai.Y, ai.Dir, ai.Name, ai.Sprite, "{"); } foreach (AegisItem aii in ai.Items) { if (aii.GetType() == typeof(AegisLabel)) { var al = (AegisLabel)aii; if (al.Name == "OnClick") { GenLabel(al); break; } } else { var al = (AegisUnknown)aii; GenUnk(al); } } foreach (AegisItem aii in ai.Items) { if (aii.GetType() == typeof(AegisLabel)) { var al = (AegisLabel)aii; if (al.Name == "OnClick") { continue; } GenLabel(al); } else { var al = (AegisUnknown)aii; GenUnk(al); } } WriteNewLine("{0}\n", "}"); }
private AegisItem MatchWhileBlock() { var ai = new AegisItem(); PushNode(ai); while (tk.Type != TokenType.Label && tk.Type != TokenType.npc && tk.Type != TokenType.trader && tk.Type != TokenType.warp && tk.Type != TokenType.putmob && tk.Type != TokenType.putboss && tk.Type != TokenType.hiddenwarp && tk.Type != TokenType.EOF && tk.Type != TokenType.EndWhile && tk.Type != TokenType.EOF) { AegisItem aii = MatchStmt(); if (fallback) { fallback = false; continue; } curNode.Items.Add(aii); } ai = PopNode(); return(ai); }
public void PushNode(AegisItem ai) { sai.Push(curNode); curNode = ai; }