Skip to content

Commit

Permalink
V 0.5 -Vertical Slice Completed
Browse files Browse the repository at this point in the history
-Redone Rewards (now has Reward Director)
-Created Items
-Created Upgrades
-Created new Enemies
-Created new Allies
-Created way to switch Allies
-Made all items and units and spells have their own art (beta art)
  • Loading branch information
AmethystEspeon committed Jan 19, 2023
1 parent 51ff1be commit 357ef12
Show file tree
Hide file tree
Showing 81 changed files with 1,664 additions and 252 deletions.
13 changes: 9 additions & 4 deletions Auras/ArcaneConversion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,31 @@ local ImageList = require("Images.ImageList");
local ArcaneConversion = {};

function ArcaneConversion:init()
self.castSpellName = SpellIdentifierList.ArcaneConversion;
self.image = ImageList.ArcaneConversion;
self.startingDuration = 10;
self.currentDuration = 10;

local castSpell = self:getCastSpell() or {durationMultiplier = 1};
self.startingDuration = 10*castSpell.durationMultiplier;
self.currentDuration = 10*castSpell.durationMultiplier;
self.tickInterval = 0.1;
self.timeSinceLastTick = 0;
self.healPerTick = 5;
end

function CreateArcaneConversion(target, numDebuffRemoved)
function CreateArcaneConversion(target, caster, numDebuffRemoved)
assert(target);
local arcaneConversionBuff = Create(Aura,Buff,ArcaneConversion);
arcaneConversionBuff.numDebuffRemoved = numDebuffRemoved;
arcaneConversionBuff.target = target;
arcaneConversionBuff.caster = caster;
return arcaneConversionBuff;
end

function ArcaneConversion:tick(dt)
self.timeSinceLastTick = self.timeSinceLastTick + dt
if self.timeSinceLastTick >= self.tickInterval then
self.target:addHealth(self.healPerTick+self.healPerTick*self.numDebuffRemoved);
local castSpell = self:getCastSpell();
self.target:addHealth((self.healPerTick+self.healPerTick*self.numDebuffRemoved)*castSpell.damageHealMultiplier);
self.timeSinceLastTick = 0;
end
if self.currentDuration > 0 then
Expand Down
11 changes: 11 additions & 0 deletions Auras/Aura.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ function Aura:drawDuration(x, y, scale)
love.graphics.pop()
end

function Aura:getCastSpell()
if not self.caster then
return;
end
for _, spell in ipairs(self.caster.spells) do
if spell.name == self.castSpellName then
return spell;
end
end
end

function CreateAura()
return Create(Aura);
end
Expand Down
13 changes: 9 additions & 4 deletions Auras/Cauterize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@ local ImageList = require("Images.ImageList");
local Cauterize = {};

function Cauterize:init()
self.castSpellName = SpellIdentifierList.Cauterize;
self.image = ImageList.Cauterize;
self.timeSinceLastTick = 0;
self.tickInterval = 0.1;
self.startingDuration = 5;
self.currentDuration = 5;

local castSpell = self:getCastSpell() or {durationMultiplier = 1}
self.startingDuration = 5*castSpell.durationMultiplier;
self.currentDuration = 5*castSpell.durationMultiplier;
self.healPerTick = 20;
end

function CreateCauterize(target)
function CreateCauterize(target, caster)
assert(target);
local cauterizeBuff = Create(Aura,Buff,Cauterize);
cauterizeBuff.target = target;
cauterizeBuff.caster = caster;
return cauterizeBuff;
end

function Cauterize:tick(dt)
local castSpell = self:getCastSpell();
self.timeSinceLastTick = self.timeSinceLastTick + dt;
if self.timeSinceLastTick >= self.tickInterval then
self.target:addHealth(self.healPerTick);
self.target:addHealth(self.healPerTick*castSpell.damageHealMultiplier);
self.timeSinceLastTick = 0;
end
if self.currentDuration > 0 then
Expand Down
43 changes: 43 additions & 0 deletions Auras/Decay.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
local Create = require("Core.Create");
local _, Aura = unpack(require("Auras.Aura"));
local _, Debuff = unpack(require("Auras.Debuff"));
local ImageList = require("Images.ImageList");
local ItemIdentifierList = require("Items.ItemIdentifierList");

local Decay = {};

function Decay:init()
self.name = ItemIdentifierList.DecayingPower;
self.castSpellName = SpellIdentifierList.DecayingPower;
self.image = ImageList.DecayingPower;
self.timeSinceLastTick = 0;
self.tickInterval = 1;
self.damagePerTick = 15;

self.isDispellable = false;
end

function Decay:removeAura()
self.expired = true;
self.isDispellable = true;
end

function CreateDecayingPower(target)
assert(target);
local decayingPowerDebuff = Create(Aura, Debuff, Decay);
decayingPowerDebuff.target = target;
return decayingPowerDebuff;
end

function Decay:tick(dt)
if self.expired then
return;
end
self.timeSinceLastTick = self.timeSinceLastTick + dt;
if self.timeSinceLastTick >= self.tickInterval then
self.target:minusHealth(self.damagePerTick);
self.timeSinceLastTick = 0;
end
end

return {CreateDecayingPower, Decay};
4 changes: 3 additions & 1 deletion Auras/DivineInspiration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ local _,Buff = unpack(require("Auras.Buff"));
local DivineInspiration = {};

function DivineInspiration:init()
self.castSpellName = SpellIdentifierList.DivineInspiration;
self.image = ImageList.DivineInspiration;
self.startingDuration = 15;
self.currentDuration = 15;
end

function CreateDivineInspiration(target)
function CreateDivineInspiration(target, caster)
assert(target)
local divineInspirationBuff = Create(Aura,Buff,DivineInspiration);
divineInspirationBuff.target = target;
divineInspirationBuff.caster = caster;
divineInspirationBuff.lastHealth = target.health;
return divineInspirationBuff;
end
Expand Down
45 changes: 45 additions & 0 deletions Auras/HealCooldown.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
local Create = require("Core.Create");
local _, Aura = unpack(require("Auras.Aura"));
local _, Buff = unpack(require("Auras.Buff"));
local ImageList = require("Images.ImageList");
local SpellIdentifierList = require("Spells.SpellIdentifierList");

local Heal = {};

function Heal:init()
self.name = SpellIdentifierList.Heal .. "Cooldown";
self.castSpellName = SpellIdentifierList.Heal;
self.image = ImageList.Heal;
self.startingDuration = 10;
self.currentDuration = 10;
self.stacks = 1;

self.isDispellable = false;
end

function CreateHeal(target, caster)
assert(target);
local healBuff = Create(Aura,Buff,Heal);
healBuff.target = target;
healBuff.caster = caster;
return healBuff;
end

function Heal:tick(dt)
if self.currentDuration > 0 then
self.currentDuration = self.currentDuration - dt;
elseif self.currentDuration <= 0 then
self.currentDuration = 0;
self.expired = true;
end
end

function Heal:onExpire()
for _, spell in pairs(self.caster.spells) do
if spell.name == SpellIdentifierList.Heal then
spell.maxCooldown = spell.initialMaxCooldown;
end
end
end

return {CreateHeal, Heal}
41 changes: 41 additions & 0 deletions Auras/HealDispel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local Create = require("Core.Create");
local _, Aura = unpack(require("Auras.Aura"));
local _, Buff = unpack(require("Auras.Buff"));
local ImageList = require("Images.ImageList");
local SpellIdentifierList = require("Spells.SpellIdentifierList");

local Heal = {};

function Heal:init()
self.name = SpellIdentifierList.Heal .. "Dispel";
self.castSpellName = SpellIdentifierList.Heal;
self.image = ImageList.Heal;
self.startingDuration = 1;
self.currentDuration = 1;

self.isDispellable = false;
end

function CreateHeal(target, caster)
assert(target);
local healBuff = Create(Aura,Buff,Heal);
healBuff.target = target;
healBuff.caster = caster
return healBuff;
end

function Heal:tick(dt)
if self.currentDuration > 0 then
self.currentDuration = self.currentDuration - dt;
elseif self.currentDuration <= 0 then
self.currentDuration = 0;
self.expired = true;
end
for _,debuff in pairs(self.target.debuffs) do
if debuff.isDispellable then
debuff:dispel(self.caster);
end
end
end

return {CreateHeal, Heal};
9 changes: 6 additions & 3 deletions Auras/Miracle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ local ImageList = require("Images.ImageList");
local Miracle = {};

function Miracle:init()
self.castSpellName = SpellIdentifierList.Miracle;
self.image = ImageList.Miracle;
self.startingDuration = 5;
self.currentDuration = 5;
local castSpell = self:getCastSpell() or {durationMultiplier = 1};
self.startingDuration = 5*castSpell.durationMultiplier;
self.currentDuration = 5*castSpell.durationMultiplier;
end

function CreateMiracle(target)
function CreateMiracle(target, caster)
assert(target);
local miracleBuff = Create(Aura,Buff,Miracle);
miracleBuff.target = target;
miracleBuff.caster = caster;
return miracleBuff;
end

Expand Down
12 changes: 8 additions & 4 deletions Auras/PrayToDarkness.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ local ImageList = require("Images.ImageList");
local PrayToDarkness = {};

function PrayToDarkness:init()
self.castSpellName = SpellIdentifierList.PrayToDarkness;
self.image = ImageList.PrayToDarkness;
self.timeSinceLastTick = 0;
self.tickInterval = 1;
self.startingDuration = 15;
self.currentDuration = 15;
self.damagePerTick = 20;

local castSpell = self:getCastSpell() or {durationMultiplier = 1};
self.startingDuration = 15*castSpell.durationMultiplier;
self.currentDuration = 15*castSpell.durationMultiplier;
self.damagePerTick = 20/castSpell.durationMultiplier; --Same damage over time, longer duration.
end

function CreatePrayToDarkness(target)
function CreatePrayToDarkness(target, caster)
assert(target);
local prayToDarknessDebuff = Create(Aura,Debuff,PrayToDarkness);
prayToDarknessDebuff.target = target;
prayToDarknessDebuff.caster = caster;
return prayToDarknessDebuff;
end

Expand Down
13 changes: 9 additions & 4 deletions Auras/Regeneration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,31 @@ local ImageList = require("Images.ImageList");
local Regeneration = {};

function Regeneration:init()
self.castSpellName = SpellIdentifierList.Regeneration;
self.image = ImageList.Regeneration;
self.timeSinceLastTick = 0;
self.tickInterval = 0.25;
self.startingDuration = 10;
self.currentDuration = 10;

local castSpell = self:getCastSpell() or {durationMultiplier = 1};
self.startingDuration = 10*castSpell.durationMultiplier;
self.currentDuration = 10*castSpell.durationMultiplier;
self.healPerTick = 10;
--Total Healing: (1/0.5)*5*10 = 100
end

function CreateRegeneration(target)
function CreateRegeneration(target, caster)
assert(target);
local regenerationBuff = Create(Aura,Buff,Regeneration);
regenerationBuff.target = target;
regenerationBuff.caster = caster;
return regenerationBuff;
end

function Regeneration:tick(dt)
local castSpell = self:getCastSpell();
self.timeSinceLastTick = self.timeSinceLastTick + dt;
if self.timeSinceLastTick >= self.tickInterval then
self.target:addHealth(self.healPerTick);
self.target:addHealth(self.healPerTick*castSpell.damageHealMultiplier);
self.timeSinceLastTick = 0;
end
if self.currentDuration > 0 then
Expand Down
7 changes: 5 additions & 2 deletions Auras/RewindFate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@ local _,Buff = unpack(require("Auras.Buff"));
local RewindFate = {};

function RewindFate:init()
self.castSpellName = SpellIdentifierList.RewindFate;
self.image = ImageList.RewindLate;
self.startingDuration = 5;
self.currentDuration = 5;
end

function CreateRewindFate(target)
function CreateRewindFate(target, caster)
assert(target)
local rewindFateBuff = Create(Aura,Buff,RewindFate);
rewindFateBuff.target = target;
rewindFateBuff.caster = caster;
rewindFateBuff.previousHealth = target.health;
rewindFateBuff.previousMana = target.mana;
--TODO: Find a different way around this.
if target ~= "dummy" then
rewindFateBuff.previousDead = target.isDead();
rewindFateBuff.previousDead = target:isDead();
end
--TODO: Make it rewind other buffs maybe?
return rewindFateBuff;
end

function RewindFate:onExpire()
print("OLD:" .. self.previousHealth .. " NEW:" .. self.target.health)
self.target.health = self.previousHealth;
self.target.mana = self.previousMana;
self.target.dead = self.previousDead;
Expand Down
13 changes: 9 additions & 4 deletions Auras/ScatterDisease.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@ local ImageList = require("Images.ImageList");
local ScatterDisease = {};

function ScatterDisease:init()
self.castSpellName = SpellIdentifierList.ScatterDisease;
self.image = ImageList.ScatterDisease;
self.timeSinceLastTick = 0;
self.tickInterval = 1;
self.startingDuration = 10;
self.currentDuration = 10;

local castSpell = self:getCastSpell() or {durationMultiplier = 1};
self.startingDuration = 10*castSpell.durationMultiplier;
self.currentDuration = 10*castSpell.durationMultiplier;
self.damagePerTick = 25;
end

function CreateScatterDisease(target)
function CreateScatterDisease(target, caster)
assert(target);
local scatterDiseaseDebuff = Create(Aura, Debuff, ScatterDisease);
scatterDiseaseDebuff.target = target;
scatterDiseaseDebuff.caster = caster;
return scatterDiseaseDebuff;
end

function ScatterDisease:tick(dt)
local castSpell = self:getCastSpell();
self.timeSinceLastTick = self.timeSinceLastTick + dt;
if self.timeSinceLastTick >= self.tickInterval then
self.target:minusHealth(self.damagePerTick);
self.target:minusHealth(self.damagePerTick*castSpell.damageHealMultiplier);
self.timeSinceLastTick = 0;
end
if self.currentDuration > 0 then
Expand Down
Loading

0 comments on commit 357ef12

Please sign in to comment.