Skip to content

Commit

Permalink
tweak: optimize pulsing particle effects
Browse files Browse the repository at this point in the history
  • Loading branch information
kiedtl committed Aug 28, 2023
1 parent 9938d37 commit fe5c825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data/scripts/particles.janet
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@
(default radius :distance)
~(fn [self ticks ctx coord target]
(let [lrad (case ,radius :distance (+ 1 (:distance coord target)) ,radius)
angle (rad (* 2 (/ (self :total-spawned) lrad)))
angle (rad (* 3 (/ (self :total-spawned) lrad)))
n (+ (% (self :total-spawned) lrad) 0)]
(if ,inverse
[(:move-angle target n angle) target]
Expand Down Expand Up @@ -1159,7 +1159,7 @@
:speed 0 :lifetime 45 :territorial true
:triggers @[ [[:COND-true] [:TRIG-lerp-color :bg ELEC_BLUE2 "rgb" [:sine-custom (fn [self ticks &] (* 8.2 ticks))]]] ]
})
:lifetime 1
:lifetime 0
:spawn-count (Emitter :SCNT-dist-to-target-360)
:get-spawn-params (SPAR-circle :inverse true :radius 2)
})
Expand All @@ -1172,7 +1172,7 @@
[[:COND-true] [:TRIG-modify-color :bg "rgb" [:completed-lifetime 1]]]
]
})
:lifetime 1
:lifetime 0
:spawn-count (Emitter :SCNT-dist-to-target-360)
:get-spawn-params (SPAR-circle :inverse true :radius 2)
:birth-delay 45
Expand All @@ -1191,7 +1191,7 @@
[[:COND-true] [:TRIG-lerp-color :bg 0xffffff "rgb" [:sine-custom (fn [self ticks &] (* 8.1 ticks))]]]
]
})
:lifetime 1
:lifetime 0
:spawn-count (Emitter :SCNT-dist-to-target-360)
:get-spawn-params (SPAR-circle)
})
Expand Down
2 changes: 1 addition & 1 deletion src/items.zig
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ fn _triggerEldritchLantern(mob: *Mob, _: *Evocable) Evocable.EvokeError!void {
ui.Animation.apply(.{ .Particle = .{
.name = "pulse-brief",
.coord = state.player.coord,
.target = .{ .I = state.player.stat(.Vision) },
.target = .{ .I = state.player.stat(.Vision) - 1 },
} });

mob.addStatus(.Daze, 0, .{ .Tmp = rng.range(usize, 1, 4) });
Expand Down

0 comments on commit fe5c825

Please sign in to comment.