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
efc265af
Commit
efc265af
authored
4 years ago
by
Ryan Yappert
Browse files
Options
Downloads
Patches
Plain Diff
WIP regenResourcesFast change.
parent
dabf7032
No related branches found
Branches containing commit
No related tags found
1 merge request
!692
Resource-ification project for Life, Feedback, etc.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/engines/default/engine/interface/ActorResource.lua
+3
-2
3 additions, 2 deletions
game/engines/default/engine/interface/ActorResource.lua
with
3 additions
and
2 deletions
game/engines/default/engine/interface/ActorResource.lua
+
3
−
2
View file @
efc265af
...
...
@@ -215,7 +215,8 @@ function _M:recomputeRegenResources()
for
i
=
1
,
#
_M
.
resources_def
do
r
=
_M
.
resources_def
[
i
]
if
r
.
regen_prop
and
(
not
r
.
talent
or
self
:
knowTalent
(
r
.
talent
))
then
fstr
=
fstr
..
(
"self.%s = util.bound(self.%s + self.%s, self.%s, self.%s) "
):
format
(
r
.
short_name
,
r
.
short_name
,
r
.
regen_prop
,
r
.
minname
,
r
.
maxname
)
--fstr = fstr..("self.%s = util.bound(self.%s + self.%s, self.%s, self.%s) "):format(r.short_name, r.short_name, r.regen_prop, r.minname, r.maxname)
fstr
=
fstr
..
(
"self[%s](self)"
):
format
(
r
.
regenFunction
)
end
end
...
...
@@ -226,7 +227,7 @@ end
--- Regen resources, should be called in your actor's act() method
function
_M
:
regenResources
()
--
if self.regenResourcesFast then return self:regenResourcesFast() end
if
self
.
regenResourcesFast
then
return
self
:
regenResourcesFast
()
end
local
r
for
i
=
1
,
#
_M
.
resources_def
do
...
...
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