comparison Engine/Spells/Spells.cpp @ 2566:30eb6dcac768

big spell fx overhaul
author a.parshin
date Wed, 20 May 2015 21:05:07 +0200
parents 3121fb54a110
children d569340b05ff
comparison
equal deleted inserted replaced
2565:117c219bf913 2566:30eb6dcac768
20 #include "Media/Audio/AudioPlayer.h" 20 #include "Media/Audio/AudioPlayer.h"
21 #include "Engine/Objects/Actor.h" 21 #include "Engine/Objects/Actor.h"
22 #include "stru6.h" 22 #include "stru6.h"
23 23
24 24
25 std::array<TownPortalData, 6> TownPortalList = //4ECBB8 25 std::array<TownPortalData, 6> TownPortalList = // 4ECBB8
26 {{ 26 {{
27 {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0}, 27 {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0},
28 {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0}, 28 {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0},
29 {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0}, 29 {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0},
30 {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0}, 30 {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0},
31 {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0}, 31 {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0},
32 {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0} 32 {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0}
33 }} ; 33 }} ;
34 34
35 struct SpellStats *pSpellStats; 35 struct SpellStats *pSpellStats = nullptr;
36 36
37 37
38 std::array<stru324_spell, 103> stru_4E3ACC = 38 std::array<stru324_spell_id_to_sprite_mapping, 103> spell_sprite_mapping = // 4E3ACC
39 {{ 39 {{
40 {10, 0}, 40 { SPRITE_SPELL_0, 0 },
41 {1000, 0}, {1010, 0}, {1020, 0}, {1030, 0}, {1040, 0}, {1050, 0}, {1060, 0}, {1070, 0}, {1080, 0}, {1090, 0}, {1100, 0}, 41 { SPRITE_SPELL_FIRE_TORCH_LIGHT, 0 },
42 {2000, 0}, {2010, 0}, {2020, 0}, {2030, 0}, {2040, 0}, {2050, 0}, {2060, 0}, {2070, 0}, {2080, 0}, {2090, 0}, {2100, 0}, 42 { SPRITE_SPELL_FIRE_FIRE_BOLT, 0 },
43 {3000, 0}, {3010, 0}, {3020, 0}, {3030, 0}, {3040, 0}, {3050, 0}, {3060, 0}, {3070, 0}, {3080, 0}, {3090, 0}, {3100, 0}, 43 { SPRITE_SPELL_FIRE_PROTECTION_FROM_FIRE, 0 },
44 {4000, 0}, {4010, 0}, {4020, 0}, {4030, 0}, {4040, 0}, {4050, 0}, {4060, 0}, {4070, 0}, {4080, 0}, {4090, 0}, {4100, 0}, 44 { SPRITE_SPELL_FIRE_FIRE_AURA, 0 },
45 {5000, 0}, {5010, 0}, {5020, 0}, {5030, 0}, {5040, 0}, {5050, 0}, {5060, 0}, {5070, 0}, {5080, 0}, {5090, 0}, {5100, 0}, 45 { SPRITE_SPELL_FIRE_HASTE, 0 },
46 {6000, 0}, {6010, 0}, {6020, 0}, {6030, 0}, {6040, 0}, {6050, 0}, {6060, 0}, {6070, 0}, {6080, 0}, {6090, 0}, {6100, 0}, 46 { SPRITE_SPELL_FIRE_FIREBALL, 0 },
47 {7000, 0}, {7010, 0}, {7020, 0}, {7030, 0}, {7040, 0}, {7050, 0}, {7060, 0}, {7070, 0}, {7080, 0}, {7090, 0}, {7100, 0}, 47 { SPRITE_SPELL_FIRE_FIRE_SPIKE, 0 },
48 {8000, 0}, {8010, 0}, {8020, 0}, {8030, 0}, {8040, 0}, {8050, 0}, {8060, 0}, {8070, 0}, {8080, 0}, {8090, 0}, {8100, 0}, 48 { SPRITE_SPELL_FIRE_IMMOLATION, 0 },
49 {9000, 0}, {9010, 0}, {9020, 0}, {9030, 0}, {9040, 0}, {9050, 0}, {9060, 0}, {9070, 0}, {9080, 0}, {9090, 0}, {9100, 0}, 49 { SPRITE_SPELL_FIRE_METEOR_SHOWER, 0 },
50 {545, 0}, 50 { SPRITE_SPELL_FIRE_INFERNO, 0 },
51 {545, 0}, 51 { SPRITE_SPELL_FIRE_INCINERATE, 0 },
52 {555, 0} 52
53 { SPRITE_SPELL_AIR_WIZARD_EYE, 0 },
54 { SPRITE_SPELL_AIR_FEATHER_FALL, 0 },
55 { SPRITE_SPELL_AIR_PROTECTION_FROM_AIR, 0 },
56 { SPRITE_SPELL_AIR_SPARKS, 0 },
57 { SPRITE_SPELL_AIR_JUMP, 0 },
58 { SPRITE_SPELL_AIR_SHIELD, 0 },
59 { SPRITE_SPELL_AIR_LIGHNING_BOLT, 0 },
60 { SPRITE_SPELL_AIR_INVISIBILITY, 0 },
61 { SPRITE_SPELL_AIR_IMPLOSION, 0 },
62 { SPRITE_SPELL_AIR_FLY, 0 },
63 { SPRITE_SPELL_AIR_STARBURST, 0 },
64
65 { SPRITE_SPELL_WATER_AWAKEN, 0 },
66 { SPRITE_SPELL_WATER_POISON_SPRAY, 0 },
67 { SPRITE_SPELL_WATER_PROTECTION_FROM_WATER, 0 },
68 { SPRITE_SPELL_WATER_ICE_BOLT, 0 },
69 { SPRITE_SPELL_WATER_WATER_WALK, 0 },
70 { SPRITE_SPELL_WATER_RECHARGE_ITEM, 0 },
71 { SPRITE_SPELL_WATER_ACID_BURST, 0 },
72 { SPRITE_SPELL_WATER_ENCHANT_ITEM, 0 },
73 { SPRITE_SPELL_WATER_TOWN_PORTAL, 0 },
74 { SPRITE_SPELL_WATER_ICE_BLAST, 0 },
75 { SPRITE_SPELL_WATER_LLOYDS_BEACON, 0 },
76
77 { SPRITE_SPELL_EARTH_STUN, 0 },
78 { SPRITE_SPELL_EARTH_SLOW, 0 },
79 { SPRITE_SPELL_EARTH_PROTECTION_FROM_EARTH, 0 },
80 { SPRITE_SPELL_EARTH_DEADLY_SWARM, 0 },
81 { SPRITE_SPELL_EARTH_STONESKIN, 0 },
82 { SPRITE_SPELL_EARTH_BLADES, 0 },
83 { SPRITE_SPELL_EARTH_STONE_TO_FLESH, 0 },
84 { SPRITE_SPELL_EARTH_ROCK_BLAST, 0 },
85 { SPRITE_SPELL_EARTH_TELEKINESIS, 0 },
86 { SPRITE_SPELL_EARTH_DEATH_BLOSSOM, 0 },
87 { SPRITE_SPELL_EARTH_MASS_DISTORTION, 0 },
88
89 { SPRITE_SPELL_SPIRIT_DETECT_LIFE, 0 },
90 { SPRITE_SPELL_SPIRIT_BLESS, 0 },
91 { SPRITE_SPELL_SPIRIT_FATE, 0 },
92 { SPRITE_SPELL_SPIRIT_TURN_UNDEAD, 0 },
93 { SPRITE_SPELL_SPIRIT_REMOVE_CURSE, 0 },
94 { SPRITE_SPELL_SPIRIT_PRESERVATION, 0 },
95 { SPRITE_SPELL_SPIRIT_HEROISM, 0 },
96 { SPRITE_SPELL_SPIRIT_SPIRIT_LASH, 0 },
97 { SPRITE_SPELL_SPIRIT_RAISE_DEAD, 0 },
98 { SPRITE_SPELL_SPIRIT_SHARED_LIFE, 0 },
99 { SPRITE_SPELL_SPIRIT_RESSURECTION, 0 },
100
101 { SPRITE_SPELL_MIND_REMOVE_FEAR, 0 },
102 { SPRITE_SPELL_MIND_MIND_BLAST, 0 },
103 { SPRITE_SPELL_MIND_PROTECTION_FROM_MIND, 0 },
104 { SPRITE_SPELL_MIND_TELEPATHY, 0 },
105 { SPRITE_SPELL_MIND_CHARM, 0 },
106 { SPRITE_SPELL_MIND_CURE_PARALYSIS, 0 },
107 { SPRITE_SPELL_MIND_BERSERK, 0 },
108 { SPRITE_SPELL_MIND_MASS_FEAR, 0 },
109 { SPRITE_SPELL_MIND_CURE_INSANITY, 0 },
110 { SPRITE_SPELL_MIND_PSYCHIC_SHOCK, 0 },
111 { SPRITE_SPELL_MIND_ENSLAVE, 0 },
112
113 { SPRITE_SPELL_BODY_CURE_WEAKNESS, 0 },
114 { SPRITE_SPELL_BODY_FIRST_AID, 0 },
115 { SPRITE_SPELL_BODY_PROTECTION_FROM_BODY, 0 },
116 { SPRITE_SPELL_BODY_HARM, 0 },
117 { SPRITE_SPELL_BODY_REGENERATION, 0 },
118 { SPRITE_SPELL_BODY_CURE_POISON, 0 },
119 { SPRITE_SPELL_BODY_HAMMERHANDS, 0 },
120 { SPRITE_SPELL_BODY_CURE_DISEASE, 0 },
121 { SPRITE_SPELL_BODY_PROTECTION_FROM_MAGIC, 0 },
122 { SPRITE_SPELL_BODY_FLYING_FIST, 0 },
123 { SPRITE_SPELL_BODY_POWER_CURE, 0 },
124
125 { SPRITE_SPELL_LIGHT_LIGHT_BOLT, 0 },
126 { SPRITE_SPELL_LIGHT_DESTROY_UNDEAD, 0 },
127 { SPRITE_SPELL_LIGHT_DISPEL_MAGIC, 0 },
128 { SPRITE_SPELL_LIGHT_PARALYZE, 0 },
129 { SPRITE_SPELL_LIGHT_SUMMON_ELEMENTAL, 0 },
130 { SPRITE_SPELL_LIGHT_DAY_OF_THE_GODS, 0 },
131 { SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT, 0 },
132 { SPRITE_SPELL_LIGHT_DAY_OF_PROTECTION, 0 },
133 { SPRITE_SPELL_LIGHT_HOUR_OF_POWER, 0 },
134 { SPRITE_SPELL_LIGHT_SUNRAY, 0 },
135 { SPRITE_SPELL_LIGHT_DIVINE_INTERVENTION, 0 },
136
137 { SPRITE_SPELL_DARK_REANIMATE, 0 },
138 { SPRITE_SPELL_DARK_TOXIC_CLOUD, 0 },
139 { SPRITE_SPELL_DARK_VAMPIRIC_WEAPON, 0 },
140 { SPRITE_SPELL_DARK_SHRINKING_RAY, 0 },
141 { SPRITE_SPELL_DARK_SHARPMETAL, 0 },
142 { SPRITE_SPELL_DARK_CONTROL_UNDEAD, 0 },
143 { SPRITE_SPELL_DARK_PAIN_REFLECTION, 0 },
144 { SPRITE_SPELL_DARK_SACRIFICE, 0 },
145 { SPRITE_SPELL_DARK_DRAGON_BREATH, 0 },
146 { SPRITE_SPELL_DARK_ARMAGEDDON, 0 },
147 { SPRITE_SPELL_DARK_SOULDRINKER, 0 },
148
149 { SPRITE_SPELL_BOW_ARROW, 0 },
150 { SPRITE_SPELL_101, 0 },
151 { SPRITE_SPELL_LASER_PROJECTILE, 0 }
53 }}; 152 }};
54 153
55 154
56 155
57 SpellData::SpellData( __int16 innormalMana, __int16 inExpertLevelMana, __int16 inMasterLevelMana, __int16 inMagisterLevelMana, 156 SpellData::SpellData( __int16 innormalMana, __int16 inExpertLevelMana, __int16 inMasterLevelMana, __int16 inMagisterLevelMana,
181 SpellData(40, 40, 40, 40, 110, 110, 110, 110, 0, 0, 0), 280 SpellData(40, 40, 40, 40, 110, 110, 110, 110, 0, 0, 0),
182 SpellData(45, 45, 45, 45, 200, 200, 200, 150, 0, 0, 0), 281 SpellData(45, 45, 45, 45, 200, 200, 200, 150, 0, 0, 0),
183 SpellData(50, 50, 50, 50, 120, 120, 120, 100, 0, 25, 0), 282 SpellData(50, 50, 50, 50, 120, 120, 120, 100, 0, 25, 0),
184 SpellData(55, 55, 55, 55, 250, 250, 250, 250, 50, 1, 0), 283 SpellData(55, 55, 55, 55, 250, 250, 250, 250, 50, 1, 0),
185 SpellData(60, 60, 60, 60, 300, 300, 300, 300, 25, 8, 0) 284 SpellData(60, 60, 60, 60, 300, 300, 300, 300, 25, 8, 0)
186 }}; 285 }};
187 286
188 std::array<unsigned int, 25> wand_spell_ids = 287 std::array<SPELL_TYPE, 25> wand_spell_ids =
189 { 288 {
190 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm 289 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm
191 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM, 290 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM,
192 // 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 291 // 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
193 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM, 292 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM,
420 case SPELL_EARTH_BLADES: 519 case SPELL_EARTH_BLADES:
421 case SPELL_EARTH_ROCK_BLAST: 520 case SPELL_EARTH_ROCK_BLAST:
422 case SPELL_WATER_POISON_SPRAY: 521 case SPELL_WATER_POISON_SPRAY:
423 case SPELL_AIR_SPARKS: 522 case SPELL_AIR_SPARKS:
424 case SPELL_EARTH_DEATH_BLOSSOM: 523 case SPELL_EARTH_DEATH_BLOSSOM:
425 a1.uType = stru_4E3ACC[uSpellID].uType; 524 a1.uType = spell_sprite_mapping[uSpellID].uSpriteType;
426 a1.stru_24.Reset(); 525 a1.containing_item.Reset();
427 a1.spell_id = uSpellID; 526 a1.spell_id = uSpellID;
428 a1.spell_level = uSkill; 527 a1.spell_level = uSkill;
429 a1.spell_skill = skillMasteryPlusOne; 528 a1.spell_skill = skillMasteryPlusOne;
430 v16 = 0; 529 v16 = 0;
431 while (v16 < pObjectList->uNumObjects) 530 while (v16 < pObjectList->uNumObjects)