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
Otowa Kotori
Tales of MajEyal
Commits
16456447
Commit
16456447
authored
10 years ago
by
Alex Ksandra
Browse files
Options
Downloads
Patches
Plain Diff
Cleaned upnames in automaticTalents & when cooldown is lower than usage time, refuse to auto use.
parent
1e9033a7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/modules/tome/class/Player.lua
+10
-6
10 additions, 6 deletions
game/modules/tome/class/Player.lua
with
10 additions
and
6 deletions
game/modules/tome/class/Player.lua
+
10
−
6
View file @
16456447
...
...
@@ -852,27 +852,31 @@ function _M:automaticTalents()
for
tid
,
c
in
pairs
(
self
.
talents_auto
)
do
local
t
=
self
.
talents_def
[
tid
]
local
spotted
=
spotHostiles
(
self
,
true
)
if
(
t
.
mode
~=
"sustained"
or
not
self
.
sustain_talents
[
tid
])
and
not
self
.
talents_cd
[
tid
]
and
self
:
preUseTalent
(
t
,
true
,
true
)
and
(
not
t
.
auto_use_check
or
t
.
auto_use_check
(
self
,
t
))
then
local
cd
=
self
:
getTalentCooldown
(
t
)
or
0
local
turns_used
=
util
.
getval
(
t
.
no_energy
,
self
,
t
)
==
true
and
0
or
1
if
cd
<=
turns_used
then
game
.
logPlayer
(
self
,
"Automatic use of talent %s skipped: cooldown too low (%d)."
,
t
.
name
,
cd
)
elseif
(
t
.
mode
~=
"sustained"
or
not
self
.
sustain_talents
[
tid
])
and
not
self
.
talents_cd
[
tid
]
and
self
:
preUseTalent
(
t
,
true
,
true
)
and
(
not
t
.
auto_use_check
or
t
.
auto_use_check
(
self
,
t
))
then
if
(
c
==
1
)
or
(
c
==
2
and
#
spotted
<=
0
)
or
(
c
==
3
and
#
spotted
>
0
)
then
if
c
~=
2
then
uses
[
#
uses
+
1
]
=
{
name
=
t
.
name
,
no_energy
=
util
.
getval
(
t
.
no_energy
,
self
,
t
)
==
true
and
0
or
1
,
cd
=
self
:
getTalentCooldown
(
t
)
or
0
,
fct
=
function
()
self
:
useTalent
(
tid
)
end
}
uses
[
#
uses
+
1
]
=
{
name
=
t
.
name
,
turns_used
=
turns_used
,
cd
=
cd
,
fct
=
function
()
self
:
useTalent
(
tid
)
end
}
else
if
not
self
:
attr
(
"blind"
)
then
uses
[
#
uses
+
1
]
=
{
name
=
t
.
name
,
no_energy
=
util
.
getval
(
t
.
no_energy
,
self
,
t
)
==
true
and
0
or
1
,
cd
=
self
:
getTalentCooldown
(
t
)
or
0
,
fct
=
function
()
self
:
useTalent
(
tid
,
nil
,
nil
,
nil
,
self
)
end
}
uses
[
#
uses
+
1
]
=
{
name
=
t
.
name
,
turns_used
=
turns_used
,
cd
=
cd
,
fct
=
function
()
self
:
useTalent
(
tid
,
nil
,
nil
,
nil
,
self
)
end
}
end
end
end
if
c
==
4
and
#
spotted
>
0
then
for
fid
,
foe
in
pairs
(
spotted
)
do
if
foe
.
x
>=
self
.
x
-
1
and
foe
.
x
<=
self
.
x
+
1
and
foe
.
y
>=
self
.
y
-
1
and
foe
.
y
<=
self
.
y
+
1
then
uses
[
#
uses
+
1
]
=
{
name
=
t
.
name
,
no_energy
=
util
.
getval
(
t
.
no_energy
,
self
,
t
)
==
true
and
0
or
1
,
cd
=
self
:
getTalentCooldown
(
t
)
or
0
,
fct
=
function
()
self
:
useTalent
(
tid
)
end
}
uses
[
#
uses
+
1
]
=
{
name
=
t
.
name
,
turns_used
=
turns_used
,
cd
=
cd
,
fct
=
function
()
self
:
useTalent
(
tid
)
end
}
end
end
end
end
end
table.sort
(
uses
,
function
(
a
,
b
)
local
an
,
nb
=
util
.
getval
(
a
.
no_energy
,
self
,
a
),
util
.
getval
(
b
.
no_energy
,
self
,
b
)
local
an
,
nb
=
a
.
tunrs_used
,
b
.
turns_used
if
an
<
nb
then
return
true
elseif
an
>
nb
then
return
false
else
...
...
@@ -884,7 +888,7 @@ function _M:automaticTalents()
table
.
print
(
uses
)
for
_
,
use
in
ipairs
(
uses
)
do
use
.
fct
()
if
u
til
.
getval
(
use
.
no_energy
,
self
,
use
)
==
1
then
break
end
if
u
se
.
turns_used
>
0
then
break
end
end
self
:
attr
(
"_forbid_sounds"
,
-
1
)
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