88
99namespace InscryptionCommunityPatch . Tests ;
1010
11+ /// <summary>
12+ /// This function defines our Testing Cost.
13+ /// </summary>
1114public class TestCost : CustomCardCost
1215{
16+ /// <summary>
17+ /// The Name of the Custom Cost.
18+ /// </summary>
1319 public override string CostName => "TestCost" ;
20+ /// <summary>
21+ /// This function initializes our Test Cost.
22+ /// </summary>
1423 public static void Init ( )
1524 {
1625 PatchPlugin . Logger . LogDebug ( "Adding TestCost" ) ;
@@ -21,24 +30,60 @@ public static void Init()
2130 . SetFoundAtChoiceNodes ( true , TextureHelper . GetImageAsTexture ( "testCost.png" , typeof ( TestCost ) . Assembly ) ) ;
2231 }
2332
33+ /// <summary>
34+ /// This defines the Cost Tier associated with the Amount of the Cost.
35+ /// </summary>
36+ /// <param name="amount">The amount of the Test Cost.</param>
37+ /// <returns>A <see cref="Mathf.Floor"/> of <c>amount/2</c>.</returns>
2438 public static int CostTier ( int amount )
2539 {
2640 return Mathf . FloorToInt ( amount / 2f ) ;
2741 }
42+
43+ /// <summary>
44+ /// A bool determining whether a <see cref="CardInfo"/> can be played with the current amount of the cost.
45+ /// </summary>
46+ /// <param name="amount">The Amount of a Cost the Player currently has.</param>
47+ /// <param name="card">The Card the Player is trying to play.</param>
48+ /// <param name="hand">The Player's current Hand.</param>
49+ /// <returns>True if the Amount of the Cost is <c><= 2</c>.</returns>
2850 public static bool CanBePlayed ( int amount , CardInfo card , List < CardInfo > hand )
2951 {
3052 return amount <= 2 ;
3153 }
54+
55+ /// <summary>
56+ /// A Function used to get the Cost's Texture within 3D Act's.
57+ /// </summary>
58+ /// <param name="cardCost">The Cost Amount of the Card.</param>
59+ /// <param name="cardInfo">The <see cref="CardInfo"/> of the Card.</param>
60+ /// <param name="playableCard">The <see cref="PlayableCard"/> variant of the Card.</param>
61+ /// <returns>A <see cref="ReverseColours"/> application of the 3D Act Variant EnergyCost associated with the passed in Cost Amount.</returns>
3262 public static Texture2D Texture3D ( int cardCost , CardInfo cardInfo , PlayableCard playableCard )
3363 {
3464 Texture2D tex = TextureHelper . GetImageAsTexture ( $ "energy_cost_{ Mathf . Min ( 7 , cardCost ) } .png", typeof ( PatchPlugin ) . Assembly ) ;
3565 return ReverseColours ( tex ) ;
3666 }
67+
68+ /// <summary>
69+ /// A Function used to get the Cost's Texture within 2D Act's.
70+ /// </summary>
71+ /// <param name="cardCost">The Cost Amount of the Card.</param>
72+ /// <param name="info">The <see cref="CardInfo"/> of the Card.</param>
73+ /// <param name="playableCard">The <see cref="PlayableCard"/> variant of the Card.</param>
74+ /// <returns>A <see cref="ReverseColours"/> application of the 2D Act Variant EnergyCost associated with the passed in Cost Amount.</returns>
75+ /// <returns></returns>
3776 public static Texture2D TexturePixel ( int cardCost , CardInfo info , PlayableCard playableCard )
3877 {
3978 Texture2D tex = Part2CardCostRender . CombineIconAndCount ( cardCost , TextureHelper . GetImageAsTexture ( $ "pixel_energy.png", typeof ( PatchPlugin ) . Assembly ) ) ;
4079 return ReverseColours ( tex ) ;
4180 }
81+
82+ /// <summary>
83+ /// A function used to Reverse the Colours of a Sprite.
84+ /// </summary>
85+ /// <param name="texToReverse">The Texture in which to reverse the Colours of.</param>
86+ /// <returns>A Colour Reversed version of the Passed Texture.</returns>
4287 private static Texture2D ReverseColours ( Texture2D texToReverse )
4388 {
4489 for ( int x = 0 ; x < texToReverse . width ; x ++ )
@@ -57,16 +102,34 @@ private static Texture2D ReverseColours(Texture2D texToReverse)
57102 return texToReverse ;
58103 }
59104
105+ /// <summary>
106+ /// A Bool determining whether the Card's Cost was satisfied or not.
107+ /// </summary>
108+ /// <param name="cardCost">The Card's Cost.</param>
109+ /// <param name="card">The Card in which is attempting to be played.</param>
110+ /// <returns>True if the Cost was satisified and false otherwise.</returns>
60111 public override bool CostSatisfied ( int cardCost , PlayableCard card )
61112 {
62113 return cardCost <= ( Singleton < ResourcesManager > . Instance . PlayerEnergy - card . EnergyCost ) ;
63114 }
64-
115+
116+ /// <summary>
117+ /// The Hint said when the Cost was not Satisfied.
118+ /// </summary>
119+ /// <param name="cardCost">The Card's Cost.</param>
120+ /// <param name="card">The Card in which is attempting to be played.</param>
121+ /// <returns>The String of the Hint to be said when the Card's Cost is not Satisfied.</returns>
65122 public override string CostUnsatisfiedHint ( int cardCost , PlayableCard card )
66123 {
67124 return "Eat your greens aby. " + card . Info . DisplayedNameLocalized ;
68125 }
69126
127+ /// <summary>
128+ /// Depletes the Card's Cost from our Custom Cost's Cost Pool.
129+ /// </summary>
130+ /// <param name="cardCost">The Card's Cost</param>
131+ /// <param name="card">The Card in which is attempting to be played.</param>
132+ /// <returns>The Card's Cost depleted from the Custom Cost's pool.</returns>
70133 public override IEnumerator OnPlayed ( int cardCost , PlayableCard card )
71134 {
72135 if ( cardCost > 0 )
0 commit comments