コード例 #1
0
ファイル: SimpleLockResult.cs プロジェクト: WARP-D/Hikari
 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;
 }
コード例 #2
0
ファイル: AttackSummaryUI.cs プロジェクト: WARP-D/Hikari
 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();
 }
コード例 #3
0
 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
     });
コード例 #4
0
ファイル: PlacementKind.cs プロジェクト: WARP-D/Hikari
        public static bool IsLineClear(this PlacementKind placementKind)
        {
            switch (placementKind)
            {
            case None:
            case Mini:
            case TSpin:
                return(false);

            default:
                return(true);
            }
        }
コード例 #5
0
ファイル: PlacementKind.cs プロジェクト: WARP-D/Hikari
 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",
         _ => "..."
     });
コード例 #6
0
ファイル: LockResult.cs プロジェクト: WARP-D/Hikari
        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!" : "")}");
        }
コード例 #7
0
ファイル: PlacementKind.cs プロジェクト: WARP-D/Hikari
        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);
            }
        }
コード例 #8
0
ファイル: PlacementKind.cs プロジェクト: WARP-D/Hikari
        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);
            }
        }