Compare commits

..
11 Commits
Author SHA1 Message Date
Martin Robertz e37a932d84 Merge branch 'MeteorWeightChanges' into dev 2022-04-08 19:54:26 +02:00
BigflufandScriptedPiky 595bd797fd Meteor weight changes (#21)
* Set "weight" to 0 for testing

What will happen if the weight is 0? Time to find out!

* Experimental Additions

Based on what BigFluf (211200168656240642) on Discord stated:
"If this works you should be able to change the weights in the configs to any number you like, and it'll just use those as relative chances and never add any 'filler' blocks like the stone
So for example if you have a meteor with just Black Granite with weight 1 and Iron Ore with weight 1, both would have 50% chance
Or you could put both at 1 million and it'd still be the same
Just make sure the new meteor GUI is changed in the same way if possible, otherwise the ore chances will be inaccurate"

* Update MeteorParadigm.java

Removed hardcoded maxChance and chance at fixed 1000 total weight, instead using dynamically calculated total weight of all the blocks in the meteor

* Update NEIMeteorRecipeHandler.java

* Update BloodMagicConfiguration.java

* Added getTotalMeteorWeight function

Moved loop to calculate total weight to it's own function, used in NEI tab as well

* Using getTotalMeteorWeight function

Changed copy-pasted weight calculation code to function call for getTotalMeteorWeight

Co-authored-by: ScriptedPiky <[email protected]>
2022-04-08 14:03:58 +02:00
Bigfluf 1593b5482b Using getTotalMeteorWeight function
Changed copy-pasted weight calculation code to function call for getTotalMeteorWeight
2022-04-08 12:03:48 +02:00
Bigfluf 00f9fa1add Added getTotalMeteorWeight function
Moved loop to calculate total weight to it's own function, used in NEI tab as well
2022-04-08 12:01:27 +02:00
Bigfluf 5c930a479f Update BloodMagicConfiguration.java 2022-03-31 01:43:41 +02:00
Bigfluf d8b0fa1cc9 Update NEIMeteorRecipeHandler.java 2022-03-31 01:41:00 +02:00
Bigfluf 801a8548f2 Update MeteorParadigm.java
Removed hardcoded maxChance and chance at fixed 1000 total weight, instead using dynamically calculated total weight of all the blocks in the meteor
2022-03-31 01:38:14 +02:00
ScriptedPiky 366a22908f Experimental Additions
Based on what BigFluf (211200168656240642) on Discord stated:
"If this works you should be able to change the weights in the configs to any number you like, and it'll just use those as relative chances and never add any 'filler' blocks like the stone
So for example if you have a meteor with just Black Granite with weight 1 and Iron Ore with weight 1, both would have 50% chance
Or you could put both at 1 million and it'd still be the same
Just make sure the new meteor GUI is changed in the same way if possible, otherwise the ore chances will be inaccurate"
2022-03-30 13:11:45 -07:00
ScriptedPiky c72e20a7ef Set "weight" to 0 for testing
What will happen if the weight is 0? Time to find out!
2022-03-30 12:53:57 -07:00
ScriptedPiky 79cab43a65 Reflects to 100k cost in config (#19)
See: https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/pull/9960
2022-03-15 14:02:14 +01:00
ScriptedPiky 52ee540b52 Sanity adjusted Superior Capacity Rune (#18)
I realized that the buff was perhaps too insane prior lmao
2022-03-01 09:20:13 +01:00
4 changed files with 28 additions and 12 deletions

No files matched your search

@@ -101,7 +101,6 @@ public class BloodMagicConfiguration
AlchemicalWizardry.customPotionDemonCloakID = config.get("Potion ID", "DemonCloak", 115).getInt();
AlchemicalWizardry.customPotionAmphibianID = config.get("Potion ID", "Amphibian", 116).getInt();
MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt();
AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true);
AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron", "gold", "copper", "tin", "lead", "silver", "osmium"}).getStringList();
@@ -249,7 +248,7 @@ public class BloodMagicConfiguration
AlchemicalWizardry.ritualCostFeatheredEarth = config.get(lpCosts, "Ritual of the Feathered Earth", new int[]{100000, 0}).getIntList();
AlchemicalWizardry.ritualCostGaia = config.get(lpCosts, "Gaia's Transformation", new int[]{1000000, 0}).getIntList();
AlchemicalWizardry.ritualCostCondor = config.get(lpCosts, "Reverence of the Condor", new int[]{1000000, 0}).getIntList();
AlchemicalWizardry.ritualCostFallingTower = config.get(lpCosts, "Mark of the Falling Tower", new int[]{50000, 0}).getIntList();
AlchemicalWizardry.ritualCostFallingTower = config.get(lpCosts, "Mark of the Falling Tower", new int[]{100000, 0}).getIntList();
AlchemicalWizardry.ritualCostBalladOfAlchemy = config.get(lpCosts, "Ballad of Alchemy", new int[]{20000, 10}).getIntList();
AlchemicalWizardry.ritualCostExpulsion = config.get(lpCosts, "Aura of Expulsion", new int[]{1000000, 1000}).getIntList();
AlchemicalWizardry.ritualCostSuppression = config.get(lpCosts, "Dome of Suppression", new int[]{10000, 2}).getIntList();
@@ -36,6 +36,9 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
this.input.add(new PositionedStack(meteor.focusStack, 74, 4));
int row = 0;
int col = 0;
float totalMeteorWeight = meteor.getTotalMeteorWeight();
for (MeteorParadigmComponent component : meteor.componentList) {
ItemStack stack = component.getValidBlockParadigm();
List<String> tooltips = new ArrayList<>();
@@ -43,7 +46,7 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
stack = new ItemStack(Blocks.fire);
tooltips.add(String.format("no entries found for oredict \"%s\"", component.getOreDictName()));
}
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(component.getChance())));
tooltips.add(I18n.format("nei.recipe.meteor.chance", getFormattedChance(component.getChance() / totalMeteorWeight)));
this.outputs.add(new TooltipStack(stack, 3 + 18 * col, 37 + 18 * row, tooltips));
col++;
if (col > 8) {
@@ -171,9 +174,9 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
.collect(Collectors.toList());
}
private String getFormattedChance(int chance) {
float percentage = (float) chance / 10;
boolean isInteger = Float.compare(percentage, (float) (chance / 10)) == 0;
private String getFormattedChance(float chance) {
float percentage = chance * 100.0f;
boolean isInteger = percentage - (int) percentage <= 0.01;
if (isInteger) return String.format("%,d", (int) percentage);
else return String.format("%,.1f", percentage);
}
@@ -16,7 +16,6 @@ public class MeteorParadigm
public ItemStack focusStack;
public int radius;
public int cost;
public static int maxChance = 1000;
public static Random rand = new Random();
@@ -37,6 +36,21 @@ public class MeteorParadigm
componentList.add(mpc);
}
}
public int getTotalMeteorWeight()
{
int totalMeteorWeight = 0;
for (MeteorParadigmComponent mpc : componentList)
{
if (mpc == null || !mpc.isValidBlockParadigm())
{
continue;
}
totalMeteorWeight += mpc.getChance();
}
return totalMeteorWeight;
}
public void createMeteorImpact(World world, int x, int y, int z, boolean[] flags)
{
@@ -56,16 +70,13 @@ public class MeteorParadigm
}
int newRadius = radius;
int chance = maxChance;
if (hasOrbisTerrae)
{
newRadius += 2;
chance += 200;
} else if (hasTerrae)
{
newRadius += 1;
chance += 100;
}
world.createExplosion(null, x, y, z, newRadius * 4, AlchemicalWizardry.doMeteorsDestroyBlocks);
@@ -75,6 +86,8 @@ public class MeteorParadigm
float obsidChance = hasTennebrae ? 1 : 0;
float totalChance = iceChance + soulChance + obsidChance;
int totalMeteorWeight = getTotalMeteorWeight();
for (int i = -newRadius; i <= newRadius; i++)
{
@@ -92,7 +105,8 @@ public class MeteorParadigm
continue;
}
int randNum = world.rand.nextInt(chance);
int randNum = world.rand.nextInt(totalMeteorWeight);
boolean hasPlacedBlock = false;
for (MeteorParadigmComponent mpc : componentList)
@@ -801,7 +801,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
this.efficiencyMultiplier = (float) Math.pow(0.80, upgrades.getSpeedUpgrades());
this.sacrificeEfficiencyMultiplier = (float) (0.12 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float) (0.12 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float) ((1 * Math.pow(1.22, upgrades.getBetterCapacitiveUpgrades()) + 0.35 * upgrades.getAltarCapacitiveUpgrades()));
this.capacityMultiplier = (float) ((1 * Math.pow(1.14, upgrades.getBetterCapacitiveUpgrades()) + 0.35 * upgrades.getAltarCapacitiveUpgrades()));
this.dislocationMultiplier = (float) (Math.pow(1.5, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float) (1 + 0.04 * upgrades.getOrbCapacitiveUpgrades());
this.capacity = (int) (FluidContainerRegistry.BUCKET_VOLUME * 10 * capacityMultiplier);