1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . IO ;
3
4
using System . Linq ;
4
5
using System . Text ;
5
6
using XbTool . Bdat ;
@@ -68,7 +69,7 @@ public static void ResolveItemRef(BdatStringValue value)
68
69
break ;
69
70
case BdatFieldType . Item :
70
71
if ( tables . Game == Game . XB2 ) ApplyRef ( BdatStringTools . GetItemTableXb2 ( refId ) ) ;
71
- if ( tables . Game == Game . XB1 )
72
+ if ( tables . Game == Game . XB1 || tables . Game == Game . XB1DE )
72
73
{
73
74
var itemType = ( ItemTypeXb1 ) int . Parse ( item [ field . RefField ] . ValueString ) ;
74
75
ApplyRef ( BdatStringTools . GetItemTableXb1 ( itemType ) ) ;
@@ -86,6 +87,11 @@ public static void ResolveItemRef(BdatStringValue value)
86
87
case BdatFieldType . EventSetup :
87
88
ApplyRef ( BdatStringTools . GetEventSetupTable ( refId ) ) ;
88
89
break ;
90
+ case BdatFieldType . Quest when tables . Game == Game . XB1DE :
91
+ ApplyRef ( BdatStringTools . GetQuestTableXb1 ( refId ) ) ;
92
+ break ;
93
+ case BdatFieldType . Quest :
94
+ throw new InvalidDataException ( ) ;
89
95
case BdatFieldType . QuestFlag :
90
96
ApplyRef ( BdatStringTools . GetQuestListTable ( refId ) ) ;
91
97
break ;
@@ -95,20 +101,25 @@ public static void ResolveItemRef(BdatStringValue value)
95
101
case BdatFieldType . Condition :
96
102
if ( tables . Game == Game . XB2 )
97
103
{
98
- var conditionType = ( ConditionType ) int . Parse ( item [ field . RefField ] . ValueString ) ;
104
+ var conditionType = ( ConditionType ) int . Parse ( item [ field . RefField ] . ValueString ) ;
99
105
ApplyRef ( BdatStringTools . GetConditionTable ( conditionType ) ) ;
100
106
}
101
107
if ( tables . Game == Game . XBX )
102
108
{
103
- var conditionType = ( ConditionTypeXbx ) int . Parse ( item [ field . RefField ] . ValueString ) ;
109
+ var conditionType = ( ConditionTypeXbx ) int . Parse ( item [ field . RefField ] . ValueString ) ;
104
110
ApplyRef ( BdatStringTools . GetConditionTableXbx ( conditionType ) ) ;
105
111
}
106
112
107
113
break ;
108
- case BdatFieldType . Task :
114
+ case BdatFieldType . Task when tables . Game == Game . XB2 :
109
115
var taskType = ( TaskType ) int . Parse ( item [ field . RefField ] . ValueString ) ;
110
116
ApplyRef ( BdatStringTools . GetTaskTable ( taskType ) ) ;
111
117
break ;
118
+ case BdatFieldType . Task when tables . Game == Game . XB1 || tables . Game == Game . XB1DE :
119
+ var taskTypeXb1 = ( TaskTypeXb1 ) int . Parse ( item [ field . RefField ] . ValueString ) ;
120
+ int itemId = int . Parse ( item [ field . Field ] . ValueString ) ;
121
+ ApplyRef ( BdatStringTools . GetTaskTableXb1 ( taskTypeXb1 , itemId ) ) ;
122
+ break ;
112
123
case BdatFieldType . ShopTable :
113
124
var shopType = ( ShopType ) int . Parse ( item [ field . RefField ] . ValueString ) ;
114
125
ApplyRef ( BdatStringTools . GetShopTable ( shopType ) ) ;
@@ -117,8 +128,8 @@ public static void ResolveItemRef(BdatStringValue value)
117
128
ApplyRef ( BdatStringTools . GetCharacterTable ( refId ) ) ;
118
129
break ;
119
130
case BdatFieldType . Enhance :
120
- if ( tables . Game == Game . XB2 ) value . Display = BdatStringTools . GetEnhanceCaption ( value ) ;
121
- if ( tables . Game == Game . XBX ) value . Display = BdatStringTools . GetEnhanceCaptionXbx ( value ) ;
131
+ if ( tables . Game == Game . XB2 ) value . Display = BdatStringTools . GetEnhanceCaption ( value ) ;
132
+ if ( tables . Game == Game . XBX ) value . Display = BdatStringTools . GetEnhanceCaptionXbx ( value ) ;
122
133
break ;
123
134
case BdatFieldType . WeatherIdMap :
124
135
value . Display = BdatStringTools . PrintWeatherIdMap ( refId , 13 , tables ) ;
@@ -149,7 +160,7 @@ public static void ResolveItemRef(BdatStringValue value)
149
160
case BdatFieldType . Place :
150
161
var placeCat = ( PlaceCategory ) int . Parse ( item [ field . RefField ] . ValueString ) ;
151
162
string placeTable = GimmickData . GetPlaceTable ( placeCat , refId ) ;
152
- if ( placeTable != null ) ApplyRef ( placeTable ) ;
163
+ if ( placeTable != null ) ApplyRef ( placeTable ) ;
153
164
break ;
154
165
}
155
166
0 commit comments