protected override MethodResult Get() { IndexedVar player = TranslateContext.VarCollection.AssignVar(Scope, "OptimisedSphereHitbox: player", TranslateContext.IsGlobal, null); IndexedVar position = TranslateContext.VarCollection.AssignVar(Scope, "OptimisedSphereHitbox: position", TranslateContext.IsGlobal, null); Element[] actions = ArrayBuilder<Element>.Build ( player.SetVariable((Element)Parameters[0]), position.SetVariable((Element)Parameters[1]) ); Element radius = (Element)Parameters[2]; Element eyePos = Element.Part<V_EyePosition>(player.GetVariable()); Element range = Element.Part<V_DistanceBetween>(eyePos, position.GetVariable()); Element direction = Element.Part<V_FacingDirectionOf>(player.GetVariable()); Element raycast = Element.Part<V_RayCastHitPosition>(eyePos, Element.Part<V_Add>( eyePos, Element.Part<V_Multiply>(direction, range) ), new V_AllPlayers(), new V_Null(), new V_False() ); Element distance = Element.Part<V_DistanceBetween>(position.GetVariable(), raycast); Element compare = Element.Part<V_Compare>(distance, EnumData.GetEnumValue(Operators.LessThanOrEqual), radius); return new MethodResult(actions, compare); }
public string ToWorkshop() { var builder = new TabStringBuilder(true); builder.Indent = 0; // builder.AppendLine($"rule(\"{Name}\")"); // rule("this is the name of the rule!") builder.AppendLine("{"); // { builder.AppendLine(); // // builder.Indent = 1; // (indent) builder.AppendLine("event"); // event builder.AppendLine("{"); // { builder.Indent = 2; // (indent) builder.AppendLine(EnumData.GetEnumValue(RuleEvent).ToWorkshop() + ";"); // Ongoing - Each Player if (!IsGlobal) // --(only if the event is a player event) { // | builder.AppendLine(EnumData.GetEnumValue(Team).ToWorkshop() + ";"); // | Team 1 builder.AppendLine(EnumData.GetEnumValue(Player).ToWorkshop() + ";"); // | Bastion } // builder.Indent = 1; // (outdent) builder.AppendLine("}"); // } // if (Conditions?.Length > 0) // (only if there are 1 or more conditions) { // | builder.AppendLine(); // | builder.AppendLine("conditions"); // | conditions builder.AppendLine("{"); // | { builder.Indent = 2; // | (indent) foreach (var condition in Conditions) // | { builder.AppendLine(condition.ToWorkshop() + ";"); // | Number Of Players >= 3; } builder.Indent = 1; // | (outdent) builder.AppendLine("}"); // | } } // // if (Actions?.Length > 0) // (only if there are 1 or more actions) { // | builder.AppendLine(); // | builder.AppendLine("// Action count: " + Actions.Length); // | // Action count: # builder.AppendLine("actions"); // | actions builder.AppendLine("{"); // | { builder.Indent = 2; // | (indent) foreach (var action in Actions) // | { builder.AppendLine(action.ToWorkshop()); // | Set Global Variable(A, true); } builder.Indent = 1; // | (outdent) builder.AppendLine("}"); // | } } // builder.Indent = 0; // (outdent) builder.AppendLine("}"); // } return(builder.ToString()); }
protected override MethodResult Get() { Element array = Element.Part <V_SortedArray>((Element)Parameters[0], new V_ArrayElement()); Element length = Element.Part <V_CountOf>(array); Element condition = Element.Part <V_Compare>(length % 2, EnumData.GetEnumValue(Operators.Equal), new V_Number(0)); Element medianIndex = (length + 1) / 2; Element consequent = (Element.Part <V_ValueInArray>(array, medianIndex - 0.5) + Element.Part <V_ValueInArray>(array, medianIndex + 0.5)) / 2; Element alternative = Element.Part <V_ValueInArray>(array, medianIndex); return(new MethodResult(null, Element.TernaryConditional(condition, consequent, alternative, false))); }
protected override MethodResult Get() { IndexedVar player = TranslateContext.VarCollection.AssignVar(Scope, "IsAIUnintrusive: player", TranslateContext.IsGlobal, null); Element[] actions = ArrayBuilder <Element> .Build ( player.SetVariable((Element)Parameters[0]), Element.Part <A_Communicate>(player.GetVariable(), EnumData.GetEnumValue(Communication.VoiceLineUp)) ); Element result = Element.Part <V_Not>(Element.Part <V_IsCommunicating>(player.GetVariable(), EnumData.GetEnumValue(Communication.VoiceLineUp))); return(new MethodResult(actions, result)); }
protected override MethodResult Get() { IndexedVar array = IndexedVar.AssignInternalVar(TranslateContext.VarCollection, Scope, "OptimisedSortedMedian: array", TranslateContext.IsGlobal); IndexedVar medianIndex = IndexedVar.AssignInternalVar(TranslateContext.VarCollection, Scope, "OptimisedSortedMedian: medianIndex", TranslateContext.IsGlobal); Element length = Element.Part <V_CountOf>(array.GetVariable()); Element condition = Element.Part <V_Compare>(length % 2, EnumData.GetEnumValue(Operators.Equal), new V_Number(0)); Element consequent = (Element.Part <V_ValueInArray>(array.GetVariable(), medianIndex.GetVariable() - 0.5) + Element.Part <V_ValueInArray>(array.GetVariable(), medianIndex.GetVariable() + 0.5)) / 2; Element alternative = Element.Part <V_ValueInArray>(array.GetVariable(), medianIndex.GetVariable()); Element[] actions = ArrayBuilder <Element> .Build ( array.SetVariable(Element.Part <V_SortedArray>((Element)Parameters[0], new V_ArrayElement())), medianIndex.SetVariable((length + 1) / 2) ); return(new MethodResult(actions, Element.TernaryConditional(condition, consequent, alternative, false))); }
public static Element Hud( IWorkshopTree players = null, IWorkshopTree header = null, IWorkshopTree subheader = null, IWorkshopTree text = null, HudLocation location = HudLocation.Top, double?sortOrder = null, Color headerColor = Color.White, Color subheaderColor = Color.White, Color textColor = Color.White, HudTextRev reevaluation = HudTextRev.VisibleToSortOrderAndString, Spectators spectators = Spectators.DefaultVisibility) => Element.Part <A_CreateHudText>( players ?? Element.Part <V_AllPlayers>(), header ?? Element.Part <V_Null>(), subheader ?? Element.Part <V_Null>(), text ?? Element.Part <V_Null>(), EnumData.GetEnumValue(location), new V_Number(sortOrder == null ? 0 : sortOrder.Value), EnumData.GetEnumValue(headerColor), EnumData.GetEnumValue(subheaderColor), EnumData.GetEnumValue(textColor), EnumData.GetEnumValue(reevaluation), EnumData.GetEnumValue(spectators) );
protected override MethodResult Get() { Element player = (Element)Parameters[0]; Element position = (Element)Parameters[1]; Element radius = (Element)Parameters[2]; Element eyePos = Element.Part<V_EyePosition>(player); Element range = Element.Part<V_DistanceBetween>(eyePos, position); Element direction = Element.Part<V_FacingDirectionOf>(player); Element raycast = Element.Part<V_RayCastHitPosition>(eyePos, Element.Part<V_Add>( eyePos, Element.Part<V_Multiply>(direction, range) ), new V_AllPlayers(), new V_Null(), new V_False() ); Element distance = Element.Part<V_DistanceBetween>(position, raycast); Element compare = Element.Part<V_Compare>(distance, EnumData.GetEnumValue(Operators.LessThanOrEqual), radius); return new MethodResult(null, compare); }
protected override MethodResult Get() { IndexedVar player = TranslateContext.VarCollection.AssignVar(Scope, "IsAIAccurate: player", TranslateContext.IsGlobal, null); IndexedVar originalHero = TranslateContext.VarCollection.AssignVar(Scope, "IsAIAccurate: originalHero", TranslateContext.IsGlobal, null); IndexedVar isAI = TranslateContext.VarCollection.AssignVar(Scope, "IsAIAccurate: isAI", TranslateContext.IsGlobal, null); Element[] actions = ArrayBuilder <Element> .Build ( player.SetVariable((Element)Parameters[0]), originalHero.SetVariable(Element.Part <V_HeroOf>(player.GetVariable())), Element.Part <A_SkipIf>(Element.Part <V_Not>(Element.Part <V_Compare>(originalHero.GetVariable(), EnumData.GetEnumValue(Operators.Equal), new V_Null())), new V_Number(2)), isAI.SetVariable(new V_False()), Element.Part <A_Skip>(new V_Number(4)), Element.Part <A_ForcePlayerHero>(player.GetVariable(), EnumData.GetEnumValue(Hero.Ashe)), isAI.SetVariable(Element.Part <V_Compare>(Element.Part <V_HeroOf>(player.GetVariable()), EnumData.GetEnumValue(Operators.NotEqual), EnumData.GetEnumValue(Hero.Ashe))), Element.Part <A_ForcePlayerHero>(player.GetVariable(), originalHero.GetVariable()), Element.Part <A_StopForcingHero>(player.GetVariable()) ); Element result = isAI.GetVariable(); return(new MethodResult(actions, result)); }
protected override MethodResult Get() { IndexedVar array = IndexedVar.AssignInternalVar(TranslateContext.VarCollection, Scope, "OptimisedBlendedIndex: array", TranslateContext.IsGlobal); IndexedVar index = IndexedVar.AssignInternalVar(TranslateContext.VarCollection, Scope, "OptimisedBlendedIndex: index", TranslateContext.IsGlobal); Element[] actions = ArrayBuilder <Element> .Build ( array.SetVariable((Element)Parameters[0]), index.SetVariable((Element)Parameters[1]) ); Element condition = Element.Part <V_Compare>(Element.Part <V_RoundToInteger>(index.GetVariable(), EnumData.GetEnumValue(Rounding.Down)), EnumData.GetEnumValue(Operators.Equal), index.GetVariable()); Element consequent = Element.Part <V_ValueInArray>(array.GetVariable(), index.GetVariable()); Element alt1 = Element.Part <V_ValueInArray>(array.GetVariable(), Element.Part <V_RoundToInteger>(index.GetVariable(), EnumData.GetEnumValue(Rounding.Down))) * Element.Part <V_Subtract>(index.GetVariable(), Element.Part <V_RoundToInteger>(index.GetVariable(), EnumData.GetEnumValue(Rounding.Down))); Element alt2 = Element.Part <V_ValueInArray>(array.GetVariable(), Element.Part <V_RoundToInteger>(index.GetVariable(), EnumData.GetEnumValue(Rounding.Up))) * (Element.Part <V_RoundToInteger>(index.GetVariable(), EnumData.GetEnumValue(Rounding.Up)) - index.GetVariable()); Element alternative = alt1 + alt2; return(new MethodResult(actions, Element.TernaryConditional(condition, consequent, alternative, false))); }
protected override MethodResult Get() { Element array = (Element)Parameters[0]; Element index = (Element)Parameters[1]; Element condition = Element.Part <V_Compare>(Element.Part <V_RoundToInteger>(index, EnumData.GetEnumValue(Rounding.Down)), EnumData.GetEnumValue(Operators.Equal), index); Element consequent = Element.Part <V_ValueInArray>(array, index); Element alt1 = Element.Part <V_ValueInArray>(array, Element.Part <V_RoundToInteger>(index, EnumData.GetEnumValue(Rounding.Down))) * (index - Element.Part <V_RoundToInteger>(index, EnumData.GetEnumValue(Rounding.Down))); Element alt2 = Element.Part <V_ValueInArray>(array, Element.Part <V_RoundToInteger>(index, EnumData.GetEnumValue(Rounding.Up))) * (Element.Part <V_RoundToInteger>(index, EnumData.GetEnumValue(Rounding.Up)) - index); Element alternative = alt1 + alt2; return(new MethodResult(null, Element.TernaryConditional(condition, consequent, alternative, false))); }
public Condition(Element value1, Elements.Operators compareOperator, Element value2) : this(value1, EnumData.GetEnumValue(compareOperator), value2) { }
protected override MethodResult Get() { Element array = Element.Part <V_SortedArray>((Element)Parameters[0], new V_ArrayElement()); Element length = Element.Part <V_CountOf>(array); Element condition = Element.Part <V_Compare>(Element.Part <V_Modulo>(length, new V_Number(2)), EnumData.GetEnumValue(Operators.Equal), new V_Number(0)); Element medianIndex = Element.Part <V_Divide>(Element.Part <V_Add>(length, new V_Number(1)), new V_Number(2)); Element consequent = Element.Part <V_Divide>(Element.Part <V_Add>(Element.Part <V_ValueInArray>(array, Element.Part <V_Subtract>(medianIndex, new V_Number(0.5))), Element.Part <V_ValueInArray>(array, Element.Part <V_Add>(medianIndex, new V_Number(0.5)))), new V_Number(2)); Element alternative = Element.Part <V_ValueInArray>(array, medianIndex); return(new MethodResult(null, Element.TernaryConditional(condition, consequent, alternative))); }
public V_Compare(IWorkshopTree left, Operators op, IWorkshopTree right) : base(left, EnumData.GetEnumValue(op), right) { }
public V_Compare(Element left, Operators op, Element right) : base(left, EnumData.GetEnumValue(op), right) { }
protected override MethodResult Get() { IndexedVar player = TranslateContext.VarCollection.AssignVar(Scope, "SetHealth: player", TranslateContext.IsGlobal, null); IndexedVar health = TranslateContext.VarCollection.AssignVar(Scope, "SetHealth: health", TranslateContext.IsGlobal, null); Element[] actions = ArrayBuilder <Element> .Build ( player.SetVariable((Element)Parameters[0]), health.SetVariable((Element)Parameters[1]), Element.Part <A_SkipIf>(Element.Part <V_Not>(Element.Part <V_Compare>(Element.Part <V_Health>(player.GetVariable()), EnumData.GetEnumValue(Operators.LessThan), health.GetVariable())), new V_Number(2)), Element.Part <A_Heal>(player.GetVariable(), new V_Null(), Element.Part <V_Subtract>(health.GetVariable(), Element.Part <V_Health>(player.GetVariable()))), Element.Part <A_Skip>(new V_Number(2)), Element.Part <A_SkipIf>(Element.Part <V_Not>(Element.Part <V_Compare>(Element.Part <V_Health>(player.GetVariable()), EnumData.GetEnumValue(Operators.GreaterThan), health.GetVariable())), new V_Number(1)), Element.Part <A_Damage>(player.GetVariable(), new V_Null(), Element.Part <V_Subtract>(Element.Part <V_Health>(player.GetVariable()), health.GetVariable())) ); return(new MethodResult(actions, null)); }
public string ToWorkshop(OutputLanguage language, bool optimize) { var builder = new TabStringBuilder(true); builder.Indent = 0; if (Disabled) { builder.Append(LanguageInfo.Translate(language, "disabled") + " "); } builder.AppendLine($"{LanguageInfo.Translate(language, "rule")}(\"{Name}\")"); builder.AppendLine("{"); builder.AppendLine(); builder.Indent = 1; builder.AppendLine(LanguageInfo.Translate(language, "event")); builder.AppendLine("{"); builder.Indent = 2; builder.AppendLine(EnumData.GetEnumValue(RuleEvent) .ToWorkshop(language) + ";"); // Add attributes. switch (RuleType) { case RuleType.PlayerBased: // Player based attributes builder.AppendLine(EnumData.GetEnumValue(Team).ToWorkshop(language) + ";"); // Team attribute builder.AppendLine(EnumData.GetEnumValue(Player).ToWorkshop(language) + ";"); // Player attribute break; case RuleType.Subroutine: builder.AppendLine(Subroutine.ToWorkshop(language) + ";"); // Attribute name break; } builder.Indent = 1; builder.AppendLine("}"); if (Conditions?.Length > 0) { builder.AppendLine(); builder.AppendLine(LanguageInfo.Translate(language, "conditions")); builder.AppendLine("{"); builder.Indent = 2; foreach (var condition in Conditions) { builder.AppendLine(condition.ToWorkshop(language, optimize) + ";"); } builder.Indent = 1; builder.AppendLine("}"); } // Add actions. if (Actions?.Length > 0) { builder.AppendLine(); builder.AppendLine("// Action count: " + Actions.Length); // Action count comment. builder.AppendLine(LanguageInfo.Translate(language, "actions")); builder.AppendLine("{"); builder.Indent = 2; foreach (var action in Actions) { if (optimize) { builder.AppendLine(action.Optimize().ToWorkshop(language)); } else { builder.AppendLine(action.ToWorkshop(language)); } } builder.Indent = 1; builder.AppendLine("}"); } builder.Indent = 0; builder.AppendLine("}"); return(builder.ToString()); }
protected override MethodResult Get() { IndexedVar array = TranslateContext.VarCollection.AssignVar(Scope, "OptimisedSortedMedian: array", TranslateContext.IsGlobal, null); IndexedVar medianIndex = TranslateContext.VarCollection.AssignVar(Scope, "OptimisedSortedMedian: medianIndex", TranslateContext.IsGlobal, null); Element length = Element.Part <V_CountOf>(array.GetVariable()); Element condition = Element.Part <V_Compare>(Element.Part <V_Modulo>(length, new V_Number(2)), EnumData.GetEnumValue(Operators.Equal), new V_Number(0)); Element consequent = Element.Part <V_Divide>(Element.Part <V_Add>(Element.Part <V_ValueInArray>(array.GetVariable(), Element.Part <V_Subtract>(medianIndex.GetVariable(), new V_Number(0.5))), Element.Part <V_ValueInArray>(array.GetVariable(), Element.Part <V_Add>(medianIndex.GetVariable(), new V_Number(0.5)))), new V_Number(2)); Element alternative = Element.Part <V_ValueInArray>(array.GetVariable(), medianIndex.GetVariable()); Element[] actions = ArrayBuilder <Element> .Build ( array.SetVariable(Element.Part <V_SortedArray>((Element)Parameters[0], new V_ArrayElement())), medianIndex.SetVariable(Element.Part <V_Divide>(Element.Part <V_Add>(length, new V_Number(1)), new V_Number(2))) ); return(new MethodResult(actions, Element.TernaryConditional(condition, consequent, alternative))); }
public void ToWorkshop(WorkshopBuilder builder, bool optimize) { if (Disabled) { builder.AppendKeyword("disabled") .Append(" "); } builder.AppendKeyword("rule") .AppendLine("(\"" + Name + "\")") .AppendLine("{") .AppendLine() .Indent() .AppendKeywordLine("event") .AppendLine("{") .Indent() .AppendLine(EnumData.GetEnumValue(RuleEvent).ToWorkshop(builder.OutputLanguage, ToWorkshopContext.Other) + ";"); // Add attributes. switch (RuleType) { case RuleType.PlayerBased: // Player based attributes builder.AppendLine(EnumData.GetEnumValue(Team).ToWorkshop(builder.OutputLanguage, ToWorkshopContext.Other) + ";"); // Team attribute builder.AppendLine(EnumData.GetEnumValue(Player).ToWorkshop(builder.OutputLanguage, ToWorkshopContext.Other) + ";"); // Player attribute break; case RuleType.Subroutine: builder.AppendLine(Subroutine.ToWorkshop(builder.OutputLanguage, ToWorkshopContext.Other) + ";"); // Attribute name break; } builder.Unindent() .AppendLine("}"); if (Conditions?.Length > 0) { builder.AppendLine() .AppendKeywordLine("conditions") .AppendLine("{") .Indent(); foreach (var condition in Conditions) { builder.AppendLine(condition.ToWorkshop(builder.OutputLanguage, optimize) + ";"); } builder.Unindent() .AppendLine("}"); } // Add actions. if (Actions?.Length > 0) { builder.AppendLine() .AppendLine("// Action count: " + Actions.Length) // Action count comment. .AppendKeywordLine("actions") .AppendLine("{") .Indent(); foreach (var action in Actions) { if (optimize) { builder.AppendLine(action.Optimize().ToWorkshop(builder.OutputLanguage, ToWorkshopContext.Action)); } else { builder.AppendLine(action.ToWorkshop(builder.OutputLanguage, ToWorkshopContext.Action)); } } builder.Unindent() .AppendLine("}"); } builder.Unindent() .AppendLine("}"); }
static MethodResult GetMapID(bool isGlobal, VarCollection varCollection, object[] parameters) { /* * All credit to https://us.forums.blizzard.com/en/overwatch/t/workshop-resource-get-the-current-map-name-updated-1-action/ * Based off code: 5VAQA */ int mapcount = 0; for (int i = 0; i < Constants.MapChecks.Length; i++) { mapcount += Constants.MapChecks[i].Length; } V_Append prev = null; V_Append current = null; for (int s = 0; s < Constants.MapChecks.Length; s++) { for (int i = 0; i < Constants.MapChecks[s].Length; i++) { current = new V_Append() { ParameterValues = new IWorkshopTree[2] }; if (prev != null) { current.ParameterValues[0] = prev; } else { current.ParameterValues[0] = new V_EmptyArray(); } // Set the map ID current.ParameterValues[1] = new V_Number(Constants.MapChecks[s][i]); prev = current; } } return(new MethodResult(null, Element.Part <V_IndexOfArrayValue>(current, Element.Part <V_RoundToInteger>(Element.Part <V_Divide>( Element.Part <V_RoundToInteger>( Element.Part <V_Multiply>( Element.Part <V_DistanceBetween>( Element.Part <V_Vector>(new V_Number(0), new V_Number(0), new V_Number(0)), Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(100), new V_Number(100), new V_Number(100))) ), new V_Number(100) ), EnumData.GetEnumValue(Rounding.Down) ), new V_Number(4) ), EnumData.GetEnumValue(Rounding.Down)) ), CustomMethodType.Value)); }
static MethodResult GetMap(bool isGlobal, VarCollection varCollection, object[] parameters) { Var temp = varCollection.AssignVar("GetMap: temp", isGlobal); Element[] actions = new Element[] { temp.SetVariable(Element.Part <V_RoundToInteger>( Element.Part <V_Add>( Element.Part <V_DistanceBetween>( Element.Part <V_NearestWalkablePosition>( Element.Part <V_Vector>(new V_Number(-500.000), new V_Number(0), new V_Number(0)) ), Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(500), new V_Number(0), new V_Number(0))) ), Element.Part <V_DistanceBetween>( Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(0), new V_Number(0), new V_Number(-500.000))), Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(0), new V_Number(0), new V_Number(500))) ) ), EnumData.GetEnumValue(Rounding.Down) )), temp.SetVariable(Element.Part <V_IndexOfArrayValue>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(153)), new V_Number(468)), new V_Number(1196)), new V_Number(135)), new V_Number(139)), new V_Number(477)), new V_Number(184)), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(343)), new V_Number(347)), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(366) ), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(433)), new V_Number(436) ), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(403)), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(382)), new V_Number(384) ), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(993)), new V_Number(386)), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(331)), new V_Number(348) ), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(659)), new V_Number(145)), new V_Number(569)), new V_Number(384)), new V_Number(1150)), new V_Number(371)), new V_Number(179)), new V_Number(497)), new V_Number(374)), new V_Number(312)), new V_Number(324)), new V_Number(434)), new V_Number(297)), new V_Number(276)), new V_Number(330)), new V_Number(376)), new V_Number(347)), new V_Number(480)), new V_Number(310)), new V_Number(342)), new V_Number(360)), new V_Number(364)), new V_Number(372)), new V_Number(370)), new V_Number(450)), new V_Number(356)), new V_Number(305)), temp.GetVariable()) ) }; return(new MethodResult(actions, temp.GetVariable(), CustomMethodType.MultiAction_Value)); }
protected override MethodResult Get() { IndexedVar temp = TranslateContext.VarCollection.AssignVar(Scope, "GetMap: temp", TranslateContext.IsGlobal, null); Element[] actions = ArrayBuilder <Element> .Build ( temp.SetVariable(Element.Part <V_RoundToInteger>( Element.Part <V_Add>( Element.Part <V_DistanceBetween>( Element.Part <V_NearestWalkablePosition>( Element.Part <V_Vector>(new V_Number(-500.000), new V_Number(0), new V_Number(0)) ), Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(500), new V_Number(0), new V_Number(0))) ), Element.Part <V_DistanceBetween>( Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(0), new V_Number(0), new V_Number(-500.000))), Element.Part <V_NearestWalkablePosition>(Element.Part <V_Vector>(new V_Number(0), new V_Number(0), new V_Number(500))) ) ), EnumData.GetEnumValue(Rounding.Down) )), temp.SetVariable(Element.Part <V_IndexOfArrayValue>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(153)), new V_Number(468)), new V_Number(1196)), new V_Number(135)), new V_Number(139)), new V_Number(477)), new V_Number(184)), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(343)), new V_Number(347)), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(366) ), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(433)), new V_Number(436) ), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(403)), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(382)), new V_Number(384) ), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(993)), new V_Number(386)), Element.Part <V_FirstOf>( Element.Part <V_FilteredArray>( Element.Part <V_Append>( Element.Part <V_Append>(Element.Part <V_EmptyArray>(), new V_Number(331)), new V_Number(348) ), Element.Part <V_Compare>( Element.Part <V_ArrayElement>(), EnumData.GetEnumValue(Operators.Equal), temp.GetVariable() ) ) ) ), new V_Number(659)), new V_Number(145)), new V_Number(569)), new V_Number(384)), new V_Number(1150)), new V_Number(371)), new V_Number(179)), new V_Number(497)), new V_Number(374)), new V_Number(312)), new V_Number(324)), new V_Number(434)), new V_Number(297)), new V_Number(276)), new V_Number(330)), new V_Number(376)), new V_Number(347)), new V_Number(480)), new V_Number(310)), new V_Number(342)), new V_Number(360)), new V_Number(364)), new V_Number(372)), new V_Number(370)), new V_Number(450)), new V_Number(356)), new V_Number(305)), temp.GetVariable()) ) ); return(new MethodResult(actions, temp.GetVariable())); }