Repository navigation
Implement projectiles from Wld_PlayEffect - #1083
Open
pieterdeschepper wants to merge 1 commit into
Open
pieterdeschepper wants to merge 1 commit into
pieterdeschepper wants to merge 1 commit into
Conversation
Wld_PlayEffect returned early when the script passed a damage, level or projectile argument, so the Sleeper in Gothic 1 (ZS_Sleeper_Loop) never shot his fireball at the player. For isProjectile, the effect is now launched like a spell, from the source npc toward the target, through a new Bullet built from a VisualFx. It has no gravity and stops at walls, like a spell. On hit it deals the given damage of the given damage types (minus protection), without the bow hit-chance and critical-hit rules. Non-projectile calls with damage or a level still log "effect not implemented". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wld_PlayEffectreturned early (// TODO, "effect not implemented") whenever the script passed a damage, level or projectile argument. In Gothic 1 the only such call is the Sleeper's fireball inZS_Sleeper_Loop:As a result the Sleeper never attacked the player during the final fight.
Change
Wld_PlayEffectwithisProjectilelaunches the effect with the newWorld::shootEffect. It reuses the spell trajectory code fromshootSpell(moved intomagicTrajectory), so the effect'semTrjOriginNode/emTrjTargetNodeandemTrjTargetRangeapply. The damage argument is applied to every damage type set in the mask, as for spells.Bullet(World&, const VisualFx&, pos)for a projectile without an item or spell.BulletBody::setMagic()/isMagic()give it spell physics: no gravity, and it stops at walls instead of bouncing.Bullet::isEffect()):emFXCollDynruns, as for spells.Testing
Gothic 1 on macOS (Apple M3 Pro), loading a save in the Sleeper's chamber. Every 5 seconds the Sleeper shoots a fireball:
I tested in a local build. Gothic 2 is not tested.
🤖 Generated with Claude Code