public static bool IsExtraEffectMonster(MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray) { if (MonsterGrowStepData.IsGardenDigimonScope(monsterData.monsterMG.growStep)) { return(false); } int areaId = ExtraEffectUtil.GetAreaId(); foreach (int num in monsterData.GetChipEquip().GetChipIdList()) { GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num.ToString()); if (chipEffectData != null) { GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] invocationList = ChipEffectStatus.GetInvocationList(chipEffectData, EffectStatusBase.EffectTriggerType.Area, monsterData.monsterM.monsterGroupId.ToInt32(), null, areaId); if (invocationList.Length > 0) { return(true); } } } GameWebAPI.RespDataMA_EventPointBonusM.EventPointBonus[] eventPointBonuses = ExtraEffectUtil.GetEventPointBonuses(ExtraEffectUtil.GetDungeonId().ToString()); foreach (GameWebAPI.RespDataMA_EventPointBonusM.EventPointBonus eventPointBonus in eventPointBonuses) { bool flag = ExtraEffectUtil.CheckExtraParams(monsterData, eventPointBonus); if (flag) { return(true); } } return(ExtraEffectUtil.CheckExtraStageParams(monsterData, effectArray)); }
private void SetSelectedCharChg(MonsterData monster) { this.changeMonsterData = monster; if (null != this.goMN_ICON_CHG_2) { UnityEngine.Object.Destroy(this.goMN_ICON_CHG_2); } Transform transform = this.goMN_ICON_CHG.transform; GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(this.changeMonsterData, transform.localScale, transform.localPosition, transform.parent, true, false); this.goMN_ICON_CHG_2 = guimonsterIcon.gameObject; this.goMN_ICON_CHG_2.SetActive(true); guimonsterIcon.Data = this.changeMonsterData; guimonsterIcon.SetTouchAct_S(new Action <MonsterData>(this.actRemoveChg)); guimonsterIcon.SetTouchAct_L(new Action <MonsterData>(this.ActMIconLong)); UIWidget component = this.goMN_ICON_CHG.GetComponent <UIWidget>(); UIWidget component2 = guimonsterIcon.gameObject.GetComponent <UIWidget>(); if (component != null && component2 != null) { int add = component.depth - component2.depth; DepthController component3 = guimonsterIcon.gameObject.GetComponent <DepthController>(); component3.AddWidgetDepth(guimonsterIcon.transform, add); } this.goMN_ICON_CHG.SetActive(false); guimonsterIcon.Gimmick = ExtraEffectUtil.IsExtraEffectMonster(this.changeMonsterData, this.effectArray); this.SetChangeMonsterData(); }
public static bool CheckExtraStageParams(MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM effect) { GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray = new GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] { effect }; return(ExtraEffectUtil.CheckExtraStageParams(monsterData, effectArray)); }
public bool SetValues(MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] gimmickEffectArray) { bool result = false; int changeValue; int num; ExtraEffectUtil.GetExtraEffectFluctuationValue(out changeValue, out num, monsterData, gimmickEffectArray, EffectStatusBase.ExtraEffectType.Hp, 0, true); this.SetParameter(monsterData.userMonster.hp, changeValue, this.hpLabel, this.hpGimmickLabel, this.hpArrow); if (num != 0) { result = true; } ExtraEffectUtil.GetExtraEffectFluctuationValue(out changeValue, out num, monsterData, gimmickEffectArray, EffectStatusBase.ExtraEffectType.Atk, 0, true); this.SetParameter(monsterData.userMonster.attack, changeValue, this.attackLabel, this.attackGimmickLabel, this.attackArrow); if (num != 0) { result = true; } ExtraEffectUtil.GetExtraEffectFluctuationValue(out changeValue, out num, monsterData, gimmickEffectArray, EffectStatusBase.ExtraEffectType.Def, 0, true); this.SetParameter(monsterData.userMonster.defense, changeValue, this.defenseLabel, this.defenseGimmickLabel, this.defenseArrow); if (num != 0) { result = true; } ExtraEffectUtil.GetExtraEffectFluctuationValue(out changeValue, out num, monsterData, gimmickEffectArray, EffectStatusBase.ExtraEffectType.Satk, 0, true); this.SetParameter(monsterData.userMonster.spAttack, changeValue, this.magicAttackLabel, this.magicAttackGimmickLabel, this.magicAttackArrow); if (num != 0) { result = true; } ExtraEffectUtil.GetExtraEffectFluctuationValue(out changeValue, out num, monsterData, gimmickEffectArray, EffectStatusBase.ExtraEffectType.Sdef, 0, true); this.SetParameter(monsterData.userMonster.spDefense, changeValue, this.magicDefenceLabel, this.magicDefenseGimmickLabel, this.magicDefenseArrow); if (num != 0) { result = true; } ExtraEffectUtil.GetExtraEffectFluctuationValue(out changeValue, out num, monsterData, gimmickEffectArray, EffectStatusBase.ExtraEffectType.Speed, 0, true); this.SetParameter(monsterData.userMonster.speed, changeValue, this.speedLabel, this.speedGimmickLabel, this.speedArrow); if (num != 0) { result = true; } this.luckLabel.text = monsterData.userMonster.luck; if (!this.disableFriendshipMaxValue) { this.friendshipLabel.text = MonsterFriendshipData.GetMaxFriendshipFormat(monsterData.userMonster.friendship, monsterData.monsterMG.growStep); } else { this.friendshipLabel.text = monsterData.userMonster.friendship; } return(result); }
private void SetSelectedChar() { if (CMD_ChangeMonster.SelectMonsterData != null) { Transform transform = this.goMN_ICON_NOW.transform; GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(CMD_ChangeMonster.SelectMonsterData, transform.localScale, transform.localPosition, transform.parent, true, false); this.goMN_ICON_NOW_2 = guimonsterIcon.gameObject; this.goMN_ICON_NOW_2.SetActive(true); guimonsterIcon.Data = CMD_ChangeMonster.SelectMonsterData; guimonsterIcon.SetTouchAct_L(new Action <MonsterData>(this.ActMIconLong)); UIWidget component = this.goMN_ICON_NOW.GetComponent <UIWidget>(); UIWidget component2 = guimonsterIcon.gameObject.GetComponent <UIWidget>(); if (null != component && null != component2) { int add = component.depth - component2.depth; DepthController component3 = guimonsterIcon.gameObject.GetComponent <DepthController>(); component3.AddWidgetDepth(guimonsterIcon.transform, add); } this.goMN_ICON_NOW.SetActive(false); guimonsterIcon.Gimmick = ExtraEffectUtil.IsExtraEffectMonster(CMD_ChangeMonster.SelectMonsterData, this.effectArray); } }
private static bool CheckExtraStageParams(MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray) { EffectStatusBase.ExtraEffectType[] array = new EffectStatusBase.ExtraEffectType[] { EffectStatusBase.ExtraEffectType.Atk, EffectStatusBase.ExtraEffectType.Def, EffectStatusBase.ExtraEffectType.Hp, EffectStatusBase.ExtraEffectType.Speed, EffectStatusBase.ExtraEffectType.Satk, EffectStatusBase.ExtraEffectType.Sdef, EffectStatusBase.ExtraEffectType.SkillPower, EffectStatusBase.ExtraEffectType.SkillHit }; foreach (EffectStatusBase.ExtraEffectType extraEffectType in array) { int num = 0; int num2 = 0; if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillPower || extraEffectType == EffectStatusBase.ExtraEffectType.SkillHit) { for (int j = 1; j <= 3; j++) { ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, monsterData, effectArray, extraEffectType, j, false); if (num2 != 0) { return(true); } } } else { ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, monsterData, effectArray, extraEffectType, 0, false); if (num2 != 0) { return(true); } } } return(false); }
private static int GetExtraStageValue(int baseValue, MonsterData monsterData, MonsterData[] party, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray, AffectEffectProperty affectEffectProperty, EffectStatusBase.ExtraEffectType extraEffectType) { if (effectArray == null || effectArray.Length == 0) { return(baseValue); } List <ExtraEffectStatus> list = new List <ExtraEffectStatus>(); foreach (GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM worldDungeonExtraEffectM in effectArray) { ExtraEffectStatus item = new ExtraEffectStatus(worldDungeonExtraEffectM); list.Add(item); } if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillPower) { return(ExtraEffectStatus.GetExtraEffectCorrectionValue(ExtraEffectUtil.GetAreaId(), list, affectEffectProperty.GetPower(null), party, new MonsterData[0], monsterData, affectEffectProperty, extraEffectType)); } if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillHit) { return(ExtraEffectStatus.GetExtraEffectCorrectionValue(ExtraEffectUtil.GetAreaId(), list, (int)(affectEffectProperty.hitRate * 100f), party, new MonsterData[0], monsterData, affectEffectProperty, extraEffectType)); } return(ExtraEffectStatus.GetExtraEffectCorrectionValue(ExtraEffectUtil.GetAreaId(), list, baseValue, party, new MonsterData[0], monsterData, null, extraEffectType)); }
private GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] SetStageGimmick(string StageID, string DungeonID) { GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] array = DataMng.Instance().StageGimmick.GetExtraEffectDataList(StageID, DungeonID).ToArray(); array = array.Where((GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM item) => ExtraEffectUtil.CheckExtraStageParams(this.Data, item)).ToArray <GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM>(); int num = 0; int num2 = 0; ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, this.Data, array, EffectStatusBase.ExtraEffectType.SkillPower, 1, true); if (num2 == 1) { this.gimmickSkillActionUp.SetActive(true); } else if (num2 == -1) { this.gimmickSkillActionDown.SetActive(true); } ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, this.Data, array, EffectStatusBase.ExtraEffectType.SkillHit, 1, true); if (num2 == 1) { this.gimmickSkillActionUp.SetActive(true); } else if (num2 == -1) { this.gimmickSkillActionDown.SetActive(true); } ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, this.Data, array, EffectStatusBase.ExtraEffectType.SkillPower, 2, true); if (num2 == 1) { this.gimmickSkillSucceedUp.SetActive(true); } else if (num2 == -1) { this.gimmickSkillSucceedDown.SetActive(true); } ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, this.Data, array, EffectStatusBase.ExtraEffectType.SkillHit, 2, true); if (num2 == 1) { this.gimmickSkillSucceedUp.SetActive(true); } else if (num2 == -1) { this.gimmickSkillSucceedDown.SetActive(true); } if (this.gimmickSkillSucceedUp2 == null || this.gimmickSkillSucceedDown2 == null) { return(array); } ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, this.Data, array, EffectStatusBase.ExtraEffectType.SkillPower, 3, true); if (num2 == 1) { this.gimmickSkillSucceedUp2.SetActive(true); } else if (num2 == -1) { this.gimmickSkillSucceedDown2.SetActive(true); } ExtraEffectUtil.GetExtraEffectFluctuationValue(out num, out num2, this.Data, array, EffectStatusBase.ExtraEffectType.SkillHit, 3, true); if (num2 == 1) { this.gimmickSkillSucceedUp2.SetActive(true); } else if (num2 == -1) { this.gimmickSkillSucceedDown2.SetActive(true); } return(array); }
private static int GetExtraChipValue(MonsterData monsterData, EffectStatusBase.ExtraEffectType effectType) { float num = 0f; int areaId = ExtraEffectUtil.GetAreaId(); GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(monsterData.monsterM.monsterGroupId).Group; foreach (int num2 in monsterData.GetChipEquip().GetChipIdList()) { GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num2.ToString()); if (chipEffectData != null) { GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] invocationList = ChipEffectStatus.GetInvocationList(chipEffectData, EffectStatusBase.EffectTriggerType.Area, monsterData.monsterM.monsterGroupId.ToInt32(), null, areaId); int num3 = 0; EffectStatusBase.ExtraEffectType effectType2 = EffectStatusBase.ExtraEffectType.Non; switch (effectType) { case EffectStatusBase.ExtraEffectType.Atk: num3 = monsterData.userMonster.attack.ToInt32(); effectType2 = EffectStatusBase.ExtraEffectType.Atk; break; case EffectStatusBase.ExtraEffectType.Def: num3 = monsterData.userMonster.defense.ToInt32(); effectType2 = EffectStatusBase.ExtraEffectType.Def; break; case EffectStatusBase.ExtraEffectType.Hp: num3 = monsterData.userMonster.hp.ToInt32(); effectType2 = EffectStatusBase.ExtraEffectType.Hp; break; case EffectStatusBase.ExtraEffectType.Speed: num3 = monsterData.userMonster.speed.ToInt32(); effectType2 = EffectStatusBase.ExtraEffectType.Speed; break; case EffectStatusBase.ExtraEffectType.Satk: num3 = monsterData.userMonster.spAttack.ToInt32(); effectType2 = EffectStatusBase.ExtraEffectType.Satk; break; case EffectStatusBase.ExtraEffectType.Sdef: num3 = monsterData.userMonster.spDefense.ToInt32(); effectType2 = EffectStatusBase.ExtraEffectType.Sdef; break; default: if (effectType == EffectStatusBase.ExtraEffectType.SkillPower || effectType == EffectStatusBase.ExtraEffectType.SkillHit) { num3 = 0; effectType2 = EffectStatusBase.ExtraEffectType.Non; } break; } GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster responseMonsterIntegrationGroupMaster = MasterDataMng.Instance().ResponseMonsterIntegrationGroupMaster; GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup[] source = responseMonsterIntegrationGroupMaster.monsterIntegrationGroupM.Where((GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup item) => item.monsterId == monsterData.monsterM.monsterId).ToArray <GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup>(); string[] monsterIntegrationIds = source.Select((GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup item) => item.monsterIntegrationId).ToArray <string>(); num += ChipEffectStatus.GetChipEffectValueToFloat(invocationList, (float)num3, false, monsterIntegrationIds, monsterData.monsterM.monsterGroupId, ExtraEffectUtil.ResistanceToTolerance(monsterData), group.tribe, MonsterGrowStepData.ToGrowStep(group.growStep), null, null, ChipEffectStatus.TargetType.Actor, effectType2, 0); } } return(Mathf.FloorToInt(num)); }
public static void GetExtraEffectFluctuationValue(out int result, out int change, MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray, EffectStatusBase.ExtraEffectType extraEffectType, int skillType = 0, bool isChipValue = true) { int num = (int)ExtraEffectUtil.GetStatusValue(extraEffectType, monsterData, skillType); int num2 = 0; if (isChipValue) { num2 = ExtraEffectUtil.GetExtraChipValue(monsterData, extraEffectType); } MonsterData[] party = new MonsterData[] { monsterData }; if (CMD_PartyEdit.instance != null) { MonsterData[] array = CMD_PartyEdit.instance.GetSelectedMD().ToArray(); bool flag = array.Where((MonsterData item) => item.userMonster.userMonsterId == monsterData.userMonster.userMonsterId).Any <MonsterData>(); if (flag) { party = array; } else { GameWebAPI.RespDataMN_GetDeckList.DeckList[] deckList = DataMng.Instance().RespDataMN_DeckList.deckList; string deckNoText = DataMng.Instance().RespDataMN_DeckList.selectDeckNum; GameWebAPI.RespDataMN_GetDeckList.DeckList deckList2 = deckList.Where((GameWebAPI.RespDataMN_GetDeckList.DeckList item) => item.deckNum == deckNoText.ToString()).SingleOrDefault <GameWebAPI.RespDataMN_GetDeckList.DeckList>(); bool flag2 = deckList2.monsterList.Where((GameWebAPI.RespDataMN_GetDeckList.MonsterList item) => item.userMonsterId == monsterData.userMonster.userMonsterId).Any <GameWebAPI.RespDataMN_GetDeckList.MonsterList>(); if (flag2) { List <MonsterData> list = new List <MonsterData>(); foreach (GameWebAPI.RespDataMN_GetDeckList.MonsterList monsterList2 in deckList2.monsterList) { MonsterData monsterDataByUserMonsterID = MonsterDataMng.Instance().GetMonsterDataByUserMonsterID(monsterList2.userMonsterId, false); list.Add(monsterDataByUserMonsterID); } party = list.ToArray(); } } } int num3 = 0; AffectEffectProperty affectEffectProperty = null; if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillPower) { List <AffectEffectProperty> affectEffectPropertyListForUtil = BattleServerControl.GetAffectEffectPropertyListForUtil(num.ToString()); if (affectEffectPropertyListForUtil != null && affectEffectPropertyListForUtil.Count <AffectEffectProperty>() > 0) { affectEffectProperty = affectEffectPropertyListForUtil[0]; num = affectEffectProperty.GetPower(null); num3 = ExtraEffectUtil.GetExtraStageValue(num, monsterData, party, effectArray, affectEffectProperty, extraEffectType); } else { num = num3; } } else if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillHit) { List <AffectEffectProperty> affectEffectPropertyListForUtil2 = BattleServerControl.GetAffectEffectPropertyListForUtil(num.ToString()); if (affectEffectPropertyListForUtil2 != null && affectEffectPropertyListForUtil2.Count <AffectEffectProperty>() > 0) { affectEffectProperty = affectEffectPropertyListForUtil2[0]; num = (int)(affectEffectProperty.hitRate * 100f); num3 = ExtraEffectUtil.GetExtraStageValue(num, monsterData, party, effectArray, affectEffectProperty, extraEffectType); } else { num = num3; } } else { num3 = ExtraEffectUtil.GetExtraStageValue(num, monsterData, party, effectArray, affectEffectProperty, extraEffectType); } result = num3 + num2; change = 0; if (num2 > 0 || num < num3) { change = 1; } else if (num2 < 0 || num > num3) { change = -1; } }
public bool IsMatch(List <string> ExtraEffectIDList, MonsterData MonsterData) { return(ExtraEffectUtil.IsExtraEffectMonster(MonsterData, this.GetExtraEffectDataList(ExtraEffectIDList).ToArray())); }