public SimpleLockResult(PlacementKind placementKind, bool perfectClear, uint ren, uint attack) { this.placementKind = placementKind; b2b = placementKind.IsContinuous(); this.perfectClear = perfectClear; this.ren = ren; this.attack = attack; }
public void Show(PlacementKind kind) { sequence?.Complete(); text.text = kind.GetFullName(); sequence = DOTween.Sequence() .Append(background.DOAnchorPos(Vector2.zero, .18f)) .Insert(.1f, textTr.DOAnchorPos(Vector2.zero, .15f).SetEase(Ease.OutBack)) .Insert(.9f, textTr.DOAnchorPos(new Vector2(0, -80), .2f)) .Join(background.DOAnchorPos(new Vector2(0, -80), .2f)); sequence.Play(); }
public static uint GetGarbage(this PlacementKind placementKind) { return(placementKind switch { Clear2 => 1, Mini2 => 1, Clear3 => 2, Spin1 => 2, Clear4 => 4, Spin2 => 4, Spin3 => 6, _ => 0 });
public static bool IsLineClear(this PlacementKind placementKind) { switch (placementKind) { case None: case Mini: case TSpin: return(false); default: return(true); } }
public static string GetFullName(this PlacementKind placementKind) { return(placementKind switch { Clear1 => "Single", Clear2 => "Double", Clear3 => "Triple", Clear4 => "Quad", TSpin1 => "T-Spin Single", TSpin2 => "T-Spin Double", TSpin3 => "T-Spin Triple", Mini1 => "T-Spin Mini Single", Mini2 => "T-Spin Mini Double", _ => "..." });
public LockResult(PlacementKind placementKind, bool perfectClear, uint ren, List <int> clearedLines, bool prevB2B) { this.placementKind = placementKind; b2b = placementKind.IsLineClear() ? placementKind.IsContinuous() : prevB2B; this.perfectClear = perfectClear; this.ren = ren; var b2bBonus = prevB2B && b2b && placementKind.IsLineClear(); attack = (uint)((perfectClear ? 10 : placementKind.GetGarbage()) + (b2bBonus ? 1 : 0) + Game.GetRenAttack(ren)); this.clearedLines = clearedLines; // Debug.Log($"{placementKind.ToString()} {(b2bBonus ? " B2B" : "")} Combo{ren} {(perfectClear ? " Clear!" : "")}"); }
public static bool IsContinuous(this PlacementKind placementKind) { switch (placementKind) { case Mini: case Mini1: case Mini2: case TSpin: case TSpin1: case TSpin2: case TSpin3: case Clear4: return(true); default: return(false); } }
public static uint GetGarbage(this PlacementKind placementKind) { switch (placementKind) { case Clear2: case Mini2: return(1); case Clear3: case TSpin1: return(2); case Clear4: case TSpin2: return(4); case TSpin3: return(6); default: return(0); } }