Revamp the entire skillset and rebalance everything.
This commit is contained in:
@@ -5,9 +5,6 @@ import net.fretux.ascend.config.AscendConfig;
|
||||
import net.fretux.ascend.player.PlayerStatsProvider;
|
||||
import net.fretux.ascend.player.StatEffects;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.effect.MobEffectCategory;
|
||||
import net.minecraft.world.entity.ai.gossip.GossipType;
|
||||
import net.minecraft.world.entity.npc.Villager;
|
||||
@@ -24,7 +21,6 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.event.level.BlockEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDamageEvent;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.animal.IronGolem;
|
||||
import net.minecraft.world.entity.animal.SnowGolem;
|
||||
@@ -76,7 +72,7 @@ public class ActivityEvents {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerTickFortitude(TickEvent.PlayerTickEvent event) {
|
||||
public static void onPlayerTickSurvivalXP(TickEvent.PlayerTickEvent event) {
|
||||
Player player = event.player;
|
||||
if (player.level().isClientSide || event.phase != TickEvent.Phase.END) return;
|
||||
if (player.tickCount % 100 != 0) return;
|
||||
@@ -133,13 +129,6 @@ public class ActivityEvents {
|
||||
Player player = event.player;
|
||||
if (player.level().isClientSide || event.phase != TickEvent.Phase.END) return;
|
||||
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
||||
int willpower = stats.getAttributeLevel("willpower");
|
||||
if (willpower > 0 && player.tickCount % 80 == 0) {
|
||||
float regen = StatEffects.getWillpowerHealthRegen(willpower);
|
||||
if (regen > 0.0f && player.getHealth() < player.getMaxHealth()) {
|
||||
player.heal(regen);
|
||||
}
|
||||
}
|
||||
if (player.tickCount % 200 != 0) return;
|
||||
boolean hasNegativeEffect = player.getActiveEffects().stream()
|
||||
.anyMatch(e -> e.getEffect().getCategory() == MobEffectCategory.HARMFUL);
|
||||
@@ -252,63 +241,6 @@ public class ActivityEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerDealsDamage(LivingDamageEvent event) {
|
||||
if (!(event.getSource().getEntity() instanceof Player player)) return;
|
||||
if (player.level().isClientSide) return;
|
||||
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
||||
float damage = event.getAmount();
|
||||
var stack = player.getMainHandItem();
|
||||
if (!stack.isEmpty()) {
|
||||
double multiplier = 1.0d;
|
||||
if (stack.getItem() instanceof net.minecraft.world.item.AxeItem) {
|
||||
int heavy = stats.getAttributeLevel("heavy_scaling");
|
||||
multiplier = StatEffects.getHeavyWeaponScalingMultiplier(heavy);
|
||||
} else if (stack.getItem() instanceof net.minecraft.world.item.SwordItem) {
|
||||
int medium = stats.getAttributeLevel("medium_scaling");
|
||||
multiplier = StatEffects.getWeaponScalingMultiplier(medium);
|
||||
} else {
|
||||
int light = stats.getAttributeLevel("light_scaling");
|
||||
multiplier = StatEffects.getLightWeaponScalingMultiplier(light);
|
||||
}
|
||||
damage *= (float) multiplier;
|
||||
}
|
||||
event.setAmount(damage);
|
||||
});
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerEvasion(LivingHurtEvent event) {
|
||||
if (!(event.getEntity() instanceof Player player)) return;
|
||||
if (player.level().isClientSide) return;
|
||||
if (event.getAmount() <= 0) return;
|
||||
player.getCapability(PlayerStatsProvider.PLAYER_STATS).ifPresent(stats -> {
|
||||
int agility = stats.getAttributeLevel("agility");
|
||||
if (agility <= 0) return;
|
||||
double evadeChance = StatEffects.getAgilityEvasionChance(agility);
|
||||
if (player.getRandom().nextDouble() < evadeChance) {
|
||||
float original = event.getAmount();
|
||||
event.setAmount(original * 0.1f);
|
||||
if (player.level() instanceof ServerLevel serverLevel) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
double offsetX = (serverLevel.random.nextDouble() - 0.5) * 0.6;
|
||||
double offsetY = serverLevel.random.nextDouble() * 1.5;
|
||||
double offsetZ = (serverLevel.random.nextDouble() - 0.5) * 0.6;
|
||||
serverLevel.sendParticles(
|
||||
ParticleTypes.CLOUD,
|
||||
player.getX() + offsetX,
|
||||
player.getY() + offsetY,
|
||||
player.getZ() + offsetZ,
|
||||
1,
|
||||
0, 0, 0, 0.0
|
||||
);
|
||||
}
|
||||
}
|
||||
player.playSound(SoundEvents.ENDERMAN_TELEPORT, 0.4f, 1.5f);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean isCharismaAlly(Player player, LivingEntity entity) {
|
||||
if (entity instanceof TamableAnimal tame) {
|
||||
return tame.isTame() && tame.isOwnedBy(player);
|
||||
|
||||
Reference in New Issue
Block a user