Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/doc/lua/projectile.md
blob: 8552cab5bff447043d46011aa4ba2fdccc0460b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
The projectile table contains bindings specific to projectiles which are available in addition to their common tables.

---

#### `Json` projectile.getParameter(`String` parameter, `Json` default)

Returns the value for the specified config parameter. If there is no value set, returns the default.

---

#### `void` projectile.die()

Destroys the projectile.

---

#### `EntityId` projectile.sourceEntity()

Returns the entity id of the projectile's source entity, or `nil` if no source entity is set.

---

#### `float` projectile.powerMultiplier()

Returns the projectile's power multiplier.

---

#### `float` projectile.power()

Returns the projectile's power (damage).

---

#### `void` projectile.setPower(`float` power)

Sets the projectile's power (damage).

---

#### `float` projectile.timeToLive()

Returns the projectile's current remaining time to live.

---

#### `void` projectile.setTimeToLive(`float` timeToLive)

Sets the projectile's current remaining time to live. Altering the time to live may cause visual disparity between the projectile's master and slave entities.

---

#### `bool` projectile.collision()

Returns `true` if the projectile has collided and `false` otherwise.

---

#### `void` projectile.processAction(`Json` action)

Immediately performs the specified action. Action should be specified in a format identical to a single entry in e.g. actionOnReap in the projectile's configuration. This function will not properly perform rendering actions as they will not be networked.

---

#### 'void' projectile.setReferenceVelocity(Maybe<`Vec2F`> velocity)

Sets the projectile's reference velocity (a base velocity to which movement is relative)