-
Notifications
You must be signed in to change notification settings - Fork 5
effectPreview
A library providing functionality to preview charge, leap, teleport, move, and damage to some extent in skill effects.
All the methods (except addHiddenLeap) does not apply what they preview, which can be useful to add in preview that is lost when applying the actual effects in scripts where previews are lost.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the preview to |
spaceDamage |
SpaceDamage | the damage object to preview |
Adds a damage preview with the specified spaceDamage, to the specified effect. This method is quite limited, and cannot preview everything you can add to a SpaceDamage object.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the preview to |
p1 |
Point | the start of the charge preview |
p2 |
Point | the end of the charge preview |
pathing |
number | (optional) the pathing for the charge - defaults to PATH_FLYER |
Adds a charge preview from p1 to p2, to the specified effect.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the preview to |
p1 |
Point | the start of the leap preview |
p2 |
Point | the end of the leap preview |
Adds a leap preview from p1 to p2, to the specified effect.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the preview to |
p1 |
Point | the start of the teleport preview |
p2 |
Point | the end of the teleport preview |
Adds a teleport preview from p1 to p2, to the specified effect.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the preview to |
pawn |
BoardPawn | the pawn we want to preview moving |
p2 |
Point | the end of the move preview |
Adds a move preview from the specified pawn's to p2, to the specified effect.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the leap to |
p1 |
Point | the start of the leap |
p2 |
Point | the end of the leap |
delay |
number | whether the skill should wait until the leap is done or not, before proceding to the next skill effect entry - FULL_DELAY or NO_DELAY |
(outlier from the remaining methods) Adds a leap from p1 to p2 to the specified effect, where the leap preview will be hidden.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the action to |
tile |
Point | the tile we want cleared of pawns |
Moves every pawn from the specified tile to Point(-1,-1), and stores the action. Using rewindTile, reverts the pawns back to the tile again.
Mostly an internal method, but it has its uses on its own as well. It can be used if pawns need to be temporarily moved away for any reason.
NOTE: Each call to this method or filterTile will reset the memory of which pawns has previously been moved. It should always be used paired with rewindTile, and any additions to the skill effect in between the clearTile and rewindTile should always use NO_DELAY to ensure everything happens on the very same update frame.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the action to |
tile |
Point | the tile we want cleared of pawns |
id |
number | the id of a pawn that will remain on the tile |
Moves every pawn from the specified tile to Point(-1,-1) except the pawn with the specified id, and stores the action. Using rewindTile, reverts the pawns back to the tile again.
Mostly an internal method, but it has its uses on its own as well. It can be used if pawns need to be temporarily moved away for any reason.
NOTE: Each call to this method or clearTile will reset the memory of which pawns has previously been moved. It should always be used paired with rewindTile, and any additions to the skill effect in between the filterTile and rewindTile should always use NO_DELAY to ensure everything happens on the very same update frame.
| Argument name | Type | Description |
|---|---|---|
self |
table | the effectPreview library itself |
effect |
SkillEffect | the effect to add the action to |
tile |
Point | the tile we want cleared of pawns |
Moves every temporary displaced pawn due to clearTile or filterTile to the specified tile
Mostly an internal method, but it has its uses on its own as well. It can be used if pawns need to be temporarily moved away for any reason.