本文整理汇总了C#中Equipment.HasParam方法的典型用法代码示例。如果您正苦于以下问题:C# Equipment.HasParam方法的具体用法?C# Equipment.HasParam怎么用?C# Equipment.HasParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Equipment
的用法示例。
在下文中一共展示了Equipment.HasParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanLookup
public bool CanLookup(
string fname, LookupType type,
SkillDef scontext=null,
Character ccontext=null,
Character tcontext=null,
Equipment econtext=null,
Item icontext=null,
Formula f=null
)
{
switch(type) {
case LookupType.Auto:
return (icontext != null && icontext.HasParam(fname)) ||
(econtext != null && econtext.HasParam(fname)) ||
(scontext != null && scontext.HasParam(fname)) ||
(ccontext != null && ccontext.HasStat(fname)) ||
(tcontext != null && tcontext.HasStat(fname));
case LookupType.SkillParam:
return scontext.HasParam(fname);
case LookupType.ItemParam: {
if(icontext == null && scontext != null) {
icontext = scontext.InvolvedItem;
}
if(icontext == null && econtext != null) {
icontext = econtext.baseItem;
}
return icontext != null && icontext.HasParam(fname);
}
case LookupType.ReactedItemParam: {
icontext = scontext.currentReactedSkill.InvolvedItem;
return icontext != null && icontext.HasParam(fname);
}
case LookupType.ActorStat:
if(scontext != null) { return scontext.character.HasStat(fname); }
if(econtext != null) { return econtext.wielder.HasStat(fname); }
if(ccontext != null) { return ccontext.HasStat(fname); }
return false;
case LookupType.ActorMountStat: {
Character m = null;
if(scontext != null) { m = scontext.currentTargetCharacter.mountedCharacter; }
if(econtext != null) { m = econtext.wielder.mountedCharacter; }
if(tcontext != null) { m = tcontext.mountedCharacter; }
if(m != null) { return m.HasStat(fname); }
// Debug.Log("can lookup "+fname+" on mount "+m+" ? "+(m != null && m.HasStat(fname)));
return false;
}
case LookupType.ActorMounterStat: {
Character m = null;
if(scontext != null) { m = scontext.currentTargetCharacter.mountingCharacter; }
if(econtext != null) { m = econtext.wielder.mountingCharacter; }
if(tcontext != null) { m = tcontext.mountingCharacter; }
if(m != null) { return m.HasStat(fname); }
return false;
}
case LookupType.ActorEquipmentParam:
if(scontext != null) {
ccontext = scontext.character;
} else if(ccontext == null && econtext != null) {
if(econtext.Matches(f.equipmentSlots, f.equipmentCategories)) {
return econtext.HasParam(fname);
} else {
ccontext = econtext.wielder;
}
}
return CanLookupEquipmentParamOn(fname, type, ccontext, f);
case LookupType.ActorMountEquipmentParam:
if(scontext != null) {
ccontext = scontext.character.mountedCharacter;
} else if(ccontext == null && econtext != null) {
if(econtext.Matches(f.equipmentSlots, f.equipmentCategories)) {
return econtext.HasParam(fname);
} else {
ccontext = econtext.wielder.mountedCharacter;
}
}
return CanLookupEquipmentParamOn(fname, type, ccontext, f);
case LookupType.ActorMounterEquipmentParam:
if(scontext != null) {
ccontext = scontext.character.mountingCharacter;
} else if(ccontext == null && econtext != null) {
if(econtext.Matches(f.equipmentSlots, f.equipmentCategories)) {
return econtext.HasParam(fname);
} else {
ccontext = econtext.wielder.mountingCharacter;
}
}
return CanLookupEquipmentParamOn(fname, type, ccontext, f);
case LookupType.ActorSkillParam:
if(scontext != null) { return scontext.HasParam(fname); }
return false;
case LookupType.ActorStatusEffect:
if(scontext != null) { return scontext.character.HasStatusEffect(fname); }
if(econtext != null) { return econtext.wielder.HasStatusEffect(fname); }
if(ccontext != null) { return ccontext.HasStatusEffect(fname); }
return false;
case LookupType.ActorMountStatusEffect: {
Character m = null;
if(scontext != null) { m = scontext.character.mountedCharacter; }
if(econtext != null) { m = econtext.wielder.mountedCharacter; }
if(ccontext != null) { m = ccontext.mountedCharacter; }
//.........这里部分代码省略.........