Mercurial > mm7
comparison mm7_6.cpp @ 2242:c4f87fb3cfee
for NextTurn()
author | Ritor1 |
---|---|
date | Mon, 24 Feb 2014 16:19:01 +0600 |
parents | 34035536bbf5 |
children | 8817c398b792 |
comparison
equal
deleted
inserted
replaced
2235:6ab7d7c112bb | 2242:c4f87fb3cfee |
---|---|
636 { | 636 { |
637 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i) | 637 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i) |
638 { | 638 { |
639 char icon_name[32]; | 639 char icon_name[32]; |
640 sprintf(icon_name, "turn%u", i); | 640 sprintf(icon_name, "turn%u", i); |
641 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon("turn0"); | 641 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name); |
642 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]); | 642 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]); |
643 } | 643 } |
644 | 644 |
645 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | 645 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); |
646 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | 646 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); |
912 else | 912 else |
913 partyAction = PARTY_WalkForward; | 913 partyAction = PARTY_WalkForward; |
914 pPartyActionQueue->Add(partyAction); | 914 pPartyActionQueue->Add(partyAction); |
915 break; | 915 break; |
916 } | 916 } |
917 if (pTurnEngine->turn_stage != 1 && pTurnEngine->turn_stage != 2 && pTurnEngine->uActionPointsLeft > 0 ) | 917 if (pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 ) |
918 { | 918 { |
919 pTurnEngine->uActionPointsLeft -= 26; | 919 pTurnEngine->uActionPointsLeft -= 26; |
920 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | 920 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
921 partyAction = PARTY_RunForward; | 921 partyAction = PARTY_RunForward; |
922 else | 922 else |
935 else | 935 else |
936 partyAction = PARTY_WalkBackward; | 936 partyAction = PARTY_WalkBackward; |
937 pPartyActionQueue->Add(partyAction); | 937 pPartyActionQueue->Add(partyAction); |
938 break; | 938 break; |
939 } | 939 } |
940 if ( pTurnEngine->turn_stage != 1 && pTurnEngine->turn_stage != 2 && pTurnEngine->uActionPointsLeft > 0 ) | 940 if ( pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 ) |
941 { | 941 { |
942 pTurnEngine->uActionPointsLeft -= 26; | 942 pTurnEngine->uActionPointsLeft -= 26; |
943 if ( pParty->uFlags2 & 2 ) | 943 if ( pParty->uFlags2 & 2 ) |
944 partyAction = PARTY_RunBackward; | 944 partyAction = PARTY_RunBackward; |
945 else | 945 else |
955 { | 955 { |
956 partyAction = PARTY_StrafeLeft; | 956 partyAction = PARTY_StrafeLeft; |
957 pPartyActionQueue->Add(partyAction); | 957 pPartyActionQueue->Add(partyAction); |
958 break; | 958 break; |
959 } | 959 } |
960 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | 960 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
961 break; | 961 break; |
962 pTurnEngine->uActionPointsLeft -= 26; | 962 pTurnEngine->uActionPointsLeft -= 26; |
963 partyAction = PARTY_StrafeLeft; | 963 partyAction = PARTY_StrafeLeft; |
964 pPartyActionQueue->Add(partyAction); | 964 pPartyActionQueue->Add(partyAction); |
965 break; | 965 break; |
970 { | 970 { |
971 partyAction = PARTY_StrafeRight; | 971 partyAction = PARTY_StrafeRight; |
972 pPartyActionQueue->Add(partyAction); | 972 pPartyActionQueue->Add(partyAction); |
973 break; | 973 break; |
974 } | 974 } |
975 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | 975 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
976 break; | 976 break; |
977 pTurnEngine->uActionPointsLeft -= 26; | 977 pTurnEngine->uActionPointsLeft -= 26; |
978 partyAction = PARTY_StrafeRight; | 978 partyAction = PARTY_StrafeRight; |
979 pPartyActionQueue->Add(partyAction); | 979 pPartyActionQueue->Add(partyAction); |
980 break; | 980 break; |
983 break; | 983 break; |
984 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | 984 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing |
985 { | 985 { |
986 if (pParty->bTurnBasedModeOn) | 986 if (pParty->bTurnBasedModeOn) |
987 { | 987 { |
988 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | 988 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
989 break; | 989 break; |
990 pTurnEngine->uActionPointsLeft -= 26; | 990 pTurnEngine->uActionPointsLeft -= 26; |
991 } | 991 } |
992 partyAction = PARTY_StrafeLeft; | 992 partyAction = PARTY_StrafeLeft; |
993 } | 993 } |
1007 break; | 1007 break; |
1008 if ( GetAsyncKeyState(17) ) // strafing | 1008 if ( GetAsyncKeyState(17) ) // strafing |
1009 { | 1009 { |
1010 if (pParty->bTurnBasedModeOn) | 1010 if (pParty->bTurnBasedModeOn) |
1011 { | 1011 { |
1012 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) | 1012 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
1013 break; | 1013 break; |
1014 pTurnEngine->uActionPointsLeft -= 26; | 1014 pTurnEngine->uActionPointsLeft -= 26; |
1015 } | 1015 } |
1016 partyAction = PARTY_StrafeRight; | 1016 partyAction = PARTY_StrafeRight; |
1017 } | 1017 } |
1040 } | 1040 } |
1041 break; | 1041 break; |
1042 case INPUT_Pass: | 1042 case INPUT_Pass: |
1043 if ( pCurrentScreen ) | 1043 if ( pCurrentScreen ) |
1044 break; | 1044 break; |
1045 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == 3) | 1045 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT) |
1046 { | 1046 { |
1047 pTurnEngine->field_18 |= TE_FLAG_8; | 1047 pTurnEngine->field_18 |= TE_FLAG_8; |
1048 break; | 1048 break; |
1049 } | 1049 } |
1050 if ( uActiveCharacter ) | 1050 if ( uActiveCharacter ) |
1061 case INPUT_Combat://if press ENTER | 1061 case INPUT_Combat://if press ENTER |
1062 if (pCurrentScreen == SCREEN_GAME) | 1062 if (pCurrentScreen == SCREEN_GAME) |
1063 { | 1063 { |
1064 if (pParty->bTurnBasedModeOn) | 1064 if (pParty->bTurnBasedModeOn) |
1065 { | 1065 { |
1066 if (pTurnEngine->turn_stage == 3 || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) | 1066 if (pTurnEngine->turn_stage == TE_MOVEMENT || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
1067 { | 1067 { |
1068 pParty->bTurnBasedModeOn = 0; | 1068 pParty->bTurnBasedModeOn = 0; |
1069 pTurnEngine->End(true); | 1069 pTurnEngine->End(true); |
1070 } | 1070 } |
1071 } | 1071 } |
1077 } | 1077 } |
1078 break; | 1078 break; |
1079 case INPUT_CastReady: | 1079 case INPUT_CastReady: |
1080 if (pCurrentScreen != SCREEN_GAME) | 1080 if (pCurrentScreen != SCREEN_GAME) |
1081 break; | 1081 break; |
1082 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == 3) | 1082 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT) |
1083 { | 1083 { |
1084 pTurnEngine->field_18 |= TE_FLAG_8; | 1084 pTurnEngine->field_18 |= TE_FLAG_8; |
1085 break; | 1085 break; |
1086 } | 1086 } |
1087 if ( !uActiveCharacter ) | 1087 if ( !uActiveCharacter ) |
1103 pMessageQueue_50C9E8->AddMessage(UIMSG_CastQuickSpell, 0, 0); | 1103 pMessageQueue_50C9E8->AddMessage(UIMSG_CastQuickSpell, 0, 0); |
1104 break; | 1104 break; |
1105 case INPUT_Attack: | 1105 case INPUT_Attack: |
1106 if (pCurrentScreen != SCREEN_GAME) | 1106 if (pCurrentScreen != SCREEN_GAME) |
1107 break; | 1107 break; |
1108 if (pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3) | 1108 if (pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT) |
1109 { | 1109 { |
1110 pTurnEngine->field_18 |= TE_FLAG_8; | 1110 pTurnEngine->field_18 |= TE_FLAG_8; |
1111 break; | 1111 break; |
1112 } | 1112 } |
1113 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | 1113 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |