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
K'van
Tales of MajEyal
Commits
dde16c28
Commit
dde16c28
authored
10 years ago
by
Alex Ksandra
Browse files
Options
Downloads
Patches
Plain Diff
Reshape Weapon/Armour is egoed now, fixed removeEgoByName
parent
2589b838
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game/engines/default/engine/Zone.lua
+7
-1
7 additions, 1 deletion
game/engines/default/engine/Zone.lua
game/modules/tome/data/talents/psionic/finer-energy-manipulations.lua
+47
-29
47 additions, 29 deletions
.../tome/data/talents/psionic/finer-energy-manipulations.lua
with
54 additions
and
30 deletions
game/engines/default/engine/Zone.lua
+
7
−
1
View file @
dde16c28
...
...
@@ -525,9 +525,15 @@ function _M:removeEgo(e, ego)
return
ego
end
function
_M
:
getEgoByName
(
e
,
ego_name
)
for
i
,
v
in
ipairs
(
e
.
ego_list
or
{})
do
if
v
[
1
].
name
==
ego_name
then
return
v
[
1
]
end
end
end
function
_M
:
removeEgoByName
(
e
,
ego_name
)
for
i
,
v
in
ipairs
(
e
.
ego_list
or
{})
do
if
v
[
1
].
name
==
ego_name
then
return
self
:
removeEgo
(
e
,
v
)
end
if
v
[
1
].
name
==
ego_name
then
return
self
:
removeEgo
(
e
,
v
[
1
]
)
end
end
end
...
...
This diff is collapsed.
Click to expand it.
game/modules/tome/data/talents/psionic/finer-energy-manipulations.lua
+
47
−
29
View file @
dde16c28
...
...
@@ -101,54 +101,72 @@ newTalent{
return
math.floor
(
self
:
combatTalentMindDamage
(
t
,
2
,
10
))
end
,
reshape
=
function
(
self
,
t
,
o
,
in_dialog
)
local
Entity
=
require
(
"engine.Entity"
)
if
o
.
combat
then
local
atk_boost
=
t
.
boost
(
self
,
t
)
local
dam_boost
=
atk_boost
if
(
o
.
old_atk
or
0
)
<
atk_boost
or
(
o
.
old_
dam
or
0
)
<
dam_boost
then
if
not
o
.
been_reshaped
then
o
.
orig_atk
=
(
o
.
combat
.
atk
or
0
)
o
.
orig_dam
=
(
o
.
combat
.
dam
or
0
)
else
if
o
.
been_reshaped
==
true
then
--Update items affected by older versions of this talent
local
old_atk
=
(
o
.
old_
atk
or
0
)
local
old_dam
=
(
o
.
old_dam
or
0
)
local
old_ego
=
game
.
zone
:
removeEgoByName
(
o
,
"reshape weapon"
)
if
not
old_ego
and
o
.
been_reshaped
then
--Update items affected by older versions of this talent
if
o
.
been_reshaped
==
true
then
o
.
name
=
o
.
name
:
gsub
(
"reshaped "
,
""
,
1
)
o
.
orig_atk
=
o
.
combat
.
atk
-
(
o
.
old_atk
or
0
)
o
.
orig_dam
=
o
.
combat
.
dam
-
(
o
.
old_dam
or
0
)
o
.
combat
.
atk
=
o
.
combat
.
atk
-
(
o
.
old_atk
or
0
)
o
.
combat
.
dam
=
o
.
combat
.
dam
-
(
o
.
old_dam
or
0
)
else
o
.
combat
.
atk
=
o
.
orig_atk
o
.
combat
.
dam
=
o
.
orig_dam
end
o
.
combat
.
atk
=
o
.
orig_atk
+
atk_boost
o
.
combat
.
dam
=
o
.
orig_dam
+
dam_boost
o
.
old_atk
=
atk_boost
o
.
old_dam
=
dam_boost
o
.
been_reshaped
=
nil
elseif
old_ego
then
old_atk
=
old_ego
.
combat
.
atk
old_dam
=
old_ego
.
combat
.
dam
end
if
old_atk
<
atk_boost
or
old_dam
<
dam_boost
then
local
new_ego
=
Entity
.
new
{
name
=
"reshape weapon"
,
been_reshaped
=
"reshaped("
..
tostring
(
atk_boost
)
..
","
..
tostring
(
dam_boost
)
..
") "
,
special
=
true
,
combat
=
{
atk
=
atk_boost
,
dam
=
dam_boost
},
}
game
.
logPlayer
(
self
,
"You reshape your %s."
,
o
:
getName
{
do_colour
=
true
,
no_count
=
true
})
o
.
special
=
true
o
.
been_reshaped
=
"reshaped("
..
tostring
(
atk_boost
)
..
","
..
tostring
(
dam_boost
)
..
") "
game
.
zone
:
applyEgo
(
o
,
new_ego
,
"object"
,
true
)
if
in_dialog
then
self
:
talentDialogReturn
(
true
)
end
else
game
.
zone
:
applyEgo
(
o
,
old_ego
,
"object"
,
true
)
-- nohing happened
game
.
logPlayer
(
self
,
"You cannot reshape your %s any further."
,
o
:
getName
{
do_colour
=
true
,
no_count
=
true
})
end
else
local
armour
=
t
.
arm_boost
(
self
,
t
)
local
fat
=
t
.
fat_red
(
self
,
t
)
if
(
o
.
old_fat
or
0
)
<
fat
or
o
.
wielder
.
combat_armor
<
(
o
.
orig_arm
or
0
)
+
armour
then
o
.
wielder
=
o
.
wielder
or
{}
if
not
o
.
been_reshaped
then
o
.
orig_arm
=
(
o
.
wielder
.
combat_armor
or
0
)
o
.
orig_fat
=
(
o
.
wielder
.
fatigue
or
0
)
end
local
old_fat
=
(
o
.
old_fat
or
0
)
local
old_arm
old_arm
=
o
.
wielder
.
combat_armor
local
old_ego
=
game
.
zone
:
removeEgoByName
(
o
,
"reshape armour"
)
if
not
old_ego
and
o
.
been_reshaped
then
o
.
wielder
.
combat_armor
=
o
.
orig_arm
o
.
wielder
.
fatigue
=
o
.
orig_fat
o
.
wielder
.
combat_armor
=
(
o
.
wielder
.
combat_armor
or
0
)
+
armour
o
.
wielder
.
fatigue
=
(
o
.
wielder
.
fatigue
or
0
)
-
fat
if
o
.
wielder
.
fatigue
<
0
and
not
(
o
.
orig_fat
<
0
)
then
o
.
wielder
.
fatigue
=
0
elseif
o
.
wielder
.
fatigue
<
0
and
o
.
orig_fat
<
0
then
o
.
wielder
.
fatigue
=
o
.
orig_fat
end
o
.
old_fat
=
fat
o
.
been_reshaped
=
nil
elseif
old_ego
then
old_fat
=
old_ego
.
fatigue_reduction
end
if
old_fat
<
fat
or
old_arm
<
o
.
wielder
.
combat_armor
+
armour
then
local
real_fat
if
e
.
wielder
.
fatigue
<
0
then
real_fat
=
0
else
real_fat
=
min
(
fat
,
e
.
wielder
.
fatigue
)
end
local
new_ego
=
Entity
.
new
{
name
=
"reshape armour"
,
been_reshaped
=
"reshaped["
..
tostring
(
armour
)
..
","
..
tostring
(
o
.
wielder
.
fatigue
-
o
.
orig_fat
)
..
"%] "
,
special
=
true
,
wielder
=
{
combat_armour
=
arm
,
fatigue
=-
real_fat
},
fatigue_reduction
=
fat
,
}
game
.
logPlayer
(
self
,
"You reshape your %s."
,
o
:
getName
{
do_colour
=
true
,
no_count
=
true
})
o
.
special
=
true
if
o
.
orig_name
then
o
.
name
=
o
.
orig_name
end
--Fix name for items affected by older versions of this talent
o
.
been_reshaped
=
"reshaped["
..
tostring
(
armour
)
..
","
..
tostring
(
o
.
wielder
.
fatigue
-
o
.
orig_fat
)
..
"%] "
game
.
zone
:
applyEgo
(
o
,
new_ego
,
"object"
,
true
)
if
in_dialog
then
self
:
talentDialogReturn
(
true
)
end
else
game
.
zone
:
applyEgo
(
o
,
old_ego
,
"object"
,
true
)
game
.
logPlayer
(
self
,
"You cannot reshape your %s any further."
,
o
:
getName
{
do_colour
=
true
,
no_count
=
true
})
end
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