Beispiel #1
0
 /// <summary>
 /// Add time to summoned bullets. They will simulate the missing time and start from the specified time.
 /// </summary>
 /// <param name="frames"></param>
 /// <param name="sp"></param>
 /// <returns></returns>
 public static SyncPattern AddTime(GCXF <float> frames, SyncPattern sp)
 {
     return(sbh => {
         sbh.AddTime(frames(sbh.GCX));
         sp(sbh);
     });
 }
Beispiel #2
0
 public static AsyncPattern Eruption(GCXF <float> wait, GCXF <float> times, ExBPY angleOffset,
                                     ExBPY speed, ExBPY gravity, GenCtxProperty[] props) => _AsGCR(S(GCXU(VTPRepo.Velocity(
                                                                                                              TPr.PX(speed),
                                                                                                              TPr.PY(gravity)
                                                                                                              ))), props, GenCtxProperty.WT(wait, times), GenCtxProperty.PreLoop(new GCRule[] {
     new GCRule <float>(ExType.Float, "rv2.a", GCOperator.Assign,
                        GCXF(x => Add(angleOffset(x), RV2A(BRV2(x)))))
 }));
Beispiel #3
0
 /// <summary>
 /// `crosshair`: Create a crosshair that follows the target for a limited amount of time
 /// and saves the target's position in public data hoisting.
 /// </summary>
 public static TaskPattern Crosshair(string style, GCXF <Vector2> locator, GCXF <float> homeSec, GCXF <float> stickSec,
                                     ReflectEx.Hoist <Vector2> locSave, ExBPY indexer)
 {
     var cindexer = GCXF(indexer);
     var saver    = Async("_$CROSSHAIR_INVALID", _ => V2RV2.Zero, AsyncPatterns.GCRepeat2(
                              x => 1,
                              x => ETime.ENGINEFPS * homeSec(x),
                              GCXFRepo.RV2Zero,
                              new[] { GenCtxProperty.SaveV2((locSave, cindexer, locator)) }, new[] { AtomicPatterns.Noop() }
Beispiel #4
0
 public PowerAuraOptions(IEnumerable <PowerAuraOption> props)
 {
     foreach (var prop in props.Unroll())
     {
         if (prop is ScaleProp sp)
         {
             scale = sp.value;
         }
         else if (prop is StaticFlag)
         {
             static_ = true;
         }
         else if (prop is ColorProp cp)
         {
             color = cp.value;
         }
         else if (prop is TimeProp tp)
         {
             time = tp.value;
         }
         else if (prop is IterationsProp ip)
         {
             itrs = ip.value;
         }
         else if (prop is SFXProp sfxp)
         {
             sfx = sfxp.value;
         }
         else if (prop is LayerProp lp)
         {
             layer = lp.value.Int();
         }
         else if (prop is NextProp np)
         {
             next = new PowerAuraOptions(np.value);
         }
         else
         {
             throw new Exception($"PowerAura option {prop.GetType()} not handled.");
         }
     }
 }
Beispiel #5
0
        public static SyncPattern TreeArrow(ExBPY indexer, ExBPY n, ExBPY xStep, ExBPY yStep, GenCtxProperty[] props,
                                            GCXU <VTP> path, string treeColor, GCXF <float> treeXLen, ExBPY treeYLen, ExBPY treeXStep,
                                            ExBPY treeYStep)
        {
            var loc = V2Key;
            var dir = V2Key;

            return(_FArrow(indexer, n, xStep, yStep, props, path, null, loc, dir, Color(treeColor, _AsGSR(
                                                                                            _AsGSR(DS(HV2(loc), HV2(dir), indexer, Parametrics.PXY(rxi, ryi)),
                                                                                                   Times(treeXLen),
                                                                                                   PreLoop(new GCRule[] {
                new GCRule <float>(ExType.Float, xi, GCOperator.Assign, GCXF(
                                       x => Mul(EN1, Add(Mul(xStep(x), Decrement(n(x))), Mul(treeXStep(x), T()(x))))
                                       ))
            })
                                                                                                   ),
                                                                                            Times(GCXF(treeYLen)),
                                                                                            PreLoop(new GCRule[] {
                new GCRule <float>(ExType.Float, yi, GCOperator.Assign, GCXF(
                                       x => Mul(treeYStep(x), HNMod(treeYLen(x), T()(x)))
                                       ))
            })
                                                                                            ))));
        }
Beispiel #6
0
 public static GenCtxProperty Wait(GCXF <float> frames) => new WaitProp(frames);
Beispiel #7
0
 /// <summary>
 /// Set the max amount of time this function will execute for, in frames.
 /// </summary>
 public static GenCtxProperty For(GCXF <float> frames) => new ForTimeProp(frames);
Beispiel #8
0
 public FRV2Prop(GCXF <V2RV2> f) : base(f)
 {
 }
Beispiel #9
0
 public CancelProp(GCXF <bool> val) : base(val)
 {
 }
Beispiel #10
0
 public static SyncPattern SetP(GCXF <float> p, SyncPattern sp) => _AsGSR(sp, GCP.SetP(p));
Beispiel #11
0
 public AlternateProp(GCXF <float> f) : base(f)
 {
 }
Beispiel #12
0
 public ParametrizationProp(Parametrization p, GCXF <float>?mutater) : base(p)
 {
     this.mutater = mutater;
 }
Beispiel #13
0
 public RootedVTP(GCXF <Vector2> root, ExVTP path) : this(root, Compilers.GCXU(path))
 {
 }
Beispiel #14
0
 public BankProp(bool toZero, GCXF <V2RV2> f)
 {
     this.toZero = toZero;
     this.banker = f;
 }
Beispiel #15
0
 public BankProp(bool toZero, V2RV2 f)
 {
     this.toZero = toZero;
     this.banker = _ => f;
 }
Beispiel #16
0
 public RootProp(GCXF <Vector2> root, bool doAdjust) : base(root)
 {
     this.doAdjust = doAdjust;
 }
Beispiel #17
0
 public SFXProp(string[] sfx, GCXF <float>?indexer, GCXF <bool>?pred) : base(sfx)
 {
     this.indexer = indexer;
     this.pred    = pred;
 }
Beispiel #18
0
 public TargetProp(RV2ControlMethod method, GCXF <Vector2> func, bool fromSummon) : base(func)
 {
     this.method     = method;
     this.fromSummon = fromSummon;
 }
Beispiel #19
0
 /// <summary>
 /// Wait and times properties combined.
 /// </summary>
 /// <returns></returns>
 public static GenCtxProperty WT(GCXF <float> frames, GCXF <float> times) => new CompositeProp(Wait(frames), Times(times));
Beispiel #20
0
 public ColorProp(string[] colors, GCXF <float>?indexer, bool reverse) : base(colors)
 {
     this.indexer = indexer;
     this.reverse = reverse;
 }
Beispiel #21
0
 public RootedVTP(GCXF <Vector2> root, GCXU <VTP> path)
 {
     this.root = root;
     this.path = path;
 }
Beispiel #22
0
 public RV2IncrProp(GCXF <V2RV2> rule) : base(rule)
 {
 }
Beispiel #23
0
 public WhileProp(GCXF <bool> f) : base(f)
 {
 }
Beispiel #24
0
 public DelayProp(GCXF <float> f) : base(f)
 {
 }
Beispiel #25
0
 /// <summary>
 /// Add the Y-difference from the executing BehaviorEntity to the target to the child SyncPattern.
 /// </summary>
 /// <param name="target">Target</param>
 /// <param name="syncPattern">Child SyncPattern to modify</param>
 /// <returns></returns>
 public static SyncPattern TargetY(GCXF <Vector2> target, SyncPattern[] syncPattern) => _AsGSR(syncPattern, GenCtxProperty.Target(RV2ControlMethod.RY, target));
Beispiel #26
0
 public OnLaserProp(GCXF <float> f) : base(f)
 {
 }
Beispiel #27
0
 public static AsyncPattern gEruption(GCXF <float> wait, GCXF <float> times, ExBPY angleOffset,
                                      ExBPY speed, ExBPY gravity) => Eruption(wait, times, angleOffset, speed, gravity, new GenCtxProperty[] { });
Beispiel #28
0
 public RV2SpreadProp(GCXF <V2RV2> f) : base(f)
 {
 }
Beispiel #29
0
 public MAngProp(GCXF <float> mutater) : base(mutater)
 {
 }
Beispiel #30
0
 public ClipProp(GCXF <bool> val) : base(val)
 {
 }