Mercurial > mm7
comparison Items.cpp @ 2464:104fdbea0386
cleaning project part 2
author | zipi |
---|---|
date | Sun, 17 Aug 2014 17:49:34 +0100 |
parents | f4af3b203f65 |
children | b054ea5daf45 |
comparison
equal
deleted
inserted
replaced
2463:0f17a30149ec | 2464:104fdbea0386 |
---|---|
5 #define _CRT_SECURE_NO_WARNINGS | 5 #define _CRT_SECURE_NO_WARNINGS |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string> | 7 #include <string> |
8 #include "UI\UIHouses.h" | 8 #include "UI\UIHouses.h" |
9 #include "GUIButton.h" | 9 #include "GUIButton.h" |
10 #include "mm7_unsorted_subs.h" | 10 |
11 #include "ErrorHandling.h" | 11 #include "ErrorHandling.h" |
12 | 12 |
13 #include "Items.h" | 13 #include "Items.h" |
14 #include "MapInfo.h" | 14 #include "MapInfo.h" |
15 #include "GUIWindow.h" | 15 #include "GUIWindow.h" |
21 #include "FactionTable.h" | 21 #include "FactionTable.h" |
22 #include "StorylineTextTable.h" | 22 #include "StorylineTextTable.h" |
23 #include "texts.h" | 23 #include "texts.h" |
24 #include "mm7_data.h" | 24 #include "mm7_data.h" |
25 #include "OurMath.h" | 25 #include "OurMath.h" |
26 | |
27 #include "Game.h" | |
26 | 28 |
27 | 29 |
28 struct ITEM_VARIATION | 30 struct ITEM_VARIATION |
29 { | 31 { |
30 unsigned __int16 treasure_level; | 32 unsigned __int16 treasure_level; |
2249 break; | 2251 break; |
2250 } | 2252 } |
2251 } | 2253 } |
2252 return test; | 2254 return test; |
2253 } | 2255 } |
2256 | |
2257 //----- (00493F79) -------------------------------------------------------- | |
2258 void init_summoned_item(stru351_summoned_item *_this, __int64 duration) | |
2259 { | |
2260 signed __int64 v2; // ST2C_8@1 | |
2261 signed __int64 v3; // qax@1 | |
2262 //signed __int64 v4; // ST1C_8@1 | |
2263 unsigned __int64 v5; // qax@1 | |
2264 unsigned int v6; // ebx@1 | |
2265 | |
2266 v2 = (signed __int64)((double)duration * 0.234375); | |
2267 v3 = v2 / 60 / 60; | |
2268 //v4 = v3; | |
2269 v5 = (unsigned int)v3 / 0x18; | |
2270 v6 = (unsigned int)(v5 / 7) >> 2; | |
2271 _this->field_0_expire_second = v2 % 60; | |
2272 _this->field_4_expire_minute = v2 / 60 % 60; | |
2273 _this->field_8_expire_hour = v3 % 24; | |
2274 _this->field_10_expire_week = v5 / 7 & 3; | |
2275 _this->field_C_expire_day = (unsigned int)v5 % 0x1C; | |
2276 _this->field_14_exprie_month = v6 % 0xC; | |
2277 _this->field_18_expire_year = v6 / 0xC + game_starting_year; | |
2278 } |