Conversation
Fixed effect consumption logic for certain effects like Overheat.
| continue; | ||
| } | ||
| var extraEff = ExileDB.ExileEffects().get(effId); | ||
| if (extraEff != null) { |
There was a problem hiding this comment.
better to stop code execution early
| if (extraEff != null) { | |
| if (extraEff = null) { | |
| continue; | |
| } |
| } | ||
| var extraEff = ExileDB.ExileEffects().get(effId); | ||
| if (extraEff != null) { | ||
| var unitT = com.robertx22.mine_and_slash.uncommon.datasaving.Load.Unit(target); |
There was a problem hiding this comment.
use an import
| var unitT = com.robertx22.mine_and_slash.uncommon.datasaving.Load.Unit(target); | |
| var unitT = Load.Unit(target); |
| if (extraEff != null) { | ||
| var unitT = com.robertx22.mine_and_slash.uncommon.datasaving.Load.Unit(target); | ||
| var storeT = unitT.getStatusEffectsData(); | ||
| var instT = storeT.getOrCreate(extraEff); |
There was a problem hiding this comment.
use EffectUtils.applyEffect instead and set other fields after this
| instT.caster_uuid = caster.getStringUUID(); | ||
| try { extraEff.onApply(target); } catch (Exception ignored) {} | ||
| unitT.equipmentCache.STATUS.setDirty(); | ||
| unitT.sync.setDirty(); |
There was a problem hiding this comment.
Should be done once after the for loop
| instT.is_infinite = false; | ||
| instT.caster_uuid = caster.getStringUUID(); | ||
| try { extraEff.onApply(target); } catch (Exception ignored) {} | ||
| unitT.equipmentCache.STATUS.setDirty(); |
There was a problem hiding this comment.
Happens during onApply function
| unitT.equipmentCache.STATUS.setDirty(); |
| Objects.requireNonNull(data); | ||
| LivingEntity target = sourceEntity instanceof LivingEntity ? (LivingEntity) sourceEntity : null; | ||
| return new SpellCtx(EntityActivation.ON_EXPIRE, sourceEntity, caster, target, data); | ||
| SpellCtx ctx = new SpellCtx(EntityActivation.ON_EXPIRE, sourceEntity, caster, target, data); |
There was a problem hiding this comment.
This is the wrong activation entity you used here
- You should rename EntityActivation.ON_EXPIRE to EntityActivation.ON_ENTITY_EXPIRE.
- Create new EntityActivation.ON_EFFECT_EXPIRE
- Create new method SpellCtx.onEffectExpire
- Replace all usages of SpellCtx.onExpire with SpellCtx.onEffectExpire
There was a problem hiding this comment.
This would require massive refactoring. ON_EXPIRE was preexisting and was either made by Mahj or Robert, I think. ComponentPart, ExileEffectAction, onExpireCondition, ExpireAction, SpellBuilder, etc. would all be affected. If any datapack builders reference ON_EXPIRE they are sure to break as well.
How essential is this change?
ee39b40 to
f8ba63f
Compare
No description provided.