for kirin: cheapen break block and reduce packaged hex cooldowns

This commit is contained in:
petrak@ 2023-02-04 18:52:00 -06:00
parent af03b8c321
commit d5e65b5162
9 changed files with 93 additions and 6 deletions

View file

@ -21,11 +21,21 @@ public class HexConfig {
double mediaToHealthRate();
int cypherCooldown();
int trinketCooldown();
int artifactCooldown();
int DEFAULT_DUST_MEDIA_AMOUNT = MediaConstants.DUST_UNIT;
int DEFAULT_SHARD_MEDIA_AMOUNT = MediaConstants.SHARD_UNIT;
int DEFAULT_CHARGED_MEDIA_AMOUNT = MediaConstants.CRYSTAL_UNIT;
double DEFAULT_MEDIA_TO_HEALTH_RATE = 2 * MediaConstants.CRYSTAL_UNIT / 20.0;
int DEFAULT_CYPHER_COOLDOWN = 8;
int DEFAULT_TRINKET_COOLDOWN = 5;
int DEFAULT_ARTIFACT_COOLDOWN = 3;
}
public interface ClientConfigAccess {

View file

@ -1,13 +1,13 @@
package at.petrak.hexcasting.common.casting.operators.spells
import at.petrak.hexcasting.api.misc.MediaConstants
import at.petrak.hexcasting.api.mod.HexConfig
import at.petrak.hexcasting.api.casting.ParticleSpray
import at.petrak.hexcasting.api.casting.RenderedSpell
import at.petrak.hexcasting.api.casting.castables.SpellAction
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getBlockPos
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.misc.MediaConstants
import at.petrak.hexcasting.api.mod.HexConfig
import at.petrak.hexcasting.xplat.IXplatAbstractions
import net.minecraft.core.BlockPos
import net.minecraft.world.phys.Vec3
@ -25,7 +25,7 @@ object OpBreakBlock : SpellAction {
return Triple(
Spell(pos),
(MediaConstants.DUST_UNIT * 1.125).toInt(),
MediaConstants.DUST_UNIT / 8,
listOf(ParticleSpray.burst(Vec3.atCenterOf(pos), 1.0))
)
}

View file

@ -1,5 +1,6 @@
package at.petrak.hexcasting.common.items.magic;
import at.petrak.hexcasting.api.mod.HexConfig;
import net.minecraft.world.item.ItemStack;
public class ItemArtifact extends ItemPackagedHex {
@ -16,4 +17,9 @@ public class ItemArtifact extends ItemPackagedHex {
public boolean breakAfterDepletion() {
return false;
}
@Override
public int cooldown() {
return HexConfig.common().artifactCooldown();
}
}

View file

@ -1,5 +1,6 @@
package at.petrak.hexcasting.common.items.magic;
import at.petrak.hexcasting.api.mod.HexConfig;
import net.minecraft.world.item.ItemStack;
public class ItemCypher extends ItemPackagedHex {
@ -16,4 +17,9 @@ public class ItemCypher extends ItemPackagedHex {
public boolean breakAfterDepletion() {
return true;
}
@Override
public int cooldown() {
return HexConfig.common().cypherCooldown();
}
}

View file

@ -1,9 +1,9 @@
package at.petrak.hexcasting.common.items.magic;
import at.petrak.hexcasting.api.item.HexHolderItem;
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment;
import at.petrak.hexcasting.api.casting.eval.CastingHarness;
import at.petrak.hexcasting.api.casting.iota.Iota;
import at.petrak.hexcasting.api.item.HexHolderItem;
import at.petrak.hexcasting.api.utils.NBTHelper;
import at.petrak.hexcasting.common.lib.hex.HexIotaTypes;
import net.minecraft.nbt.CompoundTag;
@ -40,6 +40,8 @@ public abstract class ItemPackagedHex extends ItemMediaHolder implements HexHold
public abstract boolean breakAfterDepletion();
public abstract int cooldown();
@Override
public boolean canRecharge(ItemStack stack) {
return !breakAfterDepletion();
@ -120,7 +122,7 @@ public abstract class ItemPackagedHex extends ItemMediaHolder implements HexHold
}
player.awardStat(stat);
sPlayer.getCooldowns().addCooldown(this, 5);
sPlayer.getCooldowns().addCooldown(this, this.cooldown());
if (broken) {
stack.shrink(1);

View file

@ -1,5 +1,6 @@
package at.petrak.hexcasting.common.items.magic;
import at.petrak.hexcasting.api.mod.HexConfig;
import net.minecraft.world.item.ItemStack;
public class ItemTrinket extends ItemPackagedHex {
@ -16,4 +17,9 @@ public class ItemTrinket extends ItemPackagedHex {
public boolean breakAfterDepletion() {
return false;
}
@Override
public int cooldown() {
return HexConfig.common().trinketCooldown();
}
}

View file

@ -184,10 +184,16 @@
"text.autoconfig.hexcasting.option.common.shardMediaAmount": "Shard Media Amount",
"text.autoconfig.hexcasting.option.common.chargedCrystalMediaAmount": "Charged Crystal Media Amount",
"text.autoconfig.hexcasting.option.common.mediaToHealthRate": "Media To Health Rate",
"text.autoconfig.hexcasting.option.common.cypherCooldown": "Cypher Cooldown",
"text.autoconfig.hexcasting.option.common.trinketCooldown": "Trinket Cooldown",
"text.autoconfig.hexcasting.option.common.artifactCooldown": "Artifact Cooldown",
"text.autoconfig.hexcasting.option.common.dustMediaAmount.@Tooltip": "How much media a single Amethyst Dust item is worth",
"text.autoconfig.hexcasting.option.common.shardMediaAmount.@Tooltip": "How much media a single Amethyst Shard item is worth",
"text.autoconfig.hexcasting.option.common.chargedCrystalMediaAmount.@Tooltip": "How much media a single Charged Amethyst Crystal item is worth",
"text.autoconfig.hexcasting.option.common.mediaToHealthRate.@Tooltip": "How many points of media a half-heart is worth when casting from HP",
"text.autoconfig.hexcasting.option.common.cypherCooldown.@Tooltip": "Cooldown of a cypher in ticks",
"text.autoconfig.hexcasting.option.common.trinketCooldown.@Tooltip": "Cooldown of a trinket in ticks",
"text.autoconfig.hexcasting.option.common.artifactCooldown.@Tooltip": "Cooldown of an artifact in ticks",
"text.autoconfig.hexcasting.option.client.ctrlTogglesOffStrokeOrder": "Ctrl Toggles Off Stroke Order",
"text.autoconfig.hexcasting.option.client.invertSpellbookScrollDirection": "Invert Spellbook Scroll Direction",
@ -1079,7 +1085,7 @@
"hexcasting.entry.blockworks": "Blockworks",
"hexcasting.page.blockworks.place_block": "Remove a location from the stack, then pick a block item and place it at the given location.$(br)Costs a negligible amount of _media.",
"hexcasting.page.blockworks.break_block": "Remove a location from the stack, then break the block at the given location. This spell can break nearly anything a Diamond Pickaxe can break.$(br)Costs a bit more than one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.break_block": "Remove a location from the stack, then break the block at the given location. This spell can break nearly anything a Diamond Pickaxe can break.$(br)Costs about an eighth of one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.create_water": "Summon a block of water (or insert up to a bucket's worth) into a block at the given position. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.destroy_water": "Drains either a liquid container at, or a body of liquid around, the given position. Costs about two $(l:items/amethyst)$(item)Charged Amethyst/$.",
"hexcasting.page.blockworks.conjure_block": "Conjure an ethereal, but solid, block that sparkles with my pigment at the given position. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",

View file

@ -64,6 +64,14 @@ public class FabricHexConfig extends PartitioningSerializer.GlobalData {
@ConfigEntry.Gui.Tooltip
private double mediaToHealthRate = DEFAULT_MEDIA_TO_HEALTH_RATE;
@ConfigEntry.Gui.Tooltip
private int cypherCooldown = DEFAULT_CYPHER_COOLDOWN;
@ConfigEntry.Gui.Tooltip
private int trinketCooldown = DEFAULT_TRINKET_COOLDOWN;
@ConfigEntry.Gui.Tooltip
private int artifactCooldown = DEFAULT_ARTIFACT_COOLDOWN;
@Override
public void validatePostLoad() throws ValidationException {
this.dustMediaAmount = Math.max(this.dustMediaAmount, 0);
@ -91,6 +99,21 @@ public class FabricHexConfig extends PartitioningSerializer.GlobalData {
public double mediaToHealthRate() {
return mediaToHealthRate;
}
@Override
public int cypherCooldown() {
return cypherCooldown;
}
@Override
public int trinketCooldown() {
return trinketCooldown;
}
@Override
public int artifactCooldown() {
return artifactCooldown;
}
}
@Config(name = "client")

View file

@ -16,6 +16,10 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess {
private static ForgeConfigSpec.IntValue chargedCrystalMediaAmount;
private static ForgeConfigSpec.DoubleValue mediaToHealthRate;
private static ForgeConfigSpec.IntValue cypherCooldown;
private static ForgeConfigSpec.IntValue trinketCooldown;
private static ForgeConfigSpec.IntValue artifactCooldown;
public ForgeHexConfig(ForgeConfigSpec.Builder builder) {
builder.push("Media Amounts");
dustMediaAmount = builder.comment("How much media a single Amethyst Dust item is worth")
@ -27,6 +31,15 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess {
mediaToHealthRate = builder.comment("How many points of media a half-heart is worth when casting from HP")
.defineInRange("mediaToHealthRate", DEFAULT_MEDIA_TO_HEALTH_RATE, 0.0, Double.POSITIVE_INFINITY);
builder.pop();
builder.push("Cooldowns");
cypherCooldown = builder.comment("Cooldown in ticks of a cypher")
.defineInRange("cypherCooldown", DEFAULT_CYPHER_COOLDOWN, 0, Integer.MAX_VALUE);
trinketCooldown = builder.comment("Cooldown in ticks of a trinket")
.defineInRange("trinketCooldown", DEFAULT_TRINKET_COOLDOWN, 0, Integer.MAX_VALUE);
artifactCooldown = builder.comment("Cooldown in ticks of a artifact")
.defineInRange("artifactCooldown", DEFAULT_ARTIFACT_COOLDOWN, 0, Integer.MAX_VALUE);
builder.pop();
}
@Override
@ -49,6 +62,21 @@ public class ForgeHexConfig implements HexConfig.CommonConfigAccess {
return mediaToHealthRate.get();
}
@Override
public int cypherCooldown() {
return cypherCooldown.get();
}
@Override
public int trinketCooldown() {
return trinketCooldown.get();
}
@Override
public int artifactCooldown() {
return artifactCooldown.get();
}
public static class Client implements HexConfig.ClientConfigAccess {
private static ForgeConfigSpec.BooleanValue ctrlTogglesOffStrokeOrder;
private static ForgeConfigSpec.BooleanValue invertSpellbookScrollDirection;