diff --git a/sonic-radiance.love/assets/sprites/gfx/hit.lua b/sonic-radiance.love/assets/sprites/gfx/hit1.lua similarity index 100% rename from sonic-radiance.love/assets/sprites/gfx/hit.lua rename to sonic-radiance.love/assets/sprites/gfx/hit1.lua diff --git a/sonic-radiance.love/assets/sprites/gfx/hit.png b/sonic-radiance.love/assets/sprites/gfx/hit1.png similarity index 100% rename from sonic-radiance.love/assets/sprites/gfx/hit.png rename to sonic-radiance.love/assets/sprites/gfx/hit1.png diff --git a/sonic-radiance.love/assets/sprites/gfx/HA.lua b/sonic-radiance.love/assets/sprites/gfx/homming.lua similarity index 100% rename from sonic-radiance.love/assets/sprites/gfx/HA.lua rename to sonic-radiance.love/assets/sprites/gfx/homming.lua diff --git a/sonic-radiance.love/assets/sprites/gfx/HA.png b/sonic-radiance.love/assets/sprites/gfx/homming.png similarity index 100% rename from sonic-radiance.love/assets/sprites/gfx/HA.png rename to sonic-radiance.love/assets/sprites/gfx/homming.png diff --git a/sonic-radiance.love/datas/gamedata/ennemies/skills/tackle.lua b/sonic-radiance.love/datas/gamedata/ennemies/skills/tackle.lua index de26f55..1d0a2e1 100644 --- a/sonic-radiance.love/datas/gamedata/ennemies/skills/tackle.lua +++ b/sonic-radiance.love/datas/gamedata/ennemies/skills/tackle.lua @@ -15,7 +15,7 @@ return { choregraphy = { -- the main attack choregraphy {"goTo3D", "none", "actor", "target", -0.4, 0, 0, 0.5, true}, {"sendDamage", "none", 120, "basic", "none", false}, - {'addGFX', "sentDamage", 'hitGFX', "target", -0.4, 0, 0, true, false}, + {'addGFX', "sentDamage", 'hit1', "target", -0.4, 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", "actor", 4, 8, true}, {"wait", "none", 0.1}, diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index 804544e..67fc5e0 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -21,7 +21,8 @@ return { {'playSFX', "none", 'spinrelease'}, {"waitFor", "none", "actionFinished:playerMove"}, {"sendDamage", "none", 100, "basic", "none", false}, - {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, 0, true, false}, + {"sendStatus", "none", "vulnerable", 5, true}, + {'addGFX', "sentDamage", 'hit1', "target", 0, 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", "actor", 4, 8, true}, {"wait", "none", 0.1}, diff --git a/sonic-radiance.love/datas/gamedata/skills/hitcombo.lua b/sonic-radiance.love/datas/gamedata/skills/hitcombo.lua index 47b9ea2..ce0abef 100644 --- a/sonic-radiance.love/datas/gamedata/skills/hitcombo.lua +++ b/sonic-radiance.love/datas/gamedata/skills/hitcombo.lua @@ -23,21 +23,21 @@ return { {'playSFX', "none", 'hit'}, {'setAnimation', "none", "actor", 'hit1start', true}, {'sendDamage', "none", 40, "basic", "none", false}, - {'addGFX',"sentDamage", 'hitGFX', "actor", 0.75, 0, 0, true, false}, + {'addGFX',"sentDamage", 'hit1', "actor", 0.75, 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", "actor", 'hit1end', true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", "actor", 'hit2start', true}, {'sendDamage', "none", 40, "basic", "none", false}, - {'addGFX',"sentDamage", 'hitGFX', "actor", 0.75, 0, 0, true, false}, + {'addGFX',"sentDamage", 'hit1', "actor", 0.75, 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", "actor", 'hit2end', true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", "actor", 'hit3start', true}, {'sendDamage', "none", 40, "basic", "none", false}, - {'addGFX',"sentDamage", 'hitGFX', "actor", 0.75, 0, 0, true, false}, + {'addGFX',"sentDamage", 'hit1', "actor", 0.75, 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", "actor", 'hit3end', true}, {'setAnimation', "none", "actor", 'idle', false}, @@ -46,7 +46,7 @@ return { {"setAnimation", "qteSuccess:1", "actor", "upper", false}, {"waitFor", "qteSuccess:1", "haveFrameSignal:hitconnect"}, {'sendDamage', "qteSuccess:1", 75, "basic", "none", false}, - {'addGFX', {"qteSuccess:1", "sentDamage"}, 'hitGFX', "actor", 0.75, 0, 0, true, false}, + {'addGFX', {"qteSuccess:1", "sentDamage"}, 'hit1', "actor", 0.75, 0, 0, true, false}, {'playSFX', {"qteSuccess:1", "sentDamage"}, 'hitconnect'}, {'wait', "none", 0.2}, diff --git a/sonic-radiance.love/datas/gamedata/skills/homming.lua b/sonic-radiance.love/datas/gamedata/skills/homming.lua index e5a86f3..cee908b 100644 --- a/sonic-radiance.love/datas/gamedata/skills/homming.lua +++ b/sonic-radiance.love/datas/gamedata/skills/homming.lua @@ -21,12 +21,12 @@ return { {"taggedAction", "hommingQte", {"addQTE", "none", {"simplePrompt", {{"A", 1}}, 0.4}, "target", false}}, {"waitFor", "none", "actionFinished:hommingQte"}, {"taggedAction", "dashToEnnemy", {"goTo3D", "none", "actor", "target", 0, 0, 8, 0.2, false}}, - {'addGFX', "none", 'hommingGFX', "actor", 0, 0, -4, true, false}, + {'addGFX', "none", 'homming', "actor", 0, 0, -4, true, false}, {"setAnimation", "none", "actor", "spin", false}, {'playSFX', "none", 'spinrelease'}, {"waitFor", "none", "actionFinished:dashToEnnemy"}, {"sendDamage", "none", 30, "aerial", "none", false}, - {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, 4, true, false}, + {'addGFX', "sentDamage", 'hit1', "target", 0, 0, 4, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {"taggedAction", "jumpingHero", {'jumpBack', "none", "actor", 5.5, 5.5, false}}, {"wait", "none", 0.1}, diff --git a/sonic-radiance.love/datas/gamedata/skills/spindash.lua b/sonic-radiance.love/datas/gamedata/skills/spindash.lua index ceb304e..96078bf 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spindash.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spindash.lua @@ -15,7 +15,7 @@ return { {'playSFX', "none", 'spinrelease'}, {"goTo", "none", "actor", "target", 0, 0, 0.3, true}, {"sendDamage", "none", 120, "basic", "none", false}, - {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, 0, true, false}, + {'addGFX', "sentDamage", 'hit1', "target", 0, 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", "actor", 4, 8, true}, {"wait", "none", 0.1}, diff --git a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua index 232c555..50fcb4a 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua @@ -38,7 +38,7 @@ 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.world.obj.GFX(self.world, self.x, self.y, self.z, "boom1", self, false) self:destroy() end diff --git a/sonic-radiance.love/scenes/battlesystem/actors/gfx.lua b/sonic-radiance.love/scenes/battlesystem/actors/gfx.lua index 02f9ad7..398e70e 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/gfx.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/gfx.lua @@ -1,12 +1,11 @@ local Parent = require("scenes.battlesystem.actors.movable") local GFX = Parent:extend() +local GFX_DIRECTORY = "assets/sprites/gfx/" function GFX:new(world, x, y, z, spritename, creator, blockProcess, tag) - local width, height = world.assets.sprites[spritename]:getDimensions() - GFX.super.new(self, world, x, y, z) - self:setSprite(spritename, width/2, height, true) - self:cloneSprite() + self:loadAnimation(spritename) + self.creator = creator self.blockProcess = blockProcess or false self.tag = tag or "" @@ -18,6 +17,15 @@ function GFX:new(world, x, y, z, spritename, creator, blockProcess, tag) self.direction = 1 end +function GFX:loadAnimation(spritename) + if self.world.assets.sprites[spritename] == nil then + self.world.assets:addSprite(spritename, GFX_DIRECTORY .. spritename) + end + local width, height = self.world.assets.sprites[spritename]:getDimensions() + self:setSprite(spritename, width/2, height, true) + self:cloneSprite() +end + function GFX:animationEnded(animation) core.debug:print("gfx", 'Current animation "' .. animation .. '" have ended, destroying gfx') if (self.blockProcess) and (self.creator ~= nil) and (self.creator.getSignal ~= nil) then diff --git a/sonic-radiance.love/scenes/battlesystem/assets.lua b/sonic-radiance.love/scenes/battlesystem/assets.lua index 71b3d78..3c23bb8 100644 --- a/sonic-radiance.love/scenes/battlesystem/assets.lua +++ b/sonic-radiance.love/scenes/battlesystem/assets.lua @@ -8,9 +8,7 @@ return { {"qtebtn", "assets/gui/qtebtn"} }, ["sprites"] = { - {"cursorground", "assets/gui/cursor/ground"}, - {"hitGFX", "assets/sprites/gfx/hit"}, - {"boomGFX", "assets/sprites/gfx/boom1"}, + {"cursorground", "assets/gui/cursor/ground"} }, ["textures"] = { {"menucursor", "assets/gui/cursor-menulist.png"}, diff --git a/sonic-radiance.love/scenes/debug/commons/assets.lua b/sonic-radiance.love/scenes/debug/commons/assets.lua index 244881b..4181dbe 100644 --- a/sonic-radiance.love/scenes/debug/commons/assets.lua +++ b/sonic-radiance.love/scenes/debug/commons/assets.lua @@ -7,7 +7,7 @@ return { }, ["sprites"] = { {"cursorground", "assets/gui/cursor/ground"}, - {"hitGFX", "assets/sprites/gfx/hit"}, + {"hitGFX", "assets/sprites/gfx/hit1"}, }, ["textures"] = { {"menucursor", "assets/gui/cursor-menulist.png"}, diff --git a/sonic-radiance.love/scenes/menus/assets.lua b/sonic-radiance.love/scenes/menus/assets.lua index 90e9914..bfeff91 100644 --- a/sonic-radiance.love/scenes/menus/assets.lua +++ b/sonic-radiance.love/scenes/menus/assets.lua @@ -1,7 +1,7 @@ return { ["sprites"] = { {"cursorground", "assets/gui/cursor/ground"}, - {"hitGFX", "assets/sprites/gfx/hit"}, + {"hitGFX", "assets/sprites/gfx/hit1"}, }, ["textures"] = { {"background", "assets/artworks/back.png"} diff --git a/sonic-radiance.love/scenes/overworld/assets.lua b/sonic-radiance.love/scenes/overworld/assets.lua index a01c280..5bb444f 100644 --- a/sonic-radiance.love/scenes/overworld/assets.lua +++ b/sonic-radiance.love/scenes/overworld/assets.lua @@ -7,7 +7,7 @@ return { }, ["sprites"] = { {"cursorground", "assets/gui/cursor/ground"}, - {"hitGFX", "assets/sprites/gfx/hit"}, + {"hitGFX", "assets/sprites/gfx/hit1"}, {"encounter", "assets/sprites/encounter"}, {"punch", "assets/sprites/gfx/punch"}, {"dash", "assets/sprites/gfx/dash"},