Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class BlockTossAbility(player: Player) : BrawlAbility("block_toss", player) {
private val maxDamage = metadata.double("maxDamage") ?: 9.0
private val damage = metadata.double("damage") ?: 8.0
private val knockbackMultiplier = metadata.double("knockbackMultiplier") ?: 2.5
private val blockRotationStepSpeedTicks =
(metadata.int("blockRotationStepSpeedTicks") ?: 4).coerceAtLeast(1)

private val activeProjectiles = mutableListOf<BrawlProjectile>()

Expand Down Expand Up @@ -137,10 +139,10 @@ class BlockTossAbility(player: Player) : BrawlAbility("block_toss", player) {
var tumbleAngleY = 0f
var tumbleAngleX = 0f

val rotatationStepSpeedTicks = 4
val rotationStepSpeedTicks = blockRotationStepSpeedTicks

runnables.add(
repeatingTask(rotatationStepSpeedTicks.toLong()) {
repeatingTask(rotationStepSpeedTicks.toLong()) {
if (!displayBlock.isValid) {
cancel()
return@repeatingTask
Expand All @@ -164,7 +166,7 @@ class BlockTossAbility(player: Player) : BrawlAbility("block_toss", player) {

displayBlock.setTransformationMatrix(transform)
displayBlock.interpolationDelay = 0
displayBlock.interpolationDuration = rotatationStepSpeedTicks
displayBlock.interpolationDuration = rotationStepSpeedTicks
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@ class BoneExplosionAbility(player: Player) : BrawlAbility("bone_explosion", play

private val explosionRadius = metadata.double("explosionRadius") ?: 7.0
private val baseDamage = metadata.double("baseDamage") ?: 6.0
private val explosionKnockbackMultiplier =
metadata.double("explosionKnockbackMultiplier") ?: 2.5
private val explosionBoneCount = metadata.int("explosionBoneCount") ?: 48
private val explosionBoneVelocity = metadata.double("explosionBoneVelocity") ?: 0.8

override fun activate() {
player.location
.clone()
.add(0.0, 0.5, 0.5)
.itemEffect(48, 0.8, Sound.ENTITY_SKELETON_HURT, 2f, 1.2f, Material.BONE, 40)
.itemEffect(
explosionBoneCount,
explosionBoneVelocity,
Sound.ENTITY_SKELETON_HURT,
2f,
1.2f,
Material.BONE,
40,
)

val validEntities =
player.location.getNearbyPlayers(explosionRadius).filter { it != player }
Expand All @@ -36,7 +48,7 @@ class BoneExplosionAbility(player: Player) : BrawlAbility("bone_explosion", play
entity,
Damager.DamagerLivingEntity(player),
damage,
2.5,
explosionKnockbackMultiplier,
BrawlDamageType.Explosion,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ExplodeAbility(player: Player) : BrawlAbility("explode", player) {
private val explosionRadius = metadata.double("explosionRadius") ?: 8.0
private val explosionKnockbackMultiplier =
metadata.double("explosionKnockbackMultiplier") ?: 2.5
private val explosionVelocityStrength = metadata.double("explosionVelocityStrength") ?: 1.8

override fun canActivate(sendMessage: Boolean): Boolean {
if (isExplodeActive) {
Expand Down Expand Up @@ -137,7 +138,7 @@ class ExplodeAbility(player: Player) : BrawlAbility("explode", player) {
damageEvent.callEvent()
}

player.setVelocity(1.8, 0.2, 1.4, true)
player.setVelocity(explosionVelocityStrength, 0.2, 1.4, true)

setCooldown(currentTimeAtActivation)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MilkSpiralAbility(player: Player) : BrawlAbility("milk_spiral", player) {
private val damage = metadata.double("damage") ?: 5.0
private val maxTimesHit = metadata.int("maxTimesHit") ?: 2
private val damageCooldownMs = metadata.long("damageCooldownMs") ?: 250
private val particleSpiralRadius = metadata.double("particleSpiralRadius") ?: 1.5

private val lastDamageTime = hashMapOf<Player, Long>()
private val timesHit = hashMapOf<Player, Int>()
Expand Down Expand Up @@ -60,19 +61,32 @@ class MilkSpiralAbility(player: Player) : BrawlAbility("milk_spiral", player) {
val circleSecond = direction.clone().crossProduct(circleFirst).normalize()

val speed = 3
val radius = 1.5
var theta = player.ticksLived.toDouble() / speed
var totalAddedDistance = 0.0

while (totalAddedDistance < totalDistance) {
val firstParticle =
oldLocation
.clone()
.add(getCirclePoint(circleFirst, circleSecond, theta, radius))
.add(
getCirclePoint(
circleFirst,
circleSecond,
theta,
particleSpiralRadius,
)
)
val secondParticle =
oldLocation
.clone()
.add(getCirclePoint(circleFirst, circleSecond, theta + Math.PI, radius))
.add(
getCirclePoint(
circleFirst,
circleSecond,
theta + Math.PI,
particleSpiralRadius,
)
)

if (first) {
firstParticle.world.playSound(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class SulphurBombAbility(player: Player) : BrawlAbility("sulphur_bomb", player)

private val projectileKnockbackModifier = metadata.double("projectileKnockbackModifier") ?: 2.5
private val projectileDamage = metadata.double("projectileDamage") ?: 6.5
private val projectileVelocityMultiplier =
metadata.double("projectileVelocityMultiplier") ?: 1.55
private val projectileSize = (metadata.double("projectileSize") ?: 0.65).coerceAtLeast(0.1)
private val projectileTrailMaxParticles = metadata.int("projectileTrailMaxParticles") ?: 8

private val activeProjectiles = mutableListOf<BrawlProjectile>()

Expand All @@ -44,9 +48,9 @@ class SulphurBombAbility(player: Player) : BrawlAbility("sulphur_bomb", player)
ItemStack.of(Material.COAL),
"abilities.sulphur_bomb.name",
)
.velocityMultiplier(1.55)
.projectileSize(0.65)
.trailEffect(Particle.SMOKE, count = 8)
.velocityMultiplier(projectileVelocityMultiplier)
.projectileSize(projectileSize)
.trailEffect(Particle.SMOKE, count = projectileTrailMaxParticles)
.impactEffect(Particle.EXPLOSION, Sound.ENTITY_GENERIC_EXPLODE)
.onHitEntity { entity, projectile ->
handleSulphurBombHit(entity, projectile)
Expand Down
57 changes: 42 additions & 15 deletions plugin/src/main/resources/data/abilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ abilities:
usage: right_click
hotbarItem: iron_axe
displayItem: coal
metadata:
projectileKnockbackModifier: 2.5
projectileDamage: 6.5
projectileVelocityMultiplier: 1.55
projectileSize: 0.65
projectileTrailMaxParticles: 8

- id: explode
cooldown: 8.0
Expand All @@ -14,6 +20,11 @@ abilities:
usage: right_click
hotbarItem: iron_shovel
displayItem: creeper_spawn_egg
metadata:
fuseTimeTicks: 30
explosionRadius: 8.0
explosionKnockbackMultiplier: 2.5
explosionVelocityStrength: 1.8

- id: bone_explosion
cooldown: 10.0
Expand All @@ -22,6 +33,12 @@ abilities:
usage: right_click
hotbarItem: iron_axe
displayItem: bone
metadata:
explosionRadius: 7.0
baseDamage: 6.0
explosionKnockbackMultiplier: 2.5
explosionBoneCount: 48
explosionBoneVelocity: 0.8

- id: roped_arrow
cooldown: 5.0
Expand All @@ -30,6 +47,9 @@ abilities:
usage: left_click
hotbarItem: bow
displayItem: arrow
metadata:
arrowVelocityModifier: 2.4
arrowDamage: 6.0

- id: angry_herd
cooldown: 13.0
Expand All @@ -39,13 +59,15 @@ abilities:
hotbarItem: iron_axe
displayItem: cow_spawn_egg
metadata:
cowsCount: 5
cowSpeed: 0.9
contactRadius: 1.2
durationTicks: 60
damagePerHit: 5.0
knockbackMultiplier: 1.25
hitCooldownTicks: 10
cowAmountRadius: 3
cowAmountHeight: 1
stuckTimeMs: 300
forceMoveTimeMs: 350
durationMs: 2500
hitboxRadius: 2.2
damageCooldownMs: 600
damage: 5.0
knockback: 1.25

- id: milk_spiral
cooldown: 9.0
Expand All @@ -55,14 +77,13 @@ abilities:
hotbarItem: iron_shovel
displayItem: milk_bucket
metadata:
durationTicks: 160
propelTicks: 80
helixRadius: 1.5
centerSpeed: 0.9
playerSpeed: 1.0
spiralDurationMs: 3000
velocityDurationMs: 1800
hitboxRadius: 2.0
damage: 5.0
maxTargets: 2
hitCooldownTicks: 10
maxTimesHit: 2
damageCooldownMs: 250
particleSpiralRadius: 1.5

- id: blink
cooldown: 6.0
Expand All @@ -81,4 +102,10 @@ abilities:
usage: right_click
hotbarItem: iron_sword
displayItem: grass_block
metadata:
metadata:
chargeTimeMs: 1200
maxCharge: 1.4
maxDamage: 9.0
damage: 8.0
knockbackMultiplier: 2.5
blockRotationStepSpeedTicks: 4
8 changes: 4 additions & 4 deletions plugin/src/main/resources/data/kits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kits:
- id: regeneration
overrides:
metadata:
regenRate: 0.4
healAmount: 0.4
- id: hunger
abilities:
- id: sulphur_bomb
Expand All @@ -52,7 +52,7 @@ kits:
- id: regeneration
overrides:
metadata:
regenRate: 0.25
healAmount: 0.25
- id: hunger
- id: arrow_recharge
overrides:
Expand Down Expand Up @@ -81,7 +81,7 @@ kits:
- id: regeneration
overrides:
metadata:
regenRate: 0.25
healAmount: 0.25
- id: stampede
- id: hunger
abilities:
Expand All @@ -106,7 +106,7 @@ kits:
- id: regeneration
overrides:
metadata:
regenRate: 0.25
healAmount: 0.25
- id: hunger
abilities:
- id: blink
Expand Down
24 changes: 19 additions & 5 deletions plugin/src/main/resources/data/passives.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
passives:
- id: double_jump
userFacing: false
metadata:
# Motion tuning
horizontalMultiplier: 0.9
verticalBoost: 0.9
allowMidairReset: false

- id: hunger
userFacing: false
metadata:
hungerRestoreDelayMs: 250

- id: regeneration
userFacing: false
metadata:
healAmount: 1.0
healIntervalTicks: 60

- id: arrow_recharge
displayItem: bundle
userFacing: true
metadata:
arrowIntervalTicks: 20
arrowHotbarSlot: 2
maximumArrowCount: 3
arrowIntervalTicks: 40

- id: barrage
displayItem: spectral_arrow
userFacing: true
metadata:
maxCharge: 5
arrowDamage: 6.0

- id: stampede
displayItem: leather
userFacing: true
metadata:
maxLevel: 4
ticksPerLevel: 60
extraDamagePerLevel: 0.5
extraKnockbackPerLevel: 0.1
stackIncreaseTimeMs: 3000
maxStacks: 3
stopSprintDamage: 3