This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
23 changed files
with
623 additions
and
296 deletions.
There are no files selected for viewing
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,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UnityEngine; | ||
|
||
namespace RogueLibsCore.Test | ||
{ | ||
public class GiantAbility : CustomAbility, IDoUpdate | ||
{ | ||
public static void Test() | ||
{ | ||
RogueLibs.CreateCustomAbility<GiantAbility>() | ||
.WithName(new CustomNameInfo("Giant")) | ||
.WithDescription(new CustomNameInfo("Transform into a giant and crush your enemies!")) | ||
.WithSprite(Properties.Resources.Batteries) | ||
.WithUnlock(new AbilityUnlock { UnlockCost = 15, CharacterCreationCost = 10, }); | ||
} | ||
|
||
public override void SetupDetails() { } | ||
public override string GetCountString() => recharge != 0f ? recharge.ToString() : base.GetCountString(); | ||
|
||
public override void OnAdded() { } | ||
public override void OnHeld(OnAbilityHeldArgs e) { } | ||
public override void OnReleased(OnAbilityReleasedArgs e) { } | ||
public override void OnUpdated(OnAbilityUpdatedArgs e) { } | ||
public override PlayfieldObject FindTarget() => null; | ||
|
||
private float recharge; | ||
public void Update() => recharge = Mathf.Max(recharge - Time.deltaTime, 0f); | ||
|
||
public override void OnPressed() | ||
{ | ||
if (recharge > 0f) return; | ||
|
||
Owner.statusEffects.AddStatusEffect("Giant", 15); | ||
Owner.statusEffects.AddStatusEffect("Enraged", 15); | ||
|
||
recharge = 30f; | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.