Skip to content

Commit

Permalink
day 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottWilson0903 committed Nov 8, 2021
1 parent 1f68ce9 commit afdbedb
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 12 deletions.
Binary file added Artwork/ability_poisonous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 69 additions & 11 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Plugin : BaseUnityPlugin
{
private const string PluginGuid = "cyantist.inscryption.sigiladay";
private const string PluginName = "SigilADay";
private const string PluginVersion = "1.0.0.0";
private const string PluginVersion = "1.1.0.0";

private void Awake()
{
Expand All @@ -31,6 +31,7 @@ private void Awake()
AddRegen2();
AddRegen3();
AddRegenFull();
AddPoisonous();
}

private NewAbility AddBloodGuzzler()
Expand Down Expand Up @@ -172,13 +173,36 @@ private NewAbility AddRegenFull()
return ability;
}

private NewAbility AddPoisonous()
{
AbilityInfo info = ScriptableObject.CreateInstance<AbilityInfo>();
info.powerLevel = 3;
info.rulebookName = "Poisonous";
info.rulebookDescription = "When [creature] perishes, the creature that killed it perishes as well.";
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 = "When this creature perishes, it will kill the creature that killed it.";
lines.Add(line);
info.abilityLearnedDialogue = new DialogueEvent.LineSet(lines);

byte[] imgBytes = System.IO.File.ReadAllBytes("BepInEx/plugins/CardLoader/Artwork/ability_poisonous.png");
Texture2D tex = new Texture2D(2,2);
tex.LoadImage(imgBytes);

NewAbility ability = new NewAbility(info,typeof(Poisonous),tex);
BloodGuzzler.ability = ability.ability;
return ability;
}

public class BloodGuzzler : AbilityBehaviour
{
public override Ability Ability
{
get
{
return ability;
return ability;
}
}

Expand Down Expand Up @@ -219,7 +243,7 @@ public override Ability Ability
{
get
{
return ability;
return ability;
}
}

Expand Down Expand Up @@ -251,15 +275,15 @@ public override Ability Ability
{
get
{
return ability;
return ability;
}
}

public static Ability ability;

public override bool RespondsToUpkeep(bool playerUpkeep)
{
return base.Card.OpponentCard != playerUpkeep;
return base.Card.OpponentCard != playerUpkeep;
}

public override IEnumerator OnUpkeep(bool playerUpkeep)
Expand All @@ -280,15 +304,15 @@ public override Ability Ability
{
get
{
return ability;
return ability;
}
}

public static Ability ability;

public override bool RespondsToUpkeep(bool playerUpkeep)
{
return base.Card.OpponentCard != playerUpkeep;
return base.Card.OpponentCard != playerUpkeep;
}

public override IEnumerator OnUpkeep(bool playerUpkeep)
Expand All @@ -309,15 +333,15 @@ public override Ability Ability
{
get
{
return ability;
return ability;
}
}

public static Ability ability;

public override bool RespondsToUpkeep(bool playerUpkeep)
{
return base.Card.OpponentCard != playerUpkeep;
return base.Card.OpponentCard != playerUpkeep;
}

public override IEnumerator OnUpkeep(bool playerUpkeep)
Expand All @@ -338,15 +362,15 @@ public override Ability Ability
{
get
{
return ability;
return ability;
}
}

public static Ability ability;

public override bool RespondsToUpkeep(bool playerUpkeep)
{
return base.Card.OpponentCard != playerUpkeep;
return base.Card.OpponentCard != playerUpkeep;
}

public override IEnumerator OnUpkeep(bool playerUpkeep)
Expand All @@ -357,5 +381,39 @@ public override IEnumerator OnUpkeep(bool playerUpkeep)
yield break;
}
}

public class Poisonous : AbilityBehaviour
{
public override Ability Ability
{
get
{
return ability;
}
}

public static Ability ability;

public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer)
{
return !wasSacrifice && base.Card.OnBoard;
}

public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer)
{
yield return base.PreSuccessfulTriggerSequence();
yield return new WaitForSeconds(0.25f);
if (killer != null)
{
yield return killer.Die(false, base.Card, true);
if (Singleton<BoardManager>.Instance is BoardManager3D)
{
yield return new WaitForSeconds(0.5f);
yield return base.LearnAbility(0.5f);
}
}
yield break;
}
}
}
}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SigilADay",
"version_number": "1.0.0",
"version_number": "1.1.0",
"website_url": "https://github.com/ScottWilson0903/InscryptionExampleMod",
"description": "Collection of custom sigils",
"dependencies": [
Expand Down

0 comments on commit afdbedb

Please sign in to comment.