Hi,
I have a few questions about previewing ability stats in custom tooltips.
1) What would be the best way to grab status value changes previews and other ability information in these two cases?:
A) Ability is selected and targeting a combatant, so a custom tooltip will appear with status change|AP cost and other information similar to Battle Settings->Target Settings ->Target information Dialogue.
B) Ability is not selected, and I want to grab same information from ability shortcut. For example to display in a tooltip, when I'm hovering over ability icon in custom shortcut slot system.
I tried looking into Target information Dialogue source code, but I'm having trouble recreating it's behavior and when I can, I'm getting different results.
2) Is there a way to get Item/Abilities action cost for specific battle, regardless of whether that battle is currently running? I'm using this code, but this gives me 0AP if battle is not currently running.
public static int AbilityAPCost(ORKFramework.AbilityShortcut _IShortcut, ORKFramework.Combatant _Combatant)
{
int _Cost = 0;
if (_IShortcut.GetActiveLevel().ownTurnActionCost)
_Cost = (int)((_IShortcut.GetActiveLevel().GetActionCost(_Combatant, null, null)));
else if (ORKFramework.ORK.BattleSystem.turnBased.actionsPerTurn.ownAbilityCost)
_Cost = (int)(ORKFramework.ORK.BattleSystem.turnBased.actionsPerTurn.defaultAbilityCostSetting.GetCost(_Combatant));
else
_Cost = (int)(ORKFramework.ORK.BattleSystem.turnBased.actionsPerTurn.defaultActionCostSetting.GetCost(_Combatant));
return _Cost;
}
ORK.GUI.PreviewShortcut
Or the calculated preview from each individual combatant:
combatant.Status.Preview
If you want to show a preview, you can do this by setting a new preview shortcut, e.g. for an ability:
ORK.GUI.PreviewShortcut = new PreviewShortcut(user, targets, ability, enableTooltip, null);
user is the user combatant, targets is a list of targets (can also be null), ability is the AbilityShortcut of the used ability, enableTooltip is true/false depending of if this should also show a tooltip for the ability.
AP costs are only previewed during a battle that uses AP, i.e. either turn based or phase battles.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I could not quite understand how to make that work.
For example
_Target.Status.Preview.statusValue.GetValueMin
Gives me value of 50, which does not make sense as the ability has set damage value of 5. Does it add 0 at the end?
The PreviewShortcut would not work for me I think, as I'm trying to process the values in a custom way for tooltips.
But I think overall that approach would not give me information that I'm looking for.
For example I have these two cases:
1) Battle is running, I have ability selected and I have the target of the ability selected. S
2) Battle is not running, I don't have ability selected. I just have ability shortcut and ability user references. Is it possible to get some status change values in this case? I could use dummy target combatant.
Based on these cases, I want to calculate Damage, Status Effects and other information associated with Ability. Can you give me a direction, or point me to a place in source code, where I can for example loop through status changes of an ability and calculate chances?
The closest I got to this was:
_BaseAttack.GetActiveLevel().targetChange.consume[0].GetDisplayChangeMin(_User, _Target, 1, 1, null, null)
Am I on the right track? Where do damage factor and damage multiplier values come from? Does this function take into account initial value I set in the ability settings?
For AP, This should give me AP value regardless of combat or not right?
Combatant.Abilities.GetBaseAttack(0).GetActiveLevel().turnActionCostSetting.GetCost(Combatant)
You're on the right track with your code examples. I'd recommend checking this out in ORK's code directly to see how this works. E.g. for an ability, this is implemented in the GetPreview function of the AbilityShortcut class.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!