diff mm7_3.cpp @ 860:8fc2f035abc0

* AI function renames * more PID replaces
author zipi
date Sun, 31 Mar 2013 12:39:29 +0100
parents e4bd2a0bf08b
children fea81e031484
line wrap: on
line diff
--- a/mm7_3.cpp	Sun Mar 31 12:01:31 2013 +0100
+++ b/mm7_3.cpp	Sun Mar 31 12:39:29 2013 +0100
@@ -1114,7 +1114,7 @@
       v30 = WorldPosToGridCellX(v0->vPosition.x);
       _46E26D_collide_against_sprites(v30, v29);
       _46EF01_collision_chech_player(0);
-      _46ED8A_collide_against_sprite_objects(8 * v75 | OBJECT_Actor);
+      _46ED8A_collide_against_sprite_objects(PID(v75,OBJECT_Actor));
       v31 = 0;
       for ( i = 0; v31 < ai_arrays_size; ++v31 )
       {
@@ -1178,7 +1178,7 @@
             {
               if ( v71 == 0 )
 			  {
-				  Actor::_402968(v75, v38, 0, (AIDirection *)0);
+				  Actor::Flee(v75, v38, 0, (AIDirection *)0);
 			  }
 			  else
 			  {
@@ -1191,7 +1191,7 @@
 			}
 			else if ( pActors[v39].pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly )
             {
-              Actor::_402968(v75, v38, 0, (AIDirection *)0);
+              Actor::Flee(v75, v38, 0, (AIDirection *)0);
             }
 			else
 			{
@@ -1447,7 +1447,7 @@
           v10 = i;
           if ( !(v9 & 0x40) )
             goto LABEL_35;
-          _46BFFA_check_object_intercept(i, 8 * i | OBJECT_Item);
+          _46BFFA_check_object_intercept(i, PID(i,OBJECT_Item));
         }
     }
 LABEL_36:
@@ -2343,7 +2343,7 @@
           v6 = v108 & 0x3F;
           /*if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
           {
-            pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
+            pParty->field_6F4_packedid = PID(v108,OBJECT_BModel);
             v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
           }*/
 		  if ( BYTE3(v7[v6].uAttributes) & 4 )
@@ -11152,11 +11152,11 @@
               v15->uScreenSpaceX = a5;
               v15->uScreenSpaceY = a6;
               //v23 = 8 * uDecorationID;
-              //LOBYTE(v23) = 8 * uDecorationID | OBJECT_Decoration;
+              //LOBYTE(v23) = PID(uDecorationID,OBJECT_Decoration);
 
               //v15->sZValue = v22 + v23;
               v15->actual_z = HIWORD(x);
-              v15->object_pid = 8 * uDecorationID | OBJECT_Decoration;
+              v15->object_pid = PID(uDecorationID,OBJECT_Decoration);
 
               v15->uTintColor = 0;
               v15->pSpriteFrame = v12;
@@ -11309,12 +11309,12 @@
               v3->uTintColor = 0;
               v3->uScreenSpaceY = v22;
               //v23 = 8 * i;
-              //LOBYTE(v23) = 8 * i | OBJECT_Item;
+              //LOBYTE(v23) = PID(i,OBJECT_Item);
               v3->pSpriteFrame = v24;
               //v12 = (p->uAttributes & 0x20) == 0;
               //v3->sZValue = v21 + v23;
               v3->actual_z = HIWORD(x);
-              v3->object_pid = 8 * i | OBJECT_Item;
+              v3->object_pid = PID(i,OBJECT_Item);
               if (p->uAttributes & 0x20)
               {
                 if ( !pRenderer->pRenderD3D )
@@ -15388,8 +15388,8 @@
 				v21->pMonsterInfo.uRecoveryTime = 0;
 			if ( !(v21->uAttributes & 0x8000) )
 				v21->uAttributes |= 0x8000;
-			a1 = 8 * actor_id | OBJECT_Actor;
-			v30 = Actor::GetDirectionInfo(8 * actor_id | OBJECT_Actor, target_pid, &a3, 0);
+			a1 = PID(actor_id,OBJECT_Actor);
+			v30 = Actor::GetDirectionInfo(PID(actor_id,OBJECT_Actor), target_pid, &a3, 0);
 			memcpy(&v75, v30, sizeof(v75));
 			memcpy(&pDir, &v75, sizeof(pDir));
 			uAIState = v21->uAIState; 
@@ -15429,24 +15429,24 @@
 				else if ( v21->uAIState == AttackingRanged1 )
 				{
 					v34 = v21->pMonsterInfo.uMissleAttack1Type;
-					Actor::_404874(actor_id, &pDir, v34, 0);
+					Actor::RangedAttack(actor_id, &pDir, v34, 0);
 				}
 				else if ( v21->uAIState == AttackingRanged2 )
 				{
 					v34 = v21->pMonsterInfo.uMissleAttack2Type;
-					Actor::_404874(actor_id, &pDir, v34, 1);
+					Actor::RangedAttack(actor_id, &pDir, v34, 1);
 				}
 				else if ( v21->uAIState == AttackingRanged3 )
 				{
 					v65 = v21->pMonsterInfo.uSpellSkillAndMastery1;
 					v33 = v21->pMonsterInfo.uSpell1ID;
-					Actor::_404AC7(actor_id, &pDir, v33, 2, v65);
+					Actor::SpellAttack(actor_id, &pDir, v33, 2, v65);
 				}
 				else if ( v21->uAIState == AttackingRanged4 )
 				{
 					v65 = v21->pMonsterInfo.uSpellSkillAndMastery2;
 					v33 = v21->pMonsterInfo.uSpell2ID;
-					Actor::_404AC7(actor_id, &pDir, v33, 3, v65);
+					Actor::SpellAttack(actor_id, &pDir, v33, 3, v65);
 				}
 			}
 
@@ -15492,7 +15492,7 @@
 				{
 					//peasents after attacked
 					//guard after attacked
-					Actor::_402968(actor_id, target_pid, 0, &pDir);
+					Actor::Flee(actor_id, target_pid, 0, &pDir);
 				}
 				continue;
 			}
@@ -15508,7 +15508,7 @@
 					}
 					else
 					{
-						Actor::_402968(actor_id, target_pid, 0, &pDir);
+						Actor::Flee(actor_id, target_pid, 0, &pDir);
 						continue;
 					}
 						
@@ -15525,7 +15525,7 @@
 						v42 = (double)(signed int)v84;
 						if ( v43 > v42 && (signed int)v36 < 10240 )
 						{
-							Actor::_402968(actor_id, target_pid, 0, &pDir);
+							Actor::Flee(actor_id, target_pid, 0, &pDir);
 							continue;
 						}
 					}
@@ -15564,7 +15564,7 @@
 									Actor::AI_Stand(actor_id, target_pid, v64, &pDir);
 									continue;
 								}
-								Actor::_402AD7(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
+								Actor::Pursue1(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
 							}
 						}
 						else
@@ -15583,7 +15583,7 @@
 									else
 									{
 										//monsters
-										Actor::_402686(actor_id, target_pid, 0, &pDir);
+										Actor::Pursue3(actor_id, target_pid, 0, &pDir);
 									}
 								}
 								else if ( v21->pMonsterInfo.uMovementType == 5 )
@@ -15598,7 +15598,7 @@
 									//monsters
 									//guard after player runs away
 									// follow player
-									Actor::_40281C(actor_id, target_pid, 0, &pDir, v70);
+									Actor::Pursue2(actor_id, target_pid, 0, &pDir, v70);
 								}
 							}
 							else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 )
@@ -15639,7 +15639,7 @@
 							else
 							{
 								v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
-								Actor::_402AD7(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
+								Actor::Pursue1(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
 							}
 						}
 						else
@@ -15657,7 +15657,7 @@
 									}
 									else
 									{
-										Actor::_402686(actor_id, target_pid, 256, &pDir);
+										Actor::Pursue3(actor_id, target_pid, 256, &pDir);
 									}
 								}
 								else if ( v21->pMonsterInfo.uMovementType == 5 )
@@ -15669,7 +15669,7 @@
 								else
 								{
 									v70 = (signed __int64)v48;
-									Actor::_40281C(actor_id, target_pid, 0, &pDir, v70);
+									Actor::Pursue2(actor_id, target_pid, 0, &pDir, v70);
 								}
 							}
 							else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 )
@@ -15731,7 +15731,7 @@
 						}
 						else
 						{
-							Actor::_402686(actor_id, target_pid, 256, &pDir);
+							Actor::Pursue3(actor_id, target_pid, 256, &pDir);
 						}
 					}
 					else if ( v21->pMonsterInfo.uMovementType == 5 )
@@ -15743,7 +15743,7 @@
 					else
 					{
 						v70 = (signed __int64)v56;
-						Actor::_40281C(actor_id, target_pid, 0, &pDir, v70);
+						Actor::Pursue2(actor_id, target_pid, 0, &pDir, v70);
 					}
 				}
 				else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 )
@@ -15767,7 +15767,7 @@
 				}
 				else
 				{
-					Actor::_402AD7(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
+					Actor::Pursue1(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
 				}
 			}
 			else
@@ -16025,7 +16025,7 @@
   {
     if ( v40->CanAct() )
     {
-      *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
+      *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = PID(v3,OBJECT_Player);
       v1->pQueue[v1->uActorQueueSize].field_C = 2;
       v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
       pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
@@ -16055,8 +16055,8 @@
             v8 = ai_near_actors_targets_pid[v5];
             LOBYTE(v7) = v7 | 0x80;
             v6->uAttributes = v7;
-            v33 = 8 * v5 | OBJECT_Actor;
-            memcpy(&v31, Actor::GetDirectionInfo(8 * v5 | OBJECT_Actor, v8, &a3, 0), sizeof(v31));
+            v33 = PID(v5,OBJECT_Actor);
+            memcpy(&v31, Actor::GetDirectionInfo(PID(v5,OBJECT_Actor), v8, &a3, 0), sizeof(v31));
             memcpy(&v30, &v31, sizeof(v30));
             Actor::AI_StandOrBored(v37, 4, 32, &v30);
             *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;