Просмотр исходного кода

Cheat code to look at your own security and add any number of cards to hand

hooperk 3 месяцев назад
Родитель
Сommit
977c0245a7
2 измененных файлов с 37 добавлено и 1 удалено
  1. 33 1
      Assets/Scripts/Script/GManager.cs
  2. 4 0
      Assets/Scripts/Script/MainPhaseAction/CheatAction.cs

+ 33 - 1
Assets/Scripts/Script/GManager.cs

@@ -597,7 +597,12 @@ public class GManager : MonoBehaviourPun
         {
         {
             turnStateMachine.QueueMainPhaseAction(You, new CheatAction(You.PlayerID, CheatAction.Type.LoseMemory));
             turnStateMachine.QueueMainPhaseAction(You, new CheatAction(You.PlayerID, CheatAction.Type.LoseMemory));
         }
         }
-
+        
+        //Add security to hand
+        if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.H))
+        {
+            turnStateMachine.QueueMainPhaseAction(You, new CheatAction(You.PlayerID, CheatAction.Type.RemoveFromSecurity));
+        }
     }
     }
 
 
     public IEnumerator DrawCard(Player _player)
     public IEnumerator DrawCard(Player _player)
@@ -700,5 +705,32 @@ public class GManager : MonoBehaviourPun
 
 
         yield return StartCoroutine(turnStateMachine.SetMainPhase());
         yield return StartCoroutine(turnStateMachine.SetMainPhase());
     }
     }
+
+    public IEnumerator RemoveFromSecurity (Player _player)
+    {
+        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+    
+        selectCardEffect.SetUp(
+            canTargetCondition: (cardSource) => true,
+            canTargetCondition_ByPreSelecetedList: null,
+            canEndSelectCondition: null,
+            canNoSelect: () => true,
+            selectCardCoroutine: null,
+            afterSelectCardCoroutine: null,
+            message: "Select Cards to add to hand",
+            maxCount: _player.SecurityCards.Count,
+            canEndNotMax: true,
+            isShowOpponent: false,
+            mode: SelectCardEffect.Mode.AddHand,
+            root: SelectCardEffect.Root.Security,
+            customRootCardList: null,
+            canLookReverseCard: true,
+            selectPlayer: _player,
+            cardEffect: null);
+    
+        yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+
+        yield return StartCoroutine(turnStateMachine.SetMainPhase());
+    }
     #endregion
     #endregion
 }
 }

+ 4 - 0
Assets/Scripts/Script/MainPhaseAction/CheatAction.cs

@@ -12,6 +12,7 @@ public class CheatAction : MainPhaseAction
         PlaceCardInSecurityFaceup,
         PlaceCardInSecurityFaceup,
         GainMemory,
         GainMemory,
         LoseMemory,
         LoseMemory,
+        RemoveFromSecurity,
     }
     }
 
 
     Type CheatType;
     Type CheatType;
@@ -66,6 +67,9 @@ public class CheatAction : MainPhaseAction
                 case Type.LoseMemory:
                 case Type.LoseMemory:
                     gameManager.StartCoroutine(gameManager.AlterMemory(player, -1));
                     gameManager.StartCoroutine(gameManager.AlterMemory(player, -1));
                     break;
                     break;
+                case Type.RemoveFromSecurity:
+                    gameManager.StartCoroutine(gameManager.RemoveFromSecurity(player));
+                    break;
                 default:
                 default:
                     break;
                     break;
             }
             }