//Conditions
var equipConditions = equipShortcut.Setting.equipConditions.conditions;
if(equipConditions.useConditions){
if(equipConditions.conditions.condition != null){
for(int i = 0; i < equipConditions.conditions.condition.Length; i++){
var condition = equipConditions.conditions.condition[i];
//Don't know how to get condition details.
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
This let's you cycle through status conditions and checks if they're valid or not:
var equipConditions = this.Setting.equipConditions.conditions;
if(equipConditions.useConditions)
{
if(equipConditions.conditions.condition != null)
{
for(int i = 0; i < equipConditions.conditions.condition.Length; i++)
{
var statusCondition = equipConditions.conditions.condition[i].settings as CombatantStatusGeneralCondition<GameObjectSelection>;
if(statusCondition != null)
{
for(int j = 0; j < statusCondition.conditions.condition.Length; j++)
{
if(statusCondition.conditions.condition[i].Check(combatant))
{
// valid
}
else
{
// not valid
}
}
}
}
}
}
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
var statusCondition = equipConditions.conditions.condition[i].settings as CombatantStatusGeneralCondition<GameObjectSelection>;
This is what I need.
And I have another similar question, how can I get the
Research Item's Ability Settings and Item Settings like the screenshot below?Also the Research Cost and Research Conditions.I can only get the cost string text, but not the Research Cost entity.
var allTrees = m_Combatant.Research.GetAllTrees();
foreach (var tree in allTrees)
{
foreach (var item in tree.GetItems())
{
Debug.Log(" KKKKKK: " + item.GetName() + "///" + item.GetTypeContent() + "///" + item.GetUseCostText(m_Combatant));
//How to get Research Item's Ability/Item/Quest Settings? And Research Cost/Condition.
}
}
Edit:
I can get the Ability/Item/Quest Settings of the Research Item by this code:
if(item.GetTypeContent() != null && item.GetTypeContent().GetType() == typeof(AbilityType)){
var abilityResearchItem = item.Setting.settings as AbilityResearchItem;
}
But still don't know how to get the cost and conditions entity.
researchItem.Setting.learnConditions;
researchItem.Setting.learnCost;