简化弹药配方

This commit is contained in:
Atsuihsio 2024-06-28 20:37:17 +08:00
parent 56d43058b5
commit 3417cd381c
7 changed files with 79 additions and 51 deletions

View file

@ -72,7 +72,7 @@ public class FragEntity extends ThrowableItemProjectile {
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5)); TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
entity.hurt(TargetModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()), entity.hurt(TargetModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
5 - (float) Mth.clamp(0.2 * this.position0.distanceTo(entity.position()) 5 - (float) Mth.clamp(0.1 * this.position0.distanceTo(entity.position())
* (entity instanceof LivingEntity livingEntity ? livingEntity.getMaxHealth() / 100 + 1 : 1), 0, 4.5)); * (entity instanceof LivingEntity livingEntity ? livingEntity.getMaxHealth() / 100 + 1 : 1), 0, 4.5));
} }
} }

View file

@ -178,7 +178,7 @@ public class GunGrenadeEntity extends ThrowableItemProjectile {
explosion.finalizeExplosion(false); explosion.finalizeExplosion(false);
ParticleTool.spawnMediumExplosionParticles(this.level(), this.position()); ParticleTool.spawnMediumExplosionParticles(this.level(), this.position());
for (int index0 = 0; index0 < 50; index0++) { for (int index0 = 0; index0 < 100; index0++) {
fragShoot(); fragShoot();
} }
} }

View file

@ -68,19 +68,19 @@ public class GunRecycleGuiButtonMessage {
if (gun.is(TargetModTags.Items.GUN)) { if (gun.is(TargetModTags.Items.GUN)) {
// 普通稀有度 // 普通稀有度
var material = switch (gun.getRarity()) { var material = switch (gun.getRarity()) {
case COMMON -> Items.IRON_INGOT; case COMMON -> TargetModItems.COMMON_MATERIAL_PACK.get();
case RARE -> TargetModItems.INGOT_STEEL.get(); case RARE -> TargetModItems.RARE_MATERIAL_PACK.get();
case EPIC -> TargetModItems.CEMENTED_CARBIDE_INGOT.get(); case EPIC -> TargetModItems.EPIC_MATERIAL_PACK.get();
default -> null; default -> null;
}; };
if (material != null) ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(material)); if (material != null) ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(material));
// 特殊稀有度 // 特殊稀有度
if (gun.is(TargetModTags.Items.LEGENDARY_GUN)) { if (gun.is(TargetModTags.Items.LEGENDARY_GUN)) {
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Items.NETHERITE_INGOT)); ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(TargetModItems.LEGENDARY_MATERIAL_PACK.get()));
} }
if (gun.is(TargetModTags.Items.SPECIAL_GUN)) { if (gun.is(TargetModTags.Items.SPECIAL_GUN)) {
ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(TargetModItems.SOUL_STEEL_INGOT.get())); ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(TargetModItems.SPECIAL_MATERIAL_PACK.get()));
} }
// 高等级额外奖励 // 高等级额外奖励

View file

@ -1,19 +1,26 @@
{ {
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shapeless",
"category": "misc", "category": "misc",
"pattern": [ "ingredients": [
"aaa", {
"aaa",
"bbb"
],
"key": {
"a": {
"item": "target:handgun_ammo" "item": "target:handgun_ammo"
}, },
"b": { {
"item": "minecraft:paper" "item": "target:handgun_ammo"
},
{
"item": "target:handgun_ammo"
},
{
"item": "target:handgun_ammo"
},
{
"item": "target:handgun_ammo"
},
{
"item": "target:handgun_ammo"
} }
}, ],
"result": { "result": {
"item": "target:handgun_ammo_box", "item": "target:handgun_ammo_box",
"count": 1 "count": 1

View file

@ -1,19 +1,26 @@
{ {
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shapeless",
"category": "misc", "category": "misc",
"pattern": [ "ingredients": [
"aaa", {
"aaa",
"bbb"
],
"key": {
"a": {
"item": "target:rifle_ammo" "item": "target:rifle_ammo"
}, },
"b": { {
"item": "minecraft:paper" "item": "target:rifle_ammo"
},
{
"item": "target:rifle_ammo"
},
{
"item": "target:rifle_ammo"
},
{
"item": "target:rifle_ammo"
},
{
"item": "target:rifle_ammo"
} }
}, ],
"result": { "result": {
"item": "target:rifle_ammo_box", "item": "target:rifle_ammo_box",
"count": 1 "count": 1

View file

@ -1,19 +1,26 @@
{ {
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shapeless",
"category": "misc", "category": "misc",
"pattern": [ "ingredients": [
"aaa", {
"aaa",
"bbb"
],
"key": {
"a": {
"item": "target:shotgun_ammo" "item": "target:shotgun_ammo"
}, },
"b": { {
"item": "minecraft:paper" "item": "target:shotgun_ammo"
},
{
"item": "target:shotgun_ammo"
},
{
"item": "target:shotgun_ammo"
},
{
"item": "target:shotgun_ammo"
},
{
"item": "target:shotgun_ammo"
} }
}, ],
"result": { "result": {
"item": "target:shotgun_ammo_box", "item": "target:shotgun_ammo_box",
"count": 1 "count": 1

View file

@ -1,19 +1,26 @@
{ {
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shapeless",
"category": "misc", "category": "misc",
"pattern": [ "ingredients": [
"aaa", {
"aaa",
"bbb"
],
"key": {
"a": {
"item": "target:sniper_ammo" "item": "target:sniper_ammo"
}, },
"b": { {
"item": "minecraft:paper" "item": "target:sniper_ammo"
},
{
"item": "target:sniper_ammo"
},
{
"item": "target:sniper_ammo"
},
{
"item": "target:sniper_ammo"
},
{
"item": "target:sniper_ammo"
} }
}, ],
"result": { "result": {
"item": "target:sniper_ammo_box", "item": "target:sniper_ammo_box",
"count": 1 "count": 1