Skip to content

Commit

Permalink
Add support to DummyCaster package for vec3 origins
Browse files Browse the repository at this point in the history
  • Loading branch information
thecadorn committed Feb 7, 2025
1 parent e21b2f2 commit 0495a32
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions wurst/dummy/DummyCaster.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import ClosureTimers
* DummyCaster uses one dummy per cast, and only removes it after a set delay, to allow effects and damage to process
* Example with long delay for blizzard:
*
* new DummyCaster(casterPos)
* new DummyCaster()
* ..origin(casterPos)
* ..owner(caster)
* ..delay(15)
* ..castPoint('A000', 1, OrderIds.OrderIds.blizzard, target)
Expand All @@ -29,11 +30,16 @@ public class DummyCaster
private var castCount = 0
protected var delay = 5.0
protected var owner = DUMMY_PLAYER
protected var origin = ZERO2
protected var origin = ZERO3

construct()

/** Sets the origin of the dummy with a z-value of 0 */
function origin(vec2 pos)
this.origin = pos.toVec3()

/** Sets the origin of the dummy */
function origin(vec3 pos)
this.origin = pos

/** Sets the owner of the dummy */
Expand Down Expand Up @@ -75,9 +81,9 @@ public class DummyCaster
return dummy

protected function prepare(int id, int lvl) returns unit
let dummy = DummyRecycler.get(origin, angle(0))
let dummy = DummyRecycler.get(origin.toVec2(), angle(0))
if origin.inBounds()
dummy.setXY(origin)
dummy.setXYZReal(origin)
dummy..addAbility(id)..setMana(1000000)
if lvl > 1
dummy.setAbilityLevel(id, lvl)
Expand Down

0 comments on commit 0495a32

Please sign in to comment.