void BuildActionCost(dynamic action, Saint.Action sAction) { if (sAction.Cost == 0) { return; } switch (sAction.CostType) { case Saint.ActionCostType.CP: action.resource = "CP"; action.cost = sAction.Cost; break; case Saint.ActionCostType.GP: action.resource = "GP"; action.cost = sAction.Cost; break; case Saint.ActionCostType.HPPercent: action.resource = "HP"; action.cost = sAction.Cost + "%"; break; case Saint.ActionCostType.LimitBreakGauge: action.resource = "limitbreak"; break; case Saint.ActionCostType.MP: case Saint.ActionCostType.MP2: action.resource = "MP"; action.cost = sAction.GetMpCost(GarlandDatabase.LevelCap); break; case Saint.ActionCostType.MPAll: action.resource = "MP"; action.cost = sAction.GetMpCost(GarlandDatabase.LevelCap) + "+"; break; case Saint.ActionCostType.NoCost: break; case Saint.ActionCostType.StatusAll: action.resource = "Status"; action.cost = GetStatus(sAction.SourceRow.Sheet.Collection.GetSheet <Saint.Status>("Status")[sAction.Cost]); break; case Saint.ActionCostType.StatusAmount: action.resource = "Stack"; action.cost = sAction.Cost; break; case Saint.ActionCostType.TP: action.resource = "TP"; action.cost = sAction.Cost; break; case Saint.ActionCostType.TPAll: action.resource = "TP"; action.cost = "All"; break; case Saint.ActionCostType.BeastGauge: action.resource = "Beast"; action.cost = sAction.Cost; break; case Saint.ActionCostType.BloodGauge: action.resource = "Blood"; action.cost = sAction.Cost; break; case Saint.ActionCostType.NinkiGauge: action.resource = "Ninki"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Chakra: action.resource = "Chakra"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Aetherflow: action.resource = "Aetherflow"; action.cost = sAction.Cost; break; case Saint.ActionCostType.AethertrailAttunement: action.resource = "Aethertrail"; action.cost = sAction.Cost; break; case Saint.ActionCostType.KenkiGauge: case Saint.ActionCostType.KenkiGauge2: action.resource = "Kenki"; action.cost = sAction.Cost; break; case Saint.ActionCostType.OathGauge: action.resource = "Oath"; action.cost = sAction.Cost; break; case Saint.ActionCostType.BalanceGauge: action.resource = "Balance"; action.cost = sAction.Cost; break; case Saint.ActionCostType.FaerieGauge: action.resource = "Faerie"; action.cost = sAction.Cost; break; case Saint.ActionCostType.LilyAll: action.resource = "Lily"; action.cost = "All"; break; case Saint.ActionCostType.Ceruleum: action.resource = "Ceruleum"; action.cost = sAction.Cost; break; case Saint.ActionCostType.AstrologianCard: case Saint.ActionCostType.AstrologianCard2: case Saint.ActionCostType.AstrologianCard3: case Saint.ActionCostType.AstrologianCard4: case Saint.ActionCostType.AstrologianCard5: case Saint.ActionCostType.AstrologianCard6: case Saint.ActionCostType.GreasedLightning: case Saint.ActionCostType.Repertoire: case Saint.ActionCostType.DreadwyrmAether: case Saint.ActionCostType.DreadwyrmTrance: case Saint.ActionCostType.AstralFireOrUmbralIce: case Saint.ActionCostType.UnknownDragoon48: break; case Saint.ActionCostType.Unknown20: break; default: throw new NotImplementedException(); } }
dynamic BuildAction(Saint.Action sAction) { dynamic action = new JObject(); action.id = sAction.Key; _builder.Localize.Strings((JObject)action, sAction, "Name"); _builder.Localize.HtmlStrings((JObject)action, sAction.ActionTransient, "Description"); action.patch = PatchDatabase.Get("action", sAction.Key); action.category = sAction.ActionCategory.Key; if (!sAction.Icon.Path.EndsWith("000000.tex")) { action.icon = IconDatabase.EnsureEntry("action", sAction.Icon); } if (sAction.ClassJobCategory.Key > 0) { action.affinity = sAction.ClassJobCategory.Key; } action.lvl = sAction.ClassJobLevel; action.range = sAction.Range; // -1 = melee, 0 = self action.cast = sAction.CastTime.TotalMilliseconds; action.recast = sAction.RecastTime.TotalMilliseconds; // This is needed for ninja and pet actions. var sClassJob = sAction.ClassJob; if (sClassJob == null || (sClassJob.Key == 0 && sAction.ClassJobCategory.ClassJobs.Count() == 1)) { if (sAction.ClassJobCategory.Key > 0) { action.job = sAction.ClassJobCategory.ClassJobs.First().Key; } } else { action.job = sClassJob.Key; } if (sAction.ComboFrom.Key > 0) { action.comboFrom = sAction.ComboFrom.Key; _builder.Db.AddReference(action, "action", sAction.ComboFrom.Key, false); } if (sAction.GainedStatus.Key != 0) { action.gainedStatus = GetStatus(sAction.GainedStatus); } if (sAction.EffectRange > 1) { action.size = sAction.EffectRange; } BuildActionCost(action, sAction); var cooldownGroup = (byte)sAction["CooldownGroup"]; if (cooldownGroup == 58) { action.gcd = 1; } // Not very useful. //if (gameData.CanTargetSelf) // action.self = 1; //if (gameData.CanTargetParty) // action.party = 1; //if (gameData.CanTargetFriendly) // action.friendly = 1; //if (gameData.CanTargetHostile) // action.hostile = 1; //if (gameData.TargetArea) // action.aoe = 1; _builder.Db.Actions.Add(action); _builder.Db.ActionsById[sAction.Key] = action; return(action); }
void BuildActionCost(dynamic action, Saint.Action sAction) { if (sAction.Cost == 0) { return; } switch (sAction.CostType) { case Saint.ActionCostType.CP: action.resource = "CP"; action.cost = sAction.Cost; break; case Saint.ActionCostType.GP: action.resource = "GP"; action.cost = sAction.Cost; break; case Saint.ActionCostType.HPPercent: action.resource = "HP"; action.cost = sAction.Cost + "%"; break; case Saint.ActionCostType.LimitBreakGauge: action.resource = "limitbreak"; break; case Saint.ActionCostType.MP: case Saint.ActionCostType.MP2: action.resource = "MP"; action.cost = sAction.GetMpCost(GarlandDatabase.LevelCap); break; case Saint.ActionCostType.MPAll: action.resource = "MP"; action.cost = sAction.GetMpCost(GarlandDatabase.LevelCap) + "+"; break; case Saint.ActionCostType.NoCost: break; case Saint.ActionCostType.StatusAll: action.resource = "Status"; action.cost = GetStatus(sAction.SourceRow.Sheet.Collection.GetSheet <Saint.Status>("Status")[sAction.Cost]); break; case Saint.ActionCostType.StatusAmount: action.resource = "Stack"; action.cost = sAction.Cost; break; case Saint.ActionCostType.TP: action.resource = "TP"; action.cost = sAction.Cost; break; case Saint.ActionCostType.TPAll: action.resource = "TP"; action.cost = "All"; break; case Saint.ActionCostType.BeastGauge: action.resource = "Beast"; action.cost = sAction.Cost; break; case Saint.ActionCostType.BloodGauge: action.resource = "Blood"; action.cost = sAction.Cost; break; case Saint.ActionCostType.NinkiGauge: action.resource = "Ninki"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Chakra: action.resource = "Chakra"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Aetherflow: action.resource = "Aetherflow"; action.cost = sAction.Cost; break; case Saint.ActionCostType.AethertrailAttunement: action.resource = "Aethertrail"; action.cost = sAction.Cost; break; case Saint.ActionCostType.KenkiGauge: case Saint.ActionCostType.KenkiGauge2: action.resource = "Kenki"; action.cost = sAction.Cost; break; case Saint.ActionCostType.OathGauge: action.resource = "Oath"; action.cost = sAction.Cost; break; case Saint.ActionCostType.BalanceGauge: action.resource = "Balance"; action.cost = sAction.Cost; break; case Saint.ActionCostType.FaerieGauge: action.resource = "Faerie"; action.cost = sAction.Cost; break; case Saint.ActionCostType.LilyAll: action.resource = "Lily"; action.cost = "All"; break; case Saint.ActionCostType.Ceruleum: action.resource = "Ceruleum"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Polyglot: action.resource = "Polyglot"; action.cost = sAction.Cost; break; case Saint.ActionCostType.FourfoldFeather: action.resource = "Fourfold Feather"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Espirit: action.resource = "Espirit"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Cartridge: action.resource = "Cartridge"; action.cost = sAction.Cost; break; case Saint.ActionCostType.BloodLily: action.resource = "Blood Lily"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Lily: action.resource = "Lily"; action.cost = sAction.Cost; break; case Saint.ActionCostType.SealsAll: action.resource = "Seals"; action.cost = "All"; break; case Saint.ActionCostType.SoulVoice: action.resource = "Soul Voice"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Heat: action.resource = "Heat"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Battery: action.resource = "Battery"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Meditation: action.resource = "Meditation"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Soul: action.resource = "Soul"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Shroud: action.resource = "Shroud"; action.cost = sAction.Cost; break; case Saint.ActionCostType.LemureShroud: action.resource = "Lemure Shroud"; action.cost = sAction.Cost; break; case Saint.ActionCostType.VoidShroud: action.resource = "Void Shroud"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Addersgall: action.resource = "Addersgall"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Addersting: action.resource = "Addersting"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Arcanum: switch (sAction.Cost) { case 1: action.resource = "Fire Arcanum"; action.cost = sAction.Cost; break; case 2: action.resource = "Earth Arcanum"; action.cost = sAction.Cost; break; case 3: action.resource = "Wind Arcanum"; action.cost = sAction.Cost; break; } break; case Saint.ActionCostType.FireAttunement: action.resource = "Fire Attunement"; action.cost = sAction.Cost; break; case Saint.ActionCostType.EarthAttunement: action.resource = "Earth Attunement"; action.cost = sAction.Cost; break; case Saint.ActionCostType.WindAttunement: action.resource = "Wind Attunement"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Firstmind: action.resource = "Firstmind"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Paradox: action.resource = "Paradox"; action.cost = sAction.Cost; break; case Saint.ActionCostType.ManaStack: action.resource = "Mana Stack"; action.cost = sAction.Cost; break; case Saint.ActionCostType.BeastChakra: action.resource = "Beast Chakra"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Coda: action.resource = "Coda"; action.cost = sAction.Cost; break; case Saint.ActionCostType.Enshrouded: action.resource = "Enshrouded"; action.cost = "Effect"; break; case Saint.ActionCostType.AstrologianCard: case Saint.ActionCostType.AstrologianCard2: case Saint.ActionCostType.AstrologianCard3: case Saint.ActionCostType.AstrologianCard4: case Saint.ActionCostType.AstrologianCard5: case Saint.ActionCostType.AstrologianCard6: case Saint.ActionCostType.GreasedLightning: case Saint.ActionCostType.Repertoire: case Saint.ActionCostType.DreadwyrmAether: case Saint.ActionCostType.DreadwyrmTrance: case Saint.ActionCostType.AstralFireOrUmbralIce: case Saint.ActionCostType.UnknownDragoon48: case Saint.ActionCostType.Unknown83: case Saint.ActionCostType.Unknown80: case Saint.ActionCostType.Unknown77: case Saint.ActionCostType.Unknown70: break; case Saint.ActionCostType.Unknown20: break; default: break; } }