Warp 研究
[!INFO] 实现类:
shukaro.warptheory.research.WarpResearch加载:WarpTheory.postInit()调用WarpResearch.init()条目数:9(7 个WTResearchItem+ 2 个FakeResearch)
2 个伪研究(FakeResearch)
FakeResearch 不是真正的研究页,而是把本模组物品
映射到 Thaumcraft 已有研究 上的壳:
FakeResearch.newFake("FAKESOAP", "SANESOAP", "ALCHEMY", 0, 0).registerResearchItem();
FakeResearch.newFake("FAKEELDMAJOR", "ELDRITCHMAJOR", "ELDRITCH", 0, -3).registerResearchItem();
| 伪键 | 映射到 | 分类 | 行列 |
|---|---|---|---|
FAKESOAP |
SANESOAP(理智肥皂) |
ALCHEMY |
0, 0 |
FAKEELDMAJOR |
ELDRITCHMAJOR(初级魔幻理论) |
ELDRITCH |
0, -3 |
FAKEELDMAJOR 位于 ELDRITCH 分类的第 -3 行(在
ELDRITCHMAJOR 之上),使次级净化器的研究能挂在既有理论之下。
这两个伪键被用作其它研究的前置(setParents):
FAKESOAP 是 ITEM_SOMETHING 与 ITEM_LITMUS 的前置;
FAKEELDMAJOR 是 ITEM_WARPCLEANSERMINOR 的前置之一。
7 个 WTResearchItem
WTResearchItem 继承 Thaumcraft 的 ResearchItem,构造参数为
(键, AspectList, 行, 列, 复杂度, 产物 ItemStack)。
| # | 研究键 | 要素 | 行列 | 复杂度 | 产物 | 状态标记 |
|---|---|---|---|---|---|---|
| 1 | ITEM_WARPCLEANSERMINOR |
ELDRITCH3 + EXCHANGE1 |
-1, -2 | 2 | itemCleanserMinor |
setHidden() |
| 2 | ITEM_WARPCLEANSER |
见下 | — | — | itemCleanser |
setConcealed() |
| 3 | ITEM_PURE_TALISMAN |
— | — | — | itemAmulet |
setConcealed() |
| 4 | ITEM_PORTABLE_SHOWER |
— | — | — | itemWarpWardAmulet |
setConcealed() |
| 5 | ITEM_SOMETHING |
ELDRITCH3 |
2, 0 | 1 | itemSomething |
setSecondary() |
| 6 | ITEM_LITMUS |
ELDRITCH3 + MAGIC3 |
-2, 0 | 2 | itemPaper |
setConcealed() |
| 7 | ITEM_POTION |
MIND3 + HEAL3 |
-2, -1 | 0 | itemOblivionPotion |
setAutoUnlock() + setSpecial() |
⚠️ 7 个 WTResearchItem 对应 7 件物品中的 7 件 ——
虚空方块 与 2 个未注册 FX 实体无研究。
Thaumcraft 研究状态标志
| 标志 | 含义 | 出现在 |
|---|---|---|
setHidden() |
默认隐藏,靠触发器显示 | 净化器(次级) |
setConcealed() |
默认隐藏,需前置完成 | 净化器(完全)、两个护符、石蕊试纸 |
setSecondary() |
次级研究(副页面) | 「某物」 |
setAutoUnlock() |
自动解锁(无需研究) | 遗忘药水 |
setSpecial() |
标记为特殊研究 | 遗忘药水 |
即 7 件物品中 5 件默认隐藏、1 件自动解锁, 只有「某物」需要正常研究。
触发方式
| 方式 | 方法 | 出现在 |
|---|---|---|
| 物品触发 | setItemTriggers(ItemApi.getItem("itemSanitySoap", 0)) |
净化器(次级) |
| 要素触发 | setAspectTriggers(...) |
「某物」、石蕊试纸 |
ITEM_SOMETHING 的要素触发为
Aspect.ELDRITCH, Aspect.FLESH, Aspect.EXCHANGE,
ITEM_LITMUS 为 Aspect.ELDRITCH, Aspect.MAGIC, Aspect.SENSES。
ITEM_SOMETHING 的动态研究页
「某物」是唯一页数随材料变化的条目:
int i = 1;
for (ItemStack meat : WarpRecipes.meats) {
somethingPages[i] = (new ResearchPage((CrucibleRecipe) recipes.get("WarpChunk" + meat)));
i++;
}
i 从 1 开始(跳过索引 0),4 种肉生成 4 页,
故该研究共 5 页(1 页文本 + 4 页坩埚配方)。
meats 列表由 WarpRecipes.initMeats() 填充,见
Warp 配方。
「某物」的双重曲曲注入
new WTResearchItem(…).setAspectTriggers(…).registerResearchItem();
ThaumcraftApi.addWarpToResearch(Constants.ITEM_SOMETHING, 2);
研究侧 addWarpToResearch(…, 2) 加 2 点曲曲,
而配方侧 addWarpToItem(…, 1) 加 1 点 ——
刻意的不对称,同一物品两条路径曲曲值不同。
研究页文本键
| 页 | 语言键 |
|---|---|
| 净化器(次级) | research.warptheory.warpcleanserminor |
| 石蕊试纸 | research.warptheory.paper |
| 遗忘药水 | research.warptheory.oblivionpotion.1 / .2 |
FakeResearch 的背景贴图用 Thaumcraft 自带资源:
textures/gui/gui_researchbackeldritch.png。
配方挂载
研究页通过 WarpResearch.recipes(HashMap<String, Object>)
取配方对象强转后包成 ResearchPage:
| 研究 | 取的键 | 强转类型 |
|---|---|---|
| 净化器(次级) | PureTearMinor |
InfusionRecipe |
| 净化器(完全) | PureTear |
InfusionRecipe |
| 纯净护符 | PureAmulet |
InfusionRecipe |
| 曲曲护符 | WarpWardAmulet |
InfusionRecipe |
| 「某物」 | WarpChunk<meat> × 4 |
CrucibleRecipe |
| 石蕊试纸 | Litmus |
ShapelessArcaneRecipe |
| 遗忘药水 | Potion |
ShapedArcaneRecipe |
分类
本模组定义了自己的研究分类常量:
public static final String CATEGORY_WARPTHEORY = "WT_Category";
⚠️ 该常量在本仓未被 WarpResearch 使用(7 个 WTResearchItem
用的是物品键作为研究键),
但它是 7 件物品在书中的归属分类。