comparison mm7_2.cpp @ 1119:aa706cde7fda

* dark spells working * found aoe apply buff function * round() moved * some global variable fixes * DecalBuilder::ApplyDecals_OutdoorFace() clean
author zipi
date Wed, 29 May 2013 22:51:00 +0100
parents 39eaa6b00141
children dd1cb6a2dba6
comparison
equal deleted inserted replaced
1118:ca415f6bac1c 1119:aa706cde7fda
11066 UpdateActors_ODM(); 11066 UpdateActors_ODM();
11067 check_event_triggers(); 11067 check_event_triggers();
11068 } 11068 }
11069 11069
11070 //----- (0046BEF1) -------------------------------------------------------- 11070 //----- (0046BEF1) --------------------------------------------------------
11071 void SpriteObject::_46BEF1_apply_spells() 11071 void SpriteObject::_46BEF1_apply_spells_aoe()
11072 { 11072 {
11073 SpriteObject *v1; // edi@1 11073 SpriteObject *v1; // edi@1
11074 Actor *v2; // esi@2 11074 Actor *v2; // esi@2
11075 __int16 v3; // fps@4 11075 __int16 v3; // fps@4
11076 unsigned __int8 v4; // c0@4 11076 unsigned __int8 v4; // c0@4
11077 unsigned __int8 v5; // c3@4 11077 unsigned __int8 v5; // c3@4
11078 signed int v6; // [sp+8h] [bp-4h]@1 11078 signed int v6; // [sp+8h] [bp-4h]@1
11079 11079
11080 int v7,v8,v9,v10,v11;
11081
11080 v6 = 0; 11082 v6 = 0;
11081 v1 = this; 11083 v1 = this;
11082 if ( (signed int)uNumActors > 0 ) 11084 if ( (signed int)uNumActors > 0 )
11083 { 11085 {
11084 v2 = pActors;//[0].vPosition.y; 11086 v2 = pActors;//[0].vPosition.y;
11085 do 11087 do
11086 { 11088 {
11087 if ( v2->CanAct() ) 11089 if ( v2->CanAct() )
11088 { 11090 {
11089 //UNDEF(v3); 11091 //UNDEF(v3);
11090 if ( !(v4 | v5) ) 11092 //.text:0046BF26 movsx eax, word ptr [esi-2]
11093 //.text:0046BF2A sub eax, [edi+4]
11094 //.text:0046BF31 mov [ebp+var_8], eax
11095 //.text:0046BF37 fild [ebp+var_8]
11096 // v7 pushed to stack
11097 v7 = v2->vPosition.x - this->vPosition.x;
11098
11099 //.text:0046BF2D movsx ecx, word ptr [esi+2]
11100 v8 = v2->vPosition.z;
11101
11102 //.text:0046BF34 movsx eax, word ptr [esi]
11103 //.text:0046BF3A sub eax, [edi+8]
11104 //.text:0046BF3D mov [ebp+var_8], eax
11105 //.text:0046BF44 fild [ebp+var_8]
11106 // v9 pushed to stack
11107 v9 = v2->vPosition.y - this->vPosition.y;
11108
11109 //.text:0046BF40 movsx eax, word ptr [esi-6]
11110 //.text:0046BF47 sar eax, 1
11111 //.text:0046BF49 add eax, ecx
11112 //.text:0046BF4B sub eax, [edi+0Ch]
11113 //.text:0046BF4E mov [ebp+var_8], eax
11114 //.text:0046BF51 fild [ebp+var_8]
11115 //.text:0046BF58 fld st
11116 // v10 pushed to stack, two times
11117 v10 = v2->uActorHeight / 2 + v8 - this->vVelocity.y;
11118
11119 //.text:0046BF54 movsx eax, word ptr [esi-8]
11120 //.text:0046BF5A add eax, 100h
11121 //.text:0046BF63 mov ecx, eax
11122 v11 = this->vVelocity.x;
11123
11124 //.text:0046BF5F fmul st, st(1)
11125 // stack: v10*v10, v10, v9, v7
11126 //.text:0046BF61 fld st(2)
11127 // stack: v7, v10*v10, v10, v9, v7
11128
11129
11130 //.text:0046BF65 fmul st, st(3)
11131 // stack: v7*v9, v10*v10, v10, v9, v7
11132
11133 //.text:0046BF67 imul ecx, eax
11134 v11 = v11 * v11;
11135
11136 //.text:0046BF6A faddp st(1), st
11137 // stack: v10*v10+v7*v9, v10, v9, v7
11138 //.text:0046BF6C fld st(3)
11139 // stack: v7, v10*v10+v7*v9, v10, v9, v7
11140 //.text:0046BF6E fmul st, st(4)
11141 // stack: v7*v7, v10*v10+v7*v9, v10, v9, v7
11142 //.text:0046BF70 faddp st(1), st
11143 // stack: v10*v10+v7*v9+v7*v7, v10, v9, v7
11144
11145 //.text:0046BF72 mov [ebp+var_8], ecx
11146 //.text:0046BF75 fild [ebp+var_8]
11147 // v11 pushed to stack
11148
11149 //.text:0046BF78 fcompp
11150 // if ( v11 > v10*v10+v7*v9+v7*v7 )
11151 // stack: v10, v9, v7
11152
11153 //.text:0046BF7A fstp st
11154 // stack: v9, v7
11155
11156 //.text:0046BF7C fnstsw ax
11157 //.text:0046BF7E fstp st
11158 // stack: v7
11159
11160 //.text:0046BF80 test ah, 41h
11161 //.text:0046BF83 fstp st
11162 //.text:0046BF85 jnz short loc_46BFDD
11163
11164 if ( v11 >= v10*v10+v7*v9+v7*v7 )
11091 { 11165 {
11092 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) ) 11166 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) )
11093 { 11167 {
11094 v2->pActorBuffs[v1->spell_id].Apply( 11168 v2->pActorBuffs[v1->spell_id].Apply(
11095 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335), 11169 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335),
11346 v138 = 1; 11420 v138 = 1;
11347 if ( v151 != OBJECT_Actor) 11421 if ( v151 != OBJECT_Actor)
11348 { 11422 {
11349 if ( v6 != 9030 || v2->spell_skill != 4 ) 11423 if ( v6 != 9030 || v2->spell_skill != 4 )
11350 goto LABEL_246; 11424 goto LABEL_246;
11351 v2->_46BEF1_apply_spells(); 11425 v2->_46BEF1_apply_spells_aoe();
11352 LABEL_233: 11426 LABEL_233:
11353 if ( !v138 ) 11427 if ( !v138 )
11354 { 11428 {
11355 v109 = pObjectList->uNumObjects; 11429 v109 = pObjectList->uNumObjects;
11356 ++v2->uType; 11430 ++v2->uType;
11455 0); 11529 0);
11456 } 11530 }
11457 } 11531 }
11458 else 11532 else
11459 { 11533 {
11460 v2->_46BEF1_apply_spells(); 11534 v2->_46BEF1_apply_spells_aoe();
11461 } 11535 }
11462 v2->spell_level = 0; 11536 v2->spell_level = 0;
11463 v2->spell_skill = 0; 11537 v2->spell_skill = 0;
11464 v2->spell_id = 0; 11538 v2->spell_id = 0;
11465 goto LABEL_233; 11539 goto LABEL_233;