Skip to content

Commit

Permalink
close #101 ... well, more like touch up
Browse files Browse the repository at this point in the history
  • Loading branch information
gamma-delta committed Jun 12, 2022
1 parent bf46822 commit 6ad14e6
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object OpBlink : SpellOperator {

return Triple(
Spell(target, delta),
ManaConstants.SHARD_UNIT * delta.roundToInt(),
ManaConstants.SHARD_UNIT * (delta * 0.5).roundToInt(),
listOf(
ParticleSpray.cloud(targetMiddlePos, 2.0, 50),
ParticleSpray.burst(targetMiddlePos.add(dvec), 2.0, 100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.spells

import at.petrak.hexcasting.api.misc.ManaConstants
import at.petrak.hexcasting.api.mod.HexConfig
import at.petrak.hexcasting.api.spell.getChecked
import at.petrak.hexcasting.api.spell.ParticleSpray
import at.petrak.hexcasting.api.spell.RenderedSpell
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.api.spell.SpellOperator
import at.petrak.hexcasting.api.spell.*
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.xplat.IXplatAbstractions
import net.minecraft.core.BlockPos
Expand All @@ -26,7 +22,7 @@ object OpBreakBlock : SpellOperator {
val centered = Vec3.atCenterOf(BlockPos(pos))
return Triple(
Spell(pos),
ManaConstants.DUST_UNIT * 2,
(ManaConstants.DUST_UNIT * 1.125).toInt(),
listOf(ParticleSpray.burst(centered, 1.0))
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ class OpExplode(val fire: Boolean) : SpellOperator {
val pos = args.getChecked<Vec3>(0, argc)
val strength = args.getChecked<Double>(1, argc)
ctx.assertVecInRange(pos)
val clampedStrength = Mth.clamp(strength, 0.0, 10.0)
val cost = ManaConstants.DUST_UNIT * (3 * clampedStrength + if (fire) 0.125 else 1.0)
return Triple(
Spell(pos, strength, this.fire),
((1 + Mth.clamp(strength.toFloat(), 0f, 10f) + if (this.fire) 2 else 0) * ManaConstants.SHARD_UNIT).toInt(),
listOf(ParticleSpray.burst(pos, strength, 50))
Spell(pos, clampedStrength, this.fire),
cost.toInt(),
listOf(ParticleSpray.burst(pos, clampedStrength, 50))
)
}

Expand All @@ -36,7 +38,7 @@ class OpExplode(val fire: Boolean) : SpellOperator {
pos.x,
pos.y,
pos.z,
Mth.clamp(strength.toFloat(), 0f, 10f),
strength.toFloat(),

This comment has been minimized.

Copy link
@yrsegal

yrsegal Jun 12, 2022

Contributor

this should be clampedStrength no

This comment has been minimized.

Copy link
@gamma-delta

gamma-delta Jun 12, 2022

Author Collaborator

Whoops

This comment has been minimized.

Copy link
@gamma-delta

gamma-delta Jun 12, 2022

Author Collaborator

Wait no that works, they're different scopes. clampedStrength gets passed to Spell ctor

this.fire,
Explosion.BlockInteraction.BREAK
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object OpExtinguish : SpellOperator {

return Triple(
Spell(target),
ManaConstants.CRYSTAL_UNIT,
ManaConstants.DUST_UNIT * 6,
listOf(ParticleSpray.burst(target, 1.0))
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object OpPlaceBlock : SpellOperator {

return Triple(
Spell(target),
ManaConstants.DUST_UNIT,
ManaConstants.DUST_UNIT / 8,
listOf(ParticleSpray.cloud(Vec3.atCenterOf(pos), 1.0))
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package at.petrak.hexcasting.common.casting.operators.spells

import at.petrak.hexcasting.api.misc.ManaConstants

import at.petrak.hexcasting.api.spell.getChecked
import at.petrak.hexcasting.api.spell.ParticleSpray
import at.petrak.hexcasting.api.spell.RenderedSpell
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.api.spell.SpellOperator
import at.petrak.hexcasting.api.spell.*
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.api.spell.mishaps.MishapBadItem
import at.petrak.hexcasting.api.spell.mishaps.MishapBadOffhandItem
Expand Down Expand Up @@ -48,8 +43,11 @@ object OpRecharge : SpellOperator {
if (mana.mana >= mana.maxMana)
return null

return Triple(Spell(entity),
ManaConstants.CRYSTAL_UNIT, listOf(ParticleSpray.burst(entity.position(), 0.5)))
return Triple(
Spell(entity),
ManaConstants.SHARD_UNIT,
listOf(ParticleSpray.burst(entity.position(), 0.5))
)
}

private data class Spell(val itemEntity: ItemEntity) : RenderedSpell {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package at.petrak.hexcasting.common.casting.operators.spells

import at.petrak.hexcasting.api.misc.ManaConstants
import at.petrak.hexcasting.api.spell.getChecked
import at.petrak.hexcasting.api.spell.ParticleSpray
import at.petrak.hexcasting.api.spell.RenderedSpell
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.api.spell.SpellOperator
import at.petrak.hexcasting.api.spell.*
import at.petrak.hexcasting.api.spell.casting.CastingContext
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
Expand All @@ -28,7 +24,7 @@ object OpTheOnlyReasonAnyoneDownloadedPsi : SpellOperator {

return Triple(
Spell(target),
ManaConstants.DUST_UNIT,
(ManaConstants.DUST_UNIT + 1.125).toInt(),

This comment has been minimized.

Copy link
@yrsegal

yrsegal Jun 12, 2022

Contributor

I don't think this is what you meant to do

listOf(ParticleSpray.burst(Vec3.atCenterOf(BlockPos(target)), 1.0))
)
}
Expand Down
18 changes: 9 additions & 9 deletions Common/src/main/resources/assets/hexcasting/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -899,25 +899,25 @@

"hexcasting.entry.basic_spell": "Basic Spells",
"hexcasting.page.basic_spell.explode.1": "Remove a number and vector from the stack, then create an explosion at the given location with the given power.",
"hexcasting.page.basic_spell.explode.2": "A power of 3 is about as much as a Creeper's blast; 4 is about as much as a TNT blast. Nature refuses to give me a blast of more than 10 power, though.$(br2)Strangely, this explosion doesn't seem to harm me. Perhaps it's because $(italic)I/$ am the one exploding?$(br2)Costs about one $(l:items/amethyst)$(item)Amethyst Shard/$, plus an extra $(l:items/amethyst)$(item)Amethyst Shard/$ per point of explosion power.",
"hexcasting.page.basic_spell.explode.2": "A power of 3 is about as much as a Creeper's blast; 4 is about as much as a TNT blast. Nature refuses to give me a blast of more than 10 power, though.$(br2)Strangely, this explosion doesn't seem to harm me. Perhaps it's because $(italic)I/$ am the one exploding?$(br2)Costs a negligible amount at power 0, plus 3 extra $(l:items/amethyst)$(item)Amethyst Dust/$s per point of explosion power.",
"hexcasting.page.basic_spell.explode.fire.1": "Remove a number and vector from the stack, then create a fiery explosion at the given location with the given power.",
"hexcasting.page.basic_spell.explode.fire.2": "Costs three $(l:items/amethyst)$(item)Amethyst Shards/$, plus about one extra $(l:items/amethyst)$(item)Amethyst Shard/$ per point of explosion power. Otherwise, the same as $(l:patterns/spells/basic#hexcasting:explode)$(action)Explosion/$, except with fire.",
"hexcasting.page.basic_spell.explode.fire.2": "Costs one $(l:items/amethyst)$(item)Amethyst Dust/$, plus about 3 extra $(l:items/amethyst)$(item)Amethyst Dust/$s per point of explosion power. Otherwise, the same as $(l:patterns/spells/basic#hexcasting:explode)$(action)Explosion/$, except with fire.",
"hexcasting.page.basic_spell.add_motion": "Remove an entity and direction from the stack, then give a shove to the given entity in the given direction. The strength of the impulse is determined by the length of the vector.$(br)Costs units of $(l:items/amethyst)$(item)Amethyst Dust/$ equal to the square of the length of the vector.",
"hexcasting.page.basic_spell.blink": "Remove an entity and length from the stack, then teleport the given entity along its look vector by the given length.$(br)Costs about one $(l:items/amethyst)$(item)Amethyst Shard/$ per block travelled.",
"hexcasting.page.basic_spell.blink": "Remove an entity and length from the stack, then teleport the given entity along its look vector by the given length.$(br)Costs about one $(l:items/amethyst)$(item)Amethyst Shard/$ per two blocks travelled.",
"hexcasting.page.basic_spell.beep.1": "Remove a vector and two numbers from the stack. Plays an $(thing)instrument/$ defined by the first number at the given location, with a $(thing)note/$ defined by the second number. Costs a negligible amount of _media.",
"hexcasting.page.basic_spell.beep.2": "There appear to be 16 different $(thing)instruments/$ and 25 different $(thing)notes/$. Both are indexed by zero.$(br2)These seem to be the same instruments I can produce with a $(item)Note Block/$, though the reason for each instrument's number being what it is eludes me.$(br2)Either way, I can find the numbers I need to use by inspecting a $(item)Note Block/$ through a $(l:items/lens)$(item)Scrying Lens/$.",

"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 about 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 two $(l:items/amethyst)$(item)Amethyst Dust/$.",
"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.create_water": "Summon a block of water (or insert 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": "Destroy a great deal of liquid (not just water) 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/$.",
"hexcasting.page.blockworks.conjure_light": "Conjure a magical light that softly glows with my pigment at the given position. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.bonemeal": "Encourage a plant or sapling at the target position to grow, as if $(item)Bonemeal/$ was applied. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.bonemeal": "Encourage a plant or sapling at the target position to grow, as if $(item)Bonemeal/$ was applied. Costs a bit more than one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.edify": "Forcibly infuse _media into the sapling at the target position, causing it to grow into an $(l:items/edified)$(thing)Edified Tree/$. Costs about one $(l:items/amethyst)$(item)Charged Crystal/$.",
"hexcasting.page.blockworks.ignite": "Start a fire on top of the given location, as if a $(item)Fire Charge/$ was applied. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.blockworks.extinguish": "Extinguish blocks in a large area. Costs about one $(l:items/amethyst)$(item)Charged Amethyst/$.",
"hexcasting.page.blockworks.extinguish": "Extinguish blocks in a large area. Costs about six $(l:items/amethyst)$(item)Amethyst Dust/$s.",

"hexcasting.entry.nadirs": "Nadirs",
"hexcasting.page.nadirs.1": "This family of spells all impart a negative potion effect upon an entity. They all take an entity, the recipient, and one or two numbers, the first being the duration and the second, if present, being the potency (starting at 1).$(br2)Each one has a \"base cost;\" the actual cost is equal to that base cost, multiplied by the potency squared.",
Expand All @@ -933,10 +933,10 @@
"hexcasting.page.hexcasting_spell.craft/cypher": "Costs about one $(l:items/amethyst)$(item)Charged Amethyst/$.",
"hexcasting.page.hexcasting_spell.craft/trinket": "Costs about five $(l:items/amethyst)$(item)Charged Amethysts/$.",
"hexcasting.page.hexcasting_spell.craft/artifact": "Costs about ten $(l:items/amethyst)$(item)Charged Amethysts/$.",
"hexcasting.page.hexcasting_spell.recharge.1": "Recharge a _media-containing item in my other hand. Costs about one $(l:items/amethyst)$(item)Charged Amethyst/$.",
"hexcasting.page.hexcasting_spell.recharge.1": "Recharge a _media-containing item in my other hand. Costs about one $(l:items/amethyst)$(item)Amethyst Shard/$.",
"hexcasting.page.hexcasting_spell.recharge.2": "This spell is cast in a similar method to the crafting spells; an entity representing a dropped stack of $(l:items/amethyst)$(item)Amethyst/$ is provided, and recharges the _media battery of the item in my other hand.$(br2)This spell $(italic)cannot/$ recharge the item farther than its original battery size.",
"hexcasting.page.hexcasting_spell.erase.1": "Clear a _Hex-containing item in my other hand. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",
"hexcasting.page.hexcasting_spell.erase.2": "The spell will also void all the _media stored inside the item, releasing it back to Nature and returning the item to a perfectly clean slate. This way, I can re-use $(l:items/hexcasting)$(item)Trinkets/$ I have put an erroneous spell into, for example.$(br2)This also works to clear a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$, unsealing them in the process.",
"hexcasting.page.hexcasting_spell.erase.2": "The spell will also void all the _media stored inside the item, releasing it back to Nature and returning the item to a perfectly clean slate. This way, I can re-use $(l:items/hexcasting)$(item)Trinkets/$ I have put an erroneous spell into, for example.$(br2)This also works to clear a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$ page, unsealing them in the process.",

"hexcasting.entry.sentinels": "Sentinels",
"hexcasting.page.sentinels.1": "$(italic)Hence, away! Now all is well,$(br)One aloof stand sentinel./$$(br2)A $(l:patterns/spells/sentinels)$(thing)Sentinel/$ is a mysterious force I can summon to assist in the casting of _Hexes, like a familiar or guardian spirit. It appears as a spinning geometric shape to my eyes, but is invisible to everyone else.",
Expand Down
Binary file added art/slate_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6ad14e6

Please sign in to comment.