Commit Graph

3 Commits

Author SHA1 Message Date
kayjaydee f6ca35bfc4 refactor: simplify ChainResolver and RayCaster interfaces, enhance ChainDamageApplier logic
- Updated ChainResolver to remove unused shooterOrigin and shooterDirection parameters, streamlining the resolve method.
- Modified RayCaster interface to reflect changes in method signature, focusing on maxBlocks only.
- Enhanced ChainDamageApplier to utilize a new CauseIndexHolder for resolving the PHYSICAL damage cause index, improving clarity and performance.
- Refactored ChainDamageApplier.apply method to use HytaleEntityAdapter for target references, ensuring correct damage application.
- Adjusted tests in ChainResolverTest and ChainDamageApplierTest to align with the new method signatures and logic.

Tests: All tests passing. Build: ./gradlew clean build successful.
2026-04-28 08:20:07 +02:00
kayjaydee 03754a0646 refactor: drop unused VFX scaffolding, single-line English doc, reduce debug logs
- Remove unused chain/ParticleTrail and chain/VolumeCurve (dead since the EntityEffect
  pivot replaced the per-particle emit path) plus their test suites.
- Drop Vec3.lerp (only consumer was ParticleTrail).
- Strip step-by-step "[N/9]" debug logs from the orchestrator and per-entity logs
  from HytaleEntitySource / HytalePlayerRayCaster / ChainDamageApplier; keep one
  summary log per click and warnings on failure.
- Extract resolveChain and tryEmitVfx helpers in ChainLightningSceptreInteraction
  so firstRun reads top-down (cooldown gate -> resolve -> damage -> vfx -> deduct).
- Translate every Java doc/comment to single-line English.

Tests: 30/30 green (29 baseline kept + 1 chain damage adapter test).
Build: ./gradlew shadowJar clean.
2026-04-27 19:17:47 +02:00
kayjaydee ee9ac1ab53 feat(phase-4): VFX via EntityEffect bridge — chain hits glow blue
Working POC visual : chaque cible touchée par la chaîne reçoit l'EntityEffect
`Chain_Hit_Effect` (Server/Entity/Effects/) appliqué via
`EffectControllerComponent.addEffect`. L'effet contient EntityTopTint/BottomTint
bleu + un Splash particle scale 4 tinted, duration 0.6s.

## Pourquoi pas ParticleUtil.spawnParticleEffect

Tentatives extensives via le path standalone SpawnParticleSystem packet (3-arg
auto-broadcast et 7-arg explicit playerRef) ont échoué — particles invisibles
côté client malgré delivery confirmée serveur. Pattern Java→custom particle
non supporté en l'état Hytale 2026.03.26-89796e57b (asset sync plugin custom
pas wired). Vanilla "Splash" via le path standalone : 0/5 visible.

## EntityEffect = path ECS replication

`EffectControllerComponent.addEffect` ajoute un `ActiveEntityEffect` au target,
propagé aux clients via la sync ECS automatique (path Cleric-Rod / canonique).
Le client lookup l'EntityEffect par index dans son map (broadcast au connect)
et applique ApplicationEffects (tints + particles inline) sur le modèle de
l'entity. C'est ce path qui rend.

## Limitations POC

- VFX-02 (atténuation sonore) non livré : SoundEvent custom subit le même
  problème de sync que ParticleSystem custom. Path standalone SoundUtil
  également cassé pour assets plugin. EntityEffect a un WorldSoundEventId
  field qu'on pourrait remplir avec un vanilla, deferred.
- VolumeCurve.java + ParticleTrail.java conservés (33 tests JUnit verts) mais
  inutilisés runtime — la courbe de volume était hop-indexed et l'EntityEffect
  est uniforme. Garder pour usage futur si Hytale fix le sync.
- TRAIL_DENSITY abaissé 4.0 → 1.0 (réduction du spam packet pendant les
  itérations diagnostic, pas critique vu qu'inutilisé).
- Phase 1 items en snake_case toujours warns au boot — pas bloquant, fix
  cosmétique reporté.

## Files

NEW : `src/main/resources/Server/Entity/Effects/Chain_Hit_Effect.json`
NEW : `src/main/java/com/mythlane/chainlightning/sceptre/HytaleVfxEmitter.java`
      (réécrit pour utiliser EffectControllerComponent.addEffect)
MOD : `ChainLightningSceptreInteraction.java` étape 7.5 — passe playerRef
MOD : `ParticleTrail.TRAIL_DENSITY` 4.0 → 1.0
DEL : `Server/Particles/Chain_Spark.{particlesystem,particlespawner}` +
      `Common/Particles/Chain_Spark.png` (dropped — inutilisés par EntityEffect
      qui référence vanilla Splash)
.gitignore : ignore *.zip + note (asset source temporaires)

Tests : 41/41 verts (29 baseline + 12 Phase 4 pure-Java).
Build : `./gradlew shadowJar` clean.
UAT 17:05 : confirmé visuel — mobs glow bleu sur hit chain.
2026-04-27 19:08:39 +02:00