Skip to content

Commit 94b21f6

Browse files
committed
添加技能“龙怒帝威”(与“相携与共”存在命名冲突问题);
“龙怒帝威”药水效果失效; 发现问题:刘备“相携与共”会给予额外自身生命恢复效果;
1 parent 172ed36 commit 94b21f6

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

src/main/java/xyz/lisbammisakait/item/ModItems.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.minecraft.text.Text;
1414
import net.minecraft.util.Identifier;
1515
import xyz.lisbammisakait.skill.LiuBeiASkill;
16+
import xyz.lisbammisakait.skill.LiuBeiBSkill;
1617
import xyz.lisbammisakait.skill.TieJiTaChuanSkill;
1718
import xyz.lisbammisakait.RelightTheThreePointStrategy;
1819
import xyz.lisbammisakait.skill.YinFengLaiXiangSkill;
@@ -32,7 +33,7 @@ public class ModItems {
3233
.displayName(Text.translatable("rttpsGroup.RelightTheThreePointStrategy"))
3334
.build();
3435

35-
// public static final Item FEILONGDUOFENG = register("feilongduofeng", Item::new, new Item.Settings());
36+
// public static final Item FEILONGDUOFENG = register("feilongduofeng", Item::new, new Item.Settings());
3637
// public static final Item FEILONGDUOFENG = register();
3738
// public static Item register(String path, Function<Item.Settings, Item> factory, Item.Settings settings) {
3839
// final RegistryKey<Item> registryKey = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(RelightTheThreePointStrategy.MOD_ID, path));
@@ -59,10 +60,15 @@ public class ModItems {
5960
public static final RegistryKey<Item> LIUBEIASKILL_KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(RelightTheThreePointStrategy.MOD_ID, "longnudiwei"));
6061
//注意下一行代码的component是为了给技能添加冷却时间
6162
public static final Item LIUBEIASKILL = register(new LiuBeiASkill( new Item.Settings().registryKey(LIUBEIASKILL_KEY).component(RtTPSComponents.COOLDOWN_TYPE,LiuBeiASkill.COOLDOWN)), LIUBEIASKILL_KEY);
63+
//注册刘备B技能
64+
public static final RegistryKey<Item> LIUBEIBSKILL_KEY = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(RelightTheThreePointStrategy.MOD_ID, "xiangxieyvgong"));
65+
public static final Item LIUBEIBSKILL = register(new LiuBeiBSkill( new Item.Settings().registryKey(LIUBEIBSKILL_KEY).component(RtTPSComponents.COOLDOWN_TYPE,LiuBeiBSkill.COOLDOWN)), LIUBEIBSKILL_KEY);
66+
67+
6268
public static Item register(Item item, RegistryKey<Item> registryKey) {
63-
// Register the item.
69+
// Register the item.
6470
Item registeredItem = Registry.register(Registries.ITEM, registryKey.getValue(), item);
65-
// Return the registered item!
71+
// Return the registered item!
6672
return registeredItem;
6773
}
6874

@@ -80,6 +86,7 @@ public static void registerToSkillGroups() {
8086
itemGroup.add(ModItems.YINFENGLAIXIANG);
8187
itemGroup.add(ModItems.TIEJITACHUAN);
8288
itemGroup.add(ModItems.LIUBEIASKILL);
89+
itemGroup.add(ModItems.LIUBEIBSKILL);
8390
});
8491
}
8592
//注册武器
@@ -96,4 +103,4 @@ public static void initialize() {
96103
registerToRtTPSGroups();
97104
//registerToVanillaItemGroups();
98105
}
99-
}
106+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package xyz.lisbammisakait.skill;
2+
3+
import net.minecraft.client.MinecraftClient;
4+
import net.minecraft.client.network.ClientPlayerEntity;
5+
import net.minecraft.entity.effect.StatusEffectInstance;
6+
import net.minecraft.entity.effect.StatusEffects;
7+
import net.minecraft.item.Item;
8+
import net.minecraft.item.ItemStack;
9+
import net.minecraft.item.tooltip.TooltipType;
10+
import net.minecraft.text.Text;
11+
import xyz.lisbammisakait.RelightTheThreePointStrategy;
12+
13+
import java.util.List;
14+
15+
public class LiuBeiBSkill extends Item implements ActiveSkillable {
16+
private final int WITHER_EFFECT_DURATION = 3;
17+
private final int WITHER_EFFECT_AMPLIFIER = 3;
18+
private final int STRENGTH_EFFECT_DURATION = 15;
19+
private final int STRENGTH_EFFECT_AMPLIFIER = 0;
20+
public static final int COOLDOWN = 30;
21+
22+
public LiuBeiBSkill(Settings settings) {
23+
super(settings);
24+
}
25+
26+
@Override
27+
public void castSkill(MinecraftClient client, ItemStack stack) {
28+
ClientPlayerEntity user = client.player;
29+
if (user.getItemCooldownManager().isCoolingDown(stack)) {
30+
// 如果物品正在冷却中,直接返回
31+
return ;
32+
}
33+
RelightTheThreePointStrategy.LOGGER.info("给自己添加凋零与力量效果");
34+
user.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, WITHER_EFFECT_DURATION*20, WITHER_EFFECT_AMPLIFIER));
35+
user.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, STRENGTH_EFFECT_DURATION*20, STRENGTH_EFFECT_AMPLIFIER));
36+
user.getItemCooldownManager().set(stack, COOLDOWN * 20);
37+
}
38+
39+
@Override
40+
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
41+
tooltip.add(Text.translatable("skill.relight-the-three-point-strategy.xiangxieyvgong"));
42+
}
43+
}

src/main/resources/assets/relight-the-three-point-strategy/lang/zh_cn.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
"item.relight-the-three-point-strategy.tiejitachuan":"铁骑踏川",
2020
"item.relight-the-three-point-strategy.yinfenglaixiang": "引凤来翔",
2121
"item.relight-the-three-point-strategy.longnudiwei": "龙怒帝威",
22+
"item.relight-the-three-point-strategy.xiangxieyvgong": "相携与共",
2223
"---------------------------------------------": "---------------------------------",
2324
"-------------------------------------技能描述": "-----------------------------------",
2425
"----------------------------------------------": "--------------------------------",
2526
"skill.relight-the-three-point-strategy.tiejitachuan": "§a[被动] §f当你手持武器时,获得加速效果。当你打出普攻时,朝向目标突刺3格。",
2627
"skill.relight-the-three-point-strategy.yinfenglaixiang": "§a[被动] §f你的每下普攻都有%1$s%%概率附带击退与%2$ss燃烧。",
28+
"skill.relight-the-three-point-strategy.xiangxieyvgong": "§a[主动]",
2729
"----------------------------------------": "--------------------------------------",
2830
"-------------------------------------武器描述": "-----------------------------------",
2931
"-------------------------------------": "-----------------------------------------",

0 commit comments

Comments
 (0)