Skip to content

Commit 7a56a1c

Browse files
authored
Merge pull request #137 from BetrixDev/cursor/add-metadata-to-brawl-game-data-63c6
Add metadata to brawl game data
2 parents 0bbac52 + db403bf commit 7a56a1c

File tree

8 files changed

+110
-36
lines changed

8 files changed

+110
-36
lines changed

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class BlockTossAbility(player: Player) : BrawlAbility("block_toss", player) {
2929
private val maxDamage = metadata.double("maxDamage") ?: 9.0
3030
private val damage = metadata.double("damage") ?: 8.0
3131
private val knockbackMultiplier = metadata.double("knockbackMultiplier") ?: 2.5
32+
private val blockRotationStepSpeedTicks =
33+
(metadata.int("blockRotationStepSpeedTicks") ?: 4).coerceAtLeast(1)
3234

3335
private val activeProjectiles = mutableListOf<BrawlProjectile>()
3436

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

140-
val rotatationStepSpeedTicks = 4
142+
val rotationStepSpeedTicks = blockRotationStepSpeedTicks
141143

142144
runnables.add(
143-
repeatingTask(rotatationStepSpeedTicks.toLong()) {
145+
repeatingTask(rotationStepSpeedTicks.toLong()) {
144146
if (!displayBlock.isValid) {
145147
cancel()
146148
return@repeatingTask
@@ -164,7 +166,7 @@ class BlockTossAbility(player: Player) : BrawlAbility("block_toss", player) {
164166

165167
displayBlock.setTransformationMatrix(transform)
166168
displayBlock.interpolationDelay = 0
167-
displayBlock.interpolationDuration = rotatationStepSpeedTicks
169+
displayBlock.interpolationDuration = rotationStepSpeedTicks
168170
}
169171
)
170172

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,24 @@ class BoneExplosionAbility(player: Player) : BrawlAbility("bone_explosion", play
1313

1414
private val explosionRadius = metadata.double("explosionRadius") ?: 7.0
1515
private val baseDamage = metadata.double("baseDamage") ?: 6.0
16+
private val explosionKnockbackMultiplier =
17+
metadata.double("explosionKnockbackMultiplier") ?: 2.5
18+
private val explosionBoneCount = metadata.int("explosionBoneCount") ?: 48
19+
private val explosionBoneVelocity = metadata.double("explosionBoneVelocity") ?: 0.8
1620

1721
override fun activate() {
1822
player.location
1923
.clone()
2024
.add(0.0, 0.5, 0.5)
21-
.itemEffect(48, 0.8, Sound.ENTITY_SKELETON_HURT, 2f, 1.2f, Material.BONE, 40)
25+
.itemEffect(
26+
explosionBoneCount,
27+
explosionBoneVelocity,
28+
Sound.ENTITY_SKELETON_HURT,
29+
2f,
30+
1.2f,
31+
Material.BONE,
32+
40,
33+
)
2234

2335
val validEntities =
2436
player.location.getNearbyPlayers(explosionRadius).filter { it != player }
@@ -36,7 +48,7 @@ class BoneExplosionAbility(player: Player) : BrawlAbility("bone_explosion", play
3648
entity,
3749
Damager.DamagerLivingEntity(player),
3850
damage,
39-
2.5,
51+
explosionKnockbackMultiplier,
4052
BrawlDamageType.Explosion,
4153
)
4254

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ExplodeAbility(player: Player) : BrawlAbility("explode", player) {
2929
private val explosionRadius = metadata.double("explosionRadius") ?: 8.0
3030
private val explosionKnockbackMultiplier =
3131
metadata.double("explosionKnockbackMultiplier") ?: 2.5
32+
private val explosionVelocityStrength = metadata.double("explosionVelocityStrength") ?: 1.8
3233

3334
override fun canActivate(sendMessage: Boolean): Boolean {
3435
if (isExplodeActive) {
@@ -137,7 +138,7 @@ class ExplodeAbility(player: Player) : BrawlAbility("explode", player) {
137138
damageEvent.callEvent()
138139
}
139140

140-
player.setVelocity(1.8, 0.2, 1.4, true)
141+
player.setVelocity(explosionVelocityStrength, 0.2, 1.4, true)
141142

142143
setCooldown(currentTimeAtActivation)
143144
}

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class MilkSpiralAbility(player: Player) : BrawlAbility("milk_spiral", player) {
1818
private val damage = metadata.double("damage") ?: 5.0
1919
private val maxTimesHit = metadata.int("maxTimesHit") ?: 2
2020
private val damageCooldownMs = metadata.long("damageCooldownMs") ?: 250
21+
private val particleSpiralRadius = metadata.double("particleSpiralRadius") ?: 1.5
2122

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

6263
val speed = 3
63-
val radius = 1.5
6464
var theta = player.ticksLived.toDouble() / speed
6565
var totalAddedDistance = 0.0
6666

6767
while (totalAddedDistance < totalDistance) {
6868
val firstParticle =
6969
oldLocation
7070
.clone()
71-
.add(getCirclePoint(circleFirst, circleSecond, theta, radius))
71+
.add(
72+
getCirclePoint(
73+
circleFirst,
74+
circleSecond,
75+
theta,
76+
particleSpiralRadius,
77+
)
78+
)
7279
val secondParticle =
7380
oldLocation
7481
.clone()
75-
.add(getCirclePoint(circleFirst, circleSecond, theta + Math.PI, radius))
82+
.add(
83+
getCirclePoint(
84+
circleFirst,
85+
circleSecond,
86+
theta + Math.PI,
87+
particleSpiralRadius,
88+
)
89+
)
7690

7791
if (first) {
7892
firstParticle.world.playSound(

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ class SulphurBombAbility(player: Player) : BrawlAbility("sulphur_bomb", player)
2121

2222
private val projectileKnockbackModifier = metadata.double("projectileKnockbackModifier") ?: 2.5
2323
private val projectileDamage = metadata.double("projectileDamage") ?: 6.5
24+
private val projectileVelocityMultiplier =
25+
metadata.double("projectileVelocityMultiplier") ?: 1.55
26+
private val projectileSize = (metadata.double("projectileSize") ?: 0.65).coerceAtLeast(0.1)
27+
private val projectileTrailMaxParticles = metadata.int("projectileTrailMaxParticles") ?: 8
2428

2529
private val activeProjectiles = mutableListOf<BrawlProjectile>()
2630

@@ -44,9 +48,9 @@ class SulphurBombAbility(player: Player) : BrawlAbility("sulphur_bomb", player)
4448
ItemStack.of(Material.COAL),
4549
"abilities.sulphur_bomb.name",
4650
)
47-
.velocityMultiplier(1.55)
48-
.projectileSize(0.65)
49-
.trailEffect(Particle.SMOKE, count = 8)
51+
.velocityMultiplier(projectileVelocityMultiplier)
52+
.projectileSize(projectileSize)
53+
.trailEffect(Particle.SMOKE, count = projectileTrailMaxParticles)
5054
.impactEffect(Particle.EXPLOSION, Sound.ENTITY_GENERIC_EXPLODE)
5155
.onHitEntity { entity, projectile ->
5256
handleSulphurBombHit(entity, projectile)

plugin/src/main/resources/data/abilities.yml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ abilities:
66
usage: right_click
77
hotbarItem: iron_axe
88
displayItem: coal
9+
metadata:
10+
projectileKnockbackModifier: 2.5
11+
projectileDamage: 6.5
12+
projectileVelocityMultiplier: 1.55
13+
projectileSize: 0.65
14+
projectileTrailMaxParticles: 8
915

1016
- id: explode
1117
cooldown: 8.0
@@ -14,6 +20,11 @@ abilities:
1420
usage: right_click
1521
hotbarItem: iron_shovel
1622
displayItem: creeper_spawn_egg
23+
metadata:
24+
fuseTimeTicks: 30
25+
explosionRadius: 8.0
26+
explosionKnockbackMultiplier: 2.5
27+
explosionVelocityStrength: 1.8
1728

1829
- id: bone_explosion
1930
cooldown: 10.0
@@ -22,6 +33,12 @@ abilities:
2233
usage: right_click
2334
hotbarItem: iron_axe
2435
displayItem: bone
36+
metadata:
37+
explosionRadius: 7.0
38+
baseDamage: 6.0
39+
explosionKnockbackMultiplier: 2.5
40+
explosionBoneCount: 48
41+
explosionBoneVelocity: 0.8
2542

2643
- id: roped_arrow
2744
cooldown: 5.0
@@ -30,6 +47,9 @@ abilities:
3047
usage: left_click
3148
hotbarItem: bow
3249
displayItem: arrow
50+
metadata:
51+
arrowVelocityModifier: 2.4
52+
arrowDamage: 6.0
3353

3454
- id: angry_herd
3555
cooldown: 13.0
@@ -39,13 +59,15 @@ abilities:
3959
hotbarItem: iron_axe
4060
displayItem: cow_spawn_egg
4161
metadata:
42-
cowsCount: 5
43-
cowSpeed: 0.9
44-
contactRadius: 1.2
45-
durationTicks: 60
46-
damagePerHit: 5.0
47-
knockbackMultiplier: 1.25
48-
hitCooldownTicks: 10
62+
cowAmountRadius: 3
63+
cowAmountHeight: 1
64+
stuckTimeMs: 300
65+
forceMoveTimeMs: 350
66+
durationMs: 2500
67+
hitboxRadius: 2.2
68+
damageCooldownMs: 600
69+
damage: 5.0
70+
knockback: 1.25
4971

5072
- id: milk_spiral
5173
cooldown: 9.0
@@ -55,14 +77,13 @@ abilities:
5577
hotbarItem: iron_shovel
5678
displayItem: milk_bucket
5779
metadata:
58-
durationTicks: 160
59-
propelTicks: 80
60-
helixRadius: 1.5
61-
centerSpeed: 0.9
62-
playerSpeed: 1.0
80+
spiralDurationMs: 3000
81+
velocityDurationMs: 1800
82+
hitboxRadius: 2.0
6383
damage: 5.0
64-
maxTargets: 2
65-
hitCooldownTicks: 10
84+
maxTimesHit: 2
85+
damageCooldownMs: 250
86+
particleSpiralRadius: 1.5
6687

6788
- id: blink
6889
cooldown: 6.0
@@ -81,4 +102,10 @@ abilities:
81102
usage: right_click
82103
hotbarItem: iron_sword
83104
displayItem: grass_block
84-
metadata:
105+
metadata:
106+
chargeTimeMs: 1200
107+
maxCharge: 1.4
108+
maxDamage: 9.0
109+
damage: 8.0
110+
knockbackMultiplier: 2.5
111+
blockRotationStepSpeedTicks: 4

plugin/src/main/resources/data/kits.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ kits:
2626
- id: regeneration
2727
overrides:
2828
metadata:
29-
regenRate: 0.4
29+
healAmount: 0.4
3030
- id: hunger
3131
abilities:
3232
- id: sulphur_bomb
@@ -52,7 +52,7 @@ kits:
5252
- id: regeneration
5353
overrides:
5454
metadata:
55-
regenRate: 0.25
55+
healAmount: 0.25
5656
- id: hunger
5757
- id: arrow_recharge
5858
overrides:
@@ -81,7 +81,7 @@ kits:
8181
- id: regeneration
8282
overrides:
8383
metadata:
84-
regenRate: 0.25
84+
healAmount: 0.25
8585
- id: stampede
8686
- id: hunger
8787
abilities:
@@ -106,7 +106,7 @@ kits:
106106
- id: regeneration
107107
overrides:
108108
metadata:
109-
regenRate: 0.25
109+
healAmount: 0.25
110110
- id: hunger
111111
abilities:
112112
- id: blink
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11
passives:
22
- id: double_jump
33
userFacing: false
4+
metadata:
5+
# Motion tuning
6+
horizontalMultiplier: 0.9
7+
verticalBoost: 0.9
8+
allowMidairReset: false
49

510
- id: hunger
611
userFacing: false
12+
metadata:
13+
hungerRestoreDelayMs: 250
714

815
- id: regeneration
916
userFacing: false
17+
metadata:
18+
healAmount: 1.0
19+
healIntervalTicks: 60
1020

1121
- id: arrow_recharge
1222
displayItem: bundle
1323
userFacing: true
1424
metadata:
15-
arrowIntervalTicks: 20
25+
arrowHotbarSlot: 2
26+
maximumArrowCount: 3
27+
arrowIntervalTicks: 40
1628

1729
- id: barrage
1830
displayItem: spectral_arrow
1931
userFacing: true
32+
metadata:
33+
maxCharge: 5
34+
arrowDamage: 6.0
2035

2136
- id: stampede
2237
displayItem: leather
2338
userFacing: true
2439
metadata:
25-
maxLevel: 4
26-
ticksPerLevel: 60
27-
extraDamagePerLevel: 0.5
28-
extraKnockbackPerLevel: 0.1
40+
stackIncreaseTimeMs: 3000
41+
maxStacks: 3
42+
stopSprintDamage: 3

0 commit comments

Comments
 (0)