private bool checkTiming(EffectCheckTimings chk_timing) { if (this.mBuffEffect == null) { return(false); } bool flag = false; foreach (BuffEffectParam.Buff buff in this.mBuffEffect.param.buffs) { switch (buff.type) { case ParamTypes.Mov: case ParamTypes.Jmp: flag = true; break; } } switch (chk_timing) { case EffectCheckTimings.Moment: return(!flag); case EffectCheckTimings.MomentStart: return(flag); default: return(false); } }
private bool actionBuff(Unit target, EffectCheckTimings chk_timing, RandXorshift rand = null) { if (this.mBuffEffect == null || target == null || !this.mBuffEffect.CheckEnableBuffTarget(target)) { return(false); } if (rand != null) { int rate = (int)this.mBuffEffect.param.rate; if (0 < rate && rate < 100 && (int)(rand.Get() % 100U) > rate) { return(true); } } BaseStatus status1 = new BaseStatus(); BaseStatus status2 = new BaseStatus(); BaseStatus status3 = new BaseStatus(); BaseStatus status4 = new BaseStatus(); BaseStatus status5 = new BaseStatus(); BaseStatus status6 = new BaseStatus(); this.mBuffEffect.CalcBuffStatus(ref status1, target.Element, BuffTypes.Buff, true, false, SkillParamCalcTypes.Add, 0); this.mBuffEffect.CalcBuffStatus(ref status2, target.Element, BuffTypes.Buff, true, true, SkillParamCalcTypes.Add, 0); this.mBuffEffect.CalcBuffStatus(ref status3, target.Element, BuffTypes.Buff, false, false, SkillParamCalcTypes.Scale, 0); this.mBuffEffect.CalcBuffStatus(ref status4, target.Element, BuffTypes.Debuff, true, false, SkillParamCalcTypes.Add, 0); this.mBuffEffect.CalcBuffStatus(ref status5, target.Element, BuffTypes.Debuff, true, true, SkillParamCalcTypes.Add, 0); this.mBuffEffect.CalcBuffStatus(ref status6, target.Element, BuffTypes.Debuff, false, false, SkillParamCalcTypes.Scale, 0); if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Add, false)) { BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Buff, false, SkillParamCalcTypes.Add, status1, chk_timing); target.SetBuffAttachment(buffAttachment, false); } if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Add, true)) { BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Buff, true, SkillParamCalcTypes.Add, status2, chk_timing); target.SetBuffAttachment(buffAttachment, false); } if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Scale)) { BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Buff, false, SkillParamCalcTypes.Scale, status3, chk_timing); target.SetBuffAttachment(buffAttachment, false); } if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Add, false)) { BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Debuff, false, SkillParamCalcTypes.Add, status4, chk_timing); target.SetBuffAttachment(buffAttachment, false); } if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Add, true)) { BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Debuff, true, SkillParamCalcTypes.Add, status5, chk_timing); target.SetBuffAttachment(buffAttachment, false); } if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Scale)) { BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Debuff, false, SkillParamCalcTypes.Scale, status6, chk_timing); target.SetBuffAttachment(buffAttachment, false); } return(true); }
public bool Deserialize(JSON_CondEffectParam json) { if (json == null) { return(false); } this.iname = json.iname; this.job = json.job; this.buki = json.buki; this.birth = json.birth; this.sex = (ESex)json.sex; this.elem = (EElement)json.elem; this.cond = (ESkillCondition)json.cond; this.type = (ConditionEffectTypes)json.type; this.chk_target = (EffectCheckTargets)json.chktgt; this.chk_timing = (EffectCheckTimings)json.timing; this.value_ini = (OInt)json.vini; this.value_max = (OInt)json.vmax; this.rate_ini = (OInt)json.rini; this.rate_max = (OInt)json.rmax; this.turn_ini = (OInt)json.tini; this.turn_max = (OInt)json.tmax; this.curse = (OInt)json.curse; this.conditions = (EUnitCondition[])null; if (json.conds != null) { this.conditions = new EUnitCondition[json.conds.Length]; for (int index = 0; index < json.conds.Length; ++index) { if (json.conds[index] >= 0) { this.conditions[index] = (EUnitCondition)(1 << json.conds[index]); } } } this.v_poison_rate = (OInt)json.v_poi; this.v_poison_fix = (OInt)json.v_poifix; this.v_paralyse_rate = (OInt)json.v_par; this.v_blink_hit = (OInt)json.v_blihit; this.v_blink_avo = (OInt)json.v_bliavo; this.v_death_count = (OInt)json.v_dea; this.v_berserk_atk = (OInt)json.v_beratk; this.v_berserk_def = (OInt)json.v_berdef; this.v_fast = (OInt)json.v_fast; this.v_slow = (OInt)json.v_slow; this.v_donmov = (OInt)json.v_don; this.v_auto_hp_heal = (OInt)json.v_ahp; this.v_auto_mp_heal = (OInt)json.v_amp; this.v_auto_hp_heal_fix = (OInt)json.v_ahpfix; this.v_auto_mp_heal_fix = (OInt)json.v_ampfix; return(true); }
public static void MomentBuff(Unit target, int grid_x, int grid_y, EffectCheckTimings chk_timing = EffectCheckTimings.Moment) { if (target == null) { return; } TrickData trickData = TrickData.SearchEffect(grid_x, grid_y); if (trickData == null || !trickData.checkTarget(target, false) || !trickData.checkTiming(chk_timing)) { return; } trickData.actionBuff(target, chk_timing, (RandXorshift)null); }
public bool Deserialize(JSON_BuffEffectParam json) { if (json == null) { return(false); } this.iname = json.iname; this.job = json.job; this.buki = json.buki; this.birth = json.birth; this.sex = (ESex)json.sex; this.un_group = json.un_group; this.elem = Convert.ToInt32(json.elem.ToString("d7"), 2); this.rate = (OInt)json.rate; this.turn = (OInt)json.turn; this.chk_target = (EffectCheckTargets)json.chktgt; this.chk_timing = (EffectCheckTimings)json.timing; this.cond = (ESkillCondition)json.cond; this.mIsUpBuff = (OBool)false; this.mUpTiming = (EffectCheckTimings)json.up_timing; this.mAppType = (EAppType)json.app_type; this.mAppMct = json.app_mct; this.mEffRange = (EEffRange)json.eff_range; this.mFlags = (BuffFlags)0; if (json.is_up_rep != 0) { this.mFlags |= BuffFlags.UpReplenish; } if (json.is_no_dis != 0) { this.mFlags |= BuffFlags.NoDisabled; } if (json.is_no_bt != 0) { this.mFlags |= BuffFlags.NoBuffTurn; } ParamTypes type1 = (ParamTypes)json.type1; ParamTypes type2 = (ParamTypes)json.type2; ParamTypes type3 = (ParamTypes)json.type3; ParamTypes type4 = (ParamTypes)json.type4; ParamTypes type5 = (ParamTypes)json.type5; ParamTypes type6 = (ParamTypes)json.type6; ParamTypes type7 = (ParamTypes)json.type7; ParamTypes type8 = (ParamTypes)json.type8; ParamTypes type9 = (ParamTypes)json.type9; ParamTypes type10 = (ParamTypes)json.type10; ParamTypes type11 = (ParamTypes)json.type11; int length = 0; if (type1 != ParamTypes.None) { ++length; } if (type2 != ParamTypes.None) { ++length; } if (type3 != ParamTypes.None) { ++length; } if (type4 != ParamTypes.None) { ++length; } if (type5 != ParamTypes.None) { ++length; } if (type6 != ParamTypes.None) { ++length; } if (type7 != ParamTypes.None) { ++length; } if (type8 != ParamTypes.None) { ++length; } if (type9 != ParamTypes.None) { ++length; } if (type10 != ParamTypes.None) { ++length; } if (type11 != ParamTypes.None) { ++length; } if (length > 0) { this.buffs = new BuffEffectParam.Buff[length]; int index = 0; if (type1 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type1; this.buffs[index].value_ini = (OInt)json.vini1; this.buffs[index].value_max = (OInt)json.vmax1; this.buffs[index].value_one = (OInt)json.vone1; this.buffs[index].calc = (SkillParamCalcTypes)json.calc1; ++index; } if (type2 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type2; this.buffs[index].value_ini = (OInt)json.vini2; this.buffs[index].value_max = (OInt)json.vmax2; this.buffs[index].value_one = (OInt)json.vone2; this.buffs[index].calc = (SkillParamCalcTypes)json.calc2; ++index; } if (type3 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type3; this.buffs[index].value_ini = (OInt)json.vini3; this.buffs[index].value_max = (OInt)json.vmax3; this.buffs[index].value_one = (OInt)json.vone3; this.buffs[index].calc = (SkillParamCalcTypes)json.calc3; ++index; } if (type4 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type4; this.buffs[index].value_ini = (OInt)json.vini4; this.buffs[index].value_max = (OInt)json.vmax4; this.buffs[index].value_one = (OInt)json.vone4; this.buffs[index].calc = (SkillParamCalcTypes)json.calc4; ++index; } if (type5 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type5; this.buffs[index].value_ini = (OInt)json.vini5; this.buffs[index].value_max = (OInt)json.vmax5; this.buffs[index].value_one = (OInt)json.vone5; this.buffs[index].calc = (SkillParamCalcTypes)json.calc5; ++index; } if (type6 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type6; this.buffs[index].value_ini = (OInt)json.vini6; this.buffs[index].value_max = (OInt)json.vmax6; this.buffs[index].value_one = (OInt)json.vone6; this.buffs[index].calc = (SkillParamCalcTypes)json.calc6; ++index; } if (type7 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type7; this.buffs[index].value_ini = (OInt)json.vini7; this.buffs[index].value_max = (OInt)json.vmax7; this.buffs[index].value_one = (OInt)json.vone7; this.buffs[index].calc = (SkillParamCalcTypes)json.calc7; ++index; } if (type8 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type8; this.buffs[index].value_ini = (OInt)json.vini8; this.buffs[index].value_max = (OInt)json.vmax8; this.buffs[index].value_one = (OInt)json.vone8; this.buffs[index].calc = (SkillParamCalcTypes)json.calc8; ++index; } if (type9 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type9; this.buffs[index].value_ini = (OInt)json.vini9; this.buffs[index].value_max = (OInt)json.vmax9; this.buffs[index].value_one = (OInt)json.vone9; this.buffs[index].calc = (SkillParamCalcTypes)json.calc9; ++index; } if (type10 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type10; this.buffs[index].value_ini = (OInt)json.vini10; this.buffs[index].value_max = (OInt)json.vmax10; this.buffs[index].value_one = (OInt)json.vone10; this.buffs[index].calc = (SkillParamCalcTypes)json.calc10; ++index; } if (type11 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type11; this.buffs[index].value_ini = (OInt)json.vini11; this.buffs[index].value_max = (OInt)json.vmax11; this.buffs[index].value_one = (OInt)json.vone11; this.buffs[index].calc = (SkillParamCalcTypes)json.calc11; int num = index + 1; } foreach (BuffEffectParam.Buff buff in this.buffs) { if ((int)buff.value_one != 0) { this.mIsUpBuff = (OBool)true; break; } } } if (json.custom_targets != null) { this.custom_targets = new string[json.custom_targets.Length]; for (int index = 0; index < json.custom_targets.Length; ++index) { this.custom_targets[index] = json.custom_targets[index]; } } return(true); }
private BuffAttachment createBuffAttachment(Unit target, BuffTypes buff_type, bool is_negative_value_is_buff, SkillParamCalcTypes calc_type, BaseStatus status, EffectCheckTimings chk_timing) { if (this.mBuffEffect == null) { return((BuffAttachment)null); } BuffAttachment buffAttachment = new BuffAttachment(this.mBuffEffect.param); buffAttachment.user = this.mCreateUnit; buffAttachment.skill = (SkillData)null; buffAttachment.skilltarget = SkillEffectTargets.Self; buffAttachment.IsPassive = (OBool)false; buffAttachment.CheckTarget = (Unit)null; buffAttachment.DuplicateCount = 0; buffAttachment.CheckTiming = chk_timing; buffAttachment.turn = (OInt)1; buffAttachment.BuffType = buff_type; buffAttachment.IsNegativeValueIsBuff = is_negative_value_is_buff; buffAttachment.CalcType = calc_type; buffAttachment.UseCondition = this.mBuffEffect.param.cond; status.CopyTo(buffAttachment.status); return(buffAttachment); }
public bool Deserialize(JSON_BuffEffectParam json) { if (json == null) { return(false); } this.iname = json.iname; this.job = json.job; this.buki = json.buki; this.birth = json.birth; this.sex = (ESex)json.sex; this.elem = Convert.ToInt32(json.elem.ToString("d7"), 2); this.rate = (OInt)json.rate; this.turn = (OInt)json.turn; this.chk_target = (EffectCheckTargets)json.chktgt; this.chk_timing = (EffectCheckTimings)json.timing; this.cond = (ESkillCondition)json.cond; this.mAppType = (EAppType)json.app_type; this.mAppMct = json.app_mct; this.mEffRange = (EEffRange)json.eff_range; ParamTypes type1 = (ParamTypes)json.type1; ParamTypes type2 = (ParamTypes)json.type2; ParamTypes type3 = (ParamTypes)json.type3; ParamTypes type4 = (ParamTypes)json.type4; ParamTypes type5 = (ParamTypes)json.type5; ParamTypes type6 = (ParamTypes)json.type6; ParamTypes type7 = (ParamTypes)json.type7; ParamTypes type8 = (ParamTypes)json.type8; ParamTypes type9 = (ParamTypes)json.type9; ParamTypes type10 = (ParamTypes)json.type10; int length = 0; if (type1 != ParamTypes.None) { ++length; } if (type2 != ParamTypes.None) { ++length; } if (type3 != ParamTypes.None) { ++length; } if (type4 != ParamTypes.None) { ++length; } if (type5 != ParamTypes.None) { ++length; } if (type6 != ParamTypes.None) { ++length; } if (type7 != ParamTypes.None) { ++length; } if (type8 != ParamTypes.None) { ++length; } if (type9 != ParamTypes.None) { ++length; } if (type10 != ParamTypes.None) { ++length; } if (length > 0) { this.buffs = new BuffEffectParam.Buff[length]; int index = 0; if (type1 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type1; this.buffs[index].value_ini = (OInt)json.vini1; this.buffs[index].value_max = (OInt)json.vmax1; this.buffs[index].calc = (SkillParamCalcTypes)json.calc1; ++index; } if (type2 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type2; this.buffs[index].value_ini = (OInt)json.vini2; this.buffs[index].value_max = (OInt)json.vmax2; this.buffs[index].calc = (SkillParamCalcTypes)json.calc2; ++index; } if (type3 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type3; this.buffs[index].value_ini = (OInt)json.vini3; this.buffs[index].value_max = (OInt)json.vmax3; this.buffs[index].calc = (SkillParamCalcTypes)json.calc3; ++index; } if (type4 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type4; this.buffs[index].value_ini = (OInt)json.vini4; this.buffs[index].value_max = (OInt)json.vmax4; this.buffs[index].calc = (SkillParamCalcTypes)json.calc4; ++index; } if (type5 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type5; this.buffs[index].value_ini = (OInt)json.vini5; this.buffs[index].value_max = (OInt)json.vmax5; this.buffs[index].calc = (SkillParamCalcTypes)json.calc5; ++index; } if (type6 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type6; this.buffs[index].value_ini = (OInt)json.vini6; this.buffs[index].value_max = (OInt)json.vmax6; this.buffs[index].calc = (SkillParamCalcTypes)json.calc6; ++index; } if (type7 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type7; this.buffs[index].value_ini = (OInt)json.vini7; this.buffs[index].value_max = (OInt)json.vmax7; this.buffs[index].calc = (SkillParamCalcTypes)json.calc7; ++index; } if (type8 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type8; this.buffs[index].value_ini = (OInt)json.vini8; this.buffs[index].value_max = (OInt)json.vmax8; this.buffs[index].calc = (SkillParamCalcTypes)json.calc8; ++index; } if (type9 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type9; this.buffs[index].value_ini = (OInt)json.vini9; this.buffs[index].value_max = (OInt)json.vmax9; this.buffs[index].calc = (SkillParamCalcTypes)json.calc9; ++index; } if (type10 != ParamTypes.None) { this.buffs[index] = new BuffEffectParam.Buff(); this.buffs[index].type = type10; this.buffs[index].value_ini = (OInt)json.vini10; this.buffs[index].value_max = (OInt)json.vmax10; this.buffs[index].calc = (SkillParamCalcTypes)json.calc10; int num = index + 1; } } return(true); }