Skip to content

Commit

Permalink
Fixed #44
Browse files Browse the repository at this point in the history
  • Loading branch information
CleverNucleus committed Jan 27, 2022
1 parent 9ece29d commit 2d7ad09
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 93 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.12.10

# Mod Properties
mod_version = 3.1.0
mod_version = 3.1.1
maven_group = com.github.clevernucleus
archives_base_name = playerex

# Dependencies
fabric_version=0.44.0+1.18
dataattributes_version=1.1.3
dataattributes_version=1.1.4
opc_version=0.0.1
cardinal_components_version=4.0.1
placeholder_api=1.1.3+1.17.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,93 +68,6 @@ public static float damageModified(final LivingEntity livingEntity, final Damage
}

return amount;

/*
* We need a predicate for each *resistance/immunity*
* We have a registry of predicates and loop through those here
if(origin instanceof PersistentProjectileEntity) {
// Piercing damage
} else if(origin instanceof LivingEntity) {
// We know it's a LivingEntity attacking us
// Now test *how* it's attacking us
LivingEntity attacker = (LivingEntity)origin;
ItemStack weapon = attacker.getMainHandStack();
if(weapon != ItemStack.EMPTY) {
// Now we know what type of weapon it is
// Hence we can determine if it is:
// - Bludgeoning
// - Slashing
// - Piercing
// Maybe we provide a percentage/weighted distribution of damage types instead of just returning one type
// Do we base this off of raw nbt from this itemstack or from a local item method that takes itemstack as a parameter
}
}
return original; // TODO resistances and amps
/*
* Fire damage <- can do now
* - isFire()
* Freeze damage <- can do now also do we maybe want to dub this 'frost' instead of 'freeze'?
* - equals(FREEZE)
* Wither Damage <- can do now
* - equals(WITHER)
* Radiant Damage
* Poison Damage <- can do now
* - equals(POISON)
* Lightning <- can do now maybe
* - equals(LIGHTNING_BOLT) we would dub it as 'lightning damage'
* Bludgeoning (explosion damage?)
* Piercing
* Slashing
* Force? would this be like explosion damage?
* ... maybe some more ? we want d&d a theme ideally
*
* What we had before:
* Magic Damage Resistance (sucked and didn't work across mods very well, not to mention what do we do about potions).
* Also, what if we fire magic fireballs? are they magic damage or fire damage? I would say fire which is why this is a bad damage type.
*
* Fire Damage Resistance
* Freeze Damage Resistance
* Drowning Damage Resistance (what kind of damage type would this be thematically?) I think we just remove this one.
* Falling Damage Resistance (this is basically bludgeoning, but if we called it that would people know what that meant?)
* Wither Resistance
*
*
*
* So listing it on the resistances section (can really only justify 6, not including the empty space on the combat page):
*
* Also, do we say 'x Damage Resistance' or just 'x Resistance'?
*
* Fire Resistance
* Freeze/Frost/Cold Resistance
* Lightning Resistance
* Poison Resistance
* Wither Resistance
* Radiant Resistance
*
*
* We don't have anything we can do with Radiant damage yet, or ever in PlayerEx, so we need to think abut if we add it before
* we have an addon mod that uses it. Kind of the same deal with Lightning damage.
*
* Additionally, I think we'd rather have 5 attributes listed instead of 6 because it's just more aesthetically pleasing on the gui.
* Also, including Lifesteal and Attack Range (which is implemented in another mod) we have an ideal 3-4 slots to fill on combat page:
* Slashing Resistance
* Bludgeoning Resistance
* Piercing Resistance
*
* these would be ideal to put there. Unlike in dnd though we have a percentage reduction in damage instead of just 50%, else we could
* use simple booleans/DataTracker.
*
* Not quite sure yet on how I would mixin to these damage types to ensure that Magic damage is always differentiated into categories.
* Maybe we use Wrappers with static a static enum/get map? We input damage type and attacker/source and it returns our category.
*
*/
}

public static boolean onDamage(final LivingEntity livingEntity, final DamageSource source, final float original) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void preOnEntityHit(EntityHitResult entityHitResult, CallbackInfo info)
}
}

@ModifyArg(method = "onEntityHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z"), index = 1)
@ModifyArg(method = "onEntityHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;damage(Lnet/minecraft/entity/damage/DamageSource;F)Z"), index = -1)
private float onDamage(float i) {
PersistentProjectileEntity persistentProjectileEntity = (PersistentProjectileEntity)(Object)this;
Entity owner = persistentProjectileEntity.getOwner();
Expand Down
Binary file modified src/main/resources/assets/playerex/textures/gui/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/main/resources/data/playerex/attributes/functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"playerex:intelligence": {
"playerex:heal_amplification": 0.02,
"playerex:ranged_crit_damage": 0.005,
"playerex:fire_resistance": 0.01,
"playerex:wither_resistance": 0.01
},
"playerex:luckiness": {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Adds RPG style attributes to the game, and provides the player with a new levelling system.",
"authors": [
"CleverNucleus",
"elhertz - spanish translation & helpful feature requests"
"elhertz - spanish translation and helpful feature requests"
],
"contact": {
"homepage": "https://www.curseforge.com/minecraft/mc-mods/playerex",
Expand Down Expand Up @@ -41,7 +41,7 @@
"fabricloader": ">=0.12.10",
"fabric": ">=0.44.0",
"minecraft": "1.18.x",
"dataattributes": ">=1.1.2",
"dataattributes": ">=1.1.4",
"cloth-config2": ">=6.0.0",
"java": ">=17"
}
Expand Down

0 comments on commit 2d7ad09

Please sign in to comment.