Compare commits

...

26 Commits

Author SHA1 Message Date
781a09a947 Merge branch 'feature/effects' 2026-05-06 10:19:23 +03:00
9e7a787d83 Merge branch 'main' of https://gitea.peaashmeter.dev/ArcMutex/heroes-of-nerevelon 2026-05-03 20:29:38 +03:00
d41f9fb542 remove pQueue by y-axis from CharacterGrid as sorting is done now during
the draw
2026-05-03 20:29:31 +03:00
80ae1e0a68 add hints in .luarc.json 2026-05-03 20:28:12 +03:00
790d63d37f add missing annotaion for ai.makeTurn 2026-04-25 18:26:02 +03:00
fd47ada751 fix dev_attack sound timing 2026-04-24 05:01:51 +03:00
149432e699 Create progressive_plains.ogg 2026-04-24 04:38:36 +03:00
8eb453ff7f move assets to lfs 2026-04-24 04:38:28 +03:00
a39be70969 conifgure git LFS 2026-04-24 04:37:58 +03:00
41a906fe6a Merge pull request 'rework/rendering' (#36) from rework/rendering into main
Reviewed-on: #36
2026-04-23 19:52:51 +03:00
3e23599c88 add luals annotaions 2026-04-23 19:35:44 +03:00
cb53fa8d88 feat: implement sprite_light uber-shader with dynamic lighting and animated outline 2026-04-23 19:34:35 +03:00
254e94fc29 improve characters dynamic lighting 2026-04-23 19:25:12 +03:00
606c1158e3 move character lighting to shader 2026-04-23 18:58:08 +03:00
1ad38c3103 feat: implement RenderQueue, SpriteBatch for tiles and Low-Res rendering for lights/shadows 2026-04-23 17:34:31 +03:00
c2c33cbf1b hotfix: revert some shit caused by merge
make the boar work with new AI features
2026-04-17 00:38:16 +03:00
d33d6eedd6 Merge pull request 'feature/ai-but-cooler' (#35) from feature/ai-but-cooler into main
Есть куда стремиться, но для work-in-progress покатит. Потом с удобством использования поиграемся

Reviewed-on: #35
2026-04-17 00:31:10 +03:00
d7228cc322 slightly tweak the types in AIBehavior 2026-04-17 00:29:53 +03:00
d1597d8ffa i dont need epsilon now 2026-04-16 15:04:50 +03:00
85883dfa7d he's (ai) doing some stuff and i think its cool 2026-04-15 17:29:16 +03:00
a16b279e44 i hate negative numbers 2026-04-15 14:53:07 +03:00
cdf68004da new circleVectors (midpoint circle algorithm) and pathToClosestCharacter
function
2026-04-15 13:42:33 +03:00
bad4b494cd circleVectors function and some ai progress 2026-04-15 09:56:17 +03:00
b6737e8f0b some casual self typing 2026-04-14 19:25:00 +03:00
db8db450d0 ai maketurn, but in table 2026-04-12 23:21:50 +03:00
46c7b46bd1 added class stat 2026-04-12 23:10:20 +03:00
4 changed files with 16 additions and 15 deletions

View File

@ -6,5 +6,6 @@
"love.filesystem.load": "loadfile"
},
"workspace.ignoreDir": ["dev_utils"],
"diagnostics.ignoredFiles": "Disable"
"diagnostics.ignoredFiles": "Disable",
"hint.enable": true
}

View File

@ -1,6 +1,7 @@
local easing = require "lib.utils.easing"
local pf = require "lib.pathfinder"
local utils = require "lib.utils.utils"
local task = require "lib.utils.task"
--- @alias AIAction fun(self: AIBehavior): Task<nil>
@ -156,6 +157,16 @@ local behavior = {}
behavior.__index = behavior
behavior.id = "ai"
--- Заставляет ИИ сделать ход
---
--- По умолчанию ничего не делает
--- @return Task<nil>
function behavior:makeTurn()
return function(callback)
callback()
end
end
--- @param class Class
function behavior.new(class)
return setmetatable({

View File

@ -37,8 +37,8 @@ function behavior.new(hp, mana, initiative, class, isInTurnOrder)
hp = hp or 20,
mana = mana or 10,
initiative = initiative or 10,
class = class or "dev_warrior",
isInTurnOrder = isInTurnOrder or true,
class = "dev_warrior",
amIAlive = true
}, behavior)
end

View File

@ -1,8 +1,6 @@
local utils = require "lib.utils.utils"
local pQueue = require "lib.utils.priority_queue"
--- @class CharacterGrid : Grid
--- @field __grid {string: Id|nil}
--- @field yOrderQueue PriorityQueue<Character> очередь отрисовки сверху вниз
local grid = setmetatable({}, require "lib.level.grid.base")
grid.__index = grid
@ -29,22 +27,13 @@ function grid:add(id)
end
end
--- @param a Character
--- @param b Character
local function drawCmp(a, b)
--- @TODO: это захардкожено, надо разделить поведения
return a:has(Tree.behaviors.positioned).position.y < b:has(Tree.behaviors.positioned).position.y
end
--- fills the grid with the actual data
---
--- should be called as early as possible during every tick
function grid:reload()
self:reset()
self.yOrderQueue = pQueue.new(drawCmp)
utils.each(Tree.level.characters, function(c)
self:add(c.id)
self.yOrderQueue:insert(c)
end)
end