BIN
sonic-radiance.love/assets/sfx/badnicsDestroyed.wav
Normal file
18
sonic-radiance.love/assets/sprites/gfx/boom1.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
metadata = {
|
||||
height = 32,
|
||||
width = 32,
|
||||
defaultAnim = "default",
|
||||
ox = 16,
|
||||
oy = 32,
|
||||
},
|
||||
animations = {
|
||||
["default"] = {
|
||||
startAt = 1,
|
||||
endAt = 3,
|
||||
loop = 1,
|
||||
speed = 15,
|
||||
pauseAtEnd = false,
|
||||
},
|
||||
}
|
||||
}
|
BIN
sonic-radiance.love/assets/sprites/gfx/boom1.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
|
@ -112,5 +112,19 @@ return {
|
|||
speed = 25,
|
||||
pauseAtEnd = false,
|
||||
},
|
||||
["hurt"] = {
|
||||
startAt = 47,
|
||||
endAt = 49,
|
||||
loop = 49,
|
||||
speed = 15,
|
||||
pauseAtEnd = true,
|
||||
},
|
||||
["ko"] = {
|
||||
startAt = 50,
|
||||
endAt = 52,
|
||||
loop = 52,
|
||||
speed = 15,
|
||||
pauseAtEnd = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
|
@ -112,5 +112,19 @@ return {
|
|||
speed = 25,
|
||||
pauseAtEnd = false,
|
||||
},
|
||||
["hurt"] = {
|
||||
startAt = 55,
|
||||
endAt = 57,
|
||||
loop = 57,
|
||||
speed = 15,
|
||||
pauseAtEnd = true,
|
||||
},
|
||||
["ko"] = {
|
||||
startAt = 58,
|
||||
endAt = 62,
|
||||
loop = 62,
|
||||
speed = 15,
|
||||
pauseAtEnd = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 47 KiB |
|
@ -112,5 +112,19 @@ return {
|
|||
speed = 25,
|
||||
pauseAtEnd = false,
|
||||
},
|
||||
["hurt"] = {
|
||||
startAt = 49,
|
||||
endAt = 51,
|
||||
loop = 51,
|
||||
speed = 15,
|
||||
pauseAtEnd = true,
|
||||
},
|
||||
["ko"] = {
|
||||
startAt = 53,
|
||||
endAt = 59,
|
||||
loop = 59,
|
||||
speed = 15,
|
||||
pauseAtEnd = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 59 KiB |
|
@ -47,6 +47,7 @@ function AbstractMobParent:setHP(newHP, relative)
|
|||
else
|
||||
self.hp = newHP
|
||||
end
|
||||
self.hp = math.max(0, self.hp)
|
||||
end
|
||||
|
||||
function AbstractMobParent:setPP(newPP, relative)
|
||||
|
|
|
@ -228,6 +228,14 @@ function Battler:choregraphyEnded()
|
|||
self.movementType = MOVEMENT_NONE
|
||||
end
|
||||
|
||||
function Battler:getHurt()
|
||||
|
||||
end
|
||||
|
||||
function Battler:die()
|
||||
self:destroy()
|
||||
end
|
||||
|
||||
-- DRAW FUNCTIONS
|
||||
function Battler:draw()
|
||||
local x, y = self.world.map:gridToPixel(self.x, self.y, true)
|
||||
|
@ -250,6 +258,11 @@ function Battler:animationEnded(animation)
|
|||
if (self.currentlyBlocking ~= nil and self.blockedBy=="animation") then
|
||||
self:unblockChoregraphy()
|
||||
end
|
||||
self:getNewAnimation(animation)
|
||||
end
|
||||
|
||||
function Battler:getNewAnimation(animation)
|
||||
|
||||
end
|
||||
|
||||
function Battler:validateAction()
|
||||
|
|
|
@ -23,6 +23,12 @@ function Ennemy:draw()
|
|||
end
|
||||
end
|
||||
|
||||
function Ennemy:die()
|
||||
self.assets.sfx["badnicsBoom"]:play()
|
||||
self.world.obj.GFX(self.world, self.x, self.y, self.z, "boomGFX", self, false)
|
||||
self:destroy()
|
||||
end
|
||||
|
||||
function Ennemy:getStats()
|
||||
return self.data.stats
|
||||
end
|
||||
|
|
|
@ -17,6 +17,16 @@ function Hero:update(dt)
|
|||
self:updateAnimation(dt)
|
||||
end
|
||||
|
||||
-- HURT/DEATH FUNCTIONS
|
||||
|
||||
function Hero:getHurt()
|
||||
self:changeAnimation("hurt")
|
||||
end
|
||||
|
||||
function Hero:die()
|
||||
self:changeAnimation("ko")
|
||||
end
|
||||
|
||||
-- ASSETS FUNCTIONS
|
||||
-- Load and play assets needed by the character
|
||||
|
||||
|
@ -36,6 +46,12 @@ function Hero:updateAnimation(dt)
|
|||
self:setCustomSpeed(self.gspeed * 160 * dt)
|
||||
end
|
||||
|
||||
function Hero:getNewAnimation(animation)
|
||||
if (animation == "hurt") then
|
||||
self:changeAnimation("idle")
|
||||
end
|
||||
end
|
||||
|
||||
-- DRAW FUNCTIONS
|
||||
-- Draw everything related to the hero
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ return {
|
|||
["sprites"] = {
|
||||
{"cursorground", "assets/gui/cursor/ground"},
|
||||
{"hitGFX", "assets/sprites/gfx/hit"},
|
||||
{"boomGFX", "assets/sprites/gfx/boom1"},
|
||||
},
|
||||
["textures"] = {
|
||||
{"menucursor", "assets/gui/cursor-menulist.png"},
|
||||
|
@ -43,6 +44,7 @@ return {
|
|||
{"woosh", "assets/sfx/woosh.wav"},
|
||||
{"spincharge", "assets/sfx/spincharge.wav"},
|
||||
{"spinrelease", "assets/sfx/spinrelease.wav"},
|
||||
{"badnicsBoom", "assets/sfx/badnicsDestroyed.wav"},
|
||||
|
||||
{"mBack", "assets/sfx/menus/back.wav"},
|
||||
{"mBeep", "assets/sfx/menus/beep.wav"},
|
||||
|
|
|
@ -40,6 +40,7 @@ end
|
|||
|
||||
function FighterParent:die()
|
||||
self.isAlive = false
|
||||
self.actor:die()
|
||||
end
|
||||
|
||||
function FighterParent:sendDamage(target, value, accuracy, isSpecial, isAerial)
|
||||
|
@ -68,6 +69,7 @@ function FighterParent:receiveDamage(value, accuracy, isSpecial, isAerial)
|
|||
|
||||
core.debug:print("cbs/fighter", "Taken " .. value .. " damage" )
|
||||
self:setHP(value * -1, true)
|
||||
self.actor:getHurt()
|
||||
end
|
||||
|
||||
function FighterParent:getAbstract()
|
||||
|
|
|
@ -72,11 +72,6 @@ function VillainFighter:endAction()
|
|||
|
||||
end
|
||||
|
||||
function FighterParent:die()
|
||||
self.isAlive = false
|
||||
self.actor:destroy()
|
||||
end
|
||||
|
||||
function VillainFighter:setBonus(pvFactor, statFactor)
|
||||
self.abstract:setBonus(pvFactor, statFactor)
|
||||
end
|
||||
|
|
|
@ -50,10 +50,12 @@ function TurnController:update(dt)
|
|||
if (self.currentFighter ~= nil) then
|
||||
self.currentFighter:update(dt)
|
||||
else
|
||||
if (self.player:countAlive() > 0) then
|
||||
self:nextAction()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TurnController:nextAction()
|
||||
if (self.turns.isFinished) or (self.turns.current >= #self.actionList) then
|
||||
|
|