This commit is contained in:
YuTian 2024-08-11 13:30:47 +08:00
parent 5c88e81278
commit 64efbb5a59
9 changed files with 42 additions and 21 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/.idea/
/out/
/EnderDragonWars.iml
/lib/

View File

@ -25,7 +25,7 @@ public class AddMaxHealthEffect extends GiftEffect {
private int count = 0;
@Override
public void run() {
if (count >= 10) {
if (count >= 50) {
cancel();
return;
}

View File

@ -19,6 +19,8 @@ public class PlayerBigEffect extends GiftEffect {
}
player.getAttribute(Attribute.GENERIC_SCALE).setBaseValue(player.getAttribute(Attribute.GENERIC_SCALE).getBaseValue() + 0.5);
player.getAttribute(Attribute.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(player.getAttribute(Attribute.PLAYER_BLOCK_INTERACTION_RANGE).getBaseValue() + 1);
player.getAttribute(Attribute.GENERIC_STEP_HEIGHT).setBaseValue(player.getAttribute(Attribute.GENERIC_STEP_HEIGHT).getBaseValue() + 1);
player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue() + 0.2);
}
}

View File

@ -16,6 +16,7 @@ public class PlayerResetEffect extends GiftEffect {
Player player = game.getPlayer();
player.getAttribute(Attribute.GENERIC_SCALE).setBaseValue(1);
player.getAttribute(Attribute.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(4.5);
player.getAttribute(Attribute.GENERIC_STEP_HEIGHT).setBaseValue(0.6);
}
}

View File

@ -19,6 +19,8 @@ public class PlayerSmallEffect extends GiftEffect {
}
player.getAttribute(Attribute.GENERIC_SCALE).setBaseValue(player.getAttribute(Attribute.GENERIC_SCALE).getBaseValue() - 0.5);
player.getAttribute(Attribute.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(player.getAttribute(Attribute.PLAYER_BLOCK_INTERACTION_RANGE).getBaseValue() - 0.5);
player.getAttribute(Attribute.GENERIC_STEP_HEIGHT).setBaseValue(player.getAttribute(Attribute.GENERIC_STEP_HEIGHT).getBaseValue() - 1);
player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(player.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue() - 0.2);
}
}

View File

@ -19,7 +19,7 @@ public class TakeMaxHealthEffect extends GiftEffect {
if (player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue() <= 20) {
return;
}
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue() - 20);
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(20);
}

View File

@ -10,7 +10,8 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class LikeListener implements Listener {
@EventHandler//点赞
@EventHandler
public void onDianZan(LiveLikeEvents e) {
Player zhubo = e.getPlayer();
String userName = "" + RandomUtil.getRandomInt(999, 10000);
@ -29,4 +30,5 @@ public class LikeListener implements Listener {
gameManager.setDianzan_amount(0);
}
}
}

View File

@ -2,8 +2,7 @@ package com.yaohun.enderdragonwars.manager;
import com.yaohun.enderdragonwars.effect.GiftEffect;
import com.yaohun.enderdragonwars.effect.GiftQueue;
import com.yaohun.enderdragonwars.effect.types.BomBomEffect;
import com.yaohun.enderdragonwars.effect.types.ClearInventoryEffect;
import com.yaohun.enderdragonwars.effect.types.*;
import org.bukkit.scheduler.BukkitTask;
import java.util.HashMap;
@ -43,6 +42,20 @@ public class GiftEffectManager {
public static void registerAll() {
registerGiftEffect("清理背包", ClearInventoryEffect::new);
registerGiftEffect("火山喷发", BomBomEffect::new);
registerGiftEffect("幸运方块", LuckyBlockEffect::new);
registerGiftEffect("黑洞", BlackHoleEffect::new);
registerGiftEffect("五雷轰顶", FiveLightningEffect::new);
registerGiftEffect("装备清空", ClearInventoryEffect::new);
registerGiftEffect("岩浆泡澡", LavaPoolEffect::new);
registerGiftEffect("钢铁保安", SummonIronGolem::new);
registerGiftEffect("6倍血量", AddMaxHealthEffect::new);
registerGiftEffect("原地复活", GiveTotemEffect::new);
registerGiftEffect("魔豆天梯", SpawnEnderPortalEffect::new);
registerGiftEffect("世界毁灭", WorldDestroyEffect::new);
registerGiftEffect("变大", PlayerBigEffect::new);
registerGiftEffect("变小", PlayerSmallEffect::new);
registerGiftEffect("安全庇护所", SpawnBuildEffect::new);
registerGiftEffect("螺旋升天", ToHeavenEffect::new);
}
private static void registerGiftEffect(String id, Function<String, GiftEffect> giftEffectGetter) {