athrane / bassebombecraft

Bassebombecraft Minecraft Mod
https://www.curseforge.com/minecraft/mc-mods/bassebombecraft
GNU General Public License v3.0
0 stars 0 forks source link

Add contagion projectile modifier item #1250

Closed athrane closed 2 years ago

athrane commented 2 years ago

Final (and simple)semantics for the item:

Contagion2 operator

CoreOp

The predicate function will exclude an entity if it already has contagion, i.e. it doesn't doesn't spread to already contagious entities.

Implementation detail: The predicate function is defined as (please notice the nice AND):

Function<Ports, Predicate<LivingEntity>> fnGetPredicate = p -> hasLivingEntitiesDifferentIds(
  applyV(fnGetTrueSource, p)).and(hasNotPotionEffect(CONTAGION_EFFECT.get()));

AoeEffectOp

ContagionEffect potion effect

CoreOp (for spread of potion effect)

The predicate function will only exclude itself. Any effect (including Contagion) will effect spread to any entity. Even if it is already contagious.

AoeEffectOp (for spread of potion effect)

athrane commented 2 years ago

Comparison with wildfire operator

CoreOp

Operators

Semantics

AoeEffectOp

Implemented by WildfireEffect.splAoeEffectOp.

Operators

Semantics

athrane commented 2 years ago

Discarded semantics for the item:

Contagion2 operator

CoreOp

The predicate function will exclude an entity if it already has contagion, i.e. it doesn't doesn't spread to already contagious entities.

Implementation detail: The predicate function is defined as (please notice the nice AND):

Function<Ports, Predicate<LivingEntity>> fnGetPredicate = p -> hasLivingEntitiesDifferentIds(
  applyV(fnGetTrueSource, p)).and(hasNotPotionEffect(CONTAGION_EFFECT.get()));

AoeEffectOp

ContagionEffect potion effect

CoreOp1 (for spread of contagion)

The predicate function will only exclude itself. Any effect (including Contagion) will effect spread to any entity. Even if it is already contagious.

AoeEffectOp1 (for spread of contagion)

CoreOp2 (for spread of potion effect)

The predicate function will only exclude itself. Any effect (including Contagion) will effect spread to any entity. Even if it is already contagious.

AoeEffectOp2 (for spread of potion effect)

CoreOp

The predicate function will only exclude itself. Any effect (including Contagion) will effect spread to any entity. Even if it is already contagious.

AoeEffectOp

athrane commented 2 years ago

Event more discarded semantics for the item:

Contagion2 operator

CoreOp

The predicate function will exclude an entity if it already has contagion, i.e. it doesn't doesn't spread to already contagious entities.

Implementation detail: The predicate function is defined as (please notice the nice AND):

Function<Ports, Predicate<LivingEntity>> fnGetPredicate = p -> hasLivingEntitiesDifferentIds(
  applyV(fnGetTrueSource, p)).and(hasNotPotionEffect(CONTAGION_EFFECT.get()));

AoeEffectOp

ContagionEffect potion effect

CoreOp (for spread of potion effect)

The predicate function will only exclude itself. Any effect (including Contagion) will effect spread to any entity. Even if it is already contagious.

AoeEffectOp (for spread of potion effect)

CoreOp

The predicate function will only exclude itself. Any effect (including Contagion) will effect spread to any entity. Even if it is already contagious.

AoeEffectOp

athrane commented 2 years ago

Resolved with commit: f5bee22