数值平衡,再次修复不能强制打断单发装填类换弹的bug
This commit is contained in:
parent
8214d9bbe9
commit
14addf7f1e
13 changed files with 120 additions and 50 deletions
|
@ -353,13 +353,19 @@ public class ClickHandler {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PacketDistributor.sendToServer(new FireMessage(0));
|
PacketDistributor.sendToServer(new FireMessage(0));
|
||||||
if (GunsTool.getGunIntTag(tag, "FireMode") == 1) {
|
if ((!(tag.getBoolean("is_normal_reloading") || tag.getBoolean("is_empty_reloading"))
|
||||||
if (ClientEventHandler.burstFireSize == 0) {
|
&& !GunsTool.getGunBooleanTag(tag, "Reloading")
|
||||||
ClientEventHandler.burstFireSize = GunsTool.getGunIntTag(tag, "BurstSize");
|
&& !GunsTool.getGunBooleanTag(tag, "Charging")
|
||||||
}
|
&& !GunsTool.getGunBooleanTag(tag, "NeedBoltAction"))
|
||||||
} else {
|
&& drawTime < 0.01) {
|
||||||
if (!stack.is(ModItems.BOCEK.get())) {
|
if (GunsTool.getGunIntTag(tag, "FireMode") == 1) {
|
||||||
ClientEventHandler.holdFire = true;
|
if (ClientEventHandler.burstFireSize == 0) {
|
||||||
|
ClientEventHandler.burstFireSize = GunsTool.getGunIntTag(tag, "BurstSize");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!stack.is(ModItems.BOCEK.get())) {
|
||||||
|
ClientEventHandler.holdFire = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,23 +337,7 @@ public class CannonShellEntity extends FastThrowableProjectile implements GeoEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlayState movementPredicate(AnimationState<CannonShellEntity> event) {
|
private PlayState movementPredicate(AnimationState<CannonShellEntity> event) {
|
||||||
if (this.animationProcedure.equals("empty")) {
|
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.cannon_shell.idle"));
|
||||||
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.cannon_shell.idle"));
|
|
||||||
}
|
|
||||||
return PlayState.STOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PlayState procedurePredicate(AnimationState<CannonShellEntity> event) {
|
|
||||||
if (!animationProcedure.equals("empty") && event.getController().getAnimationState() == AnimationController.State.STOPPED) {
|
|
||||||
event.getController().setAnimation(RawAnimation.begin().thenPlay(this.animationProcedure));
|
|
||||||
if (event.getController().getAnimationState() == AnimationController.State.STOPPED) {
|
|
||||||
this.animationProcedure = "empty";
|
|
||||||
event.getController().forceAnimationReset();
|
|
||||||
}
|
|
||||||
} else if (animationProcedure.equals("empty")) {
|
|
||||||
return PlayState.STOP;
|
|
||||||
}
|
|
||||||
return PlayState.CONTINUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -364,7 +348,6 @@ public class CannonShellEntity extends FastThrowableProjectile implements GeoEnt
|
||||||
@Override
|
@Override
|
||||||
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
|
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
|
||||||
data.add(new AnimationController<>(this, "movement", 0, this::movementPredicate));
|
data.add(new AnimationController<>(this, "movement", 0, this::movementPredicate));
|
||||||
data.add(new AnimationController<>(this, "procedure", 0, this::procedurePredicate));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,8 +5,8 @@ import com.atsuishio.superbwarfare.init.ModDamageTypes;
|
||||||
import com.atsuishio.superbwarfare.init.ModEntities;
|
import com.atsuishio.superbwarfare.init.ModEntities;
|
||||||
import com.atsuishio.superbwarfare.init.ModItems;
|
import com.atsuishio.superbwarfare.init.ModItems;
|
||||||
import com.atsuishio.superbwarfare.tools.ChunkLoadTool;
|
import com.atsuishio.superbwarfare.tools.ChunkLoadTool;
|
||||||
|
import com.atsuishio.superbwarfare.tools.CustomExplosion;
|
||||||
import com.atsuishio.superbwarfare.tools.ParticleTool;
|
import com.atsuishio.superbwarfare.tools.ParticleTool;
|
||||||
import com.atsuishio.superbwarfare.tools.ProjectileTool;
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.component.DataComponents;
|
import net.minecraft.core.component.DataComponents;
|
||||||
|
@ -26,11 +26,14 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.alchemy.Potion;
|
import net.minecraft.world.item.alchemy.Potion;
|
||||||
import net.minecraft.world.item.alchemy.PotionContents;
|
import net.minecraft.world.item.alchemy.PotionContents;
|
||||||
import net.minecraft.world.item.alchemy.Potions;
|
import net.minecraft.world.item.alchemy.Potions;
|
||||||
|
import net.minecraft.world.level.Explosion;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.BellBlock;
|
import net.minecraft.world.level.block.BellBlock;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.EntityHitResult;
|
import net.minecraft.world.phys.EntityHitResult;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import net.neoforged.neoforge.event.EventHooks;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import software.bernie.geckolib.animatable.GeoEntity;
|
import software.bernie.geckolib.animatable.GeoEntity;
|
||||||
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
||||||
|
@ -179,7 +182,7 @@ public class MortarShellEntity extends FastThrowableProjectile implements GeoEnt
|
||||||
Entity entity = entityHitResult.getEntity();
|
Entity entity = entityHitResult.getEntity();
|
||||||
entity.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), this, this.getOwner()), this.damage);
|
entity.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), this, this.getOwner()), this.damage);
|
||||||
if (this.level() instanceof ServerLevel) {
|
if (this.level() instanceof ServerLevel) {
|
||||||
ProjectileTool.causeCustomExplode(this, this.damage, this.radius);
|
causeExplode(entityHitResult.getLocation());
|
||||||
this.createAreaCloud(this.level());
|
this.createAreaCloud(this.level());
|
||||||
}
|
}
|
||||||
this.discard();
|
this.discard();
|
||||||
|
@ -196,7 +199,7 @@ public class MortarShellEntity extends FastThrowableProjectile implements GeoEnt
|
||||||
}
|
}
|
||||||
if (!this.level().isClientSide() && this.level() instanceof ServerLevel) {
|
if (!this.level().isClientSide() && this.level() instanceof ServerLevel) {
|
||||||
if (this.tickCount > 1) {
|
if (this.tickCount > 1) {
|
||||||
ProjectileTool.causeCustomExplode(this, this.damage, this.radius);
|
causeExplode(blockHitResult.getLocation());
|
||||||
this.createAreaCloud(this.level());
|
this.createAreaCloud(this.level());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,13 +218,31 @@ public class MortarShellEntity extends FastThrowableProjectile implements GeoEnt
|
||||||
}
|
}
|
||||||
if (this.tickCount > this.life || this.isInWater()) {
|
if (this.tickCount > this.life || this.isInWater()) {
|
||||||
if (this.level() instanceof ServerLevel) {
|
if (this.level() instanceof ServerLevel) {
|
||||||
ProjectileTool.causeCustomExplode(this, this.damage, this.radius);
|
causeExplode(position());
|
||||||
this.createAreaCloud(this.level());
|
this.createAreaCloud(this.level());
|
||||||
}
|
}
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void causeExplode(Vec3 vec3) {
|
||||||
|
CustomExplosion explosion = new CustomExplosion(this.level(), this,
|
||||||
|
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(),
|
||||||
|
this,
|
||||||
|
this.getOwner()),
|
||||||
|
damage,
|
||||||
|
vec3.x,
|
||||||
|
vec3.y,
|
||||||
|
vec3.z,
|
||||||
|
radius,
|
||||||
|
ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).
|
||||||
|
setDamageMultiplier(1.25f);
|
||||||
|
explosion.explode();
|
||||||
|
EventHooks.onExplosionStart(this.level(), explosion);
|
||||||
|
explosion.finalizeExplosion(false);
|
||||||
|
ParticleTool.spawnMediumExplosionParticles(this.level(), vec3);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
|
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import com.atsuishio.superbwarfare.init.ModSounds;
|
||||||
import com.atsuishio.superbwarfare.network.message.receive.ClientIndicatorMessage;
|
import com.atsuishio.superbwarfare.network.message.receive.ClientIndicatorMessage;
|
||||||
import com.atsuishio.superbwarfare.tools.CustomExplosion;
|
import com.atsuishio.superbwarfare.tools.CustomExplosion;
|
||||||
import com.atsuishio.superbwarfare.tools.ParticleTool;
|
import com.atsuishio.superbwarfare.tools.ParticleTool;
|
||||||
import com.atsuishio.superbwarfare.tools.ProjectileTool;
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
@ -85,10 +84,8 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G
|
||||||
entity.invulnerableTime = 0;
|
entity.invulnerableTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tickCount > 0) {
|
if (this.tickCount > 0 && this.level() instanceof ServerLevel) {
|
||||||
if (this.level() instanceof ServerLevel) {
|
causeExplode(result.getLocation());
|
||||||
causeExplode(entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
@ -102,30 +99,27 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G
|
||||||
bell.attemptToRing(this.level(), resultPos, blockHitResult.getDirection());
|
bell.attemptToRing(this.level(), resultPos, blockHitResult.getDirection());
|
||||||
}
|
}
|
||||||
if (this.level() instanceof ServerLevel) {
|
if (this.level() instanceof ServerLevel) {
|
||||||
causeExplodeBlock(blockHitResult);
|
causeExplode(blockHitResult.getLocation());
|
||||||
}
|
}
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void causeExplode(Entity entity) {
|
private void causeExplode(Vec3 vec3) {
|
||||||
CustomExplosion explosion = new CustomExplosion(this.level(), this,
|
CustomExplosion explosion = new CustomExplosion(this.level(), this,
|
||||||
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(),
|
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(),
|
||||||
this,
|
this,
|
||||||
this.getOwner()),
|
this.getOwner()),
|
||||||
explosionDamage,
|
explosionDamage,
|
||||||
entity.getX(),
|
vec3.x,
|
||||||
entity.getY() + 0.6 * entity.getBbHeight(),
|
vec3.y,
|
||||||
entity.getZ(),
|
vec3.z,
|
||||||
explosionRadius,
|
explosionRadius,
|
||||||
ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).
|
ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).
|
||||||
setDamageMultiplier(1.25f);
|
setDamageMultiplier(1.25f);
|
||||||
explosion.explode();
|
explosion.explode();
|
||||||
EventHooks.onExplosionStart(this.level(), explosion);
|
EventHooks.onExplosionStart(this.level(), explosion);
|
||||||
explosion.finalizeExplosion(false);
|
explosion.finalizeExplosion(false);
|
||||||
ParticleTool.spawnSmallExplosionParticles(this.level(),
|
ParticleTool.spawnSmallExplosionParticles(this.level(), vec3);
|
||||||
new Vec3(entity.getX(),
|
|
||||||
entity.getEyeY(),
|
|
||||||
entity.getZ()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void causeExplodeBlock(HitResult result) {
|
private void causeExplodeBlock(HitResult result) {
|
||||||
|
@ -161,9 +155,7 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G
|
||||||
|
|
||||||
if (this.tickCount > 200 || this.isInWater()) {
|
if (this.tickCount > 200 || this.isInWater()) {
|
||||||
if (this.level() instanceof ServerLevel && !onGround()) {
|
if (this.level() instanceof ServerLevel && !onGround()) {
|
||||||
ProjectileTool.causeCustomExplode(this,
|
causeExplode(position());
|
||||||
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
|
|
||||||
this, this.explosionDamage, this.explosionRadius, 1.25f);
|
|
||||||
}
|
}
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,6 +154,15 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
||||||
.multiply(0.16f, ModTags.DamageTypes.PROJECTILE)
|
.multiply(0.16f, ModTags.DamageTypes.PROJECTILE)
|
||||||
.multiply(10, ModDamageTypes.VEHICLE_STRIKE)
|
.multiply(10, ModDamageTypes.VEHICLE_STRIKE)
|
||||||
.custom((source, damage) -> {
|
.custom((source, damage) -> {
|
||||||
|
if (source.getDirectEntity() instanceof CannonShellEntity) {
|
||||||
|
return 0.9f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof SmallCannonShellEntity) {
|
||||||
|
return 1.3f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 2.2f * damage;
|
||||||
|
}
|
||||||
if (source.getDirectEntity() instanceof MelonBombEntity) {
|
if (source.getDirectEntity() instanceof MelonBombEntity) {
|
||||||
return 2f * damage;
|
return 2f * damage;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ import com.atsuishio.superbwarfare.component.ModDataComponents;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.C4Entity;
|
import com.atsuishio.superbwarfare.entity.projectile.C4Entity;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.CannonShellEntity;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.EnergyVehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.EnergyVehicleEntity;
|
||||||
|
@ -221,6 +223,12 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity,
|
||||||
if (source.getDirectEntity() instanceof MelonBombEntity) {
|
if (source.getDirectEntity() instanceof MelonBombEntity) {
|
||||||
return 8f * damage;
|
return 8f * damage;
|
||||||
}
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 3f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof CannonShellEntity) {
|
||||||
|
return 3f * damage;
|
||||||
|
}
|
||||||
return damage;
|
return damage;
|
||||||
})
|
})
|
||||||
.reduce(12);
|
.reduce(12);
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle;
|
||||||
import com.atsuishio.superbwarfare.Mod;
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
||||||
|
@ -155,6 +156,9 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit
|
||||||
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
||||||
return 3f * damage;
|
return 3f * damage;
|
||||||
}
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 1.5f * damage;
|
||||||
|
}
|
||||||
return damage;
|
return damage;
|
||||||
})
|
})
|
||||||
.reduce(8);
|
.reduce(8);
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle;
|
||||||
import com.atsuishio.superbwarfare.Mod;
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
||||||
|
@ -137,6 +138,9 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt
|
||||||
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
||||||
return 3f * damage;
|
return 3f * damage;
|
||||||
}
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 1.5f * damage;
|
||||||
|
}
|
||||||
return damage;
|
return damage;
|
||||||
})
|
})
|
||||||
.reduce(7);
|
.reduce(7);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.atsuishio.superbwarfare.client.gui.RangeHelper;
|
||||||
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ThirdPersonCameraPosition;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ThirdPersonCameraPosition;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
|
||||||
|
@ -188,6 +189,12 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity
|
||||||
.multiply(0.85f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
|
.multiply(0.85f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
|
||||||
.multiply(10f, ModDamageTypes.VEHICLE_STRIKE)
|
.multiply(10f, ModDamageTypes.VEHICLE_STRIKE)
|
||||||
.custom((source, damage) -> getSourceAngle(source, 1f) * damage)
|
.custom((source, damage) -> getSourceAngle(source, 1f) * damage)
|
||||||
|
.custom((source, damage) -> {
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 1.5f * damage;
|
||||||
|
}
|
||||||
|
return damage;
|
||||||
|
})
|
||||||
.reduce(8);
|
.reduce(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.atsuishio.superbwarfare.client.gui.RangeHelper;
|
||||||
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ThirdPersonCameraPosition;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ThirdPersonCameraPosition;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
|
||||||
|
@ -213,6 +214,12 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt
|
||||||
.multiply(0.85f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
|
.multiply(0.85f, ModTags.DamageTypes.PROJECTILE_ABSOLUTE)
|
||||||
.multiply(10f, ModDamageTypes.VEHICLE_STRIKE)
|
.multiply(10f, ModDamageTypes.VEHICLE_STRIKE)
|
||||||
.custom((source, damage) -> getSourceAngle(source, 1f) * damage)
|
.custom((source, damage) -> getSourceAngle(source, 1f) * damage)
|
||||||
|
.custom((source, damage) -> {
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 1.5f * damage;
|
||||||
|
}
|
||||||
|
return damage;
|
||||||
|
})
|
||||||
.reduce(8);
|
.reduce(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle;
|
||||||
import com.atsuishio.superbwarfare.Mod;
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
||||||
|
@ -150,6 +151,9 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
|
||||||
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
||||||
return 3f * damage;
|
return 3f * damage;
|
||||||
}
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 1.5f * damage;
|
||||||
|
}
|
||||||
return damage;
|
return damage;
|
||||||
})
|
})
|
||||||
.reduce(9);
|
.reduce(9);
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle;
|
||||||
import com.atsuishio.superbwarfare.Mod;
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
|
import com.atsuishio.superbwarfare.entity.projectile.*;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.*;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.*;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
|
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.weapon.ProjectileWeapon;
|
import com.atsuishio.superbwarfare.entity.vehicle.weapon.ProjectileWeapon;
|
||||||
|
@ -105,6 +106,30 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
|
||||||
.multiply(0.8f, ModDamageTypes.CANNON_FIRE)
|
.multiply(0.8f, ModDamageTypes.CANNON_FIRE)
|
||||||
.multiply(0.16f, ModTags.DamageTypes.PROJECTILE)
|
.multiply(0.16f, ModTags.DamageTypes.PROJECTILE)
|
||||||
.multiply(2, ModDamageTypes.VEHICLE_STRIKE)
|
.multiply(2, ModDamageTypes.VEHICLE_STRIKE)
|
||||||
|
.custom((source, damage) -> {
|
||||||
|
if (source.getDirectEntity() instanceof CannonShellEntity) {
|
||||||
|
return 0.9f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof SmallCannonShellEntity) {
|
||||||
|
return 1.3f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 2.2f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof MelonBombEntity) {
|
||||||
|
return 2f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof RgoGrenadeEntity) {
|
||||||
|
return 6f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof HandGrenadeEntity) {
|
||||||
|
return 5f * damage;
|
||||||
|
}
|
||||||
|
if (source.getDirectEntity() instanceof MortarShellEntity) {
|
||||||
|
return 4f * damage;
|
||||||
|
}
|
||||||
|
return damage;
|
||||||
|
})
|
||||||
.reduce(2);
|
.reduce(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle;
|
||||||
import com.atsuishio.superbwarfare.Mod;
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.C4Entity;
|
import com.atsuishio.superbwarfare.entity.projectile.*;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
|
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.RpgRocketEntity;
|
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.SmallCannonShellEntity;
|
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.LandArmorEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.LandArmorEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ThirdPersonCameraPosition;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ThirdPersonCameraPosition;
|
||||||
|
@ -205,6 +202,9 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
||||||
if (source.getDirectEntity() instanceof RpgRocketEntity) {
|
if (source.getDirectEntity() instanceof RpgRocketEntity) {
|
||||||
return 1.5f * damage;
|
return 1.5f * damage;
|
||||||
}
|
}
|
||||||
|
if (source.getDirectEntity() instanceof GunGrenadeEntity) {
|
||||||
|
return 2f * damage;
|
||||||
|
}
|
||||||
return damage;
|
return damage;
|
||||||
})
|
})
|
||||||
.reduce(9);
|
.reduce(9);
|
||||||
|
|
Loading…
Add table
Reference in a new issue