public void FightAction(WFightAction fightAction) { if (Event_ActionReceived != null) { Event_ActionReceived(MakeFightAction(fightAction)); } }
private List <ActionData> MakeFightAction(WFightAction fightActions) { List <ActionData> actionList = new List <ActionData>(); for (int n = 0; n < fightActions.f_acts.Length; n++) { WFightActionData fightAc = fightActions.f_acts[n]; FightActionData fad = new FightActionData(); var effectsInfo = new List <SpellEffectInfo>(); AppearanceConfigData.MagicAppearanceData appearance; appearance = AppearanceConfigData.instance.GetMagicWithIndex(_battleLogic.GetCharacterWithID(fightAc.owner_id).moniker, fightAc.spell_index); fad.consumedActionPoint = fightAc.con_ap; fad.ownerID = fightAc.owner_id; //if (appearance._multiplePartDamage != null && appearance._multiplePartDamage.Count > 0) //{ // effectsInfo = multipart(appearance._multiplePartDamage, effectsInfo); //} for (int i = 0; i < fightAc.spell_effect_info.Length; i++) { BattleObjStats finalStat = MakeBattleObject(fightAc.spell_effect_info[i].final_character_stats); List <SpellSingleStatChangeInfo> statChanges = MakeSingleStatChangeList( fightAc.spell_effect_info[i].single_stat_changes); SpellEffectInfo effect = new SpellEffectInfo(statChanges, fightAc.spell_effect_info[i].target_character_id, fightAc.spell_effect_info[i].effect_on_character, finalStat); effectsInfo.Add(effect); } fad.spellInfo = new SpellInfo( fightAc.spell_index, appearance._isInstant, appearance._dontShowToUser, appearance._needTargetToComeNear, appearance._spellName, appearance._cost, appearance._prefabName, fightAc.spell_type, appearance._damageType, appearance._spellImpact, effectsInfo); fad.spellInfo.generatedActionPoint = fightAc.gen_ap; fad.spellInfo.isCritical = fightAc.is_critical; actionList.Add(fad); } return(actionList); }