示例#1
0
 public static IEnumerator TestAutoGuideEmpty()
 {
     TestHarness.OnSOF(() => {
         TestHarness.RunBehaviorScript("Auto Empty Guide", "mokou");
         var red     = BM.TPool("gem-red/b");
         var baseLoc = V2RV2.NRot(1, 0);
         TestHarness.Check(0, () => {
             var e = BM.TPool("empty.1");
             AreEqual(4, red.Count);
             for (int ii = 0; ii < 4; ++ii)
             {
                 var sloc = (baseLoc + V2RV2.RX(2, 45 + ii * 90)).Bank();
                 var eloc = (sloc + V2RV2.RX(0.2f, 32)).Bank() + V2RV2.RY(1f + frame);
                 SBPos(ref e[ii], eloc.TrueLocation);
                 //90 is the direction of the empty bullet (from rotate @ mydir over the movement py + 1 t)
                 var rloc = eloc.BankOffset(90) + V2RV2.RX(1, 80);
                 SBPos(ref red[ii], rloc.TrueLocation);
             }
         });
     });
     while (TestHarness.Running)
     {
         yield return(null);
     }
 }
示例#2
0
 public static IEnumerator TestSummonAlong()
 {
     TestHarness.OnSOF(() => {
         TestHarness.RunBehaviorScript("SummonAlong", "mokou");
         var o         = BM.TPool("gem-red/w");
         var bo        = BM.TPool("gem-green/w");
         var br        = BM.TPool("gem-blue/w");
         var bt        = BM.TPool("gem-teal/w");
         var baseLocv2 = V2(1, 0);
         var baseLoc   = V2RV2.NRot(1, 0);
         var oloc      = baseLoc + V2RV2.RX(1, 80);
         var boloc     = baseLoc + V2RV2.RX(1, 160);
         var brloc     = baseLoc + V2RV2.RX(1, 240);
         var btloc     = baseLoc + V2RV2.RX(1, 320);
         //Verify summons are correct
         SBPos(ref o[0], oloc + V2RV2.RY(0, 30));
         SBPos(ref o[1], oloc + V2RV2.RY(1, 30));
         SBPos(ref bo[0], boloc.Bank() + V2RV2.RY(0));
         SBPos(ref bo[1], boloc.Bank() + V2RV2.RY(1));
         SBPos(ref br[0], brloc.Bank() + V2RV2.RY(0));
         SBPos(ref br[1], brloc.Bank() + V2RV2.RY(1));
         SBPos(ref bt[0], btloc.Bank() + V2RV2.RY(0));
         SBPos(ref bt[1], btloc.Bank() + V2RV2.RY(1));
         TestHarness.Check(0, () => {
             //Verify angle is correct
             SBPos(ref o[0], oloc + V2RV2.Rot(frame, 0, 30));
             SBPos(ref o[1], oloc + V2RV2.Rot(frame, 1, 30));
             SBPos(ref bo[0], (boloc.Bank() + V2RV2.RY(0)).Bank() + V2RV2.RX(frame, 30));
             SBPos(ref bo[1], (boloc.Bank() + V2RV2.RY(1)).Bank() + V2RV2.RX(frame, 30));
             var rp = (brloc.Bank() + V2RV2.RY(0)).Bank(30);
             SBPos(ref br[0], rp + V2RV2.RX(frame, (rp.TrueLocation - baseLocv2).ToDeg()));
             rp = (brloc.Bank() + V2RV2.RY(1)).Bank(30);
             SBPos(ref br[1], rp + V2RV2.RX(frame, (rp.TrueLocation - baseLocv2).ToDeg()));
             //In this case the tangent is 90 degrees from the firing direction (summonalong eq = py t)
             SBPos(ref bt[0], (btloc.Bank() + V2RV2.RY(0)).BankOffset(30) + V2RV2.RX(frame, 90));
             SBPos(ref bt[1], (btloc.Bank() + V2RV2.RY(1)).BankOffset(30) + V2RV2.RX(frame, 90));
         });
     });
     while (TestHarness.Running)
     {
         yield return(null);
     }
 }