1------------------------------------------------------------------------------[[
2-- Filename: status.lua
3--
4-- Description: This file contains the definitions of all status effects in
5-- Hero of Allacrost. Each item has a unique integer identifier that is used
6-- as its key in the items table below.
7------------------------------------------------------------------------------]]
8
9-- All item definitions are stored in this table
10if (status_effects == nil) then
11   status_effects = {}
12end
13
14
15status_effects[hoa_global.GameGlobal.GLOBAL_STATUS_FORTITUDE_BOOST] = {
16	name = hoa_system.Translate("Defense Up"),
17
18	Apply = function(effect)
19		timer = effect:GetTimer();
20		actor = effect:GetAffectedActor();
21		intensity = effect:GetIntensity();
22
23		actor:ResetFortitude();
24		base_fortitude = actor:GetFortitude();
25		if (intensity == hoa_global.GameGlobal.GLOBAL_INTENSITY_NEUTRAL) then
26			-- Fortitude was already reset, no further action needed
27		elseif (intensity == hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_LESSER) then
28			actor:SetFortitude(base_fortitude * 2); -- Fortitude 2x
29		elseif (intensity == hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_MODERATE) then
30			actor:SetFortitude(base_fortitude * 3); -- Fortitude 3x
31		elseif (intensity == hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_GREATER) then
32			actor:SetFortitude(base_fortitude * 4); -- Fortitude 4x
33		elseif (intensity == hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_EXTREME) then
34			actor:SetFortitude(base_fortitude * 5); -- Fortitude 5x
35		else
36			-- TODO: print some sort of error message?
37		end
38		timer:SetDuration(30000); -- 30 seconds
39	end
40}
41
42
43
44
45
46status_effects[100] = {
47	name = hoa_system.Translate("Dummy effect"),
48
49	Init = function(thisEffect, target)
50	end,
51
52	Update = function(thisEffect, target)
53	end,
54
55	Remove = function(thisEffect, target)
56	end
57}
58
59status_effects[200] = {
60	name = hoa_system.Translate("Defense Up"),
61
62	Init = function(thisEffect, target)
63		thisEffect:SetForModifier(0.25); -- Increase Physical Defense by 25%
64		thisEffect:SetDuration(30000); -- This is about three "turns"
65		thisEffect:StartTimer();
66	end,
67
68	Update = function(thisEffect, target)
69	end,
70
71	Remove = function(thisEffect, target)
72	end
73}
74
75status_effects[300] = {
76	name = hoa_system.Translate("Stun"),
77	-- Stop an actor's timer for a brief period
78
79	Init = function(thisEffect, target)
80		thisEffect:SetStunEffect(true);
81		thisEffect:SetDuration(10000); -- This is about one "turn"
82		thisEffect:StartTimer();
83	end,
84
85	Update = function(thisEffect, target)
86	end,
87
88	Remove = function(thisEffect, target)
89	end
90}
91
92status_effects[400] = {
93	name = hoa_system.Translate("Dodge Enemies"),
94
95	Init = function(thisEffect, target)
96		thisEffect:SetEvaModifier(9.0); -- Increase evade by 900%
97		thisEffect:SetDuration(20000); -- This is about two "turns"
98		thisEffect:StartTimer();
99	end,
100
101	Update = function(thisEffect, target)
102	end,
103
104	Remove = function(thisEffect, target)
105	end
106}
107