/// <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); }); }
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))))) }));
/// <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() }
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."); } } }
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))) )) }) )))); }
public static GenCtxProperty Wait(GCXF <float> frames) => new WaitProp(frames);
/// <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);
public FRV2Prop(GCXF <V2RV2> f) : base(f) { }
public CancelProp(GCXF <bool> val) : base(val) { }
public static SyncPattern SetP(GCXF <float> p, SyncPattern sp) => _AsGSR(sp, GCP.SetP(p));
public AlternateProp(GCXF <float> f) : base(f) { }
public ParametrizationProp(Parametrization p, GCXF <float>?mutater) : base(p) { this.mutater = mutater; }
public RootedVTP(GCXF <Vector2> root, ExVTP path) : this(root, Compilers.GCXU(path)) { }
public BankProp(bool toZero, GCXF <V2RV2> f) { this.toZero = toZero; this.banker = f; }
public BankProp(bool toZero, V2RV2 f) { this.toZero = toZero; this.banker = _ => f; }
public RootProp(GCXF <Vector2> root, bool doAdjust) : base(root) { this.doAdjust = doAdjust; }
public SFXProp(string[] sfx, GCXF <float>?indexer, GCXF <bool>?pred) : base(sfx) { this.indexer = indexer; this.pred = pred; }
public TargetProp(RV2ControlMethod method, GCXF <Vector2> func, bool fromSummon) : base(func) { this.method = method; this.fromSummon = fromSummon; }
/// <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));
public ColorProp(string[] colors, GCXF <float>?indexer, bool reverse) : base(colors) { this.indexer = indexer; this.reverse = reverse; }
public RootedVTP(GCXF <Vector2> root, GCXU <VTP> path) { this.root = root; this.path = path; }
public RV2IncrProp(GCXF <V2RV2> rule) : base(rule) { }
public WhileProp(GCXF <bool> f) : base(f) { }
public DelayProp(GCXF <float> f) : base(f) { }
/// <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));
public OnLaserProp(GCXF <float> f) : base(f) { }
public static AsyncPattern gEruption(GCXF <float> wait, GCXF <float> times, ExBPY angleOffset, ExBPY speed, ExBPY gravity) => Eruption(wait, times, angleOffset, speed, gravity, new GenCtxProperty[] { });
public RV2SpreadProp(GCXF <V2RV2> f) : base(f) { }
public MAngProp(GCXF <float> mutater) : base(mutater) { }
public ClipProp(GCXF <bool> val) : base(val) { }