From 6c409cc1ba4c86e8c10b5df40a78aee5a2d1b012 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 10:50:43 +0200 Subject: [PATCH 01/68] chore: extract level calculation in an utils --- .../game/abstractmobs/utils.lua | 32 ++++++++++++++ sonic-radiance.love/game/characters.lua | 42 +++++++------------ 2 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 sonic-radiance.love/game/abstractmobs/utils.lua diff --git a/sonic-radiance.love/game/abstractmobs/utils.lua b/sonic-radiance.love/game/abstractmobs/utils.lua new file mode 100644 index 0000000..fc85fbc --- /dev/null +++ b/sonic-radiance.love/game/abstractmobs/utils.lua @@ -0,0 +1,32 @@ +local StatsUtils = {} + +local CONST = {} + +CONST.EXP_MULTIPLICATOR = 4 +CONST.EXP_RATIO = 5 + +CONST.BASE_STAT = 5 +CONST.BASE_HP = 15 +CONST.BASE_MP = 8 + +CONST.MULT_STAT = 2 +CONST.MULT_HP = 2.7 +CONST.MULT_MP = 1.5 + +function StatsUtils.getExpValue(level) + return math.floor( ( CONST.EXP_MULTIPLICATOR * ( level ^ 3 ) ) / CONST.EXP_RATIO ) +end + +function StatsUtils.getStatValue(level, base) + return math.floor( (((base * CONST.MULT_STAT) * level)/100) ) + CONST.BASE_STAT +end + +function StatsUtils.getHPValue(level, base) + return math.floor( (((base * CONST.MULT_HP) * level)/100) ) + CONST.BASE_HP + level +end + +function StatsUtils.getPPValue(level, base) + return math.floor( (((base * CONST.MULT_MP) * level)/100) ) + CONST.BASE_MP +end + +return StatsUtils diff --git a/sonic-radiance.love/game/characters.lua b/sonic-radiance.love/game/characters.lua index 1d45d8c..32bb403 100644 --- a/sonic-radiance.love/game/characters.lua +++ b/sonic-radiance.love/game/characters.lua @@ -24,6 +24,8 @@ local CharacterManager = Object:extend() +local statsutils = require "game.abstractmobs.utils" + function CharacterManager:new(controller) self.controller = controller self.namelist = require "datas.gamedata.characters" @@ -59,8 +61,8 @@ function CharacterManager:initCharacter(id) local character = self:getCharacterData(id) stats.level = character.startlevel - stats.exp = self:getExpValue(stats.level) - stats.exp_next = self:getExpValue(stats.level + 1) + stats.exp = statsutils.getExpValue(stats.level) + stats.exp_next = statsutils.getExpValue(stats.level + 1) stats.hpmax = character.base_stats.hpmax stats.ppmax = character.base_stats.ppmax stats.attack = character.base_stats.attack @@ -83,16 +85,12 @@ function CharacterManager:initCharacter(id) self.list[id] = character end -function CharacterManager:getExpValue(level) - return math.floor( ( 4 * ( level ^ 3 ) ) / 5 ) -end - function CharacterManager:setLevel(id, newlevel) self.list[id].stats.level = newlevel local stats = self.list[id].stats local exp, exp_next, exp_current - exp = self:getExpValue(stats.level) - exp_next = self:getExpValue(stats.level + 1) + exp = statsutils.getExpValue(stats.level) + exp_next = statsutils.getExpValue(stats.level + 1) exp_current = self.list[id].stats.exp self.list[id].stats.exp = math.max(math.min(exp_current, exp_next - 1), exp) @@ -105,31 +103,19 @@ function CharacterManager:levelUp(id) self:setLevel(id, self.list[id].stats.level + 1) end -function CharacterManager:getStatValue(level, base) - return math.floor( (((base * 2) * level)/100) ) + 5 -end - -function CharacterManager:getHPValue(level, base) - return math.floor( (((base * 2.7) * level)/100) ) + 15 + level -end - -function CharacterManager:getPPValue(level, base) - return math.floor( (((base * 1.5) * level)/100) ) + 8 -end - function CharacterManager:recalculateStats(id) local character = self.list[id] local stats = character.stats local base_stats = character.base_stats - stats.hpmax = self:getHPValue(stats.level, base_stats.hpmax) - stats.ppmax = self:getPPValue(stats.level, base_stats.ppmax) - stats.attack = self:getStatValue(stats.level, base_stats.attack) - stats.power = self:getStatValue(stats.level, base_stats.power) - stats.defense = self:getStatValue(stats.level, base_stats.defense) - stats.mind = self:getStatValue(stats.level, base_stats.mind) - stats.technic = self:getStatValue(stats.level, base_stats.technic) - stats.speed = self:getStatValue(stats.level, base_stats.speed) + stats.hpmax = statsutils.getHPValue(stats.level, base_stats.hpmax) + stats.ppmax = statsutils.getPPValue(stats.level, base_stats.ppmax) + stats.attack = statsutils.getStatValue(stats.level, base_stats.attack) + stats.power = statsutils.getStatValue(stats.level, base_stats.power) + stats.defense = statsutils.getStatValue(stats.level, base_stats.defense) + stats.mind = statsutils.getStatValue(stats.level, base_stats.mind) + stats.technic = statsutils.getStatValue(stats.level, base_stats.technic) + stats.speed = statsutils.getStatValue(stats.level, base_stats.speed) end function CharacterManager:getSkillList(id) From 698d6697fbdc621c7f641ba899918672ed595cf9 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 13:13:54 +0200 Subject: [PATCH 02/68] chore: add a basic abstractmob system --- .../game/abstractmobs/ennemy.lua | 26 +++++++++++ .../game/abstractmobs/parent.lua | 45 +++++++++++++++++++ sonic-radiance.love/game/ennemies.lua | 8 ++-- 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 sonic-radiance.love/game/abstractmobs/ennemy.lua create mode 100644 sonic-radiance.love/game/abstractmobs/parent.lua diff --git a/sonic-radiance.love/game/abstractmobs/ennemy.lua b/sonic-radiance.love/game/abstractmobs/ennemy.lua new file mode 100644 index 0000000..65df743 --- /dev/null +++ b/sonic-radiance.love/game/abstractmobs/ennemy.lua @@ -0,0 +1,26 @@ +AbstractMobParent = require "game.abstractmobs.parent" + +AbstractEnnemy = AbstractMobParent:extend() + +function AbstractEnnemy:new(name) + self.simplename = name + self.super.new(self) +end + +function AbstractEnnemy:initBasicElements() + self.data = require("datas.gamedata.ennemies." .. self.simplename) + self.name = self.data.name + self.fullname = self.data.fullname + self.turns = self.data.turns + +end + +function AbstractEnnemy:createStats() + return require("datas.gamedata.ennemies." .. self.simplename .. ".stats") +end + +function AbstractEnnemy:createSkills() + return require("datas.gamedata.ennemies." .. self.simplename .. ".skills") +end + +return AbstractEnnemy diff --git a/sonic-radiance.love/game/abstractmobs/parent.lua b/sonic-radiance.love/game/abstractmobs/parent.lua new file mode 100644 index 0000000..b3ee25e --- /dev/null +++ b/sonic-radiance.love/game/abstractmobs/parent.lua @@ -0,0 +1,45 @@ +local AbstractMobParent = Object:extend() + +function AbstractMobParent:new() + self:initBasicElements() + self.stats = self:createStats() + self.skills = self:createSkills() + self:initLife() +end + +function AbstractMobParent:initBasicElements() + self.name = "PlaceHolder" + self.fullname = "PlaceHolder" + self.turns = 2 +end + +function AbstractMobParent:createStats() + local stats = {} + + stats.hpmax = 0 + stats.ppmax = 0 + stats.attack = 0 + stats.power = 0 + stats.defense = 0 + stats.technic = 0 + stats.mind = 0 + stats.speed = 0 + + return stats +end + +function AbstractMobParent:createSkills() + return {} +end + +function AbstractMobParent:initLife() + self.hp = self.stats.hpmax + self.mp = self.stats.mpmax + self.status = 0 +end + +function AbstractMobParent:getStats() + return self.stats +end + +return AbstractMobParent diff --git a/sonic-radiance.love/game/ennemies.lua b/sonic-radiance.love/game/ennemies.lua index 60336f1..4a656eb 100644 --- a/sonic-radiance.love/game/ennemies.lua +++ b/sonic-radiance.love/game/ennemies.lua @@ -1,15 +1,13 @@ local EnnemyManager = Object:extend() +local AbstractEnnemy = require "game.abstractmobs.ennemy" + function EnnemyManager:new(controller) self.controller = controller end function EnnemyManager:getEnnemyData(ennemy) - local data = require("datas.gamedata.ennemies." .. ennemy) - data.skills = require("datas.gamedata.ennemies." .. ennemy .. ".skills") - data.stats = require("datas.gamedata.ennemies." .. ennemy .. ".stats") - - return data + return AbstractEnnemy(ennemy) end return EnnemyManager From 00396522fb73bcd27269387ded6a105ac3e6fe50 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 13:20:24 +0200 Subject: [PATCH 03/68] chore: prepare for AbstractCharacter extraction --- sonic-radiance.love/game/characters.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sonic-radiance.love/game/characters.lua b/sonic-radiance.love/game/characters.lua index 32bb403..3a0a9ee 100644 --- a/sonic-radiance.love/game/characters.lua +++ b/sonic-radiance.love/game/characters.lua @@ -36,15 +36,19 @@ function CharacterManager:new(controller) end function CharacterManager:init() - for k, v in pairs(self.namelist) do - local dir = "datas/gamedata/characters/" .. v .. "/init.lua" - local fileinfo = love.filesystem.getInfo(dir) - if fileinfo ~= nil then - self:initCharacter(v) + for k, name in pairs(self.namelist) do + if (self:charDataExists(name)) then + self:initCharacter(name) end end end +function CharacterManager:charDataExists(name) + local dir = "datas/gamedata/characters/" .. name .. "/init.lua" + local fileinfo = love.filesystem.getInfo(dir) + return (fileinfo ~= nil) +end + function CharacterManager:getCharacterData(charname) -- va eprmettre de récupérer les données d'un personnage local charfolder = "datas.gamedata.characters." .. charname From cd9b9f37e43d07ebac0a2ce328005a6f3fcdef50 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 13:41:20 +0200 Subject: [PATCH 04/68] chore(game/characters): more utils extraction --- .../game/abstractmobs/utils.lua | 29 ++++++++++++++---- sonic-radiance.love/game/characters.lua | 30 +++++++++---------- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/sonic-radiance.love/game/abstractmobs/utils.lua b/sonic-radiance.love/game/abstractmobs/utils.lua index fc85fbc..14f798e 100644 --- a/sonic-radiance.love/game/abstractmobs/utils.lua +++ b/sonic-radiance.love/game/abstractmobs/utils.lua @@ -1,4 +1,4 @@ -local StatsUtils = {} +local CharUtils = {} local CONST = {} @@ -13,20 +13,37 @@ CONST.MULT_STAT = 2 CONST.MULT_HP = 2.7 CONST.MULT_MP = 1.5 -function StatsUtils.getExpValue(level) +function CharUtils.getExpValue(level) return math.floor( ( CONST.EXP_MULTIPLICATOR * ( level ^ 3 ) ) / CONST.EXP_RATIO ) end -function StatsUtils.getStatValue(level, base) +function CharUtils.getStatValue(level, base) return math.floor( (((base * CONST.MULT_STAT) * level)/100) ) + CONST.BASE_STAT end -function StatsUtils.getHPValue(level, base) +function CharUtils.getHPValue(level, base) return math.floor( (((base * CONST.MULT_HP) * level)/100) ) + CONST.BASE_HP + level end -function StatsUtils.getPPValue(level, base) +function CharUtils.getPPValue(level, base) return math.floor( (((base * CONST.MULT_MP) * level)/100) ) + CONST.BASE_MP end -return StatsUtils +function CharUtils.charDataExists(name) + local dir = "datas/gamedata/characters/" .. name .. "/init.lua" + local fileinfo = love.filesystem.getInfo(dir) + return (fileinfo ~= nil) +end + +function CharUtils.getCharacterData(charname) + -- va eprmettre de récupérer les données d'un personnage + local charfolder = "datas.gamedata.characters." .. charname + local character = require(charfolder) + character.base_stats = require(charfolder .. ".stats") + character.inventory = require(charfolder .. ".inventory") + character.skills = require(charfolder .. ".skills") + + return character +end + +return CharUtils diff --git a/sonic-radiance.love/game/characters.lua b/sonic-radiance.love/game/characters.lua index 3a0a9ee..fcb072f 100644 --- a/sonic-radiance.love/game/characters.lua +++ b/sonic-radiance.love/game/characters.lua @@ -24,7 +24,7 @@ local CharacterManager = Object:extend() -local statsutils = require "game.abstractmobs.utils" +local charutils = require "game.abstractmobs.utils" function CharacterManager:new(controller) self.controller = controller @@ -37,7 +37,7 @@ end function CharacterManager:init() for k, name in pairs(self.namelist) do - if (self:charDataExists(name)) then + if (charutils.charDataExists(name)) then self:initCharacter(name) end end @@ -62,11 +62,11 @@ end function CharacterManager:initCharacter(id) local stats = {} - local character = self:getCharacterData(id) + local character = charutils.getCharacterData(id) stats.level = character.startlevel - stats.exp = statsutils.getExpValue(stats.level) - stats.exp_next = statsutils.getExpValue(stats.level + 1) + stats.exp = charutils.getExpValue(stats.level) + stats.exp_next = charutils.getExpValue(stats.level + 1) stats.hpmax = character.base_stats.hpmax stats.ppmax = character.base_stats.ppmax stats.attack = character.base_stats.attack @@ -93,8 +93,8 @@ function CharacterManager:setLevel(id, newlevel) self.list[id].stats.level = newlevel local stats = self.list[id].stats local exp, exp_next, exp_current - exp = statsutils.getExpValue(stats.level) - exp_next = statsutils.getExpValue(stats.level + 1) + exp = charutils.getExpValue(stats.level) + exp_next = charutils.getExpValue(stats.level + 1) exp_current = self.list[id].stats.exp self.list[id].stats.exp = math.max(math.min(exp_current, exp_next - 1), exp) @@ -112,14 +112,14 @@ function CharacterManager:recalculateStats(id) local stats = character.stats local base_stats = character.base_stats - stats.hpmax = statsutils.getHPValue(stats.level, base_stats.hpmax) - stats.ppmax = statsutils.getPPValue(stats.level, base_stats.ppmax) - stats.attack = statsutils.getStatValue(stats.level, base_stats.attack) - stats.power = statsutils.getStatValue(stats.level, base_stats.power) - stats.defense = statsutils.getStatValue(stats.level, base_stats.defense) - stats.mind = statsutils.getStatValue(stats.level, base_stats.mind) - stats.technic = statsutils.getStatValue(stats.level, base_stats.technic) - stats.speed = statsutils.getStatValue(stats.level, base_stats.speed) + stats.hpmax = charutils.getHPValue(stats.level, base_stats.hpmax) + stats.ppmax = charutils.getPPValue(stats.level, base_stats.ppmax) + stats.attack = charutils.getStatValue(stats.level, base_stats.attack) + stats.power = charutils.getStatValue(stats.level, base_stats.power) + stats.defense = charutils.getStatValue(stats.level, base_stats.defense) + stats.mind = charutils.getStatValue(stats.level, base_stats.mind) + stats.technic = charutils.getStatValue(stats.level, base_stats.technic) + stats.speed = charutils.getStatValue(stats.level, base_stats.speed) end function CharacterManager:getSkillList(id) From a63b4ddeb3ec3a028e7c890e7cc45e07ee48c092 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 14:02:22 +0200 Subject: [PATCH 05/68] improvement(game/character): create an AbstractCharacter object --- .../game/abstractmobs/character.lua | 92 ++++++++++++++ .../game/abstractmobs/utils.lua | 2 +- sonic-radiance.love/game/characters.lua | 115 ++---------------- 3 files changed, 105 insertions(+), 104 deletions(-) create mode 100644 sonic-radiance.love/game/abstractmobs/character.lua diff --git a/sonic-radiance.love/game/abstractmobs/character.lua b/sonic-radiance.love/game/abstractmobs/character.lua new file mode 100644 index 0000000..535072a --- /dev/null +++ b/sonic-radiance.love/game/abstractmobs/character.lua @@ -0,0 +1,92 @@ +AbstractMobParent = require "game.abstractmobs.parent" + +AbstractCharacter = AbstractMobParent:extend() + +local charutils = require "game.abstractmobs.utils" + +function AbstractCharacter:new(name) + self.simplename = name + self.super.new(self) +end + +function AbstractCharacter:initBasicElements() + self.data = charutils.getCharacterData(self.simplename) + self.name = self.data.name + self.fullname = self.data.fullname + self.turns = self.data.turns + + self.level = self.data.startlevel + self.exp = charutils.getExpValue(self.level) + self.exp_next = charutils.getExpValue(self.level + 1) +end + +function AbstractCharacter:createStats() + local stats = {} + local base_stats = self.data.stats + + stats.hpmax = charutils.getHPValue(self.level, base_stats.hpmax) + stats.ppmax = charutils.getPPValue(self.level, base_stats.ppmax) + stats.attack = charutils.getStatValue(self.level, base_stats.attack) + stats.power = charutils.getStatValue(self.level, base_stats.power) + stats.defense = charutils.getStatValue(self.level, base_stats.defense) + stats.mind = charutils.getStatValue(self.level, base_stats.mind) + stats.technic = charutils.getStatValue(self.level, base_stats.technic) + stats.speed = charutils.getStatValue(self.level, base_stats.speed) + + return stats +end + +function AbstractCharacter:createSkills() + local learnedlist = {} + + for i, v in ipairs(self.data.skills) do + local tech_name, tech_level, isLearned = v[1], v[2], false + if tech_level <= self.level then + local canLearn = true + for i, learnedSkill in ipairs(learnedlist) do + + -- We check if the skill have already been learned, to level-up it + if learnedSkill.name == tech_name then + canLearn = false + learnedSkill.level = learnedSkill.level + 1 + end + end + + if (canLearn) then + local skilldata = {} + skilldata.name = tech_name + skilldata.level = 1 + skilldata.learnedAt = tech_level + + table.insert(learnedlist, skilldata) + end + + end + -- On continue ensuite d'itérer dans la liste + end + + return learnedlist +end + +function AbstractCharacter:setLevel(newlevel) + self.level = newlevel + local exp, exp_next, exp_current + exp_min = charutils.getExpValue(self.level) + exp_max = charutils.getExpValue(self.level + 1) + exp = self.exp + + self.exp = math.max(math.min(exp, exp_max - 1), exp_min) + self.exp_next = exp_max + + self.stats = self:createStats() +end + +function AbstractCharacter:levelUp() + self:setLevel(self.level + 1) +end + +function AbstractCharacter:heal() + self:initLife() +end + +return AbstractCharacter diff --git a/sonic-radiance.love/game/abstractmobs/utils.lua b/sonic-radiance.love/game/abstractmobs/utils.lua index 14f798e..bc56593 100644 --- a/sonic-radiance.love/game/abstractmobs/utils.lua +++ b/sonic-radiance.love/game/abstractmobs/utils.lua @@ -39,7 +39,7 @@ function CharUtils.getCharacterData(charname) -- va eprmettre de récupérer les données d'un personnage local charfolder = "datas.gamedata.characters." .. charname local character = require(charfolder) - character.base_stats = require(charfolder .. ".stats") + character.stats = require(charfolder .. ".stats") character.inventory = require(charfolder .. ".inventory") character.skills = require(charfolder .. ".skills") diff --git a/sonic-radiance.love/game/characters.lua b/sonic-radiance.love/game/characters.lua index fcb072f..6b1dac7 100644 --- a/sonic-radiance.love/game/characters.lua +++ b/sonic-radiance.love/game/characters.lua @@ -25,6 +25,7 @@ local CharacterManager = Object:extend() local charutils = require "game.abstractmobs.utils" +local AbstractCharacter = require "game.abstractmobs.character" function CharacterManager:new(controller) self.controller = controller @@ -38,73 +39,17 @@ end function CharacterManager:init() for k, name in pairs(self.namelist) do if (charutils.charDataExists(name)) then - self:initCharacter(name) + self.list[name] = AbstractCharacter(name) end end end -function CharacterManager:charDataExists(name) - local dir = "datas/gamedata/characters/" .. name .. "/init.lua" - local fileinfo = love.filesystem.getInfo(dir) - return (fileinfo ~= nil) +function CharacterManager:setLevel(name, newlevel) + self.list[name]:setLevel(newlevel) end -function CharacterManager:getCharacterData(charname) - -- va eprmettre de récupérer les données d'un personnage - local charfolder = "datas.gamedata.characters." .. charname - local character = require(charfolder) - character.base_stats = require(charfolder .. ".stats") - character.inventory = require(charfolder .. ".inventory") - character.skills = require(charfolder .. ".skills") - - return character -end - -function CharacterManager:initCharacter(id) - local stats = {} - local character = charutils.getCharacterData(id) - - stats.level = character.startlevel - stats.exp = charutils.getExpValue(stats.level) - stats.exp_next = charutils.getExpValue(stats.level + 1) - stats.hpmax = character.base_stats.hpmax - stats.ppmax = character.base_stats.ppmax - stats.attack = character.base_stats.attack - stats.power = character.base_stats.power - stats.defense = character.base_stats.defense - stats.technic = character.base_stats.technic - stats.mind = character.base_stats.mind - stats.speed = character.base_stats.speed - - character.stats = stats - self.list[id] = character - - self:recalculateStats(id) - - stats.hp = stats.hpmax - stats.pp = stats.ppmax - stats.status = 0 - - character.stats = stats - self.list[id] = character -end - -function CharacterManager:setLevel(id, newlevel) - self.list[id].stats.level = newlevel - local stats = self.list[id].stats - local exp, exp_next, exp_current - exp = charutils.getExpValue(stats.level) - exp_next = charutils.getExpValue(stats.level + 1) - exp_current = self.list[id].stats.exp - - self.list[id].stats.exp = math.max(math.min(exp_current, exp_next - 1), exp) - self.list[id].stats.exp_next = exp_next - - self:recalculateStats(id) -end - -function CharacterManager:levelUp(id) - self:setLevel(id, self.list[id].stats.level + 1) +function CharacterManager:levelUp(name) + self.list[name]:levelUp() end function CharacterManager:recalculateStats(id) @@ -122,39 +67,6 @@ function CharacterManager:recalculateStats(id) stats.speed = charutils.getStatValue(stats.level, base_stats.speed) end -function CharacterManager:getSkillList(id) - local character = self.list[id] - local learnedlist = {} - - for i, v in ipairs(character.skills) do - local tech_name, tech_level, isLearned = v[1], v[2], false - if tech_level <= character.stats.level then - local canLearn = true - for i, learnedSkill in ipairs(learnedlist) do - - -- We check if the skill have already been learned, to level-up it - if learnedSkill.name == tech_name then - canLearn = false - learnedSkill.level = learnedSkill.level + 1 - end - end - - if (canLearn) then - local skilldata = {} - skilldata.name = tech_name - skilldata.level = 1 - skilldata.learnedAt = tech_level - - table.insert(learnedlist, skilldata) - end - - end - -- On continue ensuite d'itérer dans la liste - end - - return learnedlist -end - function CharacterManager:getData() local data = {} data.list = self.list @@ -168,15 +80,13 @@ function CharacterManager:setData(data) self.team = data.team end -function CharacterManager:heal(id) - self.list[id].stats.hp = self.list[id].stats.hpmax - self.list[id].stats.hp = self.list[id].stats.ppmax - self.list[id].stats.status = 0 +function CharacterManager:heal(name) + self.list[name]:heal() end -function CharacterManager:addToTeam(id) - self:heal(id) - table.insert(self.team, id) +function CharacterManager:addToTeam(name) + self:heal(name) + table.insert(self.team, name) end function CharacterManager:removeToTeam(teamid) @@ -191,9 +101,8 @@ end function CharacterManager:printCharacter(id) local character = self.list[id] - local stats = character.stats print(id .. ". " .. character.fullname) - print("Lvl " .. character.stats.level .. " (" .. stats.exp .. "/" .. stats.exp_next .. " exp)") + print("Lvl " .. character.level .. " (" .. character.exp .. "/" .. character.exp_next .. " exp)") end function CharacterManager:printTeam() From 99ce270a485bb7e4cebff864cc8741fe094dc39b Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 15:07:35 +0200 Subject: [PATCH 06/68] =?UTF-8?q?improvement(cbs):=20refonte=20du=20syst?= =?UTF-8?q?=C3=A8me=20de=20tour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battlesystem/controllers/ennemy.lua | 21 +++++ .../controllers/fighters/character.lua | 29 +++++++ .../controllers/fighters/parent.lua | 76 +++++++++++++++++++ .../controllers/fighters/villain.lua | 29 +++++++ .../scenes/battlesystem/controllers/init.lua | 39 +++++----- .../battlesystem/controllers/parent.lua | 42 +++++++--- .../battlesystem/controllers/player.lua | 35 +++------ 7 files changed, 218 insertions(+), 53 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/ennemy.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/controllers/ennemy.lua new file mode 100644 index 0000000..9860b98 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/ennemy.lua @@ -0,0 +1,21 @@ +local FighterControllerParent = require "scenes.battlesystem.controllers.parent" +local EnnemyController = FighterControllerParent:extend() + +local Villain = require "scenes.battlesystem.controllers.fighters.villain" + +function EnnemyController:new(owner) + self.super.new(self, owner) + self:initVillains() +end + +function EnnemyController:initVillains() + self:addVillain("motobug") + self:addVillain("motobug") + self:addVillain("motobug") +end + +function EnnemyController:addVillain(name) + self:add(Villain(self, name, self:count() + 1)) +end + +return EnnemyController diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua new file mode 100644 index 0000000..ffcfd33 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -0,0 +1,29 @@ +local FighterParent = require "scenes.battlesystem.controllers.fighters.parent" +local HeroFighter = FighterParent:extend() + +local POSITIONS = {3, 1, 5} +local HEROES_LINE = 3; + +function HeroFighter:new(owner, character, id) + self.name = character + self.super.new(self, owner, true, id) +end + +function HeroFighter:getAbstract() + return game.characters.list[self.name] +end + +function HeroFighter:createActor() + local x, y = HEROES_LINE, POSITIONS[self.id] + return self.world.obj.Hero(self.world, x, y, self) +end + +function HeroFighter:startAction() + +end + +function HeroFighter:endAction() + +end + +return HeroFighter diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua new file mode 100644 index 0000000..7a6a9d5 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua @@ -0,0 +1,76 @@ +local FighterParent = Object:extend() + +local counter = 0 + +function FighterParent:new(owner, isHero, id) + self.owner = owner + self.turnSystem = owner.turnSystem + self.world = owner.world + self.isHero = isHero + + -- Note : l'ID est ici relatif à chaque quand, il n'est donc pas unique, + -- ce qui est unique étant le combo id + isHero + self.id = id + + self.abstract = self:getAbstract() + self.actor = self:createActor() + + self.isActive = false +end + +function FighterParent:getAbstract() + return {} +end + +function FighterParent:createActor() + return {} +end + +function FighterParent:update(dt) + counter = counter + dt + if (counter > 5) then + counter = 0 + self:setInactive() + end +end + +function FighterParent:setActive() + counter = 0 + self.isActive = true + self:startAction() +end + +function FighterParent:setInactive() + self.isActive = false + self.turnSystem:nextAction() +end + +function FighterParent:getNbrActionPerTurn() + return self.abstract.turns +end + +function FighterParent:getStats() + return self.abstract:getStats() +end + +function FighterParent:startAction() + +end + +function FighterParent:getUniqueIdentificator() + local side = 1 + if (isHero == false) then + side = -1 + end + return self.id * side +end + +function FighterParent:getNonUniqueIdentificator() + return self.id +end + +function FighterParent:canFight() + return true +end + +return FighterParent diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua new file mode 100644 index 0000000..5a392ec --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua @@ -0,0 +1,29 @@ +local FighterParent = require "scenes.battlesystem.controllers.fighters.parent" +local VillainFighter = FighterParent:extend() + +local POSITIONS = {3, 1, 5} +local ENNEMY_LINE = 10; + +function VillainFighter:new(owner, ennemy, id) + self.name = ennemy + self.super.new(self, owner, false, id) +end + +function VillainFighter:getAbstract() + return game.ennemies:getEnnemyData(self.name) +end + +function VillainFighter:createActor() + local x, y = ENNEMY_LINE, POSITIONS[self.id] + return self.world.obj.Ennemy(self.world, x, y, self) +end + +function VillainFighter:startAction() + +end + +function VillainFighter:endAction() + +end + +return VillainFighter diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index 9c34d96..c418647 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -1,7 +1,7 @@ local TurnController = Object:extend() local Player = require "scenes.battlesystem.controllers.player" -local Ennemy = require "scenes.battlesystem.controllers.player" +local Ennemy = require "scenes.battlesystem.controllers.ennemy" local maputils = require "scenes.battlesystem.utils" @@ -10,7 +10,7 @@ function TurnController:new(scene) self.world = scene.world self.player = Player(self) - --self.ennemies = Ennemy(self) + self.ennemies = Ennemy(self) self.isActive = false @@ -22,6 +22,8 @@ function TurnController:new(scene) self.turns.isFinished = true self.turns.changeBattler = true self.actionList = {} + + self.currentFighter = nil end function TurnController:startBattle() @@ -30,10 +32,8 @@ end function TurnController:update(dt) if (self.isActive) then - if (self.currentlyPlaying == "heroes") then - self.player:update(dt) - elseif (self.currentlyPlaying == "ennemies") then - --self.ennemies:update(dt) + if (self.currentFighter ~= nil) then + self.currentFighter:update(dt) else self:nextAction() end @@ -45,15 +45,15 @@ function TurnController:nextAction() self:startNewTurn() else self.turns.current = self.turns.current + 1 - core.debug:print("cbs/world", "switching to next action") + core.debug:print("cbs/turns", "switching to next action") end - self.scene.hud:moveBattleCursor(self.turns.current) + --self.scene.hud:moveBattleCursor(self.turns.current) self:startAction() end function TurnController:startNewTurn() - core.debug:print("cbs/world", "New Turn Starting") + core.debug:print("cbs/turns", "New Turn Starting") self.turns.current = 1 self.turns.isFinished = false self.turns.number = self.turns.number + 1 @@ -61,27 +61,24 @@ function TurnController:startNewTurn() end function TurnController:calculateTurn() - self.actionList = self.world:generateActionList() + self.actionList = {} + self.player:putActions(self.actionList) + self.ennemies:putActions(self.actionList) table.sort(self.actionList, maputils.sortBattlers) end function TurnController:startAction() -core.debug:print("cbs/world", "Starting action " .. self.turns.current) + core.debug:print("cbs/turns", "Starting action " .. self.turns.current) local nextAction = self.actionList[self.turns.current] print(nextAction) - local nextActor = nextAction.actor - if (nextActor.isDestroyed == true) then + local nextFighter = nextAction.fighter + if (nextFighter.isDestroyed == true) then -- On skipe le personnage s'il a été detruit self:nextAction() else - if (nextActor.side == "heroes") then - self.player:setActive(nextActor) - self.currentlyPlaying = "heroes" - elseif (nextActor.side == "ennemies") then - --self.ennemies:setActive(nextActor) - self.currentlyPlaying = "ennemies" - self.actionList[self.turns.current].actor:setActive() - end + self.currentFighter = nextFighter + core.debug:print("cbs/turns", "Activating " .. self.currentFighter.name) + self.currentFighter:setActive() end end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index 01775eb..940a832 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -1,22 +1,46 @@ -local ControllerParent = Object:extend() +local FighterControllerParent = Object:extend() -function ControllerParent:new(owner) - self.owner = owner - self.activeActor = nil; - self.startData = {} +function FighterControllerParent:new(turnSystem) + self.turnSystem = turnSystem + self.world = turnSystem.world + self.list = {} end -function ControllerParent:setActive(activeActor) +function FighterControllerParent:add(fighter) + table.insert(self.list, fighter) +end + +function FighterControllerParent:count() + return #self.list +end + +function FighterControllerParent:setActive(activeActor) self.activeActor = activeActor activeActor:setActive() end -function ControllerParent:update(dt) +function FighterControllerParent:update(dt) end -function ControllerParent:endAction() +function FighterControllerParent:endAction() self.owner:nextAction() end -return PlayerController +function FighterControllerParent:putActions(actionList) + for i, fighter in ipairs(self.list) do + + if fighter:canFight() then + for i=1, fighter:getNbrActionPerTurn() do + local action = {} + action.fighter = fighter + action.number = i + table.insert(actionList, action) + end + end + + end +end + + +return FighterControllerParent diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/player.lua b/sonic-radiance.love/scenes/battlesystem/controllers/player.lua index 8ec0a5b..6132d4f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/player.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/player.lua @@ -1,28 +1,17 @@ -local PlayerController = Object:extend() +local FighterControllerParent = require "scenes.battlesystem.controllers.parent" +local HeroFighterController = FighterControllerParent:extend() -function PlayerController:new(owner) - self.owner = owner - self.activeActor = nil; - self.startData = {} +local Character = require "scenes.battlesystem.controllers.fighters.character" + +function HeroFighterController:new(owner) + self.super.new(self, owner) + self:initHeroes() end -function PlayerController:setActive(activeActor) - self.activeActor = activeActor - activeActor:setActive() +function HeroFighterController:initHeroes() + for i, hero in ipairs(game.characters.team) do + self:add(Character(self, hero, i)) + end end -function PlayerController:update(dt) - -end - -function PlayerController:setStartData(x, y, direction) - self.startData.x = x - self.startData.y = y - self.startData.direction = direction -end - -function PlayerController:getStartData() - return self.startData.x, self.startData.y, self.startData.direction -end - -return PlayerController +return HeroFighterController From 977d4bac1652860c754a4ff7ff6ffeaf6637d014 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 16:06:35 +0200 Subject: [PATCH 07/68] fix(game/abstractmobs): use right var for pp --- sonic-radiance.love/game/abstractmobs/parent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-radiance.love/game/abstractmobs/parent.lua b/sonic-radiance.love/game/abstractmobs/parent.lua index b3ee25e..4d64fa1 100644 --- a/sonic-radiance.love/game/abstractmobs/parent.lua +++ b/sonic-radiance.love/game/abstractmobs/parent.lua @@ -34,7 +34,7 @@ end function AbstractMobParent:initLife() self.hp = self.stats.hpmax - self.mp = self.stats.mpmax + self.pp = self.stats.ppmax self.status = 0 end From 1f3d07c223a69a8839e1f01ff39edfa48498d6a8 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 16:20:57 +0200 Subject: [PATCH 08/68] improvement(cbs): let the turn controller handle the hud --- .../controllers/fighters/character.lua | 18 ++++++++++ .../controllers/fighters/parent.lua | 12 +++++++ .../controllers/fighters/villain.lua | 20 +++++++++++ .../scenes/battlesystem/controllers/init.lua | 33 ++++++++++++++----- .../battlesystem/controllers/parent.lua | 8 ++++- .../battlesystem/controllers/player.lua | 6 ++++ .../scenes/battlesystem/gui/hud.lua | 18 ++++------ .../scenes/battlesystem/gui/simplehpbar.lua | 29 ++++++++++++++++ .../scenes/battlesystem/gui/statusbar.lua | 23 ++++++------- .../scenes/battlesystem/init.lua | 9 +---- 10 files changed, 137 insertions(+), 39 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/gui/simplehpbar.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index ffcfd33..96f5b1f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -1,12 +1,20 @@ local FighterParent = require "scenes.battlesystem.controllers.fighters.parent" local HeroFighter = FighterParent:extend() +local StatusBar = require "scenes.battlesystem.gui.statusbar" + local POSITIONS = {3, 1, 5} local HEROES_LINE = 3; function HeroFighter:new(owner, character, id) self.name = character self.super.new(self, owner, true, id) + + self.statusbar = StatusBar(self) +end + +function HeroFighter:updateAssets(dt) + self.statusbar:update(dt) end function HeroFighter:getAbstract() @@ -26,4 +34,14 @@ function HeroFighter:endAction() end +-- DRAW FUNCTIONS +function HeroFighter:drawIcon(x, y) + local iconID = 1 + self.assets.tileset["charicons"]:drawTile(iconID, x, y) +end + +function HeroFighter:drawHUD() + self.statusbar:draw() +end + return HeroFighter diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua index 7a6a9d5..35aa413 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua @@ -7,6 +7,7 @@ function FighterParent:new(owner, isHero, id) self.turnSystem = owner.turnSystem self.world = owner.world self.isHero = isHero + self.assets = self.turnSystem.scene.assets -- Note : l'ID est ici relatif à chaque quand, il n'est donc pas unique, -- ce qui est unique étant le combo id + isHero @@ -34,6 +35,10 @@ function FighterParent:update(dt) end end +function FighterParent:updateAssets(dt) + -- Vide pour l'instant +end + function FighterParent:setActive() counter = 0 self.isActive = true @@ -73,4 +78,11 @@ function FighterParent:canFight() return true end +-- DRAW FUNCTIONS + +function FighterParent:drawIcon(x, y) + love.graphics.setColor(1, 1, 1, 1) + love.graphics.rectangle("fill", x, y, 16, 16) +end + return FighterParent diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua index 5a392ec..45ac549 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua @@ -1,14 +1,23 @@ local FighterParent = require "scenes.battlesystem.controllers.fighters.parent" local VillainFighter = FighterParent:extend() +local SimpleHPBar = require "scenes.battlesystem.gui.simplehpbar" + local POSITIONS = {3, 1, 5} local ENNEMY_LINE = 10; function VillainFighter:new(owner, ennemy, id) self.name = ennemy self.super.new(self, owner, false, id) + + self.hpbar = SimpleHPBar(self.abstract.hp) end +function VillainFighter:updateAssets(dt) + self.hpbar:update(dt) +end + + function VillainFighter:getAbstract() return game.ennemies:getEnnemyData(self.name) end @@ -26,4 +35,15 @@ function VillainFighter:endAction() end +-- DRAW FUNCTIONS +function VillainFighter:drawIcon(x, y) + love.graphics.setColor(1, 0, 0, 1) + love.graphics.rectangle("fill", x, y, 16, 16) + love.graphics.setColor(1, 1, 1, 1) +end + +function VillainFighter:drawHUD(x, y) + self.hpbar:draw(x, y) +end + return VillainFighter diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index c418647..0455c1d 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -3,15 +3,14 @@ local TurnController = Object:extend() local Player = require "scenes.battlesystem.controllers.player" local Ennemy = require "scenes.battlesystem.controllers.ennemy" +local HUD = require "scenes.battlesystem.gui.hud" + local maputils = require "scenes.battlesystem.utils" function TurnController:new(scene) self.scene = scene self.world = scene.world - self.player = Player(self) - self.ennemies = Ennemy(self) - self.isActive = false self.currentlyPlaying = "" @@ -24,13 +23,29 @@ function TurnController:new(scene) self.actionList = {} self.currentFighter = nil + + self.hud = HUD(self) + + self.player = Player(self) + self.ennemies = Ennemy(self) end function TurnController:startBattle() self.isActive = true + self.hud:movePlayerHUD(true) +end + +function TurnController:finishBattle() + self.isBattleActive = false + self.actionlist = {} + self.hud:movePlayerHUD(false) + self.scene:finishBattle() end function TurnController:update(dt) + self.player:update(dt) + self.ennemies:update(dt) + self.hud:update(dt) if (self.isActive) then if (self.currentFighter ~= nil) then self.currentFighter:update(dt) @@ -47,7 +62,7 @@ function TurnController:nextAction() self.turns.current = self.turns.current + 1 core.debug:print("cbs/turns", "switching to next action") end - --self.scene.hud:moveBattleCursor(self.turns.current) + self.hud:moveBattleCursor(self.turns.current) self:startAction() end @@ -86,13 +101,15 @@ function TurnController:endAction() self.currentlyPlaying = "" end -function TurnController:drawTurnList(x, y) - -end - function TurnController:sendSignalToCurrentBattler(signal, subSignal) self.actionList[self.turns.current].actor:receiveSignal(signal, subSignal) end +function TurnController:draw() + self.hud:draw() + self.player:draw() + self.ennemies:draw() +end + return TurnController diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index 940a832..5bdf754 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -20,7 +20,9 @@ function FighterControllerParent:setActive(activeActor) end function FighterControllerParent:update(dt) - + for i, fighter in ipairs(self.list) do + fighter:updateAssets(dt) + end end function FighterControllerParent:endAction() @@ -42,5 +44,9 @@ function FighterControllerParent:putActions(actionList) end end +function FighterControllerParent:draw() + --Aucun dessin par defaut, ils sont géré différements +end + return FighterControllerParent diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/player.lua b/sonic-radiance.love/scenes/battlesystem/controllers/player.lua index 6132d4f..007e734 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/player.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/player.lua @@ -14,4 +14,10 @@ function HeroFighterController:initHeroes() end end +function HeroFighterController:draw() + for i, hero in ipairs(self.list) do + hero:drawHUD() + end +end + return HeroFighterController diff --git a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua index 469cad4..2c1a570 100644 --- a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua +++ b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua @@ -4,11 +4,11 @@ local gui = require "game.modules.gui" local TweenManager = require "game.modules.tweenmanager" -function HUD:new(scene) - self.scene = scene - self.world = scene.world - self.assets = scene.assets - self.turns = scene.turns +function HUD:new(turns) + self.turns = turns + self.scene = turns.scene + self.world = self.scene.world + self.assets = self.scene.assets self.frame = gui.newBorder(424, 30, 4) self.tweens = TweenManager(self) @@ -38,14 +38,10 @@ function HUD:getPlayerHUDPosition() end function HUD:draw() - for i, battler in ipairs(self.world.battlers) do - battler:drawHUD() - end - for i, action in ipairs(self.turns.actionList) do - action.actor:drawIcon(4 + (i-1)*(20), 6) + action.fighter:drawIcon(4 + (i-1)*(20), 6) end - local cursorx = self.battlerCursor * 20 - 6 + local cursorx = self.battlerCursor * 20 - 8 if #self.turns.actionList > 0 then self.assets.images["menucursor"]:draw(cursorx, 26, math.rad(-90), 1, 1, 4, 8) diff --git a/sonic-radiance.love/scenes/battlesystem/gui/simplehpbar.lua b/sonic-radiance.love/scenes/battlesystem/gui/simplehpbar.lua new file mode 100644 index 0000000..c568eb2 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/gui/simplehpbar.lua @@ -0,0 +1,29 @@ +local SimpleHPBar = Object:extend() + +local TweenManager = require "game.modules.tweenmanager" +local gui = require "game.modules.gui" + +function SimpleHPBar:new(hp) + self.tweens = TweenManager(self) + self.hp = hp + self.baseHP = hp +end + +function SimpleHPBar:setHP(newHP) + self.tweens:newTween(0, 0.1, {hp = newHP}, 'inCubic') +end + +function SimpleHPBar:update(dt) + self.tweens:update(dt) +end + +function SimpleHPBar:draw(x, y) + love.graphics.setColor(0, 0, 0, 1) + gui.drawBar(x, y, 26, 4) + love.graphics.setColor(248/255, 160/255, 0, 1) + local bar = math.floor(24 * (self.hp / self.baseHP)) + gui.drawBar(x, y + 1, bar, 2) + love.graphics.setColor(1, 1, 1, 1) +end + +return SimpleHPBar diff --git a/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua b/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua index c0be16f..9dd45ea 100644 --- a/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua +++ b/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua @@ -6,16 +6,17 @@ local gui = require "game.modules.gui" local HUDBASE = 8 local HUDSEP = 152 -function StatusBar:new(actor) - self.actor = actor - self.hud = self.actor.scene.hud - self.assets = self.actor.assets +function StatusBar:new(fighter) + self.fighter = fighter + self.hud = fighter.turnSystem.hud + self.assets = self.fighter.assets - self.charid = self.actor.charid - self.stats = game.characters.list[self.charid].stats + self.charid = self.fighter.name + self.stats = self.fighter:getStats() + self.abstract = self.fighter.abstract - self.hp = self.stats.hp - self.pp = self.stats.pp + self.hp = self.abstract.hp + self.pp = self.abstract.pp self.tweens = TweenManager(self) end @@ -41,8 +42,8 @@ function StatusBar:drawEmblem(x, y) end function StatusBar:draw() - local x = HUDBASE + (self.actor.charnumber-1)*HUDSEP - local y = self.actor.scene.hud:getPlayerHUDPosition() + local x = HUDBASE + (self.fighter.id-1)*HUDSEP + local y = self.hud:getPlayerHUDPosition() self:drawEmblem(x, y) self.assets.images["statusbar"]:draw(x+12, y-6) @@ -63,7 +64,7 @@ function StatusBar:draw() love.graphics.print(math.floor(self.hp) .. "/" .. hpmax, x+34, y+5) love.graphics.print(math.floor(self.pp) .. "/" .. ppmax, x+28, y+17) - local lvl = game.characters.list[self.charid].stats.level + local lvl = self.abstract.level if lvl < 100 then lvl = "0" .. lvl diff --git a/sonic-radiance.love/scenes/battlesystem/init.lua b/sonic-radiance.love/scenes/battlesystem/init.lua index 0e99bc9..8882278 100644 --- a/sonic-radiance.love/scenes/battlesystem/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/init.lua @@ -6,8 +6,6 @@ local World = require "scenes.battlesystem.world" local MenuSystem = require "scenes.battlesystem.menu" local Turns = require "scenes.battlesystem.controllers" -local HUD = require "scenes.battlesystem.gui.hud" - local VictoryScreen = require "scenes.battlesystem.screens.victory" function BattleSystem:new() @@ -32,17 +30,13 @@ function BattleSystem:initManagers() self.world = World(self) self.menu = MenuSystem(self) self.turns = Turns(self) - - self.hud = HUD(self) end function BattleSystem:startBattle() self.turns:startBattle() - self.hud:movePlayerHUD(true) end function BattleSystem:finishBattle() - self.hud:movePlayerHUD(false) self.assets:setMusic("assets/music/victory.mp3") self.assets:playMusic() self.screen = VictoryScreen(self) @@ -58,7 +52,6 @@ end function BattleSystem:update(dt) self.world:update(dt) self.turns:update(dt) - self.hud:update(dt) if (self.screen ~= nil) then self.screen:update(dt) end @@ -66,7 +59,7 @@ end function BattleSystem:draw() self.world:draw() - self.hud:draw() + self.turns:draw() if (self.screen ~= nil) then self.screen:draw() end From d8dafdfe481651ff0f18aa0b2b9c01875c17d822 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 16:49:14 +0200 Subject: [PATCH 09/68] improvement(cbs): precalculate the map --- .../scenes/battlesystem/map.lua | 124 ++++++++++-------- 1 file changed, 68 insertions(+), 56 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/map.lua b/sonic-radiance.love/scenes/battlesystem/map.lua index 006ee05..2ea1b10 100644 --- a/sonic-radiance.love/scenes/battlesystem/map.lua +++ b/sonic-radiance.love/scenes/battlesystem/map.lua @@ -7,13 +7,16 @@ local DURATION = 0.66 local OPACITY_MIN = 0 local OPACITY_MAX = 0.75 +local HEIGHT = 5 +local BOTTOM_BORDER = 1 + function Map:new(world, type, terrain) self.world = world self.assets = self.world.assets self.scene = self.world.scene self.datas = {} - self.datas.type = type or "city" + self.datas.type = type or "forest" self.datas.terrains = terrain or maputils.newEmptyMap() self.tweens = TweenManager(self) @@ -30,14 +33,21 @@ function Map:new(world, type, terrain) self.assets:addImage("back1", backpath .. "-back.png") self.assets:addImage("back2", backpath .. "-fore.png") self.assets:addImage("cliff", backpath .. "-cliff.png") + + self.texture = {} + self.texture.floor = self:generateFloor(tile) end -- GET FUNCTIONS -- Get information from the map +function Map:getTotalHeight() + return HEIGHT + BOTTOM_BORDER; +end + function Map:getTerrain(x, y) - if self.datas.terrains[y] ~= nil then - return self.datas.terrains[y][x] + if (y <= HEIGHT) then + return 0 else return nil end @@ -47,6 +57,26 @@ function Map:isInGrid(x, y) return ( self:getTerrain(x, y) ~= nil ) end +function Map:getStartY() + return 240 - (self:getTotalHeight() * 20) - 10 +end + +function Map:gridToPixel(x, y, center) + local pixelx, pixely + local center = center or false + local x, y = x, y + + if (center) then + x = x + .5 + y = y + .5 + end + + pixelx = maputils.CONST.STARTX + ((x-1) * 31) + ((y-1) * 10) + pixely = self:getStartY() + ((y-1) * 20) + + return math.floor(pixelx), math.floor(pixely) +end + function Map:update(dt) self.tweens:update(dt) end @@ -75,17 +105,43 @@ end -- DRAW FUNCTIONS -- Draw the battle map -function Map:draw(activeGrid, effectGrid) +function Map:generateFloor(tile) + local canvas = love.graphics.newCanvas(31*16, self:getTotalHeight() * 20) + local tile = tile or 1 + + love.graphics.setCanvas( canvas ) + + for i=1, self:getTotalHeight() do + for j=0, 18 do + local tiley = (i-1)*20 + local tilex = (j-2)*31 + (i-1)*10 + local variant = 1 + ((i + j) % 2) + local tiles = self.datas.tiles*2 + variant + if (not self:isInGrid(j, i)) then + love.graphics.setColor(.66, .66, .66, 1) + end + self.assets.tileset["normaltiles"]:drawTile(tiles, tilex, tiley) + utils.graphics.resetColor() + end + end + + love.graphics.setCanvas( ) + + local imagedata = canvas:newImageData() + local texture = love.graphics.newImage( imagedata ) + imagedata:release() + canvas:release() + return texture +end + + +function Map:draw() self:drawBackgrounds() self:drawBorders() - self:drawTerrains(activeGrid) - if (effectGrid ~= nil) then - self:drawEffectGrid(effectGrid) - end + love.graphics.draw(self.texture.floor, maputils.CONST.STARTX, self:getStartY()) end function Map:drawBackgrounds() - local w, _ = core.screen:getDimensions() local w2, h2 = self.assets.images["back1"]:getDimensions() @@ -97,7 +153,7 @@ function Map:drawBackgrounds() local w2, h2 = self.assets.images["back2"]:getDimensions() local imax = math.ceil(w / w2) + 1 for i=1, imax do - self.assets.images["back2"]:draw((i-1)*w2, maputils.CONST.STARTY-h2, 0, 1, 1) + self.assets.images["back2"]:draw((i-1)*w2, self:getStartY()-h2, 0, 1, 1) end end @@ -105,51 +161,8 @@ end function Map:drawBorders() local border = self.datas.borders + 1 for i=1, 7 do - self.assets.tileset["borders"]:drawTile(border, (i-1)*80, maputils.CONST.STARTY-10 , 0, 1, 1) - self.assets.tileset["borders"]:drawTile(border, (i-1)*80, maputils.CONST.STARTY+20*7, 0, 1, 1) - end -end - -function Map:drawTerrains(activeGrid) - local vl, vhd, vd = 1, .7, .5 - local isActive = (activeGrid ~= nil) - - - for i=1, 7 do - for j= -2, 17 do - local k = 1 + ((i + j) % 2) - - local terrain = self:getTerrain(j, i) - local x, y = maputils.gridToPixel(j, i, false) - - if (terrain ~= nil) then - if (isActive) then - if (activeGrid[i][j] == 1) then - love.graphics.setColor(vl, vl, vl, 1) - else - love.graphics.setColor(vhd, vhd, vhd, 1) - end - else - love.graphics.setColor(vl, vl, vl, 1) - end - - self:drawTile(x, y, terrain, k) - else - love.graphics.setColor(vd, vd, vd, 1) - self:drawTile(x, y, 0, k) - end - end - end - - love.graphics.setColor(1, 1, 1, 1) -end - -function Map:drawTile(x, y, type, variant) - if type == 0 then - local tiles = self.datas.tiles*2 + variant - self.assets.tileset["normaltiles"]:drawTile(tiles, x, y) - else - self.assets.tileset["sptiles"]:drawTile(type, x, y) + self.assets.tileset["borders"]:drawTile(border, (i-1)*80, self:getStartY()-10 , 0, 1, 1) + self.assets.tileset["borders"]:drawTile(border, (i-1)*80, 240-10, 0, 1, 1) end end @@ -166,5 +179,4 @@ function Map:drawEffectGrid(effectGrid) end end - return Map From 8512ab3c26a40b2505cffdb867a1bdccf8d384c8 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 16:57:38 +0200 Subject: [PATCH 10/68] chore: adapt the world to the new turnSystem --- .../scenes/battlesystem/utils.lua | 26 +---- .../scenes/battlesystem/world.lua | 102 +----------------- 2 files changed, 7 insertions(+), 121 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/utils.lua b/sonic-radiance.love/scenes/battlesystem/utils.lua index 5f2455a..25e05de 100644 --- a/sonic-radiance.love/scenes/battlesystem/utils.lua +++ b/sonic-radiance.love/scenes/battlesystem/utils.lua @@ -84,34 +84,18 @@ function maputils.maskToMap(ox, oy, shape, size, direction) return map end -function maputils.gridToPixel(x, y, center) - local pixelx, pixely - local center = center or false - local x, y = x, y - - if (center) then - x = x + .5 - y = y + .5 - end - - pixelx = maputils.CONST.STARTX + ((x-1) * 31) + ((y-1) * 10) - pixely = maputils.CONST.STARTY + ((y-1) * 20) - - return math.floor(pixelx), math.floor(pixely) -end - function maputils.sortBattlers(a, b) - local astats = a.actor:getStats() - local bstats = b.actor:getStats() + local astats = a.fighter:getStats() + local bstats = b.fighter:getStats() local aspeed = astats.speed / 1.5 * a.number local bspeed = bstats.speed / 1.5 * b.number if (aspeed == bspeed) then - if (a.actor.isHero == b.actor.isHero) then - return (a.actor.id > b.actor.id) + if (a.fighter.isHero == b.fighter.isHero) then + return (a.fighter.id > b.fighter.id) else - return a.actor.isHero + return a.fighter.isHero end else return (aspeed > bspeed) diff --git a/sonic-radiance.love/scenes/battlesystem/world.lua b/sonic-radiance.love/scenes/battlesystem/world.lua index c3d586d..b6ca394 100644 --- a/sonic-radiance.love/scenes/battlesystem/world.lua +++ b/sonic-radiance.love/scenes/battlesystem/world.lua @@ -32,29 +32,10 @@ function World:new(scene, battlefile) self.ennNumber = 0 self.map = Map(self, "city") - self.cursor = Cursor(self) - - self:resetActiveGrid() - self:resetEffectGrid() - - self:initHeroes() - self:initEnnemies() self.isBattleActive = false end -function World:initHeroes(battlefile) - for i, hero in ipairs(game.characters.team) do - self:addHero(POSITIONS[i].x, POSITIONS[i].y, hero, i) - end -end - -function World:initEnnemies(battlefile) - self:addEnnemy(10, 3, "motobug") - self:addEnnemy(10, 5, "motobug") - self:addEnnemy(9, 4, "motobug") -end - function World:registerActor(actor) self.globalID = self.globalID + 1 @@ -90,78 +71,6 @@ function World:getActorInCase(x, y, notThisActor) return nil end --- BATTLER FUNCTIONS --- Handle the actual battle participants - -function World:addHero(x, y, id) - self.heroNumber = self.heroNumber + 1 - local hero = self.obj.Hero(self, x, y, id, self.heroNumber) - - table.insert(self.battlers, hero) -end - -function World:addEnnemy(x, y, id) - self.ennNumber = self.ennNumber + 1 - local enn = self.obj.Ennemy(self, x, y, id, self.ennNumber) - - table.insert(self.battlers, enn) -end - -function World:destroyBattler(actorToDestroy) - -- remove the actor from the battler liste - for i, actor in ipairs(self.battlers) do - if actor == actorToDestroy then - table.remove(self.battlers, i) - end - end - - -- Also remove all actions related to the actor - for i, action in ipairs(self.actionlist) do - if action.actor == actorToDestroy then - table.remove(self.actionlist, i) - end - end -end - -function World:generateActionList() - self.actionlist = {} - - for i,v in ipairs(self.battlers) do - for i=1, v.actionPerTurn do - local action = {} - action.actor = v - action.number = i - table.insert(self.actionlist, action) - end - end - - return self.actionlist -end - -function World:countHeroes() - local count = 0 - - for i, battler in ipairs(self.battlers) do - if (battler.isHero) then - count = count + 1 - end - end - - return count -end - -function World:countEnnemies() - local count = 0 - - for i, battler in ipairs(self.battlers) do - if (battler.isEnnemy) then - count = count + 1 - end - end - - return count -end - -- UPDATE FUNCTION -- Update all actors @@ -170,16 +79,9 @@ function World:update(dt) actor:update(dt) end - self.cursor:update(dt) self.map:update(dt) end -function World:finishBattle() - self.isBattleActive = false - self.actionlist = {} - self.scene:finishBattle() -end - function World:sendSignalToCurrentBattler(signal, subSignal) self.scene.turns:sendSignalToCurrentBattler(signal, subSignal) end @@ -212,10 +114,10 @@ end function World:draw() self.map:draw(self.activeGrid, self.effectGrid) - self.cursor:drawBottom() + --self.cursor:drawBottom() self:drawShadows() self:drawActors() - self.cursor:drawTop() + --self.cursor:drawTop() end function World:drawActors() From 5e1ee752ac0f64e1b1e49f7223600e4495e555e4 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 16:57:58 +0200 Subject: [PATCH 11/68] fix: readd fighter removal --- .../scenes/battlesystem/controllers/init.lua | 8 ++++++++ .../scenes/battlesystem/controllers/parent.lua | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index 0455c1d..b36a0e0 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -82,6 +82,14 @@ function TurnController:calculateTurn() table.sort(self.actionList, maputils.sortBattlers) end +function TurnController:removeAllActionsFromFighter(fighterToRemove) + for i, action in ipairs(self.actionlist) do + if action.fighter == fighterToRemove then + table.remove(self.actionlist, i) + end + end +end + function TurnController:startAction() core.debug:print("cbs/turns", "Starting action " .. self.turns.current) local nextAction = self.actionList[self.turns.current] diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index 5bdf754..de032d3 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -48,5 +48,18 @@ function FighterControllerParent:draw() --Aucun dessin par defaut, ils sont géré différements end +function FighterControllerParent:removeFighter(fighterToRemove) + -- remove the actor from the battler liste + for i, fighter in ipairs(self.list) do + if fighter == fighterToRemove then + table.remove(self.list, i) + end + end + + -- Also remove all actions related to the actor + self.turnSystem:removeAllActionsFromFighter(fighterToRemove) +end + + return FighterControllerParent From a41aabbd7d8ec5714674da93484603afc50e6946 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 17:02:00 +0200 Subject: [PATCH 12/68] chore: drop the grid/cursor system --- .../scenes/battlesystem/cursor.lua | 214 ------------------ .../scenes/battlesystem/map.lua | 48 ---- .../scenes/battlesystem/utils.lua | 79 ------- .../scenes/battlesystem/world.lua | 35 +-- 4 files changed, 1 insertion(+), 375 deletions(-) delete mode 100644 sonic-radiance.love/scenes/battlesystem/cursor.lua diff --git a/sonic-radiance.love/scenes/battlesystem/cursor.lua b/sonic-radiance.love/scenes/battlesystem/cursor.lua deleted file mode 100644 index ba862c2..0000000 --- a/sonic-radiance.love/scenes/battlesystem/cursor.lua +++ /dev/null @@ -1,214 +0,0 @@ -local Cursor = Object:extend() - -local maputils = require "scenes.battlesystem.utils" -local TweenManager = require "game.modules.tweenmanager" - -function Cursor:new(world) - self.world = world - self.scene = world.scene - self.assets = world.assets - - self.tweens = TweenManager(self) - - self.x = 1 - self.y = 1 - self.isActive = false - self.tx = 1 - self.ty = 1 - - self.signal = "" - - self.grid = maputils.newEmptyMap() -end - -function Cursor:set(x, y, signal, subSignal) - self.x = math.max(math.min(x, 12), 1) - self.y = math.max(math.min(y, 07), 1) - self.initialx = self.x - self.initialy = self.y - - self:placeInGrid() - - self.tx = self.x - self.ty = self.y - - self.isActive = true - self.signal = signal or "" - self.subSignal = subSignal or "" - - self.world:setActiveGridFromGrid(self.grid) -end - -function Cursor:placeInGrid() - while (self.grid[self.y][self.x] == 0) do - core.debug:print("cursor", "testing position " .. self.x .. " " .. self.y) - -- On teste d'abord les position > initialx - if self.x >= self.initialx then - if self.x >= 12 then - -- cependant, si on est au maximum, on se place juste avant - self.x = self.initialx - 1 - else - self.x = self.x + 1 - end - else - if self.x <= 1 then - -- cependant, si on est au minimum, on doit tester une autre ligne - self.x = self.initialx - if self.y >= self.initialy then - -- on test d'abord les positions en dessous de la position initiales - if self.y >= 7 then - self.y = self.initialy - 1 - else - self.y = self.y + 1 - end - else - if self.y <= 1 then - core.debug:error("cursor", "map was empty") - else - self.y = self.y - 1 - end - end - else - -- sinon, on test les positions avant - self.x = self.x - 1 - end - end - end -end - -function Cursor:setGrid(ox, oy, shape, size, direction, whitelistedEntity) - self.grid = maputils.newEmptyMap() - - for y, line in ipairs(self.grid) do - for x, case in ipairs(line) do - if not maputils.isInMask(x, y, ox, oy, shape, size, direction) then - self.grid[y][x] = 0 - else - if (self:testPoint(x, y, whitelistedEntity)) then - self.grid[y][x] = 1 - else - self.grid[y][x] = 0 - end - end - end - end - - self.world:setActiveGridFromGrid(self.grid) -end - -function Cursor:setGridIgnoreActor(ox, oy, shape, size, direction) - self.grid = maputils.newEmptyMap() - - for y, line in ipairs(self.grid) do - for x, case in ipairs(line) do - if maputils.isInMask(x, y, ox, oy, shape, size, direction) then - self.grid[y][x] = 1 - end - end - end - - self.world:setActiveGridFromGrid(self.grid) -end - -function Cursor:testPoint(x, y, whitelistedActor) - if ((self.world:getActorInCase(x, y) == nil) or - (self.world:getActorInCase(x, y) == whitelistedActor) and (whitelistedActor ~= nil)) and - (self.world.map:getTerrain(x, y) ~= 3) then - return true - else - return false - end -end - -function Cursor:gridIsActive(x, y) - if self.grid[y] ~= nil then - return (self.grid[y][x] == 1) - else - return false - end -end - -function Cursor:getGrid() - if (self.isActive) then - return self.grid - else - return maputils.newFullMap() - end -end - -function Cursor:resetGrid() - self.grid = EmptyGrid -end - -function Cursor:unset() - self.isActive = false -end - -function Cursor:update(dt) - if (self.isActive) then - local keys = self.scene:getKeys(1) - - if (keys["up"].isDown and self.y == self.ty) then - dy = math.max(self.y - 1, 1) - if (self.grid[dy][self.x] == 1) then - self.y = dy - self:addTween() - end - end - if (keys["down"].isDown and self.y == self.ty) then - dy = math.min(self.y + 1, 7) - if (self.grid[dy][self.x] == 1) then - self.y = dy - self:addTween() - end - end - if (keys["left"].isDown and self.x == self.tx) then - dx = math.max(self.x - 1, 1) - if (self.grid[self.y][dx] == 1) then - self.x = dx - self:addTween() - end - end - if (keys["right"].isDown and self.x == self.tx) then - dx = math.min(self.x + 1, 12) - if (self.grid[self.y][dx] == 1) then - self.x = dx - self:addTween() - end - end - - if (keys["A"].isPressed and self.x == self.tx and self.y == self.ty) then - self.world:sendSignalToCurrentBattler(self.signal, self.subSignal) - end - - self.tweens:update(dt) - end -end - -function Cursor:addTween() - self.tweens:newTween(0, 0.2, {tx = self.x, ty = self.y}, 'linear') -end - -function Cursor:drawBottom() - - if (self.isActive) then - local x, y, frame - x, y = maputils.gridToPixel(self.tx, self.ty, true) - - self.assets.sprites["cursorground"]:drawAnimation(x, y, 0, 1, 1, 14, 6) - end - -end - -function Cursor:drawTop() - - if (self.isActive) then - local x, y - x, y = maputils.gridToPixel(self.tx, self.ty, true) - - self.assets.images["cursorpeak"]:draw(x, y - 24, 0, 1, 1, 7, 26) - end - -end - -return Cursor diff --git a/sonic-radiance.love/scenes/battlesystem/map.lua b/sonic-radiance.love/scenes/battlesystem/map.lua index 2ea1b10..71d7b57 100644 --- a/sonic-radiance.love/scenes/battlesystem/map.lua +++ b/sonic-radiance.love/scenes/battlesystem/map.lua @@ -1,11 +1,6 @@ local Map = Object:extend() local maputils = require "scenes.battlesystem.utils" -local TweenManager = require "game.modules.tweenmanager" - -local DURATION = 0.66 -local OPACITY_MIN = 0 -local OPACITY_MAX = 0.75 local HEIGHT = 5 local BOTTOM_BORDER = 1 @@ -17,11 +12,6 @@ function Map:new(world, type, terrain) self.datas = {} self.datas.type = type or "forest" - self.datas.terrains = terrain or maputils.newEmptyMap() - - self.tweens = TweenManager(self) - self.effectOpacity = OPACITY_MIN - self:increaseOpacity() local zones = require "datas.gamedata.maps.shoot.zones" local datas = zones[self.datas.type] @@ -77,31 +67,6 @@ function Map:gridToPixel(x, y, center) return math.floor(pixelx), math.floor(pixely) end -function Map:update(dt) - self.tweens:update(dt) -end - --- OPACITY FUNCTIONS --- Simple functions to work on opacity - -function Map:decreaseOpacity() - self.tweens:newTween(0, DURATION/2, {effectOpacity = OPACITY_MIN}, "inExpo") - self.tweens:newTimer(DURATION/2, "increaseOpacity") -end - -function Map:increaseOpacity() - self.tweens:newTween(0, DURATION/2, {effectOpacity = OPACITY_MAX}, "inExpo") - self.tweens:newTimer(DURATION/2, "decreaseOpacity") -end - -function Map:timerResponse(timer) - if timer == "increaseOpacity" then - self:increaseOpacity() - elseif timer == "decreaseOpacity" then - self:decreaseOpacity() - end -end - -- DRAW FUNCTIONS -- Draw the battle map @@ -166,17 +131,4 @@ function Map:drawBorders() end end -function Map:drawEffectGrid(effectGrid) - for i=1,7 do - for j=1,17 do - if (effectGrid[i][j] == 1) then - local x, y = maputils.gridToPixel(j, i) - love.graphics.setColor(1, 1, 1, self.effectOpacity) - self.assets.images["emptytile"]:draw(x, y) - love.graphics.setColor(1, 1, 1, 1) - end - end - end -end - return Map diff --git a/sonic-radiance.love/scenes/battlesystem/utils.lua b/sonic-radiance.love/scenes/battlesystem/utils.lua index 25e05de..8c940a0 100644 --- a/sonic-radiance.love/scenes/battlesystem/utils.lua +++ b/sonic-radiance.love/scenes/battlesystem/utils.lua @@ -5,85 +5,6 @@ maputils.CONST = {} maputils.CONST.STARTX = -8 maputils.CONST.STARTY = 90 - -function maputils.newEmptyMap() - return { - {00,00,00,00,00,00,00,00,00,00,00,00}, - {00,00,00,00,00,00,00,00,00,00,00,00}, - {00,00,00,00,00,00,00,00,00,00,00,00}, - {00,00,00,00,00,00,00,00,00,00,00,00}, - {00,00,00,00,00,00,00,00,00,00,00,00}, - {00,00,00,00,00,00,00,00,00,00,00,00}, - {00,00,00,00,00,00,00,00,00,00,00,00}, - } -end - -function maputils.newFullMap() - return { - {01,01,01,01,01,01,01,01,01,01,01,01}, - {01,01,01,01,01,01,01,01,01,01,01,01}, - {01,01,01,01,01,01,01,01,01,01,01,01}, - {01,01,01,01,01,01,01,01,01,01,01,01}, - {01,01,01,01,01,01,01,01,01,01,01,01}, - {01,01,01,01,01,01,01,01,01,01,01,01}, - {01,01,01,01,01,01,01,01,01,01,01,01}, - } -end - -function maputils.isInMask(x, y, ox, oy, shape, size, direction) - local direction = direction or 1 - local shape = shape or "point" - if shape == "point" then - return ((x == ox) and (y == oy)) - elseif shape == "square" then - local x1 = ox - math.floor(size/2) - local x2 = ox + math.ceil(size/2) - - local y1 = oy - math.floor(size/2) - local y2 = oy + math.ceil(size/2) - return ((x >= x1) and (x <= x2) and (y >= y1) and (y <= y2)) - elseif shape == "circle" then - local lenght = utils.math.pointDistance(x, y, ox, oy) - return (lenght <= size) - elseif shape == "fullheight" then - local x2 = ox + (size*direction) - return ((x >= ox) and (x <= x2)) - elseif shape == "fullwidth" then - local y2 = oy + (size*direction) - return ((y >= oy) and (y <= y2)) - elseif shape == "line" then - local x2 = ox + (size*direction) - return ((y == oy) and (x >= ox) and (x <= x2)) - elseif shape == "column" then - local y2 = oy + (size*direction) - return ((x == ox) and (y >= oy) and (y <= y2)) - elseif shape == "everything" then - return true - else - if shape == nil then - shape = "nil" - end - core.debug:warning("maputils", "shape " .. shape .. " doesn't exist") - end -end - -function maputils.maskToMap(ox, oy, shape, size, direction) - local map = maputils.newEmptyMap() - - for i, line in ipairs(map) do - for j, case in ipairs(line) do - local isInMask = maputils.isInMask(j, i, ox, oy, shape, size, direction) - if (isInMask) then - map[i][j] = 1 - else - map[i][j] = 0 - end - end - end - - return map -end - function maputils.sortBattlers(a, b) local astats = a.fighter:getStats() local bstats = b.fighter:getStats() diff --git a/sonic-radiance.love/scenes/battlesystem/world.lua b/sonic-radiance.love/scenes/battlesystem/world.lua index b6ca394..83ef709 100644 --- a/sonic-radiance.love/scenes/battlesystem/world.lua +++ b/sonic-radiance.love/scenes/battlesystem/world.lua @@ -2,7 +2,6 @@ local World = Object:extend() local maputils = require "scenes.battlesystem.utils" local Map = require "scenes.battlesystem.map" -local Cursor = require "scenes.battlesystem.cursor" local TweenManager = require "game.modules.tweenmanager" @@ -26,11 +25,6 @@ function World:new(scene, battlefile) self.actors = {} self.globalID = 0 - self.battlers = {} - - self.heroNumber = 0 - self.ennNumber = 0 - self.map = Map(self, "city") self.isBattleActive = false @@ -78,46 +72,19 @@ function World:update(dt) for i, actor in ipairs(self.actors) do actor:update(dt) end - - self.map:update(dt) end function World:sendSignalToCurrentBattler(signal, subSignal) self.scene.turns:sendSignalToCurrentBattler(signal, subSignal) end --- ACTIVEGRID FUNCTIONS --- Help to handle the activeGrid system - -function World:resetActiveGrid() - self.activeGrid = maputils.newFullMap() -end - -function World:setActiveGrid(ox, oy, shape, size, direction) - self.activeGrid = maputils.maskToMap(ox, oy, shape, size, direction) -end - -function World:setActiveGridFromGrid(grid) - self.activeGrid = grid -end - -function World:resetEffectGrid() - self.effectGrid = maputils.newEmptyMap() -end - -function World:setEffectGrid(ox, oy, shape, size, direction) - self.effectGrid = maputils.maskToMap(ox, oy, shape, size, direction) -end - -- DRAW FUNCTION -- Draw the world function World:draw() - self.map:draw(self.activeGrid, self.effectGrid) - --self.cursor:drawBottom() + self.map:draw() self:drawShadows() self:drawActors() - --self.cursor:drawTop() end function World:drawActors() From 6bca41d794a7b86385c5b02c8cc0a30fa8f69e09 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 17:06:17 +0200 Subject: [PATCH 13/68] chore: first round of actor cleanup There is still a lot of work though --- .../scenes/battlesystem/actors/ennemy.lua | 25 ++------ .../scenes/battlesystem/actors/hero.lua | 59 +++++++------------ .../scenes/battlesystem/actors/parent.lua | 4 +- 3 files changed, 28 insertions(+), 60 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua index 58aeadc..8d08b3c 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua @@ -3,10 +3,10 @@ local Ennemy = Battler:extend() local gui = require "game.modules.gui" -function Ennemy:new(world, x, y, id, number) +function Ennemy:new(world, x, y, owner) Ennemy.super.new(self, world, x, y, 0) self.isEnnemy = true - self.ennid = id or "motobug" + self.owner = owner self.actionPerTurn = 2 @@ -18,31 +18,16 @@ function Ennemy:new(world, x, y, id, number) end function Ennemy:draw() - local x, y = self.maputils.gridToPixel(self.x, self.y, true) + local x, y = self.world.map:gridToPixel(self.x, self.y, true) love.graphics.setColor(1, 0, 0, 1) love.graphics.rectangle("fill", x - 8, y - 32, 16, 32) love.graphics.setColor(1, 1, 1, 1) -end -function Ennemy:drawHUD() - local x, y = self.maputils.gridToPixel(self.x, self.y, true) - love.graphics.setColor(0, 0, 0, 1) - gui.drawBar(x - 14, y - 38, 26, 4) - love.graphics.setColor(248/255, 160/255, 0, 1) - local bar = math.floor(24 * (self.shownHP / self.data.stats.hpmax)) - gui.drawBar(x - 14, y - 37, bar, 2) - love.graphics.setColor(1, 1, 1, 1) - -end - -function Ennemy:drawIcon(x, y) - love.graphics.setColor(1, 0, 0, 1) - love.graphics.rectangle("fill", x, y, 16, 16) - love.graphics.setColor(1, 1, 1, 1) + self.owner:drawHUD(x - 14, y - 38) end function Ennemy:receiveDatas() - self.data = game.ennemies:getEnnemyData(self.ennid) + self.data = game.ennemies:getEnnemyData(self.owner.name) end function Ennemy:setHP(value, relative) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index db3d113..6133202 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -2,28 +2,26 @@ local Battler = require("scenes.battlesystem.actors.battler") local Hero = Battler:extend() local gui = require "game.modules.gui" -local StatusBar = require "scenes.battlesystem.gui.statusbar" local ChoregraphySystem = require "scenes.battlesystem.actors.systems.choregraphy" -- INIT FUNCTIONS -- Initialize the hero -function Hero:new(world, x, y, charid, charnumber) +function Hero:new(world, x, y, owner, charnumber) Hero.super.new(self, world, x, y, 0) self.isHero = true + self.owner = owner self:initMovementSystem() - self:initCharacter(charid) + --self:initCharacter(charid) self:initSprite() self:initChoregraphySystem() self:initVoices() - self.statusbar = StatusBar(self) - self.side = "heroes" end @@ -34,37 +32,31 @@ function Hero:initCharacter(charid) if charid == nil then core.debug:error("FATAL ERROR: charid not set") end - self.charid = charid - self.charnumber = charnumber or 1 - - self.hp = game.characters.list[self.charid].stats.hp - self.pp = game.characters.list[self.charid].stats.pp - - self.actionPerTurn = game.characters.list[self.charid].turns + self.owner.name = charid self.turnAction = nil end function Hero:getStats() - return game.characters.list[self.charid].stats + return game.characters.list[self.owner.name].stats end function Hero:setHP(value, relative) if relative == true then - value = game.characters.list[self.charid].stats.hp + value + value = game.characters.list[self.owner.name].stats.hp + value end - game.characters.list[self.charid].stats.hp = value - self.statusbar:updateHP() + game.characters.list[self.owner.name].stats.hp = value + --self.statusbar:updateHP() end function Hero:setPP(value, relative) if relative == true then - value = game.characters.list[self.charid].stats.pp + value + value = game.characters.list[self.owner.name].stats.pp + value end - game.characters.list[self.charid].stats.pp = value - self.statusbar:updatePP() + game.characters.list[self.owner.name].stats.pp = value + --self.statusbar:updatePP() end @@ -72,8 +64,8 @@ end -- Function to set or unset activity to the character function Hero:setActive() - core.debug:print("cbs/hero", "hero " .. self.charid .. " is now active") - local gridsize = game.characters.list[self.charid].move + core.debug:print("cbs/hero", "hero " .. self.owner.name .. " is now active") + local gridsize = game.characters.list[self.owner.name].move if (gridsize == nil) then gridsize = 3 core.debug:warning("cbs/character", "move value is nil") @@ -110,7 +102,7 @@ function Hero:update(dt) self.yprevious = self.y self.zprevious = self.z - self.statusbar:update(dt) + --self.statusbar:update(dt) end -- MOVE FUNCTIONS @@ -354,16 +346,16 @@ end -- Getting info about the actor function Hero:getCharacterData() - return game.characters.list[self.charid] + return game.characters.list[self.owner.name] end -- ASSETS FUNCTIONS -- Load and play assets needed by the character function Hero:initSprite() - self.assets:addSprite(self.charid, "datas/gamedata/characters/" .. self.charid .. "/sprites") - self.assets.sprites[self.charid]:setCustomSpeed(16) - self:setSprite(self.charid, 32, 48, true) + self.assets:addSprite(self.owner.name, "datas/gamedata/characters/" .. self.owner.name .. "/sprites") + self.assets.sprites[self.owner.name]:setCustomSpeed(16) + self:setSprite(self.owner.name, 32, 48, true) self:cloneSprite() self:changeAnimation("idle") end @@ -380,13 +372,13 @@ function Hero:initVoices() end function Hero:addVoiceEffect(name) - local completename = self.charid .. "_" .. name - local path = "datas/gamedata/characters/" .. self.charid .. "/voices/" .. name .. ".wav" + local completename = self.owner.name .. "_" .. name + local path = "datas/gamedata/characters/" .. self.owner.name .. "/voices/" .. name .. ".wav" self.assets:newSFX(completename, path) end function Hero:talk(name) - local completename = self.charid .. "_" .. name + local completename = self.owner.name .. "_" .. name self.assets.sfx[completename]:play() end @@ -397,13 +389,4 @@ function Hero:draw() self:drawSprite(0, -self.z) end -function Hero:drawIcon(x, y) - local iconID = 1 - self.assets.tileset["charicons"]:drawTile(iconID, x, y) -end - -function Hero:drawHUD() - self.statusbar:draw() -end - return Hero diff --git a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua index 0ae9d8f..2a095b0 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua @@ -153,7 +153,7 @@ end function Parent:drawSprite(tx, ty) utils.graphics.resetColor() - local x, y = self.maputils.gridToPixel(self.x, self.y, true) + local x, y = self.world.map:gridToPixel(self.x, self.y, true) local tx = tx or 0 local ty = ty or 0 @@ -176,7 +176,7 @@ function Parent:draw() end function Parent:drawShadow() - local x, y = self.maputils.gridToPixel(self.x, self.y, true) + local x, y = self.world.map:gridToPixel(self.x, self.y, true) self.assets.images["actorsShadow"]:draw(x, y, 0, 1, 1, 12, 5) end From f3cfaf9ac24040414678eb0d0098e17c86b4a95e Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 18:09:53 +0200 Subject: [PATCH 14/68] fix: adapt the menu system to the new concept --- .../controllers/fighters/character.lua | 12 +- .../controllers/fighters/parent.lua | 2 +- .../scenes/battlesystem/controllers/init.lua | 2 +- .../scenes/battlesystem/menu.lua | 146 ++++-------------- 4 files changed, 41 insertions(+), 121 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 96f5b1f..daf4220 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -17,6 +17,10 @@ function HeroFighter:updateAssets(dt) self.statusbar:update(dt) end +function HeroFighter:update(dt) + +end + function HeroFighter:getAbstract() return game.characters.list[self.name] end @@ -27,13 +31,19 @@ function HeroFighter:createActor() end function HeroFighter:startAction() - + core.debug:print("cbs/heroFighter", "launching the action menu") + self.turnSystem.scene.menu:set( self ) end function HeroFighter:endAction() end +-- Basic actions +function HeroFighter:doNothing() + self:setInactive() +end + -- DRAW FUNCTIONS function HeroFighter:drawIcon(x, y) local iconID = 1 diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua index 35aa413..5715a84 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua @@ -47,7 +47,7 @@ end function FighterParent:setInactive() self.isActive = false - self.turnSystem:nextAction() + self.turnSystem:endAction() end function FighterParent:getNbrActionPerTurn() diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index b36a0e0..cfec8b6 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -106,7 +106,7 @@ function TurnController:startAction() end function TurnController:endAction() - self.currentlyPlaying = "" + self.currentFighter = nil end function TurnController:sendSignalToCurrentBattler(signal, subSignal) diff --git a/sonic-radiance.love/scenes/battlesystem/menu.lua b/sonic-radiance.love/scenes/battlesystem/menu.lua index 0d1f8a3..00cd9b6 100644 --- a/sonic-radiance.love/scenes/battlesystem/menu.lua +++ b/sonic-radiance.love/scenes/battlesystem/menu.lua @@ -15,34 +15,33 @@ local MENU_WIDTH, MENU_ITEM_HEIGHT = 148, 17 local MENU_ITEM_NUMBER = 6 function MenuConstructor:new( controller ) - self.controller = controller + self.scene = controller end function MenuConstructor:reconstruct(character) - self.controller.menusystem:reset() + core.debug:print("cbs/menu", "Reconstructing the menu") + self.scene.menusystem:reset() self:build(character) - self.controller.menusystem:switchMenu("BaseMenu") + self.scene.menusystem:switchMenu("BaseMenu") end function MenuConstructor:build(character) + core.debug:print("cbs/menu", "Building the menu") self:buildBaseMenu(character) self:buildSkillMenu(character) self:buildObjectMenu(character) - self.controller.menusystem:setSoundFromSceneAssets("mBeep") + self.scene.menusystem:setSoundFromSceneAssets("mBeep") end function MenuConstructor:buildBaseMenu(character) - CharacterMenu(self.controller, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y) + CharacterMenu(self.scene, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y) ActionWidget(character, "BaseMenu", "attack") SubMenuWidget(character, "BaseMenu", "skills", "SkillMenu") SubMenuWidget(character, "BaseMenu", "objects", "ObjectMenu") ActionWidget(character, "BaseMenu", "defend") ActionWidget(character, "BaseMenu", "flee") - BackMenuWidget(character, "BaseMenu") - - self.controller.menusystem.menus["BaseMenu"]:setCancelWidget() end function MenuConstructor:set(currentCharacter) @@ -50,23 +49,23 @@ function MenuConstructor:set(currentCharacter) end function MenuConstructor:buildSkillMenu(character) - CharacterMenu(self.controller, "SkillMenu", MENUPOS_X1 - 16, MENUPOS_Y) - local list = game.characters:getSkillList(character.charid) + CharacterMenu(self.scene, "SkillMenu", MENUPOS_X1 - 16, MENUPOS_Y) + local list = character.abstract.skills for k, skill in pairs(list) do SkillWidget(character, "SkillMenu", skill.name, "") end SubMenuWidget(character, "SkillMenu", "back", "BaseMenu") - self.controller.menusystem.menus["SkillMenu"]:setCancelWidget() + self.scene.menusystem.menus["SkillMenu"]:setCancelWidget() end function MenuConstructor:buildObjectMenu(character) - CharacterMenu(self.controller, "ObjectMenu", MENUPOS_X1 - 16, MENUPOS_Y) + CharacterMenu(self.scene, "ObjectMenu", MENUPOS_X1 - 16, MENUPOS_Y) - CharacterMenu(self.controller, "MedMenu", MENUPOS_X1 - 16, MENUPOS_Y) - CharacterMenu(self.controller, "RingMenu", MENUPOS_X1 - 16, MENUPOS_Y) - CharacterMenu(self.controller, "WispMenu", MENUPOS_X1 - 16, MENUPOS_Y) - CharacterMenu(self.controller, "OtherMenu", MENUPOS_X1 - 16, MENUPOS_Y) + CharacterMenu(self.scene, "MedMenu", MENUPOS_X1 - 16, MENUPOS_Y) + CharacterMenu(self.scene, "RingMenu", MENUPOS_X1 - 16, MENUPOS_Y) + CharacterMenu(self.scene, "WispMenu", MENUPOS_X1 - 16, MENUPOS_Y) + CharacterMenu(self.scene, "OtherMenu", MENUPOS_X1 - 16, MENUPOS_Y) SubMenuWidget(character, "ObjectMenu", "heal", "MedMenu") @@ -81,12 +80,12 @@ function MenuConstructor:buildObjectMenu(character) SubMenuWidget(character, "OtherMenu", "back", "ObjectMenu") - self.controller.menusystem.menus["ObjectMenu"]:setCancelWidget() + self.scene.menusystem.menus["ObjectMenu"]:setCancelWidget() - self.controller.menusystem.menus["MedMenu"]:setCancelWidget() - self.controller.menusystem.menus["RingMenu"]:setCancelWidget() - self.controller.menusystem.menus["WispMenu"]:setCancelWidget() - self.controller.menusystem.menus["OtherMenu"]:setCancelWidget() + self.scene.menusystem.menus["MedMenu"]:setCancelWidget() + self.scene.menusystem.menus["RingMenu"]:setCancelWidget() + self.scene.menusystem.menus["WispMenu"]:setCancelWidget() + self.scene.menusystem.menus["OtherMenu"]:setCancelWidget() end @@ -149,7 +148,7 @@ end function BattleWidget:getControllers(character, menu_name) self.character = character or core.debug:error("cbs/widget", "character must not be nil") - self.scene = self.character.scene + self.scene = self.character.turnSystem.scene self.assets = self.character.assets self.menusystem = self.scene.menusystem @@ -167,26 +166,7 @@ function BattleWidget:update(dt) end function BattleWidget:selectAction() - self:setActiveGrid() - self:setEffectGrid() -end - -function BattleWidget:setActiveGrid() - if (self:haveActiveGrid()) then - local ox, oy, shape, size, idk = self:getActiveGrid() - self.scene.world:setActiveGrid(ox, oy, shape, size, idk) - else - self.scene.world:resetActiveGrid() - end -end - -function BattleWidget:setEffectGrid() - if (self:haveEffectGrid()) then - local ox, oy, shape, size, idk = self:getEffectGrid() - self.scene.world:setEffectGrid(ox, oy, shape, size, idk) - else - self.scene.world:resetEffectGrid() - end + -- Rien de base, à voir ensuite comment je gère end function BattleWidget:drawCanvas() @@ -217,9 +197,6 @@ function BattleWidget:drawCanvas() end function BattleWidget:action() - self.scene.world:resetActiveGrid() - self.scene.world:resetEffectGrid() - self:sendCharacterData() self.scene:flushKeys() @@ -228,24 +205,8 @@ end -- External functions -function BattleWidget:haveActiveGrid() - return false -end - -function BattleWidget:getActiveGrid() - return 0, 0, "point", 0, 0 -end - -function BattleWidget:haveEffectGrid() - return false -end - -function BattleWidget:getEffectGrid() - return 0, 0, "point", 0, 0 -end - function BattleWidget:sendCharacterData() - self.character:receiveSignal() + self.character:doNothing() end -- ActionWidget @@ -256,16 +217,8 @@ function ActionWidget:new(character, menu_name, action) ActionWidget.super.new(self, character, menu_name, action, "") end -function ActionWidget:haveEffectGrid() - return (self.actionType == "attack") -end - -function ActionWidget:getEffectGrid() - return self.character.x + self.character.direction, self.character.y, "point", 1, 1 -end - function ActionWidget:sendCharacterData() - self.character:receiveSignal(self.actionType) + self.character:doNothing() end -- SubMenuWidget @@ -318,58 +271,15 @@ function SkillWidget:new(character, menu_name, skill) SkillWidget.super.new(self, character, menu_name, self.skillname, "-" .. label2, "skills") end -function SkillWidget:selectAction() - if self.skilldata ~= nil then - SkillWidget.super.selectAction(self) - else - self.scene.world:resetActiveGrid() - self.scene.world:resetEffectGrid() - end -end - -function SkillWidget:haveActiveGrid() - return (self.skilldata.target ~= nil) -end - -function SkillWidget:haveEffectGrid() - return ((self.skilldata.target == nil) and (self.skilldata.effectArea ~= nil)) -end - -function SkillWidget:getActiveGrid() - local x = self.character.x + self.skilldata.target[1] - local y = self.character.y + self.skilldata.target[2] - local shape = self.skilldata.target[3] - local size = self.skilldata.target[4] - local direction = self.character.direction - - return x, y, shape, size, direction -end - -function SkillWidget:getEffectGrid() - local x = self.character.x + self.skilldata.effectArea[1] - local y = self.character.y + self.skilldata.effectArea[2] - local shape = self.skilldata.effectArea[3] - local size = self.skilldata.effectArea[4] - local direction = self.character.direction - - return x, y, shape, size, direction -end - function SkillWidget:sendCharacterData() if self.skilldata ~= nil then - if self:haveActiveGrid() then - local x, y, shape, size, direction = self:getActiveGrid() - self.scene.world.cursor:setGridIgnoreActor(x, y, shape, size, direction) - self.scene.world.cursor:set(self.character.x, self.character.y, "skill", self.skillname) - self.assets.sfx["mSelect"]:play() - else - self.assets.sfx["mSelect"]:play() - self.character:useSkill(self.skillname, self.character.x, self.character.y) - end + self.assets.sfx["mSelect"]:play() + self.character:doNothing() + --self.character:useSkill(self.skillname, self.character.x, self.character.y) else core.debug:warning("cbs/menu", "skill " .. self.skillname .. " doesn't exist") - self.character:receiveSignal("none") + self.character:doNothing() self.assets.sfx["mError"]:play() end From 649bb561dade1b8f4e95f9431b354e720a05518b Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 21:41:14 +0200 Subject: [PATCH 15/68] feat: simple selection system --- .../scenes/battlesystem/actors/battler.lua | 2 + .../scenes/battlesystem/actors/ennemy.lua | 5 ++ .../scenes/battlesystem/actors/parent.lua | 3 + .../controllers/fighters/character.lua | 29 ++++++++- .../fighters/systems/selection.lua | 65 +++++++++++++++++++ .../controllers/fighters/villain.lua | 2 +- .../battlesystem/controllers/parent.lua | 4 ++ .../scenes/battlesystem/menu.lua | 26 ++++++-- 8 files changed, 129 insertions(+), 7 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua diff --git a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua index c531968..89913a7 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua @@ -8,6 +8,8 @@ function Battler:new(world, x, y, z) self.speed = 3 self.isActive = false self.debugActiveTimer = 0 + + self.isSelected = false end function Battler:destroy() diff --git a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua index 8d08b3c..742767a 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua @@ -24,6 +24,11 @@ function Ennemy:draw() love.graphics.setColor(1, 1, 1, 1) self.owner:drawHUD(x - 14, y - 38) + + if (self.isSelected) then + local height = 32 + self.assets.images["cursorpeak"]:draw(x - 7, y - 24 - 32) + end end function Ennemy:receiveDatas() diff --git a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua index 2a095b0..e2c8110 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua @@ -178,6 +178,9 @@ end function Parent:drawShadow() local x, y = self.world.map:gridToPixel(self.x, self.y, true) self.assets.images["actorsShadow"]:draw(x, y, 0, 1, 1, 12, 5) + if (self.isSelected == true) then + self.assets.sprites["cursorground"]:drawAnimation(x - 2, y - 1, 0, 1, 1, 12, 5) + end end function Parent:drawHUD() diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index daf4220..68d76f7 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -2,6 +2,7 @@ local FighterParent = require "scenes.battlesystem.controllers.fighters.parent" local HeroFighter = FighterParent:extend() local StatusBar = require "scenes.battlesystem.gui.statusbar" +local SelectionSystem = require "scenes.battlesystem.controllers.fighters.systems.selection" local POSITIONS = {3, 1, 5} local HEROES_LINE = 3; @@ -11,6 +12,12 @@ function HeroFighter:new(owner, character, id) self.super.new(self, owner, true, id) self.statusbar = StatusBar(self) + + self.currentAction = "" + self.actionArgument = "" + self.target = nil + + self.selection = nil end function HeroFighter:updateAssets(dt) @@ -18,7 +25,9 @@ function HeroFighter:updateAssets(dt) end function HeroFighter:update(dt) - + if (self.selection ~= nil) then + self.selection:update(dt) + end end function HeroFighter:getAbstract() @@ -32,6 +41,9 @@ end function HeroFighter:startAction() core.debug:print("cbs/heroFighter", "launching the action menu") + self.currentAction = "" + self.actionArgument = "" + self.target = nil self.turnSystem.scene.menu:set( self ) end @@ -44,6 +56,21 @@ function HeroFighter:doNothing() self:setInactive() end +function HeroFighter:attack() + self.currentAction = "attack" + self.selection = SelectionSystem(self, self.owner.turnSystem.ennemies) +end + +function HeroFighter:receiveTarget(target) + self.selection = nil + self:setInactive() +end + +function HeroFighter:goBackToMenu() + self.owner.turnSystem.scene.menusystem:activate() + self.selection = nil +end + -- DRAW FUNCTIONS function HeroFighter:drawIcon(x, y) local iconID = 1 diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua new file mode 100644 index 0000000..2d57620 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua @@ -0,0 +1,65 @@ +local SelectionSystem = Object:extend() + +function SelectionSystem:new(owner, fighterList) + self.fighterList = fighterList + self.owner = owner + self.assets = self.owner.assets + self.selectedTarget = 1 +end + +function SelectionSystem:update(dt) + --Faire en sorte que cela permette de choisir la cible + local keys = self.owner.turnSystem.scene:getKeys(1) + self:purgeTarget() + if (keys["up"].isPressed) then + if (self.selectedTarget == 1) then + self.selectedTarget = self.fighterList:count() + else + self.selectedTarget = self.selectedTarget - 1 + end + self.assets.sfx["mBeep"]:play() + end + if (keys["down"].isPressed) then + if (self.selectedTarget == self.fighterList:count()) then + self.selectedTarget = 1 + else + self.selectedTarget = self.selectedTarget + 1 + end + self.assets.sfx["mBeep"]:play() + end + + self:updateTarget() + + if (keys["A"].isPressed) then + self.assets.sfx["mSelect"]:play() + self:selectTarget() + end + + if (keys["B"].isPressed) then + self.assets.sfx["mBack"]:play() + self:goBack() + end + +end + +function SelectionSystem:purgeTarget() + local target = self.fighterList:get(self.selectedTarget) + target.actor.isSelected = false +end + +function SelectionSystem:updateTarget() + local target = self.fighterList:get(self.selectedTarget) + target.actor.isSelected = true +end + +function SelectionSystem:selectTarget() + self:purgeTarget() + self.owner:receiveTarget(self.fighterList:get(self.selectedTarget)) +end + +function SelectionSystem:goBack() + self:purgeTarget() + self.owner:goBackToMenu() +end + +return SelectionSystem diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua index 45ac549..c8a9c6b 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua @@ -3,7 +3,7 @@ local VillainFighter = FighterParent:extend() local SimpleHPBar = require "scenes.battlesystem.gui.simplehpbar" -local POSITIONS = {3, 1, 5} +local POSITIONS = {1, 3, 5} local ENNEMY_LINE = 10; function VillainFighter:new(owner, ennemy, id) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index de032d3..b9659fa 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -6,6 +6,10 @@ function FighterControllerParent:new(turnSystem) self.list = {} end +function FighterControllerParent:get(id) + return self.list[id] +end + function FighterControllerParent:add(fighter) table.insert(self.list, fighter) end diff --git a/sonic-radiance.love/scenes/battlesystem/menu.lua b/sonic-radiance.love/scenes/battlesystem/menu.lua index 00cd9b6..cea0beb 100644 --- a/sonic-radiance.love/scenes/battlesystem/menu.lua +++ b/sonic-radiance.love/scenes/battlesystem/menu.lua @@ -10,6 +10,8 @@ local SubMenuWidget = BattleWidget:extend() local BackMenuWidget = BattleWidget:extend() local SkillWidget = BattleWidget:extend() +local AttackWidget = ActionWidget:extend() + local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 32, 32, 110 local MENU_WIDTH, MENU_ITEM_HEIGHT = 148, 17 local MENU_ITEM_NUMBER = 6 @@ -33,11 +35,12 @@ function MenuConstructor:build(character) self:buildObjectMenu(character) self.scene.menusystem:setSoundFromSceneAssets("mBeep") + self.scene.menusystem:activate() end function MenuConstructor:buildBaseMenu(character) CharacterMenu(self.scene, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y) - ActionWidget(character, "BaseMenu", "attack") + AttackWidget(character, "BaseMenu") SubMenuWidget(character, "BaseMenu", "skills", "SkillMenu") SubMenuWidget(character, "BaseMenu", "objects", "ObjectMenu") ActionWidget(character, "BaseMenu", "defend") @@ -101,7 +104,7 @@ function CharacterMenu:new(scene, name, x, y) local w, h = MENU_WIDTH, MENU_ITEM_NUMBER * MENU_ITEM_HEIGHT CharacterMenu.super.new(self, scene.menusystem, name, x, y, w, h, MENU_ITEM_NUMBER) self.cursorTexture = love.graphics.newImage("assets/gui/cursor-menulist.png") - self.cursorTransition = 1 + self.cursorTransition = 0 end function CharacterMenu:update(dt) @@ -197,10 +200,10 @@ function BattleWidget:drawCanvas() end function BattleWidget:action() - self:sendCharacterData() - self.scene:flushKeys() - self.scene.menusystem:reset() + self.scene.menusystem:deactivate() + + self:sendCharacterData() end -- External functions @@ -221,6 +224,19 @@ function ActionWidget:sendCharacterData() self.character:doNothing() end +-- AttackWidget +-- The basic action widget + +function AttackWidget:new(character, menu_name) + self.actionType = "attack" + ActionWidget.super.new(self, character, menu_name, "attack", "") +end + +function AttackWidget:sendCharacterData() + self.character:attack() +end + + -- SubMenuWidget -- A simple widget to change menu From eb1113064dd64f6feb995302d17c2ac191ebcd98 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 21:46:17 +0200 Subject: [PATCH 16/68] fix: faster placeholder waiting time --- .../scenes/battlesystem/controllers/fighters/parent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua index 5715a84..6489a4d 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua @@ -29,7 +29,7 @@ end function FighterParent:update(dt) counter = counter + dt - if (counter > 5) then + if (counter > 1) then counter = 0 self:setInactive() end From 9ece46fbb5036fdb83a221a8da84a0fafae0e535 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 19 Jul 2020 22:38:59 +0200 Subject: [PATCH 17/68] feat: add the basic action selection system --- .../controllers/fighters/character.lua | 46 +++++++++++++++---- .../fighters/systems/actions/attack.lua | 17 +++++++ .../fighters/systems/actions/defend.lua | 17 +++++++ .../fighters/systems/actions/flee.lua | 17 +++++++ .../fighters/systems/actions/init.lua | 9 ++++ .../fighters/systems/actions/parent.lua | 40 ++++++++++++++++ .../scenes/battlesystem/menu.lua | 19 +------- 7 files changed, 139 insertions(+), 26 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/defend.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/flee.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 68d76f7..dc8d964 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -3,6 +3,7 @@ local HeroFighter = FighterParent:extend() local StatusBar = require "scenes.battlesystem.gui.statusbar" local SelectionSystem = require "scenes.battlesystem.controllers.fighters.systems.selection" +local actionList = require "scenes.battlesystem.controllers.fighters.systems.actions" local POSITIONS = {3, 1, 5} local HEROES_LINE = 3; @@ -13,15 +14,19 @@ function HeroFighter:new(owner, character, id) self.statusbar = StatusBar(self) - self.currentAction = "" - self.actionArgument = "" - self.target = nil + self.action = nil self.selection = nil end function HeroFighter:updateAssets(dt) self.statusbar:update(dt) + + if (self.action ~= nil) then + if (self.action.isStarted) then + self.action:update(dt) + end + end end function HeroFighter:update(dt) @@ -41,9 +46,7 @@ end function HeroFighter:startAction() core.debug:print("cbs/heroFighter", "launching the action menu") - self.currentAction = "" - self.actionArgument = "" - self.target = nil + self.action = nil self.turnSystem.scene.menu:set( self ) end @@ -56,14 +59,35 @@ function HeroFighter:doNothing() self:setInactive() end +function HeroFighter:doBasicAction(action) + self.action = actionList[action](self) + self:verifyTargets() +end + +function HeroFighter:verifyTargets() + local needTarget, targetEnnemies = self.action:needTarget() + + if (needTarget) then + if (targetEnnemies) then + self.selection = SelectionSystem(self, self.owner.turnSystem.ennemies) + else + self.selection = SelectionSystem(self, self.owner) + end + else + self.action:start() + end + +end + function HeroFighter:attack() - self.currentAction = "attack" - self.selection = SelectionSystem(self, self.owner.turnSystem.ennemies) + self:doBasicAction("attack") end function HeroFighter:receiveTarget(target) self.selection = nil - self:setInactive() + if (self.action ~= nil) then + self.action:start() + end end function HeroFighter:goBackToMenu() @@ -71,6 +95,10 @@ function HeroFighter:goBackToMenu() self.selection = nil end +function HeroFighter:finishAction() + self:setInactive() +end + -- DRAW FUNCTIONS function HeroFighter:drawIcon(x, y) local iconID = 1 diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua new file mode 100644 index 0000000..84e83aa --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua @@ -0,0 +1,17 @@ +local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.actions.parent" +local AttackAction = ActionParent:extend() + +function AttackAction:new(fighter) + AttackAction.super.new(self, fighter) +end + +function AttackAction:needTarget() + return true, true +end + +function AttackAction:startAction() + core.debug:print("cbs/action", "Starting attack action") + self:finishAction() +end + +return AttackAction diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/defend.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/defend.lua new file mode 100644 index 0000000..10597b9 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/defend.lua @@ -0,0 +1,17 @@ +local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.actions.parent" +local DefendAction = ActionParent:extend() + +function DefendAction:new(fighter) + DefendAction.super.new(self, fighter) +end + +function DefendAction:needTarget() + return false, false +end + +function DefendAction:startAction() + core.debug:print("cbs/action", "Starting defend action") + self:finishAction() +end + +return DefendAction diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/flee.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/flee.lua new file mode 100644 index 0000000..def62b6 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/flee.lua @@ -0,0 +1,17 @@ +local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.actions.parent" +local FleeAction = ActionParent:extend() + +function FleeAction:new(fighter) + FleeAction.super.new(self, fighter) +end + +function FleeAction:needTarget() + return false, false +end + +function FleeAction:startAction() + core.debug:print("cbs/action", "Starting flee action") + self:finishAction() +end + +return FleeAction diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua new file mode 100644 index 0000000..daa2ac7 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua @@ -0,0 +1,9 @@ +local actions = {} + +actions.attack = require "scenes.battlesystem.controllers.fighters.systems.actions.attack" +--actions.skill = require "scenes.battlesystem.controllers.fighters.systems.actions.skill" +--actions.item = require "scenes.battlesystem.controllers.fighters.systems.actions.item" +actions.defend = require "scenes.battlesystem.controllers.fighters.systems.actions.defend" +actions.flee = require "scenes.battlesystem.controllers.fighters.systems.actions.flee" + +return actions diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua new file mode 100644 index 0000000..f802e25 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua @@ -0,0 +1,40 @@ +local ActionParent = Object:extend() + +function ActionParent:new(fighter) + self.fighter = fighter + self.target = nil + self.choregraphy = nil + + self.isStarted = false +end + +function ActionParent:update(dt) + if (self.choregraphy ~= nil) then + self.choregraphy:update(dt) + end +end + +function ActionParent:needTarget() + -- needTarget, targetEnnemies + return false, false +end + +function ActionParent:setTarget(target) + self.target = target +end + +function ActionParent:start() + self.isStarted = true + self:startAction() +end + +function ActionParent:startAction() + + self:finishAction() +end + +function ActionParent:finishAction() + self.fighter:finishAction() +end + +return ActionParent diff --git a/sonic-radiance.love/scenes/battlesystem/menu.lua b/sonic-radiance.love/scenes/battlesystem/menu.lua index cea0beb..44ebe20 100644 --- a/sonic-radiance.love/scenes/battlesystem/menu.lua +++ b/sonic-radiance.love/scenes/battlesystem/menu.lua @@ -10,8 +10,6 @@ local SubMenuWidget = BattleWidget:extend() local BackMenuWidget = BattleWidget:extend() local SkillWidget = BattleWidget:extend() -local AttackWidget = ActionWidget:extend() - local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 32, 32, 110 local MENU_WIDTH, MENU_ITEM_HEIGHT = 148, 17 local MENU_ITEM_NUMBER = 6 @@ -40,7 +38,7 @@ end function MenuConstructor:buildBaseMenu(character) CharacterMenu(self.scene, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y) - AttackWidget(character, "BaseMenu") + ActionWidget(character, "BaseMenu", "attack") SubMenuWidget(character, "BaseMenu", "skills", "SkillMenu") SubMenuWidget(character, "BaseMenu", "objects", "ObjectMenu") ActionWidget(character, "BaseMenu", "defend") @@ -221,22 +219,9 @@ function ActionWidget:new(character, menu_name, action) end function ActionWidget:sendCharacterData() - self.character:doNothing() + self.character:doBasicAction(self.actionType) end --- AttackWidget --- The basic action widget - -function AttackWidget:new(character, menu_name) - self.actionType = "attack" - ActionWidget.super.new(self, character, menu_name, "attack", "") -end - -function AttackWidget:sendCharacterData() - self.character:attack() -end - - -- SubMenuWidget -- A simple widget to change menu From fcdd10484f1dd06d1b4ed0e68462cbb684b12619 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 20 Jul 2020 12:24:26 +0200 Subject: [PATCH 18/68] feat: add basic skill actions --- .../datas/gamedata/skills/attack.lua | 6 ++---- .../datas/gamedata/skills/spinattack.lua | 4 ++-- .../datas/gamedata/skills/spinjump.lua | 14 ++++---------- .../controllers/fighters/character.lua | 10 ++++++++++ .../fighters/systems/actions/init.lua | 4 ++-- .../fighters/systems/actions/item.lua | 17 +++++++++++++++++ .../fighters/systems/actions/skill.lua | 18 ++++++++++++++++++ .../scenes/battlesystem/menu.lua | 3 +-- 8 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/item.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index 021eee9..439cec8 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -8,10 +8,8 @@ return { cost = 00, -- the pp cost of the attack. Will be ignored if it's set -- as character default attack - target = nil, -- which area can be selected as a target with the cursor. - -- if not nil : {ox, oy, shape, size, affectedByDirection} - - targetNumber = 1, -- how many ennemy you can target with the attack. + needTarget = true, + targetNumber = 1, -- 0 for targeting all ennemies effectArea = {1, 0, "point", 1, true}, -- which area is affected by the attack -- if not nil : {ox, oy, shape, size, affectedByDirection} diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index f70ae50..441500d 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -1,8 +1,8 @@ return { name = "spinattack", cost = 05, - target = nil, -- No targeting capacity - effectArea = {0, 0, "line", 5, true}, -- which area is affected by the attack + targetNumber = 1, -- 0 for targeting all ennemies + targetEnnemies = true, choregraphy = { {"setAnimation", "none", "spindash", false}, {'playSFX', "none", 'spincharge'}, diff --git a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua index e0518cd..2389708 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua @@ -4,17 +4,11 @@ -- Also serve as a tutoriel for how to create a file attack and choregraphy return { - name = "spinjump", -- unused for this attack, but still usefull sometimes - cost = 03, -- the pp cost of the attack. Will be ignored if it's set - -- as character default attack + name = "spinjump", + cost = 03, - target = {2, -1, "square", 3, true}, -- which area can be selected as a target with the cursor. - -- if not nil : {ox, oy, shape, size, affectedByDirection} - - targetNumber = 1, -- how many ennemy you can target with the attack. - - effectArea = {1, 0, "point", 1, true}, -- which area is affected by the attack - -- if not nil : {ox, oy, shape, size, affectedByDirection} + targetNumber = 1, -- 0 for targeting all ennemies + targetEnnemies = true, choregraphy = { -- the main attack choregraphy {"setAnimation", "none", "spinjump", false}, diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index dc8d964..ce7616b 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -64,6 +64,16 @@ function HeroFighter:doBasicAction(action) self:verifyTargets() end +function HeroFighter:useItem(item) + self.action = actionList["item"](self, item) + self:verifyTargets() +end + +function HeroFighter:useSkill(skill) + self.action = actionList["skill"](self, skill) + self:verifyTargets() +end + function HeroFighter:verifyTargets() local needTarget, targetEnnemies = self.action:needTarget() diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua index daa2ac7..1bc71ec 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/init.lua @@ -1,8 +1,8 @@ local actions = {} actions.attack = require "scenes.battlesystem.controllers.fighters.systems.actions.attack" ---actions.skill = require "scenes.battlesystem.controllers.fighters.systems.actions.skill" ---actions.item = require "scenes.battlesystem.controllers.fighters.systems.actions.item" +actions.skill = require "scenes.battlesystem.controllers.fighters.systems.actions.skill" +actions.item = require "scenes.battlesystem.controllers.fighters.systems.actions.item" actions.defend = require "scenes.battlesystem.controllers.fighters.systems.actions.defend" actions.flee = require "scenes.battlesystem.controllers.fighters.systems.actions.flee" diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/item.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/item.lua new file mode 100644 index 0000000..bd6f7dc --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/item.lua @@ -0,0 +1,17 @@ +local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.actions.parent" +local ItemAction = ActionParent:extend() + +function ItemAction:new(fighter, item) + ItemAction.super.new(self, fighter) +end + +function ItemAction:needTarget() + return false, false +end + +function ItemAction:startAction() + core.debug:print("cbs/action", "Starting flee action") + self:finishAction() +end + +return ItemAction diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua new file mode 100644 index 0000000..5cbfce8 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua @@ -0,0 +1,18 @@ +local ActionParent = require "scenes.battlesystem.controllers.fighters.systems.actions.parent" +local SkillAction = ActionParent:extend() + +function SkillAction:new(fighter, skill) + self.data = game.skills:getSkillData(skill) + SkillAction.super.new(self, fighter) +end + +function SkillAction:needTarget() + return (self.data.targetNumber == 1), self.data.targetEnnemies +end + +function SkillAction:startAction() + core.debug:print("cbs/action", "Starting flee action") + self:finishAction() +end + +return SkillAction diff --git a/sonic-radiance.love/scenes/battlesystem/menu.lua b/sonic-radiance.love/scenes/battlesystem/menu.lua index 44ebe20..21b0996 100644 --- a/sonic-radiance.love/scenes/battlesystem/menu.lua +++ b/sonic-radiance.love/scenes/battlesystem/menu.lua @@ -276,8 +276,7 @@ function SkillWidget:sendCharacterData() if self.skilldata ~= nil then self.assets.sfx["mSelect"]:play() - self.character:doNothing() - --self.character:useSkill(self.skillname, self.character.x, self.character.y) + self.character:useSkill(self.skillname) else core.debug:warning("cbs/menu", "skill " .. self.skillname .. " doesn't exist") self.character:doNothing() From 55d66eef85de8b698d0c03b9a61cce52c6cd1ff9 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:12:37 +0200 Subject: [PATCH 19/68] feat: add bases for the new choregraphy system --- .../game/utils/choregraphy/arguments.lua | 12 +++++ .../game/utils/choregraphy/init.lua | 45 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 sonic-radiance.love/game/utils/choregraphy/arguments.lua create mode 100644 sonic-radiance.love/game/utils/choregraphy/init.lua diff --git a/sonic-radiance.love/game/utils/choregraphy/arguments.lua b/sonic-radiance.love/game/utils/choregraphy/arguments.lua new file mode 100644 index 0000000..0adabd0 --- /dev/null +++ b/sonic-radiance.love/game/utils/choregraphy/arguments.lua @@ -0,0 +1,12 @@ +return { + ["wait"] = {"duration"}, + ["addGFX"] = {'sprite', "origin", "x", "y", "affectedByDirection", 'blockProcess'}, + ["playSFX"] = {"sfx"}, + ["sendDamage"] = {"power", "accuracy", "isSpecial", "isAerial"}, + ["goTo"] = {"origin", "x", "y", "duration", "blockProcess"}, + ["setAnimation"] = {"animation", "blockProcess"}, + ["jump"] = {"power", "blockProcess"}, + ["jumpTo"] = {"origin", "x", "y", "duration", "blockProcess"}, + ["jumpBack"] = {"duration", "blockProcess"}, + --[name] = {args}, +} diff --git a/sonic-radiance.love/game/utils/choregraphy/init.lua b/sonic-radiance.love/game/utils/choregraphy/init.lua new file mode 100644 index 0000000..5aa85a0 --- /dev/null +++ b/sonic-radiance.love/game/utils/choregraphy/init.lua @@ -0,0 +1,45 @@ +ChoregraphyUtils = {} + +function ChoregraphyUtils.getStepStructure(stepName) + local stepTypeList = require "game.utils.choregraphy.arguments" + return stepTypeList[stepName] +end + +function ChoregraphyUtils.stepExists(stepName) + return (ChoregraphyUtils.getStepStructure(stepName) ~= nil) +end + +function ChoregraphyUtils.validate(stepBaseDatas) + local structure = ChoregraphyUtils.getStepStructure(stepBaseDatas[1]) + if (structure == nil) then + return false + else + return ((#structure + 2) == #stepBaseDatas) + end +end + +function ChoregraphyUtils.getStepDatas(stepBaseDatas) + + local stepData = {} + stepData.name = stepBaseDatas[1] + + if (ChoregraphyUtils.validate(stepBaseDatas)) then + stepData.condition = stepBaseDatas[2] + + local structure = ChoregraphyUtils.getStepStructure(stepData.name) + + stepData.arguments = {} + + for i, argumentName in ipairs(structure) do + local argumentContent = stepBaseDatas[i + 2] + stepData.arguments[argumentName] = argumentContent + end + + return stepData + else + error("L'étape " .. stepData.name .. " à un nbr d'argument incorrect") + end + +end + +return ChoregraphyUtils From 070d23076bd7d63a6c709a18b78b3155c7cac43b Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:13:08 +0200 Subject: [PATCH 20/68] feat: adapt skill to the new Choregraphy System --- sonic-radiance.love/datas/gamedata/skills/attack.lua | 12 ++++++------ .../datas/gamedata/skills/spinattack.lua | 8 ++++---- .../datas/gamedata/skills/spinjump.lua | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index 439cec8..c9c6e3a 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -11,31 +11,31 @@ return { needTarget = true, targetNumber = 1, -- 0 for targeting all ennemies - effectArea = {1, 0, "point", 1, true}, -- which area is affected by the attack - -- if not nil : {ox, oy, shape, size, affectedByDirection} - choregraphy = { -- the main attack choregraphy + --{'goTo', "none", "target", 0, 0} {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit1start', true}, {'sendDamage', "none", 33, 100, false, false}, - {'addGFX',"sentDamage", 'hitGFX', 0.75, 0, true, false}, + {'addGFX',"sentDamage", 'hitGFX', "target", 0.75, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit1end', true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit2start', true}, {'sendDamage', "none", 33, 100, false, false}, - {'addGFX',"sentDamage", 'hitGFX', 0.75, 0, true, false}, + {'addGFX',"sentDamage", 'hitGFX', "target", 0.75, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit2end', true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit3start', true}, {'sendDamage', "none", 33, 100, false, false}, - {'addGFX',"sentDamage", 'hitGFX', 0.75, 0, true, false}, + {'addGFX',"sentDamage", 'hitGFX', "target", 0.75, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit3end', true}, {'setAnimation', "none", 'idle', false}, + --{'wait', "none", 0.2}, + --{'goTo', "none", "start", 0, 0}, {'wait', "none", 0.5} }, diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index 441500d..0711b6f 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -9,11 +9,11 @@ return { {"wait", "none", 0.5}, {"setAnimation", "none", "spin", false}, {'playSFX', "none", 'spinrelease'}, - {"dashForward", "none", 12, true}, - {"sendDamageFromPos", "none", 0, 0, 120, 100, false, false, true}, - {'addGFX', "sentDamage", 'hitGFX', 0, 0, true, false}, + {"goTo", "none", "target", 0, 0, 0.3, true}, + {"sendDamage", "none", 120, 100, false, false}, + {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, - {'jumpBack', "none", true}, + {'jumpBack', "none", 0.1, true}, {'setAnimation', "none", 'idle', false}, } } diff --git a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua index 2389708..b897a8c 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua @@ -13,11 +13,11 @@ return { choregraphy = { -- the main attack choregraphy {"setAnimation", "none", "spinjump", false}, {'playSFX', "none", 'jump'}, - {'jumpToCursor', 'none', true}, - {"sendDamageFromCursor", "none", 0, 0, 110, 100, false, true, true}, - {'addGFX', "sentDamage", 'hitGFX', 0, 0, true, false}, + {'jumpTo', 'none', "target", 0.5, 0, 0, true}, + {"sendDamage", "none", 110, 100, false, true}, + {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, - {'jumpBack', "none", true}, + {'jumpBack', "none", 0.1, true}, {'setAnimation', "none", 'idle', false}, }, From 2085b9df2cc594d5e49ebffe2d29fc63464a82bf Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:13:46 +0200 Subject: [PATCH 21/68] feat: add some doc to the steps --- .../game/utils/choregraphy/arguments.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sonic-radiance.love/game/utils/choregraphy/arguments.lua b/sonic-radiance.love/game/utils/choregraphy/arguments.lua index 0adabd0..c0eb5ed 100644 --- a/sonic-radiance.love/game/utils/choregraphy/arguments.lua +++ b/sonic-radiance.love/game/utils/choregraphy/arguments.lua @@ -10,3 +10,13 @@ return { ["jumpBack"] = {"duration", "blockProcess"}, --[name] = {args}, } + +-- The "origin" argument can have the different values +-- - "target" : the action target. if there is multiple target, it'll +-- be equal to the middle of the ennemy line +-- +-- - "self" : the fighter's actor position +-- +-- - "start" : the fighter's starting position +-- +-- - "absolute" : the 0,0 coordinates From a5ec563480c50a0f3468c40fd717e73acf122b0a Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:16:33 +0200 Subject: [PATCH 22/68] feat: initial version of the new choregraphy system --- .../fighters/systems/choregraphy/init.lua | 46 +++++++++++++++++++ .../systems/choregraphy/step/parent.lua | 16 +++++++ 2 files changed, 62 insertions(+) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua new file mode 100644 index 0000000..b1e8006 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -0,0 +1,46 @@ +local ChoregraphySystem = Object:extend() + +local choregraphyUtils = require "game.utils.choregraphy" + +function ChoregraphySystem:new(action, choregraphy) + self.action = action + self.fighter = action.fighter + self.actor = self.fighter.actor + + self.currentStepId = 0 + self.currentStep = nil + self.stepList = choregraphy +end + +function ChoregraphySystem:update(dt) + if (self.currentStep ~= nil) then + self.currentStep:update(dt) + else + self:switchStep() + end +end + +function ChoregraphySystem:switchStep() + if self:haveNextStep() then + self.currentStepId = self.currentStepId + 1 + local stepData = choregraphyUtils.getStepDatas(self.stepList[self.currentStepId]) + core.debug:print("cbs/choregraphy", "Starting step " .. stepData.name) + --self.currentStep = self.stepList[self.currentStepId] + else + self:endChoregraphy() + end +end + +function ChoregraphySystem:endStep() + self.currentStep = nil +end + +function ChoregraphySystem:endChoregraphy() + self.action:choregraphyEnded() +end + +function ChoregraphySystem:haveNextStep() + return ((self.currentStepId + 1) <= #self.stepList) +end + +return ChoregraphySystem diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua new file mode 100644 index 0000000..5694e3f --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua @@ -0,0 +1,16 @@ +local StepParent = Object:extend() + +function StepParent:new(choregraphySystem, name, arguments) + self.name = name + self.choregraphy = choregraphySystem + self.arguments = arguments + self.isStarted = false +end + +function StepParent:update(dt) + if (not self.isStarted) then + self:startStep() + end +end + +return StepParent From 2e38b31deac88ddb2423dcfbfcdcc6e372d9b0cb Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:20:48 +0200 Subject: [PATCH 23/68] feat: hook up the choregraphy system to the actions --- .../fighters/systems/actions/attack.lua | 2 +- .../fighters/systems/actions/parent.lua | 15 +++++++++++++++ .../fighters/systems/actions/skill.lua | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua index 84e83aa..7697633 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/attack.lua @@ -11,7 +11,7 @@ end function AttackAction:startAction() core.debug:print("cbs/action", "Starting attack action") - self:finishAction() + self:loadChoregraphy("attack") end return AttackAction diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua index f802e25..b21080f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua @@ -1,5 +1,7 @@ local ActionParent = Object:extend() +local ChoregraphySystem = require "scenes.battlesystem.controllers.fighters.systems.choregraphy" + function ActionParent:new(fighter) self.fighter = fighter self.target = nil @@ -14,6 +16,15 @@ function ActionParent:update(dt) end end +function ActionParent:loadChoregraphy(skillname) + local skill = game.skills:getSkillData(skillname) + self.choregraphy = ChoregraphySystem(self, skill.choregraphy) +end + +function ActionParent:loadChoregraphyFromSkill(skill) + self.choregraphy = ChoregraphySystem(self, skill.choregraphy) +end + function ActionParent:needTarget() -- needTarget, targetEnnemies return false, false @@ -28,6 +39,10 @@ function ActionParent:start() self:startAction() end +function ActionParent:choregraphyEnded() + self:finishAction() +end + function ActionParent:startAction() self:finishAction() diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua index 5cbfce8..76a05c1 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/skill.lua @@ -12,7 +12,7 @@ end function SkillAction:startAction() core.debug:print("cbs/action", "Starting flee action") - self:finishAction() + self:loadChoregraphyFromSkill(self.data) end return SkillAction From bf23dd2056d55f3daf2ffa9a80ddba304a41b581 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:49:24 +0200 Subject: [PATCH 24/68] chore: extract hp management from actor --- .../game/abstractmobs/parent.lua | 23 ++++++++++++++++++ .../scenes/battlesystem/actors/ennemy.lua | 24 +------------------ .../scenes/battlesystem/actors/hero.lua | 23 ------------------ .../controllers/fighters/character.lua | 11 +++++++++ .../controllers/fighters/parent.lua | 23 +++++++++++++++++- .../controllers/fighters/villain.lua | 6 +++++ .../scenes/battlesystem/gui/statusbar.lua | 4 ++-- 7 files changed, 65 insertions(+), 49 deletions(-) diff --git a/sonic-radiance.love/game/abstractmobs/parent.lua b/sonic-radiance.love/game/abstractmobs/parent.lua index 4d64fa1..61c2e0a 100644 --- a/sonic-radiance.love/game/abstractmobs/parent.lua +++ b/sonic-radiance.love/game/abstractmobs/parent.lua @@ -32,12 +32,35 @@ function AbstractMobParent:createSkills() return {} end +-- LIFE FUNCTIONS +-- Handle HP and stuff like that + function AbstractMobParent:initLife() self.hp = self.stats.hpmax self.pp = self.stats.ppmax self.status = 0 end +function AbstractMobParent:setHP(newHP, relative) + if (relative) then + self.hp = self.hp + newHP + else + self.hp = newHP + end +end + +function AbstractMobParent:setPP(newPP, relative) + if (relative) then + self.pp = self.pp + newPP + else + self.pp = newPP + end +end + +function AbstractMobParent:isAlive() + return (self.hp > 0) +end + function AbstractMobParent:getStats() return self.stats end diff --git a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua index 742767a..cd30f60 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua @@ -9,12 +9,6 @@ function Ennemy:new(world, x, y, owner) self.owner = owner self.actionPerTurn = 2 - - self:receiveDatas() - self.hp = self.data.stats.hpmax - self.pp = self.data.stats.ppmax - - self.shownHP = self.hp end function Ennemy:draw() @@ -24,29 +18,13 @@ function Ennemy:draw() love.graphics.setColor(1, 1, 1, 1) self.owner:drawHUD(x - 14, y - 38) - + if (self.isSelected) then local height = 32 self.assets.images["cursorpeak"]:draw(x - 7, y - 24 - 32) end end -function Ennemy:receiveDatas() - self.data = game.ennemies:getEnnemyData(self.owner.name) -end - -function Ennemy:setHP(value, relative) - if (relative) then - value = self.hp + value - end - - self.hp = value - self.tweens:newTween(0, 0.1, {shownHP = self.hp}, 'inCubic') - if (self.hp <= 0) then - self:destroy() - end -end - function Ennemy:getStats() return self.data.stats end diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 6133202..d81e195 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -37,29 +37,6 @@ function Hero:initCharacter(charid) self.turnAction = nil end -function Hero:getStats() - return game.characters.list[self.owner.name].stats -end - -function Hero:setHP(value, relative) - if relative == true then - value = game.characters.list[self.owner.name].stats.hp + value - end - - game.characters.list[self.owner.name].stats.hp = value - --self.statusbar:updateHP() -end - -function Hero:setPP(value, relative) - if relative == true then - value = game.characters.list[self.owner.name].stats.pp + value - end - - game.characters.list[self.owner.name].stats.pp = value - --self.statusbar:updatePP() -end - - -- ACTIVITY FUNCTION -- Function to set or unset activity to the character diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index ce7616b..39c5bcc 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -109,6 +109,17 @@ function HeroFighter:finishAction() self:setInactive() end +-- LIFE functions +function HeroFighter:setHP(value, relative) + HeroFighter.super.setHP(self, value, relative) + self.statusbar:updateHP() +end + +function HeroFighter:setPP(value, relative) + HeroFighter.super.setPP(self, value, relative) + self.statusbar:updatePP() +end + -- DRAW FUNCTIONS function HeroFighter:drawIcon(x, y) local iconID = 1 diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua index 6489a4d..1e7bb52 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua @@ -17,6 +17,27 @@ function FighterParent:new(owner, isHero, id) self.actor = self:createActor() self.isActive = false + self.isAlive = true +end + +-- LIFE handling functions + +function FighterParent:setHP(value, relative) + self.abstract:setHP(value, relative) +end + +function FighterParent:setPP(value, relative) + self.abstract:setPP(value, relative) +end + +function FighterParent:applyDeath() + if (self.hp <= 0 and self.isAlive) then + self:die() + end +end + +function FighterParent:die() + self.isAlive = false end function FighterParent:getAbstract() @@ -75,7 +96,7 @@ function FighterParent:getNonUniqueIdentificator() end function FighterParent:canFight() - return true + return self.isAlive end -- DRAW FUNCTIONS diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua index c8a9c6b..3fa98cc 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua @@ -35,6 +35,12 @@ function VillainFighter:endAction() end +-- LIFE FUNCTIONS +function VillainFighter:setHP(value, relative) + VillainFighter.super.setHP(self, value, relative) + self.hpbar:setHP(self.abstract.hp) +end + -- DRAW FUNCTIONS function VillainFighter:drawIcon(x, y) love.graphics.setColor(1, 0, 0, 1) diff --git a/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua b/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua index 9dd45ea..c7a3dbf 100644 --- a/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua +++ b/sonic-radiance.love/scenes/battlesystem/gui/statusbar.lua @@ -26,11 +26,11 @@ function StatusBar:update(dt) end function StatusBar:updateHP() - self.tweens:newTween(0, 0.3, {hp = game.characters.list[self.charid].stats.hp}, 'linear') + self.tweens:newTween(0, 0.3, {hp = self.abstract.hp}, 'linear') end function StatusBar:updatePP() - self.tweens:newTween(0, 0.3, {pp = game.characters.list[self.charid].stats.pp}, 'linear') + self.tweens:newTween(0, 0.3, {pp = self.abstract.pp}, 'linear') end function StatusBar:drawEmblem(x, y) From 799a5325234872c34cfcc80a9ad11a5ffd0fa808 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 19:55:11 +0200 Subject: [PATCH 25/68] chore: extract voice system from actor --- .../scenes/battlesystem/actors/hero.lua | 20 ------------------- .../controllers/fighters/character.lua | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index d81e195..5bcb8b0 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -20,8 +20,6 @@ function Hero:new(world, x, y, owner, charnumber) self:initSprite() self:initChoregraphySystem() - self:initVoices() - self.side = "heroes" end @@ -53,8 +51,6 @@ function Hero:setActive() self.world.cursor:set(self.startx, self.starty, "cursorMove") - --self:talk("turnstart") - self.directionPrevious = self.direction end @@ -343,22 +339,6 @@ function Hero:animationEnded(animation) end end -function Hero:initVoices() - self:addVoiceEffect("move") - self:addVoiceEffect("turnstart") -end - -function Hero:addVoiceEffect(name) - local completename = self.owner.name .. "_" .. name - local path = "datas/gamedata/characters/" .. self.owner.name .. "/voices/" .. name .. ".wav" - self.assets:newSFX(completename, path) -end - -function Hero:talk(name) - local completename = self.owner.name .. "_" .. name - self.assets.sfx[completename]:play() -end - -- DRAW FUNCTIONS -- Draw everything related to the hero diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 39c5bcc..d2a4c00 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -13,6 +13,7 @@ function HeroFighter:new(owner, character, id) self.super.new(self, owner, true, id) self.statusbar = StatusBar(self) + self:initVoices() self.action = nil @@ -47,6 +48,7 @@ end function HeroFighter:startAction() core.debug:print("cbs/heroFighter", "launching the action menu") self.action = nil + self:talk("turnstart") self.turnSystem.scene.menu:set( self ) end @@ -120,6 +122,24 @@ function HeroFighter:setPP(value, relative) self.statusbar:updatePP() end +-- VOICE SYSTEM + +function HeroFighter:initVoices() + self:addVoiceEffect("move") + self:addVoiceEffect("turnstart") +end + +function HeroFighter:addVoiceEffect(name) + local completename = self.name .. "_" .. name + local path = "datas/gamedata/characters/" .. self.name .. "/voices/" .. name .. ".wav" + self.assets:newSFX(completename, path) +end + +function HeroFighter:talk(name) + local completename = self.name .. "_" .. name + self.assets.sfx[completename]:play() +end + -- DRAW FUNCTIONS function HeroFighter:drawIcon(x, y) local iconID = 1 From bb3d82340419814bb4c9c3942466edc5d7d16a17 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 20:04:12 +0200 Subject: [PATCH 26/68] chore(cbs/heroactor): first round of dead code cleanup --- .../scenes/battlesystem/actors/hero.lua | 60 ------------------- 1 file changed, 60 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 5bcb8b0..cd3b173 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -1,8 +1,6 @@ local Battler = require("scenes.battlesystem.actors.battler") local Hero = Battler:extend() -local gui = require "game.modules.gui" - local ChoregraphySystem = require "scenes.battlesystem.actors.systems.choregraphy" -- INIT FUNCTIONS @@ -15,67 +13,25 @@ function Hero:new(world, x, y, owner, charnumber) self:initMovementSystem() - --self:initCharacter(charid) - self:initSprite() self:initChoregraphySystem() self.side = "heroes" end --- CHARACTER FUNCTIONS --- All functions related to character handling - -function Hero:initCharacter(charid) - if charid == nil then - core.debug:error("FATAL ERROR: charid not set") - end - self.owner.name = charid - - self.turnAction = nil -end - --- ACTIVITY FUNCTION --- Function to set or unset activity to the character - -function Hero:setActive() - core.debug:print("cbs/hero", "hero " .. self.owner.name .. " is now active") - local gridsize = game.characters.list[self.owner.name].move - if (gridsize == nil) then - gridsize = 3 - core.debug:warning("cbs/character", "move value is nil") - end - self.world.cursor:setGrid(self.x, self.y, "circle", gridsize, 1, self) - self.x, self.y = utils.math.round(self.x), utils.math.round(self.y) - self.startx, self.starty = self.x, self.y - - self.world.cursor:set(self.startx, self.starty, "cursorMove") - - self.directionPrevious = self.direction -end - -- UPDATE FUNCTION -- Update the hero function Hero:update(dt) Hero.super.update(self, dt) - -- Get keys to have some keyboard functions - self.keys = self.scene:getKeys(1) - -- Calculate speed to calculate animation speed self:updateSpeed(dt) self:updateChoregraphy(dt) - if (self.scene:haveMenus()) then - self:changeDirection(dt) - end - self.xprevious = self.x self.yprevious = self.y self.zprevious = self.z - - --self.statusbar:update(dt) end -- MOVE FUNCTIONS @@ -153,15 +109,6 @@ function Hero:updateSpeed(dt) self:setCustomSpeed(self.gspeed * 320) end -function Hero:changeDirection(dt) - -- Change direction by pressing left or right when selecting the next action - if (self.keys["left"].isPressed) then - self.direction = -1 - elseif (self.keys["right"].isPressed) then - self.direction = 1 - end -end - function Hero:initJump() self.jump = {} self.jump.spin = false @@ -315,13 +262,6 @@ function Hero:unblockChoregraphy() self.blockingChoregraphy = "" end --- INFO FUNCTIONS --- Getting info about the actor - -function Hero:getCharacterData() - return game.characters.list[self.owner.name] -end - -- ASSETS FUNCTIONS -- Load and play assets needed by the character From eec4ef060b422796d8f8086381ec0b543d366aa5 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 24 Jul 2020 21:54:12 +0200 Subject: [PATCH 27/68] feat(cbs/choregraphy): add some basic steps --- .../scenes/battlesystem/actors/parent.lua | 7 +++++ .../controllers/fighters/character.lua | 1 + .../fighters/systems/choregraphy/init.lua | 9 ++++-- .../systems/choregraphy/step/addGFX.lua | 29 +++++++++++++++++++ .../systems/choregraphy/step/init.lua | 14 +++++++++ .../systems/choregraphy/step/parent.lua | 23 ++++++++++++--- .../systems/choregraphy/step/playSFX.lua | 13 +++++++++ .../systems/choregraphy/step/wait.lua | 19 ++++++++++++ 8 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addGFX.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/playSFX.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/wait.lua diff --git a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua index e2c8110..d2d4775 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/parent.lua @@ -47,6 +47,13 @@ function Parent:update(dt) self.tweens:update(dt) end +-- GET FUNCTIONS +-- Get informations + +function Parent:getCoordinate() + return self.x, self.y +end + -- SPRITE FUNCTIONS -- Handle the character sprite diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index d2a4c00..581bbef 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -98,6 +98,7 @@ end function HeroFighter:receiveTarget(target) self.selection = nil if (self.action ~= nil) then + self.action:setTarget(target) self.action:start() end end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua index b1e8006..a9899a5 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -1,11 +1,14 @@ local ChoregraphySystem = Object:extend() local choregraphyUtils = require "game.utils.choregraphy" +local stepObjectList = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step" function ChoregraphySystem:new(action, choregraphy) self.action = action self.fighter = action.fighter self.actor = self.fighter.actor + self.assets = self.fighter.actor.assets + self.world = self.actor.world self.currentStepId = 0 self.currentStep = nil @@ -14,7 +17,7 @@ end function ChoregraphySystem:update(dt) if (self.currentStep ~= nil) then - self.currentStep:update(dt) + self.currentStep:updateStep(dt) else self:switchStep() end @@ -25,7 +28,9 @@ function ChoregraphySystem:switchStep() self.currentStepId = self.currentStepId + 1 local stepData = choregraphyUtils.getStepDatas(self.stepList[self.currentStepId]) core.debug:print("cbs/choregraphy", "Starting step " .. stepData.name) - --self.currentStep = self.stepList[self.currentStepId] + if (stepObjectList[stepData.name] ~= nil) then + self.currentStep = stepObjectList[stepData.name](self, stepData.arguments) + end else self:endChoregraphy() end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addGFX.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addGFX.lua new file mode 100644 index 0000000..7b70183 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addGFX.lua @@ -0,0 +1,29 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local StepGFX = StepParent:extend() + +function StepGFX:new(controller, args) + StepGFX.super.new(self, controller, args) +end + +function StepGFX:start() + local x, y = self:getStepCoordinate() + + self.choregraphy.world.obj.GFX(self.choregraphy.world, x, y, 0, self.arguments.sprite, self, self.arguments.blockProcess) + + if (not self.arguments.blockProcess) then + self:finish() + end +end + +function StepGFX:update(dt) + +end + +function StepGFX:getSignal(signal) + if (signal == "gfxEnded") then + self:finish() + end +end + + +return StepGFX diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua new file mode 100644 index 0000000..2c8b191 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua @@ -0,0 +1,14 @@ +local actions = {} + +local baseURI = "scenes.battlesystem.controllers.fighters.systems.choregraphy.step." + +actions["addGFX"] = require(baseURI .. "addGFX") +--actions["dashForward"] = require(baseURI .. "dashForward") +--actions["jump"] = require(baseURI .. "jump") +actions["playSFX"] = require(baseURI .. "playSFX") +--actions["sendDamage"] = require(baseURI .. "sendDamage") +--actions["sendDamageToPoint"] = require(baseURI .. "sendDamageToPoint") +--actions["setAnimation"] = require(baseURI .. "setAnimation") +actions["wait"] = require(baseURI .. "wait") + +return actions diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua index 5694e3f..5d56108 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua @@ -1,16 +1,31 @@ local StepParent = Object:extend() -function StepParent:new(choregraphySystem, name, arguments) - self.name = name +function StepParent:new(choregraphySystem, arguments) self.choregraphy = choregraphySystem self.arguments = arguments self.isStarted = false end -function StepParent:update(dt) +function StepParent:updateStep(dt) if (not self.isStarted) then - self:startStep() + self:start() + self.isStarted = true + else + self:update(dt) end end +function StepParent:getStepCoordinate() + if (self.arguments.origin == "target") then + local target = self.choregraphy.action.target + local x, y = target.actor:getCoordinate() + return x + self.arguments.x, y + self.arguments.y + end +end + +function StepParent:finish() + print("action finished") + self.choregraphy:endStep() +end + return StepParent diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/playSFX.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/playSFX.lua new file mode 100644 index 0000000..e5d24ac --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/playSFX.lua @@ -0,0 +1,13 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local PlaySFX = StepParent:extend() + +function PlaySFX:new(system, args) + PlaySFX.super.new(self, system, args) +end + +function PlaySFX:start() + self.choregraphy.assets.sfx[self.arguments.sfx]:play() + self:finish() +end + +return PlaySFX diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/wait.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/wait.lua new file mode 100644 index 0000000..5098318 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/wait.lua @@ -0,0 +1,19 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local WaitStep = StepParent:extend() + +function WaitStep:new(controller, args) + WaitStep.super.new(self, controller, args) +end + +function WaitStep:start() + self.timer = 0 +end + +function WaitStep:update(dt) + self.timer = self.timer + dt + if (self.timer > self.arguments.duration) then + self:finish() + end +end + +return WaitStep; From 4f024dbb395c6f43b1a7ecde71a1bc0c72b0058d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 08:43:15 +0200 Subject: [PATCH 28/68] chore: remove old choregraphy system from heroes' actors --- .../scenes/battlesystem/actors/hero.lua | 118 ++---------------- 1 file changed, 13 insertions(+), 105 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index cd3b173..82b8859 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -14,7 +14,6 @@ function Hero:new(world, x, y, owner, charnumber) self:initMovementSystem() self:initSprite() - self:initChoregraphySystem() self.side = "heroes" end @@ -27,8 +26,6 @@ function Hero:update(dt) -- Calculate speed to calculate animation speed self:updateSpeed(dt) - self:updateChoregraphy(dt) - self.xprevious = self.x self.yprevious = self.y self.zprevious = self.z @@ -152,114 +149,25 @@ function Hero:applyMotion(dt) end end --- SIGNAL FUNCTIONS --- All functions related to signal receiving - -function Hero:receiveSignal(action_type, id) - if id == nil then - core.debug:print("battler/hero", "action selected : " .. action_type) - else - core.debug:print("battler/hero", "action selected : " .. action_type .. " (" .. id .. ")") - end - if (action_type == "defend") then - self.turnAction = "defend" - self:switchActiveBattler( ) - elseif (action_type == "attack") then - --self:changeAnimation("hit1") - self:attack() - elseif (action_type == "skill") then - self.world.cursor:unset( ) - self:useSkill(id, self.world.cursor.x, self.world.cursor.y) - elseif (action_type == "cursorMove") then - if (self.x ~= self.world.cursor.x) or (self.y ~= self.world.cursor.y) then - self:changeAnimation("walk", true) - self:goTo(self.world.cursor.x, self.world.cursor.y, 'cursorMove', 1) - self.assets.sfx["woosh"]:play() - else - self.world:resetActiveGrid() - self.scene.menu:set( self ) - end - self.world.cursor:unset( ) - else - self:switchActiveBattler( ) - end -end - -function Hero:positionSelected(x, y) - self:changeAnimation("walk", true) - self:goTo(self.world.cursor.x, self.world.cursor.y, 'cursorMove', 1) - self.assets.sfx["woosh"]:play() -end - -function Hero:receiveBackSignal() - self.world.cursor:set(self.x, self.y, "cursorMove") - if (self.x ~= self.startx) or (self.y ~= self.starty) then - self.world.cursor:set(self.x, self.y, "cursorMove") - self.assets.sfx["woosh"]:play() - self:changeAnimation("walk") - end -end - -function Hero:timerResponse(timer) - if timer == "switchActiveBattler" then - self.scene.turns:nextAction() - elseif timer == "wait" then - self.choregraphy.changeAction = true - elseif timer == "cursorMove" then - self:changeAnimation("idle") - self.world:resetActiveGrid() - self.scene.menu:set( self ) - elseif timer == 'backMove' then - self:changeAnimation("idle") - self.direction = self.directionPrevious - elseif timer == 'action_jumpBack' then - self.unlockDirection = true - self:unblockChoregraphy() - elseif timer == self.choregraphy.blockedBy then - self:unblockChoregraphy() - end -end - --- ACTION FUNCTIONS --- All functions related to actions - -function Hero:switchActiveBattler() - print("Switching Active Battler") - self.tweens:newTimer(0.15, "switchActiveBattler") -end - -- CHOREGRAPHY FUNCTIONS -- All functions related to the choregraphy system -function Hero:initChoregraphySystem() - self.choregraphy = ChoregraphySystem(self) - self.blockingChoregraphy = nil -end - -function Hero:attack(id, dx, dy) - local skill = game.skills:getSkillData("attack") - self.choregraphy:start(skill, dx, dy) -end - -function Hero:useSkill(id, dx, dy) - local skill = game.skills:getSkillData(id) - self:setPP(skill.cost * -1, true) - self.choregraphy:start(skill, dx, dy) -end - -function Hero:updateChoregraphy(dt) - self.choregraphy:update(dt) -end - -function Hero:blockChoregraphy(isBlocked, blockedBy) - if (isBlocked) then - self.blockingChoregraphy = blockedBy +function Hero:blockChoregraphy(isBlocking, currentlyBlocking, blockedBy) + if (isBlocking) then + self.currentlyBlocking = currentlyBlocking + self.blockedBy = blockedBy end end function Hero:unblockChoregraphy() - self.choregraphy:endAction() - self.blockingChoregraphy = "" + self.currentlyBlocking:finish() + self.currentlyBlocking = nil +end + +function Hero:receiveSignal(signal) + if (self.currentlyBlocking ~= nil) then + self:unblockChoregraphy() + end end -- ASSETS FUNCTIONS @@ -274,7 +182,7 @@ function Hero:initSprite() end function Hero:animationEnded(animation) - if (animation == self.blockingChoregraphy) then + if (self.currentlyBlocking ~= nil and self.blockedBy=="animation") then self:unblockChoregraphy() end end From d69255ead042879a15f03df1bf2708260ca06fe8 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 08:44:03 +0200 Subject: [PATCH 29/68] chore: put the damage handling system inside fighters and not actors --- .../scenes/battlesystem/actors/battler.lua | 37 ------------------- .../controllers/fighters/parent.lua | 30 ++++++++++++++- .../controllers/fighters/villain.lua | 5 +++ .../scenes/battlesystem/controllers/init.lua | 6 +++ .../battlesystem/controllers/parent.lua | 6 +++ 5 files changed, 46 insertions(+), 38 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua index 89913a7..1b045da 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua @@ -14,7 +14,6 @@ end function Battler:destroy() Battler.super.destroy(self) - self.world:destroyBattler(self) end function Battler:setActive() @@ -39,40 +38,4 @@ function Battler:validateAction() end -function Battler:sendDamage(x, y, value, accuracy, isSpecial, isAerial) - local stats = self:getStats() - local value = value / 10 - - if (isSpecial) then - value = value * stats.power - else - value = value * stats.attack - end - core.debug:print("battler", "sending " .. value .." damage at position <" .. x .. ";" .. y .. ">") - - local fromEnnemy = self.isEnnemy - - local other = self.world:getActorInCase(x, y, self) - if (other ~= nil) then - core.debug:print("battler", "sending damage to actor at position <" .. x .. ";" .. y .. ">") - other:receiveDamage(value, accuracy, isSpecial, isAerial, fromWho) - return true - else - return false - end -end - -function Battler:receiveDamage(value, accuracy, isSpecial, isAerial) - local stats = self:getStats() - if (fromEnnemy ~= self.isEnnemy) then - if (isSpecial) then - value = value / stats.mind - else - value = value / stats.defense - end - core.debug:print("battler", "taken " .. value .. " damage" ) - self:setHP(value * -1, true) - end -end - return Battler diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua index 1e7bb52..6399b6b 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/parent.lua @@ -31,7 +31,7 @@ function FighterParent:setPP(value, relative) end function FighterParent:applyDeath() - if (self.hp <= 0 and self.isAlive) then + if (self.abstract.hp <= 0 and self.isAlive) then self:die() end end @@ -40,6 +40,34 @@ function FighterParent:die() self.isAlive = false end +function FighterParent:sendDamage(target, value, accuracy, isSpecial, isAerial) + local stats = self:getStats() + local value = value / 10 + + if (isSpecial) then + value = value * stats.power + else + value = value * stats.attack + end + + core.debug:print("cbs/battler", "Sending " .. value .." damage at " .. target.name) + + target:receiveDamage(value, accuracy, isSpecial, isAerial, fromWho) +end + +function FighterParent:receiveDamage(value, accuracy, isSpecial, isAerial) + local stats = self:getStats() + + if (isSpecial) then + value = value / stats.mind + else + value = value / stats.defense + end + + core.debug:print("cbs/fighter", "Taken " .. value .. " damage" ) + self:setHP(value * -1, true) +end + function FighterParent:getAbstract() return {} end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua index 3fa98cc..a26ad18 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua @@ -35,6 +35,11 @@ function VillainFighter:endAction() end +function FighterParent:die() + self.isAlive = false + self.actor:destroy() +end + -- LIFE FUNCTIONS function VillainFighter:setHP(value, relative) VillainFighter.super.setHP(self, value, relative) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index cfec8b6..a4f48aa 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -90,6 +90,12 @@ function TurnController:removeAllActionsFromFighter(fighterToRemove) end end +function TurnController:applyDeath() + self.ennemies:applyDeath() + self.player:applyDeath() +end + + function TurnController:startAction() core.debug:print("cbs/turns", "Starting action " .. self.turns.current) local nextAction = self.actionList[self.turns.current] diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index b9659fa..198f358 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -18,6 +18,12 @@ function FighterControllerParent:count() return #self.list end +function FighterControllerParent:applyDeath() + for i, fighter in ipairs(self.list) do + fighter:applyDeath() + end +end + function FighterControllerParent:setActive(activeActor) self.activeActor = activeActor activeActor:setActive() From 75914d694de1bb3c4060f9dccca15f9bee0873c5 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 08:44:59 +0200 Subject: [PATCH 30/68] chore: hook up the damage system to the choregraphy system --- .../fighters/systems/choregraphy/init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua index a9899a5..61f3bbf 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -9,6 +9,7 @@ function ChoregraphySystem:new(action, choregraphy) self.actor = self.fighter.actor self.assets = self.fighter.actor.assets self.world = self.actor.world + self.target = action.target self.currentStepId = 0 self.currentStep = nil @@ -36,12 +37,24 @@ function ChoregraphySystem:switchStep() end end +function ChoregraphySystem:sendDamage(power, accuracy, isSpecial, isAerial) + if (self.target ~= nil) then + if (self.fighter.isAlive) then + self.fighter:sendDamage(self.target, power, accuracy, isSpecial, isAerial) + return true + else + return false + end + end +end + function ChoregraphySystem:endStep() self.currentStep = nil end function ChoregraphySystem:endChoregraphy() self.action:choregraphyEnded() + self.fighter.turnSystem:applyDeath() end function ChoregraphySystem:haveNextStep() From 8fe8f61821288ce41bb90baa04241ef0a3a9eb91 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 10:24:07 +0200 Subject: [PATCH 31/68] fix: start simplification of the movement system --- .../scenes/battlesystem/actors/battler.lua | 4 +++ .../scenes/battlesystem/actors/hero.lua | 33 ++++++++----------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua index 1b045da..c7a3f5e 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua @@ -4,6 +4,10 @@ local Battler = Parent:extend() function Battler:new(world, x, y, z) Battler.super.new(self, world, x, y, z) + self.start = {} + self.start.x = x + self.start.y = y + self.isBattler = true self.speed = 3 self.isActive = false diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 82b8859..a06994c 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -47,32 +47,21 @@ function Hero:initMovementSystem() self:initJump() end -function Hero:getMovementDuration(dx, dy, factor) - local factor = factor or 1 - local duration = MOVEMENT_DURATION / factor - local coef = 0.5 - local dx, dy = dx, dy - local distance = utils.math.pointDistance(self.x, self.y, dx, dy) * coef - return duration * distance -end - -function Hero:goTo(dx, dy, timerName, factor, easing) +function Hero:goTo(dx, dy, duration, easing) local easing = easing or 'inOutQuad' - local factor = factor or 1 - local duration = math.max(self:getMovementDuration(dx, dy, factor), 0.30) if duration > 0 then self.tweens:newTween(0, duration, {x = dx, y = dy}, easing) end - self.tweens:newTimer(duration + 0.02, timerName) + self.tweens:newTimer(duration + 0.02, "goTo") end -function Hero:jumpTo(dx, dy, size, timerName, spinjump, factor, easing) +function Hero:jumpTo(dx, dy, sizeFactor, duration, spinjump, easing) local easing = easing or 'inOutQuad' - local factor = factor or 1 - local duration = math.max(self:getMovementDuration(dx, dy, factor), 0.30) + local dist = utils.math.pointDistance(self.x, self.y, dx, dy) + local jumpHeight = dist * 8 * sizeFactor self.tweens:newTween(0, duration, {x = dx, y = dy}, easing) - self.tweens:newTimer(duration + 0.02, timerName) - self:setJump(size, spinjump, duration) + self.tweens:newTimer(duration + 0.02, "jumpTo") + self:setJump(jumpHeight, spinjump, duration) end function Hero:updateSpeed(dt) @@ -164,12 +153,16 @@ function Hero:unblockChoregraphy() self.currentlyBlocking = nil end -function Hero:receiveSignal(signal) - if (self.currentlyBlocking ~= nil) then +function Hero:timerResponse(signal) + if ((self.currentlyBlocking ~= nil) and (signal == self.blockedBy)) then self:unblockChoregraphy() end end +function Hero:choregraphyEnded() + self.direction = 1 +end + -- ASSETS FUNCTIONS -- Load and play assets needed by the character From df6e283013aabf56b5c01a9707e87778e68aab33 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 10:24:32 +0200 Subject: [PATCH 32/68] fix: last missing step currently done --- .../systems/choregraphy/step/goTo.lua | 28 +++++++++++++++++++ .../systems/choregraphy/step/init.lua | 10 +++---- .../systems/choregraphy/step/jumpBack.lua | 28 +++++++++++++++++++ .../systems/choregraphy/step/jumpTo.lua | 28 +++++++++++++++++++ .../systems/choregraphy/step/sendDamage.lua | 22 +++++++++++++++ .../systems/choregraphy/step/setAnimation.lua | 26 +++++++++++++++++ 6 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/goTo.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/setAnimation.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/goTo.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/goTo.lua new file mode 100644 index 0000000..a38c982 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/goTo.lua @@ -0,0 +1,28 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local GoToStep = StepParent:extend() + +function GoToStep:new(controller, args) + GoToStep.super.new(self, controller, args) +end + +function GoToStep:start() + + local x, y = self:getStepCoordinate() + self.choregraphy.actor:goTo(x, y, self.arguments.duration) + + if (self.arguments.blockProcess == false) then + self:finish() + else + self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "goTo") + end +end + +function GoToStep:update(dt) + +end + +function GoToStep:getSignal(signal) + +end + +return GoToStep; diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua index 2c8b191..2d6102b 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua @@ -3,12 +3,12 @@ local actions = {} local baseURI = "scenes.battlesystem.controllers.fighters.systems.choregraphy.step." actions["addGFX"] = require(baseURI .. "addGFX") ---actions["dashForward"] = require(baseURI .. "dashForward") ---actions["jump"] = require(baseURI .. "jump") +actions["goTo"] = require(baseURI .. "goTo") +actions["jumpTo"] = require(baseURI .. "jumpTo") +actions["jumpBack"] = require(baseURI .. "jumpBack") actions["playSFX"] = require(baseURI .. "playSFX") ---actions["sendDamage"] = require(baseURI .. "sendDamage") ---actions["sendDamageToPoint"] = require(baseURI .. "sendDamageToPoint") ---actions["setAnimation"] = require(baseURI .. "setAnimation") +actions["sendDamage"] = require(baseURI .. "sendDamage") +actions["setAnimation"] = require(baseURI .. "setAnimation") actions["wait"] = require(baseURI .. "wait") return actions diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua new file mode 100644 index 0000000..0bf6000 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua @@ -0,0 +1,28 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local JumpBackStep = StepParent:extend() + +function JumpBackStep:new(controller, args) + JumpBackStep.super.new(self, controller, args) +end + +function JumpBackStep:start() + + local x, y = self.choregraphy.actor.start.x, self.choregraphy.actor.start.y + self.choregraphy.actor:jumpTo(x, y, 0.5, self.arguments.duration, false, "outQuad") + + if (self.arguments.blockProcess == false) then + self:finish() + else + self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "jumpTo") + end +end + +function JumpBackStep:update(dt) + +end + +function JumpBackStep:getSignal(signal) + +end + +return JumpBackStep; diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua new file mode 100644 index 0000000..978c2f1 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua @@ -0,0 +1,28 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local JumpToStep = StepParent:extend() + +function JumpToStep:new(controller, args) + JumpToStep.super.new(self, controller, args) +end + +function JumpToStep:start() + + local x, y = self:getStepCoordinate() + self.choregraphy.actor:jumpTo(x, y, 1, self.arguments.duration, true, "inOutQuad") + + if (self.arguments.blockProcess == false) then + self:finish() + else + self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "jumpTo") + end +end + +function JumpToStep:update(dt) + +end + +function JumpToStep:getSignal(signal) + +end + +return JumpToStep; diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua new file mode 100644 index 0000000..92e5548 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua @@ -0,0 +1,22 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local SendDamage = StepParent:extend() + +local maputils = require "scenes.battlesystem.utils" + +function SendDamage:new(system, args) + SendDamage.super.new(self, system, args) +end + +function SendDamage:start() + local power = self.arguments.power + local accuracy = self.arguments.accuracy + local isSpecial = self.arguments.isSpecial + local isAerial = self.arguments.isAerial + + + + self.choregraphy.haveSentDamage = self.choregraphy:sendDamage(power, accuracy, isSpecial, isAerial) + self:finish() +end + +return SendDamage diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/setAnimation.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/setAnimation.lua new file mode 100644 index 0000000..b7982f9 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/setAnimation.lua @@ -0,0 +1,26 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local AnimationSetterStep = StepParent:extend() + +function AnimationSetterStep:new(controller, args) + AnimationSetterStep.super.new(self, controller, args) +end + +function AnimationSetterStep:start() + self.choregraphy.actor:changeAnimation(self.arguments.animation) + + if (self.arguments.blockProcess == false) then + self:finish() + else + self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "animation") + end +end + +function AnimationSetterStep:update(dt) + +end + +function AnimationSetterStep:getSignal(signal) + +end + +return AnimationSetterStep; From 6e012ba46cac924b66c4d1e03633c61047b2d6d1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 10:25:00 +0200 Subject: [PATCH 33/68] fix: replace actor after choregraphy --- .../controllers/fighters/systems/choregraphy/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua index 61f3bbf..47ad32b 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -53,6 +53,7 @@ function ChoregraphySystem:endStep() end function ChoregraphySystem:endChoregraphy() + self.actor:choregraphyEnded() self.action:choregraphyEnded() self.fighter.turnSystem:applyDeath() end From 6a64126db32cd09fe25105d8d6f2c7e45c4ad094 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 10:25:14 +0200 Subject: [PATCH 34/68] fix: improve skills choregraphy --- sonic-radiance.love/datas/gamedata/skills/spinattack.lua | 2 +- sonic-radiance.love/datas/gamedata/skills/spinjump.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index 0711b6f..e1c3656 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -13,7 +13,7 @@ return { {"sendDamage", "none", 120, 100, false, false}, {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, - {'jumpBack', "none", 0.1, true}, + {'jumpBack', "none", 0.3, true}, {'setAnimation', "none", 'idle', false}, } } diff --git a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua index b897a8c..fe79331 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua @@ -13,11 +13,11 @@ return { choregraphy = { -- the main attack choregraphy {"setAnimation", "none", "spinjump", false}, {'playSFX', "none", 'jump'}, - {'jumpTo', 'none', "target", 0.5, 0, 0, true}, + {'jumpTo', 'none', "target", 0, 0, 0.5, true}, {"sendDamage", "none", 110, 100, false, true}, {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, - {'jumpBack', "none", 0.1, true}, + {'jumpBack', "none", 0.3, true}, {'setAnimation', "none", 'idle', false}, }, From 808108c3f335ab39c71019d7f31bbf4471b50948 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 11:18:00 +0200 Subject: [PATCH 35/68] chore: remove the old choregraphy system --- .../actors/systems/actions/addGFX.lua | 36 ------- .../actors/systems/actions/dashForward.lua | 19 ---- .../actors/systems/actions/init.lua | 14 --- .../actors/systems/actions/jump.lua | 40 -------- .../actors/systems/actions/parent.lua | 29 ------ .../actors/systems/actions/playSFX.lua | 14 --- .../actors/systems/actions/sendDamage.lua | 38 -------- .../systems/actions/sendDamageToPoint.lua | 29 ------ .../actors/systems/actions/setAnimation.lua | 24 ----- .../actors/systems/actions/wait.lua | 19 ---- .../actors/systems/choregraphy.lua | 95 ------------------- 11 files changed, 357 deletions(-) delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/addGFX.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/dashForward.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/init.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/jump.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/parent.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/playSFX.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamage.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamageToPoint.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/setAnimation.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/actions/wait.lua delete mode 100644 sonic-radiance.love/scenes/battlesystem/actors/systems/choregraphy.lua diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/addGFX.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/addGFX.lua deleted file mode 100644 index 08f88c9..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/addGFX.lua +++ /dev/null @@ -1,36 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local GFXAction = ChoregraphyActionParent:extend() - -function GFXAction:new(controller, args, effectArea) - GFXAction.super.new(self, controller, args, effectArea) -end - -function GFXAction:start() - local dx = self.args.dx - - if (self.args.affectedByDirection) then - dx = dx * self.actor.direction - end - - local x = self.actor.x - local y = self.actor.y - local z = 0 - - self.actor.world.obj.GFX(self.actor.world, x + dx, y + self.args.dy, z, self.args.sprite, self, self.args.blockProcess) - if (not self.args.blockProcess) then - self:finish() - end -end - -function GFXAction:update(dt) - -end - -function GFXAction:getSignal(signal) - if (signal == "gfxEnded") then - self:finish() - end -end - - -return GFXAction diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/dashForward.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/dashForward.lua deleted file mode 100644 index 02e3918..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/dashForward.lua +++ /dev/null @@ -1,19 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local DashAction = ChoregraphyActionParent:extend() - -function DashAction:new(system, args, effectArea) - DashAction.super.new(self, system, args, effectArea) -end - -function DashAction:start() - self.actor:setMotionX(self.actor.direction, self.args.speed) - self.actor:blockChoregraphy(self.args.blockProcess, "action_dashForward") -end - -function DashAction:getSignal(signal) - if (signal == "actorHaveFinished") then - self:finish() - end -end - -return DashAction; diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/init.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/init.lua deleted file mode 100644 index 4c819f9..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/init.lua +++ /dev/null @@ -1,14 +0,0 @@ -local actions = {} - -local baseURI = "scenes.battlesystem.actors.systems.actions." - -actions["addGFX"] = require(baseURI .. "addGFX") -actions["dashForward"] = require(baseURI .. "dashForward") -actions["jump"] = require(baseURI .. "jump") -actions["playSFX"] = require(baseURI .. "playSFX") -actions["sendDamage"] = require(baseURI .. "sendDamage") -actions["sendDamageToPoint"] = require(baseURI .. "sendDamageToPoint") -actions["setAnimation"] = require(baseURI .. "setAnimation") -actions["wait"] = require(baseURI .. "wait") - -return actions diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/jump.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/jump.lua deleted file mode 100644 index ba8507c..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/jump.lua +++ /dev/null @@ -1,40 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local JumpAction = ChoregraphyActionParent:extend() - -function JumpAction:new(system, args, effectArea) - JumpAction.super.new(self, system, args, effectArea) -end - -function JumpAction:start() - local xx, yy - local spinjump = true - local factor = 1 - local easing = 'inOutQuad' - if self.args.name == "jumpBack" then - xx, yy = self.controller.startx, self.controller.starty - self.actor.directionLocked = true - spinjump = false - factor = 2 - easing = 'outQuad' - elseif self.args.name == "jumpToCursor" then - xx, yy = self.controller.dx, self.controller.dy - end - - local dist = utils.math.pointDistance(self.actor.x, self.actor.y, xx, yy) - local jumpHeight = dist * 16 / factor - - self.actor:jumpTo(xx, yy, jumpHeight, "action_jumpBack", spinjump, 1, easing) - self.actor:blockChoregraphy(self.args.blockProcess, "action_jumpBack") - if (not self.args.blockProcess) then - self:finish() - end -end - -function JumpAction:getSignal(signal) - if (signal == "actorHaveFinished") then - self:finish() - end -end - - -return JumpAction diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/parent.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/parent.lua deleted file mode 100644 index 38ec360..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/parent.lua +++ /dev/null @@ -1,29 +0,0 @@ -local ChoregraphyAction = Object:extend() - -function ChoregraphyAction:new(controller, args, effectArea) - self.controller = controller - self.actor = controller.actor - - self.args = args; - self.effectArea = effectArea; - self:start() -end - -function ChoregraphyAction:start() - self:finish() -end - -function ChoregraphyAction:update(dt) - -end - -function ChoregraphyAction:getSignal(signal) - -end - -function ChoregraphyAction:finish() - print("action finished") - self.controller:endAction() -end - -return ChoregraphyAction; diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/playSFX.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/playSFX.lua deleted file mode 100644 index 8f085b0..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/playSFX.lua +++ /dev/null @@ -1,14 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local PlaySFX = ChoregraphyActionParent:extend() - -function PlaySFX:new(system, args, effectArea) - PlaySFX.super.new(self, system, args, effectArea) -end - -function PlaySFX:start() - self.actor.assets.sfx[self.args.sfx]:play() - self:finish() -end - - -return PlaySFX diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamage.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamage.lua deleted file mode 100644 index 262fbf9..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamage.lua +++ /dev/null @@ -1,38 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local SendDamage = ChoregraphyActionParent:extend() - -local maputils = require "scenes.battlesystem.utils" - -function SendDamage:new(system, args, effectArea) - SendDamage.super.new(self, system, args, effectArea) -end - -function SendDamage:start() - local power = self.args.power - local accuracy = self.args.accuracy - local isSpecial = self.args.isSpecial - local isAerial = self.args.isAerial - - local dx = self.effectArea[1] - if self.effectArea[5] then - dx = dx * self.controller.direction - end - local ox = self.controller.startx + dx - local oy = self.controller.starty + self.effectArea[2] - local grid = maputils.maskToMap(ox, oy, self.effectArea[3], self.effectArea[4], self.controller.direction) - - local test = false - - for i, line in ipairs(grid) do - for j, case in ipairs(line) do - if grid[i][j] == 1 then - test = self.actor:sendDamage(j, i, power, accuracy, isSpecial, isAerial) - end - end - end - - self.controller.haveSentDamage = test - self:finish() -end - -return SendDamage diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamageToPoint.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamageToPoint.lua deleted file mode 100644 index c90cb49..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/sendDamageToPoint.lua +++ /dev/null @@ -1,29 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local SendDamage = ChoregraphyActionParent:extend() - -function SendDamage:new(system, args, effectArea) - SendDamage.super.new(self, system, args, effectArea) -end - -function SendDamage:start() - local xx, yy - if self.args.name == "sendDamageFromCursor" then - xx = self.controller.dx - yy = self.controller.dy - elseif self.args.name == "sendDamageFromPos" then - xx = utils.math.round(self.actor.x) - yy = utils.math.round(self.actor.y) - end - - local dx = self.args.dx - if (self.args.affectedByDirection) then - dx = dx * self.controller.direction - end - xx = xx + dx - yy = yy + self.args.dy - self.controller.haveSentDamage = self.actor:sendDamage(xx, yy, self.args.power, self.args.accuracy, self.args.isSpecial, self.args.isAerial) - - self:finish() -end - -return SendDamage diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/setAnimation.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/setAnimation.lua deleted file mode 100644 index ee26427..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/setAnimation.lua +++ /dev/null @@ -1,24 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local AnimationSetterAction = ChoregraphyActionParent:extend() - -function AnimationSetterAction:new(controller, args, effectArea) - AnimationSetterAction.super.new(self, controller, args, effectArea) -end - -function AnimationSetterAction:start() - self.actor:changeAnimation(self.args.animation) - self.actor:blockChoregraphy(self.args.blockProcess, self.args.animation) - if (self.args.blockProcess == false) then - self:finish() - end -end - -function AnimationSetterAction:update(dt) - -end - -function AnimationSetterAction:getSignal(signal) - -end - -return AnimationSetterAction; diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/wait.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/wait.lua deleted file mode 100644 index 53cf628..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/actions/wait.lua +++ /dev/null @@ -1,19 +0,0 @@ -local ChoregraphyActionParent = require "scenes.battlesystem.actors.systems.actions.parent" -local WaitAction = ChoregraphyActionParent:extend() - -function WaitAction:new(controller, args, effectArea) - WaitAction.super.new(self, controller, args, effectArea) -end - -function WaitAction:start() - self.timer = 0 -end - -function WaitAction:update(dt) - self.timer = self.timer + dt - if (self.timer > self.args.duration) then - self:finish() - end -end - -return WaitAction; diff --git a/sonic-radiance.love/scenes/battlesystem/actors/systems/choregraphy.lua b/sonic-radiance.love/scenes/battlesystem/actors/systems/choregraphy.lua deleted file mode 100644 index 4e0855d..0000000 --- a/sonic-radiance.love/scenes/battlesystem/actors/systems/choregraphy.lua +++ /dev/null @@ -1,95 +0,0 @@ -local ChoregraphySystem = Object:extend() - -local actionList = require "scenes.battlesystem.actors.systems.actions" - -function ChoregraphySystem:new(actor) - self.actor = actor - self:init({}, nil, self.actor.x, self.actor.y, false) -end - -function ChoregraphySystem:init(choregraphy, effectArea, dx, dy, isActive) - self.current = 0 - self.action = nil - self.isFinished = false - - self.data = choregraphy - self.effectArea = effectArea - - self.startx = self.actor.x - self.starty = self.actor.y - self.direction = self.actor.direction - - self.dx = dx or self.actor.x - self.dy = dy or self.actor.y - - self.haveSentDamage = false - - self.isActive = isActive - self.actionHaveEnded = false -end - -function ChoregraphySystem:start(skill, dx, dy) - local skill = skill - self:init(skill.choregraphy, skill.effectArea, dx, dy, true) -end - -function ChoregraphySystem:finish() - self.isActive = false - self.actor:switchActiveBattler() -end - -function ChoregraphySystem:update(dt) - if (self.actionHaveEnded) then - self.action = nil - self.actionHaveEnded = false - end - - if (self.isActive) then - if (self.action == nil) then - self:switchAction() - else - self.action:update(dt) - end - end -end - -function ChoregraphySystem:switchAction() - self.current = self.current + 1 - local nextAction = self.data[self.current] - - if (nextAction == nil) then - print("finished") - self:finish() - else - local args = game.skills:getActionArguments(nextAction) - local condition = args.condition - if (condition == "sentDamage") and (not self.haveSentDamage) then - core.debug:print("cbs/hero", "you didn't do damage, skipping " .. args.name) - self:switchAction() - else - self:doAction(nextAction) - end - - end -end - -function ChoregraphySystem:doAction(choregraphyAction) - local args = game.skills:getActionArguments(choregraphyAction) - local type = args.type or "unknown" - local effectArea = self.effectArea - - local action = actionList[type] - - if (action == nil) then - core.debug:warning("cbs/hero", "unknown action type " .. type .. ' (' .. args.name .. ')') - else - self.action = action(self, args, effectArea) - end -end - -function ChoregraphySystem:endAction() - self.action = nil - self.actionHaveEnded = true -end - -return ChoregraphySystem From 08c5724e96238c78a010fbf57db574f153f84c64 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 11:20:18 +0200 Subject: [PATCH 36/68] fix: remove calling of deleted old choregraphy system --- sonic-radiance.love/scenes/battlesystem/actors/hero.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index a06994c..84e0602 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -1,8 +1,6 @@ local Battler = require("scenes.battlesystem.actors.battler") local Hero = Battler:extend() -local ChoregraphySystem = require "scenes.battlesystem.actors.systems.choregraphy" - -- INIT FUNCTIONS -- Initialize the hero From b9816706e5ae144b2f462113fdd8643903f8ed90 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 11:22:41 +0200 Subject: [PATCH 37/68] fix: don't print input It's not really useless for debut for now --- sonic-radiance.love/core/input.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonic-radiance.love/core/input.lua b/sonic-radiance.love/core/input.lua index 4653aa1..2d6c4c6 100644 --- a/sonic-radiance.love/core/input.lua +++ b/sonic-radiance.love/core/input.lua @@ -158,13 +158,13 @@ function VirtualPad:checkKey(key) local isDown = self:isDown(key) if (isDown) then if not (self.keys[key].isDown) then - core.debug:print("virtualpad", "key " .. key .. " is Pressed") + --core.debug:print("virtualpad", "key " .. key .. " is Pressed") self.keys[key].isDown = true self.keys[key].isPressed = true self.keys[key].isReleased = false else if (self.keys[key].isPressed) then - core.debug:print("virtualpad", "key " .. key .. " is Down") + --core.debug:print("virtualpad", "key " .. key .. " is Down") self.keys[key].isPressed = false end end @@ -175,7 +175,7 @@ function VirtualPad:checkKey(key) self.keys[key].isReleased = true else if (self.keys[key].isReleased) then - core.debug:print("virtualpad", "key " .. key .. " is Released") + --core.debug:print("virtualpad", "key " .. key .. " is Released") self.keys[key].isReleased = false end end From 4ab2e72231e7dd243caea9d82d9a3ad00d2949d9 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 11:38:59 +0200 Subject: [PATCH 38/68] fix: make nil action and choregraphy when they are finished --- .../scenes/battlesystem/controllers/fighters/character.lua | 1 + .../battlesystem/controllers/fighters/systems/actions/parent.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 581bbef..0abc3ce 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -109,6 +109,7 @@ function HeroFighter:goBackToMenu() end function HeroFighter:finishAction() + self.action = nil self:setInactive() end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua index b21080f..d1f6c5f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua @@ -40,6 +40,7 @@ function ActionParent:start() end function ActionParent:choregraphyEnded() + self.choregraphy = nil self:finishAction() end From d40112ba31aa9b130947cd4468a8b1e4593b638c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 12:03:14 +0200 Subject: [PATCH 39/68] improvement: handle better defeated fighter turns --- .../scenes/battlesystem/controllers/init.lua | 4 ++-- .../scenes/battlesystem/controllers/parent.lua | 12 +++++------- .../scenes/battlesystem/gui/hud.lua | 14 +++++++++++++- sonic-radiance.love/scenes/battlesystem/init.lua | 4 ++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index a4f48aa..1f5b376 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -62,7 +62,6 @@ function TurnController:nextAction() self.turns.current = self.turns.current + 1 core.debug:print("cbs/turns", "switching to next action") end - self.hud:moveBattleCursor(self.turns.current) self:startAction() end @@ -101,13 +100,14 @@ function TurnController:startAction() local nextAction = self.actionList[self.turns.current] print(nextAction) local nextFighter = nextAction.fighter - if (nextFighter.isDestroyed == true) then + if (not nextFighter:canFight()) then -- On skipe le personnage s'il a été detruit self:nextAction() else self.currentFighter = nextFighter core.debug:print("cbs/turns", "Activating " .. self.currentFighter.name) self.currentFighter:setActive() + self.hud:moveBattleCursor(self.turns.current) end end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index 198f358..69cb720 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -42,13 +42,11 @@ end function FighterControllerParent:putActions(actionList) for i, fighter in ipairs(self.list) do - if fighter:canFight() then - for i=1, fighter:getNbrActionPerTurn() do - local action = {} - action.fighter = fighter - action.number = i - table.insert(actionList, action) - end + for i=1, fighter:getNbrActionPerTurn() do + local action = {} + action.fighter = fighter + action.number = i + table.insert(actionList, action) end end diff --git a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua index 2c1a570..f9cecd9 100644 --- a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua +++ b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua @@ -39,7 +39,11 @@ end function HUD:draw() for i, action in ipairs(self.turns.actionList) do - action.fighter:drawIcon(4 + (i-1)*(20), 6) + if action.fighter:canFight() then + action.fighter:drawIcon(4 + (i-1)*(20), 6) + else + self:drawEmptyIcon(4 + (i-1)*(20), 6) + end end local cursorx = self.battlerCursor * 20 - 8 @@ -59,4 +63,12 @@ function HUD:draw() love.graphics.print(turnnbr, x + 33, y + 1) end +function HUD:drawEmptyIcon(x, y) + local outlineLight = 0.15 + love.graphics.circle("fill", x + 8, y + 8, 2, 8) + love.graphics.setColor(outlineLight, outlineLight, outlineLight, 1) + love.graphics.circle("line", x + 8, y + 8, 2, 8) + utils.graphics.resetColor() +end + return HUD diff --git a/sonic-radiance.love/scenes/battlesystem/init.lua b/sonic-radiance.love/scenes/battlesystem/init.lua index 8882278..94573aa 100644 --- a/sonic-radiance.love/scenes/battlesystem/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/init.lua @@ -13,8 +13,8 @@ function BattleSystem:new() self.assets:batchImport("scenes.battlesystem.assets") - self.assets:setMusic("assets/music/battle1.mp3") - self.assets:playMusic() + --self.assets:setMusic("assets/music/battle1.mp3") + --self.assets:playMusic() self:initManagers() From 40b362543afb10dd5c684cb22e5476a9c24eac34 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 12:09:50 +0200 Subject: [PATCH 40/68] fix: only get potential targets for the selection system --- .../controllers/fighters/character.lua | 4 ++-- .../controllers/fighters/systems/selection.lua | 14 +++++++------- .../scenes/battlesystem/controllers/parent.lua | 10 ++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 0abc3ce..a35e22f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -81,9 +81,9 @@ function HeroFighter:verifyTargets() if (needTarget) then if (targetEnnemies) then - self.selection = SelectionSystem(self, self.owner.turnSystem.ennemies) + self.selection = SelectionSystem(self, self.owner.turnSystem.ennemies, true) else - self.selection = SelectionSystem(self, self.owner) + self.selection = SelectionSystem(self, self.owner, false) end else self.action:start() diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua index 2d57620..1db4db9 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/selection.lua @@ -1,7 +1,7 @@ local SelectionSystem = Object:extend() -function SelectionSystem:new(owner, fighterList) - self.fighterList = fighterList +function SelectionSystem:new(owner, fighterSide, onlyAlive) + self.fighterList = fighterSide:getTargets(onlyAlive) self.owner = owner self.assets = self.owner.assets self.selectedTarget = 1 @@ -13,14 +13,14 @@ function SelectionSystem:update(dt) self:purgeTarget() if (keys["up"].isPressed) then if (self.selectedTarget == 1) then - self.selectedTarget = self.fighterList:count() + self.selectedTarget = #self.fighterList else self.selectedTarget = self.selectedTarget - 1 end self.assets.sfx["mBeep"]:play() end if (keys["down"].isPressed) then - if (self.selectedTarget == self.fighterList:count()) then + if (self.selectedTarget == #self.fighterList) then self.selectedTarget = 1 else self.selectedTarget = self.selectedTarget + 1 @@ -43,18 +43,18 @@ function SelectionSystem:update(dt) end function SelectionSystem:purgeTarget() - local target = self.fighterList:get(self.selectedTarget) + local target = self.fighterList[self.selectedTarget] target.actor.isSelected = false end function SelectionSystem:updateTarget() - local target = self.fighterList:get(self.selectedTarget) + local target = self.fighterList[self.selectedTarget] target.actor.isSelected = true end function SelectionSystem:selectTarget() self:purgeTarget() - self.owner:receiveTarget(self.fighterList:get(self.selectedTarget)) + self.owner:receiveTarget(self.fighterList[self.selectedTarget]) end function SelectionSystem:goBack() diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index 69cb720..15342a5 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -18,6 +18,16 @@ function FighterControllerParent:count() return #self.list end +function FighterControllerParent:getTargets(onlyAlive) + local targetList = {} + for i, fighter in ipairs(self.list) do + if (fighter:canFight() or (not onlyAlive)) then + table.insert(targetList, fighter) + end + end + return targetList +end + function FighterControllerParent:applyDeath() for i, fighter in ipairs(self.list) do fighter:applyDeath() From 1acada1b5198aeba4e37be4ecdcdc40e39ad6187 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 12:15:50 +0200 Subject: [PATCH 41/68] fix: re-add victory condition --- .../scenes/battlesystem/controllers/init.lua | 7 +++++-- .../scenes/battlesystem/controllers/parent.lua | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua index 1f5b376..26b3826 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/init.lua @@ -36,7 +36,7 @@ function TurnController:startBattle() end function TurnController:finishBattle() - self.isBattleActive = false + self.isActive = false self.actionlist = {} self.hud:movePlayerHUD(false) self.scene:finishBattle() @@ -90,7 +90,10 @@ function TurnController:removeAllActionsFromFighter(fighterToRemove) end function TurnController:applyDeath() - self.ennemies:applyDeath() + local ennemiesAlive = self.ennemies:applyDeath() + if (ennemiesAlive == 0) then + self:finishBattle() + end self.player:applyDeath() end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua index 15342a5..7ac8d5f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/parent.lua @@ -18,6 +18,16 @@ function FighterControllerParent:count() return #self.list end +function FighterControllerParent:countAlive() + local aliveCount = 0 + for i, fighter in ipairs(self.list) do + if (fighter:canFight()) then + aliveCount = aliveCount + 1 + end + end + return aliveCount +end + function FighterControllerParent:getTargets(onlyAlive) local targetList = {} for i, fighter in ipairs(self.list) do @@ -32,6 +42,7 @@ function FighterControllerParent:applyDeath() for i, fighter in ipairs(self.list) do fighter:applyDeath() end + return self:countAlive() end function FighterControllerParent:setActive(activeActor) From 7364e5c206aa616134519fafc81ba3d8dfb7cc9f Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 16:46:46 +0200 Subject: [PATCH 42/68] feat: add more coordinate system --- .../fighters/systems/choregraphy/step/parent.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua index 5d56108..5e5508a 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/parent.lua @@ -20,6 +20,12 @@ function StepParent:getStepCoordinate() local target = self.choregraphy.action.target local x, y = target.actor:getCoordinate() return x + self.arguments.x, y + self.arguments.y + elseif (self.arguments.origin == "start") then + local x, y = self.choregraphy.actor.start.x, self.choregraphy.actor.start.y + return x + self.arguments.x, y + self.arguments.y + elseif (self.arguments.origin == "actor") then + local x, y = self.choregraphy.actor:getCoordinate() + return x + self.arguments.x, y + self.arguments.y end end From cce03643f6d961c261ecd626ff6c9ad6cd26ae56 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 16:47:29 +0200 Subject: [PATCH 43/68] improvement: revamp the whole motion system --- .../game/utils/choregraphy/arguments.lua | 2 +- .../scenes/battlesystem/actors/hero.lua | 164 ++++++++++++------ .../systems/choregraphy/step/init.lua | 1 - .../systems/choregraphy/step/jumpBack.lua | 5 +- .../systems/choregraphy/step/jumpTo.lua | 28 --- 5 files changed, 110 insertions(+), 90 deletions(-) delete mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua diff --git a/sonic-radiance.love/game/utils/choregraphy/arguments.lua b/sonic-radiance.love/game/utils/choregraphy/arguments.lua index c0eb5ed..e4ce5a5 100644 --- a/sonic-radiance.love/game/utils/choregraphy/arguments.lua +++ b/sonic-radiance.love/game/utils/choregraphy/arguments.lua @@ -5,7 +5,7 @@ return { ["sendDamage"] = {"power", "accuracy", "isSpecial", "isAerial"}, ["goTo"] = {"origin", "x", "y", "duration", "blockProcess"}, ["setAnimation"] = {"animation", "blockProcess"}, - ["jump"] = {"power", "blockProcess"}, + ["jump"] = {"power", "bounceNumber", "blockProcess"}, ["jumpTo"] = {"origin", "x", "y", "duration", "blockProcess"}, ["jumpBack"] = {"duration", "blockProcess"}, --[name] = {args}, diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 84e0602..944637f 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -1,6 +1,12 @@ local Battler = require("scenes.battlesystem.actors.battler") local Hero = Battler:extend() +local MOVEMENT_NONE = "none" +local MOVEMENT_TWEENER = "tweener" +local MOVEMENT_MOTION = "motion" + +local ZGRAVITY = 0.2 + -- INIT FUNCTIONS -- Initialize the hero @@ -21,12 +27,9 @@ end function Hero:update(dt) Hero.super.update(self, dt) - -- Calculate speed to calculate animation speed - self:updateSpeed(dt) + self:updateMovement(dt) - self.xprevious = self.x - self.yprevious = self.y - self.zprevious = self.z + self:updateAnimation(dt) end -- MOVE FUNCTIONS @@ -35,22 +38,47 @@ end local MOVEMENT_DURATION = 0.20 function Hero:initMovementSystem() - self.startx, self.starty = self.x, self.y self.xprevious, self.yprevious, self.zprevious = self.x, self.y, self.z + self.xspeed, self.yspeed, self.zspeed = 0,0,0 self.direction = 1 self.directionPrevious = 1 self.directionLocked = false - self.unlockDirection = true + + self.movementType = MOVEMENT_NONE self:initJump() end +function Hero:updateMovement(dt) + if (self.movementType == MOVEMENT_TWEENER) then + self:updateTweenerSpeed(dt) + elseif (self.movementType == MOVEMENT_MOTION) then + self:updateMotion(dt) + end + self.gspeed = math.sqrt(self.xspeed^2 + self.yspeed^2) + + self:updateDirection(dt) + self:updateJump(dt) + self:updatePreviousPosition(dt) +end + +function Hero:updatePreviousPosition() + self.xprevious = self.x + self.yprevious = self.y + self.zprevious = self.z +end + +-- Tweener movement functions + function Hero:goTo(dx, dy, duration, easing) local easing = easing or 'inOutQuad' if duration > 0 then self.tweens:newTween(0, duration, {x = dx, y = dy}, easing) end self.tweens:newTimer(duration + 0.02, "goTo") + self.tweens:newTimer(duration + 0.02, "resetMovement") + + self.movementType = MOVEMENT_TWEENER end function Hero:jumpTo(dx, dy, sizeFactor, duration, spinjump, easing) @@ -62,75 +90,81 @@ function Hero:jumpTo(dx, dy, sizeFactor, duration, spinjump, easing) self:setJump(jumpHeight, spinjump, duration) end -function Hero:updateSpeed(dt) - self:applyMotion(dt) - self.xspeed = self.x - self.xprevious - self.yspeed = self.y - self.yprevious - self.zspeed = self.z - self.zprevious +function Hero:updateTweenerSpeed(dt) + self.xspeed = (self.x - self.xprevious) / dt + self.yspeed = (self.y - self.yprevious) / dt +end - self.gspeed = math.sqrt(self.xspeed^2 + self.yspeed^2) +-- MOTION HANDLING +function Hero:setMotion(xspeed, yspeed) + self.xspeed = xspeed + self.yspeed = yspeed + self.movementType = MOVEMENT_MOTION +end + +function Hero:updateMotion(dt) + self.x = self.x + (self.xspeed) * dt + self.y = self.y + (self.yspeed) * dt +end + +function Hero:endMotion() + self.movementType = MOVEMENT_NONE + self.xspeed = 0 + self.yspeed = 0 +end + +-- Direction handling + +function Hero:updateDirection() -- Handle direction if math.abs(self.xspeed) > 0 then if (self.directionLocked == false) then self.direction = utils.math.sign(self.xspeed) end - else - if self.unlockDirection then - self.unlockDirection = false - self.directionLocked = false - end end - - if self.z > 0 and self.jump.spin == false then - if self.zspeed > 0 then - self:changeAnimation("jump") - else - self:changeAnimation("fall") - end - end - - self:setCustomSpeed(self.gspeed * 320) end +-- Jump system + function Hero:initJump() self.jump = {} - self.jump.spin = false + self.jump.useDefaultAnimation = true + self.jump.isJumping = false + self.jump.bounceNumber = 0 + self.jump.isJumpingBack = false end -function Hero:setJump(size, spinjump, duration) - local tweenDuration = duration / 2 - self.tweens:newTween(0, tweenDuration, {z = size}, 'outQuad') - self.tweens:newTween(tweenDuration, tweenDuration, {z = 0}, 'inQuad') +function Hero:setJump(power, bounceNumber, useDefaultAnimation) + self.zspeed = power self.jump.spin = spinjump + self.jump.bounceNumber = bounceNumber + self.jump.isJumping = true end -function Hero:setMotionX(direction, speed) - self.motion = speed - self.motionDirection = direction +function Hero:jumpBack() + self:setJump(3, 0, true) + self:setMotion(-10, 0) + self.jump.isJumpingBack = true end -function Hero:applyMotion(dt) - if self.motion ~= 0 and self.motion ~= nil then - local dx = self.x + self.motion * self.motionDirection * dt - -- {1, 0, "line", 5, true} - local ox = self.choregraphy.startx + (self.choregraphy.effectArea[1] * self.choregraphy.direction) - local oy = self.choregraphy.starty + self.choregraphy.effectArea[2] - local shape = self.choregraphy.effectArea[3] - local size = self.choregraphy.effectArea[4] - local direction = self.choregraphy.direction - - local new_case_x = utils.math.round(dx) - local new_case_y = utils.math.round(self.y) - print(new_case_x, new_case_y, self.world:caseIsEmpty(new_case_x, new_case_y, self)) - if self.maputils.isInMask(dx, self.y, ox, oy, shape, size, direction) and self.world:caseIsEmpty(new_case_x, new_case_y, self) then - self.x = dx - else - self.x = dx - self.motion = 0 - if (self.blockingChoregraphy == 'action_dashForward') then - self:unblockChoregraphy() - self.direction = self.choregraphy.direction +function Hero:updateJump(dt) + if (self.jump.isJumping) then + self.zspeed = self.zspeed - ZGRAVITY + self.z = self.z + self.zspeed + if (self.z <= 0) then + if (self.jump.bounceNumber > 0) then + self.zspeed = self.zspeed * -0.5 + self.jump.bounceNumber = self.jump.bounceNumber - 1 + else + self.z = 0 + self.jump.isJumping = false + self.jump.spin = false + self:timerResponse("jump") + if (self.jump.isJumpingBack) then + self:endMotion() + end + self:changeAnimation("idle") end end end @@ -155,6 +189,10 @@ function Hero:timerResponse(signal) if ((self.currentlyBlocking ~= nil) and (signal == self.blockedBy)) then self:unblockChoregraphy() end + + if (signal == "resetMovement") then + self.movementType = MOVEMENT_NONE + end end function Hero:choregraphyEnded() @@ -178,6 +216,18 @@ function Hero:animationEnded(animation) end end +function Hero:updateAnimation(dt) + if (self.z > 0 and self.jump.useDefaultAnimation) then + if self.zspeed > 0 then + self:changeAnimation("jump") + else + self:changeAnimation("fall") + end + end + + self:setCustomSpeed(self.gspeed * 320) +end + -- DRAW FUNCTIONS -- Draw everything related to the hero diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua index 2d6102b..3cc435d 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua @@ -4,7 +4,6 @@ local baseURI = "scenes.battlesystem.controllers.fighters.systems.choregraphy.st actions["addGFX"] = require(baseURI .. "addGFX") actions["goTo"] = require(baseURI .. "goTo") -actions["jumpTo"] = require(baseURI .. "jumpTo") actions["jumpBack"] = require(baseURI .. "jumpBack") actions["playSFX"] = require(baseURI .. "playSFX") actions["sendDamage"] = require(baseURI .. "sendDamage") diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua index 0bf6000..bb33e2f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpBack.lua @@ -7,13 +7,12 @@ end function JumpBackStep:start() - local x, y = self.choregraphy.actor.start.x, self.choregraphy.actor.start.y - self.choregraphy.actor:jumpTo(x, y, 0.5, self.arguments.duration, false, "outQuad") + self.choregraphy.actor:jumpBack() if (self.arguments.blockProcess == false) then self:finish() else - self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "jumpTo") + self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "jump") end end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua deleted file mode 100644 index 978c2f1..0000000 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/jumpTo.lua +++ /dev/null @@ -1,28 +0,0 @@ -local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" -local JumpToStep = StepParent:extend() - -function JumpToStep:new(controller, args) - JumpToStep.super.new(self, controller, args) -end - -function JumpToStep:start() - - local x, y = self:getStepCoordinate() - self.choregraphy.actor:jumpTo(x, y, 1, self.arguments.duration, true, "inOutQuad") - - if (self.arguments.blockProcess == false) then - self:finish() - else - self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "jumpTo") - end -end - -function JumpToStep:update(dt) - -end - -function JumpToStep:getSignal(signal) - -end - -return JumpToStep; From e72fa0cc7f4884191117cc4c160279cb6b0f77aa Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 16:47:58 +0200 Subject: [PATCH 44/68] fix: drop spin jump and revamp a bit the spindash --- .../gamedata/characters/sonic/skills.lua | 2 +- .../datas/gamedata/skills/attack.lua | 13 +++++---- .../datas/gamedata/skills/spinattack.lua | 22 ++++++++++----- .../datas/gamedata/skills/spindash.lua | 19 +++++++++++++ .../datas/gamedata/skills/spinjump.lua | 27 ------------------- 5 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 sonic-radiance.love/datas/gamedata/skills/spindash.lua delete mode 100644 sonic-radiance.love/datas/gamedata/skills/spinjump.lua diff --git a/sonic-radiance.love/datas/gamedata/characters/sonic/skills.lua b/sonic-radiance.love/datas/gamedata/characters/sonic/skills.lua index b68f655..2aed1c1 100644 --- a/sonic-radiance.love/datas/gamedata/characters/sonic/skills.lua +++ b/sonic-radiance.love/datas/gamedata/characters/sonic/skills.lua @@ -1,7 +1,7 @@ return { --{attack_name, level}, {"spinattack", 2}, - {"spinjump", 3}, + --{"spinjump", 3}, {"spindash", 8}, {"hommingattack", 11}, {"spinattack", 15}, diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index c9c6e3a..3b094d3 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -12,31 +12,30 @@ return { targetNumber = 1, -- 0 for targeting all ennemies choregraphy = { -- the main attack choregraphy - --{'goTo', "none", "target", 0, 0} + {'goTo', "none", "target", -1, 0, 0.3, true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit1start', true}, {'sendDamage', "none", 33, 100, false, false}, - {'addGFX',"sentDamage", 'hitGFX', "target", 0.75, 0, true, false}, + {'addGFX',"sentDamage", 'hitGFX', "actor", 0.75, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit1end', true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit2start', true}, {'sendDamage', "none", 33, 100, false, false}, - {'addGFX',"sentDamage", 'hitGFX', "target", 0.75, 0, true, false}, + {'addGFX',"sentDamage", 'hitGFX', "actor", 0.75, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit2end', true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit3start', true}, {'sendDamage', "none", 33, 100, false, false}, - {'addGFX',"sentDamage", 'hitGFX', "target", 0.75, 0, true, false}, + {'addGFX',"sentDamage", 'hitGFX', "actor", 0.75, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit3end', true}, {'setAnimation', "none", 'idle', false}, - --{'wait', "none", 0.2}, - --{'goTo', "none", "start", 0, 0}, - {'wait', "none", 0.5} + {'wait', "none", 0.2}, + {'goTo', "none", "start", 0, 0, 0.3, true} }, onContact = { -- if the attack move and touch multiple ennemies, you can add diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index e1c3656..d7c6daf 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -1,12 +1,16 @@ +-- A basic file describing the basic attack, in order to make it customizable one +-- day ? + +-- Also serve as a tutoriel for how to create a file attack and choregraphy + return { name = "spinattack", - cost = 05, + cost = 03, + targetNumber = 1, -- 0 for targeting all ennemies targetEnnemies = true, - choregraphy = { - {"setAnimation", "none", "spindash", false}, - {'playSFX', "none", 'spincharge'}, - {"wait", "none", 0.5}, + + choregraphy = { -- the main attack choregraphy {"setAnimation", "none", "spin", false}, {'playSFX', "none", 'spinrelease'}, {"goTo", "none", "target", 0, 0, 0.3, true}, @@ -14,6 +18,10 @@ return { {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", 0.3, true}, - {'setAnimation', "none", 'idle', false}, - } + {'goTo', "none", "start", 0, 0, 0.2, true} + }, + + onContact = { -- if the attack move and touch multiple ennemies, you can add + -- specific effect when you touch the ennemy. + }, } diff --git a/sonic-radiance.love/datas/gamedata/skills/spindash.lua b/sonic-radiance.love/datas/gamedata/skills/spindash.lua new file mode 100644 index 0000000..7f67d37 --- /dev/null +++ b/sonic-radiance.love/datas/gamedata/skills/spindash.lua @@ -0,0 +1,19 @@ +return { + name = "spindash", + cost = 05, + targetNumber = 1, -- 0 for targeting all ennemies + targetEnnemies = true, + choregraphy = { + {"setAnimation", "none", "spindash", false}, + {'playSFX', "none", 'spincharge'}, + {"wait", "none", 0.5}, + {"setAnimation", "none", "spin", false}, + {'playSFX', "none", 'spinrelease'}, + {"goTo", "none", "target", 0, 0, 0.3, true}, + {"sendDamage", "none", 120, 100, false, false}, + {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, + {'playSFX', "sentDamage", 'hitconnect'}, + {'jumpBack', "none", 0.3, true}, + {'goTo', "none", "start", 0, 0, 0.2, true} + } +} diff --git a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua b/sonic-radiance.love/datas/gamedata/skills/spinjump.lua deleted file mode 100644 index fe79331..0000000 --- a/sonic-radiance.love/datas/gamedata/skills/spinjump.lua +++ /dev/null @@ -1,27 +0,0 @@ --- A basic file describing the basic attack, in order to make it customizable one --- day ? - --- Also serve as a tutoriel for how to create a file attack and choregraphy - -return { - name = "spinjump", - cost = 03, - - targetNumber = 1, -- 0 for targeting all ennemies - targetEnnemies = true, - - choregraphy = { -- the main attack choregraphy - {"setAnimation", "none", "spinjump", false}, - {'playSFX', "none", 'jump'}, - {'jumpTo', 'none', "target", 0, 0, 0.5, true}, - {"sendDamage", "none", 110, 100, false, true}, - {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, - {'playSFX', "sentDamage", 'hitconnect'}, - {'jumpBack', "none", 0.3, true}, - {'setAnimation', "none", 'idle', false}, - }, - - onContact = { -- if the attack move and touch multiple ennemies, you can add - -- specific effect when you touch the ennemy. - }, -} From f3d44e06d19c63d6225c28873498ed00de8d1c87 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 17:03:37 +0200 Subject: [PATCH 45/68] feat: add a way to wait for the end of something already started --- .../game/utils/choregraphy/arguments.lua | 1 + .../systems/choregraphy/step/init.lua | 1 + .../choregraphy/step/waitActorFinished.lua | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua diff --git a/sonic-radiance.love/game/utils/choregraphy/arguments.lua b/sonic-radiance.love/game/utils/choregraphy/arguments.lua index e4ce5a5..8a4d3f2 100644 --- a/sonic-radiance.love/game/utils/choregraphy/arguments.lua +++ b/sonic-radiance.love/game/utils/choregraphy/arguments.lua @@ -8,6 +8,7 @@ return { ["jump"] = {"power", "bounceNumber", "blockProcess"}, ["jumpTo"] = {"origin", "x", "y", "duration", "blockProcess"}, ["jumpBack"] = {"duration", "blockProcess"}, + ["waitActorFinished"] = {"waitFor"}, --[name] = {args}, } diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua index 3cc435d..2dd3b8c 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua @@ -9,5 +9,6 @@ actions["playSFX"] = require(baseURI .. "playSFX") actions["sendDamage"] = require(baseURI .. "sendDamage") actions["setAnimation"] = require(baseURI .. "setAnimation") actions["wait"] = require(baseURI .. "wait") +actions["waitActorFinished"] = require(baseURI .. "waitActorFinished") return actions diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua new file mode 100644 index 0000000..7392a3f --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua @@ -0,0 +1,20 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local WaitActorFinishedStep = StepParent:extend() + +function WaitActorFinishedStep:new(controller, args) + WaitActorFinishedStep.super.new(self, controller, args) +end + +function WaitActorFinishedStep:start() + self.choregraphy.actor:blockChoregraphy(true, self, self.arguments.waitFor) +end + +function WaitActorFinishedStep:update(dt) + +end + +function WaitActorFinishedStep:getSignal(signal) + +end + +return WaitActorFinishedStep; From b247e9cc96630dbce89332f57e6d30adb17dcece Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 17:07:53 +0200 Subject: [PATCH 46/68] feat: improve a bit the choregraphies --- sonic-radiance.love/datas/gamedata/skills/attack.lua | 5 ++++- .../datas/gamedata/skills/spinattack.lua | 10 ++++++++-- sonic-radiance.love/datas/gamedata/skills/spindash.lua | 5 ++++- .../scenes/battlesystem/actors/hero.lua | 9 +++++++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index 3b094d3..54c43e9 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -12,6 +12,7 @@ return { targetNumber = 1, -- 0 for targeting all ennemies choregraphy = { -- the main attack choregraphy + {"setAnimation", "none", "walk", false}, {'goTo', "none", "target", -1, 0, 0.3, true}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit1start', true}, @@ -35,7 +36,9 @@ return { {'setAnimation', "none", 'hit3end', true}, {'setAnimation', "none", 'idle', false}, {'wait', "none", 0.2}, - {'goTo', "none", "start", 0, 0, 0.3, true} + {"setAnimation", "none", "walk", false}, + {'goTo', "none", "start", 0, 0, 0.3, true}, + {'setAnimation', "none", 'idle', false}, }, onContact = { -- if the attack move and touch multiple ennemies, you can add diff --git a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua index d7c6daf..1616646 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spinattack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spinattack.lua @@ -11,14 +11,20 @@ return { targetEnnemies = true, choregraphy = { -- the main attack choregraphy + {"setAnimation", "none", "walk", false}, + {"goTo", "none", "target", 0, 0, 0.6, false}, + {"wait", "none", 0.3}, {"setAnimation", "none", "spin", false}, {'playSFX', "none", 'spinrelease'}, - {"goTo", "none", "target", 0, 0, 0.3, true}, + {"waitActorFinished", "none", "goTo"}, {"sendDamage", "none", 120, 100, false, false}, {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", 0.3, true}, - {'goTo', "none", "start", 0, 0, 0.2, true} + {"wait", "none", 0.1}, + {"setAnimation", "none", "walk", false}, + {'goTo', "none", "start", 0, 0, 0.3, true}, + {'setAnimation', "none", 'idle', false}, }, onContact = { -- if the attack move and touch multiple ennemies, you can add diff --git a/sonic-radiance.love/datas/gamedata/skills/spindash.lua b/sonic-radiance.love/datas/gamedata/skills/spindash.lua index 7f67d37..02a2076 100644 --- a/sonic-radiance.love/datas/gamedata/skills/spindash.lua +++ b/sonic-radiance.love/datas/gamedata/skills/spindash.lua @@ -14,6 +14,9 @@ return { {'addGFX', "sentDamage", 'hitGFX', "target", 0, 0, true, false}, {'playSFX', "sentDamage", 'hitconnect'}, {'jumpBack', "none", 0.3, true}, - {'goTo', "none", "start", 0, 0, 0.2, true} + {"wait", "none", 0.1}, + {"setAnimation", "none", "walk", false}, + {'goTo', "none", "start", 0, 0, 0.3, true}, + {'setAnimation', "none", 'idle', false}, } } diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 944637f..00ecd7c 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -118,7 +118,7 @@ end function Hero:updateDirection() -- Handle direction - if math.abs(self.xspeed) > 0 then + if math.abs(self.xspeed) >= 0.01 then if (self.directionLocked == false) then self.direction = utils.math.sign(self.xspeed) end @@ -197,6 +197,11 @@ end function Hero:choregraphyEnded() self.direction = 1 + self.x = self.start.x + self.y = self.start.y + self.xspeed = 0 + self.yspeed = 0 + self.movementType = MOVEMENT_NONE end -- ASSETS FUNCTIONS @@ -225,7 +230,7 @@ function Hero:updateAnimation(dt) end end - self:setCustomSpeed(self.gspeed * 320) + self:setCustomSpeed(self.gspeed * 160 * dt) end -- DRAW FUNCTIONS From 6cf1df4d5b1b1c11b801e94accb5d291dd1aed90 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 17:50:44 +0200 Subject: [PATCH 47/68] feat: improve HUD and menus placement --- .../controllers/fighters/character.lua | 4 +- .../controllers/fighters/villain.lua | 2 +- .../scenes/battlesystem/gui/hud.lua | 12 +++--- .../scenes/battlesystem/menu.lua | 38 +++++++++++++++---- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index a35e22f..3a6e604 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -6,7 +6,7 @@ local SelectionSystem = require "scenes.battlesystem.controllers.fighters.system local actionList = require "scenes.battlesystem.controllers.fighters.systems.actions" local POSITIONS = {3, 1, 5} -local HEROES_LINE = 3; +local HEROES_LINE = 2; function HeroFighter:new(owner, character, id) self.name = character @@ -139,7 +139,7 @@ end function HeroFighter:talk(name) local completename = self.name .. "_" .. name - self.assets.sfx[completename]:play() + --self.assets.sfx[completename]:play() end -- DRAW FUNCTIONS diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua index a26ad18..0084169 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/villain.lua @@ -4,7 +4,7 @@ local VillainFighter = FighterParent:extend() local SimpleHPBar = require "scenes.battlesystem.gui.simplehpbar" local POSITIONS = {1, 3, 5} -local ENNEMY_LINE = 10; +local ENNEMY_LINE = 11; function VillainFighter:new(owner, ennemy, id) self.name = ennemy diff --git a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua index f9cecd9..1916b0c 100644 --- a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua +++ b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua @@ -23,7 +23,7 @@ end function HUD:movePlayerHUD(beginBattle) if (beginBattle) then - self.tweens:newTween(0, 0.4, {playerHUDPosition = 36}, 'inCubic') + self.tweens:newTween(0, 0.4, {playerHUDPosition = 16}, 'inCubic') else self.tweens:newTween(0, 0.4, {playerHUDPosition = -64}, 'inCubic') end @@ -40,20 +40,20 @@ end function HUD:draw() for i, action in ipairs(self.turns.actionList) do if action.fighter:canFight() then - action.fighter:drawIcon(4 + (i-1)*(20), 6) + action.fighter:drawIcon(4 + (i-1)*(20), 216) else - self:drawEmptyIcon(4 + (i-1)*(20), 6) + self:drawEmptyIcon(4 + (i-1)*(20), 216) end end local cursorx = self.battlerCursor * 20 - 8 if #self.turns.actionList > 0 then - self.assets.images["menucursor"]:draw(cursorx, 26, math.rad(-90), 1, 1, 4, 8) + self.assets.images["menucursor"]:draw(cursorx, 216, math.rad(90), 1, 1, 4, 8) end - local x, y = 362, 3 + local x, y = 362, 225 - love.graphics.draw(self.frame, 424, 20, 0, -1, -1) + love.graphics.draw(self.frame, 424, 220, 0, -1, 1) self.assets.images["hudturn"]:draw(x, y) self.assets.fonts["hudnbrs"]:set() local turnnbr = self.turns.turns.number diff --git a/sonic-radiance.love/scenes/battlesystem/menu.lua b/sonic-radiance.love/scenes/battlesystem/menu.lua index 21b0996..3741a7c 100644 --- a/sonic-radiance.love/scenes/battlesystem/menu.lua +++ b/sonic-radiance.love/scenes/battlesystem/menu.lua @@ -10,8 +10,8 @@ local SubMenuWidget = BattleWidget:extend() local BackMenuWidget = BattleWidget:extend() local SkillWidget = BattleWidget:extend() -local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 32, 32, 110 -local MENU_WIDTH, MENU_ITEM_HEIGHT = 148, 17 +local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 96, 32, 96 +local MENU_WIDTH, MENU_ITEM_HEIGHT = 180, 17 local MENU_ITEM_NUMBER = 6 function MenuConstructor:new( controller ) @@ -122,7 +122,27 @@ end function CharacterMenu:drawCursor() local addition = 17 - love.graphics.draw(self.cursorTexture, self.x + 4, self.y + (self.cursorTransition) * addition ) + local x = self.x + 4 + ((self.cursorTransition) * addition * 0.5) + local y = self.y + ((self.cursorTransition) * addition) + love.graphics.draw(self.cursorTexture, x, y) +end + +function CharacterMenu:draw() + self:updateView() + local widgety = self.y + local widgetx = self.x + for i,v in ipairs(self.widget.list) do + if (i >= self.view.firstSlot) and (i < self.view.firstSlot + self.view.slotNumber) then + v:draw(widgetx, widgety, self.w, self.widget.h) + if self.widget.selected == i and self:haveFocus() == true then + v:drawSelected(widgetx, widgety, self.w, self.widget.h) + else + v:draw(widgetx, widgety, self.w, self.widget.h) + end + widgety = widgety + self.widget.h + widgetx = widgetx + (self.widget.h/2) + end + end end -- WIDGETS @@ -178,10 +198,12 @@ function BattleWidget:drawCanvas() local midAsset = love.graphics.newQuad(16, 0, 1, sh, sw, sh) local endAsset = love.graphics.newQuad(sw-16, 0, 16, sh, sw, sh) - love.graphics.draw(asset, startAsset, 0, (self.height - 13) / 2) - love.graphics.draw(asset, endAsset, self.width-16, (self.height - 13) / 2) + local trueWidth = self.width - 32 - local iterations = self.width-32 + love.graphics.draw(asset, startAsset, 0, (self.height - 13) / 2) + love.graphics.draw(asset, endAsset, trueWidth-16, (self.height - 13) / 2) + + local iterations = trueWidth-32 for i=0,iterations do love.graphics.draw(asset, midAsset, 16+i, (self.height - 13) / 2) @@ -191,10 +213,10 @@ function BattleWidget:drawCanvas() h = math.floor(self.height / 2) - (self.font:getHeight() / 2) love.graphics.setColor(0, 0, 0, .8) self.font:print(self.label, 17, h, "left") - self.font:print(self.label2, self.width - 8, h, "right") + self.font:print(self.label2, trueWidth - 8, h, "right") utils.graphics.resetColor() self.font:print(self.label, 16, h, "left") - self.font:print(self.label2, self.width - 9, h, "right") + self.font:print(self.label2, trueWidth - 9, h, "right") end function BattleWidget:action() From e26597c10a1567154c822df8ee5a2d5759fa0bc9 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 31 Jul 2020 20:05:22 +0200 Subject: [PATCH 48/68] feat: add a small smoke asset --- .../assets/sprites/gfx/smallsmoke.lua | 18 ++++++++++++++++++ .../assets/sprites/gfx/smallsmoke.png | Bin 0 -> 1192 bytes 2 files changed, 18 insertions(+) create mode 100644 sonic-radiance.love/assets/sprites/gfx/smallsmoke.lua create mode 100644 sonic-radiance.love/assets/sprites/gfx/smallsmoke.png diff --git a/sonic-radiance.love/assets/sprites/gfx/smallsmoke.lua b/sonic-radiance.love/assets/sprites/gfx/smallsmoke.lua new file mode 100644 index 0000000..4dbd8f2 --- /dev/null +++ b/sonic-radiance.love/assets/sprites/gfx/smallsmoke.lua @@ -0,0 +1,18 @@ +return { + metadata = { + height = 16, + width = 16, + defaultAnim = "default", + ox = 8, + oy = 8, + }, + animations = { + ["default"] = { + startAt = 1, + endAt = 8, + loop = 1, + speed = 15, + pauseAtEnd = false, + }, + } +} diff --git a/sonic-radiance.love/assets/sprites/gfx/smallsmoke.png b/sonic-radiance.love/assets/sprites/gfx/smallsmoke.png new file mode 100644 index 0000000000000000000000000000000000000000..94ac95df826be25a5943ce19b74aef58c90a7457 GIT binary patch literal 1192 zcmV;Z1XufsP)EX>4Tx04R}tkv&MmKpe$iQ?()$2Ro<;2B}UKL`5963Pq?8YK2xEOfLO`CJjl7 zi=*ILaPVWX>fqw6tAnc`2!4P#IXWr2NQwVT3oT+iIPS;0dyl(!fKV+m&1xG5G~G56 zv8b3zuZn?J1kjHT3}Z-UmN6$uad?ied-(Wz7vWjn=l&esYQ|!KPb8jYhG`RT5KnK~ z2Iqa^5X;Ld@j3CBNf#u3wM5yK*uAVGwJG72cdMub+K6blL3k9znAT)#vvg+6mx)2Cnp`zf=WgK1r`M zweS(pvkhEaH#KDsxZDByo($QPUCB>V$Yz1}Gy0}9(0dDXt<`&L?BnzSNK#kv8{ps& z7|l`ky2raaTYLNWOryUaYm{=N+*^0#00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNlirueSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00MwXL_t(&-tAbys;e*%9iJ{D_9t8xy7W6-3WA?k5M1^f z-m=Sr%l<^gz%%$3m&qN|BqnNkJg)<#ttMlfb7syY0sQ_m!eKwwejOp$&UhxQ_jo3t zPs+vq*UUBfI0#?>%GX|(+IoNB4UBDNoj>>7xT{waL-i5tO#&zor$;#nD!Yfy89eX? zPLI+%yG$Ta|GIVXOu*Py*7<9)-sE>z6`)T_h*%*%YG%xpXtc4d-oVEUwPm_4$aFjc zuUiMZhsOEzJ?7T1iyi=jje+Wu(y7b^=d1Pqz#Ah82Hwc;xU1iS9I*lb0K(_Zi;(Jg ze2%NBM6}7s5@LRg085)5o(UOj3}SG;zJY1eTGMX?Lq~$sqlB@onsL4*S~oU) z-n>Die&Vk7BB9C9hqVXbnOLNS7~p|763jXMHR-UrXd3{1Qi4eHNq|I}PhME0IYg{* zT94XKtkM7fZX1Z1tJBgs8`}!Twwh$Jt8NXvksULFhMMjw0a!7R3=u0PRm3#|!{-gc z=WPPMNkW42RlZ}Nl$+}GKRXBT)hm~h<7x;N1>Tln7;rjXN1BKgMnCEnFz#wOmR{G9 zfW|8BYOktE6KspU{w4&7yBZ=^$fn50M4CfzzRFDY)lLKs%l8^G>Kef%hd7jEIv=OU zSHtH5pjsW`?z_`pBO^=5^RaUP+n(2Fu1{cSU?Wz@QcsCw%FNg0oA9(p;F$n+58-wB zYQ998YklB4P50I3EQ!k}dXL>51gV6fSuxi@(yF1`v(JG>!O#I?A~QCxuChUWzb>_R zlfG*LY;}@IgQ~msY2w<(QG%|ug8)0JdOk8h#~%dv;r18Se!dgA-U&?r0000 Date: Fri, 31 Jul 2020 20:06:35 +0200 Subject: [PATCH 49/68] feat: add basic qte framework --- .../datas/gamedata/skills/attack.lua | 4 ++ .../game/utils/choregraphy/arguments.lua | 1 + .../game/utils/choregraphy/init.lua | 48 ++++++++++++++++++- .../game/utils/choregraphy/qte.lua | 3 ++ .../fighters/systems/choregraphy/init.lua | 18 +++++++ .../fighters/systems/choregraphy/qte/init.lua | 5 ++ .../systems/choregraphy/step/addQTE.lua | 26 ++++++++++ .../systems/choregraphy/step/init.lua | 1 + 8 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 sonic-radiance.love/game/utils/choregraphy/qte.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/init.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addQTE.lua diff --git a/sonic-radiance.love/datas/gamedata/skills/attack.lua b/sonic-radiance.love/datas/gamedata/skills/attack.lua index 54c43e9..d3ba280 100644 --- a/sonic-radiance.love/datas/gamedata/skills/attack.lua +++ b/sonic-radiance.love/datas/gamedata/skills/attack.lua @@ -14,6 +14,8 @@ return { choregraphy = { -- the main attack choregraphy {"setAnimation", "none", "walk", false}, {'goTo', "none", "target", -1, 0, 0.3, true}, + + {"addQTE", "none", {"simplePrompt", "A", 0.2}, "target", false}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit1start', true}, {'sendDamage', "none", 33, 100, false, false}, @@ -21,6 +23,7 @@ return { {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit1end', true}, + {"addQTE", "none", {"simplePrompt", "A", 0.2}, "target", false}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit2start', true}, {'sendDamage', "none", 33, 100, false, false}, @@ -28,6 +31,7 @@ return { {'playSFX', "sentDamage", 'hitconnect'}, {'setAnimation', "none", 'hit2end', true}, + {"addQTE", "none", {"simplePrompt", "A", 0.2}, "target", false}, {'playSFX', "none", 'hit'}, {'setAnimation', "none", 'hit3start', true}, {'sendDamage', "none", 33, 100, false, false}, diff --git a/sonic-radiance.love/game/utils/choregraphy/arguments.lua b/sonic-radiance.love/game/utils/choregraphy/arguments.lua index 8a4d3f2..a400c51 100644 --- a/sonic-radiance.love/game/utils/choregraphy/arguments.lua +++ b/sonic-radiance.love/game/utils/choregraphy/arguments.lua @@ -9,6 +9,7 @@ return { ["jumpTo"] = {"origin", "x", "y", "duration", "blockProcess"}, ["jumpBack"] = {"duration", "blockProcess"}, ["waitActorFinished"] = {"waitFor"}, + ["addQTE"] = {"qteData", "origin", "blockProcess"} --[name] = {args}, } diff --git a/sonic-radiance.love/game/utils/choregraphy/init.lua b/sonic-radiance.love/game/utils/choregraphy/init.lua index 5aa85a0..5f8f831 100644 --- a/sonic-radiance.love/game/utils/choregraphy/init.lua +++ b/sonic-radiance.love/game/utils/choregraphy/init.lua @@ -1,5 +1,7 @@ ChoregraphyUtils = {} +-- steps utils + function ChoregraphyUtils.getStepStructure(stepName) local stepTypeList = require "game.utils.choregraphy.arguments" return stepTypeList[stepName] @@ -9,7 +11,7 @@ function ChoregraphyUtils.stepExists(stepName) return (ChoregraphyUtils.getStepStructure(stepName) ~= nil) end -function ChoregraphyUtils.validate(stepBaseDatas) +function ChoregraphyUtils.validateStep(stepBaseDatas) local structure = ChoregraphyUtils.getStepStructure(stepBaseDatas[1]) if (structure == nil) then return false @@ -23,7 +25,7 @@ function ChoregraphyUtils.getStepDatas(stepBaseDatas) local stepData = {} stepData.name = stepBaseDatas[1] - if (ChoregraphyUtils.validate(stepBaseDatas)) then + if (ChoregraphyUtils.validateStep(stepBaseDatas)) then stepData.condition = stepBaseDatas[2] local structure = ChoregraphyUtils.getStepStructure(stepData.name) @@ -42,4 +44,46 @@ function ChoregraphyUtils.getStepDatas(stepBaseDatas) end +-- QTE utils + +function ChoregraphyUtils.getQteStructure(qteName) + local stepTypeList = require "game.utils.choregraphy.qte" + return stepTypeList[qteName] +end + +function ChoregraphyUtils.qteExists(qteName) + return (ChoregraphyUtils.getQteStructure(qteName) ~= nil) +end + +function ChoregraphyUtils.validateQte(qteBaseDatas) + local structure = ChoregraphyUtils.getQteStructure(qteBaseDatas[1]) + if (structure == nil) then + return false + else + return ((#structure + 1) == #qteBaseDatas) + end +end + +function ChoregraphyUtils.getQteDatas(qteBaseDatas) + + local qteData = {} + qteData.name = qteBaseDatas[1] + + if (ChoregraphyUtils.validateQte(qteBaseDatas)) then + local structure = ChoregraphyUtils.getQteStructure(qteData.name) + + qteData.arguments = {} + + for i, argumentName in ipairs(structure) do + local argumentContent = qteBaseDatas[i + 1] + qteData.arguments[argumentName] = argumentContent + end + + return qteData + else + error("Le QTE " .. qteData.name .. " à un nbr d'argument incorrect") + end + +end + return ChoregraphyUtils diff --git a/sonic-radiance.love/game/utils/choregraphy/qte.lua b/sonic-radiance.love/game/utils/choregraphy/qte.lua new file mode 100644 index 0000000..4414f08 --- /dev/null +++ b/sonic-radiance.love/game/utils/choregraphy/qte.lua @@ -0,0 +1,3 @@ +return { + ["simplePrompt"] = {"key", "duration"} +} diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua index 47ad32b..9d47bb8 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -2,6 +2,7 @@ local ChoregraphySystem = Object:extend() local choregraphyUtils = require "game.utils.choregraphy" local stepObjectList = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step" +local qteObjectList = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.qte" function ChoregraphySystem:new(action, choregraphy) self.action = action @@ -14,9 +15,17 @@ function ChoregraphySystem:new(action, choregraphy) self.currentStepId = 0 self.currentStep = nil self.stepList = choregraphy + + self.qte = {} + self.qte.current = nil + self.qte.wasSuccess = false end function ChoregraphySystem:update(dt) + if (self.qte.current ~= nil) then + self.qte.current:update(dt) + end + if (self.currentStep ~= nil) then self.currentStep:updateStep(dt) else @@ -37,6 +46,15 @@ function ChoregraphySystem:switchStep() end end +function ChoregraphySystem:addQTE(action, origin, qteBaseData, blockProcess) + local qteData = choregraphyUtils.getQteDatas(qteBaseData) + if (qteObjectList[qteData.name] ~= nil) then + self.qte.current = qteObjectList[qteData.name](self, qteData.arguments, action) + self.qte.current:blockAction(action, blockProcess) + self.qte.current:setOrigin(origin) + end +end + function ChoregraphySystem:sendDamage(power, accuracy, isSpecial, isAerial) if (self.target ~= nil) then if (self.fighter.isAlive) then diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/init.lua new file mode 100644 index 0000000..c3e7f9f --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/init.lua @@ -0,0 +1,5 @@ +local qtes = {} + +local baseURI = "scenes.battlesystem.controllers.fighters.systems.choregraphy.qte." + +return qtes diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addQTE.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addQTE.lua new file mode 100644 index 0000000..13fd8f5 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/addQTE.lua @@ -0,0 +1,26 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local StepQTE = StepParent:extend() + +function StepQTE:new(controller, args) + StepQTE.super.new(self, controller, args) +end + +function StepQTE:start() + self.choregraphy:addQTE(self, self.arguments.origin, self.arguments.qteData, self.arguments.blockProcess) + if (not self.arguments.blockProcess) then + self:finish() + end +end + +function StepQTE:update(dt) + +end + +function StepQTE:getSignal(signal) + if (signal == "gfxEnded") then + self:finish() + end +end + + +return StepQTE diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua index 2dd3b8c..a827847 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua @@ -3,6 +3,7 @@ local actions = {} local baseURI = "scenes.battlesystem.controllers.fighters.systems.choregraphy.step." actions["addGFX"] = require(baseURI .. "addGFX") +actions["addQTE"] = require(baseURI .. "addQTE") actions["goTo"] = require(baseURI .. "goTo") actions["jumpBack"] = require(baseURI .. "jumpBack") actions["playSFX"] = require(baseURI .. "playSFX") From 227b2bbf1e1e0024459aeb92dfcdde4ef8f87e71 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 31 Jul 2020 21:00:31 +0200 Subject: [PATCH 50/68] feat: add qte base --- .../fighters/systems/choregraphy/init.lua | 2 +- .../systems/choregraphy/qte/parent.lua | 72 +++++++++++++++++++ .../systems/choregraphy/qte/simplePrompt.lua | 0 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/parent.lua create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/simplePrompt.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua index 9d47bb8..3eee591 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -49,7 +49,7 @@ end function ChoregraphySystem:addQTE(action, origin, qteBaseData, blockProcess) local qteData = choregraphyUtils.getQteDatas(qteBaseData) if (qteObjectList[qteData.name] ~= nil) then - self.qte.current = qteObjectList[qteData.name](self, qteData.arguments, action) + self.qte.current = qteObjectList[qteData.name](self, qteData.arguments) self.qte.current:blockAction(action, blockProcess) self.qte.current:setOrigin(origin) end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/parent.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/parent.lua new file mode 100644 index 0000000..2fdefa7 --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/parent.lua @@ -0,0 +1,72 @@ +local QteParent = Object:extend() + +function QteParent:new(choregraphySystem, arguments) + self.choregraphy = choregraphySystem + self.arguments = arguments + self.timer = 0 + self.origin = nil + self.isBlocking = nil +end + +function QteParent:blockAction(action, blockProcess) + if (blockProcess) then + self.isBlocking = action + end +end + +function QteParent:setOrigin(origin) + self.origin = origin +end + +function QteParent:drawButton(x, y, letter) + local grayValue = .44 + local darkValue = .11 + love.graphics.setColor(grayValue, grayValue, grayValue, 1) + love.graphics.circle("fill", x, y, 8, 8) + love.graphics.setColor(darkValue, darkValue, darkValue, 1) + love.graphics.circle("line", x, y, 8, 8) + love.graphics.print(letter, x, y) + utils.graphics.resetColor() +end + +function StepParent:updateStep(dt) + if (not self.isStarted) then + self:start() + self.isStarted = true + else + self:update(dt) + self:updateTimer(dt) + end +end + +function StepParent:update(dt) + -- +end + +function StepParent:updateTimer(dt) + if (self.arguments.duration ~= nil) then + self.timer = self.timer + dt + if (self.timer > self.arguments.duration) then + self:fail() + end + end +end + + +function QteParent:succes() + self:finish(true) +end + +function QteParent:fail() + self:finish(false) +end + +function QteParent:finish(success) + print("action finished") + self.choregraphy:endQte(success) + if (self.isBlocking ~= nil) then + self.isBlocking:finish() + end +end + +return QteParent diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/simplePrompt.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/qte/simplePrompt.lua new file mode 100644 index 0000000..e69de29 From a3cf5bef63b9ecd4db7d68de98f95c1a48a84626 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 09:29:13 +0200 Subject: [PATCH 51/68] fix: make widget item colorable --- sonic-radiance.love/core/modules/menusystem/listbox.lua | 2 +- sonic-radiance.love/core/modules/menusystem/widgets/init.lua | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sonic-radiance.love/core/modules/menusystem/listbox.lua b/sonic-radiance.love/core/modules/menusystem/listbox.lua index b8e47e7..10e4f85 100644 --- a/sonic-radiance.love/core/modules/menusystem/listbox.lua +++ b/sonic-radiance.love/core/modules/menusystem/listbox.lua @@ -126,10 +126,10 @@ function ListBox:draw() local widgety = self.y for i,v in ipairs(self.widget.list) do if (i >= self.view.firstSlot) and (i < self.view.firstSlot + self.view.slotNumber) then - v:draw(self.x, widgety, self.w, self.widget.h) if self.widget.selected == i and self:haveFocus() == true then v:drawSelected(self.x, widgety, self.w, self.widget.h) else + utils.graphics.resetColor() v:draw(self.x, widgety, self.w, self.widget.h) end widgety = widgety + self.widget.h diff --git a/sonic-radiance.love/core/modules/menusystem/widgets/init.lua b/sonic-radiance.love/core/modules/menusystem/widgets/init.lua index 9c02e5a..15ab5b2 100644 --- a/sonic-radiance.love/core/modules/menusystem/widgets/init.lua +++ b/sonic-radiance.love/core/modules/menusystem/widgets/init.lua @@ -91,7 +91,6 @@ end function BaseWidget:draw(x, y) if self.canvas.texture ~= nil then - utils.graphics.resetColor() love.graphics.draw(self.canvas.texture, x, y) end end From 4b9ba5eed68862e7321f19cb0d1d42b10df06a97 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 10:31:09 +0200 Subject: [PATCH 52/68] feat: add basic debug menu --- sonic-radiance.love/game/init.lua | 2 + sonic-radiance.love/main.lua | 2 +- .../scenes/debug/commons/assets.lua | 51 +++++++++++++ .../scenes/debug/commons/menu.lua | 60 +++++++++++++++ sonic-radiance.love/scenes/debug/init.lua | 3 + .../scenes/debug/menu/init.lua | 75 +++++++++++++++++++ .../scenes/debug/menu/menu.lua | 36 +++++++++ sonic-radiance.love/scenes/init.lua | 1 + 8 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 sonic-radiance.love/scenes/debug/commons/assets.lua create mode 100644 sonic-radiance.love/scenes/debug/commons/menu.lua create mode 100644 sonic-radiance.love/scenes/debug/init.lua create mode 100644 sonic-radiance.love/scenes/debug/menu/init.lua create mode 100644 sonic-radiance.love/scenes/debug/menu/menu.lua diff --git a/sonic-radiance.love/game/init.lua b/sonic-radiance.love/game/init.lua index c95d3f1..d47cd04 100644 --- a/sonic-radiance.love/game/init.lua +++ b/sonic-radiance.love/game/init.lua @@ -40,6 +40,8 @@ function Game:new() self.characters = Characters(self) self.ennemies = Ennemies(self) self.skills = Skills(self) + + self.version = "0.0.0" end function Game:setData(data) diff --git a/sonic-radiance.love/main.lua b/sonic-radiance.love/main.lua index f3e47c7..32ffdc6 100644 --- a/sonic-radiance.love/main.lua +++ b/sonic-radiance.love/main.lua @@ -30,7 +30,7 @@ function love.load() core = Core(true) game = Game() - scenes.cbs() + scenes.debug.menu() end function love.update(dt) diff --git a/sonic-radiance.love/scenes/debug/commons/assets.lua b/sonic-radiance.love/scenes/debug/commons/assets.lua new file mode 100644 index 0000000..244881b --- /dev/null +++ b/sonic-radiance.love/scenes/debug/commons/assets.lua @@ -0,0 +1,51 @@ +return { + ["tilesets"] = { + {"charicons", "assets/sprites/characters/charicons"}, + {"normaltiles", "assets/backgrounds/normaltile"}, + {"sptiles", "assets/backgrounds/specialtile"}, + {"borders", "assets/backgrounds/borders"}, + }, + ["sprites"] = { + {"cursorground", "assets/gui/cursor/ground"}, + {"hitGFX", "assets/sprites/gfx/hit"}, + }, + ["textures"] = { + {"menucursor", "assets/gui/cursor-menulist.png"}, + {"statusbar", "assets/gui/status_bar.png"}, + {"cursorpeak", "assets/gui/cursor/peak.png"}, + {"actorsShadow", "assets/sprites/shadow.png"}, + {"emptytile", "assets/backgrounds/tilemask.png"}, + + {"e_speedster", "assets/gui/emblem_speedster.png"}, + {"e_technic", "assets/gui/emblem_technic.png"}, + {"e_power", "assets/gui/emblem_power.png"}, + + {"m_speedster", "assets/gui/emblem_speedster_mask.png"}, + {"m_technic", "assets/gui/emblem_technic_mask.png"}, + {"m_power", "assets/gui/emblem_power_mask.png"}, + + {"hudturn", "assets/gui/strings/hudturn.png"}, + {"battlecompleted", "assets/gui/strings/battle_completed.png" } + }, + ["fonts"] = { + {"small", "assets/gui/fonts/PixelOperator.ttf", 16}, + {"victory", "assets/gui/fonts/vipnagorgialla.ttf", 12} + }, + ["imagefonts"] = { + {"hudnbrs", "assets/gui/fonts/hudnumbers"}, + {"hudnbrs_small", "assets/gui/fonts/hudsmallnumbers"}, + }, + ["sfx"] = { + {"hit", "assets/sfx/hit.wav"}, + {"hitconnect", "assets/sfx/hitconnect.wav"}, + {"jump", "assets/sfx/jump.wav"}, + {"woosh", "assets/sfx/woosh.wav"}, + {"spincharge", "assets/sfx/spincharge.wav"}, + {"spinrelease", "assets/sfx/spinrelease.wav"}, + + {"mBack", "assets/sfx/menus/back.wav"}, + {"mBeep", "assets/sfx/menus/beep.wav"}, + {"mSelect", "assets/sfx/menus/select.wav"}, + {"mError", "assets/sfx/menus/error.wav"}, + } +} diff --git a/sonic-radiance.love/scenes/debug/commons/menu.lua b/sonic-radiance.love/scenes/debug/commons/menu.lua new file mode 100644 index 0000000..d60d79f --- /dev/null +++ b/sonic-radiance.love/scenes/debug/commons/menu.lua @@ -0,0 +1,60 @@ +local menu = {} + +local ListBox = require "core.modules.menusystem.listbox" +local Widget = require "core.modules.menusystem.widgets" + +menu.DebugMenu = ListBox:extend() +menu.DebugWidget = Widget.Text:extend() +menu.SubMenuWidget = menu.DebugWidget:extend() + +local CONST = {} +CONST.MENU = {} +CONST.MENU.X = 16 +CONST.MENU.Y = 48 +CONST.MENU.W = 424/2 +CONST.MENU.ITEM_NUMBER = 10 +CONST.MENU.ITEM_HEIGHT = 18 + +-- Basic menu structure +function menu.DebugMenu:new(scene, name) + self.scene = scene + local x, y = CONST.MENU.X, CONST.MENU.Y + local w, h = CONST.MENU.W, CONST.MENU.ITEM_NUMBER * CONST.MENU.ITEM_HEIGHT + menu.DebugMenu.super.new(self, scene.menusystem, name, x, y, w, h, CONST.MENU.ITEM_NUMBER) +end + +function menu.DebugMenu:drawCursor() + +end + +-- Widget +function menu.DebugWidget:new(scene, menu_name, label) + local font = scene.assets.fonts["small"] + self.scene = scene + local widgetMenu = scene.menusystem.menus[menu_name] + menu.DebugWidget.super.new(self, widgetMenu, font, label) +end + +function menu.DebugWidget:drawCanvas() + local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) + self.font:draw(self.label, 8, h, -1, "left") +end + +function menu.DebugWidget:drawSelected(x, y, w, h) + love.graphics.setColor(1, 1, 0, 1) + self:draw(x, y, w, h) + utils.graphics.resetColor() +end + +-- SubMenuWidget +function menu.SubMenuWidget:new(scene, menu_name, newmenu, name) + menu.SubMenuWidget.super.new(self, scene, menu_name, name) + self.newmenu = newmenu or "BaseMenu" +end + +function menu.SubMenuWidget:action() + self.scene.menusystem:switchMenu(self.newmenu) +end + + +return menu diff --git a/sonic-radiance.love/scenes/debug/init.lua b/sonic-radiance.love/scenes/debug/init.lua new file mode 100644 index 0000000..1cf1b92 --- /dev/null +++ b/sonic-radiance.love/scenes/debug/init.lua @@ -0,0 +1,3 @@ +return { + menu = require "scenes.debug.menu" +} diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua new file mode 100644 index 0000000..37886aa --- /dev/null +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -0,0 +1,75 @@ +local Scene = require "core.modules.scenes" +local menu = require "scenes.debug.menu.menu" + +local DebugMenu = Scene:extend() + +function DebugMenu:new() + DebugMenu.super.new(self) + self.assets:batchImport("scenes.debug.commons.assets") + menu.commons.DebugMenu(self, "BaseMenu") + menu.SceneWidget(self, "BaseMenu", scenes.title, "Launch Game") + self:buildBattleMenu() + self:buildOverworldMenu() + self:buildSaveMenu() + self:buildOtherMenu() + self:buildOptionsMenu() + menu.ExitWidget(self, "BaseMenu") + + self.menusystem:activate() + self.menusystem:switchMenu("BaseMenu") +end + +function DebugMenu:buildOptionsMenu() + self:addSubMenu("options", "BaseMenu", "Options") + self:addSubMenu("backgrounds", "options", "Set Background") + menu.ShowBackgroundWidget(self, "options") + + menu.commons.SubMenuWidget(self, "backgrounds", "options", "Back") + menu.commons.SubMenuWidget(self, "options", "BaseMenu", "Back") +end + +function DebugMenu:buildOverworldMenu() + self:addSubMenu("overworld", "BaseMenu", "Overworld") + menu.commons.SubMenuWidget(self, "overworld", "BaseMenu", "Back") +end + +function DebugMenu:buildBattleMenu() + self:addSubMenu("combat", "BaseMenu", "Battle System") + menu.SceneWidget(self, "combat", scenes.cbs, "Launch Battle") + + menu.commons.SubMenuWidget(self, "combat", "BaseMenu", "Back") +end + +function DebugMenu:buildSaveMenu() + self:addSubMenu("save", "BaseMenu", "Save System") + menu.commons.SubMenuWidget(self, "save", "BaseMenu", "Back") +end + +function DebugMenu:buildOtherMenu() + self:addSubMenu("other", "BaseMenu", "Other gameplay") + menu.SceneWidget(self, "other", scenes.test, "Minigame Engine") + + menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back") +end + + +function DebugMenu:update(dt) + if (love.keyboard.isDown("space") and (not self.menusystem.isActive)) then + self.menusystem:activate() + end +end + +function DebugMenu:addSubMenu(submenu, parent, name) + local parent = parent or "BaseMenu" + menu.commons.DebugMenu(self, submenu) + menu.commons.SubMenuWidget(self, parent, submenu, name .. " >") +end + +function DebugMenu:draw() + if (self.menusystem.isActive) then + self.assets.fonts["small"]:print("## SONIC RADIANCE - DEBUG MENU ##", 424/2, 8, "center") + self.assets.fonts["small"]:print("v" .. game.version, 424 - 8, 240 - 22, "right") + end +end + +return DebugMenu; diff --git a/sonic-radiance.love/scenes/debug/menu/menu.lua b/sonic-radiance.love/scenes/debug/menu/menu.lua new file mode 100644 index 0000000..609ae60 --- /dev/null +++ b/sonic-radiance.love/scenes/debug/menu/menu.lua @@ -0,0 +1,36 @@ +local commons = require "scenes.debug.commons.menu" +local menu = {} +menu.commons = commons +menu.ExitWidget = commons.DebugWidget:extend() +menu.ShowBackgroundWidget = commons.DebugWidget:extend() +menu.SceneWidget = commons.DebugWidget:extend() + +-- ExitWidget +function menu.ExitWidget:new(scene, menuName) + menu.ExitWidget.super.new(self, scene, menuName, "Exit") +end + +function menu.ExitWidget:action() + love.event.quit("000") +end + +-- ShowBackground +function menu.ShowBackgroundWidget:new(scene, menuName) + menu.ShowBackgroundWidget.super.new(self, scene, menuName, "Show Background") +end + +function menu.ShowBackgroundWidget:action() + self.scene.menusystem:deactivate() +end + +-- SceneWidget +function menu.SceneWidget:new(scene, menuName, newScene, newSceneName) + menu.SceneWidget.super.new(self, scene, menuName, newSceneName) + self.newScene = newScene +end + +function menu.SceneWidget:action() + self.newScene() +end + +return menu diff --git a/sonic-radiance.love/scenes/init.lua b/sonic-radiance.love/scenes/init.lua index 64af5eb..1354fae 100644 --- a/sonic-radiance.love/scenes/init.lua +++ b/sonic-radiance.love/scenes/init.lua @@ -2,4 +2,5 @@ return { test = require "scenes.test_scene", title = require "scenes.titlescreen", cbs = require "scenes.battlesystem", + debug = require "scenes.debug", } From 0984ce370e7ff14992a193b50101af23d73ef6b2 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 12:50:11 +0200 Subject: [PATCH 53/68] chore: make the scene change widget a common element --- sonic-radiance.love/scenes/debug/commons/menu.lua | 11 +++++++++++ sonic-radiance.love/scenes/debug/menu/init.lua | 6 +++--- sonic-radiance.love/scenes/debug/menu/menu.lua | 11 ----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sonic-radiance.love/scenes/debug/commons/menu.lua b/sonic-radiance.love/scenes/debug/commons/menu.lua index d60d79f..3e89687 100644 --- a/sonic-radiance.love/scenes/debug/commons/menu.lua +++ b/sonic-radiance.love/scenes/debug/commons/menu.lua @@ -6,6 +6,7 @@ local Widget = require "core.modules.menusystem.widgets" menu.DebugMenu = ListBox:extend() menu.DebugWidget = Widget.Text:extend() menu.SubMenuWidget = menu.DebugWidget:extend() +menu.SceneWidget = menu.DebugWidget:extend() local CONST = {} CONST.MENU = {} @@ -56,5 +57,15 @@ function menu.SubMenuWidget:action() self.scene.menusystem:switchMenu(self.newmenu) end +-- SceneWidget +function menu.SceneWidget:new(scene, menuName, newScene, newSceneName) + menu.SceneWidget.super.new(self, scene, menuName, newSceneName) + self.newScene = newScene +end + +function menu.SceneWidget:action() + self.newScene() +end + return menu diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index 37886aa..d42bb81 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -7,7 +7,7 @@ function DebugMenu:new() DebugMenu.super.new(self) self.assets:batchImport("scenes.debug.commons.assets") menu.commons.DebugMenu(self, "BaseMenu") - menu.SceneWidget(self, "BaseMenu", scenes.title, "Launch Game") + menu.commons.SceneWidget(self, "BaseMenu", scenes.title, "Launch Game") self:buildBattleMenu() self:buildOverworldMenu() self:buildSaveMenu() @@ -35,7 +35,7 @@ end function DebugMenu:buildBattleMenu() self:addSubMenu("combat", "BaseMenu", "Battle System") - menu.SceneWidget(self, "combat", scenes.cbs, "Launch Battle") + menu.commons.SceneWidget(self, "combat", scenes.cbs, "Launch Battle") menu.commons.SubMenuWidget(self, "combat", "BaseMenu", "Back") end @@ -47,7 +47,7 @@ end function DebugMenu:buildOtherMenu() self:addSubMenu("other", "BaseMenu", "Other gameplay") - menu.SceneWidget(self, "other", scenes.test, "Minigame Engine") + menu.commons.SceneWidget(self, "other", scenes.test, "Minigame Engine") menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back") end diff --git a/sonic-radiance.love/scenes/debug/menu/menu.lua b/sonic-radiance.love/scenes/debug/menu/menu.lua index 609ae60..630ff18 100644 --- a/sonic-radiance.love/scenes/debug/menu/menu.lua +++ b/sonic-radiance.love/scenes/debug/menu/menu.lua @@ -3,7 +3,6 @@ local menu = {} menu.commons = commons menu.ExitWidget = commons.DebugWidget:extend() menu.ShowBackgroundWidget = commons.DebugWidget:extend() -menu.SceneWidget = commons.DebugWidget:extend() -- ExitWidget function menu.ExitWidget:new(scene, menuName) @@ -23,14 +22,4 @@ function menu.ShowBackgroundWidget:action() self.scene.menusystem:deactivate() end --- SceneWidget -function menu.SceneWidget:new(scene, menuName, newScene, newSceneName) - menu.SceneWidget.super.new(self, scene, menuName, newSceneName) - self.newScene = newScene -end - -function menu.SceneWidget:action() - self.newScene() -end - return menu From 55eca74922142c26b2dc98643f2eae7c828b2365 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 12:53:06 +0200 Subject: [PATCH 54/68] feat: add a way to test Shadow Shot style maps --- .../scenes/debug/menu/init.lua | 3 +- sonic-radiance.love/scenes/init.lua | 1 + .../scenes/test_scene2/assets.lua | 17 +++++++ .../scenes/test_scene2/init.lua | 44 +++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 sonic-radiance.love/scenes/test_scene2/assets.lua create mode 100644 sonic-radiance.love/scenes/test_scene2/init.lua diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index d42bb81..39c33a4 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -47,7 +47,8 @@ end function DebugMenu:buildOtherMenu() self:addSubMenu("other", "BaseMenu", "Other gameplay") - menu.commons.SceneWidget(self, "other", scenes.test, "Minigame Engine") + menu.commons.SceneWidget(self, "other", scenes.test, "Sonic Battle Maps") + menu.commons.SceneWidget(self, "other", scenes.test2, "Shadow Shot Maps") menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back") end diff --git a/sonic-radiance.love/scenes/init.lua b/sonic-radiance.love/scenes/init.lua index 1354fae..58bf0ee 100644 --- a/sonic-radiance.love/scenes/init.lua +++ b/sonic-radiance.love/scenes/init.lua @@ -1,5 +1,6 @@ return { test = require "scenes.test_scene", + test2 = require "scenes.test_scene2", title = require "scenes.titlescreen", cbs = require "scenes.battlesystem", debug = require "scenes.debug", diff --git a/sonic-radiance.love/scenes/test_scene2/assets.lua b/sonic-radiance.love/scenes/test_scene2/assets.lua new file mode 100644 index 0000000..d749a61 --- /dev/null +++ b/sonic-radiance.love/scenes/test_scene2/assets.lua @@ -0,0 +1,17 @@ +return { + ["textures"] = { + {"shadow", "assets/sprites/shadow.png"} + }, + ["sprites"] = { + {"sonic", "datas/gamedata/characters/sonic/sprites"}, + {"ring", "assets/sprites/items/ring"} + }, + ["imagefonts"] = { + --{"medium", "assets/fonts/medium"} + }, + ["sfx"] = { + --{"navigate", "assets/sfx/menu_move.mp3"}, + --{"confirm", "assets/sfx/menu_confirm.mp3"}, + --{"cancel", "assets/sfx/menu_error.mp3"}, + } +} diff --git a/sonic-radiance.love/scenes/test_scene2/init.lua b/sonic-radiance.love/scenes/test_scene2/init.lua new file mode 100644 index 0000000..0550982 --- /dev/null +++ b/sonic-radiance.love/scenes/test_scene2/init.lua @@ -0,0 +1,44 @@ +-- scenes/moveplayer3D :: a basic player movement example in fake3D + +--[[ + Copyright © 2019 Kazhnuz + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +]] + +local Scene = require "core.modules.scenes" +local MovePlayer = Scene:extend() + +local World = require "game.modules.world" + +function MovePlayer:new(playerNumber, cameraMode) + local playerNumber = playerNumber or 1 + local cameraMode = cameraMode or "split" + + MovePlayer.super.new(self) + self.assets:batchImport("scenes.test_scene.assets") + + World(self, "shoot", "forest") + + self.world:setPlayerNumber(playerNumber) + self.world.cameras:setMode(cameraMode) + + self.world:loadMap() +end + +return MovePlayer From 1ec185cc3aba2dd234a8e8c65e039a6803c9ec27 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 13:34:39 +0200 Subject: [PATCH 55/68] improvement: use a common object for parallax handling --- .../modules/drawing/parallaxBackground.lua} | 87 +++++++++----- .../game/modules/world/maps/shoot.lua | 106 +----------------- .../scenes/battlesystem/world.lua | 7 +- 3 files changed, 69 insertions(+), 131 deletions(-) rename sonic-radiance.love/{scenes/battlesystem/map.lua => game/modules/drawing/parallaxBackground.lua} (54%) diff --git a/sonic-radiance.love/scenes/battlesystem/map.lua b/sonic-radiance.love/game/modules/drawing/parallaxBackground.lua similarity index 54% rename from sonic-radiance.love/scenes/battlesystem/map.lua rename to sonic-radiance.love/game/modules/drawing/parallaxBackground.lua index 71d7b57..962ecbf 100644 --- a/sonic-radiance.love/scenes/battlesystem/map.lua +++ b/sonic-radiance.love/game/modules/drawing/parallaxBackground.lua @@ -1,24 +1,26 @@ -local Map = Object:extend() +local ParallaxBackground = Object:extend() local maputils = require "scenes.battlesystem.utils" -local HEIGHT = 5 -local BOTTOM_BORDER = 1 - -function Map:new(world, type, terrain) - self.world = world - self.assets = self.world.assets - self.scene = self.world.scene +function ParallaxBackground:new(scene, height, bottomBorder, type) + self.scene = scene + self.assets = self.scene.assets self.datas = {} self.datas.type = type or "forest" + self.height = height + self.bottomBorder = bottomBorder + local zones = require "datas.gamedata.maps.shoot.zones" local datas = zones[self.datas.type] self.datas.background = datas.background self.datas.tiles = datas.tiles self.datas.borders = datas.borders + self.assets:addTileset("normaltiles", "assets/backgrounds/normaltile") + self.assets:addTileset("borders", "assets/backgrounds/borders") + local backpath = "assets/backgrounds/parallax/" .. self.datas.background self.assets:addImage("back1", backpath .. "-back.png") self.assets:addImage("back2", backpath .. "-fore.png") @@ -31,27 +33,27 @@ end -- GET FUNCTIONS -- Get information from the map -function Map:getTotalHeight() - return HEIGHT + BOTTOM_BORDER; +function ParallaxBackground:getTotalHeight() + return self.height + self.bottomBorder; end -function Map:getTerrain(x, y) - if (y <= HEIGHT) then +function ParallaxBackground:getTerrain(x, y) + if (y <= self.height) then return 0 else return nil end end -function Map:isInGrid(x, y) +function ParallaxBackground:isInGrid(x, y) return ( self:getTerrain(x, y) ~= nil ) end -function Map:getStartY() +function ParallaxBackground:getStartY() return 240 - (self:getTotalHeight() * 20) - 10 end -function Map:gridToPixel(x, y, center) +function ParallaxBackground:gridToPixel(x, y, center) local pixelx, pixely local center = center or false local x, y = x, y @@ -70,7 +72,7 @@ end -- DRAW FUNCTIONS -- Draw the battle map -function Map:generateFloor(tile) +function ParallaxBackground:generateFloor(tile) local canvas = love.graphics.newCanvas(31*16, self:getTotalHeight() * 20) local tile = tile or 1 @@ -99,14 +101,24 @@ function Map:generateFloor(tile) return texture end - -function Map:draw() - self:drawBackgrounds() - self:drawBorders() - love.graphics.draw(self.texture.floor, maputils.CONST.STARTX, self:getStartY()) +function ParallaxBackground:draw() + self:drawParallax(0, -self:getStartY(), 424, 240) end -function Map:drawBackgrounds() +function ParallaxBackground:drawParallax(x, y, w, h) + self:drawBackground(x, y, w, h) + self:drawForeground(x, y, w, h) + --love.graphics.draw(self.texture.floor, maputils.CONST.STARTX, self:getStartY()) + local w2, _ = self.texture.floor:getDimensions() + for i=1, 2 do + local x2 = x % w2 + love.graphics.draw(self.texture.floor, ((i-1)*31*16)-x2, -y) + end + self:drawBorders(x, y, w, h) +end + + +function ParallaxBackground:drawBackgrounds() local w, _ = core.screen:getDimensions() local w2, h2 = self.assets.images["back1"]:getDimensions() @@ -123,12 +135,31 @@ function Map:drawBackgrounds() end -function Map:drawBorders() - local border = self.datas.borders + 1 - for i=1, 7 do - self.assets.tileset["borders"]:drawTile(border, (i-1)*80, self:getStartY()-10 , 0, 1, 1) - self.assets.tileset["borders"]:drawTile(border, (i-1)*80, 240-10, 0, 1, 1) +function ParallaxBackground:drawBackground(x, y, w, h) + local w2, h2 = self.assets.images["back1"]:getDimensions() + local imax = math.ceil(w / w2) + 1 + for i=1, imax do + local x1 = (x / 5) % w2 + self.assets.images["back1"]:draw((i-1)*w2 - x1, 0, 0, 1, 1, 0, 0) end end -return Map +function ParallaxBackground:drawForeground(x, y, w, h) + local w2, h2 = self.assets.images["back2"]:getDimensions() + local imax = math.ceil(w / w2) + 1 + for i=1, imax do + local x1 = (x / 2) % w2 + self.assets.images["back2"]:draw((i-1)*w2 - x1, -y, 0, 1, 1, 0, h2) + end +end + +function ParallaxBackground:drawBorders(x, y) + local border = self.datas.borders + 1 + for i=1, 7 do + local x2 = x % 80 + self.assets.tileset["borders"]:drawTile(border, (i-1)*80 - x2, -y, 0, 1, 1, 0, 10) + self.assets.tileset["borders"]:drawTile(border, (i-1)*80 - x2, -(y-self:getTotalHeight()*20), 0, 1, 1) + end +end + +return ParallaxBackground diff --git a/sonic-radiance.love/game/modules/world/maps/shoot.lua b/sonic-radiance.love/game/modules/world/maps/shoot.lua index 9d31340..cf3c1e9 100644 --- a/sonic-radiance.love/game/modules/world/maps/shoot.lua +++ b/sonic-radiance.love/game/modules/world/maps/shoot.lua @@ -4,13 +4,15 @@ local ShootMap = BaseMap:extend() local TILESIZE = 31 local TESTZONE = "forest" -local zoneDatas = require "datas.gamedata.maps.shoot.zones" +local zoneDatas = require "datas.gamedata.maps.shoot.zones" +local Background = require "game.modules.drawing.parallaxBackground" + function ShootMap:new(world, maptype, mapname) ShootMap.super.new(self, world) self:setPadding(0, 0, 0, 0) - self:generateTextures(2, "tunnel") + self.parallaxBackground = Background(world.scene, 5, 1, "tunnel") end function ShootMap:loadCollisions() @@ -34,112 +36,14 @@ function ShootMap:loadActors() -- Empty Placeholder function end -function ShootMap:generateTextures(tile, background) - - self.texture = {} - self.texture.floor = self:generateFloor(tile) - self.texture.border = love.graphics.newImage("assets/backgrounds/borders.png") - self.quads = {} - local w, h = self.texture.border:getDimensions() - self.quads.borders = love.graphics.newQuad(0, tile*10, 80, 10, w, h) - - self:addParallax(background) -end - -function ShootMap:generateFloor(tile) - local canvas = love.graphics.newCanvas(31*16, 100) - local tile = tile or 1 - - local tileTexture = love.graphics.newImage("assets/backgrounds/normaltile.png") - local tileQuad = {} - local w, h = tileTexture:getDimensions() - tileQuad[1] = love.graphics.newQuad( 0, tile*24, 40, 24, w, h) - tileQuad[2] = love.graphics.newQuad(40, tile*24, 40, 24, w, h) - - love.graphics.setCanvas( canvas ) - - for i=1, 5 do - for j=0, 18 do - local tiley = (i-1)*20 - 4 - local tilex = (j-2)*31 + (i-1)*10 - local variant = 1 + ((i + j) % 2) - love.graphics.draw(tileTexture, tileQuad[variant], tilex, tiley) - end - end - - love.graphics.setCanvas( ) - - local imagedata = canvas:newImageData() - local texture = love.graphics.newImage( imagedata ) - imagedata:release() - canvas:release() - return texture -end - function ShootMap:draw() for i=1, 10 do --love.graphics.draw(self.texture.floor, ((i-1)*31*16), 0) end end -function ShootMap:addParallax(filename) - -- Empty Placeholder function - local filename = filename or "forest" - local backfolder = "assets/backgrounds/parallax/" - filename = backfolder .. filename - self.texture.back1 = love.graphics.newImage(filename .. "-back.png") - self.texture.back2 = love.graphics.newImage(filename .. "-fore.png") - self.texture.cliff = love.graphics.newImage(filename .. "-cliff.png") -end - function ShootMap:drawParallax(x, y, w, h) - - self:drawBackground(x, y, w, h) - self:drawForeground(x, y + 10, w, h) - local w2, _ = self.texture.floor:getDimensions() - for i=1, 2 do - local x2 = x % w2 - love.graphics.draw(self.texture.floor, ((i-1)*31*16)-x2, -y) - end - - self:drawBorder(x, y + 10) - self:drawBorder(x, y - 100) - self:drawCliff(x, y - 110, w, h) + self.parallaxBackground:drawParallax(x, y, w, h) end -function ShootMap:drawBackground(x, y, w, h) - local w2, h2 = self.texture.back1:getDimensions() - local imax = math.ceil(w / w2) + 1 - for i=1, imax do - local x1 = (x / 5) % w2 - love.graphics.draw(self.texture.back1, (i-1)*w2 - x1, 0, 0, 1, 1, 0, 0) - end -end - -function ShootMap:drawForeground(x, y, w, h) - local w2, h2 = self.texture.back2:getDimensions() - local imax = math.ceil(w / w2) + 1 - for i=1, imax do - local x1 = (x / 2) % w2 - love.graphics.draw(self.texture.back2, (i-1)*w2 - x1, -y, 0, 1, 1, 0, h2) - end -end - -function ShootMap:drawBorder(x, y) - for i=1, 7 do - local x2 = x % 80 - love.graphics.draw(self.texture.border, self.quads.borders, (i-1)*80 - x2, -y, 0, 1, 1) - end -end - -function ShootMap:drawCliff(x, y, w, h) - local w2, h2 = self.texture.cliff:getDimensions() - local imax = math.ceil(w / w2) + 1 - for i=1, imax do - local x1 = (x) % w2 - love.graphics.draw(self.texture.cliff, (i-1)*w2 - x1, -y, 0, 1, 1, 0, 0) - end -end - - return ShootMap diff --git a/sonic-radiance.love/scenes/battlesystem/world.lua b/sonic-radiance.love/scenes/battlesystem/world.lua index 83ef709..75a5907 100644 --- a/sonic-radiance.love/scenes/battlesystem/world.lua +++ b/sonic-radiance.love/scenes/battlesystem/world.lua @@ -1,7 +1,7 @@ local World = Object:extend() local maputils = require "scenes.battlesystem.utils" -local Map = require "scenes.battlesystem.map" +local Map = require "game.modules.drawing.parallaxBackground" local TweenManager = require "game.modules.tweenmanager" @@ -11,6 +11,9 @@ local POSITIONS = { {x = 2, y = 6}, } +local HEIGHT = 5 +local BORDER_BOTTOM = 2 + local gui = require "game.modules.gui" -- INIT FUNCTIONS @@ -25,7 +28,7 @@ function World:new(scene, battlefile) self.actors = {} self.globalID = 0 - self.map = Map(self, "city") + self.map = Map(scene, HEIGHT, BORDER_BOTTOM, "city") self.isBattleActive = false end From cb5f9eec5a83d2a8ead17b0c2fd2bac701130da0 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 14:01:08 +0200 Subject: [PATCH 56/68] feat: background viewer --- .../scenes/debug/commons/menu.lua | 9 ++++- sonic-radiance.love/scenes/debug/init.lua | 5 ++- .../scenes/debug/menu/init.lua | 1 + .../scenes/debug/viewers/battleBack/init.lua | 40 +++++++++++++++++++ .../scenes/debug/viewers/battleBack/menu.lua | 18 +++++++++ 5 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 sonic-radiance.love/scenes/debug/viewers/battleBack/init.lua create mode 100644 sonic-radiance.love/scenes/debug/viewers/battleBack/menu.lua diff --git a/sonic-radiance.love/scenes/debug/commons/menu.lua b/sonic-radiance.love/scenes/debug/commons/menu.lua index 3e89687..4dcb1f0 100644 --- a/sonic-radiance.love/scenes/debug/commons/menu.lua +++ b/sonic-radiance.love/scenes/debug/commons/menu.lua @@ -13,7 +13,7 @@ CONST.MENU = {} CONST.MENU.X = 16 CONST.MENU.Y = 48 CONST.MENU.W = 424/2 -CONST.MENU.ITEM_NUMBER = 10 +CONST.MENU.ITEM_NUMBER = 8 CONST.MENU.ITEM_HEIGHT = 18 -- Basic menu structure @@ -28,6 +28,13 @@ function menu.DebugMenu:drawCursor() end +function menu.DebugMenu:draw() + love.graphics.setColor(0, 0, 0, 0.5) + love.graphics.rectangle("fill", self.x, self.y, self.w, self.h) + utils.graphics.resetColor() + menu.DebugMenu.super.draw(self) +end + -- Widget function menu.DebugWidget:new(scene, menu_name, label) local font = scene.assets.fonts["small"] diff --git a/sonic-radiance.love/scenes/debug/init.lua b/sonic-radiance.love/scenes/debug/init.lua index 1cf1b92..f255393 100644 --- a/sonic-radiance.love/scenes/debug/init.lua +++ b/sonic-radiance.love/scenes/debug/init.lua @@ -1,3 +1,6 @@ return { - menu = require "scenes.debug.menu" + menu = require "scenes.debug.menu", + viewers = { + battleBack = require "scenes.debug.viewers.battleBack" + } } diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index 39c33a4..bae199c 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -36,6 +36,7 @@ end function DebugMenu:buildBattleMenu() self:addSubMenu("combat", "BaseMenu", "Battle System") menu.commons.SceneWidget(self, "combat", scenes.cbs, "Launch Battle") + menu.commons.SceneWidget(self, "combat", scenes.debug.viewers.battleBack, "Background Viewer") menu.commons.SubMenuWidget(self, "combat", "BaseMenu", "Back") end diff --git a/sonic-radiance.love/scenes/debug/viewers/battleBack/init.lua b/sonic-radiance.love/scenes/debug/viewers/battleBack/init.lua new file mode 100644 index 0000000..e368bb4 --- /dev/null +++ b/sonic-radiance.love/scenes/debug/viewers/battleBack/init.lua @@ -0,0 +1,40 @@ +local Scene = require "core.modules.scenes" +local menu = require "scenes.debug.viewers.battleBack.menu" + +local BackgroundViewer = Scene:extend() +local Background = require "game.modules.drawing.parallaxBackground" +local backgroundList = require "datas.gamedata.maps.shoot.zones" + + +function BackgroundViewer:new() + BackgroundViewer.super.new(self) + self.assets:batchImport("scenes.debug.commons.assets") + menu.commons.DebugMenu(self, "MainMenu") + + self:setBackground("city") + + for backId, backgroundData in pairs(backgroundList) do + menu.ShowBackgroundWidget(self, "MainMenu", backgroundData.name, backId) + end + menu.commons.SceneWidget(self, "MainMenu", scenes.debug.menu, "Back") + + self.menusystem:activate() + self.menusystem:switchMenu("MainMenu") +end + + +function BackgroundViewer:update(dt) + if (love.keyboard.isDown("z") and (not self.menusystem.isActive)) then + self.menusystem:activate() + end +end + +function BackgroundViewer:setBackground(newBackground) + self.background = Background(self, 5, 1, newBackground) +end + +function BackgroundViewer:draw() + self.background:draw() +end + +return BackgroundViewer diff --git a/sonic-radiance.love/scenes/debug/viewers/battleBack/menu.lua b/sonic-radiance.love/scenes/debug/viewers/battleBack/menu.lua new file mode 100644 index 0000000..dd1230d --- /dev/null +++ b/sonic-radiance.love/scenes/debug/viewers/battleBack/menu.lua @@ -0,0 +1,18 @@ +local commons = require "scenes.debug.commons.menu" +local menu = {} +menu.commons = commons +menu.ShowBackgroundWidget = menu.commons.DebugWidget:extend() + +-- ShowBackground +function menu.ShowBackgroundWidget:new(scene, menuName, backgroundName, backgroundId) + menu.ShowBackgroundWidget.super.new(self, scene, menuName, backgroundName) + self.backgroundId = backgroundId +end + +function menu.ShowBackgroundWidget:action() + self.scene:setBackground(self.backgroundId) + self.scene.menusystem:deactivate() +end + + +return menu From efa7909f830dcaf1d498ad611c096fba257ca7fc Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 14:07:35 +0200 Subject: [PATCH 57/68] fix: better backgrounds --- .../backgrounds/parallax/forest-back.png | Bin 4637 -> 8282 bytes .../backgrounds/parallax/forest-fore.png | Bin 2533 -> 19306 bytes .../backgrounds/parallax/hills-back.png | Bin 4393 -> 6519 bytes .../backgrounds/parallax/hills-fore.png | Bin 3976 -> 5703 bytes .../modules/drawing/parallaxBackground.lua | 2 +- 5 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-radiance.love/assets/backgrounds/parallax/forest-back.png b/sonic-radiance.love/assets/backgrounds/parallax/forest-back.png index 760bcccc75af0efa47b231515ea9a7dba18f54a6..3e87be8d2afc782187d860552adab36cdd240cd2 100644 GIT binary patch literal 8282 zcmZvAWl$Wz((U3di@UoeXaWRxUtEH_>jsCgI0^2u=(4yI+zA1KyAw3HORxYh_kQ)g zAFp0b_e@pK)YO@pt~#eX2BfZlgGqr2003~56lJyktr!2?5gqm499p*40ss(?`s)~g zwJdz-+&$fF9h`0Gz<%yFbT+;Ywg72>DYjjo3 z8TkZu+;!hr1rhKJU&9zd!{_B#qV@?-yy13RtET!!>jQ0hscRT*_G@75o#6dVcXz^5 z(ASOEn|98fr^rjK-GIM;S4Qq`zaJ0Y{s{^S8Y1t^`%GDue@=Nl=@xq~xzJ4*X!e@L z7CDLhB3ehe0VxWyQ_tVn_kqJ(9-l}S?jD~SQ~o@h-!T7hWX=E)nx#A#sqF9DitBDS zH%%FA{Ow_RJU&0$*RoRcwv5iJRpX4!e+_$u)RHtlcM@zY_L{rFtw*8z8B?FP9}^^A zrbpH%XL{IQwUs|V-(=`4UbJL+zbTN&80fJs`}_FfV}|#Tu(*EC9_07rvZvK8v7B$F zf%*HKR>E-hHNdCiF3|g(mc{7rj`Do&?)+9)$1)%Nt;Q>frxNqy#_MJK7&(!5azYQr zg=ki1lv+y`;gl0k-Tjs^KjU?~bGW}+2%9=H!B+hp)E}`I9Zx)lHR2>6?QlO6=?BKd8)rVe9Kt|%J^<+fOunxeN!a%UmblFKj(d*i z$PGyaeKXuFImOJo&N*^MU+NR7+C$pfN+W&BZJs)@@sp#ezJ5(xyLqpur=0azUal#_ zI0W^aU|wAFoP-S&;c~)B=#R?kOR}BHo0?aS-MO3RJ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NmY@q=GyPFtFKh~$*bY)c`xCssyG5}5BZV9?P9e%U=wnsfHJ>F+i=zXla zb0USgsK21v(99=id)ZFul$lznLOXViv|Iv?87*k}I>dxdIY}G2Y?y`t%(GxEx|*!y z$M>sWNA3EuIA(;?b!ux`EHmFyBPLgZ|2p9P9 z>(DBo355bt^M;0F+hke=|JzS=55?^RbB7`Y5P z(3nqUdf7gV?m5b%9^o3MZP7#7Cj)U~wuedFDU)rb^qCg=(KJ!@5I@=DiRT{PWRIdS z@XlZZl`al!d1Q_M8D#+iPkR_gzxy^dcv$`fR16ZGFe$-G)SdF%x_5=Fhr$5a`h;Gh z6CjY)Q6Hm%7Uw3<-g-`SVri~Fv0(Ynw~t+qo;%l^;9oBl^x$4G?e(X*@@(&`z4gD$5%X*|<+ z^ed-vs79Ceabb8(-usBwNX{;;2+2)GZX zyPe!iQJEC;0ajihePfCE5i;DXzsnL}O2ws7_k8i!7f#2g9MXlO*roxe#Ja-ad z2dS|BRj}iu7i&-A=;9eWt=mhUAFqBsv;*ir*p&_$i+MehpE}&TJv!wAE;GTY=@s!;V?Z`i2ddbf84{K^o+d2ygN~NXWG;4 YX8gL{Z~SD2-xm-b61}f^Z}OG@0j=Zs>Hq)$ diff --git a/sonic-radiance.love/assets/backgrounds/parallax/hills-back.png b/sonic-radiance.love/assets/backgrounds/parallax/hills-back.png index 9fd94090b74af13cdadac58cf4d63b3e75cfb305..da44d1cdc7418c82a50f3ac0309efe3837a509d6 100644 GIT binary patch literal 6519 zcmY*;XH-*5)b^o+^j;;j(2F3#)L6A+{cLI@yIq)V?6q$owCHwC=(W&r6e zktQMvCe#GT7w>()cdhrwIcLwFwV(aWGka#%nv;CrScmoo*9`ywX!Ue8%>aOiU;?iw z$qDZ*&Sn+Dht%t?(Om#&%AmeF62V zw~nP_2LKL)p5|SP@RgsAQXyOV&CPQPN#mUvjE#L0pVD5M5&ErS z$z>g^31We_`7^(gy5!1$yAerjVy0ybQi^TF?2cfExf{LG$-V3iv-Ufa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=Vm9Zvo zJ)SoQmBa#|QWxLvs@NXpk4jh1M05rU9 znv&!>)#P$%rc2UQPLu7egn#YvFTeqK`3PFu%bj+csu~TXl??oe5aC~D{LLMJQ9sS3 z&*HgPf?VdUHAmKeAgxZqzft(N zf}Nf089-STqHJVhTsrsaVqjVp;olhi-8g_eB9l#7uD#_X6``s`_*V*l_YOc;=&n4R zi*j5kj;RvIrGiax1cZMn@Yi<$enQ`-*GBCrO#%IszF*a4MEKVd|9A)BTMnY+{i0=3 zL>n3P+Uz-h*KKtz7s9_0_(vUppW`$}kxD2ES|xa$a^?GVpDRi^^Joj<-#GkR!QIXB ztplh!xdhv%wFQKKe&i8ajsTBK>ujQkSPuW290B2<%NT%72H-13Eqj(zEpl19<+yA^ zUC7rMO?Dw8!oN27w}O?sftC<`gQ*Ht8NT6EM_y%r%)5A|gs7Z_MKqnN}9aT$#j`O4S1CQ=-w6E8W&z^*9b&&NYZNI$ zfzkx1(}tqAaGIvkF8a}gf9>(lZyGRdz(civ*`n&?qTd#`2_;EBwtdw+iSVxk{;lAT zxAh!Adpdu`NP2l$2zjrKmjy1@CtqLpv&%&sI7(DB4S)xSZskGv*Ajny2cWAUgF|~| zne_a%?Q%{V!)s56vQo*+WbW9tu@nA{!QajSxQYfnoNkMOSz{$6E4Hu1Db zMF8VkF(w_=3I9gm?>TRPD}me8pH#P;ZY7nkO3%_#Th%p_I_nbY%8I{9xi;@mQT+c8 X!uYD$krxwS00000NkvXXu0mjfG|6W< diff --git a/sonic-radiance.love/assets/backgrounds/parallax/hills-fore.png b/sonic-radiance.love/assets/backgrounds/parallax/hills-fore.png index 635341431771fb12913c1e5ae73c45c1d945b9dc..1cb948f92055f6781f04b55ad4f5dd2e12db28f3 100644 GIT binary patch literal 5703 zcmZ`-XH-*7w>}6+QRz)eLQz0KKm?^nqy$t52nr%aM0$r%1VU(1q(tRaia?a!1QY~C zs+6E0ftTJ(l+Xht)FkA_@2>CuyK9{}v(9toto`g~_ROBMlg-Vb=h%h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c-halZG_)8!-Rvv8s z)IqhsOydl!Yk$_GyEJnW50Utt9Dq&<`b=?Gy`ajCQ`hDQq5Z?teT4tyM_|FKbn7f7 zMz2|9QpOO`sQ`1-qrILkr(UV!uq7`s2M^I%Oe%gcbjZ90!ad8b+%&I2rJ2=~d3}Fx zIKDx5Tv-iti=@hxl%ZLTavShtDqShE_9hRZtH$jL9)Cgb5Mmse4gRC&gcebS%XRY_ z)Ho{5i!;sdRl*a;4~`xV5o(iTs{R3hw>fF+6}sh=vDmKsvnN@*Oa!T7uw0KGqX3@5 zl?&@{@(?lv64xVdBWerY=7g7!cD9Af?*AI|8Z|NU3(yWa>9)xW|&|M-O{dVj?Gn}v7l5f65?!Grw^Z`osAa6cd6 zum1~n`i|efzrlWZ&!fF!`RC6EIK}6dmwL1Mc>rA!c8Pj)(*sPY$MYXiYjTM!hOr-@ zkL8zn$#eIs=ei%gRCxk1ufY&cu#CKmdH}1r!?o+tV|fT~bAoDKgDf@+ZF}u`4K$oU ppCmV{!WaN$SVo>P2bdz4{{ub%OI9{jh>QRL002ovPDHLkV1m6YfA# Date: Sat, 1 Aug 2020 16:06:08 +0200 Subject: [PATCH 58/68] feat: add basic option menu --- .../assets/gui/fonts/SA2font.lua | 4 + .../assets/gui/fonts/SA2font.png | Bin 0 -> 5623 bytes sonic-radiance.love/assets/gui/fonts/sadv.lua | 4 + .../datas/languages/en/init.lua | 5 + .../datas/languages/en/options.lua | 11 + .../datas/languages/fr/init.lua | 5 + .../datas/languages/fr/options.lua | 11 + .../scenes/debug/menu/init.lua | 11 +- sonic-radiance.love/scenes/init.lua | 1 + sonic-radiance.love/scenes/options/assets.lua | 52 +++ sonic-radiance.love/scenes/options/init.lua | 97 ++++++ .../scenes/options/widgets.lua | 298 ++++++++++++++++++ 12 files changed, 489 insertions(+), 10 deletions(-) create mode 100644 sonic-radiance.love/assets/gui/fonts/SA2font.lua create mode 100644 sonic-radiance.love/assets/gui/fonts/SA2font.png create mode 100644 sonic-radiance.love/assets/gui/fonts/sadv.lua create mode 100644 sonic-radiance.love/datas/languages/en/init.lua create mode 100644 sonic-radiance.love/datas/languages/en/options.lua create mode 100644 sonic-radiance.love/datas/languages/fr/init.lua create mode 100644 sonic-radiance.love/datas/languages/fr/options.lua create mode 100644 sonic-radiance.love/scenes/options/assets.lua create mode 100644 sonic-radiance.love/scenes/options/init.lua create mode 100644 sonic-radiance.love/scenes/options/widgets.lua diff --git a/sonic-radiance.love/assets/gui/fonts/SA2font.lua b/sonic-radiance.love/assets/gui/fonts/SA2font.lua new file mode 100644 index 0000000..8b7e7ff --- /dev/null +++ b/sonic-radiance.love/assets/gui/fonts/SA2font.lua @@ -0,0 +1,4 @@ +return { + glyphs = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZÇÂÄÀÆÉÊËÈÎÏÔÖŒÜÛÙ[\\]^_`abcdefghijklmnopqrstuvwxyzçâäàæéêëèïîôöœûüù{|}", + extraspacing = 0, +} diff --git a/sonic-radiance.love/assets/gui/fonts/SA2font.png b/sonic-radiance.love/assets/gui/fonts/SA2font.png new file mode 100644 index 0000000000000000000000000000000000000000..f377f4cbcd2b9246d5e5f29be720a041f85cc7e2 GIT binary patch literal 5623 zcmYLNcRU;1*H>z^ilWP&)p}4RW{J_7jah2etR168?8IZYjXjGdYSz{oQ6XrlO(Zd+ z8mhL~V)OdF&-;7cKkm8rk8|!h_kPYj_j|r?jSRGzu5w1wE(27MqS&a3C-m}3y`xS#5F4qqnr z!^?j-+Bpp8IvQ{ARS`PPGj-m@6|C)Cq8ZR%6S69R5&FDr#`aJ@y+JV$%kl9x>+!7h zv|oNj1i$cJ5lM^{C)Y1jqrU`p!Vk+!-U&H)J974Gdpy(2h177c>_%G0Av6JX>*4{F zrI4ROm<=7Fa_DxeT{(F^t`w&H#JXY>(QB5zE{?KVou8cAD5cP+XcdtG6D@{9&4X{w zdOoEuE&k?aIhss3=M9U!fnT@$AJWU#2{3)TVf_C$|rB9{DiK z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m0Pecm^nxT?DjmJTCD=&Wl8|q10t%uKQYxuTWNNQ zKZ;@6QpOm~Hkg_eS}&S|cGhQju4){D`AB^q6*i#qnX;LEt5i;<4r69r40!<->f^)Y zfhyqm6gM#b^DYHKoK2r+)*7Ob*mWyh;AKU>k+Rr8j+QpP z>$bJNHHAx{4oT=LAYXB8+r3#;6FjdTD<@Nn*)=HCmiOT4s7TzakHcVzwZ@Ltt4Eec z7ey@#C8uBG&k7~ol&zBDV;F{>mFk+Hq*d|JVDLhfaxgBd0ukn>IcJ>RBH6*O$_^mv zG4wJ`-4x=kWc`1F>_%NRaL_~kqEP~%fi2VC9bWv=*99G&UJfSymV|lRr6K_zL?VO< zx`xIdW;qxHg6(suBiRH0y8%1FkD8#jEM#z7urp?IJkzByub#uE>w@$u(hT5(o|et8 zq1Ybx{Mb7Aabu(=7nuXN%*S?N?8NKMD9`&Z@AX*cT3xl~KXI^6^QsVDwhLTfBf+R| zasMID-j=v_4QZPH*J*Sz7!WGcvqnjiE9|%MEnpE4;;_*Uc|RF&p>dfy>VI+7zsmm* jfsgOl>s+`iJy3NZY9F~X2S6{FTq<2n1C8p(_L2Vsk5x3K literal 0 HcmV?d00001 diff --git a/sonic-radiance.love/assets/gui/fonts/sadv.lua b/sonic-radiance.love/assets/gui/fonts/sadv.lua new file mode 100644 index 0000000..956a37b --- /dev/null +++ b/sonic-radiance.love/assets/gui/fonts/sadv.lua @@ -0,0 +1,4 @@ +return { + glyphs = "abcdefghijklmnopqrstuvwxyz0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ", + extraspacing = 1 +} diff --git a/sonic-radiance.love/datas/languages/en/init.lua b/sonic-radiance.love/datas/languages/en/init.lua new file mode 100644 index 0000000..532eaa3 --- /dev/null +++ b/sonic-radiance.love/datas/languages/en/init.lua @@ -0,0 +1,5 @@ +return { + name = "English", + name_ascii = "English", + subfolder = "en" +} diff --git a/sonic-radiance.love/datas/languages/en/options.lua b/sonic-radiance.love/datas/languages/en/options.lua new file mode 100644 index 0000000..2e5406e --- /dev/null +++ b/sonic-radiance.love/datas/languages/en/options.lua @@ -0,0 +1,11 @@ +return { + ["inputs"] = "Inputs", + ["video"] = "Video", + ["audio"] = "Audio", + ["langs"] = "Languages", + ["resolution"] = "Resolution", + ["fullscreen"] = "Fullscreen", + ["borders"] = "Borders", + ["vsync"] = "V-Sync", + ["back"] = "Back", +} diff --git a/sonic-radiance.love/datas/languages/fr/init.lua b/sonic-radiance.love/datas/languages/fr/init.lua new file mode 100644 index 0000000..0c9be78 --- /dev/null +++ b/sonic-radiance.love/datas/languages/fr/init.lua @@ -0,0 +1,5 @@ +return { + name = "Français", + name_ascii = "Francais", + subfolder = "fr" +} diff --git a/sonic-radiance.love/datas/languages/fr/options.lua b/sonic-radiance.love/datas/languages/fr/options.lua new file mode 100644 index 0000000..d0b2d8f --- /dev/null +++ b/sonic-radiance.love/datas/languages/fr/options.lua @@ -0,0 +1,11 @@ +return { + ["inputs"] = "Controles", + ["video"] = "Affichage", + ["audio"] = "Sons", + ["langs"] = "Langues", + ["resolution"] = "Resolution", + ["fullscreen"] = "Plein Ecran", + ["borders"] = "Bordures", + ["vsync"] = "Sync Vert.", + ["back"] = "Retour", +} diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index bae199c..5d11638 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -12,22 +12,13 @@ function DebugMenu:new() self:buildOverworldMenu() self:buildSaveMenu() self:buildOtherMenu() - self:buildOptionsMenu() + menu.commons.SceneWidget(self, "BaseMenu", scenes.options, "Options") menu.ExitWidget(self, "BaseMenu") self.menusystem:activate() self.menusystem:switchMenu("BaseMenu") end -function DebugMenu:buildOptionsMenu() - self:addSubMenu("options", "BaseMenu", "Options") - self:addSubMenu("backgrounds", "options", "Set Background") - menu.ShowBackgroundWidget(self, "options") - - menu.commons.SubMenuWidget(self, "backgrounds", "options", "Back") - menu.commons.SubMenuWidget(self, "options", "BaseMenu", "Back") -end - function DebugMenu:buildOverworldMenu() self:addSubMenu("overworld", "BaseMenu", "Overworld") menu.commons.SubMenuWidget(self, "overworld", "BaseMenu", "Back") diff --git a/sonic-radiance.love/scenes/init.lua b/sonic-radiance.love/scenes/init.lua index 58bf0ee..0f611e0 100644 --- a/sonic-radiance.love/scenes/init.lua +++ b/sonic-radiance.love/scenes/init.lua @@ -4,4 +4,5 @@ return { title = require "scenes.titlescreen", cbs = require "scenes.battlesystem", debug = require "scenes.debug", + options = require "scenes.options", } diff --git a/sonic-radiance.love/scenes/options/assets.lua b/sonic-radiance.love/scenes/options/assets.lua new file mode 100644 index 0000000..17a38c4 --- /dev/null +++ b/sonic-radiance.love/scenes/options/assets.lua @@ -0,0 +1,52 @@ +return { + ["tilesets"] = { + {"charicons", "assets/sprites/characters/charicons"}, + {"normaltiles", "assets/backgrounds/normaltile"}, + {"sptiles", "assets/backgrounds/specialtile"}, + {"borders", "assets/backgrounds/borders"}, + }, + ["sprites"] = { + {"cursorground", "assets/gui/cursor/ground"}, + {"hitGFX", "assets/sprites/gfx/hit"}, + }, + ["textures"] = { + {"menucursor", "assets/gui/cursor-menulist.png"}, + {"statusbar", "assets/gui/status_bar.png"}, + {"cursorpeak", "assets/gui/cursor/peak.png"}, + {"actorsShadow", "assets/sprites/shadow.png"}, + {"emptytile", "assets/backgrounds/tilemask.png"}, + + {"e_speedster", "assets/gui/emblem_speedster.png"}, + {"e_technic", "assets/gui/emblem_technic.png"}, + {"e_power", "assets/gui/emblem_power.png"}, + + {"m_speedster", "assets/gui/emblem_speedster_mask.png"}, + {"m_technic", "assets/gui/emblem_technic_mask.png"}, + {"m_power", "assets/gui/emblem_power_mask.png"}, + + {"hudturn", "assets/gui/strings/hudturn.png"}, + {"battlecompleted", "assets/gui/strings/battle_completed.png" } + }, + ["fonts"] = { + {"small", "assets/gui/fonts/PixelOperator.ttf", 16}, + {"victory", "assets/gui/fonts/vipnagorgialla.ttf", 12} + }, + ["imagefonts"] = { + {"hudnbrs", "assets/gui/fonts/hudnumbers"}, + {"hudnbrs_small", "assets/gui/fonts/hudsmallnumbers"}, + {"medium", "assets/gui/fonts/SA2font"}, + }, + ["sfx"] = { + {"hit", "assets/sfx/hit.wav"}, + {"hitconnect", "assets/sfx/hitconnect.wav"}, + {"jump", "assets/sfx/jump.wav"}, + {"woosh", "assets/sfx/woosh.wav"}, + {"spincharge", "assets/sfx/spincharge.wav"}, + {"spinrelease", "assets/sfx/spinrelease.wav"}, + + {"mBack", "assets/sfx/menus/back.wav"}, + {"mBeep", "assets/sfx/menus/beep.wav"}, + {"mSelect", "assets/sfx/menus/select.wav"}, + {"mError", "assets/sfx/menus/error.wav"}, + } +} diff --git a/sonic-radiance.love/scenes/options/init.lua b/sonic-radiance.love/scenes/options/init.lua new file mode 100644 index 0000000..6790219 --- /dev/null +++ b/sonic-radiance.love/scenes/options/init.lua @@ -0,0 +1,97 @@ +local Scene = require "core.modules.scenes" +local OptionsMenu = Scene:extend() + +local ListBox = require "core.modules.menusystem.listbox" +local Widgets = require "scenes.options.widgets" + +function OptionsMenu:new() + OptionsMenu.super.new(self) + + self.assets:batchImport("scenes.options.assets") + self:addMenu("main", true) + self:addSubMenu("video", "video") + self:addSubMenu("audio", "audio") + self:addSubMenu("langs", "langs") + self:addSubMenu("inputs", "inputs") + + Widgets.Resolution(self, "video") + Widgets.Switch(self, "video", "fullscreen") + Widgets.Switch(self, "video", "borders") + Widgets.Switch(self, "video", "vsync") + + self:addPlayerMenus() + + self:setLanguageMenu() + + Widgets.Audio(self, "audio", "sfx") + Widgets.Audio(self, "audio", "music") + + Widgets.Exit(self, "main") + self.menusystem:switchMenu("main") + + self.menusystem:setSoundFromSceneAssets("mBeep") + + self.keyDetector = {} + self.keyDetector.widget = nil +end + +-- MENU FUNCTION +-- Functions that serve the handling of menus + +function OptionsMenu:addMenu(name, nobackbutton) + local screenHeight, screenWidth = core.screen:getDimensions() + local w, h = 424/2, 240 - 48 + local x, y = w / 2, 24 + ListBox(self.menusystem, name, x, y, w, h, 8) +end + +function OptionsMenu:addSubMenu(name, fullname) + self:addMenu(name) + Widgets.SubMenu(self, "main", name, fullname) + Widgets.SubMenu(self, name, "main", "back", 1, "<") +end + +function OptionsMenu:addPlayerMenus() + for i,v in ipairs(core.input.data) do + local menu = "player" .. i + self:addMenu(menu) + Widgets.PlayerSubMenu(self, "inputs", i) + for k,w in pairs(v.keys) do + -- FIXME: make sure that you can use the order you want for the keys list + -- instead of a random one + Widgets.Key(self, i, k) + end + Widgets.SubMenu(self, menu, "inputs", "back", 1, "<") + end +end + +function OptionsMenu:addScene(submenu, scene, fullname) + Widgets.Dummy(self, submenu, fullname) +end + +function OptionsMenu:setLanguageMenu() + for i,v in ipairs(core.lang.data.available) do + Widgets.Lang(self, "langs", v) + end +end + +function OptionsMenu:changeKey(widget) + self.keyDetector.isActive = true + self.keyDetector.widget = widget +end + +function OptionsMenu:keypressed( key ) + if (self.keyDetector.isActive) then + self.keyDetector.widget:receiveKey( key ) + self.menusystem:activate() + self.keyDetector.isActive = false + end +end + +function OptionsMenu:draw() + love.graphics.setColor(.3, .1, .4, 1) + love.graphics.rectangle("fill", 0, 0, 424, 240) + utils.graphics.resetColor() +end + +return OptionsMenu diff --git a/sonic-radiance.love/scenes/options/widgets.lua b/sonic-radiance.love/scenes/options/widgets.lua new file mode 100644 index 0000000..b59b38e --- /dev/null +++ b/sonic-radiance.love/scenes/options/widgets.lua @@ -0,0 +1,298 @@ +local widgets = {} + +local Widget = require "core.modules.menusystem.widgets" +local DoubleTextWidget = Widget.Text:extend() + +widgets.SubMenu = DoubleTextWidget:extend() +widgets.Dummy = Widget.Text:extend() +widgets.Exit = Widget.Text:extend() +widgets.Switch = DoubleTextWidget:extend() +widgets.Resolution = DoubleTextWidget:extend() +widgets.Lang = Widget.Text:extend() +widgets.PlayerSubMenu = DoubleTextWidget:extend() +widgets.Key = DoubleTextWidget:extend() +widgets.Audio = DoubleTextWidget:extend() + +-- BASIC WIDGETS +-- Simple and reusables widgets + +-- DoubleText widget : a two-side text widget + +function DoubleTextWidget:new(menu, font, label1, label2) + DoubleTextWidget.super.new(self, menu, font, label1) + self.label2 = label2 or "" +end + +function DoubleTextWidget:drawCanvas() + local w, h + w = math.floor(self.width) + h = math.floor(self.height / 2) - (self.font:getHeight() / 2) + self.font:draw(self.label, 4, h, -1, "left") + self.font:draw(self.label2, w-4, h, -1, "right") +end + +-- Submenu widget :: go to a submenu + +function widgets.SubMenu:new(scene, menu, newmenu, fullname, order, label2) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + local label = core.lang:translate("options", fullname) + local label2 = label2 or ">" + self.newmenu = newmenu + widgets.SubMenu.super.new(self, widgetmenu, font, label, label2) + self.order = order or 0 +end + +function widgets.SubMenu:action() + self.scene.assets:playSFX("mSelect") + self.scene.menusystem:switchMenu(self.newmenu) +end + +-- Dummy widget :: An empty widget to serve as a base for others + +function widgets.Dummy:new(scene, menu, fullname) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + widgets.Dummy.super.new(self, widgetmenu, font, fullname) +end + +function widgets.Dummy:action() + -- shoosh +end + +-- Exit Widget : exit the examples + +function widgets.Exit:new(scene, menu) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + local label = core.lang:translate("commons", "exit") + widgets.Exit.super.new(self, widgetmenu, font, "Exit") +end + +function widgets.Exit:action() + self.scene.assets:playSFX("mSelect") + core.scenemanager:setStoredScene("mainmenu") +end + +-- VIDEO WIDGETS +-- Handle graphical settings + +-- Switch widget (One widget to handle graphical switch) + +function widgets.Switch:new(scene, menu, keyname) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + self.keyname = keyname + local label = core.lang:translate("options", keyname) + local label2 = self:getLabel() + widgets.Switch.super.new(self, widgetmenu, font, label, label2) + self.order = order or 0 +end + +function widgets.Switch:modifyKey() + --self.key = (self.key == false) + if self.keyname == "fullscreen" then + core.options.data.video.fullscreen = (core.options.data.video.fullscreen == false) + elseif self.keyname == "borders" then + core.options.data.video.border = (core.options.data.video.border == false) + elseif self.keyname == "vsync" then + core.options.data.video.vsync = (core.options.data.video.vsync == false) + end + core.screen:applySettings() +end + +function widgets.Switch:getKey() + if self.keyname == "fullscreen" then + self.key = core.options.data.video.fullscreen + elseif self.keyname == "borders" then + self.key = (core.options.data.video.border) + elseif self.keyname == "vsync" then + self.key = (core.options.data.video.vsync) + end +end + +function widgets.Switch:getLabel() + self:getKey() + local label = "" + if (self.key) then + label = "true" + else + label = "false" + end + + return core.lang:translate("commons", label) +end + +function widgets.Switch:action() + self:modifyKey() + self.scene.assets:playSFX("mSelect") + self.label2 = self:getLabel() + core.options:write() + self:invalidateCanvas() +end + +-- Resolution Widget + +function widgets.Resolution:new(scene, menu) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + local label = core.lang:translate("options", "resolution") + local label2 = self:getLabel() + widgets.Resolution.super.new(self, widgetmenu, font, label, label2) +end + +function widgets.Resolution:getLabel() + return "x" .. core.options.data.video.resolution +end + +function widgets.Resolution:action() + if core.options.data.video.resolution == 3 then + core.options.data.video.resolution = 1 + else + core.options.data.video.resolution = core.options.data.video.resolution + 1 + end + self.label2 = self:getLabel() + core.screen:applySettings() + self.scene.assets:playSFX("mSelect") + self:invalidateCanvas() + core.options:write() +end + +-- LANGS WIDGET +-- Allow you to change the lang of the game + +function widgets.Lang:new(scene, menu, lang) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + local label = core.lang:getLangName(lang) + self.lang = lang + widgets.Lang.super.new(self, widgetmenu, font, label) +end + +function widgets.Lang:action() + self.scene.assets:playSFX("mSelect") + core.options:setLanguage(self.lang) + --self.scene.menusystem:invalidateAllWidgets() +end + +-- INPUT WIDGETS +-- Widgets to handle inputs + +function widgets.PlayerSubMenu:new(scene, menu, sourceid) + self.scene = scene + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + local label = core.lang:translate("options", "player") .. " " .. sourceid + local label2 = ">" + self.newmenu = "player" .. sourceid + widgets.PlayerSubMenu.super.new(self, widgetmenu, font, label, label2) + self.order = 0 +end + +function widgets.PlayerSubMenu:action() + self.scene.assets:playSFX("mSelect") + self.scene.menusystem:switchMenu(self.newmenu) +end + +-- Key widgets + +function widgets.Key:new(scene, sourceid, key) + self.scene = scene + self.source = sourceid + self.key = key + + local menu = "player" .. self.source + + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + local label = self.key + local label2 = self:getLabel() + + widgets.Key.super.new(self, widgetmenu, font, label, label2) + self.order = 0 +end + +function widgets.Key:getLabel() + return core.input.data[self.source].keys[self.key] +end + +function widgets.Key:action() + self.scene.assets:playSFX("navigate") + self.scene:changeKey(self) + self.scene.menusystem:deactivate() +end + +function widgets.Key:receiveKey( key ) + self.scene.assets:playSFX("mSelect") + core.options:setInputKey(self.source, self.key, key) + self.label2 = self:getLabel() + self:invalidateCanvas() +end + +-- AUDIO FUNCTIONS +-- Sounds/Music functions + +function widgets.Audio:new(scene, menu, audiotype) + self.scene = scene + self.audiotype = key + + + local widgetmenu = self.scene.menusystem.menus[menu] + local font = self.scene.assets.fonts["medium"] + self.audiotype = audiotype + local label = "" + if (self.audiotype == "sfx") then + label = core.lang:translate("options", "sfx") + else + label = core.lang:translate("options", "music") + end + local label2 = self:getLabel() + + widgets.Audio.super.new(self, widgetmenu, font, label, label2) + self.order = 0 +end + +function widgets.Audio:getLabel() + local value = self:getVolume() + string = utils.math.numberToString(value, 3) + local label = string .. "%" + + return label +end + +function widgets.Audio:getVolume() + if (self.audiotype == "sfx") then + return core.options.data.audio.sfx + else + return core.options.data.audio.music + end +end + +function widgets.Audio:setVolume(vol) + if (vol < 0) then vol = 100 end + + if (self.audiotype == "sfx") then + core.options.data.audio.sfx = vol + else + core.options.data.audio.music = vol + end + + self.label2 = self:getLabel() + self:invalidateCanvas() +end + +function widgets.Audio:action() + local value = self:getVolume() + self:setVolume(value - 20) + self.scene.assets:playSFX("mSelect") + --self.scene.assets.music:setVolume(core.options.data.audio.music / 100) + core.options:write() +end + +return widgets From ce5cb1298f5361d57fc02e576c43ab5ec10ca8e1 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 16:32:09 +0200 Subject: [PATCH 59/68] improvement: make option menu a bit less plain --- .../assets/backgrounds/options.png | Bin 0 -> 1346 bytes sonic-radiance.love/scenes/options/assets.lua | 36 +----------------- sonic-radiance.love/scenes/options/init.lua | 30 +++++++++++---- sonic-radiance.love/scenes/options/menu.lua | 14 +++++++ 4 files changed, 37 insertions(+), 43 deletions(-) create mode 100644 sonic-radiance.love/assets/backgrounds/options.png create mode 100644 sonic-radiance.love/scenes/options/menu.lua diff --git a/sonic-radiance.love/assets/backgrounds/options.png b/sonic-radiance.love/assets/backgrounds/options.png new file mode 100644 index 0000000000000000000000000000000000000000..20941e8d3d6e727c3af3496a349758be388b4011 GIT binary patch literal 1346 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrU~I{Bb`J1#c2+1T%1_J8No8Qr zm{>c}*5h!1NUMMFQKe9J?GB5S6@Fqat}TvrHWwT8+1#QkFTm6{|X?tXCVg9qo6 zt{yxZ8O|Q=DDa1|u&5-cWTMb}Z!X=WJs&FMpWiL6cyH&hV*1Rq(jMknd9zo##GFY9 zKe{fwMZiIyjbUcwu{kQL52NG1U-2##e;oO*wmz(X)@BI-fzI@qiMNhOAGthx+ri5D z7KgevdDZyYq+Md|l;63o;?J?24>lbzR!*}r^_Ni;x` z7I;J!Gcf2WgD_*oQu{KXAbW|YuPgf#4n{sX`B_p2HUNbrOI#yLobz*YQ}ap~oQqNu zOHxx5$}>wc6x=<11Hv2m#2FZvr9536Ln>~)y=z!>#XzF%VJk0VR94oygPc2}^d<`z z^j=w+896O+LDAw!<&!~4f3JNm<1r9U-}ip2PIle?pTGV-e4m*lx8C14{@=^DoJeb2iRIO{xvhOtBD z%M$usosA+9jhXU zo`UAxd+Qrsd}ef;FL8(=!`R{d&E4x$r`!|vU2L+qtWOc>ifzy4v(Fc~mA&ZYHO@KJ z>s`Hk4>0fqY`2pCx|?xl=d!KGx-R|s@_dykBeQ|Sn`io8X64GP{kc^wf#J$q<|W_H ztqtBDKf8GO&0~T4rNXRk&tQ~T@a|`o*`oJfpC>e&6a)tImF$M&uPQ3vPr;5S+Fk9J-==(r(6EMT81x%2Uhgnz3p*vfB6B1$;ud^3kz%ut+US=7wtcv zzw~SEzkAO)B@XD~R;vP3+xO3R?(}0d3`YzcrY!qDFFC@xx?E)O6hD(x2DTg5{#;aV z-8O4M$+veavO6zzE(5xDE++gZC!bLaiQLv+%pV38*=3n#1_3_$ZKU(a|b35 Date: Sat, 1 Aug 2020 16:57:12 +0200 Subject: [PATCH 60/68] feat: add bases of the future overworld system --- .../scenes/debug/menu/init.lua | 1 + sonic-radiance.love/scenes/init.lua | 1 + .../scenes/overworld/actors/init.lua | 13 ++++++ .../scenes/overworld/actors/parent.lua | 13 ++++++ .../scenes/overworld/actors/player.lua | 35 ++++++++++++++ .../scenes/overworld/actors/wall.lua | 14 ++++++ sonic-radiance.love/scenes/overworld/init.lua | 46 +++++++++++++++---- .../scenes/overworld/world.lua | 11 +++++ 8 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 sonic-radiance.love/scenes/overworld/actors/init.lua create mode 100644 sonic-radiance.love/scenes/overworld/actors/parent.lua create mode 100644 sonic-radiance.love/scenes/overworld/actors/player.lua create mode 100644 sonic-radiance.love/scenes/overworld/actors/wall.lua create mode 100644 sonic-radiance.love/scenes/overworld/world.lua diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index 5d11638..e7790e1 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -21,6 +21,7 @@ end function DebugMenu:buildOverworldMenu() self:addSubMenu("overworld", "BaseMenu", "Overworld") + menu.commons.SceneWidget(self, "overworld", scenes.overworld, "Launch Overworld") menu.commons.SubMenuWidget(self, "overworld", "BaseMenu", "Back") end diff --git a/sonic-radiance.love/scenes/init.lua b/sonic-radiance.love/scenes/init.lua index 0f611e0..d2e42d8 100644 --- a/sonic-radiance.love/scenes/init.lua +++ b/sonic-radiance.love/scenes/init.lua @@ -5,4 +5,5 @@ return { cbs = require "scenes.battlesystem", debug = require "scenes.debug", options = require "scenes.options", + overworld = require "scenes.overworld" } diff --git a/sonic-radiance.love/scenes/overworld/actors/init.lua b/sonic-radiance.love/scenes/overworld/actors/init.lua new file mode 100644 index 0000000..9d67a55 --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/init.lua @@ -0,0 +1,13 @@ +local Obj = {} + +-- On charge toutes les différentes types d'acteurs +local cwd = (...):gsub('%.init$', '') .. "." +Obj.Player = require(cwd .. "player") + +Obj.index = {} +Obj.index["player"] = Obj.Player + +Obj.collisions = {} +Obj.collisions["wall"] = require(cwd .. "wall") + +return Obj diff --git a/sonic-radiance.love/scenes/overworld/actors/parent.lua b/sonic-radiance.love/scenes/overworld/actors/parent.lua new file mode 100644 index 0000000..4a7e397 --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/parent.lua @@ -0,0 +1,13 @@ +local Base = require "core.modules.world.actors.actor2D" +local Parent = Base:extend() + +function Parent:new(world, type, x, y, w, h, isSolid) + self.scene = world.scene + Parent.super.new(self, world, type, x, y, w, h, isSolid) +end + +function Parent:draw() + love.graphics.rectangle("fill", math.floor(self.x), math.floor(self.y), self.w, self.h) +end + +return Parent diff --git a/sonic-radiance.love/scenes/overworld/actors/player.lua b/sonic-radiance.love/scenes/overworld/actors/player.lua new file mode 100644 index 0000000..9e80089 --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/player.lua @@ -0,0 +1,35 @@ +local cwd = (...):gsub('%.player$', '') .. "." +local Parent = require(cwd .. "parent") +local Player = Parent:extend() + +function Player:new(world, x, y, id) + Player.super.new(self, world, "player", x, y, 16, 16, true) + +end + +function Player:updateStart(dt) + self.xfrc, self.yfrc = 480*3, 480*3 + + if self.keys["up"].isDown then + self.ysp = -120 + end + if self.keys["down"].isDown then + self.ysp = 120 + end + if self.keys["left"].isDown then + self.xsp = -120 + end + if self.keys["right"].isDown then + self.xsp = 120 + end +end + +function Player:draw() + Player.super.draw(self) +end + +function Player:drawHUD(id) + love.graphics.print(id .. " test", 4, 4) +end + +return Player diff --git a/sonic-radiance.love/scenes/overworld/actors/wall.lua b/sonic-radiance.love/scenes/overworld/actors/wall.lua new file mode 100644 index 0000000..7e4f18e --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/actors/wall.lua @@ -0,0 +1,14 @@ +local Base = require "core.modules.world.actors.actor2D" +local Wall = Base:extend() + +function Wall:new(world, x, y, w, h) + Wall.super.new(self, world, "wall", x, y, w, h, true) + self:setDebugColor(0,0,0) +end + +function Wall:draw() + --self:drawHitbox() + --utils.graphics.resetColor( ) +end + +return Wall diff --git a/sonic-radiance.love/scenes/overworld/init.lua b/sonic-radiance.love/scenes/overworld/init.lua index b42be75..7dff1d5 100644 --- a/sonic-radiance.love/scenes/overworld/init.lua +++ b/sonic-radiance.love/scenes/overworld/init.lua @@ -1,15 +1,45 @@ +-- scenes/moveplayer :: a basic player movement example + +--[[ + Copyright © 2019 Kazhnuz + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +]] + local Scene = require "core.modules.scenes" -local OverWorld = Scene:extend() +local MovePlayer = Scene:extend() -function OverWorld:new() - OverWorld.super.new(self) +local World = require "scenes.overworld.world" + +function MovePlayer:new() + MovePlayer.super.new(self) + + World(self, "test", "map") + self.world:setPlayerNumber(1) + self.world:loadMap() end -function OverWorld:update(dt) -end - -function OverWorld:draw() +function MovePlayer:update(dt) end -return OverWorld +function MovePlayer:draw() + +end + +return MovePlayer diff --git a/sonic-radiance.love/scenes/overworld/world.lua b/sonic-radiance.love/scenes/overworld/world.lua new file mode 100644 index 0000000..c5f108c --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/world.lua @@ -0,0 +1,11 @@ +local World = require "core.modules.world.world2D" +local RPGWorld = World:extend() +local objFile = "scenes.overworld.actors" +local mapFolder = "datas/gamedata/maps/sti/" + +function RPGWorld:new(scene, folder, map, playerx, playery) + local mapFile = mapFolder .. folder .. "/" .. map .. ".lua" + RPGWorld.super.new(self, scene, objFile, mapFile) +end + +return RPGWorld From 3a9ac247fcada5e8946adda16e0fd8cf0cac41a5 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 18:54:12 +0200 Subject: [PATCH 61/68] feat: add basic charset handling --- .../assets/sprites/charset/perso.png | Bin 0 -> 29166 bytes .../scenes/overworld/actors/parent.lua | 2 + .../scenes/overworld/actors/player.lua | 14 +++- .../scenes/overworld/charsetmanager.lua | 74 ++++++++++++++++++ sonic-radiance.love/scenes/overworld/init.lua | 4 +- 5 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 sonic-radiance.love/assets/sprites/charset/perso.png create mode 100644 sonic-radiance.love/scenes/overworld/charsetmanager.lua diff --git a/sonic-radiance.love/assets/sprites/charset/perso.png b/sonic-radiance.love/assets/sprites/charset/perso.png new file mode 100644 index 0000000000000000000000000000000000000000..0cc9985fcb6f31e0366555752bd91d90008e5d43 GIT binary patch literal 29166 zcmaHybyO5z{P$F(~|`u&~f zJkMXxo|!W{_w3By`sL$DAq|!bBdFY&3f#t7L^KYWgT&tySOZ~uTcUX zxtwx6@2g1IPh~$;{OpW@AMrXlFHXh_BV3>nB9rEl9<-vbvb7<9hqqEsT1Q^7mu?Id zyT*(|Ve%DnO8_*yRr_Q4wD4cbz4ZAO;q>c!K&Q+l-9Nii10-F{ zP29}QV4l`)RxoK$J%d+kG z_LAm?-D!nI27msgX{F(xyle>MMXRtfwoDsJS)fz~de&PMzi0AtkR*=oZ!l%NP)3ss zVBag2bP6+U|D$$OR@l3EmK!kTM^(Q3XI5x*)7;V&ka!t#HtL<>;v&7vrrS&R&u5W# z3YQIs8G`PPlO_I}>XQO5=*k#Al{0*Dfvxwf;Is67XX!(MlbEZJn1jUrm6tO-0d(Wv z>cksemAhGS(?mWR#J^2e3F!%7U0<19U@=#>CAPD2f}xOh?@l*!f#CCe!_g!_4e(Ki zQ=s2StDYKm^A^l+Kku5P*=z}pMTG)?fH#0h&EhctAd071u{FDmff@!^5C%<=`NobF znB)|t)*B^+1YW+s{GnDbWk-|}PH?nM2_rc29xnL>0DpZ=9ZLo4x7aF8l)hG(s<iQ!nKWYG?(og#R6m5N;_Cnm_OYN*vSD zE72gAaUg2Inew1P7^JUvA4=ymB-Fw%R0sVST$Hn;yST}||6mPUhCd%m&`1?@mt)|f zZ^1=S$X!y1u{$wnmVOj5%7{eOd&XsiWmK>$z~mPWSEbM;dO9~X`S$UI zDd{vp{}uPuP!gS=(FL}d`2re8iNKy_}x`1&@zT=bN50+*h zyc_C5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JtH{VEiJ7zrc-I6dz*bs;nGQ48kpU?*UqhNaAD zmk`>B4xc{$3;;NK^L3}}`ma>!IqqArEDUNsIhBd5JEo3HJ6ADdACoCGn_nsY{fD$F zyx`7d(b>*Cq_QQs^nxG}V63+fMWwRLIWZe!dvzga3bykyiJI?8=Tf=3oH=?7gvJ;F zbFrO&H*FGcxeGWk9%Cu7>j1BLT+lm%@=7}Xk)|!&ZYDOm1wUZ|clsl3mN4c86Naw+2yBb|zeX{JBcc(b$%1-^2{8 zfKh@)6#(_fGT>Mu&&o|b=Qkv#z}m%b*Bs!}0HNwes`tF=v307>Ai(bLx@HTfKYUupg_#oH*Hi_w7Wa87D(^8y)LTCouE(h+z$( z0bon!n%3_6w)o)j%URz2<^NpR6VF zO7P5q$N*>`48(RrjOtqKpCPtme?K>He6A;V-p&n1KUBV5b=wEiD%nr;^TDTSpX4CU z!E6cWTl?hEESD@GJ11}$1`g9Lwfo~t2p_oFSYdwO0g0o(eZ8nIp^5UaT+b{3>N_v9 z53tymyk6PNdpR;N#vF3ftJY62N8h1j?nBR1{Y&NUlWk66af^L#Hi5(N=e7V;GampX o1UvR%yLS1a5`xr&+JW@^AG5$*Ey4B7`~Uy|07*qoM6N<$f@JlUQUCw| literal 0 HcmV?d00001 diff --git a/sonic-radiance.love/scenes/overworld/actors/parent.lua b/sonic-radiance.love/scenes/overworld/actors/parent.lua index 4a7e397..7b27ac1 100644 --- a/sonic-radiance.love/scenes/overworld/actors/parent.lua +++ b/sonic-radiance.love/scenes/overworld/actors/parent.lua @@ -4,6 +4,8 @@ local Parent = Base:extend() function Parent:new(world, type, x, y, w, h, isSolid) self.scene = world.scene Parent.super.new(self, world, type, x, y, w, h, isSolid) + self.charDir = "down" + self.charset = self.world.scene.charsetManager end function Parent:draw() diff --git a/sonic-radiance.love/scenes/overworld/actors/player.lua b/sonic-radiance.love/scenes/overworld/actors/player.lua index 9e80089..7f9187d 100644 --- a/sonic-radiance.love/scenes/overworld/actors/player.lua +++ b/sonic-radiance.love/scenes/overworld/actors/player.lua @@ -4,7 +4,11 @@ local Player = Parent:extend() function Player:new(world, x, y, id) Player.super.new(self, world, "player", x, y, 16, 16, true) + self.charset:addTexture("perso") +end +function Player:isMoving() + return ((math.abs(self.ysp) > 0.01) or (math.abs(self.xsp) > 0.01)) end function Player:updateStart(dt) @@ -12,20 +16,28 @@ function Player:updateStart(dt) if self.keys["up"].isDown then self.ysp = -120 + self.charDir = "up" end if self.keys["down"].isDown then self.ysp = 120 + self.charDir = "down" end if self.keys["left"].isDown then self.xsp = -120 + self.charDir = "left" end if self.keys["right"].isDown then self.xsp = 120 + self.charDir = "right" end end function Player:draw() - Player.super.draw(self) + if (self:isMoving()) then + self.charset:draw("perso", 1, self.charDir, self.x, self.y) + else + self.charset:drawStanding("perso", 1, self.charDir, self.x, self.y) + end end function Player:drawHUD(id) diff --git a/sonic-radiance.love/scenes/overworld/charsetmanager.lua b/sonic-radiance.love/scenes/overworld/charsetmanager.lua new file mode 100644 index 0000000..194cb62 --- /dev/null +++ b/sonic-radiance.love/scenes/overworld/charsetmanager.lua @@ -0,0 +1,74 @@ +local Charset = Object:extend() + +local folder = "assets/sprites/charset/" +local animation = {1, 2, 3, 2} +local directionList = {"down", "right", "up", "left"} + +function Charset:new(scene) + self.char = {} + self.list = {} + + for i=1, 2 do + for j=1, 4 do + local id = ((i-1)*4) + j + self.char[id] = self:addChar(i, j) + end + end + self.currentFrame = 0 +end + +function Charset:update(dt) + self.currentFrame = ((self.currentFrame + (dt*5)) % 4) +end + +function Charset:addChar(ii, jj) + local charx, chary = (jj-1)*(24*3), (ii-1)*(32*4) + print(charx, chary) + local char = {} + for i=1, 4 do + animatedDirection = {} + local running = {} + for j=1, 3 do + local x, y = charx + ((j-1)*24), (chary + (i-1)*32) + --print(x, y) + running[j] = love.graphics.newQuad(x, y, 24, 32, 24*12, 32*8) + end + local direction = directionList[i] + char[direction] = running + end + return char +end + +function Charset:addTexture(charsetName) + self.list[charsetName] = love.graphics.newImage(folder .. charsetName .. ".png") +end + +function Charset:getRunningFrame(charID, direction) + local char = self.char[charID] + local animatedDirection = char[direction] + local fakeFrame = math.min(math.floor(self.currentFrame) + 1, 4) + print(fakeFrame) + local trueFrame = animation[fakeFrame] + print(trueFrame) + return animatedDirection[trueFrame] +end + +function Charset:getStandingFrame(charID, direction) + local char = self.char[charID] + local animatedDirection = char[direction] + return animatedDirection[2] +end + +function Charset:draw(charsetName, charID, direction, x, y) + local drawable = self.list[charsetName] + local quad = self:getRunningFrame(charID, direction) + love.graphics.draw(drawable, quad, math.floor(x), math.floor(y), 0, 1, 1, 4, 16) +end + +function Charset:drawStanding(charsetName, charID, direction, x, y) + local drawable = self.list[charsetName] + local quad = self:getStandingFrame(charID, direction) + love.graphics.draw(drawable, quad, x, y, 0, 1, 1, 4, 16) +end + +return Charset diff --git a/sonic-radiance.love/scenes/overworld/init.lua b/sonic-radiance.love/scenes/overworld/init.lua index 7dff1d5..48c27de 100644 --- a/sonic-radiance.love/scenes/overworld/init.lua +++ b/sonic-radiance.love/scenes/overworld/init.lua @@ -25,9 +25,11 @@ local Scene = require "core.modules.scenes" local MovePlayer = Scene:extend() local World = require "scenes.overworld.world" +local CharsetManager = require "scenes.overworld.charsetmanager" function MovePlayer:new() MovePlayer.super.new(self) + self.charsetManager = CharsetManager(self) World(self, "test", "map") self.world:setPlayerNumber(1) @@ -35,7 +37,7 @@ function MovePlayer:new() end function MovePlayer:update(dt) - + self.charsetManager:update(dt) end function MovePlayer:draw() From df2716b3df7a6d45ae8a241aa57f457f15b120bf Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 1 Aug 2020 20:49:06 +0200 Subject: [PATCH 62/68] fix: some various fixes --- sonic-radiance.love/scenes/overworld/charsetmanager.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sonic-radiance.love/scenes/overworld/charsetmanager.lua b/sonic-radiance.love/scenes/overworld/charsetmanager.lua index 194cb62..ffc1b3b 100644 --- a/sonic-radiance.love/scenes/overworld/charsetmanager.lua +++ b/sonic-radiance.love/scenes/overworld/charsetmanager.lua @@ -23,7 +23,6 @@ end function Charset:addChar(ii, jj) local charx, chary = (jj-1)*(24*3), (ii-1)*(32*4) - print(charx, chary) local char = {} for i=1, 4 do animatedDirection = {} @@ -47,9 +46,7 @@ function Charset:getRunningFrame(charID, direction) local char = self.char[charID] local animatedDirection = char[direction] local fakeFrame = math.min(math.floor(self.currentFrame) + 1, 4) - print(fakeFrame) local trueFrame = animation[fakeFrame] - print(trueFrame) return animatedDirection[trueFrame] end @@ -68,7 +65,7 @@ end function Charset:drawStanding(charsetName, charID, direction, x, y) local drawable = self.list[charsetName] local quad = self:getStandingFrame(charID, direction) - love.graphics.draw(drawable, quad, x, y, 0, 1, 1, 4, 16) + love.graphics.draw(drawable, quad, math.floor(x), math.floor(y), 0, 1, 1, 4, 16) end return Charset From e9c7026dcb5c9b568f14140f1efb39369b096e66 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 2 Aug 2020 08:30:19 +0200 Subject: [PATCH 63/68] feat: add an information panel --- .../scenes/debug/menu/infopanel/gamedata.lua | 16 ++++++++++++++++ .../scenes/debug/menu/infopanel/init.lua | 5 +++++ .../scenes/debug/menu/infopanel/parent.lua | 17 +++++++++++++++++ sonic-radiance.love/scenes/debug/menu/init.lua | 16 ++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua create mode 100644 sonic-radiance.love/scenes/debug/menu/infopanel/init.lua create mode 100644 sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua new file mode 100644 index 0000000..13f440b --- /dev/null +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua @@ -0,0 +1,16 @@ +local Parent = require "scenes.debug.menu.infopanel.parent" +local GamePanel = Parent:extend() + +function GamePanel:new() + GamePanel.super.new(self) +end + +function GamePanel:drawContent(x, y) + local debugString = "# Save system data" .. "\n" + debugString = debugString .. "Current slot: " .. game.slot .. " / 3" .. "\n" + debugString = debugString .. "Gametime: " .. game:getTimeString() .. "\n" + + love.graphics.print(debugString, x, y) +end + +return GamePanel diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua new file mode 100644 index 0000000..3550ce8 --- /dev/null +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua @@ -0,0 +1,5 @@ +local folder = "scenes.debug.menu.infopanel." + +return { + Gamedata = require(folder .. "gamedata"), +} diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua new file mode 100644 index 0000000..5fb56a4 --- /dev/null +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua @@ -0,0 +1,17 @@ +local ParentPanel = Object:extend() +local gui = require "game.modules.gui" + +function ParentPanel:new() + self.panelBackground = gui.newTextBox("assets/gui/dialogbox.png", 128+32, 128) +end + +function ParentPanel:draw(x, y, w, h) + love.graphics.draw(self.panelBackground, x, y) + self:drawContent(x+8, y+8) +end + +function ParentPanel:drawContent(x, y) + +end + +return ParentPanel diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index e7790e1..d48bf94 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -2,6 +2,7 @@ local Scene = require "core.modules.scenes" local menu = require "scenes.debug.menu.menu" local DebugMenu = Scene:extend() +local panels = require "scenes.debug.menu.infopanel" function DebugMenu:new() DebugMenu.super.new(self) @@ -17,6 +18,8 @@ function DebugMenu:new() self.menusystem:activate() self.menusystem:switchMenu("BaseMenu") + + self.panel = panels.Gamedata() end function DebugMenu:buildOverworldMenu() @@ -35,7 +38,18 @@ end function DebugMenu:buildSaveMenu() self:addSubMenu("save", "BaseMenu", "Save System") + self:addSubMenu("characters", "save", "Characters") + for name, data in pairs(game.characters.list) do + self:addCharacterMenu(name, data) + end + menu.commons.SubMenuWidget(self, "save", "BaseMenu", "Back") + menu.commons.SubMenuWidget(self, "characters", "save", "Back") +end + +function DebugMenu:addCharacterMenu(name, data) + self:addSubMenu(name, "characters", data.fullname) + menu.commons.SubMenuWidget(self, name, "characters", "Back") end function DebugMenu:buildOtherMenu() @@ -63,6 +77,8 @@ function DebugMenu:draw() if (self.menusystem.isActive) then self.assets.fonts["small"]:print("## SONIC RADIANCE - DEBUG MENU ##", 424/2, 8, "center") self.assets.fonts["small"]:print("v" .. game.version, 424 - 8, 240 - 22, "right") + + self.panel:draw(240, 48) end end From f83c67f96aaf66b60451e828d0e375a3dff02f9a Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 2 Aug 2020 09:59:47 +0200 Subject: [PATCH 64/68] feat: add save read/write --- sonic-radiance.love/game/init.lua | 3 ++- .../scenes/debug/menu/infopanel/gamedata.lua | 2 +- .../scenes/debug/menu/init.lua | 8 +++++++ .../scenes/debug/menu/menu.lua | 22 +++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/sonic-radiance.love/game/init.lua b/sonic-radiance.love/game/init.lua index d47cd04..5e7d67b 100644 --- a/sonic-radiance.love/game/init.lua +++ b/sonic-radiance.love/game/init.lua @@ -35,6 +35,7 @@ Game.gui = require "game.modules.gui" function Game:new() self.slot = -1 + self.slotNumber = 3 self.gametime = 0 self.characters = Characters(self) @@ -95,7 +96,7 @@ function Game:getSaveFile(saveslot, absolute) end function Game:resetSaves() - for i=1, 3 do + for i=1, self.slotNumber do filepath = self:getSaveFile(i, true) if love.filesystem.exists("save" .. i .. ".save") then love.filesystem.remove( "save" .. i .. ".save" ) diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua index 13f440b..69de07d 100644 --- a/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/gamedata.lua @@ -7,7 +7,7 @@ end function GamePanel:drawContent(x, y) local debugString = "# Save system data" .. "\n" - debugString = debugString .. "Current slot: " .. game.slot .. " / 3" .. "\n" + debugString = debugString .. "Current slot: " .. game.slot .. " / " .. game.slotNumber .. "\n" debugString = debugString .. "Gametime: " .. game:getTimeString() .. "\n" love.graphics.print(debugString, x, y) diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index d48bf94..f395090 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -43,8 +43,16 @@ function DebugMenu:buildSaveMenu() self:addCharacterMenu(name, data) end + self:addSubMenu("load", "save", "Load Saves") + for i=1, game.slotNumber do + menu.LoadWidget(self, "load", i) + end + menu.SaveWidget(self, "save") + + menu.commons.SubMenuWidget(self, "save", "BaseMenu", "Back") menu.commons.SubMenuWidget(self, "characters", "save", "Back") + menu.commons.SubMenuWidget(self, "load", "save", "Back") end function DebugMenu:addCharacterMenu(name, data) diff --git a/sonic-radiance.love/scenes/debug/menu/menu.lua b/sonic-radiance.love/scenes/debug/menu/menu.lua index 630ff18..5c1266b 100644 --- a/sonic-radiance.love/scenes/debug/menu/menu.lua +++ b/sonic-radiance.love/scenes/debug/menu/menu.lua @@ -3,6 +3,8 @@ local menu = {} menu.commons = commons menu.ExitWidget = commons.DebugWidget:extend() menu.ShowBackgroundWidget = commons.DebugWidget:extend() +menu.SaveWidget = commons.DebugWidget:extend() +menu.LoadWidget = commons.DebugWidget:extend() -- ExitWidget function menu.ExitWidget:new(scene, menuName) @@ -22,4 +24,24 @@ function menu.ShowBackgroundWidget:action() self.scene.menusystem:deactivate() end +-- Save game +function menu.SaveWidget:new(scene, menuName) + menu.ShowBackgroundWidget.super.new(self, scene, menuName, "Save game") +end + +function menu.SaveWidget:action() + game:write() +end + +-- Save game +function menu.LoadWidget:new(scene, menuName, slot) + menu.ShowBackgroundWidget.super.new(self, scene, menuName, "Load file " .. slot) + self.slot = slot +end + +function menu.LoadWidget:action() + game:read(self.slot) +end + + return menu From 5d83f2ba12bbc53c7ee6492f1faf740531bfb60d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 2 Aug 2020 10:18:14 +0200 Subject: [PATCH 65/68] fix: fix club rouge name --- sonic-radiance.love/datas/gamedata/maps/battle/crouge/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-radiance.love/datas/gamedata/maps/battle/crouge/init.lua b/sonic-radiance.love/datas/gamedata/maps/battle/crouge/init.lua index f485ed8..d1d0918 100644 --- a/sonic-radiance.love/datas/gamedata/maps/battle/crouge/init.lua +++ b/sonic-radiance.love/datas/gamedata/maps/battle/crouge/init.lua @@ -1,5 +1,5 @@ return { - name = "Chao Ruins", + name = "Club Rouge", blocks = { { 56, 128, 16, 96, "top1", "side1"}, {248, 128, 16, 96, "top1", "side1"}, From cf377f15b803deebb18ea95a28b592c6ef484ae3 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 2 Aug 2020 10:18:40 +0200 Subject: [PATCH 66/68] feat: make possible to load all Battle maps --- .../datas/gamedata/maps/battle/init.lua | 1 + sonic-radiance.love/scenes/debug/commons/menu.lua | 9 +++++++-- sonic-radiance.love/scenes/debug/menu/init.lua | 10 +++++++++- sonic-radiance.love/scenes/test_scene/init.lua | 10 ++++------ 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 sonic-radiance.love/datas/gamedata/maps/battle/init.lua diff --git a/sonic-radiance.love/datas/gamedata/maps/battle/init.lua b/sonic-radiance.love/datas/gamedata/maps/battle/init.lua new file mode 100644 index 0000000..5a88bd3 --- /dev/null +++ b/sonic-radiance.love/datas/gamedata/maps/battle/init.lua @@ -0,0 +1 @@ +return {"aroom", "bhighway", "crouge", "cruins", "ebeach", "ghill", "hsummit", "library", "mdepot", "tlab"} diff --git a/sonic-radiance.love/scenes/debug/commons/menu.lua b/sonic-radiance.love/scenes/debug/commons/menu.lua index 4dcb1f0..8f03803 100644 --- a/sonic-radiance.love/scenes/debug/commons/menu.lua +++ b/sonic-radiance.love/scenes/debug/commons/menu.lua @@ -65,13 +65,18 @@ function menu.SubMenuWidget:action() end -- SceneWidget -function menu.SceneWidget:new(scene, menuName, newScene, newSceneName) +function menu.SceneWidget:new(scene, menuName, newScene, newSceneName, sceneArgument) menu.SceneWidget.super.new(self, scene, menuName, newSceneName) self.newScene = newScene + self.sceneArgument = sceneArgument end function menu.SceneWidget:action() - self.newScene() + if (self.sceneArgument ~= nil) then + self.newScene(self.sceneArgument) + else + self.newScene() + end end diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index f395090..e95973f 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -62,9 +62,17 @@ end function DebugMenu:buildOtherMenu() self:addSubMenu("other", "BaseMenu", "Other gameplay") - menu.commons.SceneWidget(self, "other", scenes.test, "Sonic Battle Maps") + self:addSubMenu("battle", "other", "Sonic Battle Maps") + local mapList = require "datas.gamedata.maps.battle" + for i, name in ipairs(mapList) do + local mapData = require("datas.gamedata.maps.battle." .. name) + local trueName = mapData.name + menu.commons.SceneWidget(self, "battle", scenes.test, trueName, name) + end + menu.commons.SceneWidget(self, "other", scenes.test2, "Shadow Shot Maps") + menu.commons.SubMenuWidget(self, "battle", "other", "Back") menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back") end diff --git a/sonic-radiance.love/scenes/test_scene/init.lua b/sonic-radiance.love/scenes/test_scene/init.lua index 0a19dea..a8e37a4 100644 --- a/sonic-radiance.love/scenes/test_scene/init.lua +++ b/sonic-radiance.love/scenes/test_scene/init.lua @@ -26,17 +26,15 @@ local MovePlayer = Scene:extend() local World = require "game.modules.world" -function MovePlayer:new(playerNumber, cameraMode) - local playerNumber = playerNumber or 1 - local cameraMode = cameraMode or "split" +function MovePlayer:new(map) MovePlayer.super.new(self) self.assets:batchImport("scenes.test_scene.assets") - World(self, "battle", "tlab") + World(self, "battle", map) - self.world:setPlayerNumber(playerNumber) - self.world.cameras:setMode(cameraMode) + self.world:setPlayerNumber(1) + self.world.cameras:setMode("split") self.world:loadMap() end From 64947f145e79e9ecf34715117088b634b1a9ffdb Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 2 Aug 2020 10:33:31 +0200 Subject: [PATCH 67/68] feat: add a panel for character data --- .../scenes/debug/menu/infopanel/character.lua | 15 +++++++++++++++ .../scenes/debug/menu/infopanel/init.lua | 1 + sonic-radiance.love/scenes/debug/menu/init.lua | 12 ++++++++---- sonic-radiance.love/scenes/debug/menu/menu.lua | 18 ++++++++++++++++-- 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 sonic-radiance.love/scenes/debug/menu/infopanel/character.lua diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua new file mode 100644 index 0000000..a3af0a0 --- /dev/null +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua @@ -0,0 +1,15 @@ +local Parent = require "scenes.debug.menu.infopanel.parent" +local CharacterPanel = Parent:extend() + +function CharacterPanel:new(character) + CharacterPanel.super.new(self) + self.character = character +end + +function CharacterPanel:drawContent(x, y) + local debugString = "# " .. self.character.name .. "(" .. "Lvl " .. self.character.level .. ")" .. "\n" + + love.graphics.print(debugString, x, y) +end + +return CharacterPanel diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua index 3550ce8..d3b96a1 100644 --- a/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/init.lua @@ -2,4 +2,5 @@ local folder = "scenes.debug.menu.infopanel." return { Gamedata = require(folder .. "gamedata"), + Character = require(folder .. "character"), } diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index e95973f..189e9d4 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -56,8 +56,8 @@ function DebugMenu:buildSaveMenu() end function DebugMenu:addCharacterMenu(name, data) - self:addSubMenu(name, "characters", data.fullname) - menu.commons.SubMenuWidget(self, name, "characters", "Back") + self:addSubMenu(name, "characters", data.fullname, panels.Character, data) + menu.SubMenuWidget(self, name, "characters", "Back", panels.Gamedata, nil) end function DebugMenu:buildOtherMenu() @@ -83,10 +83,14 @@ function DebugMenu:update(dt) end end -function DebugMenu:addSubMenu(submenu, parent, name) +function DebugMenu:addSubMenu(submenu, parent, name, panel, panelArgument) local parent = parent or "BaseMenu" menu.commons.DebugMenu(self, submenu) - menu.commons.SubMenuWidget(self, parent, submenu, name .. " >") + if (panel == nil) then + menu.commons.SubMenuWidget(self, parent, submenu, name .. " >") + else + menu.SubMenuWidget(self, parent, submenu, name .. " >", panel, panelArgument) + end end function DebugMenu:draw() diff --git a/sonic-radiance.love/scenes/debug/menu/menu.lua b/sonic-radiance.love/scenes/debug/menu/menu.lua index 5c1266b..0ba4c1c 100644 --- a/sonic-radiance.love/scenes/debug/menu/menu.lua +++ b/sonic-radiance.love/scenes/debug/menu/menu.lua @@ -5,6 +5,7 @@ menu.ExitWidget = commons.DebugWidget:extend() menu.ShowBackgroundWidget = commons.DebugWidget:extend() menu.SaveWidget = commons.DebugWidget:extend() menu.LoadWidget = commons.DebugWidget:extend() +menu.SubMenuWidget = commons.SubMenuWidget:extend() -- ExitWidget function menu.ExitWidget:new(scene, menuName) @@ -26,7 +27,7 @@ end -- Save game function menu.SaveWidget:new(scene, menuName) - menu.ShowBackgroundWidget.super.new(self, scene, menuName, "Save game") + menu.SaveWidget.super.new(self, scene, menuName, "Save game") end function menu.SaveWidget:action() @@ -35,7 +36,7 @@ end -- Save game function menu.LoadWidget:new(scene, menuName, slot) - menu.ShowBackgroundWidget.super.new(self, scene, menuName, "Load file " .. slot) + menu.LoadWidget.super.new(self, scene, menuName, "Load file " .. slot) self.slot = slot end @@ -43,5 +44,18 @@ function menu.LoadWidget:action() game:read(self.slot) end +-- Submenu +function menu.SubMenuWidget:new(scene, menu_name, newmenu, name, panel, panelArgument) + menu.SubMenuWidget.super.new(self, scene, menu_name, newmenu, name) + self.panel = panel + self.panelArgument = panelArgument +end + +function menu.SubMenuWidget:action() + self.scene.menusystem:switchMenu(self.newmenu) + self.scene.panel = self.panel(self.panelArgument) +end + + return menu From b799586a4c39ee744ccf61530babe881793789b2 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 2 Aug 2020 11:04:49 +0200 Subject: [PATCH 68/68] feat: add more info to character panel --- .../scenes/debug/menu/infopanel/character.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua index a3af0a0..fd5fe59 100644 --- a/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/character.lua @@ -8,6 +8,15 @@ end function CharacterPanel:drawContent(x, y) local debugString = "# " .. self.character.name .. "(" .. "Lvl " .. self.character.level .. ")" .. "\n" + local debugString = debugString .. "EXP: " .. self.character.exp .. " / " .. self.character.exp_next .. "\n" + local debugString = debugString .. "HP: " .. self.character.hp .. " / " .. self.character.stats.hpmax .. "\n" + local debugString = debugString .. "PP: " .. self.character.pp .. " / " .. self.character.stats.ppmax .. "\n" + local debugString = debugString .. "ATK: " .. self.character.stats.attack + local debugString = debugString .. " DEF: " .. self.character.stats.defense + local debugString = debugString .. " SPD: " .. self.character.stats.speed .. "\n" + local debugString = debugString .. "POW: " .. self.character.stats.power + local debugString = debugString .. " MND: " .. self.character.stats.mind + local debugString = debugString .. " TEK: " .. self.character.stats.technic .. "\n" love.graphics.print(debugString, x, y) end