-
Notifications
You must be signed in to change notification settings - Fork 2
/
ZSCRIPT.ArcanumSpell.zsc
151 lines (132 loc) · 4.75 KB
/
ZSCRIPT.ArcanumSpell.zsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#include "Spells/Destruction/Fireball.zsc"
#include "Spells/Destruction/Claymore.zsc"
#include "Spells/Destruction/Thunderclap.zsc"
#include "Spells/Destruction/Hammerfist.zsc"
#include "Spells/Destruction/Immolation.zsc"
#include "Spells/Destruction/Voidstorm.zsc"
#include "Spells/Restoration/Revitalization.zsc"
#include "Spells/Restoration/LifeForce.zsc"
#include "Spells/Restoration/Rage.zsc"
#include "Spells/Restoration/Transfusion.zsc"
#include "Spells/Restoration/Resurrect.zsc"
#include "Spells/Restoration/SoulGuard.zsc"
#include "Spells/Restoration/Invulnerability.zsc"
#include "Spells/Alteration/FarReach.zsc"
#include "Spells/Alteration/Worldbreaker.zsc"
#include "Spells/Alteration/Shield.zsc"
#include "Spells/Alteration/Haste.zsc"
#include "Spells/Alteration/HoradricMalus.zsc"
#include "Spells/Alteration/Feather.zsc"
#include "Spells/Alteration/Reenergize.zsc"
#include "Spells/Alteration/Displacement.zsc"
#include "Spells/Alteration/MassRecall.zsc"
#include "Spells/Conjuration/GuardianOrb.zsc"
#include "Spells/Conjuration/GhostSquad.zsc"
#include "Spells/Conjuration/HolyForce.zsc"
#include "Spells/Conjuration/Barrier.zsc"
#include "Spells/Conjuration/Bridge.zsc"
#include "Spells/Conjuration/Candlelight.zsc"
class ArcanumSpellTree abstract play
{
abstract clearscope string GetName() const;
abstract clearscope string GetDescription() const;
Array<ArcanumSpell> Spells;
void InsertSpell(ArcanumSpell spl)
{
int InsIndex = 0;
int SpellsCount = Spells.Size();
if (SpellsCount > 0)
{
for (int i = 0; i < SpellsCount; ++i)
{
if (spl.GetIndex() >= Spells[i].GetIndex())
{
InsIndex = i + 1;
}
else
{
InsIndex = i;
break;
}
}
}
Spells.Insert(InsIndex, spl);
}
bool SpellExists(class<ArcanumSpell> spell)
{
for (int i = 0; i < Spells.Size(); ++i)
{
if (Spells[i].GetClass() == spell)
{
return true;
}
}
return false;
}
}
class ArcanumTreeDestruction : ArcanumSpellTree
{
override string GetName() { return "\c[Red]Destruction\c-"; }
override string GetDescription() { return "Those who wish to destroy the world may find out how trivial it is. But is it really what you want?\n\nThis tree contains spells to call down thunder, annihilate entire hordes, or light a candle."; }
}
class ArcanumTreeRestoration : ArcanumSpellTree
{
override string GetName() { return "\c[Tan]Restoration\c-"; }
override string GetDescription() { return "It is a wise man's goal to heal the world.\n\nRestoration spells give you the ability to resurrect friends or foes, heal their wounds, cleanse their body, and protect it."; }
}
class ArcanumTreeAlteration : ArcanumSpellTree
{
override string GetName() { return "\c[Green]Alteration\c-"; }
override string GetDescription() { return "Nothing is as it appears. Manipulate the world to your liking.\n\nThe school of Alteration lets you destroy entire walls or otherwise manipulate objects."; }
}
class ArcanumTreeConjuration : ArcanumSpellTree
{
override string GetName() { return "\c[Purple]Conjuration\c-"; }
override string GetDescription() { return "If it does not exist, make it.\n\nConjuration is for the strongest of magi. With it, you can summon monsters or materialize objects."; }
}
class ArcanumSpell abstract play
{
enum SType
{
SType_SelfOrMass = 1,
SType_Targeted = 2
}
abstract class<ArcanumSpellTree> GetTree() const;
abstract int GetIndex() const;
abstract string GetName() const;
abstract int GetSpellType() const;
abstract int GetManaCost() const; // [Ace] Returns: blood, blues.
abstract ui string GetDescription() const;
abstract ui string GetTechnicalInfo() const;
abstract int GetMaxExperience() const;
abstract class<ArcanumSigil> GetSigil() const;
virtual ui void DrawHudStuff(HDStatusBar sb, HDPlayerPawn hpl, HDArcanumTome tome) { }
// [Ace; 17.01.22] This is currently unused because I've opted for a threshold system rather than a time duration.
// HDest is a slow mod so half the time the effects expire before you've made use of them or they require you to know in advance that you'd need them.
// This virtual only makes sense for timed effects whose indicator is not drawn in DrawHudStuff.
// The returns are the graphic to use and the class the internal stuff should check for.
virtual ui string, class<Powerup> GetIndicatorInfo() const { return "", null; }
// [Ace] Returns whether or not the spell reached max level.
bool GainExperience(double amt)
{
int maxExp = GetMaxExperience();
if (Experience == maxExp)
{
return false;
}
Experience = min(maxExp, Experience + amt);
return Experience == maxExp;
}
clearscope double GetExperienceFactor()
{
int maxExp = GetMaxExperience();
return maxExp > 0 ? Experience / maxExp : 0;
}
double Experience;
}
class ArcanumIndicator ui
{
string Icon;
Vector2 Pos;
Color Col;
}