调整配方,限制炮手视角。添加爆炸超压伤害

This commit is contained in:
Atsuihsio 2024-08-29 14:27:01 +08:00
parent b3524d203a
commit c5e6399d9e
14 changed files with 33 additions and 12 deletions

View file

@ -348,6 +348,17 @@ public class Mk42Entity extends PathfinderMob implements GeoEntity, ICannonEntit
public static void init() { public static void init() {
} }
protected void clampRotation(Entity entity) {
float f = Mth.wrapDegrees(entity.getXRot());
float f1 = Mth.clamp(f, -85.0F, 15.0F);
entity.xRotO += f1 - f;
entity.setXRot(entity.getXRot() + f1 - f);
}
@Override
public void onPassengerTurned(Entity entity) {
this.clampRotation(entity);
}
public static AttributeSupplier.Builder createAttributes() { public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes() return Mob.createMobAttributes()
.add(Attributes.MOVEMENT_SPEED, 0) .add(Attributes.MOVEMENT_SPEED, 0)

View file

@ -377,6 +377,16 @@ public class Mle1934Entity extends PathfinderMob implements GeoEntity, ICannonEn
public static void init() { public static void init() {
} }
protected void clampRotation(Entity entity) {
float f = Mth.wrapDegrees(entity.getXRot());
float f1 = Mth.clamp(f, -30.0F, 4.0F);
entity.xRotO += f1 - f;
entity.setXRot(entity.getXRot() + f1 - f);
}
@Override
public void onPassengerTurned(Entity entity) {
this.clampRotation(entity);
}
public static AttributeSupplier.Builder createAttributes() { public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes() return Mob.createMobAttributes()

View file

@ -90,7 +90,7 @@ public class MortarShellEntity extends ThrowableItemProjectile {
super.tick(); super.tick();
if (this.level() instanceof ServerLevel serverLevel) { if (this.level() instanceof ServerLevel serverLevel) {
ParticleTool.sendParticle(serverLevel, ParticleTypes.CAMPFIRE_COSY_SMOKE, this.xo, this.yo, this.zo, ParticleTool.sendParticle(serverLevel, ParticleTypes.CAMPFIRE_COSY_SMOKE, this.xo, this.yo, this.zo,
2, 0, 0, 0, 0.02, true); 1, 0, 0, 0, 0.001, true);
} }
if (this.tickCount > 600 || this.isInWater()) { if (this.tickCount > 600 || this.isInWater()) {
if (this.level() instanceof ServerLevel) { if (this.level() instanceof ServerLevel) {

View file

@ -143,7 +143,7 @@ public class CustomExplosion extends Explosion {
xDistance /= distance; xDistance /= distance;
yDistance /= distance; yDistance /= distance;
zDistance /= distance; zDistance /= distance;
double seenPercent = getSeenPercent(position, entity); double seenPercent = Mth.clamp(getSeenPercent(position, entity),0.25,Double.POSITIVE_INFINITY);
double damagePercent = (1.0D - distanceRate) * seenPercent; double damagePercent = (1.0D - distanceRate) * seenPercent;
double damageFinal = (damagePercent * damagePercent + damagePercent) / 2.0D * damage; double damageFinal = (damagePercent * damagePercent + damagePercent) / 2.0D * damage;

View file

@ -14,7 +14,7 @@
"item": "minecraft:iron_ingot" "item": "minecraft:iron_ingot"
}, },
"c": { "c": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
}, },
"d": { "d": {
"item": "superbwarfare:tungsten_rod" "item": "superbwarfare:tungsten_rod"

View file

@ -14,7 +14,7 @@
"item": "minecraft:iron_ingot" "item": "minecraft:iron_ingot"
}, },
"c": { "c": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
} }
}, },
"result": { "result": {

View file

@ -7,7 +7,7 @@
], ],
"key": { "key": {
"a": { "a": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
}, },
"b": { "b": {
"item": "minecraft:stick" "item": "minecraft:stick"

View file

@ -11,7 +11,7 @@
"item": "superbwarfare:fusee" "item": "superbwarfare:fusee"
}, },
"b": { "b": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
}, },
"c": { "c": {
"item": "superbwarfare:high_energy_explosives" "item": "superbwarfare:high_energy_explosives"

View file

@ -8,7 +8,7 @@
], ],
"key": { "key": {
"a": { "a": {
"tag": "forge:ingots/steel" "tag":"forge:ingots/steel"
}, },
"b": { "b": {
"tag": "forge:plates/copper" "tag": "forge:plates/copper"

View file

@ -7,7 +7,7 @@
], ],
"key": { "key": {
"a": { "a": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
} }
}, },
"result": { "result": {

View file

@ -6,7 +6,7 @@
], ],
"key": { "key": {
"a": { "a": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
} }
}, },
"result": { "result": {

View file

@ -8,7 +8,7 @@
], ],
"key": { "key": {
"a": { "a": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
} }
}, },
"result": { "result": {

View file

@ -10,7 +10,7 @@
"item": "minecraft:tripwire_hook" "item": "minecraft:tripwire_hook"
}, },
"b": { "b": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
} }
}, },
"result": { "result": {

View file

@ -11,7 +11,7 @@
"item": "minecraft:target" "item": "minecraft:target"
}, },
"b": { "b": {
"item": "superbwarfare:ingot_steel" "tag":"forge:ingots/steel"
}, },
"c": { "c": {
"item": "minecraft:armor_stand" "item": "minecraft:armor_stand"