-
Notifications
You must be signed in to change notification settings - Fork 0
onExpire + Ui Elements #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pr/threshold-decay
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.