What, may i ask, would you say is the weakest part of the gameplay experience of The Legend of Grimrock?
That's right; the combat.
Fights against single enemies are slow and boring. Strafing around a big enemy for two minutes straight is absolutely no fun at all.
You have too much mobility while attacking, and too much attacking potential while moving.
So i fixed both of those things.
BEHOLD MY MAGNIFICENCE!
Code: Select all
defineObject{
name = "party",
components = {
{
class = "Party",
onMove = function(self)
local c = self:getChampion(1)
for i=1,4 do
if self:getChampion(i):isAlive() then
c = self:getChampion(i)
end
end
if c:hasCondition("fighting") then
return false
else
for i=1,4 do
c = self:getChampion(i)
c:setConditionValue("moving",1)
end
end
end,
onAttack = function(self)
local c = self:getChampion(1)
for i=1,4 do
if self:getChampion(i):isAlive() then
c = self:getChampion(i)
end
end
if c:hasCondition("moving") then
return false
else
for i=1,4 do
c = self:getChampion(i)
c:setConditionValue("fighting",1)
end
end
end,
onCastSpell = function(self)
local c = self:getChampion(1)
for i=1,4 do
if self:getChampion(i):isAlive() then
c = self:getChampion(i)
end
end
if c:hasCondition("moving") then
return false
else
for i=1,4 do
c = self:getChampion(i)
c:setConditionValue("fighting",1)
end
end
end,
},
{
class = "Light",
name = "torch",
range = 12,
},
},
editorIcon = 32,
placement = "floor",
}
defineCondition{
name = "fighting",
uiName = "Fighting",
description = "Can't move.",
icon = 9,
beneficial = false,
harmful = false,
tickInterval = 1,
}
defineCondition{
name = "moving",
uiName = "Moving",
description = "Can't fight.",
icon = 9,
beneficial = false,
harmful = false,
tickInterval = 1,
}
BOOM! Problem solved. Why did nobody do this earlier i wonder?
There.. IS a catch, though.
It doesnt work with unarmed attacks.
Goodness knows why, maybe the on attack hook relies on the on attack hook from the item component? no idea. Anyway, we can just call it martial arts and pretend it's a feature. I'm sure that'll be fine.
Anyway, no need to thank me, you're quite welcome. just take this sh*t and go make some dungeons with it. maybe tweak the condition durations first, though, the moving one seems a bit too intrusive.
BTW, i conjured up a quick preview of the system on the steam workshop.
http://steamcommunity.com/sharedfiles/f ... 1108257639