-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2c6582
commit 972a502
Showing
6 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using UnityEngine; | ||
using APIPlugin; | ||
using DiskCardGame; | ||
using HarmonyLib; | ||
|
||
namespace SigilADay | ||
{ | ||
public partial class Plugin | ||
{ | ||
private NewAbility AddSilence() | ||
{ | ||
AbilityInfo info = ScriptableObject.CreateInstance<AbilityInfo>(); | ||
info.powerLevel = 5; | ||
info.rulebookName = "Silence"; | ||
info.rulebookDescription = "Creatures opposing [creature] have all their sigils silenced."; | ||
info.metaCategories = new List<AbilityMetaCategory> {AbilityMetaCategory.Part1Rulebook, AbilityMetaCategory.Part1Modular}; | ||
|
||
List<DialogueEvent.Line> lines = new List<DialogueEvent.Line>(); | ||
DialogueEvent.Line line = new DialogueEvent.Line(); | ||
line.text = "The sigils opposing your creature are silenced!"; | ||
lines.Add(line); | ||
info.abilityLearnedDialogue = new DialogueEvent.LineSet(lines); | ||
|
||
byte[] imgBytes = System.IO.File.ReadAllBytes(Path.Combine(this.Info.Location.Replace("SigilADay.dll",""),"Artwork/ability_silence.png")); | ||
Texture2D tex = new Texture2D(2,2); | ||
tex.LoadImage(imgBytes); | ||
|
||
NewAbility ability = new NewAbility(info,typeof(Silence),tex,AbilityIdentifier.GetAbilityIdentifier(PluginGuid, info.rulebookName)); | ||
Silence.ability = ability.ability; | ||
return ability; | ||
} | ||
} | ||
|
||
public class Silence : CustomAbilityBehaviour | ||
{ | ||
public override bool RespondsToPlayFromHand() | ||
{ | ||
return true; | ||
} | ||
|
||
public override IEnumerator OnPlayFromHand() | ||
{ | ||
yield return base.PreSuccessfulTriggerSequence(); | ||
yield return base.LearnAbility(0.25f); | ||
yield break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using UnityEngine; | ||
using APIPlugin; | ||
using DiskCardGame; | ||
|
||
namespace SigilADay | ||
{ | ||
public partial class Plugin | ||
{ | ||
private NewAbility AddTransient() | ||
{ | ||
AbilityInfo info = ScriptableObject.CreateInstance<AbilityInfo>(); | ||
info.powerLevel = 3; | ||
info.rulebookName = "Transient"; | ||
info.rulebookDescription = "[creature] will return to your hand at the end of the turn."; | ||
info.metaCategories = new List<AbilityMetaCategory> {AbilityMetaCategory.Part1Rulebook, AbilityMetaCategory.Part1Modular}; | ||
|
||
List<DialogueEvent.Line> lines = new List<DialogueEvent.Line>(); | ||
DialogueEvent.Line line = new DialogueEvent.Line(); | ||
line.text = "The creature blinks back into the owner's hand at the end of their turn."; | ||
lines.Add(line); | ||
info.abilityLearnedDialogue = new DialogueEvent.LineSet(lines); | ||
|
||
byte[] imgBytes = System.IO.File.ReadAllBytes(Path.Combine(this.Info.Location.Replace("SigilADay.dll",""),"Artwork/ability_transient.png")); | ||
Texture2D tex = new Texture2D(2,2); | ||
tex.LoadImage(imgBytes); | ||
|
||
NewAbility ability = new NewAbility(info,typeof(Transient),tex,AbilityIdentifier.GetAbilityIdentifier(PluginGuid, info.rulebookName)); | ||
Transient.ability = ability.ability; | ||
return ability; | ||
} | ||
} | ||
|
||
public class Transient : DrawCreatedCard | ||
{ | ||
public override Ability Ability | ||
{ | ||
get | ||
{ | ||
return ability; | ||
} | ||
} | ||
|
||
public static Ability ability; | ||
|
||
private void Start() | ||
{ | ||
this.copy = CardLoader.Clone(base.Card.Info); | ||
} | ||
|
||
public override CardInfo CardToDraw | ||
{ | ||
get | ||
{ | ||
return CardLoader.Clone(this.copy); | ||
} | ||
} | ||
|
||
public override bool RespondsToTurnEnd(bool playerTurnEnd) | ||
{ | ||
return playerTurnEnd; | ||
} | ||
|
||
public override IEnumerator OnTurnEnd(bool playerTurnEnd) | ||
{ | ||
yield return base.PreSuccessfulTriggerSequence(); | ||
yield return base.CreateDrawnCard(); | ||
base.Card.Anim.PlayDeathAnimation(false); | ||
base.Card.UnassignFromSlot(); | ||
base.Card.StartCoroutine(base.Card.DestroyWhenStackIsClear()); | ||
base.Card.Slot = null; | ||
yield break; | ||
} | ||
|
||
private CardInfo copy; | ||
} | ||
} |