hankerspace
New Member
- Joined
- Apr 4, 2014
- Messages
- 164
API released
Here is a little guide to explain how to make your custom mulligan.
Errors
Script compilation is done during Bot startup. Compilation errors are displayed in log window. If your custom mulligan is avaible, it will be avaible in 'custom mulligan" list. Else you deck contains errors. Check log window.
Documentation
Your custom mulligan MUST inheritate ICustomMulligan
The entrypoint of a custom mulligan is
. In this function, you must end mulligan on your own with TritonHS.EndMulligan();.
Your custom mulligan must be placed in CustomMulligan folder.
Only 3 functions are needed to create a custom mulligan :
Samples
Here is the default Custom mulligan sourcecode :
Good luck everyone![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
Here is a little guide to explain how to make your custom mulligan.
Errors
Script compilation is done during Bot startup. Compilation errors are displayed in log window. If your custom mulligan is avaible, it will be avaible in 'custom mulligan" list. Else you deck contains errors. Check log window.
Documentation
Your custom mulligan MUST inheritate ICustomMulligan
The entrypoint of a custom mulligan is
Code:
IEnumerator DoMulligan()
Your custom mulligan must be placed in CustomMulligan folder.
Only 3 functions are needed to create a custom mulligan :
Code:
TritonHS.EndMulligan(); // To end the mulligan and draw new cards
TritonHS.GetMulliganCards(); // Which returns a List of HSCard. This list contains the 3 (or 4) cards available for the mulligan.
TritonHS.ToggleMulliganCard(HSCard); // This function toggle the state of a mulligan card (replace it or not)
Samples
Here is the default Custom mulligan sourcecode :
Code:
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Triton.Common;
using Triton.Game;
namespace Triton.Bot
{
class DefaultMulligan : ICustomMulligan
{
private const int MaximumCost = 3;
public IEnumerator DoMulligan()
{
List<HSCard> cards = TritonHS.GetMulliganCards();
// Find mulligans cards where cost > MaxCost
foreach (HSCard c in cards.Where(c => c.Card.GetCost() > MaximumCost))
{
// Toggle this card
TritonHS.ToggleMulliganCard(c);
// Make sure we give the game time to actually click stuff.
yield return Coroutine.Sleep(1000);
}
yield return Coroutine.Sleep(2000);
TritonHS.EndMulligan();
}
}
}
Good luck everyone
![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
Last edited: