-
Notifications
You must be signed in to change notification settings - Fork 75
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
Enemies should not be able to teleport or summon with targets out of sight #148
Comments
Send reasonable.
…On Sun, Feb 13, 2022, 5:19 PM Dominik Reichardt ***@***.***> wrote:
Especially with Liches, they shouldn't be able to teleport to or summon
something at the Avatar without a line of sight. See Gotcha's forum post
http://exult.info/forum/viewtopic.php?f=1&t=1791278&sid=cfc074524d41ae44dde03f0466733d9c
.
A check for line of sight prevents this. Please let me know if I do this
correctly and whether you can think of a place where this could break the
game:
diff --git a/combat.cc b/combat.cc
index 75f9e87d..fbd3268c 100644
--- a/combat.cc
+++ b/combat.cc
@@ -234,6 +234,10 @@ bool Combat_schedule::teleport(
eman->add_effect(std::make_unique<Fire_field_effect>(src));
int sfx = Audio::game_sfx(43);
Audio::get_ptr()->play_sound_effect(sfx, npc); // The weird noise.
+ // check line of sight now to give it the appaearnace of the spell
+ // failing as in the original
+ if (!Fast_pathfinder_client::is_straight_path(npc, trg))
+ return false;
npc->move(dest.tx, dest.ty, dest.tz);
// Show the stars.
eman->add_effect(std::make_unique<Sprites_effect>(7, npc, 0, 0, 0, 0));
@@ -246,6 +250,9 @@ bool Combat_schedule::teleport(
bool Combat_schedule::summon(
) {
+ Game_object *trg = npc->get_target();
+ if (!Fast_pathfinder_client::is_straight_path(npc, trg))
+ return false;
ucmachine->call_usecode(SummonSpellUsecode,
npc, Usecode_machine::double_click);
npc->start_std(); // Back into queue.
—
Reply to this email directly, view it on GitHub
<#148>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE2RJK3P3OJSTHGKLJJSJDU3A36PANCNFSM5OJ3QECA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks! Added in e0a5530 |
Should you move the Line of Sight check up in I would assume a Lich, a Supra-Genius evil creature, be able to predict that the Teleport will fail by lack of Line of Sight and not even attempt it, much less create a Fire Field where it is standing. |
In the original the fire fields get created as well, so I thought mimicking this would be the best way to handle it. Without those fire fields it might look too boring, perhaps? Something else I was thinking about there in regard to the combat difficulty setting. Maybe it would be a nice touch to allow monsters without line of sight to summon at harder and to teleport at hardest. So far the combat difficulty only handles hit points differently AFAIK |
If so then OK. Looks to me as a defect in the combat IA, but OK. In that case, please replace the Because, as they are called, |
Thanks for the explanation! Changed the teleport() function accordingly but left the summon() as I have no indication if the original did execute it. |
Especially with Liches, they shouldn't be able to teleport to or summon something at the Avatar without a line of sight. See Gotcha's forum post http://exult.info/forum/viewtopic.php?f=1&t=1791278&sid=cfc074524d41ae44dde03f0466733d9c.
A check for line of sight prevents this. Please let me know if I do this correctly and whether you can think of a place where this could break the game:
The text was updated successfully, but these errors were encountered: