ChaoticTrials / MoreVanillaArmor

Armor made of vanilla material
https://modrinth.com/mod/morevanillaarmor
Apache License 2.0
2 stars 4 forks source link

Added armor set bonuses, and single armor piece effects. Added specif… #7

Closed draklorx closed 3 years ago

draklorx commented 4 years ago

…ic code for Obsidian, and Fiery, has some stand in bonuses for others, but they need to be finalized/tested.

draklorx commented 4 years ago

This is code only.

Includes: Empty textures for potion effects and new redstone essence blocks (these are not used in game but game throws non fatal errors on startup if they're missing).

General code for registering new armor effects/blocks/blockstates.

Heavy Armor Effect: Slows wearer down. Increased fall damage. Scales with armor worn, so the more heavy armor you wear the slower you go and more damage you take. Obsidian armor currently invokes this effect on each piece scaling the effect with the amount of armor gained.

Power Source Effect: Leaves a trail of redstone essence on the ground wherever the player walks. Redsone essence acts as redstone blocks but is invisible and emits redstone torch particle effects. Redstone essence will dissapear a few seconds after the player leaves the block he's standing on/removes armor. Redstone armor will trigger this effect when a full set is worn.

Fire Immunity Effect: Reduces all damage to the player from fire sources to zero. Fiery armor currently grants this effect when a full set is worn. The armor itself is not immune! It will take damage and degrade over time while in lava/on fire. This will cause it to be eventually destroyed and the player will lose the set bonus immediately.

Damage Reduction Effect: Reduces all damage except fall damage to the player by 1. This should stack with existing damage reduction effects like absorption. This effect will only trigger if the reduced damage amount would be > 0.25 damage. At least a little damage is taken regardless. Should not interfere with other mods/effects that actually do reduce damage to < 0.25. Wearing a full set of obsidian armor triggers this effect.

NOTES: I manually reverted textures in this branch, so you might end up with a conflict if you merge both this one and textures branch. Just keep all textures from textures branch if you want both.

I had a previous bug where blocks weren't being registered correctly. I was returning a single instance instead of a new instance each time. The same may STILL be true of armor effects. I'm still wrapping my head around deferred registers. Registering armor effects may need to be tweaked to account for this.

English is hard coded for some item descriptions. This needs to be moved into generators? I'm still fuzzy when it comes to this stuff. This code needs to be looked at extensively as it's in a very early state and not optimized for redundancy/maintainability.