diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-13 11:55:28 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-13 11:55:28 +0800 |
| commit | c6e86ae57442b665d138bdb8bdbd2f7bbd9f5520 (patch) | |
| tree | 89fb10c7a3f4b558fa73399fa07327c0c4d66337 /data/enemyData.lua | |
| parent | 7da9c57f410caec093156fd7c1da3c190643efcc (diff) | |
feat: pokobs drop a broken heart when a bullet hits them
also add a hook (onHit) to define behavior after a enemy is hit
Diffstat (limited to 'data/enemyData.lua')
| -rw-r--r-- | data/enemyData.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/data/enemyData.lua b/data/enemyData.lua index faa9f3e..ea38366 100644 --- a/data/enemyData.lua +++ b/data/enemyData.lua @@ -112,6 +112,11 @@ local enemyData = { { type = "brokenheart", amount = 1, chances = 1 }, { type = "brokenheart", amount = 1, chances = 0.5 } }, + onHit = function(shot) + local Loot = require "objects.loot" + local lootItem = Loot:new("brokenheart", shot.x, shot.y) + table.insert(G.currentRoom.objects.loots, lootItem) + end } } |
