summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-20 23:31:09 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-20 23:31:09 +0000
commitf9ca04b76b0fbee8cc8caac9fe04b6f4dd73603d (patch)
treed1eb07afeb50f9c43d80ca9031904e2f3b74f71c
parent4379723d21a161c55235f9bd69c6539e352ae21e (diff)
downloadnoctis-f9ca04b76b0fbee8cc8caac9fe04b6f4dd73603d.tar.bz2
Add charged catalyst stuff, also temporarily boost catalyst charge speed 100fold
-rw-r--r--src/main/java/net/flarn/noctis/item/ItemCatalyst.java17
-rw-r--r--src/main/java/net/flarn/noctis/knowledge/InternalKnowledgeTree.java1
-rw-r--r--src/main/java/net/flarn/noctis/refs/Names.java4
-rw-r--r--src/main/resources/assets/noctis/journal/en_GB.yaml20
4 files changed, 39 insertions, 3 deletions
diff --git a/src/main/java/net/flarn/noctis/item/ItemCatalyst.java b/src/main/java/net/flarn/noctis/item/ItemCatalyst.java
index 8a92903..0ce42ac 100644
--- a/src/main/java/net/flarn/noctis/item/ItemCatalyst.java
+++ b/src/main/java/net/flarn/noctis/item/ItemCatalyst.java
@@ -4,6 +4,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.flarn.noctis.init.ModItems;
+import net.flarn.noctis.knowledge.InternalKnowledgeTree;
import net.flarn.noctis.knowledge.KnowledgeBase;
import net.flarn.noctis.knowledge.KnowledgeItem;
import net.flarn.noctis.knowledge.KnowledgeVisibility;
@@ -103,7 +104,7 @@ public class ItemCatalyst extends ItemNoctisBase {
}
/* Charge us up a little */
if (!entityItem.worldObj.isRemote && skyAccess == SkyAccess.SKY) {
- adjustEnergy(s, 1);
+ adjustEnergy(s, 100);
}
} else {
if (!entityItem.worldObj.isRemote && skyAccess == SkyAccess.SKY) {
@@ -124,6 +125,7 @@ public class ItemCatalyst extends ItemNoctisBase {
EntityItem newItem = new EntityItem(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ,
recipe.output.copy());
entityItem.worldObj.spawnEntityInWorld(newItem);
+ adjustEnergy(s, -recipe.energy);
boolean changedsomething = knowledgeBase.setKnowledgeVisibility(recipe.requiredKnowledge.name, KnowledgeVisibility.KNOWN);
if (recipe.triggerKnowledge != null) {
changedsomething = changedsomething || recipe.triggerKnowledge.triggerKnowledge(knowledgeBase);
@@ -137,8 +139,19 @@ public class ItemCatalyst extends ItemNoctisBase {
}
}
+ } else {
+ if (!entityItem.worldObj.isRemote && getEnergy(s) >= (Numbers.MAX_CATALYST_POWER / 2)) {
+ String energyKnowledge = Names.Items.CATALYST_CHARGE_KNOWLEDGE[getCatalystType(s).getIndex()];
+ if (knowledgeBase.getKnowledgeVisibility(energyKnowledge) == KnowledgeVisibility.THEORY) {
+ knowledgeBase.setKnowledgeVisibility(energyKnowledge, KnowledgeVisibility.KNOWN);
+ KnowledgeItem.expandKnowledgeBase(knowledgeBase);
+ EntityPlayer player = PlayerHelper.getPlayerEntity(NBTHelper.getUUID(entityItem.getEntityItem(), Tags.General.OWNER));
+ if (player != null) {
+ KnowledgeHelper.sendKnowledgeBase(player, knowledgeBase);
+ }
+ }
+ }
}
-
return super.onEntityItemUpdate(entityItem);
}
diff --git a/src/main/java/net/flarn/noctis/knowledge/InternalKnowledgeTree.java b/src/main/java/net/flarn/noctis/knowledge/InternalKnowledgeTree.java
index 3736e8e..54bfc23 100644
--- a/src/main/java/net/flarn/noctis/knowledge/InternalKnowledgeTree.java
+++ b/src/main/java/net/flarn/noctis/knowledge/InternalKnowledgeTree.java
@@ -9,5 +9,6 @@ public class InternalKnowledgeTree {
KnowledgeItem LIGHT_BOUND_CATALYST = KnowledgeItem.addKnowledgeItem("noctis.catalyst.light.bound", true, KnowledgeVisibility.THEORY, LIGHT_CATALYST);
KnowledgeItem POTION_SPEED = KnowledgeItem.addKnowledgeItem("noctis.potion.speed", true, KnowledgeVisibility.THEORY, LIGHT_BOUND_CATALYST);
KnowledgeItem POTION_HEALTH = KnowledgeItem.addKnowledgeItem("noctis.potion.health", true, KnowledgeVisibility.HIDDEN, POTION_SPEED);
+ KnowledgeItem LIGHT_CATALYST_CHARGED = KnowledgeItem.addKnowledgeItem("noctis.catalyst.light.charged", true, KnowledgeVisibility.THEORY, POTION_SPEED);
}
}
diff --git a/src/main/java/net/flarn/noctis/refs/Names.java b/src/main/java/net/flarn/noctis/refs/Names.java
index e8b3b34..85398dd 100644
--- a/src/main/java/net/flarn/noctis/refs/Names.java
+++ b/src/main/java/net/flarn/noctis/refs/Names.java
@@ -11,11 +11,13 @@ public class Names {
public static final String CATALYSTS[] = new String[] { "lightCatalyst", "darkCatalyst", "mixedCatalyst" };
public static final String CATALYST_KNOWLEDGE[] = new String[] { "noctis.catalyst.light", "noctis.catalyst.dark", "noctis.catalyst.mixed" };
public static final String CATALYST_BOUND_KNOWLEDGE[] = new String[] { "noctis.catalyst.light.bound", "noctis.catalyst.dark.bound", "noctis.catalyst.mixed.bound" };
- }
+ public static final String[] CATALYST_CHARGE_KNOWLEDGE = new String[] { "noctis.catalyst.light.charged", "noctis.catalyst.dark.charged", "noctis.catalyst.mixed.charged" };
+ }
public static final class Recipes {
public static final String NOCTIS_PREFIX = "noctis:";
public static final String SPEED_POTION = NOCTIS_PREFIX + "potion.speed";
public static final String HEALTH_POTION = NOCTIS_PREFIX + "potion.health";
}
+
}
diff --git a/src/main/resources/assets/noctis/journal/en_GB.yaml b/src/main/resources/assets/noctis/journal/en_GB.yaml
index 96a06ec..cc6da4a 100644
--- a/src/main/resources/assets/noctis/journal/en_GB.yaml
+++ b/src/main/resources/assets/noctis/journal/en_GB.yaml
@@ -172,3 +172,23 @@ pagestack:
- kind: catalysedrecipe
goal: "noctis:potion.health"
+---
+
+item: noctis.catalyst.light.charged
+start: THEORY
+pagestack:
+ THEORY:
+ - kind: text
+ body: |
+ I sit with my catalyst and I wonder. I wonder because it feels like it is somehow part of me, somehow
+ tangled with my mind, with my very soul. Yet as I think over the visions granted to me these past days
+ I grow concerned. The catalyst I have wrought is truly a marvel and yet it does not feel as energetic
+ as my visions intimated it might. I must find a way to increase the power stored in my catalyst since
+ every time I use it it seems to grow a little weaker.
+ KNOWN:
+ - kind: text
+ body: |
+ Perseverance has proven the most valuable of my virtues once more. Night after night I have watched
+ my catalyst as it sat under the stars and I have learned something wonderful. It seems to grow more
+ energetic simply as it bathes in the light of the moon. I must take care however as I fear that the
+ sunlight has a less salubrious effect, seeming to drain energy from my catalyst instead.