private void setup(string iname, int grid_x, int grid_y, string tag, Unit creator, int create_clock, int rank, int rankcap) { if (string.IsNullOrEmpty(iname)) { return; } GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instanceDirect)) { return; } this.mTrickParam = instanceDirect.MasterParam.GetTrickParam(iname); if (this.mTrickParam == null) { return; } this.mRankCap = (OInt)Math.Max(rankcap, 1); this.mRank = (OInt)Math.Min(rank, (int)this.mRankCap); this.mBuffEffect = BuffEffect.CreateBuffEffect(instanceDirect.MasterParam.GetBuffEffectParam(this.mTrickParam.BuffId), (int)this.mRank, (int)this.mRankCap); this.mCondEffect = CondEffect.CreateCondEffect(instanceDirect.MasterParam.GetCondEffectParam(this.mTrickParam.CondId), (int)this.mRank, (int)this.mRankCap); this.mCreateUnit = creator; this.mGridX = (OInt)grid_x; this.mGridY = (OInt)grid_y; this.mTag = tag; this.mRestActionCount = this.mTrickParam.ActionCount; this.mCreateClock = (OInt)create_clock; this.mValid = (OBool)true; }
public void Setup(ConceptCardEffectsParam param, int lv, int lvcap, int awake_count, int awake_count_cap) { this.mEffectParam = param; this.mConditionsIname = param.cnds_iname; this.is_levelmax = lv >= lvcap; if (!string.IsNullOrEmpty(param.card_skill)) { this.mCardSkill = new SkillData(); this.mCardSkill.Setup(param.card_skill, lv, lvcap, (MasterParam)null); } if (!string.IsNullOrEmpty(param.add_card_skill_buff_awake) && awake_count > 0) { BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(param.add_card_skill_buff_awake); if (buffEffectParam != null) { this.mAddCardSkillBuffEffectAwake = BuffEffect.CreateBuffEffect(buffEffectParam, awake_count, awake_count_cap); } } if (!string.IsNullOrEmpty(param.add_card_skill_buff_lvmax) && lv >= lvcap && awake_count > 0) { BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(param.add_card_skill_buff_lvmax); if (buffEffectParam != null) { this.mAddCardSkillBuffEffectLvMax = BuffEffect.CreateBuffEffect(buffEffectParam, 1, 1); } } if (!string.IsNullOrEmpty(param.statusup_skill)) { this.mEquipSkill = new SkillData(); this.mEquipSkill.Setup(param.statusup_skill, lv, lvcap, (MasterParam)null); } if (!string.IsNullOrEmpty(param.skin)) { this.mSkin = param.skin; } if (!string.IsNullOrEmpty(param.abil_iname) && MonoSingleton <GameManager> .Instance.GetAbilityParam(param.abil_iname) != null) { this.mAbilityDefault = new AbilityData(); this.mAbilityDefault.Setup((UnitData)null, 0L, param.abil_iname, lv - 1, lvcap); this.mAbilityDefault.IsNoneCategory = true; this.mAbilityDefault.IsHideList = false; } if (string.IsNullOrEmpty(param.abil_iname) || string.IsNullOrEmpty(param.abil_iname_lvmax) || MonoSingleton <GameManager> .Instance.GetAbilityParam(param.abil_iname_lvmax) == null) { return; } this.mAbilityLvMax = new AbilityData(); this.mAbilityLvMax.Setup((UnitData)null, 0L, param.abil_iname_lvmax, lv - 1, lvcap); this.mAbilityLvMax.IsNoneCategory = true; this.mAbilityLvMax.IsHideList = false; }
public static bool IsEnableCardSkillForUnit(Unit target, SkillData card_skill) { if (target == null || card_skill == null || card_skill.SkillParam.condition != ESkillCondition.CardSkill) { return(false); } BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetBuffEffectParam(card_skill.SkillParam.target_buff_iname); if (buffEffectParam == null) { return(false); } return(BuffEffect.CreateBuffEffect(buffEffectParam, card_skill.Rank, card_skill.GetRankCap()).CheckEnableBuffTarget(target)); }
public BuffEffect CreateAddCardSkillBuffEffectAwake(int awake, int awake_cap) { if (string.IsNullOrEmpty(this.add_card_skill_buff_awake) || awake <= 0) { return((BuffEffect)null); } BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(this.add_card_skill_buff_awake); if (buffEffectParam == null) { return((BuffEffect)null); } return(BuffEffect.CreateBuffEffect(buffEffectParam, awake, awake_cap)); }
public void SetupLinkageBuff() { this.LinkageBuff = (BuffEffect)null; if (this.skill == null || this.mParam == null) { return; } string linkageBuffId = this.mParam.GetLinkageBuffId(this.Condition); if (string.IsNullOrEmpty(linkageBuffId)) { return; } this.LinkageBuff = BuffEffect.CreateBuffEffect(MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetBuffEffectParam(linkageBuffId), this.skill.Rank, this.skill.GetRankCap()); }
private void setup(string iname, Unit modify_unit, int rank, int rankcap) { if (string.IsNullOrEmpty(iname)) { return; } GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instanceDirect)) { return; } this.mWeatherParam = instanceDirect.MasterParam.GetWeatherParam(iname); if (this.mWeatherParam == null) { return; } this.mRankCap = (OInt)Math.Max(rankcap, 1); this.mRank = (OInt)Math.Min(rank, (int)this.mRankCap); this.mBuffEffectLists.Clear(); using (List <string> .Enumerator enumerator = this.mWeatherParam.BuffIdLists.GetEnumerator()) { while (enumerator.MoveNext()) { string current = enumerator.Current; BuffEffect buffEffect = BuffEffect.CreateBuffEffect(instanceDirect.MasterParam.GetBuffEffectParam(current), rank, rankcap); if (buffEffect != null) { this.mBuffEffectLists.Add(buffEffect); } } } this.mCondEffectLists.Clear(); using (List <string> .Enumerator enumerator = this.mWeatherParam.CondIdLists.GetEnumerator()) { while (enumerator.MoveNext()) { string current = enumerator.Current; CondEffect condEffect = CondEffect.CreateCondEffect(instanceDirect.MasterParam.GetCondEffectParam(current), rank, rankcap); if (condEffect != null) { this.mCondEffectLists.Add(condEffect); } } } this.mModifyUnit = modify_unit; }
public BuffEffect CreateAddCardSkillBuffEffectLvMax(int lv, int lv_cap, int awake) { if (lv < lv_cap) { return((BuffEffect)null); } if (string.IsNullOrEmpty(this.add_card_skill_buff_lvmax) || awake <= 0) { return((BuffEffect)null); } BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(this.add_card_skill_buff_lvmax); if (buffEffectParam == null) { return((BuffEffect)null); } return(BuffEffect.CreateBuffEffect(buffEffectParam, 1, 1)); }
public void Setup(string iname, int rank, int rankcap = 1, MasterParam master = null) { if (string.IsNullOrEmpty(iname)) { this.Reset(); } else { if (master == null) { master = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam; } this.mSkillParam = master.GetSkillParam(iname); this.mRankCap = (int)this.mSkillParam.lvcap != 0 ? (OInt)Math.Max((int)this.mSkillParam.lvcap, 1) : (OInt)Math.Max(rankcap, 1); this.mRank = (OInt)Math.Min(rank, (int)this.mRankCap); this.mTargetBuffEffect = BuffEffect.CreateBuffEffect(master.GetBuffEffectParam(this.SkillParam.target_buff_iname), (int)this.mRank, (int)this.mRankCap); this.mSelfBuffEffect = BuffEffect.CreateBuffEffect(master.GetBuffEffectParam(this.SkillParam.self_buff_iname), (int)this.mRank, (int)this.mRankCap); this.mTargetCondEffect = CondEffect.CreateCondEffect(master.GetCondEffectParam(this.SkillParam.target_cond_iname), (int)this.mRank, (int)this.mRankCap); this.mSelfCondEffect = CondEffect.CreateCondEffect(master.GetCondEffectParam(this.SkillParam.self_cond_iname), (int)this.mRank, (int)this.mRankCap); this.UpdateParam(); } }