Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lisa Greene
Tales of MajEyal
Commits
4b43bb08
Commit
4b43bb08
authored
5 years ago
by
Chris Davidson
Browse files
Options
Downloads
Patches
Plain Diff
Teleport and Phase Door now become less accurate with distance to target when used by the AI
parent
17b2eb49
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/modules/tome/data/talents/spells/conveyance.lua
+9
-2
9 additions, 2 deletions
game/modules/tome/data/talents/spells/conveyance.lua
with
9 additions
and
2 deletions
game/modules/tome/data/talents/spells/conveyance.lua
+
9
−
2
View file @
4b43bb08
...
...
@@ -55,6 +55,13 @@ local teleport_tactical = function(self, t, aitarget)
return
tacs
end
-- Reduce accuracy when teleporting to the target based on their distance
local
closeinSpread
=
function
(
self
,
t
,
aitarget
)
local
dist
=
core
.
fov
.
distance
(
self
.
x
,
self
.
y
,
aitarget
.
x
,
aitarget
.
y
)
local
tx
,
ty
=
self
:
aiSeeTargetPos
(
aitarget
,
dist
,
20
)
-- Add distance to target to the random spread radius, cap total spread at 20
return
tx
,
ty
end
newTalent
{
name
=
"Phase Door"
,
type
=
{
"spell/conveyance"
,
1
},
...
...
@@ -110,7 +117,7 @@ newTalent{
if
self
.
ai_state
.
tactic
==
"closein"
then
-- NPC trying to close in
local
dx
,
dy
=
self
.
x
-
tx
,
self
.
y
-
ty
if
target
==
self
then
-- teleport ourselves to target
x
,
y
=
tx
,
ty
x
,
y
=
closeinSpread
(
self
,
t
,
aitarget
)
else
-- teleport target to ourselves
x
,
y
=
self
.
x
,
self
.
y
end
...
...
@@ -218,7 +225,7 @@ newTalent{
if
self
.
ai_state
.
tactic
==
"closein"
then
-- NPC trying to close in
local
dx
,
dy
=
self
.
x
-
tx
,
self
.
y
-
ty
if
target
==
self
then
-- teleport ourselves to target
x
,
y
=
tx
,
ty
x
,
y
=
closeinSpread
(
self
,
t
,
aitarget
)
else
-- teleport target to ourselves
x
,
y
=
self
.
x
,
self
.
y
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment