去营业妨碍化加特林,添加了木仓管的过热变红特效
|
@ -32,6 +32,8 @@ public class MinigunItemModel extends GeoModel<Minigun> {
|
|||
CoreGeoBone gun = getAnimationProcessor().getBone("barrel");
|
||||
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
|
||||
CoreGeoBone light = getAnimationProcessor().getBone("light");
|
||||
CoreGeoBone heat_barrels = getAnimationProcessor().getBone("heatbarrels");
|
||||
|
||||
Player player = Minecraft.getInstance().player;
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
|
@ -42,6 +44,9 @@ public class MinigunItemModel extends GeoModel<Minigun> {
|
|||
}
|
||||
float times = 250f / fps;
|
||||
|
||||
float heat = (float)stack.getOrCreateTag().getDouble("heat");
|
||||
|
||||
heat_barrels.setScaleZ(4 * heat);
|
||||
|
||||
gun.setRotZ((float) (gun.getRotZ() + times * -0.008f * stack.getOrCreateTag().getDouble("minigun_rotation")));
|
||||
|
||||
|
@ -72,13 +77,14 @@ public class MinigunItemModel extends GeoModel<Minigun> {
|
|||
}
|
||||
|
||||
if (stack.getOrCreateTag().getInt("fire_animation") > 0) {
|
||||
flare.setHidden(false);
|
||||
light.setHidden(false);
|
||||
flare.setScaleX((float) (1 + 0.5 * (Math.random() - 0.5)));
|
||||
flare.setScaleY((float) (1 + 0.5 * (Math.random() - 0.5)));
|
||||
flare.setRotZ((float) (0.5 * (Math.random() - 0.5)));
|
||||
} else {
|
||||
flare.setScaleX(0);
|
||||
flare.setScaleY(0);
|
||||
flare.setRotZ(0);
|
||||
flare.setHidden(true);
|
||||
light.setHidden(true);
|
||||
|
||||
}
|
||||
|
||||
|
@ -125,5 +131,13 @@ public class MinigunItemModel extends GeoModel<Minigun> {
|
|||
move.setRotY(Mth.DEG_TO_RAD * (float) yRot);
|
||||
|
||||
move.setRotZ(2.7f * (float) m + Mth.DEG_TO_RAD * (float) zRot);
|
||||
|
||||
CoreGeoBone camera = getAnimationProcessor().getBone("camera");
|
||||
|
||||
player.getPersistentData().putDouble("camera_rot_x", Mth.RAD_TO_DEG * camera.getRotX());
|
||||
|
||||
player.getPersistentData().putDouble("camera_rot_y", Mth.RAD_TO_DEG * camera.getRotY());
|
||||
|
||||
player.getPersistentData().putDouble("camera_rot_z", Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ public class GunEventHandler {
|
|||
if (tag.getDouble("overheat") == 0
|
||||
&& (player.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).rifleAmmo > 0
|
||||
&& !(player.getCooldowns().isOnCooldown(stack.getItem())) && tag.getDouble("minigun_rotation") >= 10) {
|
||||
tag.putDouble("heat", (tag.getDouble("heat") + 1));
|
||||
tag.putDouble("heat", (tag.getDouble("heat") + 0.5));
|
||||
if (tag.getDouble("heat") >= 50.5) {
|
||||
tag.putDouble("overheat", 40);
|
||||
player.getCooldowns().addCooldown(stack.getItem(), 40);
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.client.player.LocalPlayer;
|
|||
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
|
@ -184,9 +185,18 @@ public class Minigun extends GunItem implements GeoItem, AnimatedItem {
|
|||
super.inventoryTick(itemstack, world, entity, slot, selected);
|
||||
if (entity == null)
|
||||
return;
|
||||
if (itemstack.getOrCreateTag().getDouble("heat") > 0) {
|
||||
itemstack.getOrCreateTag().putDouble("heat", (itemstack.getOrCreateTag().getDouble("heat") - 0.5));
|
||||
|
||||
double cooldown = 0;
|
||||
if(entity.wasInPowderSnow){
|
||||
cooldown = 0.75;
|
||||
} else if (entity.isInWaterOrRain()){
|
||||
cooldown = 0.2;
|
||||
} else if (entity.isOnFire() || entity.isInLava()){
|
||||
cooldown = -0.5;
|
||||
}
|
||||
|
||||
itemstack.getOrCreateTag().putDouble("heat", Mth.clamp(itemstack.getOrCreateTag().getDouble("heat") - 0.25 - cooldown,0,55));
|
||||
|
||||
if (itemstack.getOrCreateTag().getDouble("heat") == 0) {
|
||||
itemstack.getOrCreateTag().putDouble("heat_bar", 51);
|
||||
} else {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"format_version": "1.8.0",
|
||||
"animations": {
|
||||
"animation.minigun.idle": {
|
||||
"loop": true,
|
||||
"animation_length": 0.5,
|
||||
"bones": {
|
||||
"0": {
|
||||
|
@ -47,12 +46,29 @@
|
|||
"vector": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"camera": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"vector": [0, 0, 0]
|
||||
},
|
||||
"0.7083": {
|
||||
"vector": [0, 0, 0]
|
||||
},
|
||||
"1.0833": {
|
||||
"vector": [0.25, -0.5, 0.5],
|
||||
"easing": "easeInSine"
|
||||
},
|
||||
"1.4583": {
|
||||
"vector": [0, 0, 0],
|
||||
"easing": "easeOutSine"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.minigun.run": {
|
||||
"loop": true,
|
||||
"animation_length": 0.79167,
|
||||
"animation_length": 0.7917,
|
||||
"bones": {
|
||||
"0": {
|
||||
"rotation": {
|
||||
|
@ -97,6 +113,25 @@
|
|||
"easing": "easeOutSine"
|
||||
}
|
||||
}
|
||||
},
|
||||
"camera": {
|
||||
"rotation": {
|
||||
"0.0": {
|
||||
"vector": [-0.3, -0.3, 0.3]
|
||||
},
|
||||
"0.2083": {
|
||||
"vector": [0.3, 0, -0.3]
|
||||
},
|
||||
"0.4167": {
|
||||
"vector": [-0.3, 0.3, 0.3]
|
||||
},
|
||||
"0.5833": {
|
||||
"vector": [0.3, 0, -0.3]
|
||||
},
|
||||
"0.7917": {
|
||||
"vector": [-0.3, -0.3, 0.3]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,18 +9,18 @@
|
|||
"thirdperson_righthand": {
|
||||
"rotation": [
|
||||
75,
|
||||
-9,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"translation": [
|
||||
0.75,
|
||||
8.5,
|
||||
-6.25
|
||||
0,
|
||||
13,
|
||||
-3.25
|
||||
],
|
||||
"scale": [
|
||||
0.6,
|
||||
0.6,
|
||||
0.6
|
||||
0.75,
|
||||
0.75,
|
||||
0.75
|
||||
]
|
||||
},
|
||||
"thirdperson_lefthand": {
|
||||
|
@ -44,17 +44,17 @@
|
|||
"rotation": [
|
||||
0,
|
||||
0,
|
||||
7
|
||||
11.5
|
||||
],
|
||||
"translation": [
|
||||
0.5,
|
||||
-30.75,
|
||||
-27.5
|
||||
25.25,
|
||||
-50.75,
|
||||
-66.5
|
||||
],
|
||||
"scale": [
|
||||
2,
|
||||
2,
|
||||
2
|
||||
4,
|
||||
4,
|
||||
4
|
||||
]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
|
@ -62,11 +62,6 @@
|
|||
-4,
|
||||
0.5,
|
||||
-7
|
||||
],
|
||||
"scale": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ground": {
|
||||
|
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 10 KiB |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"zoom": 1,
|
||||
"dev": 3.5,
|
||||
"dev": 2.5,
|
||||
"recoil_x": 0.012,
|
||||
"recoil_y": 0.011,
|
||||
"damage": 8,
|
||||
|
|