Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
メイド指揮棒機能追加
Browse files Browse the repository at this point in the history
・オフハンドスニーク時にメイドさんを集める機能を追加
  • Loading branch information
firis-games committed Dec 25, 2020
1 parent 07dbbdd commit ffb7469
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
22 changes: 19 additions & 3 deletions src/main/java/net/blacklab/lmc/common/item/LMItemMaidStick.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,27 @@ protected ActionResult<ItemStack> onItemRightClickOffHand(World worldIn, EntityP
//有効範囲128ブロック(設定なし)
int range = 128;

//集めるときは20
if (playerIn.isSneaking()) {
range = 20;
}

List<EntityLittleMaid> maidList = worldIn.getEntitiesWithinAABB(EntityLittleMaid.class, new AxisAlignedBB(
playerIn.getPosition().add(-range, -range, -range), playerIn.getPosition().add(range, range, range)));

for (EntityLittleMaid maid : maidList) {
//5s発光状態を付与
maid.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100, 0, false, false));
if (!playerIn.isSneaking()) {
//5s発光状態を付与
maid.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100, 0, false, false));
} else {
//メイドさんのご主人様が自分であること
if (maid.isContract() && maid.isMaidContractOwner(playerIn)) {
//メイドさんをワープ
maid.setPosition(playerIn.posX + (worldIn.rand.nextDouble() - 0.5D) * 2.0D,
playerIn.posY,
playerIn.posZ + (worldIn.rand.nextDouble() - 0.5D) * 2.0D);
}
}
}

//対象がいる場合は効果音
Expand All @@ -125,6 +140,7 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List<String
tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("item.maid_stick.info"));
tooltip.add(TextFormatting.DARK_AQUA.toString() + TextFormatting.ITALIC.toString() + I18n.format("item.maid_stick.details1"));
tooltip.add(TextFormatting.DARK_AQUA.toString() + TextFormatting.ITALIC.toString() + I18n.format("item.maid_stick.details2"));
tooltip.add(TextFormatting.DARK_AQUA.toString() + TextFormatting.ITALIC.toString() + I18n.format("item.maid_stick.details3"));
tooltip.add(TextFormatting.DARK_GREEN.toString() + TextFormatting.ITALIC.toString() + I18n.format("item.maid_stick.details3"));
tooltip.add(TextFormatting.DARK_GREEN.toString() + TextFormatting.ITALIC.toString() + I18n.format("item.maid_stick.details4"));
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/lmreengaged/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,5 @@ item.maid_stick.info=Instruct the maid
item.maid_stick.details1=Waiting action switching
item.maid_stick.details2=Free action switching[Sneak]
item.maid_stick.details3=Search LittleMaid[OffHand]
item.maid_stick.details3=Call LittleMaid[OffHand:Sneak]

5 changes: 3 additions & 2 deletions src/main/resources/assets/lmreengaged/lang/ja_jp.lang
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ tile.sugar_box.details=砂糖の入ったチェストを上に置く
item.maid_stick.name=メイド指揮棒
item.maid_stick.info=メイドさんに指示する棒
item.maid_stick.details1=待機行動切替
item.maid_stick.details2=自由行動切替(スニーク)
item.maid_stick.details3=メイドさん探知(オフハンド)
item.maid_stick.details2=自由行動切替 [スニーク]
item.maid_stick.details3=メイドさん探知 [オフ]
item.maid_stick.details4=メイドさん招集 [オフ:スニーク]

0 comments on commit ffb7469

Please sign in to comment.