Kopie PassiveCards API
Check the readme for examplepublic void testboon() { CardInfo cardInfo= new CardInfo(); cardInfo.name = "TestBoon"; cardInfo.displayedName = "TestBoon"; cardInfo.cost = 2; byte[] imgBytes3 = System.IO.File.ReadAllBytes(staticpath.Replace("boonsapi.dll", "")+ "\lands\HuntGrounds.png"); Texture2D tex3 = new Texture2D(2, 2); tex3.LoadImage(imgBytes3); cardInfo.portraitTex = Sprite.Create(tex3, new Rect(0.0f, 0.0f, tex3.width, tex3.height), new Vector2(0.5f, 0.5f), 100.0f); cardInfo.baseAttack = 0; cardInfo.baseHealth = 0; cardInfo.hideAttackAndHealth = true; cardInfo.boon = BoonData.Type.None; cardInfo.metaCategories.Add(CardMetaCategory.ChoiceNode); cardInfo.description = "This doesnt look like i made this one"; cardInfo.appearanceBehaviour.Add(CardAppearanceBehaviour.Appearance.TerrainBackground); NewCard.Add(cardInfo); boonsapi.Plugin.boonandtheirtype.Add(cardInfo, typeof(testboontriggers)); boonsapi.Plugin.boondescription.Add("When get attacked heal for attacked damage");
}
public class testboontriggers : boonsapi.Plugin.baseboontriggers
{
public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
{
if (slot.Card != null && attacker != null && attacker.OpponentCard)
{
return true;
}
return false;
}
public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker)
{
if (slot.Card != null && attacker!=null && attacker.OpponentCard)
{
slot.Card.AddTemporaryMod(new CardModificationInfo(0, attacker.Attack));
}
yield break;
}
}
