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
Lisa Greene
Tales of MajEyal
Commits
14d19962
Commit
14d19962
authored
4 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
New "Combat:attackTargetWith:beforeArmor" hook
parent
9fcb1be0
No related branches found
Branches containing commit
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/interface/Combat.lua
+15
-1
15 additions, 1 deletion
game/modules/tome/class/interface/Combat.lua
game/modules/tome/data/general/npcs/gwelgoroth.lua
+3
-3
3 additions, 3 deletions
game/modules/tome/data/general/npcs/gwelgoroth.lua
with
18 additions
and
4 deletions
game/modules/tome/class/interface/Combat.lua
+
15
−
1
View file @
14d19962
...
...
@@ -492,6 +492,8 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
repelled
=
true
end
local
no_procs
=
false
if
repelled
then
self
:
logCombat
(
target
,
"#Target# repels an attack from #Source#."
)
elseif
self
:
checkEvasion
(
target
)
then
...
...
@@ -547,6 +549,16 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
print
(
"[ATTACK] dagger accuracy bonus"
,
atk
,
def
,
"="
,
bonus
,
"apr ==>"
,
apr
)
end
local
hd
=
{
"Combat:attackTargetWith:beforeArmor"
,
target
=
target
,
weapon
=
weapon
,
damtype
=
damtype
,
mult
=
mult
,
dam
=
dam
,
apr
=
apr
,
atk
=
atk
,
def
=
def
,
armor
=
armor
}
if
self
:
triggerHook
(
hd
)
then
dam
=
hd
.
dam
damtype
=
hd
.
damtype
apr
=
hd
.
apr
armor
=
hd
.
armor
mult
=
hd
.
mult
no_procs
=
hd
.
no_procs
end
armor
=
math.max
(
0
,
armor
-
apr
)
dam
=
math.max
(
dam
*
pres
-
armor
,
0
)
+
(
dam
*
(
1
-
pres
))
print
(
"[ATTACK] after armor"
,
dam
)
...
...
@@ -646,7 +658,9 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
end
]]
hitted
=
self
:
attackTargetHitProcs
(
target
,
weapon
,
dam
,
apr
,
armor
,
damtype
,
mult
,
atk
,
def
,
hitted
,
crit
,
evaded
,
repelled
,
old_target_life
)
if
not
no_procs
then
hitted
=
self
:
attackTargetHitProcs
(
target
,
weapon
,
dam
,
apr
,
armor
,
damtype
,
mult
,
atk
,
def
,
hitted
,
crit
,
evaded
,
repelled
,
old_target_life
)
end
-- Visual feedback
if
hitted
then
game
.
level
.
map
:
particleEmitter
(
target
.
x
,
target
.
y
,
1
,
"melee_attack"
,
{
color
=
target
.
blood_color
})
end
...
...
This diff is collapsed.
Click to expand it.
game/modules/tome/data/general/npcs/gwelgoroth.lua
+
3
−
3
View file @
14d19962
...
...
@@ -54,7 +54,7 @@ newEntity{
newEntity
{
base
=
"BASE_NPC_GWELGOROTH"
,
name
=
"gwelgoroth"
,
color
=
colors
.
AQUAMARINE
,
desc
=
_t
[[Gwelgoroth are mighty air elementals,
torn away from their home world by a powerful magic
.]]
,
desc
=
_t
[[Gwelgoroth are mighty air elementals,
a pure incarnation of lightning and thunder
.]]
,
level_range
=
{
10
,
nil
},
exp_worth
=
1
,
rarity
=
1
,
max_life
=
resolvers
.
rngavg
(
70
,
80
),
...
...
@@ -69,7 +69,7 @@ newEntity{ base = "BASE_NPC_GWELGOROTH",
newEntity
{
base
=
"BASE_NPC_GWELGOROTH"
,
name
=
"greater gwelgoroth"
,
color
=
colors
.
STEEL_BLUE
,
resolvers
.
nice_tile
{
image
=
"invis.png"
,
add_mos
=
{{
image
=
"npc/elemental_air_greater_gwelgoroth.png"
,
display_h
=
2
,
display_y
=-
1
}}},
desc
=
_t
[[Gwelgoroth are mighty air elementals,
torn away from their home world by a powerful magic
.]]
,
desc
=
_t
[[Gwelgoroth are mighty air elementals,
a pure incarnation of lightning and thunder
.]]
,
level_range
=
{
12
,
nil
},
exp_worth
=
1
,
rarity
=
3
,
max_life
=
resolvers
.
rngavg
(
70
,
80
),
life_rating
=
10
,
...
...
@@ -86,7 +86,7 @@ newEntity{ base = "BASE_NPC_GWELGOROTH",
newEntity
{
base
=
"BASE_NPC_GWELGOROTH"
,
name
=
"ultimate gwelgoroth"
,
color
=
colors
.
ROYAL_BLUE
,
resolvers
.
nice_tile
{
image
=
"invis.png"
,
add_mos
=
{{
image
=
"npc/elemental_air_ultimate_gwelgoroth.png"
,
display_h
=
2
,
display_y
=-
1
}}},
desc
=
_t
[[Gwelgoroth are mighty air elementals,
torn away from their home world by a powerful magic
.]]
,
desc
=
_t
[[Gwelgoroth are mighty air elementals,
a pure incarnation of lightning and thunder
.]]
,
level_range
=
{
15
,
nil
},
exp_worth
=
1
,
rarity
=
5
,
rank
=
3
,
...
...
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