comparison Actor.cpp @ 2153:d28d3c006077

Some Render decoupling.
author Nomad
date Thu, 09 Jan 2014 02:34:20 +0200
parents e99081a3a66a
children 9bd7522cdbbb
comparison
equal deleted inserted replaced
2152:d44b7775fc06 2153:d28d3c006077
1 #ifdef _MSC_VER
2 #define _CRT_SECURE_NO_WARNINGS
3 #endif
4
5 #include "mm7_data.h" 1 #include "mm7_data.h"
6 #include "DecalBuilder.h" 2 #include "DecalBuilder.h"
7 3
8 #include "Sprites.h" 4 #include "Sprites.h"
9 #include "stru6.h" 5 #include "stru6.h"
44 40
45 stru319 stru_50C198; // idb 41 stru319 stru_50C198; // idb
46 42
47 43
48 std::array<uint, 5> dword_4DF380_hostilityRanges = {0,1024,2560,5120,10240}; 44 std::array<uint, 5> dword_4DF380_hostilityRanges = {0,1024,2560,5120,10240};
45
46
47
48
49 //----- (0042FB5C) --------------------------------------------------------
50 // True if monster should play attack animation when casting this spell.
51 bool ShouldMonsterPlayAttackAnim(signed int spell_id)
52 {
53 switch (spell_id)
54 {
55 case SPELL_FIRE_HASTE:
56 case SPELL_AIR_SHIELD:
57 case SPELL_EARTH_STONESKIN:
58 case SPELL_SPIRIT_BLESS:
59 case SPELL_SPIRIT_FATE:
60 case SPELL_SPIRIT_HEROISM:
61 case SPELL_BODY_HAMMERHANDS:
62 case SPELL_BODY_POWER_CURE:
63 case SPELL_LIGHT_DISPEL_MAGIC:
64 case SPELL_LIGHT_DAY_OF_PROTECTION:
65 case SPELL_LIGHT_HOUR_OF_POWER:
66 case SPELL_DARK_PAIN_REFLECTION:
67 return false;
68 }
69
70 return true;
71 }
49 72
50 73
51 //----- (0041AF52) -------------------------------------------------------- 74 //----- (0041AF52) --------------------------------------------------------
52 void Actor::DrawHealthBar(Actor *actor, GUIWindow *window) 75 void Actor::DrawHealthBar(Actor *actor, GUIWindow *window)
53 { 76 {
1582 else 1605 else
1583 v3->pMonsterInfo.uRecoveryTime = v3->uCurrentActionLength + (int)(flt_6BE3A8_debug_recmod2 * pDira * 2.133333333333333); 1606 v3->pMonsterInfo.uRecoveryTime = v3->uCurrentActionLength + (int)(flt_6BE3A8_debug_recmod2 * pDira * 2.133333333333333);
1584 v3->vVelocity.z = 0; 1607 v3->vVelocity.z = 0;
1585 v3->vVelocity.y = 0; 1608 v3->vVelocity.y = 0;
1586 v3->vVelocity.x = 0; 1609 v3->vVelocity.x = 0;
1587 if ( _42FB5C_check_spell(v3->pMonsterInfo.uSpell2ID) ) 1610 if ( ShouldMonsterPlayAttackAnim(v3->pMonsterInfo.uSpell2ID) )
1588 { 1611 {
1589 v3->uCurrentActionLength = 64; 1612 v3->uCurrentActionLength = 64;
1590 v3->uCurrentActionTime = 0; 1613 v3->uCurrentActionTime = 0;
1591 v3->uAIState = Fidgeting; 1614 v3->uAIState = Fidgeting;
1592 v3->UpdateAnimation(); 1615 v3->UpdateAnimation();
1667 v3->pMonsterInfo.uRecoveryTime = v3->uCurrentActionLength + (int)(flt_6BE3A8_debug_recmod2 * pDira * 2.133333333333333); 1690 v3->pMonsterInfo.uRecoveryTime = v3->uCurrentActionLength + (int)(flt_6BE3A8_debug_recmod2 * pDira * 2.133333333333333);
1668 v16 = v3->pMonsterInfo.uSpell1ID; 1691 v16 = v3->pMonsterInfo.uSpell1ID;
1669 v3->vVelocity.z = 0; 1692 v3->vVelocity.z = 0;
1670 v3->vVelocity.y = 0; 1693 v3->vVelocity.y = 0;
1671 v3->vVelocity.x = 0; 1694 v3->vVelocity.x = 0;
1672 if ( _42FB5C_check_spell(v3->pMonsterInfo.uSpell1ID) ) 1695 if ( ShouldMonsterPlayAttackAnim(v3->pMonsterInfo.uSpell1ID) )
1673 { 1696 {
1674 v3->uCurrentActionLength = 64; 1697 v3->uCurrentActionLength = 64;
1675 v3->uCurrentActionTime = 0; 1698 v3->uCurrentActionTime = 0;
1676 v3->uAIState = Fidgeting; 1699 v3->uAIState = Fidgeting;
1677 v3->UpdateAnimation(); 1700 v3->UpdateAnimation();