parent
94e384ee27
commit
cf396e9464
7 changed files with 102 additions and 4 deletions
|
@ -23,13 +23,13 @@ function EffectManager:getEffectStrings(character)
|
|||
if (#self.itemdata.effects >= 1) then
|
||||
local effectInstance = self:getEffectObject(self.itemdata.effects[1], character)
|
||||
if (effectInstance ~= nil) then
|
||||
returnString = effectInstance:applyEffect() .. "\n"
|
||||
returnString = effectInstance:getText() .. "\n"
|
||||
end
|
||||
end
|
||||
if (#self.itemdata.effects >= 2) then
|
||||
local effectInstance = self:getEffectObject(self.itemdata.effects[2], character)
|
||||
if (effectInstance ~= nil) then
|
||||
returnString = effectInstance:applyEffect()
|
||||
returnString = returnString .. effectInstance:getText()
|
||||
end
|
||||
end
|
||||
return returnString
|
||||
|
|
17
sonic-radiance.love/game/loot/effects/blockstatus.lua
Normal file
17
sonic-radiance.love/game/loot/effects/blockstatus.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local ParentEffect = require "game.loot.effects.parent"
|
||||
local BlockStatusEffect = ParentEffect:extend()
|
||||
|
||||
function BlockStatusEffect:new(effect, character)
|
||||
self.effect = effect
|
||||
self.character = character
|
||||
end
|
||||
|
||||
function BlockStatusEffect:applyEffect()
|
||||
|
||||
end
|
||||
|
||||
function BlockStatusEffect:getText()
|
||||
return "Block " .. self.effect.blockWhat .. " " .. "effects"
|
||||
end
|
||||
|
||||
return BlockStatusEffect
|
28
sonic-radiance.love/game/loot/effects/heal.lua
Normal file
28
sonic-radiance.love/game/loot/effects/heal.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
local ParentEffect = require "game.loot.effects.parent"
|
||||
local HealEffect = ParentEffect:extend()
|
||||
|
||||
function HealEffect:new(effect, character)
|
||||
self.effect = effect
|
||||
self.character = character
|
||||
end
|
||||
|
||||
function HealEffect:applyEffect()
|
||||
|
||||
end
|
||||
|
||||
function HealEffect:getText()
|
||||
local num = self.effect.value
|
||||
if (self.effect.computationMode == "percent") then
|
||||
num = num .. "%"
|
||||
end
|
||||
local type = ""
|
||||
if (self.effect.healType == "hp") then
|
||||
type = "HP"
|
||||
end
|
||||
if (self.effect.healType == "mp") then
|
||||
type = "MP"
|
||||
end
|
||||
return "Heal " .. num .. " " .. type;
|
||||
end
|
||||
|
||||
return HealEffect
|
|
@ -1,3 +1,6 @@
|
|||
return {
|
||||
|
||||
heal = require "game.loot.effects.heal",
|
||||
setStatus = require "game.loot.effects.setstatus",
|
||||
protectElement = require "game.loot.effects.protectelem",
|
||||
blockStatus = require "game.loot.effects.blockstatus"
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
local EffectParent = Object:extend()
|
||||
|
||||
function EffectParent:new(effect, character)
|
||||
|
||||
self.effect = effect
|
||||
self.character = character
|
||||
end
|
||||
|
||||
function EffectParent:applyEffect()
|
||||
|
|
19
sonic-radiance.love/game/loot/effects/protectelem.lua
Normal file
19
sonic-radiance.love/game/loot/effects/protectelem.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
local ParentEffect = require "game.loot.effects.parent"
|
||||
local ProtectElemEffect = ParentEffect:extend()
|
||||
|
||||
function ProtectElemEffect:new(effect, character)
|
||||
self.effect = effect
|
||||
self.character = character
|
||||
end
|
||||
|
||||
function ProtectElemEffect:applyEffect()
|
||||
|
||||
end
|
||||
|
||||
function ProtectElemEffect:getText()
|
||||
local returnString = "Protect from " .. self.effect.element
|
||||
|
||||
return returnString
|
||||
end
|
||||
|
||||
return ProtectElemEffect
|
30
sonic-radiance.love/game/loot/effects/setstatus.lua
Normal file
30
sonic-radiance.love/game/loot/effects/setstatus.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
local ParentEffect = require "game.loot.effects.parent"
|
||||
local StatusEffect = ParentEffect:extend()
|
||||
|
||||
function StatusEffect:new(effect, character)
|
||||
self.effect = effect
|
||||
self.character = character
|
||||
end
|
||||
|
||||
function StatusEffect:applyEffect()
|
||||
|
||||
end
|
||||
|
||||
function StatusEffect:getText()
|
||||
local returnString = ""
|
||||
if (self.effect.set) then
|
||||
returnString = returnString .. "Give "
|
||||
else
|
||||
returnString = returnString .. "Remove "
|
||||
end
|
||||
|
||||
if (self.effect.status == "allNegative") then
|
||||
returnString = returnString .. "all negative effects"
|
||||
else
|
||||
returnString = returnString .. self.effect.status .. " " .. "effect"
|
||||
end
|
||||
|
||||
return returnString
|
||||
end
|
||||
|
||||
return StatusEffect
|
Loading…
Reference in a new issue