@@ -50,47 +50,46 @@ public bool IsSkillAvailable(string sname)
5050 // 特殊能力付加&強化による修正
5151 if ( Unit != null )
5252 {
53- // TODO Impl IsSkillAvailable
54- //var u = Unit;
55- //if (u.CountCondition() == 0)
56- //{
57- // return false;
58- //}
59-
60- //if (u.CountPilot() == 0)
61- //{
62- // return false;
63- //}
64-
65- //if (!ReferenceEquals(this, u.MainPilot()) && !ReferenceEquals(this, u.Pilot(1)))
66- //{
67- // return false;
68- //}
69-
70- //if (u.IsConditionSatisfied(sname + "付加"))
71- //{
72- // return true;
73- //}
74- //else if (u.IsConditionSatisfied(sname + "付加2"))
75- //{
76- // return true;
77- //}
78-
79- //if (u.IsConditionSatisfied(sname + "強化"))
80- //{
81- // if (u.ConditionLevel(sname + "強化") > 0d)
82- // {
83- // return true;
84- // }
85- //}
86-
87- //if (u.IsConditionSatisfied("強化2"))
88- //{
89- // if (u.ConditionLevel("強化2") > 0d)
90- // {
91- // return true;
92- // }
93- //}
53+ var u = Unit ;
54+ if ( u . CountCondition ( ) == 0 )
55+ {
56+ return false ;
57+ }
58+
59+ if ( u . CountPilot ( ) == 0 )
60+ {
61+ return false ;
62+ }
63+
64+ if ( ! ReferenceEquals ( this , u . MainPilot ( ) ) && ! ReferenceEquals ( this , u . Pilots . First ( ) ) )
65+ {
66+ return false ;
67+ }
68+
69+ if ( u . IsConditionSatisfied ( sname + "付加" ) )
70+ {
71+ return true ;
72+ }
73+ else if ( u . IsConditionSatisfied ( sname + "付加2" ) )
74+ {
75+ return true ;
76+ }
77+
78+ if ( u . IsConditionSatisfied ( sname + "強化" ) )
79+ {
80+ if ( u . ConditionLevel ( sname + "強化" ) > 0d )
81+ {
82+ return true ;
83+ }
84+ }
85+
86+ if ( u . IsConditionSatisfied ( sname + "強化2" ) )
87+ {
88+ if ( u . ConditionLevel ( sname + "強化2" ) > 0d )
89+ {
90+ return true ;
91+ }
92+ }
9493 }
9594
9695 return false ;
@@ -184,54 +183,47 @@ private double SkillLevel(string Index, string ref_mode, SkillData sd)
184183 }
185184
186185 {
187- // TODO Impl 特殊能力付加&強化による修正
188- //if (Unit.CountCondition() == 0)
189- //{
190- // return SkillLevelRet;
191- //}
192-
193- //if (Unit.CountPilot() == 0)
194- //{
195- // return SkillLevelRet;
196- //}
197-
198- //if (!ReferenceEquals(this, Unit.MainPilot()) && !ReferenceEquals(this, Unit.Pilot(1)))
199- //{
200- // return SkillLevelRet;
201- //}
202-
203- //bool localIsConditionSatisfied() { object 1 = sname + "付加2"; var ret = Unit.IsConditionSatisfied(1); return ret; }
204-
205- //if (Unit.IsConditionSatisfied(sname + "付加"))
206- //{
207- // SkillLevelRet = Unit.ConditionLevel(sname + "付加");
208- // if (SkillLevelRet == Constants.DEFAULT_LEVEL)
209- // {
210- // SkillLevelRet = 1d;
211- // }
212- //}
213- //else if (localIsConditionSatisfied())
214- //{
215- // SkillLevelRet = Unit.ConditionLevel(sname + "付加2");
216- // if (SkillLevelRet == Constants.DEFAULT_LEVEL)
217- // {
218- // SkillLevelRet = 1d;
219- // }
220- //}
221-
222- //if (Unit.IsConditionSatisfied(sname + "強化"))
223- //{
224- // double localConditionLevel() { object argIndex1 = sname + "強化"; var ret = Unit.ConditionLevel(argIndex1); return ret; }
225-
226- // SkillLevelRet = SkillLevelRet + localConditionLevel();
227- //}
228-
229- //if (Unit.IsConditionSatisfied(sname + "強化2"))
230- //{
231- // double localConditionLevel1() { object argIndex1 = sname + "強化2"; var ret = Unit.ConditionLevel(argIndex1); return ret; }
232-
233- // SkillLevelRet = SkillLevelRet + localConditionLevel1();
234- //}
186+ if ( Unit . CountCondition ( ) == 0 )
187+ {
188+ return SkillLevelRet ;
189+ }
190+
191+ if ( Unit . CountPilot ( ) == 0 )
192+ {
193+ return SkillLevelRet ;
194+ }
195+
196+ if ( ! ReferenceEquals ( this , Unit . MainPilot ( ) ) && ! ReferenceEquals ( this , Unit . Pilots . First ( ) ) )
197+ {
198+ return SkillLevelRet ;
199+ }
200+
201+ if ( Unit . IsConditionSatisfied ( sname + "付加" ) )
202+ {
203+ SkillLevelRet = Unit . ConditionLevel ( sname + "付加" ) ;
204+ if ( SkillLevelRet == Constants . DEFAULT_LEVEL )
205+ {
206+ SkillLevelRet = 1d ;
207+ }
208+ }
209+ else if ( Unit . IsConditionSatisfied ( sname + "付加2" ) )
210+ {
211+ SkillLevelRet = Unit . ConditionLevel ( sname + "付加2" ) ;
212+ if ( SkillLevelRet == Constants . DEFAULT_LEVEL )
213+ {
214+ SkillLevelRet = 1d ;
215+ }
216+ }
217+
218+ if ( Unit . IsConditionSatisfied ( sname + "強化" ) )
219+ {
220+ SkillLevelRet = SkillLevelRet + Unit . ConditionLevel ( sname + "強化" ) ;
221+ }
222+
223+ if ( Unit . IsConditionSatisfied ( sname + "強化2" ) )
224+ {
225+ SkillLevelRet = SkillLevelRet + Unit . ConditionLevel ( sname + "強化2" ) ;
226+ }
235227 }
236228
237229 return SkillLevelRet ;
@@ -318,99 +310,91 @@ public string SkillData(string Index)
318310 var sd = colSkill [ Index ] ;
319311 return SkillData ( Index , sd ) ;
320312 }
321- private static string SkillData ( string Index , SkillData sd )
313+ private string SkillData ( string Index , SkillData sd )
322314 {
323315 string sname = sd ? . Name ;
324316 string SkillDataRet = sd ? . StrData ;
325- return SkillDataRet ;
326- // TODO Impl SkillData
327- //ErrorHandler:
328- // ;
329- // if (string.IsNullOrEmpty(sname))
330- // {
331- // if (Information.IsNumeric(Index))
332- // {
333- // return SkillDataRet;
334- // }
335- // else
336- // {
337- // // UPGRADE_WARNING: オブジェクト Index の既定プロパティを解決できませんでした。 詳細については、'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' をクリックしてください。
338- // sname = Conversions.ToString(Index);
339- // }
340- // }
341-
342- // // 重複可能な能力は特殊能力付加で置き換えられことはない
343- // switch (sname ?? "")
344- // {
345- // case "ハンター":
346- // case "SP消費減少":
347- // case "スペシャルパワー自動発動":
348- // {
349- // if (Information.IsNumeric(Index))
350- // {
351- // return SkillDataRet;
352- // }
353317
354- // break;
355- // }
356- // }
357-
358- // // 特殊能力付加&強化による修正
359- // if (Unit is null)
360- // {
361- // return SkillDataRet;
362- // }
363-
364- // {
365- // var withBlock = Unit;
366- // if (withBlock.CountCondition() == 0)
367- // {
368- // return SkillDataRet;
369- // }
370-
371- // if (withBlock.CountPilot() == 0)
372- // {
373- // return SkillDataRet;
374- // }
375-
376- // if (!ReferenceEquals(this, withBlock.MainPilot()) && !ReferenceEquals(this, withBlock.Pilot(1)))
377- // {
378- // return SkillDataRet;
379- // }
380-
381- // bool localIsConditionSatisfied() { object 1 = sname + "付加2"; var ret = withBlock.IsConditionSatisfied(1); return ret; }
382-
383- // if (withBlock.IsConditionSatisfied(sname + "付加"))
384- // {
385- // SkillDataRet = withBlock.ConditionData(sname + "付加");
386- // }
387- // else if (localIsConditionSatisfied())
388- // {
389- // SkillDataRet = withBlock.ConditionData(sname + "付加2");
390- // }
391-
392- // if (withBlock.IsConditionSatisfied(sname + "強化"))
393- // {
394- // string localConditionData() { object argIndex1 = sname + "強化"; var ret = withBlock.ConditionData(argIndex1); return ret; }
395-
396- // if (Strings.Len(localConditionData()) > 0)
397- // {
398- // SkillDataRet = withBlock.ConditionData(sname + "強化");
399- // }
400- // }
318+ if ( string . IsNullOrEmpty ( sname ) )
319+ {
320+ if ( Information . IsNumeric ( Index ) )
321+ {
322+ return SkillDataRet ;
323+ }
324+ else
325+ {
326+ sname = Index ;
327+ }
328+ }
329+
330+ // 重複可能な能力は特殊能力付加で置き換えられことはない
331+ switch ( sname ?? "" )
332+ {
333+ case "ハンター" :
334+ case "SP消費減少" :
335+ case "スペシャルパワー自動発動" :
336+ {
337+ if ( Information . IsNumeric ( Index ) )
338+ {
339+ return SkillDataRet ;
340+ }
401341
402- // if (withBlock.IsConditionSatisfied(sname + "強化2"))
403- // {
404- // string localConditionData1() { object argIndex1 = sname + "強化2"; var ret = withBlock.ConditionData(argIndex1); return ret; }
342+ break ;
343+ }
344+ }
405345
406- // if (Strings.Len(localConditionData1()) > 0)
407- // {
408- // SkillDataRet = withBlock.ConditionData(sname + "強化2");
409- // }
410- // }
411- // }
346+ // 特殊能力付加&強化による修正
347+ if ( Unit is null )
348+ {
349+ return SkillDataRet ;
350+ }
412351
413- // return SkillDataRet;
352+ {
353+ var u = Unit ;
354+ if ( u . CountCondition ( ) == 0 )
355+ {
356+ return SkillDataRet ;
357+ }
358+
359+ if ( u . CountPilot ( ) == 0 )
360+ {
361+ return SkillDataRet ;
362+ }
363+
364+ if ( ! ReferenceEquals ( this , u . MainPilot ( ) ) && ! ReferenceEquals ( this , u . Pilots . First ( ) ) )
365+ {
366+ return SkillDataRet ;
367+ }
368+
369+ if ( u . IsConditionSatisfied ( sname + "付加" ) )
370+ {
371+ SkillDataRet = u . ConditionData ( sname + "付加" ) ;
372+ }
373+ else if ( u . IsConditionSatisfied ( sname + "付加2" ) )
374+ {
375+ SkillDataRet = u . ConditionData ( sname + "付加2" ) ;
376+ }
377+
378+ if ( u . IsConditionSatisfied ( sname + "強化" ) )
379+ {
380+ var enhData = u . ConditionData ( sname + "強化" ) ;
381+ if ( ! string . IsNullOrEmpty ( enhData ) )
382+ {
383+ SkillDataRet = enhData ;
384+ }
385+ }
386+
387+ if ( u . IsConditionSatisfied ( sname + "強化2" ) )
388+ {
389+ var enhData2 = u . ConditionData ( sname + "強化2" ) ;
390+ if ( ! string . IsNullOrEmpty ( enhData2 ) )
391+ {
392+ SkillDataRet = enhData2 ;
393+ }
394+ }
395+ }
396+
397+ return SkillDataRet ;
414398 }
415399
416400 // 特殊能力の名称
0 commit comments