Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Sorter's Distillation and Stacking Distillation for items
- Added Contemplation for escaping without the exponential growth of Consideration ([#1102](https://github.com/FallingColors/HexMod/pull/1102)) @IridescentVoid
- Added Interjection, Meditation, and Recollection for advanced pattern-list creation ([#1103](https://github.com/FallingColors/HexMod/pull/1103)) @Robotgiggle
- Added Media Reflection for checking media available to the cast ([#1235](https://github.com/FallingColors/HexMod/pull/1235)) @IridescentVoid

### Changed

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package at.petrak.hexcasting.common.casting.actions.environment

import at.petrak.hexcasting.api.casting.asActionResult
import at.petrak.hexcasting.api.casting.castables.ConstMediaAction
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.misc.MediaConstants

object OpGetMedia : ConstMediaAction {
override val argc = 0

override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
val mediaRaw = Long.MAX_VALUE - env.extractMedia(Long.MAX_VALUE, true)

return (mediaRaw.toDouble() / MediaConstants.DUST_UNIT.toDouble()).asActionResult
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import at.petrak.hexcasting.common.casting.actions.circles.OpCircleBounds;
import at.petrak.hexcasting.common.casting.actions.circles.OpImpetusDir;
import at.petrak.hexcasting.common.casting.actions.circles.OpImpetusPos;
import at.petrak.hexcasting.common.casting.actions.environment.OpGetMedia;
import at.petrak.hexcasting.common.casting.actions.escaping.*;
import at.petrak.hexcasting.common.casting.actions.eval.*;
import at.petrak.hexcasting.common.casting.actions.lists.OpEmptyList;
Expand Down Expand Up @@ -99,6 +100,8 @@ public class HexActions {
new ActionRegistryEntry(HexPattern.fromAngles("weddwaa", HexDir.EAST), OpBlockAxisRaycast.INSTANCE));
public static final ActionRegistryEntry RAYCAST_ENTITY = make("raycast/entity",
new ActionRegistryEntry(HexPattern.fromAngles("weaqa", HexDir.EAST), OpEntityRaycast.INSTANCE));
public static final ActionRegistryEntry GET_MEDIA = make("get_media",
new ActionRegistryEntry(HexPattern.fromAngles("dde", HexDir.WEST), OpGetMedia.INSTANCE));

// == spell circle getters ==

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@
raycast: "Archer's Distillation",
"raycast/axis": "Architect's Distillation",
"raycast/entity": "Scout's Distillation",
get_media: "Media Reflection",

"circle/": {
impetus_pos: "Waystone Reflection",
Expand Down Expand Up @@ -1803,6 +1804,7 @@
"raycast/entity": "Like $(l:patterns/basics#hexcasting:raycast)$(action)Archer's Distillation/$, but instead returns the $(italic)entity/$ I am looking at. Costs a negligible amount of _media.",
get_entity_height: "Transforms an entity on the stack into its height.",
get_entity_velocity: "Transforms an entity on the stack into the direction in which it's moving, with the speed of that movement as that direction's magnitude.",
get_media: "Pushes the amount of _media available to the current cast, in units of $(l:items/amethyst)$(item)Amethyst Dust/$.",
},

numbers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@
"input": "entity",
"output": "vector",
"text": "hexcasting.page.basics_pattern.get_entity_velocity"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:get_media",
"anchor": "hexcasting:get_media",
"input": "",
"output": "num",
"text": "hexcasting.page.basics_pattern.get_media"
}
]
}
Loading