diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt index ebf0acd80..544698e54 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt @@ -216,15 +216,15 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Mattery //no way null malware reference val tempLevel = level - if (tempLevel?.otmRandom!!.nextFloat() < 0.8f) { + if (tempLevel?.random!!.nextFloat() < 0.8f) { val size = gravitationStrength.pow(0.5) val eventHorizonRadius = size / 2 - val spawnRadius = 4 + eventHorizonRadius * (1.2 + tempLevel.otmRandom.nextDouble() * 0.6) + val spawnRadius = 4 + eventHorizonRadius * (1.2 + tempLevel.random.nextDouble() * 0.6) - val theta = tempLevel.otmRandom.nextDouble() * Math.PI * 2 - val phi = tempLevel.otmRandom.nextDouble() * Math.PI - Math.PI / 2 + val theta = tempLevel.random.nextDouble() * Math.PI * 2 + val phi = tempLevel.random.nextDouble() * Math.PI - Math.PI / 2 //мугек я не ощущаю центр //хз нужно настроить diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Enforcer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Enforcer.kt index 233599bd4..035c93c70 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Enforcer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/Enforcer.kt @@ -1,6 +1,8 @@ package ru.dbotthepony.mc.otm.entity +import net.minecraft.core.particles.ParticleTypes import net.minecraft.server.level.ServerBossEvent +import net.minecraft.server.level.ServerLevel import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvents import net.minecraft.sounds.SoundSource @@ -21,6 +23,7 @@ import net.minecraft.world.entity.monster.* import net.minecraft.world.entity.npc.Villager import net.minecraft.world.entity.player.Player import net.minecraft.world.level.Level + import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.game.MSoundEvents @@ -41,6 +44,7 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { entity is Zombie || entity is AbstractSkeleton }) + goalSelector.addGoal(2, RammingGoal(this)) targetSelector.addGoal(1, HurtByTargetGoal(this)) } @@ -58,7 +62,7 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { override fun getDeathSound(): SoundEvent { return SoundEvents.VAULT_BREAK } - +///boss healthbar private val bossEvent: ServerBossEvent = ServerBossEvent(TranslatableComponent(MNames.ENFORCER), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS) @@ -81,6 +85,7 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { super.die(cause) bossEvent.removeAllPlayers() } +/// //charge attack, could possibly leave a smoke trail too idk class RammingGoal(private val mob: Enforcer) : Goal() { @@ -110,7 +115,7 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { } override fun start() { - mob.playSound(MSoundEvents.PLASMA_WEAPON_OVERHEAT, 1.0f, 1.0f) + mob.playSound(MSoundEvents.ENFORCER_ALERT, 1.0f, 1.0f) chargeTime = 0 mob.navigation.stop() cooldown = minCooldown + mob.random.nextInt(maxCooldown - minCooldown) @@ -132,6 +137,30 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { return } + val leftPartic_x = mob.x - mob.lookAngle.x * 2 - 0.8f * mob.lookAngle.z + val rightPartic_x = mob.x - mob.lookAngle.x * 2 + 0.8f * mob.lookAngle.z + val smoke_y = mob.y + 0.6f + val leftPartic_z = mob.z - mob.lookAngle.z * 2 + 0.8f * mob.lookAngle.x + val rightPartic_z = mob.z - mob.lookAngle.z * 2 - 0.8f * mob.lookAngle.x + + if (mob.level() is ServerLevel) { + (mob.level() as ServerLevel).sendParticles( + ParticleTypes.LARGE_SMOKE, + leftPartic_x, smoke_y, leftPartic_z, + 2, + 0.0, 0.07, 0.0, + 0.01 + ) + + (mob.level() as ServerLevel).sendParticles( + ParticleTypes.LARGE_SMOKE, + rightPartic_x, smoke_y, rightPartic_z, + 2, + 0.0, 0.07, 0.0, + 0.01 + ) + } + if (chargeTime == windupTime) { if (chargeDir == null || chargeDir!!.length() < 0.1) { stop() @@ -163,6 +192,7 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { if (mob.boundingBox.intersects(target.boundingBox)) { val knockbackStrength = 1.5 val knockback = dir.scale(knockbackStrength) + target.push(knockback.x, 0.5, knockback.z) val damageAmount = 6.0f @@ -177,6 +207,7 @@ class Enforcer(type: EntityType, level: Level) : Monster(type,level) { chargeTime = 0 chargeDir = null isCharging = false + mob.chargeState.stop() } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MSoundEvents.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MSoundEvents.kt index 04daae5ed..5c38d8ded 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MSoundEvents.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MSoundEvents.kt @@ -27,6 +27,8 @@ object MSoundEvents { val LOADER_AMBIENT by make("loader_ambient") + val ENFORCER_ALERT by make("enforcer_alert") + fun register(bus: IEventBus) { registry.register(bus) } diff --git a/src/main/resources/assets/overdrive_that_matters/sounds/entity/enforcer/enforcer_alert.ogg b/src/main/resources/assets/overdrive_that_matters/sounds/entity/enforcer/enforcer_alert.ogg new file mode 100644 index 000000000..e3152ba6f Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/sounds/entity/enforcer/enforcer_alert.ogg differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/arena/arena_a.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/arena/arena_a.nbt new file mode 100644 index 000000000..f20f76ee8 Binary files /dev/null and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/arena/arena_a.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/crossroads/crossroad_a.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/crossroads/crossroad_a.nbt new file mode 100644 index 000000000..1e3bb21e7 Binary files /dev/null and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/crossroads/crossroad_a.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/crossroads/vertical_a.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/crossroads/vertical_a.nbt deleted file mode 100644 index 24a334816..000000000 Binary files a/src/main/resources/data/overdrive_that_matters/structure/laboratory/crossroads/vertical_a.nbt and /dev/null differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/entrance/entrance_a.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/entrance/entrance_a.nbt index 5c3803c88..ffffeca14 100644 Binary files a/src/main/resources/data/overdrive_that_matters/structure/laboratory/entrance/entrance_a.nbt and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/entrance/entrance_a.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/halls/hall1/hall_overgrown.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/halls/hall1/hall_overgrown.nbt index 2f1c93fd7..92d0367a1 100644 Binary files a/src/main/resources/data/overdrive_that_matters/structure/laboratory/halls/hall1/hall_overgrown.nbt and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/halls/hall1/hall_overgrown.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/office_b.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/office_b.nbt index adcff378b..09f5f30ea 100644 Binary files a/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/office_b.nbt and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/office_b.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/reactor.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/reactor.nbt new file mode 100644 index 000000000..d37405dd4 Binary files /dev/null and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/reactor.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/vertical_a.nbt b/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/vertical_a.nbt new file mode 100644 index 000000000..b8742b970 Binary files /dev/null and b/src/main/resources/data/overdrive_that_matters/structure/laboratory/rooms/vertical_a.nbt differ diff --git a/src/main/resources/data/overdrive_that_matters/worldgen/structure/laboratory.json b/src/main/resources/data/overdrive_that_matters/worldgen/structure/laboratory.json index 8f921d6ee..262f6f5e6 100644 --- a/src/main/resources/data/overdrive_that_matters/worldgen/structure/laboratory.json +++ b/src/main/resources/data/overdrive_that_matters/worldgen/structure/laboratory.json @@ -32,7 +32,7 @@ } }, "start_jigsaw_name": "overdrive_that_matters:laboratory_anchor", - "start_pool": "overdrive_that_matters:laboratory/entrance", + "start_pool": "overdrive_that_matters:laboratory/crossroads", "step": "underground_structures", "terrain_adaptation": "encapsulate", "use_expansion_hack": false diff --git a/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/arena.json b/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/arena.json new file mode 100644 index 000000000..34b043894 --- /dev/null +++ b/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/arena.json @@ -0,0 +1,15 @@ +{ + "name": "overdrive_that_matters:entrance", + "elements": [ + { + "element": { + "element_type": "minecraft:single_pool_element", + "location": "overdrive_that_matters:laboratory/arena/arena_a", + "processors": "overdrive_that_matters:laboratory_weathering", + "projection": "rigid" + }, + "weight": 1 + } + ], + "fallback": "minecraft:empty" +} \ No newline at end of file diff --git a/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/crossroads.json b/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/crossroads.json index 78b45a506..f40cbbda9 100644 --- a/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/crossroads.json +++ b/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/crossroads.json @@ -4,7 +4,7 @@ { "element": { "element_type": "minecraft:single_pool_element", - "location": "overdrive_that_matters:laboratory/crossroads/vertical_a", + "location": "overdrive_that_matters:laboratory/crossroads/crossroad_a", "processors": "overdrive_that_matters:laboratory_weathering", "projection": "rigid" }, diff --git a/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/rooms.json b/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/rooms.json index adeebe432..cd9068ce5 100644 --- a/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/rooms.json +++ b/src/main/resources/data/overdrive_that_matters/worldgen/template_pool/laboratory/rooms.json @@ -8,7 +8,7 @@ "processors": "overdrive_that_matters:laboratory_weathering", "projection": "rigid" }, - "weight": 1 + "weight": 3 }, { "element": { @@ -16,8 +16,26 @@ "location": "overdrive_that_matters:laboratory/rooms/office_b", "processors": "overdrive_that_matters:laboratory_weathering", "projection": "rigid" + }, + "weight": 3 + }, + { + "element": { + "element_type": "minecraft:single_pool_element", + "location": "overdrive_that_matters:laboratory/rooms/vertical_a", + "processors": "overdrive_that_matters:laboratory_weathering", + "projection": "rigid" }, "weight": 1 + }, + { + "element": { + "element_type": "minecraft:single_pool_element", + "location": "overdrive_that_matters:laboratory/rooms/reactor", + "processors": "overdrive_that_matters:laboratory_weathering", + "projection": "rigid" + }, + "weight": 2 } ], "fallback": "overdrive_that_matters:laboratory/fallback_pool"