Mercurial > mm7
annotate Spells.cpp @ 1974:0f62a2b8bd0a
stru319::_4273BB moved to Actor::_4273BB, renamed to _4273BB_DoesHitOtherActor
author | Grumpy7 |
---|---|
date | Sat, 26 Oct 2013 00:41:13 -0700 |
parents | 4da5644df18f |
children | 7a9477135943 |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1104
diff
changeset
|
4 |
0 | 5 #include <stdlib.h> |
6 | |
7 #include "Spells.h" | |
8 #include "Overlays.h" | |
9 #include "LOD.h" | |
189 | 10 #include "texts.h" |
0 | 11 |
12 #include "mm7_data.h" | |
1295 | 13 #include "Party.h" |
14 #include "Math.h" | |
15 #include "SpriteObject.h" | |
16 #include "ObjectList.h" | |
17 #include "Indoor.h" | |
18 #include "AudioPlayer.h" | |
19 #include "Actor.h" | |
20 #include "Game.h" | |
21 #include "stru6.h" | |
0 | 22 |
23 | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
24 std::array<TownPortalData, 6> TownPortalList = //4ECBB8 |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
25 {{ |
839 | 26 {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0}, |
27 {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0}, | |
28 {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0}, | |
29 {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0}, | |
30 {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0}, | |
31 {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0} | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
32 }} ; |
0 | 33 |
34 struct SpellStats *pSpellStats; | |
35 | |
36 | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
37 std::array<stru324_spell, 103> stru_4E3ACC = |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
38 {{ |
488 | 39 {10, 0}, |
40 {1000, 0}, {1010, 0}, {1020, 0}, {1030, 0}, {1040, 0}, {1050, 0}, {1060, 0}, {1070, 0}, {1080, 0}, {1090, 0}, {1100, 0}, | |
41 {2000, 0}, {2010, 0}, {2020, 0}, {2030, 0}, {2040, 0}, {2050, 0}, {2060, 0}, {2070, 0}, {2080, 0}, {2090, 0}, {2100, 0}, | |
42 {3000, 0}, {3010, 0}, {3020, 0}, {3030, 0}, {3040, 0}, {3050, 0}, {3060, 0}, {3070, 0}, {3080, 0}, {3090, 0}, {3100, 0}, | |
43 {4000, 0}, {4010, 0}, {4020, 0}, {4030, 0}, {4040, 0}, {4050, 0}, {4060, 0}, {4070, 0}, {4080, 0}, {4090, 0}, {4100, 0}, | |
44 {5000, 0}, {5010, 0}, {5020, 0}, {5030, 0}, {5040, 0}, {5050, 0}, {5060, 0}, {5070, 0}, {5080, 0}, {5090, 0}, {5100, 0}, | |
45 {6000, 0}, {6010, 0}, {6020, 0}, {6030, 0}, {6040, 0}, {6050, 0}, {6060, 0}, {6070, 0}, {6080, 0}, {6090, 0}, {6100, 0}, | |
46 {7000, 0}, {7010, 0}, {7020, 0}, {7030, 0}, {7040, 0}, {7050, 0}, {7060, 0}, {7070, 0}, {7080, 0}, {7090, 0}, {7100, 0}, | |
47 {8000, 0}, {8010, 0}, {8020, 0}, {8030, 0}, {8040, 0}, {8050, 0}, {8060, 0}, {8070, 0}, {8080, 0}, {8090, 0}, {8100, 0}, | |
1086 | 48 {9000, 0}, {9010, 0}, {9020, 0}, {9030, 0}, {9040, 0}, {9050, 0}, {9060, 0}, {9070, 0}, {9080, 0}, {9090, 0}, {9100, 0}, |
49 {545, 0}, | |
50 {545, 0}, | |
51 {555, 0} | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
52 }}; |
363 | 53 //9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1! |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
54 std::array<SpellData, 100> pSpellDatas={{ |
363 | 55 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
56 | |
57 {1, 1, 1, 1, 60, 60, 60, 40, 0, 0},//0 | |
192 | 58 {2, 2, 2, 2, 110, 110, 100, 90, 768, 0}, |
59 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
60 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0}, | |
61 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, | |
62 {8, 8, 8, 8, 100, 100, 90, 80, 1536, 0}, | |
63 {10, 10, 10, 10, 150, 150, 150, 150, 1536, 0}, | |
64 {15, 15, 15, 15, 120, 120, 120, 120, 1536, 0}, | |
65 {20, 20, 20, 20, 100, 100, 100, 90, 264, 0}, | |
66 {25, 25, 25, 25, 100, 100, 100, 90, 268, 0}, | |
67 {30, 30, 30, 30, 90, 90, 90, 90, 3855, 0}, | |
363 | 68 |
69 {1, 1, 1, 0, 60, 60, 60, 60, 0, 0}, //1 | |
192 | 70 {2, 2, 2, 2, 120, 120, 120, 100, 0, 0}, |
71 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
72 {4, 4, 4, 4, 110, 100, 90, 80, 258, 0}, | |
73 {5, 5, 5, 5, 90, 90, 70, 50, 0, 0}, | |
74 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
75 {10, 10, 10, 10, 100, 100, 90, 70, 2048, 0}, | |
76 {15, 15, 15, 15, 200, 200, 200, 200, 0, 0}, | |
77 {20, 20, 20, 20, 100, 100, 100, 90, 2570, 0}, | |
78 {25, 25, 25, 25, 250, 250, 250, 250, 0, 0}, | |
79 {30, 30, 30, 30, 90, 90, 90, 90, 276, 0}, | |
363 | 80 |
81 {1, 1, 1, 1, 60, 60, 60, 20, 0, 0}, //2 | |
192 | 82 {2, 2, 2, 2, 110, 100, 90, 70, 514, 0}, |
83 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
84 {4, 4, 4, 4, 110, 100, 90, 80, 1024, 0}, | |
85 {5, 5, 5, 5, 150, 150, 150, 150, 0, 0}, | |
86 {8, 8, 8, 8, 200, 200, 200, 200, 0, 0}, | |
87 {10, 10, 10, 10, 100, 100, 90, 80, 2313, 0}, | |
88 {15, 15, 15, 15, 140, 140, 140, 140, 0, 0}, | |
89 {20, 20, 20, 20, 200, 200, 200, 200, 0, 0}, | |
90 {25, 25, 25, 25, 80, 80, 80, 80, 780, 0}, | |
91 {30, 30, 30, 30, 250, 250, 250, 250, 0, 0}, | |
363 | 92 |
93 {1, 1, 1, 1, 80, 80, 80, 80, 0, 0}, //3 | |
192 | 94 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, |
95 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
96 {4, 4, 4, 4, 110, 100, 90, 80, 773, 0}, | |
97 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, | |
98 {8, 8, 8, 8, 100, 100, 90, 80, 2304, 0}, | |
99 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, | |
100 {15, 15, 15, 15, 90, 90, 90, 80, 2048, 0}, | |
101 {20, 20, 20, 20, 150, 150, 150, 150, 0, 0}, | |
102 {25, 25, 25, 25, 100, 100, 100, 90, 276, 0}, | |
103 {30, 30, 30, 30, 90, 90, 90, 90, 25, 0}, | |
363 | 104 |
105 {1, 1, 1, 1, 100, 100, 100, 100, 0, 0}, //4 | |
192 | 106 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, |
107 {3, 3, 3, 3, 90, 90, 90, 90, 0, 0}, | |
108 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0}, | |
109 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, | |
110 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
111 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, | |
112 {15, 15, 15, 15, 100, 100, 100, 100, 2058, 0}, | |
113 {20, 20, 20, 20, 240, 240, 240, 240, 0, 0}, | |
114 {25, 25, 25, 25, 150, 150, 150, 150, 0, 0}, | |
115 {30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0}, | |
363 | 116 |
117 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //5 | |
192 | 118 {2, 2, 2, 2, 110, 110, 110, 110, 771, 0}, |
119 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
120 {4, 4, 4, 4, 110, 100, 90, 80, 0, 0}, | |
121 {5, 5, 5, 5, 100, 100, 100, 100, 0, 0}, | |
122 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
123 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, | |
124 {15, 15, 15, 15, 80, 80, 80, 80, 0, 0}, | |
125 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0}, | |
126 {25, 25, 25, 25, 110, 110, 110, 100, 268, 0}, | |
127 {30, 30, 30, 30, 120, 120, 120, 120, 0, 0}, | |
363 | 128 |
129 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //6 | |
192 | 130 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, |
131 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
132 {4, 4, 4, 4, 110, 100, 90, 80, 520, 0}, | |
133 {5, 5, 5, 5, 110, 110, 110, 110, 0, 0}, | |
134 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
135 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, | |
136 {15, 15, 15, 15, 120, 120, 120, 120, 0, 0}, | |
137 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0}, | |
138 {25, 25, 25, 25, 110, 110, 110, 100, 1310, 0}, | |
139 {30, 30, 30, 30, 100, 100, 100, 100, 0, 0}, | |
363 | 140 |
141 {5, 5, 5, 5, 110, 100, 90, 80, 1024, 0}, //7 | |
192 | 142 {10, 10, 10, 10, 120, 110, 100, 90, 4112, 0}, |
143 {15, 15, 15, 15, 120, 110, 100, 90, 0, 0}, | |
144 {20, 20, 20, 20, 160, 140, 120, 100, 0, 0}, | |
145 {25, 25, 25, 25, 140, 140, 140, 140, 0, 0}, | |
146 {30, 30, 30, 30, 500, 500, 500, 500, 0, 0}, | |
147 {35, 35, 35, 35, 135, 135, 120, 100, 281, 0}, | |
148 {40, 40, 40, 40, 500, 500, 500, 500, 0, 0}, | |
149 {45, 45, 45, 45, 250, 250, 250, 250, 0, 0}, | |
150 {50, 50, 50, 50, 150, 150, 150, 135, 5140, 0}, | |
151 {55, 55, 55, 55, 300, 300, 300, 300, 0, 0}, | |
363 | 152 |
153 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, //8 | |
192 | 154 {15, 15, 15, 15, 120, 110, 100, 90, 2585, 0}, |
155 {20, 20, 20, 20, 120, 100, 90, 120, 0, 0}, | |
156 {25, 25, 25, 25, 120, 120, 120, 120, 0, 0}, | |
157 {30, 30, 30, 30, 90, 90, 80, 70, 1542, 0}, | |
158 {35, 35, 35, 35, 120, 120, 100, 80, 0, 0}, | |
159 {40, 40, 40, 40, 110, 110, 110, 110, 0, 0}, | |
160 {45, 45, 45, 45, 200, 200, 200, 150, 0, 0}, | |
161 {50, 50, 50, 50, 120, 120, 120, 100, 6400, 0}, | |
162 {55, 55, 55, 55, 250, 250, 250, 250, 306, 0}, | |
163 {60, 60, 60, 60, 300, 300, 300, 300, 2073, 0} | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
164 }}; |
0 | 165 |
490 | 166 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
167 std::array<unsigned int, 25> wand_spell_ids = |
490 | 168 { |
169 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm | |
170 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM, | |
171 // 140 Fairy Wand of Light 141 Fairy Wand of Ice 142 Fairy Wand of Lashing 143 Fairy Wand of Mind 144 Fairy Wand of Swarms | |
172 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM, | |
173 // 145 Alacorn Wand of Fireballs 146 Alacorn Wand of Acid 147 Alacorn Wand of Lightning 148 Alacorn Wand of Blades 149 Alacorn Wand of Charms | |
174 SPELL_FIRE_FIREBALL, SPELL_WATER_ACID_BURST, SPELL_AIR_LIGHNING_BOLT, SPELL_EARTH_BLADES, SPELL_MIND_CHARM, | |
175 // 150 Arcane Wand of Blasting 151 Arcane Wand of The Fist 152 Arcane Wand of Rocks 153 Arcane Wand of Paralyzing 154 Arcane Wand of Clouds | |
176 SPELL_WATER_ICE_BLAST, SPELL_BODY_FLYING_FIST, SPELL_EARTH_ROCK_BLAST, SPELL_LIGHT_PARALYZE, SPELL_DARK_TOXIC_CLOUD, | |
177 // 155 Mystic Wand of Implosion 156 Mystic Wand of Distortion 157 Mystic Wand of Sharpmetal 158 Mystic Wand of Shrinking 159 Mystic Wand of Incineration | |
178 SPELL_AIR_IMPLOSION, SPELL_EARTH_MASS_DISTORTION, SPELL_DARK_SHARPMETAL, SPELL_DARK_SHRINKING_RAY, SPELL_FIRE_INCINERATE | |
179 }; | |
180 | |
181 | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
182 std::array<std::array<unsigned char, 12>, 9> pSpellbookSpellIndices = // 4E2430 |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
183 {{ //0 1 2 3 4 5 6 7 8 9 10 11 |
357 | 184 {0, 3, 1, 8, 11, 7, 4, 10, 6, 2, 5, 9}, |
185 {0, 11, 2, 9, 6, 8, 5, 10, 3, 7, 1, 4}, | |
186 {0, 4, 8, 9, 1, 10, 3, 11, 7, 6, 2, 5}, | |
187 {0, 7, 10, 8, 2, 11, 1, 5, 3, 6, 4, 9}, | |
188 {0, 5, 10, 11, 7, 2, 8, 1, 4, 9, 3, 6}, | |
189 {0, 5, 9, 8, 3, 7, 6, 4, 1, 11, 2, 10}, | |
190 {0, 1, 6, 9, 3, 5, 8, 11, 7, 10, 4, 2}, | |
191 {0, 1, 10, 11, 9, 4, 3, 6, 5, 7, 8, 2}, | |
192 {0, 9, 3, 7, 1, 5, 2, 10, 11, 8, 6, 4} | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
193 }}; |
0 | 194 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
195 std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos={{ |
363 | 196 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
197 { 0, 0, 17, 13, 115, 2, 217, 15, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
198 299, 6, 28, 125, 130, 133, 294, 114, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
199 11, 232, 134, 233, 237, 171, 296, 231}, |
0 | 200 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
201 { 0, 0, 19, 9, 117, 3, 206, 13, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
202 285, 7, 16, 123, 113, 101, 201, 118, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
203 317, 110, 11, 230, 149, 236, 296, 234}, |
357 | 204 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
205 { 0, 0, 17, 9, 140, 0, 210, 34, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
206 293, 5, 15, 98, 78, 121, 175, 136, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
207 301, 115, 15, 226, 154, 225, 272, 220}, |
357 | 208 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
209 { 0, 0, 7, 9, 156, 2, 277, 9, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
210 11, 117, 111, 82, 180, 102, 303, 108, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
211 10, 229, 120, 221, 201, 217, 296, 225}, |
357 | 212 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
213 { 0, 0, 18, 8, 89, 15, 192, 14, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
214 292, 7, 22, 129, 125, 146, 217, 136, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
215 305, 115, 22, 226, 174, 237, 290, 231}, |
357 | 216 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
217 { 0, 0, 18, 12, 148, 9, 292, 7, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
218 17, 122, 121, 99, 220, 87, 293, 112, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
219 13, 236, 128, 213, 220, 223, 315, 223}, |
357 | 220 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
221 { 0, 0, 23, 14, 127, 8, 204, 0, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
222 306, 8, 14, 115, 122, 132, 200, 116, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
223 293, 122, 20, 228, 154, 228, 294, 239}, |
357 | 224 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
225 { 0, 0, 19, 14, 124, 10, 283, 12, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
226 8, 105, 113, 89, 190, 82, 298, 108, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
227 18, 181, 101, 204, 204, 203, 285, 218}, |
357 | 228 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
229 { 0, 0, 18, 17, 110, 16, 201, 15, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
230 307, 15, 18, 148, 125, 166, 201, 123, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
231 275, 120, 28, 235, 217, 222, 324, 216}}}; |
0 | 232 |
233 | |
234 //----- (0042EB31) -------------------------------------------------------- | |
235 bool SpellBuff::NotExpired() | |
236 { | |
189 | 237 return (signed __int64)this->uExpireTime > 0 ? true:false; |
0 | 238 } |
239 | |
240 | |
241 //----- (00458585) -------------------------------------------------------- | |
242 void SpellBuff::Reset() | |
243 { | |
982 | 244 uSkill = 0; |
245 uPower = 0; | |
246 uExpireTime = 0i64; | |
247 uCaster = 0; | |
248 uFlags = 0; | |
249 if (uOverlayID) | |
0 | 250 { |
982 | 251 pOtherOverlayList->pOverlays[uOverlayID - 1].Reset(); |
142 | 252 pOtherOverlayList->bRedraw = true; |
982 | 253 uOverlayID = 0; |
0 | 254 } |
255 } | |
256 | |
257 //----- (004585CA) -------------------------------------------------------- | |
1340 | 258 bool SpellBuff::IsBuffExpiredToTime( __int64 time_end ) |
259 { | |
260 if (uExpireTime && (uExpireTime < time_end)) | |
0 | 261 { |
982 | 262 uExpireTime = 0; |
263 uPower = 0; | |
264 uSkill = 0; | |
265 uOverlayID = 0; | |
266 return true; | |
0 | 267 } |
982 | 268 return false; |
0 | 269 } |
270 | |
271 //----- (004584E0) -------------------------------------------------------- | |
1340 | 272 bool SpellBuff::Apply( signed __int64 uExpireTime, unsigned __int16 uSkillLevel, unsigned __int16 uPower, int uOverlayID, unsigned __int8 caster ) |
273 { | |
274 if (this->uExpireTime && (uExpireTime < this->uExpireTime)) | |
982 | 275 return false; |
0 | 276 |
982 | 277 this->uSkill = uSkillLevel; |
278 this->uPower = uPower; | |
279 this->uExpireTime = uExpireTime; | |
280 if (this->uOverlayID && this->uOverlayID != uOverlayID) | |
0 | 281 { |
982 | 282 pOtherOverlayList->pOverlays[this->uOverlayID - 1].Reset(); |
283 pOtherOverlayList->bRedraw = true; | |
284 this->uOverlayID = 0; | |
0 | 285 } |
982 | 286 this->uOverlayID = uOverlayID; |
287 this->uCaster = caster; | |
288 | |
289 return true; | |
0 | 290 } |
291 | |
292 //----- (0045384A) -------------------------------------------------------- | |
293 void SpellStats::Initialize() | |
982 | 294 { |
191 | 295 int decode_step; |
296 char* test_string; | |
297 bool break_loop; | |
298 unsigned char c; | |
299 unsigned int temp_str_len; | |
300 char* tmp_pos; | |
189 | 301 |
191 | 302 if ( pSpellsTXT_Raw ) |
1583 | 303 free(pSpellsTXT_Raw); |
191 | 304 pSpellsTXT_Raw = NULL; |
189 | 305 |
191 | 306 pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0); |
307 strtok(pSpellsTXT_Raw, "\r"); | |
308 strtok(NULL, "\r"); | |
309 for(int i=1; i<100; ++i) | |
310 { | |
311 test_string=strtok(NULL, "\r")+1; | |
312 decode_step =0; | |
313 break_loop=false; | |
314 do | |
315 { | |
316 c = *(unsigned char*)test_string; | |
317 temp_str_len = 0; | |
318 while((c!='\t')&&(c>0)) | |
319 { | |
320 ++temp_str_len; | |
321 c=test_string[temp_str_len]; | |
322 } | |
323 tmp_pos=test_string+temp_str_len; | |
324 if (*tmp_pos == 0) | |
325 break_loop = true; | |
326 *tmp_pos = 0; | |
327 if (temp_str_len) | |
328 { | |
329 switch (decode_step) | |
330 { | |
331 case 2: | |
332 pInfos[i].pName=RemoveQuotes(test_string); | |
333 break; | |
334 case 3: | |
192 | 335 pInfos[i].uSchool = SPELL_SCHOOL_NONE; |
1104 | 336 if (!_stricmp("fire", test_string) ) |
191 | 337 { |
192 | 338 pInfos[i].uSchool =SPELL_SCHOOL_FIRE; |
191 | 339 break; |
340 } | |
1104 | 341 if ( !_stricmp("air", test_string) ) |
191 | 342 { |
192 | 343 pInfos[i].uSchool = SPELL_SCHOOL_AIR; |
191 | 344 break; |
345 } | |
1104 | 346 if ( !_stricmp("water", test_string)) |
191 | 347 { |
192 | 348 pInfos[i].uSchool = SPELL_SCHOOL_WATER; |
191 | 349 break; |
350 } | |
1104 | 351 if ( !_stricmp("earth", test_string)) |
191 | 352 { |
192 | 353 pInfos[i].uSchool = SPELL_SCHOOL_EARTH; |
191 | 354 break; |
355 } | |
1104 | 356 if ( !_stricmp("spirit", test_string)) |
191 | 357 { |
192 | 358 pInfos[i].uSchool = SPELL_SCHOOL_SPIRIT; |
191 | 359 break; |
360 } | |
1104 | 361 if ( !_stricmp("mind", test_string)) |
191 | 362 { |
192 | 363 pInfos[i].uSchool = SPELL_SCHOOL_MIND; |
191 | 364 break; |
365 } | |
1104 | 366 if ( !_stricmp("body", test_string) ) |
191 | 367 { |
192 | 368 pInfos[i].uSchool = SPELL_SCHOOL_BODY; |
191 | 369 break; |
370 } | |
1104 | 371 if ( !_stricmp("light", test_string) ) |
191 | 372 { |
192 | 373 pInfos[i].uSchool = SPELL_SCHOOL_LIGHT; |
191 | 374 break; |
375 } | |
1104 | 376 if ( !_stricmp("dark", test_string)) |
191 | 377 { |
192 | 378 pInfos[i].uSchool = SPELL_SCHOOL_DARK; |
191 | 379 break; |
380 } | |
381 | |
1104 | 382 if ( !_stricmp("magic", test_string)) |
191 | 383 { |
192 | 384 pInfos[i].uSchool = SPELL_SCHOOL_MAGIC; |
191 | 385 break; |
386 } | |
387 break; | |
388 case 4: | |
389 pInfos[i].pShortName=RemoveQuotes(test_string); | |
390 break; | |
391 case 5: | |
392 pInfos[i].pDescription=RemoveQuotes(test_string); | |
393 break; | |
394 case 6: | |
395 pInfos[i].pBasicSkillDesc=RemoveQuotes(test_string); | |
396 break; | |
397 case 7: | |
398 pInfos[i].pExpertSkillDesc=RemoveQuotes(test_string); | |
399 break; | |
400 case 8: | |
401 pInfos[i].pMasterSkillDesc=RemoveQuotes(test_string); | |
402 break; | |
403 case 9: | |
404 pInfos[i].pGrandmasterSkillDesc=RemoveQuotes(test_string); | |
405 break; | |
406 case 10: | |
407 int in_string_pos=0; | |
192 | 408 unsigned char test; |
191 | 409 int in_str_len=strlen(test_string); |
192 | 410 for (int j=0; j<in_str_len; ++j) |
411 { | |
412 test= tolower(test_string[j]); | |
413 switch (test) | |
414 { | |
415 case 109: | |
416 pSpellDatas[i].field_12|=1; | |
417 break; | |
418 case 101: | |
419 pSpellDatas[i].field_12|=2; | |
420 break; | |
421 case 99: | |
422 pSpellDatas[i].field_12|=4; | |
423 break; | |
424 case 120: | |
425 pSpellDatas[i].field_12|=8; | |
426 break; | |
427 } | |
428 } | |
191 | 429 break; |
430 } | |
431 } | |
432 else | |
433 break_loop=true; | |
434 ++decode_step; | |
435 test_string=tmp_pos+1; | |
436 } while ((decode_step<11)&&!break_loop); | |
437 if ((i%11)==0) | |
438 strtok(NULL, "\r"); | |
439 } | |
440 | |
1295 | 441 } |
442 //----- (00448DF8) -------------------------------------------------------- | |
1519 | 443 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 |
1295 | 444 { |
445 int v9; // esi@1 | |
446 double v10; // st7@4 | |
447 double v11; // st6@4 | |
448 double v12; // st5@4 | |
449 double v13; // st7@6 | |
450 int v14; // ST44_4@7 | |
451 signed int v15; // ebx@9 | |
452 signed int v16; // edx@15 | |
453 char *v17; // ecx@16 | |
454 unsigned __int16 v18; // ax@20 | |
455 char *v19; // ecx@31 | |
456 int v20; // edx@35 | |
457 signed int v21; // edx@37 | |
458 char *v22; // ecx@38 | |
459 unsigned __int16 v23; // ax@41 | |
460 int i; // esi@42 | |
461 signed int v25; // edx@55 | |
462 char *v26; // ecx@56 | |
463 unsigned __int16 v27; // ax@59 | |
464 int j; // esi@60 | |
465 signed int v29; // edx@66 | |
466 char *v30; // ecx@67 | |
467 unsigned __int16 v31; // ax@70 | |
468 //Player *v32; // eax@80 | |
469 //unsigned __int16 v33; // si@85 | |
470 int v34; // eax@96 | |
471 int v35; // eax@97 | |
472 unsigned __int64 v36; // qax@99 | |
473 SpellBuff *v37; // ecx@99 | |
474 int v38; // esi@103 | |
475 signed __int64 v39; // qax@105 | |
476 int v40; // ebx@108 | |
477 int v41; // ebx@109 | |
478 int v42; // esi@111 | |
479 int v43; // ebx@111 | |
480 int v44; // eax@117 | |
481 //unsigned __int16 v45; // si@137 | |
482 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99 | |
483 int v47; // [sp-4h] [bp-B8h]@35 | |
484 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99 | |
485 int v49; // [sp+0h] [bp-B4h]@35 | |
486 int v50; // [sp+0h] [bp-B4h]@99 | |
487 int v51; // [sp+4h] [bp-B0h]@35 | |
488 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99 | |
489 float v53; // [sp+14h] [bp-A0h]@4 | |
490 float v54; // [sp+18h] [bp-9Ch]@4 | |
491 int v55; // [sp+28h] [bp-8Ch]@7 | |
492 unsigned int yaw; // [sp+30h] [bp-84h]@7 | |
493 int pitch; // [sp+34h] [bp-80h]@7 | |
494 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
495 int v59; // [sp+A8h] [bp-Ch]@1 | |
496 int v60; // [sp+ACh] [bp-8h]@1 | |
497 //int spellnum_; // [sp+B0h] [bp-4h]@1 | |
498 //signed int levela; // [sp+BCh] [bp+8h]@80 | |
499 int a6_4; // [sp+C8h] [bp+14h]@117 | |
500 float a7a; // [sp+CCh] [bp+18h]@6 | |
501 signed int a7b; // [sp+CCh] [bp+18h]@12 | |
502 int a7c; // [sp+CCh] [bp+18h]@29 | |
503 int a7d; // [sp+CCh] [bp+18h]@55 | |
504 float a8a; // [sp+D0h] [bp+1Ch]@6 | |
505 int a8b; // [sp+D0h] [bp+1Ch]@37 | |
506 int a8c; // [sp+D0h] [bp+1Ch]@55 | |
507 float toza; // [sp+D4h] [bp+20h]@6 | |
508 | |
509 v9 = 0; | |
510 v59 = uSkillLevel + 1; | |
1519 | 511 //spellnum_ = uSpellID; |
1295 | 512 v60 = 0; |
513 if ( tox || toy || toz ) | |
514 { | |
515 v10 = (double)tox - (double)fromx; | |
516 v53 = v10; | |
517 v11 = (double)toy - (double)fromy; | |
518 v54 = v11; | |
519 v12 = (double)toz; | |
520 } | |
521 else | |
522 { | |
523 v10 = (double)pParty->vPosition.x - (double)fromx; | |
524 v53 = v10; | |
525 v11 = (double)pParty->vPosition.y - (double)fromy; | |
526 v54 = v11; | |
527 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel); | |
528 } | |
529 a7a = v12 - (double)fromz; | |
530 toza = v11 * v11; | |
531 a8a = v10 * v10; | |
532 v13 = sqrt(a7a * a7a + a8a + toza); | |
533 if ( v13 <= 1.0 ) | |
534 { | |
535 LOBYTE(v55) = 1; | |
536 yaw = 0; | |
537 pitch = 0; | |
538 } | |
539 else | |
540 { | |
541 v55 = (signed __int64)v13; | |
542 v14 = (signed __int64)sqrt(a8a + toza); | |
543 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54); | |
544 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a); | |
545 } | |
546 v15 = v59; | |
547 if ( v59 <= 0 || v59 > 4 ) | |
548 v15 = 1; | |
549 a7b = v15; | |
550 | |
551 SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
552 //SpriteObject::SpriteObject(&a1); | |
553 | |
1519 | 554 a1.uType = stru_4E3ACC[uSpellID].uType; |
555 if ( uSpellID > 58 ) | |
1295 | 556 { |
1519 | 557 if ( uSpellID == 69 ) |
1295 | 558 goto LABEL_117; |
1519 | 559 if ( uSpellID != 83 ) |
1295 | 560 return; |
561 v40 = v15 - 2; | |
562 if ( v40 ) | |
563 { | |
564 v41 = v40 - 1; | |
565 if ( !v41 ) | |
566 { | |
567 v42 = 14400 * uSkill; | |
568 v43 = 4 * uSkill + 10; | |
569 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
570 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
571 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
572 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
573 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
574 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
575 v36 = pParty->uTimePlayed + v39; | |
576 v37->Apply(v36, a7b, v43, 0, 0); | |
577 goto LABEL_139; | |
578 } | |
579 if ( v41 == 1 ) | |
580 { | |
581 v42 = 18000 * uSkill; | |
582 v43 = 5 * uSkill + 10; | |
583 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
584 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
585 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
586 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
587 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
588 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
589 v36 = pParty->uTimePlayed + v39; | |
590 v37->Apply(v36, a7b, v43, 0, 0); | |
591 goto LABEL_139; | |
592 } | |
593 } | |
594 v42 = 10800 * uSkill; | |
595 v43 = 3 * uSkill + 10; | |
596 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
597 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
598 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
599 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
600 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
601 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
602 v36 = pParty->uTimePlayed + v39; | |
603 v37->Apply(v36, a7b, v43, 0, 0); | |
604 goto LABEL_139; | |
605 } | |
1519 | 606 if ( uSpellID != 58 ) |
1295 | 607 { |
1519 | 608 switch ( uSpellID ) |
1295 | 609 { |
610 case 2: | |
611 case 6: | |
612 case 18: | |
613 case 26: | |
614 case 29: | |
615 case 32: | |
616 case 39: | |
617 case 41: | |
618 a1.stru_24.Reset(); | |
619 v16 = 0; | |
1519 | 620 a1.spell_id = uSpellID; |
1295 | 621 a1.spell_level = uSkill; |
622 a1.spell_skill = v15; | |
623 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
624 { | |
625 v18 = 0; | |
626 a1.uObjectDescID = v18; | |
627 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
628 a1.vPosition.x = fromx; | |
629 a1.uAttributes = 16; | |
630 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
631 a1.field_60_distance_related_prolly_lod = v55; | |
632 v20 = yaw; | |
633 a1.uSpriteFrameID = 0; | |
634 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
635 a1.spell_target_pid = 0; | |
636 a1.uFacing = yaw; | |
637 a1.uSoundID = 0; | |
638 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
639 a1.Create(v20, pitch, v49, 0); | |
640 goto LABEL_139; | |
641 } | |
642 v17 = (char *)&pObjectList->pObjects->uObjectID; | |
643 while ( (short)a1.uType != *(short *)v17 ) | |
644 { | |
645 ++v16; | |
646 v17 += 56; | |
647 if ( v16 >= (signed int)pObjectList->uNumObjects ) | |
648 { | |
649 v18 = 0; | |
650 a1.uObjectDescID = v18; | |
651 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
652 a1.vPosition.x = fromx; | |
653 a1.uAttributes = 16; | |
654 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
655 a1.field_60_distance_related_prolly_lod = v55; | |
656 v20 = yaw; | |
657 a1.uSpriteFrameID = 0; | |
658 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
659 a1.spell_target_pid = 0; | |
660 a1.uFacing = yaw; | |
661 a1.uSoundID = 0; | |
662 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
663 a1.Create(v20, pitch, v49, 0); | |
664 goto LABEL_139; | |
665 } | |
666 } | |
667 v18 = v16; | |
668 a1.uObjectDescID = v18; | |
669 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
670 a1.vPosition.x = fromx; | |
671 a1.uAttributes = 16; | |
672 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
673 a1.field_60_distance_related_prolly_lod = v55; | |
674 v20 = yaw; | |
675 a1.uSpriteFrameID = 0; | |
676 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
677 a1.spell_target_pid = 0; | |
678 a1.uFacing = yaw; | |
679 a1.uSoundID = 0; | |
680 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
681 a1.Create(v20, pitch, v49, 0); | |
682 goto LABEL_139; | |
683 case 24: | |
684 switch ( v15 ) | |
685 { | |
686 case 1: | |
687 v60 = 1; | |
688 break; | |
689 case 2: | |
690 v60 = 3; | |
691 break; | |
692 case 3: | |
693 v60 = 5; | |
694 break; | |
695 case 4: | |
696 v60 = 7; | |
697 break; | |
698 } | |
699 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
700 if ( v60 != 1 ) | |
701 { | |
702 a8b = a7c / (v60 - 1); | |
703 a1.stru_24.Reset(); | |
704 v21 = 0; | |
1519 | 705 a1.spell_id = uSpellID; |
1295 | 706 a1.spell_level = uSkill; |
707 a1.spell_skill = v15; | |
708 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
709 { | |
710 v23 = 0; | |
711 } | |
712 else | |
713 { | |
714 v22 = (char *)&pObjectList->pObjects->uObjectID; | |
715 while ( (short)a1.uType != *(short *)v22 ) | |
716 { | |
717 ++v21; | |
718 v22 += 56; | |
719 if ( v21 >= (signed int)pObjectList->uNumObjects ) | |
720 { | |
721 v23 = 0; | |
722 a1.uObjectDescID = v23; | |
723 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
724 a1.vPosition.x = fromx; | |
725 a1.uAttributes = 16; | |
726 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
727 a1.field_60_distance_related_prolly_lod = v55; | |
728 a1.uSpriteFrameID = 0; | |
729 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
730 a1.spell_target_pid = 4; | |
731 a1.uSoundID = 0; | |
732 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) | |
733 { | |
734 a1.uFacing = i + yaw; | |
735 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
736 } | |
737 goto LABEL_139; | |
738 } | |
739 } | |
740 v23 = v21; | |
741 } | |
742 a1.uObjectDescID = v23; | |
743 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
744 a1.vPosition.x = fromx; | |
745 a1.uAttributes = 16; | |
746 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
747 a1.field_60_distance_related_prolly_lod = v55; | |
748 a1.uSpriteFrameID = 0; | |
749 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
750 a1.spell_target_pid = 4; | |
751 a1.uSoundID = 0; | |
752 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) | |
753 { | |
754 a1.uFacing = i + yaw; | |
755 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
756 } | |
757 goto LABEL_139; | |
758 } | |
759 a1.stru_24.Reset(); | |
760 v16 = 0; | |
1519 | 761 a1.spell_id = uSpellID; |
1295 | 762 a1.spell_level = uSkill; |
763 a1.spell_skill = v15; | |
764 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
765 { | |
766 v18 = 0; | |
767 a1.uObjectDescID = v18; | |
768 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
769 a1.vPosition.x = fromx; | |
770 a1.uAttributes = 16; | |
771 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
772 a1.field_60_distance_related_prolly_lod = v55; | |
773 v20 = yaw; | |
774 a1.uSpriteFrameID = 0; | |
775 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
776 a1.spell_target_pid = 0; | |
777 a1.uFacing = yaw; | |
778 a1.uSoundID = 0; | |
779 v51 = 0; | |
780 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
781 v47 = pitch; | |
782 a1.Create(v20, v47, v49, v51); | |
783 goto LABEL_139; | |
784 } | |
785 v19 = (char *)&pObjectList->pObjects->uObjectID; | |
786 do | |
787 { | |
788 if ( (short)a1.uType == *(short *)v19 ) | |
789 { | |
790 v18 = v16; | |
791 a1.uObjectDescID = v18; | |
792 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
793 a1.vPosition.x = fromx; | |
794 a1.uAttributes = 16; | |
795 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
796 a1.field_60_distance_related_prolly_lod = v55; | |
797 v20 = yaw; | |
798 a1.uSpriteFrameID = 0; | |
799 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
800 a1.spell_target_pid = 0; | |
801 a1.uFacing = yaw; | |
802 a1.uSoundID = 0; | |
803 v51 = 0; | |
804 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
805 v47 = pitch; | |
806 a1.Create(v20, v47, v49, v51); | |
807 goto LABEL_139; | |
808 } | |
809 ++v16; | |
810 v19 += 56; | |
811 } | |
812 while ( v16 < (signed int)pObjectList->uNumObjects ); | |
813 v18 = 0; | |
814 a1.uObjectDescID = v18; | |
815 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
816 a1.vPosition.x = fromx; | |
817 a1.uAttributes = 16; | |
818 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
819 a1.field_60_distance_related_prolly_lod = v55; | |
820 v20 = yaw; | |
821 a1.uSpriteFrameID = 0; | |
822 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
823 a1.spell_target_pid = 0; | |
824 a1.uFacing = yaw; | |
825 a1.uSoundID = 0; | |
826 v51 = 0; | |
827 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
828 v47 = pitch; | |
829 a1.Create(v20, v47, v49, v51); | |
830 goto LABEL_139; | |
831 case 15: | |
832 switch ( v15 ) | |
833 { | |
834 case 1: | |
835 v60 = 3; | |
836 break; | |
837 case 2: | |
838 v60 = 5; | |
839 break; | |
840 case 3: | |
841 v60 = 7; | |
842 break; | |
843 case 4: | |
844 v60 = 9; | |
845 break; | |
846 } | |
847 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
848 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); | |
849 a1.stru_24.Reset(); | |
850 v25 = 0; | |
1519 | 851 a1.spell_id = uSpellID; |
1295 | 852 a1.spell_level = uSkill; |
853 a1.spell_skill = v15; | |
854 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
855 { | |
856 v27 = 0; | |
857 a1.uObjectDescID = v27; | |
858 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
859 a1.vPosition.x = fromx; | |
860 a1.uAttributes = 16; | |
861 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
862 a1.field_60_distance_related_prolly_lod = v55; | |
863 a1.uSpriteFrameID = 0; | |
864 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
865 a1.spell_target_pid = 4; | |
866 a1.uSoundID = 0; | |
867 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
868 { | |
869 a1.uFacing = j + yaw; | |
870 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
871 } | |
872 goto LABEL_139; | |
873 } | |
874 v26 = (char *)&pObjectList->pObjects->uObjectID; | |
875 while ( (short)a1.uType != *(short *)v26 ) | |
876 { | |
877 ++v25; | |
878 v26 += 56; | |
879 if ( v25 >= (signed int)pObjectList->uNumObjects ) | |
880 { | |
881 v27 = 0; | |
882 a1.uObjectDescID = v27; | |
883 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
884 a1.vPosition.x = fromx; | |
885 a1.uAttributes = 16; | |
886 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
887 a1.field_60_distance_related_prolly_lod = v55; | |
888 a1.uSpriteFrameID = 0; | |
889 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
890 a1.spell_target_pid = 4; | |
891 a1.uSoundID = 0; | |
892 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
893 { | |
894 a1.uFacing = j + yaw; | |
895 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
896 } | |
897 goto LABEL_139; | |
898 } | |
899 } | |
900 v27 = v25; | |
901 a1.uObjectDescID = v27; | |
902 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
903 a1.vPosition.x = fromx; | |
904 a1.uAttributes = 16; | |
905 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
906 a1.field_60_distance_related_prolly_lod = v55; | |
907 a1.uSpriteFrameID = 0; | |
908 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
909 a1.spell_target_pid = 4; | |
910 a1.uSoundID = 0; | |
911 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
912 { | |
913 a1.uFacing = j + yaw; | |
914 a1.Create( | |
915 (signed __int16)(j + (short)yaw), | |
916 pitch, | |
917 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
918 0); | |
919 } | |
920 goto LABEL_139; | |
921 case 43: | |
922 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
923 return; | |
924 a1.stru_24.Reset(); | |
925 v29 = 0; | |
1519 | 926 a1.spell_id = uSpellID; |
1295 | 927 a1.spell_level = uSkill; |
928 a1.spell_skill = v15; | |
929 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
930 { | |
931 v31 = 0; | |
932 a1.uObjectDescID = v31; | |
933 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
934 a1.vPosition.x = fromx; | |
935 a1.uAttributes = 16; | |
936 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
937 a1.field_60_distance_related_prolly_lod = v55; | |
938 a1.uSpriteFrameID = 0; | |
939 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
940 a1.spell_target_pid = 4; | |
941 a1.uSoundID = 0; | |
942 v51 = 0; | |
943 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
944 v20 = yaw; | |
945 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
946 a1.Create(v20, v47, v49, v51); | |
947 goto LABEL_139; | |
948 } | |
949 v30 = (char *)&pObjectList->pObjects->uObjectID; | |
950 break; | |
951 | |
952 case SPELL_FIRE_HASTE: | |
953 if ( v15 > 0 ) | |
954 { | |
955 if ( v15 <= 2 ) | |
956 { | |
957 v9 = 60 * (uSkill + 60); | |
958 } | |
959 else | |
960 { | |
961 if ( v15 == 3 ) | |
962 { | |
963 v9 = 180 * (uSkill + 20); | |
964 } | |
965 else | |
966 { | |
967 if ( v15 == 4 ) | |
968 v9 = 240 * (uSkill + 15); | |
969 } | |
970 } | |
971 } | |
972 //levela = 1; | |
973 //v32 = pParty->pPlayers;//[0].pConditions[1]; | |
974 //do | |
975 for (uint i = 0; i < 4; ++i) | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
976 if (pParty->pPlayers[i].IsWeak()) |
1295 | 977 return; |
978 //while ( v32 <= &pParty->pPlayers[3] ); | |
979 //if ( !levela ) | |
980 // return; | |
981 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), | |
982 v15, | |
983 0, | |
984 0, | |
985 0); | |
986 //v33 = spellnum_; | |
1519 | 987 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
988 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
989 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
990 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 991 goto LABEL_138; |
992 case 17: | |
993 case 38: | |
994 case 51: | |
995 switch ( v15 ) | |
996 { | |
997 case 1: | |
998 case 2: | |
999 v9 = 300 * (uSkill + 12); | |
1000 break; | |
1001 case 3: | |
1002 v9 = 900 * (uSkill + 4); | |
1003 break; | |
1004 case 4: | |
1005 v9 = 3600 * (uSkill + 1); | |
1006 break; | |
1007 } | |
1519 | 1008 switch ( uSpellID ) |
1295 | 1009 { |
1010 case 17: | |
1011 v60 = 0; | |
1012 uSkill = 14; | |
1013 break; | |
1014 case 38: | |
1015 v35 = uSkill + 5; | |
1016 uSkill = 15; | |
1017 v60 = v35; | |
1018 break; | |
1019 case 51: | |
1020 v34 = uSkill + 5; | |
1021 uSkill = 9; | |
1022 v60 = v34; | |
1023 break; | |
1024 } | |
1519 | 1025 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1026 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1027 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1028 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 1029 v52 = 0; |
1030 v50 = 0; | |
1031 v48 = v60; | |
1032 v46 = v15; | |
1033 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); | |
1034 v37 = &pParty->pPartyBuffs[uSkill]; | |
1035 v37->Apply(v36, v46, v48, v50, v52); | |
1036 goto LABEL_139;; | |
1037 case 8: | |
1038 if ( v15 == 2 || v15 == 3 || v15 != 4 ) | |
1039 v38 = 60 * uSkill; | |
1040 else | |
1041 v38 = 600 * uSkill; | |
1519 | 1042 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1043 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1044 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1045 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 1046 v52 = 0; |
1047 v50 = 0; | |
1048 v48 = uSkill; | |
1049 v46 = v15; | |
1050 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); | |
1051 v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION]; | |
1052 v36 = pParty->uTimePlayed + v39; | |
1053 v37->Apply(v36, v46, v48, v50, v52); | |
1054 goto LABEL_139; | |
1055 case 3: | |
1056 case 14: | |
1057 case 25: | |
1058 case 36: | |
1059 goto LABEL_117; | |
1060 default: | |
1061 return; | |
1062 } | |
1063 while ( (short)a1.uType != *(short *)v30 ) | |
1064 { | |
1065 ++v29; | |
1066 v30 += 56; | |
1067 if ( v29 >= (signed int)pObjectList->uNumObjects ) | |
1068 { | |
1069 v31 = 0; | |
1070 a1.uObjectDescID = v31; | |
1071 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
1072 a1.vPosition.x = fromx; | |
1073 a1.uAttributes = 16; | |
1074 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
1075 a1.field_60_distance_related_prolly_lod = v55; | |
1076 a1.uSpriteFrameID = 0; | |
1077 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
1078 a1.spell_target_pid = 4; | |
1079 a1.uSoundID = 0; | |
1080 v51 = 0; | |
1081 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
1082 v20 = yaw; | |
1083 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
1084 a1.Create(v20, v47, v49, v51); | |
1085 goto LABEL_139; | |
1086 } | |
1087 } | |
1088 v31 = v29; | |
1089 a1.uObjectDescID = v31; | |
1090 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
1091 a1.vPosition.x = fromx; | |
1092 a1.uAttributes = 16; | |
1093 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
1094 a1.field_60_distance_related_prolly_lod = v55; | |
1095 a1.uSpriteFrameID = 0; | |
1096 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
1097 a1.spell_target_pid = 4; | |
1098 a1.uSoundID = 0; | |
1099 v51 = 0; | |
1100 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
1101 v20 = yaw; | |
1102 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
1103 a1.Create(v20, v47, v49, v51); | |
1104 goto LABEL_139; | |
1105 } | |
1106 LABEL_117: | |
1107 v44 = uSkill; | |
1108 a6_4 = 3600 * uSkill; | |
1109 if ( v15 == 1 ) | |
1110 { | |
1111 v60 = v44; | |
1112 goto LABEL_125; | |
1113 } | |
1114 if ( v15 == 2 ) | |
1115 { | |
1116 v44 = 2 * uSkill; | |
1117 v60 = v44; | |
1118 goto LABEL_125; | |
1119 } | |
1120 if ( v15 == 3 ) | |
1121 { | |
1122 v44 = 3 * uSkill; | |
1123 v60 = v44; | |
1124 goto LABEL_125; | |
1125 } | |
1126 if ( v15 == 4 ) | |
1127 { | |
1128 v44 = 4 * uSkill; | |
1129 v60 = v44; | |
1130 goto LABEL_125; | |
1131 } | |
1132 LABEL_125: | |
1519 | 1133 switch ( uSpellID ) |
1295 | 1134 { |
1135 case 3: | |
1136 uSkill = 6; | |
1137 break; | |
1138 case 14: | |
1139 uSkill = 0; | |
1140 break; | |
1141 case 25: | |
1142 uSkill = 17; | |
1143 break; | |
1144 case 36: | |
1145 uSkill = 4; | |
1146 break; | |
1147 case 58: | |
1148 uSkill = 12; | |
1149 break; | |
1150 case 69: | |
1151 uSkill = 1; | |
1152 break; | |
1153 } | |
1154 //v45 = spellnum_; | |
1519 | 1155 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1156 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1157 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1158 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 1159 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0); |
1160 //levela = 1; | |
1161 LABEL_138: | |
1162 //if ( levela ) | |
1163 LABEL_139: | |
1519 | 1164 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
1296 | 1165 } |
1166 //----- (00427769) -------------------------------------------------------- | |
1167 bool __fastcall sub_427769_spell(unsigned int uSpellID) | |
1168 { | |
1169 bool result; // eax@2 | |
1170 | |
1679 | 1171 __debugbreak(); // wut is dat? |
1172 if ( pSpellDatas[uSpellID].field_12 & 0xC ) | |
1296 | 1173 result = 1; |
1174 else | |
1175 result = 0; | |
1176 return result; | |
1297 | 1177 } |
1178 //----- (0043AFE3) -------------------------------------------------------- | |
1179 int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4) | |
1180 { | |
1181 int result; // eax@1 | |
1182 unsigned int v5; // [sp-4h] [bp-8h]@9 | |
1183 | |
1184 result = 0; | |
1185 if ( a1 == 7 ) | |
1186 { | |
1187 if ( a3 <= 0 ) | |
1188 return result; | |
1189 if ( a3 <= 2 ) | |
1190 { | |
1191 v5 = 6; | |
1192 } | |
1193 else | |
1194 { | |
1195 if ( a3 == 3 ) | |
1196 { | |
1197 v5 = 8; | |
1198 } | |
1199 else | |
1200 { | |
1201 if ( a3 != 4 ) | |
1202 return result; | |
1203 v5 = 10; | |
1204 } | |
1205 } | |
1206 result = GetDiceResult(a2, v5); | |
1207 } | |
1208 else | |
1209 { | |
1210 if ( a1 == 44 ) | |
1211 result = a4 * (LOBYTE(pSpellDatas[40].field_10) + 2 * a2) / 100; | |
1212 else | |
1213 result = *((char *)&pSpellDatas[0].field_10 + 20 * a1) | |
1214 + GetDiceResult(a2, *((char *)&pSpellDatas[0].field_10 + 20 * a1 + 1)); | |
1215 } | |
1216 return result; | |
1295 | 1217 } |