Skip to content

Commit 3bd4b00

Browse files
committed
Changed explosion util function names
1 parent 0b0668f commit 3bd4b00

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

common/src/main/kotlin/com/lambda/util/combat/Explosion.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ object Explosion {
1818
* @param entity The entity to calculate the damage for.
1919
* @return The damage dealt by the explosion.
2020
*/
21-
fun SafeContext.damage(source: Explosion, entity: LivingEntity) =
22-
damage(source.position, entity, source.power.toDouble())
21+
fun SafeContext.explosionDamage(source: Explosion, entity: LivingEntity) =
22+
explosionDamage(source.position, entity, source.power.toDouble())
2323

2424
/**
2525
* Calculates the damage dealt by an explosion to a living entity.
@@ -28,7 +28,7 @@ object Explosion {
2828
* @param power The strength of the explosion above 0.
2929
* @return The damage dealt by the explosion.
3030
*/
31-
fun SafeContext.damage(position: Vec3d, entity: LivingEntity, power: Double): Double {
31+
fun SafeContext.explosionDamage(position: Vec3d, entity: LivingEntity, power: Double): Double {
3232
val distance = entity.pos.distanceTo(position)
3333

3434
val impact = (1.0 - distance / (power * 2.0)) *
@@ -47,10 +47,10 @@ object Explosion {
4747
* @param explosion The explosion to calculate the velocity for.
4848
* @return The velocity of the entities.
4949
*/
50-
fun SafeContext.velocity(explosion: Explosion): Map<LivingEntity, Vec3d> {
50+
fun SafeContext.explosionVelocity(explosion: Explosion): Map<LivingEntity, Vec3d> {
5151
val ref = ArrayList<LivingEntity>()
52-
getFastEntities<LivingEntity>(explosion.position, explosion.power * 2.0, ref)
53-
return ref.associateWith { entity -> velocity(entity, explosion) }
52+
getFastEntities(explosion.position, explosion.power * 2.0, ref)
53+
return ref.associateWith { entity -> explosionVelocity(entity, explosion) }
5454
}
5555

5656
/**
@@ -59,8 +59,8 @@ object Explosion {
5959
* @param explosion The explosion to calculate the velocity for.
6060
* @return The velocity of the entity.
6161
*/
62-
fun SafeContext.velocity(entity: LivingEntity, explosion: Explosion) =
63-
velocity(entity, explosion.position, explosion.power.toDouble())
62+
fun SafeContext.explosionVelocity(entity: LivingEntity, explosion: Explosion) =
63+
explosionVelocity(entity, explosion.position, explosion.power.toDouble())
6464

6565
/**
6666
* Calculates the velocity of a living entity affected by an explosion.
@@ -69,7 +69,7 @@ object Explosion {
6969
* @param power The strength of the explosion.
7070
* @return The velocity of the entity.
7171
*/
72-
fun SafeContext.velocity(entity: LivingEntity, position: Vec3d, power: Double): Vec3d {
72+
fun SafeContext.explosionVelocity(entity: LivingEntity, position: Vec3d, power: Double): Vec3d {
7373
val distance = entity.pos.distanceTo(position)
7474

7575
val size = power * 2.0
@@ -82,7 +82,7 @@ object Explosion {
8282
return diff.normalize() * vel
8383
}
8484

85-
fun SafeContext.destruction(source: Explosion): List<Vec3d> {
85+
fun SafeContext.explosionDestruction(source: Explosion): List<Vec3d> {
8686
val affected = mutableListOf<Vec3d>()
8787

8888
repeat(16) { x ->

0 commit comments

Comments
 (0)