This commit is contained in:
GearShocky 2025-03-13 10:45:42 +05:00
parent 4fc7bc62ae
commit 1670e14ae8
16 changed files with 75 additions and 9 deletions

View File

@ -216,15 +216,15 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Mattery
//no way null malware reference //no way null malware reference
val tempLevel = level val tempLevel = level
if (tempLevel?.otmRandom!!.nextFloat() < 0.8f) { if (tempLevel?.random!!.nextFloat() < 0.8f) {
val size = gravitationStrength.pow(0.5) val size = gravitationStrength.pow(0.5)
val eventHorizonRadius = size / 2 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 theta = tempLevel.random.nextDouble() * Math.PI * 2
val phi = tempLevel.otmRandom.nextDouble() * Math.PI - Math.PI / 2 val phi = tempLevel.random.nextDouble() * Math.PI - Math.PI / 2
//мугек я не ощущаю центр //мугек я не ощущаю центр
//хз нужно настроить //хз нужно настроить

View File

@ -1,6 +1,8 @@
package ru.dbotthepony.mc.otm.entity package ru.dbotthepony.mc.otm.entity
import net.minecraft.core.particles.ParticleTypes
import net.minecraft.server.level.ServerBossEvent import net.minecraft.server.level.ServerBossEvent
import net.minecraft.server.level.ServerLevel
import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource 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.npc.Villager
import net.minecraft.world.entity.player.Player import net.minecraft.world.entity.player.Player
import net.minecraft.world.level.Level import net.minecraft.world.level.Level
import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MNames
import ru.dbotthepony.mc.otm.registry.game.MSoundEvents import ru.dbotthepony.mc.otm.registry.game.MSoundEvents
@ -41,6 +44,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
entity is Zombie || entity is Zombie ||
entity is AbstractSkeleton entity is AbstractSkeleton
}) })
goalSelector.addGoal(2, RammingGoal(this)) goalSelector.addGoal(2, RammingGoal(this))
targetSelector.addGoal(1, HurtByTargetGoal(this)) targetSelector.addGoal(1, HurtByTargetGoal(this))
} }
@ -58,7 +62,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
override fun getDeathSound(): SoundEvent { override fun getDeathSound(): SoundEvent {
return SoundEvents.VAULT_BREAK return SoundEvents.VAULT_BREAK
} }
///boss healthbar
private val bossEvent: ServerBossEvent = private val bossEvent: ServerBossEvent =
ServerBossEvent(TranslatableComponent(MNames.ENFORCER), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS) ServerBossEvent(TranslatableComponent(MNames.ENFORCER), BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.PROGRESS)
@ -81,6 +85,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
super.die(cause) super.die(cause)
bossEvent.removeAllPlayers() bossEvent.removeAllPlayers()
} }
///
//charge attack, could possibly leave a smoke trail too idk //charge attack, could possibly leave a smoke trail too idk
class RammingGoal(private val mob: Enforcer) : Goal() { class RammingGoal(private val mob: Enforcer) : Goal() {
@ -110,7 +115,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
} }
override fun start() { override fun start() {
mob.playSound(MSoundEvents.PLASMA_WEAPON_OVERHEAT, 1.0f, 1.0f) mob.playSound(MSoundEvents.ENFORCER_ALERT, 1.0f, 1.0f)
chargeTime = 0 chargeTime = 0
mob.navigation.stop() mob.navigation.stop()
cooldown = minCooldown + mob.random.nextInt(maxCooldown - minCooldown) cooldown = minCooldown + mob.random.nextInt(maxCooldown - minCooldown)
@ -132,6 +137,30 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
return 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 (chargeTime == windupTime) {
if (chargeDir == null || chargeDir!!.length() < 0.1) { if (chargeDir == null || chargeDir!!.length() < 0.1) {
stop() stop()
@ -163,6 +192,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
if (mob.boundingBox.intersects(target.boundingBox)) { if (mob.boundingBox.intersects(target.boundingBox)) {
val knockbackStrength = 1.5 val knockbackStrength = 1.5
val knockback = dir.scale(knockbackStrength) val knockback = dir.scale(knockbackStrength)
target.push(knockback.x, 0.5, knockback.z) target.push(knockback.x, 0.5, knockback.z)
val damageAmount = 6.0f val damageAmount = 6.0f
@ -177,6 +207,7 @@ class Enforcer(type: EntityType<Enforcer>, level: Level) : Monster(type,level) {
chargeTime = 0 chargeTime = 0
chargeDir = null chargeDir = null
isCharging = false isCharging = false
mob.chargeState.stop() mob.chargeState.stop()
} }
} }

View File

@ -27,6 +27,8 @@ object MSoundEvents {
val LOADER_AMBIENT by make("loader_ambient") val LOADER_AMBIENT by make("loader_ambient")
val ENFORCER_ALERT by make("enforcer_alert")
fun register(bus: IEventBus) { fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)
} }

View File

@ -32,7 +32,7 @@
} }
}, },
"start_jigsaw_name": "overdrive_that_matters:laboratory_anchor", "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", "step": "underground_structures",
"terrain_adaptation": "encapsulate", "terrain_adaptation": "encapsulate",
"use_expansion_hack": false "use_expansion_hack": false

View File

@ -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"
}

View File

@ -4,7 +4,7 @@
{ {
"element": { "element": {
"element_type": "minecraft:single_pool_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", "processors": "overdrive_that_matters:laboratory_weathering",
"projection": "rigid" "projection": "rigid"
}, },

View File

@ -8,7 +8,7 @@
"processors": "overdrive_that_matters:laboratory_weathering", "processors": "overdrive_that_matters:laboratory_weathering",
"projection": "rigid" "projection": "rigid"
}, },
"weight": 1 "weight": 3
}, },
{ {
"element": { "element": {
@ -16,8 +16,26 @@
"location": "overdrive_that_matters:laboratory/rooms/office_b", "location": "overdrive_that_matters:laboratory/rooms/office_b",
"processors": "overdrive_that_matters:laboratory_weathering", "processors": "overdrive_that_matters:laboratory_weathering",
"projection": "rigid" "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 "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" "fallback": "overdrive_that_matters:laboratory/fallback_pool"