-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonster_log.lua
64 lines (57 loc) · 2.76 KB
/
monster_log.lua
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
---@meta _
--- A `MonsterLog` is the unlockable data entry associated with an enemy.
---
---@class MonsterLog
---@field displayName string The name of the log as displayed in-game
---@field story string The main lore of the enemy
---@field statHP number The enemy's displayed HP stat
---@field statDamage number The enemy's displayed damage stat
---@field statSpeed number The enemy's displayed speed stat
---@field sprite Sprite The sprite of the enemy used as the log icon
---@field portrait Sprite The big sprite of the enemy seen when viewing the log
---@field portraitSubimage number The subimage of the portrait sprite to display. **Note**: *This is 0-indexed rather than the usual 1-indexing*
---
---@overload fun(name: string): MonsterLog
MonsterLog = {}
--- A [Map](https://saturnyoshi.gitlab.io/RoRML-Docs/class/map.html) associating an enemy's [GMObject](https://saturnyoshi.gitlab.io/RoRML-Docs/class/gmObject.html) to its log entry.
---
--- Assigning a log to an object in this map will cause that object to drop the log when killed.
---
---@type Map<GMObject, MonsterLog>
MonsterLog.map = nil
--- Creates and returns a new monster log.
---
--- # Example
--- Create a new enemy and its log, assigning the log to the enemy.
--- ```lua
--- local enemy_obj = Object.base("EnemyClassic", "myEnemy")
--- local enemy_log = MonsterLog.new("My Enemy")
--- MonsterLog.map[enemy_obj] = enemy_log
--- ```
---
---@param name string The name to give the monster log within the current namespace
---@return MonsterLog
function MonsterLog.new(name) end
--- Executes a [namespace search](https://saturnyoshi.gitlab.io/RoRML-Docs/misc/contextSearch.html) to find an existing Item.
---
--- See the page on [namespace searching](https://saturnyoshi.gitlab.io/RoRML-Docs/misc/contextSearch.html#context-find) for more information.
---
---@param name string
---@param namespace? Namespace
---@return MonsterLog
function MonsterLog.find(name, namespace) end
--- Executes a [namespace search](https://saturnyoshi.gitlab.io/RoRML-Docs/misc/contextSearch.html) to find an existing Item.
---
--- See the page on [namespace searching](https://saturnyoshi.gitlab.io/RoRML-Docs/misc/contextSearch.html#context-find-all) for more information.
---
---@param namespace? Namespace
---@return MonsterLog[]
function MonsterLog.findAll(namespace) end
--- See the page on [namespace searching](https://saturnyoshi.gitlab.io/RoRML-Docs/misc/contextSearch.html#context-origin) for more information.
---
---@return Namespace '' The namespace containing the monster log
function MonsterLog:getOrigin() end
--- See the page on [namespace searching](https://saturnyoshi.gitlab.io/RoRML-Docs/misc/contextSearch.html#context-name) for more information.
---
---@return string '' The name of the monster log
function MonsterLog:getName() end