Skip to content

Commit

Permalink
fix: fix Ravenous Claws normal attack bypassing armor, resistances an…
Browse files Browse the repository at this point in the history
…d enchantments
  • Loading branch information
Elenterius committed Jul 18, 2024
1 parent 70d37cb commit 8e95aa5
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ private void addDamageTranslations() {
"%1$s was drained of blood by %2$s",
"%1$s was blood let by %2$s using %3$s"
);
addDeathMessage(ModDamageTypes.SLASH,
"%1$s was shredded to ribbons",
"%1$s was ripped apart by %2$s",
"%1$s was eviscerate by %2$s using %3$s"
);

addDeathMessage(ModDamageTypes.TOOTH_PROJECTILE, "[WIP]",
"[WIP] %1$s was forcefully implanted with teeth by %2$s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public ModDamageTypeTagsProvider(PackOutput output, CompletableFuture<HolderLook
super(output, lookupProvider, BiomancyMod.MOD_ID, existingFileHelper);
}

@SuppressWarnings("DataFlowIssue")
@Override
protected void addTags(HolderLookup.Provider pProvider) {
tag(DamageTypeTags.BYPASSES_ARMOR).add(
Expand All @@ -44,12 +43,14 @@ protected void addTags(HolderLookup.Provider pProvider) {
//damage that ignores Invincibility-Frames
tag(DamageTypeTags.BYPASSES_COOLDOWN).add(
ModDamageTypes.BLEED,
ModDamageTypes.CORROSIVE_ACID
ModDamageTypes.CORROSIVE_ACID,
ModDamageTypes.SLASH
);

tag(DamageTypeTags.NO_IMPACT).add(
ModDamageTypes.BLEED,
ModDamageTypes.CORROSIVE_ACID
ModDamageTypes.CORROSIVE_ACID,
ModDamageTypes.SLASH
);

tag(DamageTypeTags.ALWAYS_HURTS_ENDER_DRAGONS).add(
Expand Down
3 changes: 3 additions & 0 deletions src/generated/resources/assets/biomancy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@
"death.attack.biomancy.bleed": "%1$s perished from severe blood loss",
"death.attack.biomancy.bleed.player": "%1$s was drained of blood by %2$s",
"death.attack.biomancy.bleed.item": "%1$s was blood let by %2$s using %3$s",
"death.attack.biomancy.slash": "%1$s was shredded to ribbons",
"death.attack.biomancy.slash.player": "%1$s was ripped apart by %2$s",
"death.attack.biomancy.slash.item": "%1$s was eviscerate by %2$s using %3$s",
"death.attack.biomancy.tooth_projectile": "[WIP]",
"death.attack.biomancy.tooth_projectile.player": "[WIP] %1$s was forcefully implanted with teeth by %2$s",
"death.attack.biomancy.tooth_projectile.item": "[WIP] %1$s received a lethal dental implant by %2$s using %3$s",
Expand Down
5 changes: 5 additions & 0 deletions src/generated/resources/data/biomancy/damage_type/slash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.25,
"message_id": "biomancy.slash",
"scaling": "when_caused_by_living_non_player"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"values": [
"biomancy:bleed",
"biomancy:corrosive_acid"
"biomancy:corrosive_acid",
"biomancy:slash"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"values": [
"biomancy:bleed",
"biomancy:corrosive_acid"
"biomancy:corrosive_acid",
"biomancy:slash"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public static DamageSource bleed(Level level, @Nullable Entity attacker) {
return source(ModDamageTypes.BLEED, level, attacker);
}

public static DamageSource slash(Level level, @Nullable Entity attacker) {
return source(ModDamageTypes.SLASH, level, attacker);
}

public static DamageSource toothProjectile(Level level, BaseProjectile projectile, @Nullable Entity shooter) {
return source(ModDamageTypes.TOOTH_PROJECTILE, level, projectile, shooter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public final class ModDamageTypes {
public static final ResourceKey<DamageType> CHEST_BITE = key("chest_bite");
public static final ResourceKey<DamageType> CORROSIVE_ACID = key("corrosive_acid");
public static final ResourceKey<DamageType> BLEED = key("bleed");
public static final ResourceKey<DamageType> SLASH = key("slash");
public static final ResourceKey<DamageType> FALL_ON_SPIKE = key("spike_fall_on");
public static final ResourceKey<DamageType> IMPALED_BY_SPIKE = key("spike_impale");

Expand All @@ -36,6 +37,7 @@ public static void bootstrap(BootstapContext<DamageType> ctx) {
bootstrap(ctx, CHEST_BITE, DamageScaling.ALWAYS, 0.25f);
bootstrap(ctx, CORROSIVE_ACID, 0.1f);
bootstrap(ctx, BLEED, 0.25f);
bootstrap(ctx, SLASH, 0.25f);
bootstrap(ctx, FALL_ON_SPIKE);
bootstrap(ctx, IMPALED_BY_SPIKE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public boolean canPerformAction(ItemStack stack, ToolAction toolAction) {

@Override
public @Nullable DamageSource getDamageSource(ItemStack stack, Entity target, LivingEntity attacker) {
return ModDamageSources.bleed(attacker.level(), attacker);
return ModDamageSources.slash(attacker.level(), attacker);
}

@Override
Expand Down

0 comments on commit 8e95aa5

Please sign in to comment.