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
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
Recaiden
Tales of MajEyal
Commits
4943d52d
Commit
4943d52d
authored
4 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
new way to levelup combat tables
parent
d169a276
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game/modules/tome/class/Actor.lua
+1
-0
1 addition, 0 deletions
game/modules/tome/class/Actor.lua
game/modules/tome/resolvers.lua
+28
-0
28 additions, 0 deletions
game/modules/tome/resolvers.lua
with
29 additions
and
0 deletions
game/modules/tome/class/Actor.lua
+
1
−
0
View file @
4943d52d
...
...
@@ -3462,6 +3462,7 @@ function _M:die(src, death_note)
if
src
and
src
.
fireTalentCheck
then
src
:
fireTalentCheck
(
"callbackOnKill"
,
self
,
death_note
)
end
if
src
and
src
.
summoner
and
src
.
summoner
.
fireTalentCheck
then
src
.
summoner
:
fireTalentCheck
(
"callbackOnSummonKill"
,
src
,
self
,
death_note
)
end
if
game
.
zone
and
game
.
zone
.
on_actor_death
then
game
.
zone
:
on_actor_death
(
self
,
src
,
death_note
)
end
-- We do it at the end so that effects can detect death
game
:
onTickEnd
(
function
()
...
...
This diff is collapsed.
Click to expand it.
game/modules/tome/resolvers.lua
+
28
−
0
View file @
4943d52d
...
...
@@ -1413,3 +1413,31 @@ end
function
resolvers
.
calc
.
for_campaign
(
t
,
e
)
if
game
:
isCampaign
(
t
[
1
])
then
t
[
2
](
e
)
end
end
--- Make defining combat tables for npcs easy
function
resolvers
.
easy_combat_table
(
def
)
return
{
__resolver
=
"easy_combat_table"
,
def
}
end
function
resolvers
.
calc
.
easy_combat_table
(
t
,
e
)
local
def
=
table
.
clone
(
t
[
1
],
true
)
if
not
e
.
_levelup_info
then
e
.
_levelup_info
=
{}
end
local
base_level
=
1
if
e
.
level_range
and
e
.
level_range
[
1
]
then
base_level
=
e
.
level_range
[
1
]
end
if
type
(
def
.
dam
)
==
"table"
then
local
per_level
=
(
def
.
dam
[
2
]
-
def
.
dam
[
1
])
/
50
e
.
_levelup_info
[
#
e
.
_levelup_info
+
1
]
=
{
every
=
1
,
inc
=
per_level
,
max
=
def
.
dam
.
max_at
,
kchain
=
{
"combat"
},
k
=
"dam"
}
def
.
dam
=
base_level
*
per_level
+
def
.
dam
[
1
]
end
if
type
(
def
.
atk
)
==
"table"
then
local
per_level
=
(
def
.
atk
[
2
]
-
def
.
atk
[
1
])
/
50
e
.
_levelup_info
[
#
e
.
_levelup_info
+
1
]
=
{
every
=
1
,
inc
=
per_level
,
max
=
def
.
atk
.
max_at
,
kchain
=
{
"combat"
},
k
=
"atk"
}
def
.
atk
=
base_level
*
per_level
+
def
.
atk
[
1
]
end
if
type
(
def
.
apr
)
==
"table"
then
local
per_level
=
(
def
.
apr
[
2
]
-
def
.
apr
[
1
])
/
50
e
.
_levelup_info
[
#
e
.
_levelup_info
+
1
]
=
{
every
=
1
,
inc
=
per_level
,
max
=
def
.
apr
.
max_at
,
kchain
=
{
"combat"
},
k
=
"apr"
}
def
.
apr
=
base_level
*
per_level
+
def
.
apr
[
1
]
end
return
def
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