comparison Actor.cpp @ 1974:0f62a2b8bd0a

stru319::_4273BB moved to Actor::_4273BB, renamed to _4273BB_DoesHitOtherActor
author Grumpy7
date Sat, 26 Oct 2013 00:41:13 -0700
parents 3ef25d06b9b0
children c1c74df0a33e
comparison
equal deleted inserted replaced
1973:f708aaeb635b 1974:0f62a2b8bd0a
4371 return ABILITY_SPELL2; 4371 return ABILITY_SPELL2;
4372 if (this->pMonsterInfo.uAttack2Chance && rand() % 100 < this->pMonsterInfo.uAttack2Chance) 4372 if (this->pMonsterInfo.uAttack2Chance && rand() % 100 < this->pMonsterInfo.uAttack2Chance)
4373 return ABILITY_ATTACK2; 4373 return ABILITY_ATTACK2;
4374 return ABILITY_ATTACK1; 4374 return ABILITY_ATTACK1;
4375 } 4375 }
4376
4377
4378
4379 //----- (004273BB) --------------------------------------------------------
4380 bool Actor::_4273BB_DoesHitOtherActor( Actor *defender, int a3, int a4 )
4381 {
4382 signed int v6; // ebx@1
4383 signed int v7; // esi@1
4384 int armorSum; // ebx@10
4385 signed int a2a; // [sp+18h] [bp+Ch]@1
4386
4387 v6 = defender->pMonsterInfo.uAC;
4388 v7 = 0;
4389 a2a = 0;
4390 if ( defender->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 )
4391 v6 /= 2;
4392 if ( defender->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
4393 v7 = defender->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
4394 if ( defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v7 )
4395 v7 = defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower;
4396 armorSum = v7 + v6;
4397 if ( this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 )
4398 a2a = this->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower;
4399 if ( this->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && this->pActorBuffs[ACTOR_BUFF_BLESS].uPower > a2a )
4400 a2a = this->pActorBuffs[ACTOR_BUFF_BLESS].uPower;
4401 if ( this->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 )
4402 {
4403 a2a += this->pActorBuffs[ACTOR_BUFF_FATE].uPower;
4404 this->pActorBuffs[ACTOR_BUFF_FATE].Reset();
4405 }
4406 return rand() % (armorSum + 2 * this->pMonsterInfo.uLevel + 10) + a2a + 1 > armorSum + 5;
4407 }