Mercurial > mm7
comparison mm7_6.cpp @ 1972:3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
author | Grumpy7 |
---|---|
date | Sat, 26 Oct 2013 00:18:52 -0700 |
parents | e45c277da9f1 |
children | f708aaeb635b |
comparison
equal
deleted
inserted
replaced
1971:e45c277da9f1 | 1972:3ef25d06b9b0 |
---|---|
40 | 40 |
41 #include "mm7_data.h" | 41 #include "mm7_data.h" |
42 | 42 |
43 | 43 |
44 | 44 |
45 //----- (0042704B) -------------------------------------------------------- | |
46 int stru319::special_ability_use_check( struct Actor *pActor, int a2 ) | |
47 { | |
48 stru319 *v3; // edi@1 | |
49 signed int v4; // ebx@5 | |
50 signed int v5; // edi@5 | |
51 | |
52 v3 = this; | |
53 if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 | |
54 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u | |
55 && rand() % 100 < 5 ) | |
56 pActor->SummonMinion(a2); | |
57 v4 = pActor->_427102_IsOkToCastSpell(pActor->pMonsterInfo.uSpell1ID); | |
58 v5 = pActor->_427102_IsOkToCastSpell(pActor->pMonsterInfo.uSpell2ID); | |
59 if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) | |
60 return 2; | |
61 if ( v5 && pActor->pMonsterInfo.uSpell2UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell2UseChance ) | |
62 return 3; | |
63 return pActor->pMonsterInfo.uAttack2Chance && rand() % 100 < pActor->pMonsterInfo.uAttack2Chance?1:0; | |
64 } | |
65 | 45 |
66 | 46 |
67 //----- (004272F5) -------------------------------------------------------- | 47 //----- (004272F5) -------------------------------------------------------- |
68 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | 48 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) |
69 { | 49 { |