@@ -30,7 +30,7 @@ namespace SplatoonScriptsOfficial.Duties.Dawntrail;
3030
3131public unsafe class M12S_P2_Idyllic_Dream_Tired : SplatoonScript
3232{
33- public override Metadata Metadata { get ; } = new ( 6 , "NightmareXIV, Redmoon" ) ;
33+ public override Metadata Metadata { get ; } = new ( 7 , "NightmareXIV, Redmoon" ) ;
3434 public override HashSet < uint > ? ValidTerritories { get ; } = [ 1327 ] ;
3535 int Phase = 0 ;
3636
@@ -112,19 +112,21 @@ public override void OnSetup()
112112 "{\" Name\" :\" \" ,\" type\" :1,\" radius\" :6.3,\" Donut\" :0.2,\" fillIntensity\" :0.5,\" thicc\" :5.0,\" refActorType\" :1,\" DistanceMax\" :25.199999}" ) ;
113113
114114 Controller . RegisterElementFromCode ( "FarCone1" ,
115- "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.5 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
115+ "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.15 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
116116 Controller . RegisterElementFromCode ( "FarCone2" ,
117- "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.5 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
117+ "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.15 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
118118 Controller . RegisterElementFromCode ( "NearCone1" ,
119- "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.5 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
119+ "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.15 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
120120 Controller . RegisterElementFromCode ( "NearCone2" ,
121- "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.5 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
121+ "{\" Name\" :\" \" ,\" type\" :4,\" radius\" :60.0,\" coneAngleMin\" :-15,\" coneAngleMax\" :15,\" color\" :3372155131,\" fillIntensity\" :0.15 ,\" includeRotation\" :true,\" FaceMe\" :true}" ) ;
122122
123123 Controller . RegisterElement ( "stack tether" , new Element ( 0 )
124124 {
125125 thicc = 5f ,
126126 radius = 4.5f ,
127127 tether = true ,
128+ Filled = false ,
129+ Donut = 0.5f ,
128130 } ) ;
129131 }
130132
@@ -663,29 +665,49 @@ void processStored(int num)
663665
664666 if ( Phase is 13 or 16 or 17 )
665667 {
666- var stack1Pos = Vector3 . Zero ;
667- var stack2Pos = Vector3 . Zero ;
668+ Vector3 finalPosition ;
669+ Vector3 getPosition ( string element )
668670 {
669- if ( Controller . TryGetElementByName ( $ "Stack1" , out var e ) )
670- stack1Pos = new Vector3 ( e . refX , e . refZ , e . refY ) ;
671+ var e = Controller . GetElementByName ( element ) ;
672+ return new ( e ? . refX ?? 0 , e ? . refZ ?? 0 , e ? . refY ?? 0 ) ;
671673 }
674+ List < Vector3 > stackPos = [ getPosition ( "Stack1" ) , getPosition ( "Stack2" ) ] ;
675+
676+ if ( C . StackEnumPrioHorizontal )
672677 {
673- if ( Controller . TryGetElementByName ( $ "Stack2", out var e ) )
674- stack2Pos = new Vector3 ( e . refX , e . refZ , e . refY ) ;
678+ if ( stackPos [ 0 ] . X . ApproximatelyEquals ( stackPos [ 1 ] . X , 1 ) ) //horizontally equal
679+ {
680+ //apply vertical prio
681+ stackPos = stackPos . OrderBy ( x => x . Z ) . ToList ( ) ;
682+ finalPosition = stackPos [ C . StackEnumVerticalNorth ? 0 : 1 ] ;
683+ }
684+ else
685+ {
686+ stackPos = stackPos . OrderBy ( x => x . X ) . ToList ( ) ;
687+ finalPosition = stackPos [ C . StackEnumHorizontalWest ? 0 : 1 ] ;
688+ }
675689 }
676-
677- if ( Vector2 . Distance ( stack1Pos . ToVector2 ( ) , new Vector2 ( 100f , 86f ) ) < 2 )
690+ else
678691 {
679- ( stack1Pos , stack2Pos ) = ( stack2Pos , stack1Pos ) ;
692+ if ( stackPos [ 0 ] . Z . ApproximatelyEquals ( stackPos [ 1 ] . Z , 1 ) ) //vertically equal
693+ {
694+ //apply horizontal prio
695+ stackPos = stackPos . OrderBy ( x => x . X ) . ToList ( ) ;
696+ finalPosition = stackPos [ C . StackEnumHorizontalWest ? 0 : 1 ] ;
697+ }
698+ else
699+ {
700+ stackPos = stackPos . OrderBy ( x => x . Z ) . ToList ( ) ;
701+ finalPosition = stackPos [ C . StackEnumVerticalNorth ? 0 : 1 ] ;
702+ }
680703 }
681-
704+
682705 {
683- if ( Controller . TryGetElementByName ( "stack tether" , out var e ) )
706+ if ( Controller . TryGetElementByName ( "stack tether" , out var e ) )
684707 {
685708 e . Enabled = true ;
686709 e . color = GetRainbowColor ( 1f ) . ToUint ( ) ;
687- e . SetRefPosition ( C . IsStackLeft ? stack2Pos : stack1Pos ) ;
688- e . Enabled = true ;
710+ e . SetRefPosition ( finalPosition ) ;
689711 }
690712 }
691713 }
@@ -815,24 +837,51 @@ public override unsafe void OnStartingCast(uint sourceId, PacketActorCast* packe
815837 ImGuiEx . RealtimeDragDrop < PickupOrder > PickupDrag = new ( "DePiOrd" , x => x . ToString ( ) ) ;
816838 public override void OnSettingsDraw ( )
817839 {
818- ImGui . SetNextItemWidth ( 150f ) ;
819- ImGuiEx . EnumCombo ( "My tower position, looking at boss" , ref C . TowerPosition ) ;
820- ImGuiEx . RadioButtonBool ( "West platform" , "East platform" , ref C . IsGroup1 ) ;
821- ImGuiEx . RadioButtonBool ( "Taken far is Melee" , "Taken far is Ranged" , ref C . TakenFarIsMelee ) ;
822- ImGuiEx . RadioButtonBool ( "Stack left" , "Stack right" , ref C . IsStackLeft ) ;
823- ImGuiEx . HelpMarker (
824- "After processing the tower, look at the center from the outside and decide which stack to enter (left or right)" ) ;
840+ ImGuiEx . TextWrapped ( EColor . OrangeBright , "Defaults are for tired guide with uptime defamations/stacks. Go to Registered Elements tab and change positions as you want, this script can be adapted for the most strats that are here." ) ;
825841 ImGui . Separator ( ) ;
842+ ImGuiEx . Text ( EColor . YellowBright , "Tethers:" ) ;
843+ ImGui . Indent ( ) ;
826844 ImGuiEx . Text ( $ "Defamation Pickup order, starting from North clockwise:") ;
827845 PickupDrag . Begin ( ) ;
828846 for ( int i = 0 ; i < C . Pickups . Count ; i ++ )
829847 {
830848 PickupOrder x = C . Pickups [ i ] ;
831849 PickupDrag . DrawButtonDummy ( x . ToString ( ) , C . Pickups , i ) ;
832850 ImGui . SameLine ( ) ;
833- ImGuiEx . Text ( $ "{ x } ") ;
851+ ImGuiEx . TextV ( $ "{ x } ") ;
834852 }
835853 PickupDrag . End ( ) ;
854+ ImGui . Unindent ( ) ;
855+
856+ ImGuiEx . Text ( EColor . YellowBright , "Towers:" ) ;
857+ ImGui . Indent ( ) ;
858+ ImGui . SetNextItemWidth ( 150f ) ;
859+ ImGuiEx . EnumCombo ( "My tower position, looking at boss" , ref C . TowerPosition ) ;
860+
861+ ImGuiEx . TextV ( "Platform:" ) ;
862+ ImGui . SameLine ( ) ;
863+ ImGuiEx . RadioButtonBool ( "West" , "East" , ref C . IsGroup1 , true ) ;
864+
865+ ImGuiEx . TextV ( "Taken far is:" ) ;
866+ ImGui . SameLine ( ) ;
867+ ImGuiEx . RadioButtonBool ( "Melee" , "Ranged" , ref C . TakenFarIsMelee , true ) ;
868+ ImGui . Unindent ( ) ;
869+
870+ ImGuiEx . Text ( EColor . YellowBright , $ "Reenactment stacks") ;
871+ ImGui . Indent ( ) ;
872+ ImGuiEx . TextV ( $ "When stack clones are arranged horizontally (west to east):") ;
873+ ImGui . Indent ( ) ;
874+ ImGuiEx . RadioButtonBool ( "Take west stack" , "Take east stack" , ref C . StackEnumHorizontalWest , false ) ;
875+ ImGui . Unindent ( ) ;
876+ ImGuiEx . TextV ( $ "When stack clones are arranged vertically (north to south):") ;
877+ ImGui . Indent ( ) ;
878+ ImGuiEx . RadioButtonBool ( "Take north stack" , "Take south stack" , ref C . StackEnumVerticalNorth , false ) ;
879+ ImGui . Unindent ( ) ;
880+ ImGuiEx . TextV ( $ "When stack clones are not directly horizontal or vertical to each other:") ;
881+ ImGui . Indent ( ) ;
882+ ImGuiEx . RadioButtonBool ( "Use horizontal enumeration (west to east)" , "Use vertical enumeration (north to south)" , ref C . StackEnumPrioHorizontal , false ) ;
883+ ImGui . Unindent ( ) ;
884+ ImGui . Unindent ( ) ;
836885
837886 if ( ImGui . CollapsingHeader ( "Debug" ) )
838887 {
@@ -880,6 +929,9 @@ public class Config : IEzConfig
880929 public bool TakenFarIsMelee = true ;
881930 public bool IsStackLeft = true ;
882931 public List < PickupOrder > Pickups = [ PickupOrder . Stack_1 , PickupOrder . Stack_2 , PickupOrder . Stack_3 , PickupOrder . Stack_4 , PickupOrder . Defamation_1 , PickupOrder . Defamation_2 , PickupOrder . Defamation_3 , PickupOrder . Defamation_4 ] ;
932+ public bool StackEnumPrioHorizontal = false ;
933+ public bool StackEnumVerticalNorth = true ;
934+ public bool StackEnumHorizontalWest = true ;
883935 }
884936 Config C => Controller . GetConfig < Config > ( ) ;
885937
0 commit comments