Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
makeo committed 2015-10-31 01:03:24 +01:00
commit 3b4522dfff
2 files changed
+25

No files matched your search

@@ -81,6 +81,9 @@ public class NodeManipulatorResultHandler {
//Almighty Growing
possibleResults.add(RegisteredManipulations.resultApplyGrowing);
//Let the node gain primals
possibleResults.add(RegisteredManipulations.resultGainPrimal);
}
}
@@ -11,6 +11,8 @@ import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.nodes.NodeModifier;
import thaumcraft.api.nodes.NodeType;
import java.util.List;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
@@ -145,6 +147,26 @@ public class RegisteredManipulations {
}
};
public static NodeManipulatorResult resultGainPrimal = new NodeManipulatorResult(3) {
@Override
public boolean affect(TileExtendedNode node) {
List<Aspect> primals = Aspect.getPrimalAspects();
int modulo = primals.size();
int index = node.getWorldObj().rand.nextInt(primals.size());
for (int i = 0; i < primals.size(); i++) {
int get = (index + i) % modulo;
Aspect rand = primals.get(get);
if(node.getAspectsBase().getAmount(rand) <= 0) {
int randGain = node.getWorldObj().rand.nextInt(8) + 3;
node.getAspectsBase().add(rand, randGain);
node.getAspects().add(rand, randGain);
return true;
}
}
return false;
}
};
public static NodeManipulatorResult resultSwitchType = new NodeManipulatorResult(2) {
@Override
public boolean affect(TileExtendedNode node) {