Skip to content

Commit

Permalink
Frostologer rebalance (#138)
Browse files Browse the repository at this point in the history
* remove biter summon goal and require temperature to be high for destroy heat sources

* move frostologer class to own package

* move frost wand attack to own package

* move frost wand cast goal to own package

* dont turn water logged blocks to ice

* adjust frostologer fight freezing mechanics

- frostologer gains freezing when they hit root their target
- frostologer is warmed each tick they are channeling their blizzard spell
- frostologer no longer has passive freezing
- frostologer equipment can be enchanted
- frostologer has a max temp of 0, even with scorchful installed

* use heat drain config value for warming

* make frostologer icicle spell cooldown longer

* make frost wand hit cooling configurable

* start rendering frost layers earlier

* freeze damage no longer breaks root

* scale frostologer enchantment power by local difficulty

* add enervation to frostologer spawn enchantment provider

* dispense a normal vault reward from boss vault

* update destroy heat sources tests

* fix frost layer rendering

* fix issues found in self review
  • Loading branch information
TheDeathlyCow authored Jan 2, 2025
1 parent 76120a0 commit fe892cb
Show file tree
Hide file tree
Showing 23 changed files with 241 additions and 317 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.thedeathlycow.frostiful.client.model;

import com.github.thedeathlycow.frostiful.entity.FrostologerEntity;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.model.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.github.thedeathlycow.frostiful.client.render.feature.FrostologerCloakFeatureRenderer;
import com.github.thedeathlycow.frostiful.client.render.feature.FrostologerEyesFeatureRenderer;
import com.github.thedeathlycow.frostiful.client.render.feature.FrostologerFrostFeatureRenderer;
import com.github.thedeathlycow.frostiful.entity.FrostologerEntity;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.entity.EntityRendererFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.thedeathlycow.frostiful.client.render.feature;

import com.github.thedeathlycow.frostiful.Frostiful;
import com.github.thedeathlycow.frostiful.entity.FrostologerEntity;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.util.Identifier;
Expand All @@ -13,8 +13,8 @@
public enum FrostLayers {

NONE(0.0f, null),
LOW(-0.5f, Frostiful.id("textures/entity/illager/frostologer/low_frost.png")),
MEDIUM(-0.75f, Frostiful.id("textures/entity/illager/frostologer/medium_frost.png")),
LOW(-0.25f, Frostiful.id("textures/entity/illager/frostologer/low_frost.png")),
MEDIUM(-0.5f, Frostiful.id("textures/entity/illager/frostologer/medium_frost.png")),
HIGH(FrostologerEntity.MAX_POWER_SCALE_START, Frostiful.id("textures/entity/illager/frostologer/high_frost.png"));

public static final FrostLayers[] LAYERS_WITHOUT_NONE = Stream.of(FrostLayers.values())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.thedeathlycow.frostiful.client.render.feature;

import com.github.thedeathlycow.frostiful.client.model.FrostologerEntityModel;
import com.github.thedeathlycow.frostiful.entity.FrostologerEntity;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import com.github.thedeathlycow.frostiful.item.cloak.AbstractFrostologyCloakItem;
import com.github.thedeathlycow.frostiful.registry.FItems;
import net.fabricmc.api.EnvType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.thedeathlycow.frostiful.client.render.feature;

import com.github.thedeathlycow.frostiful.client.model.FrostologerEntityModel;
import com.github.thedeathlycow.frostiful.entity.FrostologerEntity;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.OverlayTexture;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.thedeathlycow.frostiful.client.render.feature;

import com.github.thedeathlycow.frostiful.client.model.FrostologerEntityModel;
import com.github.thedeathlycow.frostiful.entity.FrostologerEntity;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.VertexConsumerProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.thedeathlycow.frostiful.compat.FrostifulIntegrations;
import com.github.thedeathlycow.frostiful.config.FrostifulConfig;
import com.github.thedeathlycow.frostiful.entity.RootedEntity;
import com.github.thedeathlycow.frostiful.entity.loot.StrayLootTableModifier;
import com.github.thedeathlycow.frostiful.item.FrostedBanner;
import com.github.thedeathlycow.frostiful.item.cloak.AbstractFrostologyCloakItem;
Expand All @@ -19,6 +20,8 @@
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityCombatEvents;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import net.fabricmc.fabric.api.util.TriState;
Expand Down Expand Up @@ -75,6 +78,8 @@ public void onInitialize() {
FFeatures.initialize();
FPlacedFeatures.initialize();

ServerLivingEntityEvents.AFTER_DAMAGE.register(RootedEntity::afterDamage);

this.registerThermooEventListeners();
PayloadTypeRegistry.playS2C().register(
PointWindSpawnPacket.PACKET_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ public class CombatConfigGroup implements ConfigData {

int frostologerHeatDrainPerTick = 30;

int frostologerCoolingFromFrostWandHit = 6300 / 6;

int packedSnowballFreezeAmount = 500;

float packedSnowballDamage = 2.0f;

float packedSnowballVulnerableTypesDamage = 5.0f;

int frostologerPassiveFreezingPerTick = 2;

float frostologerMaxPassiveFreezing = 0.5f;

int biterFrostBiteMaxAmplifier = 2;

float chillagerFireDamageMultiplier = 1.5f;

int frostologerIntolerableHeat = 9;

@ConfigEntry.Gui.RequiresRestart
float furUpgradeTemplateGenerateChance = 0.5f;

Expand Down Expand Up @@ -76,6 +72,10 @@ public int getFrostologerHeatDrainPerTick() {
return 2 * frostologerHeatDrainPerTick;
}

public int getFrostologerCoolingFromFrostWandHit() {
return frostologerCoolingFromFrostWandHit;
}

public int getPackedSnowballFreezeAmount() {
return packedSnowballFreezeAmount;
}
Expand All @@ -88,14 +88,6 @@ public float getPackedSnowballVulnerableTypesDamage() {
return packedSnowballVulnerableTypesDamage;
}

public int getFrostologerPassiveFreezingPerTick() {
return frostologerPassiveFreezingPerTick;
}

public float getFrostologerMaxPassiveFreezing() {
return frostologerMaxPassiveFreezing;
}

public int getBiterFrostBiteMaxAmplifier() {
return Math.max(0, this.biterFrostBiteMaxAmplifier);
}
Expand All @@ -104,10 +96,6 @@ public float getChillagerFireDamageMultiplier() {
return chillagerFireDamageMultiplier;
}

public int getFrostologerIntolerableHeat() {
return frostologerIntolerableHeat;
}

public float getFurUpgradeTemplateGenerateChance() {
return MathHelper.clamp(furUpgradeTemplateGenerateChance, 0f, 1f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.thedeathlycow.frostiful.Frostiful;
import com.github.thedeathlycow.frostiful.config.FrostifulConfig;
import com.github.thedeathlycow.frostiful.entity.frostologer.FrostologerEntity;
import com.github.thedeathlycow.frostiful.registry.FEntityTypes;
import com.github.thedeathlycow.frostiful.registry.FItems;
import com.github.thedeathlycow.frostiful.registry.FSoundEvents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import com.github.thedeathlycow.frostiful.Frostiful;
import com.github.thedeathlycow.frostiful.config.FrostifulConfig;
import com.github.thedeathlycow.frostiful.entity.damage.FDamageTypes;
import com.github.thedeathlycow.frostiful.registry.tag.FDamageTypeTags;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MovementType;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.particle.BlockStateParticleEffect;
import net.minecraft.particle.ParticleEffect;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
Expand Down Expand Up @@ -54,6 +58,18 @@ static Vec3d getMovementWhenRooted(MovementType type, Vec3d movement, Entity ent
};
}

static void afterDamage(LivingEntity entity, DamageSource source, float baseDamageTaken, float damageTaken, boolean blocked) {
boolean breakRoot = !blocked
&& damageTaken > 0f
&& !source.isIn(FDamageTypeTags.DOES_NOT_BREAK_ROOT)
&& entity instanceof RootedEntity rooted
&& rooted.frostiful$isRooted();

if (breakRoot) {
RootedEntity.breakRootOnEntity(entity);
}
}

static void breakRootOnEntity(LivingEntity victim) {
RootedEntity rootedEntity = (RootedEntity) victim;
World world = victim.getWorld();
Expand Down Expand Up @@ -82,6 +98,4 @@ static void spawnShatterParticlesAndSound(LivingEntity victim, ServerWorld serve
1.0f, 0.75f
);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.github.thedeathlycow.frostiful.entity.frostologer;

import net.minecraft.entity.ai.goal.AttackGoal;

class FrostWandAttackGoal extends AttackGoal {
private final FrostologerEntity frostologerEntity;

public FrostWandAttackGoal(FrostologerEntity frostologerEntity) {
super(frostologerEntity);
this.frostologerEntity = frostologerEntity;
}

@Override
public boolean canStart() {
return frostologerEntity.isTargetRooted()
&& super.canStart();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.github.thedeathlycow.frostiful.entity.frostologer;

import com.github.thedeathlycow.frostiful.Frostiful;
import com.github.thedeathlycow.frostiful.registry.FItems;
import com.github.thedeathlycow.frostiful.registry.FSoundEvents;
import net.minecraft.entity.ai.goal.ProjectileAttackGoal;
import net.minecraft.util.Hand;

class FrostWandCastGoal extends ProjectileAttackGoal {

private final FrostologerEntity frostologerEntity;

public FrostWandCastGoal(FrostologerEntity frostologer, double mobSpeed, int intervalTicks, float maxShootRange) {
super(frostologer, mobSpeed, intervalTicks, maxShootRange);
this.frostologerEntity = frostologer;
}

@Override
public boolean canStart() {
return super.canStart()
&& frostologerEntity.hasTarget()
&& !frostologerEntity.isTargetRooted()
&& frostologerEntity.getMainHandStack().isOf(FItems.FROST_WAND);
}

@Override
public void start() {
super.start();
frostologerEntity.setAttacking(true);
frostologerEntity.setCurrentHand(Hand.MAIN_HAND);
this.startUsingFrostWand();
}

@Override
public void stop() {
super.stop();
frostologerEntity.setAttacking(false);
frostologerEntity.clearActiveItem();
this.stopUsingFrostWand();
if (frostologerEntity.isTargetRooted()) {
int cooling = -Frostiful.getConfig().combatConfig.getFrostologerCoolingFromFrostWandHit();
frostologerEntity.thermoo$addTemperature(cooling);
}
}

private void startUsingFrostWand() {
frostologerEntity.playSound(
FSoundEvents.ITEM_FROST_WAND_PREPARE_CAST,
1.0f, 1.0f
);
frostologerEntity.getDataTracker().set(FrostologerEntity.IS_USING_FROST_WAND, true);
}

private void stopUsingFrostWand() {
frostologerEntity.getDataTracker().set(FrostologerEntity.IS_USING_FROST_WAND, false);
}
}
Loading

0 comments on commit fe892cb

Please sign in to comment.