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
819fccf3
Commit
819fccf3
authored
11 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
fix directional shout
parent
9c1fd2f3
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/data/gfx/particles/directional_shout.lua
+13
-12
13 additions, 12 deletions
game/modules/tome/data/gfx/particles/directional_shout.lua
with
13 additions
and
12 deletions
game/modules/tome/data/gfx/particles/directional_shout.lua
+
13
−
12
View file @
819fccf3
...
...
@@ -22,9 +22,13 @@ gm, gM = gm or 0.8, gM or 1
bm
,
bM
=
bm
or
0
,
bM
or
0
am
,
aM
=
am
or
1
,
aM
or
1
local
dir
=
math.deg
(
math
.
atan2
(
ty
,
tx
))
-
90
local
spread
=
spread
or
75
/
2
dir
=
dir
-
spread
local
dir
=
math.deg
(
math
.
atan2
(
ty
,
tx
))
-- engine.Target uses a default cone_angle of 55, but from what I can tell, it
-- rounds up rather aggressively (if part of a grid square is affected, the whole
-- grid square is), so for the purposes of particle effects, 75 works well.
local
spread
=
spread
or
75
dir
=
dir
-
spread
/
2
local
distortion_factor
=
1
+
(
distortion_factor
or
0
.
1
)
local
life
=
life
or
30
...
...
@@ -33,29 +37,26 @@ local basespeed = fullradius / life
local
points
=
{}
local
nbone
for
fork
_i
=
1
,
nb_circles
or
7
do
for
circle
_i
=
1
,
nb_circles
or
7
do
local
size
=
size
or
2
local
r
=
10
local
a
=
math.rad
(
dir
)
local
firstspeed
=
rng
.
float
(
basespeed
,
basespeed
*
distortion_factor
)
points
[
#
points
+
1
]
=
{
size
=
size
,
dir
=
a
+
math.rad
(
90
),
vel
=
firstspeed
,
x
=
math.cos
(
a
)
*
r
,
y
=
math.sin
(
a
)
*
r
,
prev
=-
1
}
for
i
=
1
,
spread
*
2
,
5
do
for
i
=
0
,
spread
,
5
do
local
a
=
math.rad
(
dir
+
i
)
points
[
#
points
+
1
]
=
{
size
=
size
,
dir
=
a
+
math.rad
(
90
)
,
dir
=
a
,
vel
=
rng
.
float
(
basespeed
,
basespeed
*
distortion_factor
),
x
=
math.cos
(
a
)
*
r
,
y
=
math.sin
(
a
)
*
r
,
prev
=#
points
-
1
prev
=
i
==
0
and
-
1
or
#
points
-
1
}
end
if
not
nbone
then
nbone
=
#
points
end
end
local
nbp
=
#
points
-- Populate the
lightning
based on the
fork
s
-- Populate the
sound waves
based on the
number of circle
s
return
{
engine
=
core
.
particles
.
ENGINE_LINES
,
generator
=
function
()
local
p
=
table.remove
(
points
,
1
)
...
...
@@ -80,4 +81,4 @@ function(self)
nbp
=
nbp
-
nbone
end
end
,
nbp
,
"particles_images/beam"
nbp
,
"particles_images/beam"
\ No newline at end of file
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