void SetOffsetHP(FightDataFormat fightData) { if (fightData.Type == CHARACTER_TYPE.HERO) { var _heroAttributes = fightData.AttributeOriginCache as HeroAttributeFormat; var _attributesWithEquipment = HeroDataManager.Instance.CalculateAttributesWithEquipments(_heroAttributes, fightData.EquipmentList); var _INT = _attributesWithEquipment.INT; fightData.EquipmentList.ForEach(item => { var _attributeOffset = (item.AttributesBuff as HeroAttributeFormat); if (_attributeOffset != null) { _INT += (item.AttributesBuff as HeroAttributeFormat).INT; } }); var _HPMax = fightData.FinalAttributesCache.HPMax; var _HPOffset = _INT * (this.INTCp + base.root.Level * this.INTSp) + _HPMax * (this.HPMaxCp + base.root.Level * this.HPMaxSp) + this.NormCp + base.root.Level * this.NormSp; this.OffsetHP = Mathf.FloorToInt(_HPOffset); } else if (fightData.Type == CHARACTER_TYPE.ENEMY) { var _INT = 0.0F; var _HPMax = fightData.FinalAttributesCache.HPMax; var _HPOffset = _INT * (this.INTCp + base.root.Level * this.INTSp) + _HPMax * (this.HPMaxCp + base.root.Level * this.HPMaxSp) + this.NormCp + base.root.Level * this.NormSp; this.OffsetHP = Mathf.FloorToInt(_HPOffset); } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { this.OffsetHP = 0; if (base.TargetType == SKILL_TARGET_TYPE.SELF_GROUP) { this.SetOffsetHP(selfFightData); selfFightData.AttributesAggregateBuff.HP += this.OffsetHP; selfFightData.CalculateFinalAttributes(); if (this.OffsetHP > 0) { base.root.BattleInfoManagerScript.EnqueueMessage( INFO_FORMAT_LABEL.HP_UP, selfFightData, null, this.OffsetHP); } } else if (base.TargetType == SKILL_TARGET_TYPE.OTHER_GROUP) { this.SetOffsetHP(otherFightData); otherFightData.AttributesAggregateBuff.HP += this.OffsetHP; otherFightData.CalculateFinalAttributes(); if (this.OffsetHP > 0) { base.root.BattleInfoManagerScript.EnqueueMessage( INFO_FORMAT_LABEL.HP_UP, null, otherFightData, this.OffsetHP); } } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { if (selfFightData.OneTurnFightData.IsBlast.Value) { selfFightData.OneTurnFightData.BlastPower = base.root.Level * this.NormSp + this.NormCp; } }
public override bool CheckSuccess(FightDataFormat selfFightData, FightDataFormat otherFightData) { if (CheckInterrupt()) { return(false); } bool _result = false; if (this.SelfActiveState != TURN_STATES.NONE) { if (this.SelfActiveState == this.CurrentTurnState) { _result = true; } } // // if (this.OtherActiveState != TURN_STATES.NONE) // { // if (this.OtherActiveState == skill.TurnState) // { // _result = true; // } // } return(_result); }
void ChangeHitTarget(FightDataFormat selfFightData, Queue <AbsCharacterController> targetQueue) { switch (selfFightData.Type) { case CHARACTER_TYPE.HERO: { if (this.TargetType == SKILL_TARGET_TYPE.OTHER_GROUP) { var _manager = GameObject.FindObjectOfType <EnemyManager> (); Enqueue(targetQueue, _manager.AliveList); } break; } case CHARACTER_TYPE.ENEMY: { if (this.TargetType == SKILL_TARGET_TYPE.OTHER_GROUP) { var _manager = GameObject.FindObjectOfType <HeroManager> (); Enqueue(targetQueue, _manager.AliveList); } break; } default: break; } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { if (targetQueue.Count != 0 || selfFightData.FightType != BATTLE_FIGHT_TYPE.DEFENDER) { return; } switch (selfFightData.Type) { case CHARACTER_TYPE.HERO: { var _manager = GameObject.FindObjectOfType <HeroManager> (); this.Enqueue(targetQueue, _manager.AliveList, selfFightData.SlotID); break; } case CHARACTER_TYPE.ENEMY: { var _manager = GameObject.FindObjectOfType <EnemyManager> (); this.Enqueue(targetQueue, _manager.AliveList, selfFightData.SlotID); break; } default: break; } }
public void CheckSkillCondition(TURN_STATES state, FightDataFormat selfFightData, FightDataFormat otherFightData) { if (selfFightData.OneTurnFightData.AllSkillFailed != null && selfFightData.OneTurnFightData.AllSkillFailed.Value == true) { return; } var _currentStateSkillList = selfFightData.SkillList.FindAll(skill => { if (skill.Level < SkillOthers.LEVEL_MIN) { return(false); } if (skill.SkillCondition.IsActive == true) { return(false); } return(skill.SkillCondition.CheckState(state)); }); if (_currentStateSkillList == null) { return; } if (state == TURN_STATES.JUDGE_INITIATIVE_SKILL) { var _initProbabilitySkillList = _currentStateSkillList.FindAll(skill => { if (skill.SkillCondition.IsActive == true) { return(false); } var _targetTrigger = skill.SkillCondition.TriggerList.Find(trigger => { return(trigger.Type == SKILL_TRIGGER_TYPE.PROBABILITY && skill.Type == SKILL_TYPE.INITIATIVE); }); return(_targetTrigger != null); }); if (_initProbabilitySkillList != null) { InitiativeSkillDrawBySlot(_initProbabilitySkillList, selfFightData); } } _currentStateSkillList.ForEach(skill => { if (skill.SkillCondition.IsActive) { return; } if (skill.SkillCondition.CheckSuccess(selfFightData, otherFightData) && skill.Type != SKILL_TYPE.BUFF) { InfoManagerInstance.EnqueueMessage(INFO_FORMAT_LABEL.ACTIVE_SKILL, selfFightData, otherFightData, skill); } }); }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { var _has = selfFightData.OneTurnFightData.IgnoreDefenderAttributeList.Contains(ATTRIBUTE_TYPE.AC); if (!_has) { selfFightData.OneTurnFightData.IgnoreDefenderAttributeList.Add(ATTRIBUTE_TYPE.AC); } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { if (this.TargetType == SKILL_TARGET_TYPE.SELF_GROUP) { selfFightData.OneTurnFightData.AllSkillFailed = true; base.root.BattleInfoManagerScript.EnqueueMessage(INFO_FORMAT_LABEL.SKILL_MUST_FAILED, selfFightData, otherFightData); } }
public override bool CheckSuccess(FightDataFormat selfFightData, FightDataFormat otherFightData) { if (selfFightData.FightType == this.FightType) { return(true); } return(false); }
public override bool CheckSuccess(FightDataFormat selfFightData, FightDataFormat otherFightData) { if (this.IsForcedActive != null) { return(this.IsForcedActive.Value); } return(PJMath.ProbabilityHelper.TrySuccess(GetProbability())); }
public void ActiveSkill(TURN_STATES state, FightDataFormat selfFightData, FightDataFormat otherFightData = null, Queue <AbsCharacterController> targetQueue = null) { if (selfFightData.OneTurnFightData.AllSkillFailed != null && selfFightData.OneTurnFightData.AllSkillFailed.Value == true) { return; } CheckSkillCondition(state, selfFightData, otherFightData); ActiveEffect(state, selfFightData, otherFightData, targetQueue); }
public void Active(FightDataFormat fightData) { var _power = Mathf.FloorToInt(this.Power); fightData.AttributesAggregateBuff.HP -= _power; this.BattleInfoManagerScript.EnqueueMessage(ConstCollections.PJEnums.Battle.INFO_FORMAT_LABEL.SKILL_DOT_BURN_DAMAGE, fightData, null, _power); this.Damp(); }
public IEnumerator ActiveSkillCoroutine(TURN_STATES state, FightDataFormat selfFightData, FightDataFormat otherFightData = null, Queue <AbsCharacterController> targetQueue = null) { if (selfFightData.OneTurnFightData.AllSkillFailed != null && selfFightData.OneTurnFightData.AllSkillFailed.Value == true) { yield break; } CheckSkillCondition(state, selfFightData, otherFightData); ActiveEffect(state, selfFightData, otherFightData, targetQueue); yield break; }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { switch (this.Type) { case DOT_TYPE.BURN: { var _dotPoisonPower = 0.0F; var _posion = selfFightData.DotManager.DotList.Find(dot => dot.Type == DOT_TYPE.POISON); if (_posion != null) { _dotPoisonPower = _posion.Power; } float _VIT = 0; if (selfFightData.Type == CHARACTER_TYPE.HERO) { var _heroAttributes = selfFightData.AttributeOriginCache as HeroAttributeFormat; var _attributesWithEquipment = HeroDataManager.Instance.CalculateAttributesWithEquipments(_heroAttributes, selfFightData.EquipmentList); _VIT = _attributesWithEquipment.VIT; } this.Power = _VIT * (this.INTCp + base.root.Level * this.INTSp) + selfFightData.FinalAttributesCache.ATK * (this.ATKCp + base.root.Level * this.ATKSp) + _dotPoisonPower * this.PoisonCp; otherFightData.DotManager.Add(new DataManagement.GameData.FormatCollection.Battle.Dot.BattleDotFormat(this.Type, this.Power, this.Damp)); base.root.BattleInfoManagerScript.EnqueueMessage(INFO_FORMAT_LABEL.SKILL_DOT_BURN_ATTACH, null, otherFightData, Mathf.FloorToInt(this.Power)); break; } case DOT_TYPE.POISON: { float _VIT = 0; if (selfFightData.Type == CHARACTER_TYPE.HERO) { var _heroAttributes = selfFightData.AttributeOriginCache as HeroAttributeFormat; var _attributesWithEquipment = HeroDataManager.Instance.CalculateAttributesWithEquipments(_heroAttributes, selfFightData.EquipmentList); _VIT = _attributesWithEquipment.VIT; } var _power = _VIT * (this.INTCp + base.root.Level * this.INTSp) + selfFightData.FinalAttributesCache.ATK * (this.ATKCp + base.root.Level * this.ATKSp); otherFightData.DotManager.Add(new DataManagement.GameData.FormatCollection.Battle.Dot.BattleDotFormat(this.Type, _power, this.Damp)); break; } default: break; } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { selfFightData.OneTurnFightData.AttributesBuff.CRI += base.root.Level * this.CRISp; selfFightData.OneTurnFightData.AttributesBuff.AC += base.root.Level * this.ACSp; selfFightData.OneTurnFightData.AttributesBuff.RES += base.root.Level * this.RESSp; var _hp = Mathf.FloorToInt(base.root.Level * this.HPMaxSp); selfFightData.OneTurnFightData.AttributesBuff.HPMax += _hp; selfFightData.OneTurnFightData.AttributesBuff.HP += _hp; selfFightData.CalculateFinalAttributes(); }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { if (TargetType == SKILL_TARGET_TYPE.OTHER_GROUP) { float _damageATK = selfFightData.FinalAttributesCache.ATK; float _damageDeltaHP = selfFightData.FinalAttributesCache.HPMax - selfFightData.FinalAttributesCache.HP; float _damageNorm = this.root.Level * this.NormSp + this.NormCp; selfFightData.OneTurnFightData.AttackerPower = Mathf.FloorToInt(_damageATK + _damageDeltaHP * _damageNorm); Debug.LogWarningFormat("{0} LastStandAttackPower is actived", selfFightData.Type); } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { this.OffsetAttributes.ClearToZero(); var _roundOffset = 0; _roundOffset = base.root.Level / (int)this.AttributeTable.ATKSp; this.OffsetAttributes.ATK = this.AttributeTable.ATKCp + _roundOffset; _roundOffset = base.root.Level / (int)this.AttributeTable.DEFSp; this.OffsetAttributes.DEF = this.AttributeTable.DEFCp + _roundOffset; _roundOffset = base.root.Level / (int)this.AttributeTable.CRISp; this.OffsetAttributes.CRI = this.AttributeTable.CRICp + _roundOffset; _roundOffset = base.root.Level / (int)this.AttributeTable.AVDSp; this.OffsetAttributes.AVD = this.AttributeTable.AVDCp + _roundOffset; _roundOffset = base.root.Level / (int)this.AttributeTable.HITSp; this.OffsetAttributes.HIT = this.AttributeTable.HITCp + _roundOffset; _roundOffset = base.root.Level / (int)this.AttributeTable.ACSp; this.OffsetAttributes.AC = this.AttributeTable.ACCp + _roundOffset; if (base.TargetType == SKILL_TARGET_TYPE.SELF_GROUP) { if (this.AttributeTable.IsAggregate) { selfFightData.AttributesAggregateBuff += this.OffsetAttributes; } else { selfFightData.OneTurnFightData.AttributesBuff += this.OffsetAttributes; } selfFightData.CalculateFinalAttributes(); } else if (base.TargetType == SKILL_TARGET_TYPE.OTHER_GROUP) { if (this.AttributeTable.IsAggregate) { otherFightData.AttributesAggregateBuff += this.OffsetAttributes; } else { otherFightData.OneTurnFightData.AttributesBuff += this.OffsetAttributes; } otherFightData.CalculateFinalAttributes(); ShowDefenderInfo(selfFightData, otherFightData); } }
public bool ActiveEffect(TURN_STATES state, FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { bool _success = false; if (selfFightData.OneTurnFightData.AllSkillFailed != null && selfFightData.OneTurnFightData.AllSkillFailed.Value == true) { return(_success); } selfFightData.SkillList.ForEach(skill => { if (skill.SkillCondition.IsActive == false) { return; } // Not active yet & state var _targetList = skill.EffectList.FindAll(effect => { if (effect.EffectCondition.IsActive) { return(false); } return(effect.EffectCondition.CheckState(state)); }); if (_targetList == null) { return; } // Check condition & active effect _targetList.ForEach(effect => { effect.EffectCondition.CheckSuccess(selfFightData, otherFightData); if (effect.EffectCondition.IsActive) { effect.Active(selfFightData, otherFightData, targetQueue); _success = true; } else { // Debug.LogFormat("Effect [{0}] didn't active",effect); } }); }); return(_success); }
IMultiLangString <AbsMultiLanguageTable> GenerateCharacterName(FightDataFormat data) { if (data == null) { return(null); } IMultiLangString <AbsMultiLanguageTable> _strFormat = null; switch (data.Type) { case CHARACTER_TYPE.HERO: { var _attributes = data.AttributeOriginCache as HeroAttributeFormat; var _id = BattleStringFormatTableReader.Instance.FindID(INFO_FORMAT_LABEL.HERO_NAME); _strFormat = new MultiLangString <BattleStringFormatTable> (_id, BattleStringFormatTableReader.Instance, _attributes.NameString); break; } case CHARACTER_TYPE.ENEMY: { var _attributes = data.AttributeOriginCache as EnemyAttributeFormat; var _id = BattleStringFormatTableReader.Instance.FindID(INFO_FORMAT_LABEL.ENEMY_NAME); _strFormat = new MultiLangString <BattleStringFormatTable> (_id, BattleStringFormatTableReader.Instance, _attributes.NameString); break; } default: break; } if (_strFormat != null) { _strFormat.DisattachLangUpdate(); if (data.FightType == BATTLE_FIGHT_TYPE.DEFENDER) { _strFormat.PrefixSpaceNumber = this.DefenderSpace; } } return(_strFormat); }
public override bool CheckSuccess(FightDataFormat selfFightData, FightDataFormat otherFightData) { switch (this.CompareType) { case COMPARE_TYPE.GREATER: { var _attribute = selfFightData.FinalAttributesCache; var _delta = _attribute.ATK - _attribute.MAG; if (_delta > this.Delta_ATK_MAG) { return(PJMath.ProbabilityHelper.TrySuccess(this.Probability)); } return(false); } default: { return(false); } } }
void ShowDefenderInfo(FightDataFormat selfFightData, FightDataFormat otherFightData) { if (this.OffsetAttributes.AC < 0) { base.root.BattleInfoManagerScript.EnqueueMessage( INFO_FORMAT_LABEL.DEFENDER_AC_DOWN, selfFightData, otherFightData, Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.AC))); } else if (this.OffsetAttributes.ATK < 0 && this.OffsetAttributes.DEF < 0) { base.root.BattleInfoManagerScript.EnqueueMessage( INFO_FORMAT_LABEL.DEFENDER_ATK_DOWN_DEF_DOWN, selfFightData, otherFightData, Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.ATK)), Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.DEF))); } else if (this.OffsetAttributes.HIT < 0 && this.OffsetAttributes.AVD < 0) { if (this.OffsetAttributes.CRI < 0) { base.root.BattleInfoManagerScript.EnqueueMessage( INFO_FORMAT_LABEL.DEFENDER_HIT_DOWN_AVD_DOWN_CRI_DOWN, selfFightData, otherFightData, Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.HIT)), Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.AVD)), Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.CRI))); return; } base.root.BattleInfoManagerScript.EnqueueMessage( INFO_FORMAT_LABEL.DEFENDER_HIT_DOWN_AVD_DOWN, selfFightData, otherFightData, Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.HIT)), Mathf.Abs(Mathf.FloorToInt(this.OffsetAttributes.AVD))); } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { selfFightData.OneTurnFightData.SkillAffectRange = this.AffectRange; selfFightData.OneTurnFightData.SkillAffectType = this.AffectType; if (this.CustomAffectSlotIDList.Count > 0) { selfFightData.OneTurnFightData.SkillCustomAffectSlotIDList = this.CustomAffectSlotIDList.CloneEx(); } switch (this.AffectType) { case SKILL_AFFECT_TYPE.CHANGE_HIT_TARGET: { ChangeHitTarget(selfFightData, targetQueue); break; } default: break; } }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { selfFightData.SkillList.ForEach(skill => { skill.SkillCondition.TriggerList.ForEach(trigger => { ITrickLearning _iTrickLearning = trigger as ITrickLearning; if (_iTrickLearning != null && _iTrickLearning.EnableTrickLearning) { _iTrickLearning.TrickLearningOffset = skill.Level * this.trickLearningCp; } }); // skill.EffectList.ForEach(effect => { // effect.EffectCondition.TriggerList.ForEach(trigger =>{ // ITrickLearning _iTrickLearning = trigger as ITrickLearning; // if(_iTrickLearning != null) // { // _iTrickLearning.TrickLearningOffset = this.trickLearningOffset; // } // }); // }); }); }
IMultiLangString <AbsMultiLanguageTable> GenerateDamage(FightDataFormat attackerData, FightDataFormat defenderData) { IMultiLangString <AbsMultiLanguageTable> _damageString = null; if (attackerData.OneTurnFightData.IsBlast.Value) { var _id = BattleStringFormatTableReader.Instance.FindID(INFO_FORMAT_LABEL.BLAST_DAMAGE); _damageString = new MultiLangString <BattleStringFormatTable> (_id, BattleStringFormatTableReader.Instance, defenderData.OneTurnFightData.GetDamageFinal); } else { var _id = BattleStringFormatTableReader.Instance.FindID(INFO_FORMAT_LABEL.NORMAL_DAMAGE); _damageString = new MultiLangString <BattleStringFormatTable> (_id, BattleStringFormatTableReader.Instance, defenderData.OneTurnFightData.GetDamageFinal); } if (_damageString != null) { _damageString.DisattachLangUpdate(); } return(_damageString); }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { selfFightData.OneTurnFightData.IsHitSuccess = true; switch (selfFightData.Type) { case CHARACTER_TYPE.ENEMY: { var name = (selfFightData.AttributeOriginCache as EnemyAttributeFormat).NameString; Debug.LogWarningFormat("[Enemy] {0} : MUST_HIT actived", name); break; } case CHARACTER_TYPE.HERO: { var name = (selfFightData.AttributeOriginCache as HeroAttributeFormat).NameString; Debug.LogWarningFormat("[Hero] {0} : MUST_HIT actived", name); break; } default: break; } }
public int CalculateDamageToOther(FightDataFormat attacker, FightDataFormat defender) { return(attacker.OneTurnFightData.CalculateDamageToOther(attacker, defender)); }
public float CalculateAttackerPower(FightDataFormat attacker, FightDataFormat defender) { return(attacker.OneTurnFightData.CalculateAttackPower(attacker, defender)); }
public bool BlastSuccess(FightDataFormat attacker, FightDataFormat defender) { return(attacker.OneTurnFightData.BlastSuccess(attacker, defender)); }
public override void Active(FightDataFormat selfFightData, FightDataFormat otherFightData, Queue <AbsCharacterController> targetQueue) { selfFightData.OneTurnFightData.HitCount = this.HitCount; }