Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
tome
Tales of MajEyal
Commits
b08048f6
There was a problem fetching the pipeline summary.
Commit
b08048f6
authored
5 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
New ActorProject:projectCollect method
parent
1474a37e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/engines/default/engine/interface/ActorProject.lua
+19
-0
19 additions, 0 deletions
game/engines/default/engine/interface/ActorProject.lua
with
19 additions
and
0 deletions
game/engines/default/engine/interface/ActorProject.lua
+
19
−
0
View file @
b08048f6
...
...
@@ -342,6 +342,25 @@ function _M:canProject(t, x, y)
return
is_hit
,
stop_x
,
stop_y
,
stop_radius_x
,
stop_radius_y
end
function
_M
:
projectCollect
(
t
,
x
,
y
,
kind
,
cond
,
tgts
)
tgts
=
tgts
or
{}
self
:
project
(
t
,
x
,
y
,
function
(
px
,
py
)
local
tgt
=
game
.
level
.
map
(
px
,
py
,
kind
)
if
not
tgt
then
return
end
local
ok
=
false
if
kind
==
Map
.
ACTOR
and
type
(
cond
)
~=
"function"
then
if
cond
==
"hostile"
and
self
:
reactionToward
(
tgt
)
<
0
then
ok
=
true
elseif
cond
==
"friend"
and
self
:
reactionToward
(
tgt
)
>
0
then
ok
=
true
elseif
cond
==
nil
then
ok
=
true
end
else
if
cond
(
tgt
,
px
,
py
)
then
ok
=
true
end
end
if
ok
then
tgts
[
tgt
]
=
{
x
=
px
,
y
=
py
,
dist
=
core
.
fov
.
distance
(
self
.
x
,
self
.
y
,
px
,
py
)}
end
end
)
return
tgts
end
--- Calls :getTarget and :canProject to limit the results and returns the same as getTarget
function
_M
:
getTargetLimited
(
t
)
local
x
,
y
=
self
:
getTarget
(
t
)
...
...
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