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
2265e0b3
Commit
2265e0b3
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Plain Diff
Merge branch 'Hachem_Muche/t-engine4-RandBossCallbacks'
parents
0c358f6f
701a60e2
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/GameState.lua
+7
-4
7 additions, 4 deletions
game/modules/tome/class/GameState.lua
with
7 additions
and
4 deletions
game/modules/tome/class/GameState.lua
+
7
−
4
View file @
2265e0b3
...
...
@@ -1886,10 +1886,11 @@ end
--- Add character classes to an actor updating stats, talents, and equipment
-- @param b = actor(boss) to update
-- @param data = optional parameters:
-- @param data.force_classes = specific classes to add {Corruptor = true, Bulwark = true, ...} ignores restrictions
-- @param data.force_classes = specific classes to apply first {Corruptor = true, Bulwark = true, ...} ignores restrictions
-- forced classes are applied first, ignoring restrictions
-- @param data.nb_classes = random classes to add (in addition to any forced classes) <2>
-- @param data.class_filter = function(cdata) that must return true for any class picked.
-- (cdata = subclass definition in engine.Birther.birth_descriptor_def.subclass)
-- @param data.class_filter = function(cdata
, b
) that must return true for any class picked.
-- (cdata
, b
= subclass definition in engine.Birther.birth_descriptor_def.subclass
, boss (before classes are applied)
)
-- @param data.no_class_restrictions set true to skip class compatibility checks <nil>
-- @param data.add_trees = {["talent tree name 1"]=true, ["talent tree name 2"]=true, ..} additional talent trees to learn
-- @param data.check_talents_level set true to enforce talent level restrictions <nil>
...
...
@@ -2028,7 +2029,7 @@ print(" power types: not_power_source =", table.concat(table.keys(b.not_power_
local
force_classes
=
data
.
force_classes
and
table
.
clone
(
data
.
force_classes
)
for
name
,
cdata
in
ipairs
(
classes
)
do
if
force_classes
and
force_classes
[
cdata
.
name
]
then
apply_class
(
table
.
clone
(
cdata
,
true
))
force_classes
[
cdata
.
name
]
=
nil
elseif
not
cdata
.
not_on_random_boss
and
(
not
cdata
.
random_rarity
or
rng
.
chance
(
cdata
.
random_rarity
))
and
(
not
data
.
class_filter
or
data
.
class_filter
(
cdata
))
then
list
[
#
list
+
1
]
=
cdata
elseif
not
cdata
.
not_on_random_boss
and
(
not
cdata
.
random_rarity
or
rng
.
chance
(
cdata
.
random_rarity
))
and
(
not
data
.
class_filter
or
data
.
class_filter
(
cdata
,
b
))
then
list
[
#
list
+
1
]
=
cdata
end
end
local
to_apply
=
data
.
nb_classes
or
2
...
...
@@ -2048,6 +2049,7 @@ end
-- calls _M:applyRandomClass(b, data, instant) to add classes, talents, and equipment based on class descriptors
-- handles data.nb_classes, data.force_classes, data.class_filter, ...
-- optional parameters:
-- @param data.init = function(data, b) to run before generation
-- @param data.level = minimum level range for actor generation <1>
-- @param data.rank = rank <3.5-4>
-- @param data.life_rating = function(b.life_rating) <1.7 * base.life_rating + 4-9>
...
...
@@ -2062,6 +2064,7 @@ end
function
_M
:
createRandomBoss
(
base
,
data
)
local
b
=
base
:
clone
()
data
=
data
or
{
level
=
1
}
if
data
.
init
then
data
.
init
(
data
,
b
)
end
data
.
nb_classes
=
data
.
nb_classes
or
2
------------------------------------------------------------
...
...
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