Skip to content

Commit 5668545

Browse files
committed
Add flower energy consumption formula
1 parent 4b3c801 commit 5668545

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

src/main/java/com/mcgoodtime/productionline/tiles/SubTileFlowerOfOsiris.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
import vazkii.botania.common.block.tile.TileSpecialFlower;
1313

1414
public class SubTileFlowerOfOsiris extends SubTileFunctional{
15+
1516
private int consume;
16-
private int growthLevel = 10;
1717

18-
private int growthData;
18+
private int accelerateLevel = 10;
1919

2020
private int range = 3;
2121

@@ -28,7 +28,7 @@ public void onUpdate() {
2828
SubTileGenerating tile = getManaGenerator(pos);
2929
if(tile!=null) {
3030
if(!hasMultiOsiris(tile)){
31-
enhance(tile);
31+
accelerate(tile);
3232
}
3333
}
3434
}
@@ -45,9 +45,8 @@ private SubTileGenerating getManaGenerator(BlockPos pos) {
4545
return null;
4646
}
4747

48-
private void enhance(SubTileGenerating stg){
49-
calculateGrowthData(growthLevel);
50-
for(int i=0;i<growthData;i++){
48+
private void accelerate(SubTileGenerating stg){
49+
for(int i=0;i<=Math.min(accelerateLevel,getMaxAccelerateLevel());i++){
5150
stg.onUpdate();
5251
}
5352
}
@@ -72,10 +71,15 @@ private boolean hasMultiOsiris(SubTileGenerating GeneratingTile){
7271
return false;
7372
}
7473

75-
private void calculateGrowthData(int growthLevel){
76-
this.growthData=(int)Math.ceil((Math.log((5*(growthLevel-0.5)))*1.4));
74+
private void calculateConsume(int growthLevel){
75+
this.consume = (int)Math.ceil(64*(((Math.log(5)*growthLevel)+(1/3*Math.pow(growthLevel,2)+2))*(1+(0.1*range))));
76+
}
77+
78+
private int getMaxAccelerateLevel(){
79+
return 10;
7780
}
7881

82+
7983
@Override
8084
public int getMaxMana() {
8185
return 0;

0 commit comments

Comments
 (0)