-
Notifications
You must be signed in to change notification settings - Fork 89
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
Follow up fix for TARGET_TYPE
#685
Conversation
Are you sure, that engine also need to check target type on collision? To me checking only |
This is how fireball looks with undead type. 6.mp4In contrast firerain with undead type makes everyone angry 7.mp4Other reason I found for preventing collision for projectile spells is that AssessDamage perc is not sent. Undead priest in G1 orc temple triggers a dialog after some hits but those spells with non-matching target type never trigger it. |
Hm, yeah. Still in case of G2 this feel-like leftover from G1, that wasn't intended to be in game:
Can we instead make no change to current G2 implementation, and provide a default implementation of |
game/world/objects/npc.cpp
Outdated
@@ -2815,6 +2815,24 @@ void Npc::runEffect(Effect&& e) { | |||
visual.startEffect(owner, std::move(e), 0, true); | |||
} | |||
|
|||
bool Npc::isSpellTargetType(TargetType t) const { |
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.
Nitpick: isSpellTargetType
-> isTargetableBySpell
Done. Just wasn't getting what you were up to initially :) |
Merged, thanks! |
#682 allowed focus only if npc guild matches the spell's
TARGET_TYPE
. But that spell could still hit and cause damage.Tested both G1&G2. Projectile spells hit only if
TARGET_TYPE
allows for, while spells like firerain ignore type and always hit.I guess in theory there's same behavior for items and interactives but they can't be damaged anyway so ignore them.