annotate mm7_6.cpp @ 2316:25f771e528f0

Draw terrain
author Ritor1
date Wed, 19 Mar 2014 17:30:14 +0600
parents 0a14fc2d121e
children 9551756f46c4
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2245
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
2 #include "MM7.h"
Ritor1
parents:
diff changeset
3
1323
bfde0563ecdc removed weather.h from indoor.h
Grumpy7
parents: 1296
diff changeset
4 #include "Weather.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
5 #include "Sprites.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
6 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
7 #include "Keyboard.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
8
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1003
diff changeset
9 #include "Vis.h"
0
Ritor1
parents:
diff changeset
10 #include "Game.h"
Ritor1
parents:
diff changeset
11 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
12 #include "Party.h"
Ritor1
parents:
diff changeset
13 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
14 #include "Outdoor.h"
Ritor1
parents:
diff changeset
15 #include "Actor.h"
Ritor1
parents:
diff changeset
16 #include "Viewport.h"
2037
7a9477135943 Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents: 1989
diff changeset
17 #include "OurMath.h"
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
18 #include "SpriteObject.h"
0
Ritor1
parents:
diff changeset
19 #include "ObjectList.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 2037
diff changeset
20 #include "Timer.h"
0
Ritor1
parents:
diff changeset
21 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
22 #include "TurnEngine.h"
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
23 #include "CastSpellInfo.h"
0
Ritor1
parents:
diff changeset
24 #include "stru298.h"
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29
Ritor1
parents:
diff changeset
30
Ritor1
parents:
diff changeset
31
Ritor1
parents:
diff changeset
32 //----- (00427546) --------------------------------------------------------
Ritor1
parents:
diff changeset
33 int stru319::_427546(int a2)
Ritor1
parents:
diff changeset
34 {
Ritor1
parents:
diff changeset
35 int result; // eax@2
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37 if ( a2 >= 0 )
Ritor1
parents:
diff changeset
38 {
Ritor1
parents:
diff changeset
39 if ( a2 >= 1 )
Ritor1
parents:
diff changeset
40 result = (a2 >= 2) + 2;
Ritor1
parents:
diff changeset
41 else
Ritor1
parents:
diff changeset
42 result = 1;
Ritor1
parents:
diff changeset
43 }
Ritor1
parents:
diff changeset
44 else
Ritor1
parents:
diff changeset
45 {
Ritor1
parents:
diff changeset
46 result = 0;
Ritor1
parents:
diff changeset
47 }
Ritor1
parents:
diff changeset
48 return result;
Ritor1
parents:
diff changeset
49 }
Ritor1
parents:
diff changeset
50
Ritor1
parents:
diff changeset
51 //----- (0042EB8D) --------------------------------------------------------
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
52 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line)
0
Ritor1
parents:
diff changeset
53 {
482
9898e6b413d8 some debug stuff commented
Nomad
parents: 469
diff changeset
54 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line);
0
Ritor1
parents:
diff changeset
55 if (uNumMessages < 40)
Ritor1
parents:
diff changeset
56 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
57 files[uNumMessages] = file;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
58 lines[uNumMessages] = line;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
59
0
Ritor1
parents:
diff changeset
60 pMessages[uNumMessages].eType = msg;
Ritor1
parents:
diff changeset
61 pMessages[uNumMessages].param = param;
Ritor1
parents:
diff changeset
62 pMessages[uNumMessages++].field_8 = a4;
Ritor1
parents:
diff changeset
63 }
Ritor1
parents:
diff changeset
64 }
Ritor1
parents:
diff changeset
65
Ritor1
parents:
diff changeset
66 //----- (0042EBDB) --------------------------------------------------------
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
67 int stru193_math::Sin(int angle)
0
Ritor1
parents:
diff changeset
68 {
323
d720a13e2273 Very basic picking & entering houses
Nomad
parents: 319
diff changeset
69 return Cos(angle - this->uIntegerHalfPi);
0
Ritor1
parents:
diff changeset
70 }
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72 //----- (0042ECB5) --------------------------------------------------------
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
73 void _42ECB5_PlayerAttacksActor()
0
Ritor1
parents:
diff changeset
74 {
Ritor1
parents:
diff changeset
75 char *v5; // eax@8
Ritor1
parents:
diff changeset
76 unsigned int v9; // ecx@21
Ritor1
parents:
diff changeset
77 char *v11; // eax@26
Ritor1
parents:
diff changeset
78 unsigned int v12; // eax@47
Ritor1
parents:
diff changeset
79 SoundID v24; // [sp-4h] [bp-40h]@58
Ritor1
parents:
diff changeset
80
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
81 //result = pParty->pPlayers[uActiveCharacter-1].CanAct();
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1974
diff changeset
82 Player* player = &pParty->pPlayers[uActiveCharacter - 1];
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
83 if (!player->CanAct())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
84 return;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
85
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1459
diff changeset
86 CastSpellInfoHelpers::_427D48();
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
87 //v3 = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
88 if (pParty->Invisible())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
89 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
90
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
91 //v31 = player->pEquipment.uBow;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
92 int bow_idx = player->pEquipment.uBow;
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1558
diff changeset
93 if (bow_idx && player->pInventoryItemList[bow_idx - 1].IsBroken())
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
94 bow_idx = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
95
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
96 //v32 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
97 int wand_item_id = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
98 //v33 = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
99 //v4 = v1->pEquipment.uMainHand;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
100 int laser_weapon_item_id = 0;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
101
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
102 int main_hand_idx = player->pEquipment.uMainHand;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
103 if (main_hand_idx)
0
Ritor1
parents:
diff changeset
104 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1974
diff changeset
105 ItemGen* item = &player->pInventoryItemList[main_hand_idx - 1];
112
909822c91d47 pointer fixes
zipi
parents: 90
diff changeset
106 //v5 = (char *)v1 + 36 * v4;
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1558
diff changeset
107 if (!item->IsBroken())
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
108 {
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
109 //v28b = &v1->pInventoryItems[v4].uItemID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
110 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124);
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
111 if (item->GetItemEquipType() == EQUIP_WAND)
0
Ritor1
parents:
diff changeset
112 {
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
113 if (item->uNumCharges <= 0)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
114 player->pEquipment.uMainHand = 0; // wand discharged - unequip
0
Ritor1
parents:
diff changeset
115 else
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
116 wand_item_id = item->uItemID;//*((int *)v5 + 124);
0
Ritor1
parents:
diff changeset
117 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
118 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE)
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
119 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124);
0
Ritor1
parents:
diff changeset
120 }
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
121 }
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
122
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
123 //v30 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
124 //v29 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
125 //v28 = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
126 //v7 = pMouse->uPointingObjectID;
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
127
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
128 int target_pid = pMouse->uPointingObjectID;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
129 int target_type = PID_TYPE(target_pid),
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
130 target_id = PID_ID(target_pid);
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
131 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct())
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
132 {
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
133 target_pid = stru_50C198.FindClosestActor(5120, 0, 0);
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
134 target_type = PID_TYPE(target_pid);
ceef50611567 * AI fixed (temporary)
zipi
parents: 832
diff changeset
135 target_id = PID_ID(target_pid);
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
136 }
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
137
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1974
diff changeset
138 Actor* actor = &pActors[target_id];
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
139 int actor_distance = 0;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
140 if (target_type == OBJECT_Actor)
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
141 {
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
142 int distance_x = actor->vPosition.x - pParty->vPosition.x,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
143 distance_y = actor->vPosition.y - pParty->vPosition.y,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
144 distance_z = actor->vPosition.z - pParty->vPosition.z;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
145 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
146 if (actor_distance < 0)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
147 actor_distance = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
148 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
149
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
150 bool shooting_bow = false,
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
151 shotting_laser = false,
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
152 shooting_wand = false,
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
153 melee_attack = false;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
154 if (laser_weapon_item_id)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
155 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
156 shotting_laser = true;
490
Nomad
parents: 488
diff changeset
157 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
158 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
159 else if (wand_item_id)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
160 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
161 shooting_wand = true;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
162
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
163 int main_hand_idx = player->pEquipment.uMainHand;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1340
diff changeset
164 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItemList[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
165
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1340
diff changeset
166 if (!--player->pInventoryItemList[main_hand_idx - 1].uNumCharges)
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
167 player->pEquipment.uMainHand = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
168 }
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
169 else if (target_type == OBJECT_Actor && actor_distance <= 407.2)
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
170 {
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
171 melee_attack = true;
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
172
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
173 Vec3_int_ a3;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
174 a3.x = actor->vPosition.x - pParty->vPosition.x;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
175 a3.y = actor->vPosition.y - pParty->vPosition.y;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
176 a3.z = actor->vPosition.z - pParty->vPosition.z;
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
177 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z);
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
178
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
179 DamageMonsterFromParty(PID(OBJECT_Player, uActiveCharacter - 1), target_id, &a3);
1989
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1980
diff changeset
180 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_TWO_HANDED) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_SINGLE_HANDED))
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
181 _42FA66_do_explosive_impact(actor->vPosition.x, actor->vPosition.y, actor->vPosition.z + actor->uActorHeight / 2, 0, 512, uActiveCharacter);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
182 }
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
183 else if (bow_idx)
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
184 {
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
185 shooting_bow = true;
490
Nomad
parents: 488
diff changeset
186 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
187 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
188 else
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
189 {
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
190 melee_attack = true;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
191 ; // actor out of range or no actor; no ranged weapon so melee attacking air
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
192 }
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
193
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
194 if (!pParty->bTurnBasedModeOn && melee_attack) // wands, bows & lasers will add recovery while shooting spell effect
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
195 {
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
196 int recovery = player->GetAttackRecoveryTime(false);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
197 if (recovery < 30 )
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 295
diff changeset
198 recovery = 30;
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 810
diff changeset
199 player->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333);
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
200 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
201
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
202 int v34 = 0;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
203 if (shooting_wand)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
204 return;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
205 else if (shooting_bow)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
206 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
207 v34 = 5;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
208 player->PlaySound(SPEECH_50, 0);
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
209 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
210 if (shotting_laser)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
211 v34 = 7;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
212 else
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
213 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
214 int main_hand_idx = player->pEquipment.uMainHand;
1989
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1980
diff changeset
215 if (player->HasItemEquipped(EQUIP_TWO_HANDED))
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
216 v34 = player->pInventoryItemList[main_hand_idx - 1].GetPlayerSkillType();
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1340
diff changeset
217 pTurnEngine->ApplyPlayerAction();
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
218 }
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
219
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
220 switch (v34)
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
221 {
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
222 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
223 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
224 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
225 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
226 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
227 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
228 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
229 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break;
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
230 }
0
Ritor1
parents:
diff changeset
231 }
Ritor1
parents:
diff changeset
232
Ritor1
parents:
diff changeset
233 //----- (0042F184) --------------------------------------------------------
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
234 int stru319::FindClosestActor(int pick_depth, int a3, int a4)
0
Ritor1
parents:
diff changeset
235 {
Ritor1
parents:
diff changeset
236 int v4; // edi@1
Ritor1
parents:
diff changeset
237 stru319 *v5; // esi@1
Ritor1
parents:
diff changeset
238 int v6; // eax@2
Ritor1
parents:
diff changeset
239 int v7; // eax@4
Ritor1
parents:
diff changeset
240 int result; // eax@5
Ritor1
parents:
diff changeset
241 int *v9; // edx@8
Ritor1
parents:
diff changeset
242 signed int v10; // ebx@10
Ritor1
parents:
diff changeset
243 int v11; // edi@11
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
244 //Actor *v12; // esi@12
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
245 //unsigned __int16 v13; // ax@12
0
Ritor1
parents:
diff changeset
246 int v14; // eax@22
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
247 //char v15; // zf@30
0
Ritor1
parents:
diff changeset
248 int v16; // esi@32
Ritor1
parents:
diff changeset
249 int v17; // ecx@34
Ritor1
parents:
diff changeset
250 stru319 *v18; // eax@39
Ritor1
parents:
diff changeset
251 int v19; // edx@39
Ritor1
parents:
diff changeset
252 int v20; // ecx@41
Ritor1
parents:
diff changeset
253 unsigned __int16 v21; // ax@42
Ritor1
parents:
diff changeset
254 unsigned int v22; // [sp+8h] [bp-24h]@11
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
255 //unsigned int v23; // [sp+Ch] [bp-20h]@7
0
Ritor1
parents:
diff changeset
256 stru319 *v24; // [sp+10h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
257 unsigned int v25; // [sp+14h] [bp-18h]@8
Ritor1
parents:
diff changeset
258 int *v26; // [sp+18h] [bp-14h]@8
Ritor1
parents:
diff changeset
259 int v27; // [sp+1Ch] [bp-10h]@10
Ritor1
parents:
diff changeset
260 int *v28; // [sp+20h] [bp-Ch]@10
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
261 //unsigned int v29; // [sp+24h] [bp-8h]@7
0
Ritor1
parents:
diff changeset
262 int v30; // [sp+28h] [bp-4h]@6
Ritor1
parents:
diff changeset
263 int i; // [sp+38h] [bp+Ch]@33
Ritor1
parents:
diff changeset
264 signed int v32; // [sp+3Ch] [bp+10h]@32
Ritor1
parents:
diff changeset
265
Ritor1
parents:
diff changeset
266 v4 = 0;
Ritor1
parents:
diff changeset
267 v5 = this;
Ritor1
parents:
diff changeset
268 v24 = this;
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
269 //if ( pRenderer->pRenderD3D )
0
Ritor1
parents:
diff changeset
270 {
Ritor1
parents:
diff changeset
271 v6 = a3 != 0;
Ritor1
parents:
diff changeset
272 if ( a4 )
Ritor1
parents:
diff changeset
273 LOBYTE(v6) = v6 | 8;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
274 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1);
0
Ritor1
parents:
diff changeset
275 if ( v7 != -1 )
Ritor1
parents:
diff changeset
276 return (unsigned __int16)v7;
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
277 else return 0;
0
Ritor1
parents:
diff changeset
278 }
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
279 /*else // software impl
0
Ritor1
parents:
diff changeset
280 {
Ritor1
parents:
diff changeset
281 v30 = 0;
Ritor1
parents:
diff changeset
282 if ( pRenderer->pActiveZBuffer )
Ritor1
parents:
diff changeset
283 {
692
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
284 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y )
0
Ritor1
parents:
diff changeset
285 {
692
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
286 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y];
066e2b29b30f viewport.cpp added
Gloval
parents: 651
diff changeset
287 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y];
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
288 for ( v25 = viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y; v25; --v25 )
0
Ritor1
parents:
diff changeset
289 {
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
290 if ( (signed int)viewparams->uScreen_topL_X < (signed int)viewparams->uScreen_BttmR_X )
0
Ritor1
parents:
diff changeset
291 {
Ritor1
parents:
diff changeset
292 v28 = v9;
Ritor1
parents:
diff changeset
293 v10 = v4;
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
294 for ( v27 = viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X; v27; --v27 )
0
Ritor1
parents:
diff changeset
295 {
Ritor1
parents:
diff changeset
296 v22 = *v28;
Ritor1
parents:
diff changeset
297 v11 = *v28 & 0xFFFF;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
298 if (PID_TYPE(v11) == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
299 {
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
300 if ( pActors[PID_ID(v11)].uAIState != Dead )
0
Ritor1
parents:
diff changeset
301 {
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
302 if ( pActors[PID_ID(v11)].uAIState != Dying && pActors[PID_ID(v11)].uAIState != Removed
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
303 && pActors[PID_ID(v11)].uAIState != Summoned && pActors[PID_ID(v11)].uAIState != Disabled
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
304 && (!a3 || pActors[PID_ID(v11)].GetActorsRelation(0)) )
0
Ritor1
parents:
diff changeset
305 {
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
306 if ( (!a4 || MonsterStats::BelongsToSupertype(pActors[PID_ID(v11)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD))
295
640a176c030f sub_42ECB5
Nomad
parents: 271
diff changeset
307 && v22 <= pick_depth << 16 )
0
Ritor1
parents:
diff changeset
308 {
Ritor1
parents:
diff changeset
309 v14 = 0;
Ritor1
parents:
diff changeset
310 if ( v10 > 0 )
Ritor1
parents:
diff changeset
311 {
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
312 for ( v14; v14 < v30; ++v14 )
0
Ritor1
parents:
diff changeset
313 {
Ritor1
parents:
diff changeset
314 if ( dword_50BDA0[v14] == v11 )
Ritor1
parents:
diff changeset
315 break;
Ritor1
parents:
diff changeset
316 }
Ritor1
parents:
diff changeset
317 }
Ritor1
parents:
diff changeset
318 if ( v14 == v30 && v10 < 100 )
Ritor1
parents:
diff changeset
319 {
Ritor1
parents:
diff changeset
320 ++v30;
Ritor1
parents:
diff changeset
321 dword_50BC10[v10] = v22;
Ritor1
parents:
diff changeset
322 dword_50BDA0[v10] = v11;
Ritor1
parents:
diff changeset
323 ++v10;
Ritor1
parents:
diff changeset
324 }
Ritor1
parents:
diff changeset
325 }
Ritor1
parents:
diff changeset
326 }
Ritor1
parents:
diff changeset
327 }
Ritor1
parents:
diff changeset
328 }
Ritor1
parents:
diff changeset
329 ++v28;
Ritor1
parents:
diff changeset
330 }
Ritor1
parents:
diff changeset
331 v4 = v30;
Ritor1
parents:
diff changeset
332 v5 = v24;
Ritor1
parents:
diff changeset
333 }
Ritor1
parents:
diff changeset
334 v9 = v26 + 640;
Ritor1
parents:
diff changeset
335 v26 += 640;
Ritor1
parents:
diff changeset
336 }
Ritor1
parents:
diff changeset
337 }
Ritor1
parents:
diff changeset
338 if ( v4 > 0 )
Ritor1
parents:
diff changeset
339 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
340 v16 = (int)dword_50BC10.data();
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
341 for ( v32 = 1; v32 - 1 < v4; ++v32 )
0
Ritor1
parents:
diff changeset
342 {
Ritor1
parents:
diff changeset
343 for ( i = v32; i < v4; ++i )
Ritor1
parents:
diff changeset
344 {
Ritor1
parents:
diff changeset
345 v17 = dword_50BC10[i];
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
346 if ( dword_50BC10[i] < *(int *)v16 )
0
Ritor1
parents:
diff changeset
347 {
Ritor1
parents:
diff changeset
348 dword_50BC10[i] = *(int *)v16;
Ritor1
parents:
diff changeset
349 *(int *)v16 = v17;
Ritor1
parents:
diff changeset
350 }
Ritor1
parents:
diff changeset
351 }
Ritor1
parents:
diff changeset
352 v16 += 4;
Ritor1
parents:
diff changeset
353 }
Ritor1
parents:
diff changeset
354 v5 = v24;
Ritor1
parents:
diff changeset
355 if ( v4 > 0 )
Ritor1
parents:
diff changeset
356 {
Ritor1
parents:
diff changeset
357 v18 = v24;
2117
c7bf59066842 mm7_4-6 cleaned
Ritor1
parents: 2114
diff changeset
358 for ( v19 = v4; v19; --v19 )
0
Ritor1
parents:
diff changeset
359 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
360 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10.data() - (char *)v24].field_0 >> 3) & 0x1FFF;
0
Ritor1
parents:
diff changeset
361 v18 += 4;
Ritor1
parents:
diff changeset
362 }
Ritor1
parents:
diff changeset
363 }
Ritor1
parents:
diff changeset
364 }
Ritor1
parents:
diff changeset
365 v20 = 0;
Ritor1
parents:
diff changeset
366 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 )
Ritor1
parents:
diff changeset
367 {
Ritor1
parents:
diff changeset
368 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState;
Ritor1
parents:
diff changeset
369 if ( v21 != 4 && v21 != 5 )
Ritor1
parents:
diff changeset
370 break;
Ritor1
parents:
diff changeset
371 }
Ritor1
parents:
diff changeset
372 if ( v20 != v4 )
Ritor1
parents:
diff changeset
373 {
Ritor1
parents:
diff changeset
374 result = 8 * *(int *)&v5[4 * v20].field_0;
Ritor1
parents:
diff changeset
375 LOBYTE(result) = result | 3;
Ritor1
parents:
diff changeset
376 return result;
Ritor1
parents:
diff changeset
377 }
Ritor1
parents:
diff changeset
378 }
Ritor1
parents:
diff changeset
379 }
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
380 return 0;*/
0
Ritor1
parents:
diff changeset
381 }
Ritor1
parents:
diff changeset
382
Ritor1
parents:
diff changeset
383 //----- (0042F3D6) --------------------------------------------------------
Ritor1
parents:
diff changeset
384 void InitializeTurnBasedAnimations(void *_this)
Ritor1
parents:
diff changeset
385 {
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
386 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i)
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
387 {
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
388 char icon_name[32];
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
389 sprintf(icon_name, "turn%u", i);
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
390 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name);
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
391 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]);
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
392 }
0
Ritor1
parents:
diff changeset
393
Ritor1
parents:
diff changeset
394 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop");
Ritor1
parents:
diff changeset
395 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour");
Ritor1
parents:
diff changeset
396 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart");
Ritor1
parents:
diff changeset
397 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1");
Ritor1
parents:
diff changeset
398 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11");
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2121
diff changeset
399
0
Ritor1
parents:
diff changeset
400 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour);
Ritor1
parents:
diff changeset
401 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop);
Ritor1
parents:
diff changeset
402 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart);
Ritor1
parents:
diff changeset
403 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame);
Ritor1
parents:
diff changeset
404 }
Ritor1
parents:
diff changeset
405
Ritor1
parents:
diff changeset
406 //----- (0042F7EB) --------------------------------------------------------
Ritor1
parents:
diff changeset
407 bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9)
Ritor1
parents:
diff changeset
408 {
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
409 unsigned __int16 pObjectDescID; // ax@7
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
410 SpriteObject pSpellObject; // [sp+Ch] [bp-78h]@1
0
Ritor1
parents:
diff changeset
411
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
412 pSpellObject.stru_24.Reset();
0
Ritor1
parents:
diff changeset
413 if ( a9 )
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
414 memcpy(&pSpellObject.stru_24, a9, sizeof(pSpellObject.stru_24));
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
415 pSpellObject.spell_skill = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
416 pSpellObject.spell_level = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
417 pSpellObject.spell_id = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
418 pSpellObject.field_54 = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
419 pSpellObject.uType = uSpriteID;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
420 pObjectDescID = 0;
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
421 for ( uint i = 0; i < (signed int)pObjectList->uNumObjects; ++i )
0
Ritor1
parents:
diff changeset
422 {
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
423 if ( (short)uSpriteID == pObjectList->pObjects[i].uObjectID )
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
424 pObjectDescID = i;
0
Ritor1
parents:
diff changeset
425 }
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
426 pSpellObject.uObjectDescID = pObjectDescID;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
427 pSpellObject.vPosition.x = x;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
428 pSpellObject.vPosition.y = y;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
429 pSpellObject.vPosition.z = z;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
430 pSpellObject.uSoundID = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
431 pSpellObject.uAttributes = attributes;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
432 pSpellObject.uSectorID = pIndoor->GetSector(x, y, z);
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
433 pSpellObject.uSpriteFrameID = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
434 pSpellObject.spell_caster_pid = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
435 pSpellObject.spell_target_pid = 0;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
436 if ( !(pSpellObject.uAttributes & 0x10) )
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
437 {
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
438 if ( pItemsTable->uAllItemsCount )
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
439 {
1729
f44b6e02e81c pop-up window in character(paperdill) window, alchemy
Ritor1
parents: 1709
diff changeset
440 for ( uint i = 1; i < pItemsTable->uAllItemsCount; ++i )
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
441 {
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
442 if ( pItemsTable->pItems[i].uSpriteID == uSpriteID )
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
443 pSpellObject.stru_24.uItemID = i;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
444 }
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
445 }
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
446 }
0
Ritor1
parents:
diff changeset
447 if ( a7 )
Ritor1
parents:
diff changeset
448 {
Ritor1
parents:
diff changeset
449 if ( count > 0 )
Ritor1
parents:
diff changeset
450 {
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
451 for ( uint i = count; i; --i )
0
Ritor1
parents:
diff changeset
452 {
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
453 pSpellObject.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
454 pSpellObject.Create((signed __int16)pSpellObject.uFacing,
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
455 ((signed int)stru_5C6E00->uIntegerHalfPi / 2) + (rand() % ((signed int)stru_5C6E00->uIntegerHalfPi / 2)), a4, 0);
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
456
0
Ritor1
parents:
diff changeset
457 }
Ritor1
parents:
diff changeset
458 }
Ritor1
parents:
diff changeset
459 }
Ritor1
parents:
diff changeset
460 else
Ritor1
parents:
diff changeset
461 {
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
462 pSpellObject.uFacing = 0;
0
Ritor1
parents:
diff changeset
463 if ( count > 0 )
Ritor1
parents:
diff changeset
464 {
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
465 for ( uint i = count; i; --i )
0
Ritor1
parents:
diff changeset
466 {
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
467 pSpellObject.Create((signed __int16)pSpellObject.uFacing, stru_5C6E00->uIntegerHalfPi, a4, 0);
0
Ritor1
parents:
diff changeset
468 }
Ritor1
parents:
diff changeset
469 }
Ritor1
parents:
diff changeset
470 }
1406
d071e0e9ba75 Explosion Traps fix
Ritor1
parents: 1391
diff changeset
471 return true;
0
Ritor1
parents:
diff changeset
472 }
Ritor1
parents:
diff changeset
473
Ritor1
parents:
diff changeset
474 //----- (0042F960) --------------------------------------------------------
Ritor1
parents:
diff changeset
475 void __fastcall sub_42F960_create_object(int x, int y, int z)
Ritor1
parents:
diff changeset
476 {
Ritor1
parents:
diff changeset
477 unsigned __int16 v7; // ax@5
Ritor1
parents:
diff changeset
478 signed int v8; // eax@6
Ritor1
parents:
diff changeset
479 signed int v9; // eax@7
Ritor1
parents:
diff changeset
480
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
481 SpriteObject a1; // [sp+Ch] [bp-70h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
482 //SpriteObject::SpriteObject(&a1);
0
Ritor1
parents:
diff changeset
483 a1.stru_24.Reset();
Ritor1
parents:
diff changeset
484
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
485 a1.spell_skill = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
486 a1.spell_level = 0;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
487 a1.spell_id = 0;
0
Ritor1
parents:
diff changeset
488 a1.field_54 = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
489 a1.uType = 800;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
490 v7 = 0;
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
491 for ( uint i = 0; i < (signed int)pObjectList->uNumObjects; ++i )
0
Ritor1
parents:
diff changeset
492 {
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
493 if ( a1.uType == pObjectList->pObjects[i].uObjectID )
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
494 v7 = i;
0
Ritor1
parents:
diff changeset
495 }
Ritor1
parents:
diff changeset
496 a1.uObjectDescID = v7;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
497 a1.vPosition.x = x;
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
498 a1.vPosition.y = y;
0
Ritor1
parents:
diff changeset
499 a1.vPosition.z = z;
Ritor1
parents:
diff changeset
500 a1.uSoundID = 0;
Ritor1
parents:
diff changeset
501 a1.uAttributes = 0;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
502 a1.uSectorID = pIndoor->GetSector(x, y, z);
0
Ritor1
parents:
diff changeset
503 a1.uSpriteFrameID = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
504 a1.spell_caster_pid = 0;
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
505 a1.spell_target_pid = 0;
0
Ritor1
parents:
diff changeset
506 v8 = a1.Create(0, 0, 0, 0);
Ritor1
parents:
diff changeset
507 if ( v8 != -1 )
Ritor1
parents:
diff changeset
508 {
Ritor1
parents:
diff changeset
509 v9 = 8 * v8;
Ritor1
parents:
diff changeset
510 LOBYTE(v9) = v9 | 2;
Ritor1
parents:
diff changeset
511 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
512 }
Ritor1
parents:
diff changeset
513 }
Ritor1
parents:
diff changeset
514
Ritor1
parents:
diff changeset
515 //----- (0042FA66) --------------------------------------------------------
1546
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1517
diff changeset
516 void _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6)
0
Ritor1
parents:
diff changeset
517 {
Ritor1
parents:
diff changeset
518 unsigned __int16 v9; // ax@5
Ritor1
parents:
diff changeset
519
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
520 SpriteObject a1a; // [sp+Ch] [bp-74h]@1
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
521 //SpriteObject::SpriteObject(&a1a);
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 490
diff changeset
522 a1a.uType = 600;
0
Ritor1
parents:
diff changeset
523 a1a.stru_24.Reset();
Ritor1
parents:
diff changeset
524
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
525 a1a.spell_id = SPELL_FIRE_FIREBALL;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
526 a1a.spell_level = 8;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
527 a1a.spell_skill = 3;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
528 v9 = 0;
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
529 for ( uint i = 0; i < pObjectList->uNumObjects; ++i )
0
Ritor1
parents:
diff changeset
530 {
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
531 if ( a1a.uType == pObjectList->pObjects[i].uObjectID )
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
532 v9 = i;
0
Ritor1
parents:
diff changeset
533 }
Ritor1
parents:
diff changeset
534 a1a.uObjectDescID = v9;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
535 a1a.vPosition.x = a1;
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
536 a1a.vPosition.y = a2;
0
Ritor1
parents:
diff changeset
537 a1a.vPosition.z = a3;
Ritor1
parents:
diff changeset
538 a1a.uAttributes = 0;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
539 a1a.uSectorID = pIndoor->GetSector(a1, a2, a3);
0
Ritor1
parents:
diff changeset
540 a1a.uSpriteFrameID = 0;
823
c1da83d8223f More spell renames
Nomad
parents: 822
diff changeset
541 a1a.spell_target_pid = 0;
0
Ritor1
parents:
diff changeset
542 a1a.field_60_distance_related_prolly_lod = 0;
Ritor1
parents:
diff changeset
543 a1a.uFacing = 0;
Ritor1
parents:
diff changeset
544 a1a.uSoundID = 0;
Ritor1
parents:
diff changeset
545 if ( a6 >= 1 || a6 <= 4 )
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
546 a1a.spell_caster_pid = PID(OBJECT_Player, a6 - 1);
0
Ritor1
parents:
diff changeset
547 else
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
548 a1a.spell_caster_pid = 0;
1546
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1517
diff changeset
549
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1517
diff changeset
550 int id = a1a.Create(0, 0, 0, 0);
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1517
diff changeset
551 if (id != -1)
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2057
diff changeset
552 AttackerInfo.Add(PID(OBJECT_Item, id), a5, SLOWORD(a1a.vPosition.x), SLOWORD(a1a.vPosition.y),
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2044
diff changeset
553 SLOWORD(a1a.vPosition.z), 0, 0);
0
Ritor1
parents:
diff changeset
554 }
Ritor1
parents:
diff changeset
555
Ritor1
parents:
diff changeset
556 //----- (0042FBDD) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1450
diff changeset
557 void sub_42FBDD()
0
Ritor1
parents:
diff changeset
558 {
388
d95a91011d57 AudioPlayer::PlaySound
Nomad
parents: 377
diff changeset
559 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
560 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]);
Ritor1
parents:
diff changeset
561 pRenderer->Present();
Ritor1
parents:
diff changeset
562 }
Ritor1
parents:
diff changeset
563
Ritor1
parents:
diff changeset
564 //----- (0042FC15) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1450
diff changeset
565 void CloseWindowBackground()
0
Ritor1
parents:
diff changeset
566 {
388
d95a91011d57 AudioPlayer::PlaySound
Nomad
parents: 377
diff changeset
567 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
568 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]);
Ritor1
parents:
diff changeset
569 pRenderer->Present();
Ritor1
parents:
diff changeset
570 }
Ritor1
parents:
diff changeset
571
Ritor1
parents:
diff changeset
572 //----- (0042FC4E) --------------------------------------------------------
1575
43d3536a20f7 OnInventoryItemRightClick
Nomad
parents: 1574
diff changeset
573 void ProcessInputActions()
0
Ritor1
parents:
diff changeset
574 {
Ritor1
parents:
diff changeset
575 char v4; // al@9
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
576 //char v8; // bl@100
0
Ritor1
parents:
diff changeset
577 unsigned __int16 v9; // ax@102
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
578 int spell_price; // eax@103
0
Ritor1
parents:
diff changeset
579 char v14; // al@159
Ritor1
parents:
diff changeset
580 unsigned int v15; // eax@168
Ritor1
parents:
diff changeset
581 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
Ritor1
parents:
diff changeset
582 InputAction inputAction; // [sp+0h] [bp-8h]@7
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
583 //int v24; // [sp+4h] [bp-4h]@87
0
Ritor1
parents:
diff changeset
584
Ritor1
parents:
diff changeset
585 pGame->pKeyboardInstance->EnterCriticalSection();
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1974
diff changeset
586 Keyboard* pKeyboard = pGame->pKeyboardInstance;
0
Ritor1
parents:
diff changeset
587 if (!bAlwaysRun)
Ritor1
parents:
diff changeset
588 {
Ritor1
parents:
diff changeset
589 if (pKeyboard->IsShiftHeld())
Ritor1
parents:
diff changeset
590 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
591 else
Ritor1
parents:
diff changeset
592 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
593 }
Ritor1
parents:
diff changeset
594 else
Ritor1
parents:
diff changeset
595 {
Ritor1
parents:
diff changeset
596 if (pKeyboard->IsShiftHeld())
Ritor1
parents:
diff changeset
597 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
598 else
Ritor1
parents:
diff changeset
599 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
Ritor1
parents:
diff changeset
600 }
Ritor1
parents:
diff changeset
601
140
f4d7a9a8c363 Walk/run and other actions
Nomad
parents: 135
diff changeset
602 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
1052
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
603
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
604
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
605 // WUT? double event trigger
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
606 /*for ( uint i = 0; i < 30; ++i )
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
607 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
608 if ( pKeyActionMap->pToggleTypes[i] )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
609 v14 = pGame->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
610 else
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
611 v14 = pGame->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]);
1052
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
612 if ( v14 )
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
613 {
1052
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
614 if (pCurrentScreen == SCREEN_GAME)
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
615 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
616 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
617 continue;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
618 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
619 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
620 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
621 v15 = pMessageQueue_50CBD0->uNumMessages;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
622 if ( pMessageQueue_50CBD0->uNumMessages )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
623 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
624 v15 = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
625 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 )
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
626 {
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
627 v15 = 1;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
628 pMessageQueue_50CBD0->uNumMessages = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
629 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
630 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
631 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
632 ++pMessageQueue_50CBD0->uNumMessages;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
633 continue;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
634 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
635 pMessageQueue_50CBD0->uNumMessages = 0;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
636 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
637 //pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
638 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
639 }
1052
d48c762de563 -nomarg
Nomad
parents: 1038
diff changeset
640 }*/
0
Ritor1
parents:
diff changeset
641 if ( !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
642 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
643 for ( uint i = 0; i < 30; ++i )
0
Ritor1
parents:
diff changeset
644 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
645 inputAction = (InputAction)i;
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2153
diff changeset
646 if ( pKeyActionMap->pToggleTypes[inputAction] )
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2153
diff changeset
647 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
0
Ritor1
parents:
diff changeset
648 else
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2153
diff changeset
649 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
0
Ritor1
parents:
diff changeset
650 if ( v4 )
Ritor1
parents:
diff changeset
651 {
Ritor1
parents:
diff changeset
652 switch ( inputAction )
Ritor1
parents:
diff changeset
653 {
Ritor1
parents:
diff changeset
654 case INPUT_MoveForward:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
655 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
656 break;
Ritor1
parents:
diff changeset
657 if (!pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
658 {
140
f4d7a9a8c363 Walk/run and other actions
Nomad
parents: 135
diff changeset
659 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
0
Ritor1
parents:
diff changeset
660 partyAction = PARTY_RunForward;
Ritor1
parents:
diff changeset
661 else
Ritor1
parents:
diff changeset
662 partyAction = PARTY_WalkForward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
663 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
664 break;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
665 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
666 if (pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 )
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
667 {
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
668 pTurnEngine->uActionPointsLeft -= 26;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
669 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
670 partyAction = PARTY_RunForward;
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
671 else
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
672 partyAction = PARTY_WalkForward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
673 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
674 break;
0
Ritor1
parents:
diff changeset
675 }
Ritor1
parents:
diff changeset
676 break;
Ritor1
parents:
diff changeset
677 case INPUT_MoveBackwards:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
678 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
679 break;
Ritor1
parents:
diff changeset
680 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
681 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
682 if ( pParty->uFlags2 & 2 )
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
683 partyAction = PARTY_RunBackward;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
684 else
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
685 partyAction = PARTY_WalkBackward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
686 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
687 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
688 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
689 if ( pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 )
0
Ritor1
parents:
diff changeset
690 {
Ritor1
parents:
diff changeset
691 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
692 if ( pParty->uFlags2 & 2 )
Ritor1
parents:
diff changeset
693 partyAction = PARTY_RunBackward;
Ritor1
parents:
diff changeset
694 else
Ritor1
parents:
diff changeset
695 partyAction = PARTY_WalkBackward;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
696 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
697 break;
0
Ritor1
parents:
diff changeset
698 }
Ritor1
parents:
diff changeset
699 break;
Ritor1
parents:
diff changeset
700 case INPUT_StrafeLeft:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
701 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
702 break;
Ritor1
parents:
diff changeset
703 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
704 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
705 partyAction = PARTY_StrafeLeft;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
706 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
707 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
708 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
709 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
0
Ritor1
parents:
diff changeset
710 break;
Ritor1
parents:
diff changeset
711 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
712 partyAction = PARTY_StrafeLeft;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
713 pPartyActionQueue->Add(partyAction);
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
714 break;
0
Ritor1
parents:
diff changeset
715 case INPUT_StrafeRight:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
716 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
717 break;
Ritor1
parents:
diff changeset
718 if (!pParty->bTurnBasedModeOn)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
719 {
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
720 partyAction = PARTY_StrafeRight;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
721 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
722 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
723 }
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
724 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
0
Ritor1
parents:
diff changeset
725 break;
Ritor1
parents:
diff changeset
726 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
727 partyAction = PARTY_StrafeRight;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
728 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
729 break;
0
Ritor1
parents:
diff changeset
730 case INPUT_TurnLeft:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
731 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
732 break;
Ritor1
parents:
diff changeset
733 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
Ritor1
parents:
diff changeset
734 {
Ritor1
parents:
diff changeset
735 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
736 {
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
737 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
0
Ritor1
parents:
diff changeset
738 break;
Ritor1
parents:
diff changeset
739 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
740 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
741 partyAction = PARTY_StrafeLeft;
0
Ritor1
parents:
diff changeset
742 }
Ritor1
parents:
diff changeset
743 else
Ritor1
parents:
diff changeset
744 {
Ritor1
parents:
diff changeset
745 if ( pParty->uFlags2 & 2 )
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
746 partyAction = PARTY_FastTurnLeft;
0
Ritor1
parents:
diff changeset
747 else
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
748 partyAction = PARTY_TurnLeft;
0
Ritor1
parents:
diff changeset
749 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
750 pPartyActionQueue->Add(partyAction);
0
Ritor1
parents:
diff changeset
751 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
752 pWeather->OnPlayerTurn(10);
0
Ritor1
parents:
diff changeset
753 break;
Ritor1
parents:
diff changeset
754 case INPUT_TurnRight:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
755 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
756 break;
Ritor1
parents:
diff changeset
757 if ( GetAsyncKeyState(17) ) // strafing
Ritor1
parents:
diff changeset
758 {
Ritor1
parents:
diff changeset
759 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
760 {
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
761 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
0
Ritor1
parents:
diff changeset
762 break;
Ritor1
parents:
diff changeset
763 pTurnEngine->uActionPointsLeft -= 26;
Ritor1
parents:
diff changeset
764 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
765 partyAction = PARTY_StrafeRight;
0
Ritor1
parents:
diff changeset
766 }
Ritor1
parents:
diff changeset
767 else
Ritor1
parents:
diff changeset
768 {
Ritor1
parents:
diff changeset
769 if ( pParty->uFlags2 & 2 )
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
770 partyAction = PARTY_FastTurnRight;
0
Ritor1
parents:
diff changeset
771 else
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
772 partyAction = PARTY_TurnRight;
0
Ritor1
parents:
diff changeset
773 }
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
774 pPartyActionQueue->Add(partyAction);
0
Ritor1
parents:
diff changeset
775 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
776 pWeather->OnPlayerTurn(-10);
0
Ritor1
parents:
diff changeset
777 break;
Ritor1
parents:
diff changeset
778 case INPUT_Jump:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
779 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn)
0
Ritor1
parents:
diff changeset
780 break;
Ritor1
parents:
diff changeset
781 partyAction = (PartyAction)12;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
782 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
783 break;
0
Ritor1
parents:
diff changeset
784 case INPUT_Yell:
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
785 if (!pCurrentScreen && uActiveCharacter)
0
Ritor1
parents:
diff changeset
786 {
Ritor1
parents:
diff changeset
787 pParty->Yell();
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
788 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0);
0
Ritor1
parents:
diff changeset
789 }
187
49728858c35e On player voices
Nomad
parents: 169
diff changeset
790 break;
0
Ritor1
parents:
diff changeset
791 case INPUT_Pass:
Ritor1
parents:
diff changeset
792 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
793 break;
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
794 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
795 {
1332
1e35cfed7928 turn engine file added
Gloval
parents: 1323
diff changeset
796 pTurnEngine->field_18 |= TE_FLAG_8;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
797 break;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
798 }
0
Ritor1
parents:
diff changeset
799 if ( uActiveCharacter )
Ritor1
parents:
diff changeset
800 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
801 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery )
0
Ritor1
parents:
diff changeset
802 {
Ritor1
parents:
diff changeset
803 if ( !pParty->bTurnBasedModeOn )
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
804 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false) * 2.133333333333333));
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1459
diff changeset
805 CastSpellInfoHelpers::_427D48();
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1340
diff changeset
806 pTurnEngine->ApplyPlayerAction();
0
Ritor1
parents:
diff changeset
807 }
Ritor1
parents:
diff changeset
808 }
Ritor1
parents:
diff changeset
809 break;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
810 case INPUT_Combat://if press ENTER
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
811 if (pCurrentScreen == SCREEN_GAME)
0
Ritor1
parents:
diff changeset
812 {
Ritor1
parents:
diff changeset
813 if (pParty->bTurnBasedModeOn)
Ritor1
parents:
diff changeset
814 {
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
815 if (pTurnEngine->turn_stage == TE_MOVEMENT || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
816 {
Ritor1
parents:
diff changeset
817 pParty->bTurnBasedModeOn = 0;
Ritor1
parents:
diff changeset
818 pTurnEngine->End(true);
Ritor1
parents:
diff changeset
819 }
Ritor1
parents:
diff changeset
820 }
Ritor1
parents:
diff changeset
821 else
Ritor1
parents:
diff changeset
822 {
Ritor1
parents:
diff changeset
823 pTurnEngine->Start();
Ritor1
parents:
diff changeset
824 pParty->bTurnBasedModeOn = true;
Ritor1
parents:
diff changeset
825 }
Ritor1
parents:
diff changeset
826 }
Ritor1
parents:
diff changeset
827 break;
Ritor1
parents:
diff changeset
828 case INPUT_CastReady:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
829 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
830 break;
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
831 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT)
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
832 {
1332
1e35cfed7928 turn engine file added
Gloval
parents: 1323
diff changeset
833 pTurnEngine->field_18 |= TE_FLAG_8;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
834 break;
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
835 }
0
Ritor1
parents:
diff changeset
836 if ( !uActiveCharacter )
Ritor1
parents:
diff changeset
837 break;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
838 v9 = pPlayers[uActiveCharacter]->pActiveSkills[(unsigned __int8)pPlayers[uActiveCharacter]->uQuickSpell / 11 + 12];
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
839 if ( !pPlayers[uActiveCharacter]->uQuickSpell || bUnderwater
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
840 || (( !(HIBYTE(v9) & 1)) ?
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
841 ((v9 & 0x80) == 0 ?
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
842 ((v9 & 0x40) == 0 ? spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uNormalLevelMana : spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uExpertLevelMana) :
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
843 spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uMasterLevelMana) :
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
844 spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uMagisterLevelMana,
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
845 spell_price > pPlayers[uActiveCharacter]->sMana) )
0
Ritor1
parents:
diff changeset
846 {
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
847 pPartyActionQueue = pPartyActionQueue;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
848 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
849 break;
0
Ritor1
parents:
diff changeset
850 }
Ritor1
parents:
diff changeset
851 else
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 2059
diff changeset
852 pMessageQueue_50C9E8->AddMessage(UIMSG_CastQuickSpell, 0, 0);
0
Ritor1
parents:
diff changeset
853 break;
Ritor1
parents:
diff changeset
854 case INPUT_Attack:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
855 if (pCurrentScreen != SCREEN_GAME)
0
Ritor1
parents:
diff changeset
856 break;
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2201
diff changeset
857 if (pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT)
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
858 {
1332
1e35cfed7928 turn engine file added
Gloval
parents: 1323
diff changeset
859 pTurnEngine->field_18 |= TE_FLAG_8;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
860 break;
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
861 }
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
862 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
0
Ritor1
parents:
diff changeset
863 break;
Ritor1
parents:
diff changeset
864 case INPUT_EventTrigger:
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 243
diff changeset
865 if (pCurrentScreen == SCREEN_GAME)
0
Ritor1
parents:
diff changeset
866 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
867 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
868 break;
0
Ritor1
parents:
diff changeset
869 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 141
diff changeset
870 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE )
0
Ritor1
parents:
diff changeset
871 {
Ritor1
parents:
diff changeset
872 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
873 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
874 pMessageQueue_50CBD0->uNumMessages = 0;
0
Ritor1
parents:
diff changeset
875 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
Ritor1
parents:
diff changeset
876 {
Ritor1
parents:
diff changeset
877 pMessageQueue_50CBD0->uNumMessages = 1;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
878 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
0
Ritor1
parents:
diff changeset
879 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
1575
43d3536a20f7 OnInventoryItemRightClick
Nomad
parents: 1574
diff changeset
880 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 = 0;
0
Ritor1
parents:
diff changeset
881 ++pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
882 break;
Ritor1
parents:
diff changeset
883 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
884 break;
0
Ritor1
parents:
diff changeset
885 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 430
diff changeset
886 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
0
Ritor1
parents:
diff changeset
887 }
Ritor1
parents:
diff changeset
888 break;
Ritor1
parents:
diff changeset
889 case INPUT_CharCycle:
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1009
diff changeset
890 if ( pCurrentScreen == SCREEN_SPELL_BOOK )
0
Ritor1
parents:
diff changeset
891 break;
1575
43d3536a20f7 OnInventoryItemRightClick
Nomad
parents: 1574
diff changeset
892
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1009
diff changeset
893 pMessageQueue_50C9E8->AddMessage(UIMSG_CycleCharacters, 0, 0);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
894 break;
0
Ritor1
parents:
diff changeset
895 case INPUT_LookUp:
Ritor1
parents:
diff changeset
896 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
897 break;
Ritor1
parents:
diff changeset
898 partyAction = (PartyAction)7;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
899 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
900 break;
0
Ritor1
parents:
diff changeset
901 case INPUT_CenterView:
Ritor1
parents:
diff changeset
902 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
903 break;
Ritor1
parents:
diff changeset
904 partyAction = (PartyAction)9;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
905 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
906 break;
0
Ritor1
parents:
diff changeset
907 case INPUT_LookDown:
Ritor1
parents:
diff changeset
908 if ( pEventTimer->bPaused )
Ritor1
parents:
diff changeset
909 break;
Ritor1
parents:
diff changeset
910 partyAction = (PartyAction)8;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
911 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
912 break;
0
Ritor1
parents:
diff changeset
913 case INPUT_FlyUp:
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
914 if ( pCurrentScreen || pEventTimer->bPaused )
0
Ritor1
parents:
diff changeset
915 break;
Ritor1
parents:
diff changeset
916 partyAction = (PartyAction)13;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
917 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
918 break;
0
Ritor1
parents:
diff changeset
919 case INPUT_Land:
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
920 if ( pCurrentScreen || pEventTimer->bPaused )
0
Ritor1
parents:
diff changeset
921 break;
Ritor1
parents:
diff changeset
922 partyAction = (PartyAction)15;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
923 pPartyActionQueue->Add(partyAction);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
924 break;
0
Ritor1
parents:
diff changeset
925 case INPUT_FlyDown:
Ritor1
parents:
diff changeset
926 if ( !pCurrentScreen
Ritor1
parents:
diff changeset
927 && !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
928 {
Ritor1
parents:
diff changeset
929 partyAction = (PartyAction)14;
998
e4383e6dfbef ProcessInput
Ritor1
parents: 997
diff changeset
930 pPartyActionQueue->Add(partyAction);
0
Ritor1
parents:
diff changeset
931 }
Ritor1
parents:
diff changeset
932 break;
Ritor1
parents:
diff changeset
933 case INPUT_ZoomIn:
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1009
diff changeset
934 pMessageQueue_50C9E8->AddMessage(UIMSG_ClickZoomOutBtn, 0, 0);
163
a0e7ad5425d4 14.02.13
Ritor1
parents: 151
diff changeset
935 break;
0
Ritor1
parents:
diff changeset
936 case INPUT_ZoomOut:
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1009
diff changeset
937 pMessageQueue_50C9E8->AddMessage(UIMSG_ClickZoomInBtn, 0, 0);
0
Ritor1
parents:
diff changeset
938 break;
Ritor1
parents:
diff changeset
939 case INPUT_AlwaysRun:
Ritor1
parents:
diff changeset
940 bAlwaysRun = bAlwaysRun == 0;
Ritor1
parents:
diff changeset
941 break;
17
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
942 default:
fe0d9a98213f 17.01.13 (fix Hint error)
Ritor1
parents: 11
diff changeset
943 break;
0
Ritor1
parents:
diff changeset
944 }
Ritor1
parents:
diff changeset
945 }
Ritor1
parents:
diff changeset
946 }
Ritor1
parents:
diff changeset
947 }
Ritor1
parents:
diff changeset
948 }