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
127 changes: 71 additions & 56 deletions CHANGELOG.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entries should be past tense; also, we recently switched to a new changelog format, which doesn't seem to be present here for some reason

Large diffs are not rendered by default.

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

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

class OpTypeEquality(val invert: Boolean) : ConstMediaAction {
override val argc = 2

override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
val lhs = args[0]
val rhs = args[1]

return ((lhs.type == rhs.type) != invert).asActionResult
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import at.petrak.hexcasting.common.casting.actions.math.logic.OpBoolIf;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpCoerceToBool;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpEquality;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpTypeEquality;
import at.petrak.hexcasting.common.casting.actions.queryentity.*;
import at.petrak.hexcasting.common.casting.actions.raycast.OpBlockAxisRaycast;
import at.petrak.hexcasting.common.casting.actions.raycast.OpBlockRaycast;
Expand Down Expand Up @@ -190,6 +191,10 @@ public class HexActions {
new ActionRegistryEntry(HexPattern.fromAngles("ad", HexDir.EAST), new OpEquality(false)));
public static final ActionRegistryEntry NOT_EQUALS = make("not_equals",
new ActionRegistryEntry(HexPattern.fromAngles("da", HexDir.EAST), new OpEquality(true)));
public static final ActionRegistryEntry TYPE_EQUALS = make("type_equals",
new ActionRegistryEntry(HexPattern.fromAngles("wawdw", HexDir.EAST), new OpTypeEquality(false)));
public static final ActionRegistryEntry TYPE_NOT_EQUALS = make("type_not_equals",
new ActionRegistryEntry(HexPattern.fromAngles("wdwaw", HexDir.EAST), new OpTypeEquality(true)));
public static final ActionRegistryEntry BOOL_COERCE = make("bool_coerce",
new ActionRegistryEntry(HexPattern.fromAngles("aw", HexDir.NORTH_EAST), OpCoerceToBool.INSTANCE));
public static final ActionRegistryEntry IF = make("if",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public static void register() {
HexAPI.instance().registerSpecialVelocityGetter(EntityType.SPECTRAL_ARROW, RegisterMisc::arrowVelocitizer);
// this is an arrow apparently
HexAPI.instance().registerSpecialVelocityGetter(EntityType.TRIDENT, RegisterMisc::arrowVelocitizer);
HexAPI.instance().registerSpecialVelocityGetter(EntityType.ITEM, item -> {
// Items only tick movement every four ticks if stationary and on ground, but gravity is added every tick
// and only cleared by movement logic every four ticks
if (item.onGround() && item.getDeltaMovement().horizontalDistanceSqr() <= 1.0E-5F) return Vec3.ZERO;
return item.getDeltaMovement();
});

HexAPI.instance().registerCustomBrainsweepingBehavior(EntityType.VILLAGER, villager -> {
((AccessorVillager) villager).hex$releaseAllPois();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,33 @@

public class PatternProcessor implements IComponentProcessor {
private String translationKey;
private boolean hasArgs = false;

@Override
public void setup(Level level, IVariableProvider vars) {
if (vars.has("header"))
if (vars.has("header")) {
translationKey = vars.get("header", level.registryAccess()).asString();
else {
} else {
IVariable key = vars.get("op_id", level.registryAccess());
String opName = key.asString();

String prefix = "hexcasting.action.";
boolean hasOverride = I18n.exists(prefix + "book." + opName);
translationKey = prefix + (hasOverride ? "book." : "") + opName;

if (vars.has("input") && !vars.get("input", level.registryAccess()).asString().isEmpty())
hasArgs = true;
else if (vars.has("output") && !vars.get("output", level.registryAccess()).asString().isEmpty())
hasArgs = true;
}
}

@Override
public IVariable process(Level level, String key) {
if (key.equals("translation_key")) {
return IVariable.wrap(translationKey, level.registryAccess());
} else if (key.equals("has_signature")) {
return IVariable.wrap(hasArgs, level.registryAccess());
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,8 @@
less_eq: "Minimus Distillation II",
equals: "Equality Distillation",
not_equals: "Inequality Distillation",
type_equals: "Similarity Distillation",
type_not_equals: "Dissimilarity Distillation",
not: "Negation Purification",
bool_coerce: "Augur's Purification",
if: "Augur's Exaltation",
Expand Down Expand Up @@ -1723,7 +1725,7 @@

empty_directrix: "Firstly, a design for the cradle ... although, perhaps \"substrate\" would be more accurate a word. Without a mind guiding it, the output direction is determined by microscopic fluctuations in the _media wave and surroundings, making it effectively random.",
directrix_redstone: "A $(l:greatwork/directrix)$(item)Mason Directrix/$ switches output side based on a redstone signal. Without a signal, the exit is the _media-color side; with a signal, the exit is the redstone-color side.",
directrix_boolean: "A $(l:greatwork/directrix)$(item)Shepherd Directrix/$ switches output side based on a boolean on the stack. A $(thing)True/$ makes the wave exit from the back, a $(thing)False/$ from the front. Failing to provide a boolean at all will cause a mishap."
directrix_boolean: "A $(l:greatwork/directrix)$(item)Shepherd Directrix/$ switches output side based on a boolean popped from the stack. A $(thing)True/$ makes the wave exit from the back, a $(thing)False/$ from the front. Failing to provide a boolean at all will cause a mishap."
},

akashiclib: {
Expand Down Expand Up @@ -1906,6 +1908,8 @@
if: "If the first argument is True, keeps the second and discards the third; otherwise discards the second and keeps the third.",
equals: "If the first argument equals the second (within a small tolerance), return True. Otherwise, return False.",
not_equals: "If the first argument does not equal the second (outside a small tolerance), return True. Otherwise, return False.",
type_equals: "If the type of the first argument matches the type of the second, return True. Otherwise, return False.",
type_not_equals: "If the type of the first argument does not match the type of the second, return True. Otherwise, return False.",
greater: "If the first argument is greater than the second, return True. Otherwise, return False.",
less: "If the first argument is less than the second, return True. Otherwise, return False.",
greater_eq: "If the first argument is greater than or equal to the second, return True. Otherwise, return False.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,12 @@
"": "法术环禁用操作列表",
"@Tooltip": "法术环中被禁用操作的资源位置;试图执行此类操作会导致事故。例如,“hexcasting:get_caster”会禁用意识之精思。",
},
globalCostScaling: {
"": "全局消耗倍数",
"@Tooltip": "除去#hexcasting:cannot_modify_cost标签下的操作,其余操作的媒质消耗均会乘以该数。若希望调整该标签下操作的消耗,请使用“操作消耗倍数”配置。",
},
costRescaleListRaw: {
"": "消耗倍数",
"": "操作消耗倍数",
"@Tooltip": "资源位置与对应操作媒质消耗倍数的映射。例如,“hexcasting:add_motion 3”会让驱动的消耗变为3倍。",
},
greaterTeleportSplatsItems: {
Expand Down Expand Up @@ -920,6 +924,11 @@
"teleport/great": "卓越传送",
brainsweep: "剥离意识",

escape: "考察",
open_paren: "内省",
close_paren: "反思",
undo: "消解",

eval: "赫尔墨斯之策略",
"eval/cc": "伊里斯之策略",
for_each: "托特之策略",
Expand Down Expand Up @@ -991,13 +1000,6 @@
mask: "簿记员之策略:%s",
},

"rawhook.hexcasting:": {
open_paren: "内省",
close_paren: "反思",
escape: "考察",
undo: "消解",
},

"iota.hexcasting:": {
"null": {
"": "Null",
Expand Down Expand Up @@ -1046,7 +1048,7 @@

not_enough_args: "本应接受大于等于%s个参数,而实际栈高度为%s",
no_args: "本应接受大于等于%s个参数,而实际为空栈",
too_many_close_parens: "在绘制反思前未先绘制内省",
needs_parens: "在绘制反思前未先绘制内省",

wrong_dimension: "无法在%2$s中影响到%1$s",
entity_too_far: "%s超出影响范围",
Expand Down Expand Up @@ -1513,8 +1515,8 @@
"incorrect_block.title": "方块错误",
incorrect_block: "该操作需在目标位置存在某种方块,而该位置实际存在的方块不合适。$(br2)产生亮绿色火花,并在对应位置产生一次爆炸。这种爆炸似乎不会伤害到我、世界或是任何其他事物。就是挺吓人的。",

"retrospection.title": "反思过急",
retrospection: "试图在绘制$(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)内省/$前绘制$(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)反思/$。$(br2)产生橙色火花,并压入一个$(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)反思/$对应的图案。",
"needs_parens.title": "内省缺失",
needs_parens: "试图在绘制$(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)内省/$前绘制$(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)反思/$或$(l:patterns/patterns_as_iotas#hexcasting:undo)$(action)消解/$。$(br2)产生橙色火花,并将我试图绘制的图案作为 iota 压栈。",

"too_many_patterns.title": "陷入沉思",
too_many_patterns: "试图在单个$(hex)咒术/$内运行过多图案,通常是因为不小心制造了死循环。$(br2)产生暗蓝色火花,并使我窒息。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@
"output": "bool",
"text": "hexcasting.page.logic.not_equals"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:type_equals",
"anchor": "hexcasting:type_equals",
"input": "any, any",
"output": "bool",
"text": "hexcasting.page.logic.type_equals"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:type_not_equals",
"anchor": "hexcasting:type_not_equals",
"input": "any, any",
"output": "bool",
"text": "hexcasting.page.logic.type_not_equals"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:greater",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@
{
"type": "patchouli:text",
"text": "$(n)#input#/$ \u2192 $(n)#output#/$",
"guard": "#has_signature#",
"y": 80
},
{
"type": "patchouli:text",
"text": "#text#",
"guard": "#has_signature->inv#",
"y": 80
},
{
"type": "patchouli:text",
"text": "#text#",
"guard": "#has_signature#",
"y": 89
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@
{
"type": "patchouli:text",
"text": "$(n)#input#/$ \u2192 $(n)#output#/$",
"guard": "#has_signature#",
"y": 80
},
{
"type": "patchouli:text",
"text": "#text#",
"guard": "#has_signature->inv#",
"y": 80
},
{
"type": "patchouli:text",
"text": "#text#",
"guard": "#has_signature#",
"y": 89
}
]
Expand Down
Loading