/// <summary> /// 發生於技能狀態變更時 /// </summary> protected virtual void OnStatusChanged(SkillStatus oldValue, SkillStatus newValue) { if (StatusChanged != null) { StatusChanged(this, oldValue, newValue); } }
public static bool CheckHasStatus(this SkillStatus input, SkillStatus condition) { bool result = true; result &= ((input & condition) != 0); return(result); }
public CharacterSkill(Character character, Skill skill, SkillStatus status, uint ranks) { this.character = character; Skill = skill; Status = status; Ranks = ranks; }
private IEnumerator PlaySkill(AffectEffectProperty affectEffectProperty, List <CharacterStateControl> targetList) { SubStatePlayHitAnimationAction.Data data = new SubStatePlayHitAnimationAction.Data(); foreach (CharacterStateControl characterStateControl in targetList) { if (!characterStateControl.isDied) { SkillResults skillResults; if (AffectEffectProperty.IsDamage(affectEffectProperty.type)) { skillResults = SkillStatus.GetStageDamageSkillResult(affectEffectProperty, null, characterStateControl); if (!skillResults.onMissHit) { if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountBarrier)) { this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountBarrier, characterStateControl, null); } else if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountEvasion)) { this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountEvasion, characterStateControl, null); } else if (skillResults.isGuard) { this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountGuard, characterStateControl, skillResults.damageRateResult.dataList.Select((SufferStateProperty.Data item) => item.id).ToArray <string>()); } } } else if (Tolerance.OnInfluenceToleranceAffectEffect(affectEffectProperty.type)) { skillResults = base.stateManager.skillDetails.GetToleranceSkillResult(affectEffectProperty, null, characterStateControl); if (!skillResults.onMissHit) { if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountBarrier)) { this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountBarrier, characterStateControl, null); } else if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountEvasion)) { this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountEvasion, characterStateControl, null); } } } else { skillResults = base.stateManager.skillDetails.GetOtherSkillResult(affectEffectProperty, null, characterStateControl); } data.AddHitIcon(characterStateControl, skillResults.hitIconAffectEffect, skillResults.attackPower, skillResults.onWeakHit, skillResults.onMissHit, skillResults.onCriticalHit, false, false, false, skillResults.extraEffectType); } } data.time = base.stateManager.stateProperty.multiHitIntervalWaitSecond; data.affectEffectProperty = affectEffectProperty; data.cameraKey = this.cameraKey; this.subStatePlayHitAnimationAction.Init(data); base.SetState(this.subStatePlayHitAnimationAction.GetType()); while (base.isWaitState) { yield return(null); } yield break; }
public static bool CheckHasStatus(this Poring poring, SkillStatus condition) { bool result = true; result &= ((poring.GetCurrentStatus() & condition) != 0); return(result); }
internal SkillResult Cast(BattleContext context) { SkillResult result = this.CanCast(context); if (result == SkillResult.Ok) { this.castingTime = 0; this.skillTime = 0; this.cd = this.Define.CD; this.Context = context; this.Hit = 0; this.Bullets.Clear(); this.AddBuff(TriggerType.SkillCast, this.Context.Target); if (this.Instant) { this.DoHit(); } else { if (this.Define.CastTime > 0) { this.Status = SkillStatus.Casting; } else { this.Status = SkillStatus.Running; } } } Log.InfoFormat("Skill[{0}].Cast Result:[{1}] Status:{2}", this.Define.Name, result, this.Status); return(result); }
/*冲刺爪击*/ protected void dashAttack() { SkillStatu = SkillStatus.DashAttack; //Debug.Log("dashAttack!"); //执行冲刺、攻击 SkillStatu = SkillStatus.Busy; StartCoroutine(recoverFromSkill(5)); }
protected override void OnStatusChanged(SkillStatus prevStatus, SkillStatus newStatus) { if (newStatus == SkillStatus.Swinging) { if (_frenzyBuff.State == BaseBuff.BuffState.Active) { _frenzyBuff.Faster(); } else { if (_frenzyBuff.State == BaseBuff.BuffState.Expired) { _frenzyBuff.Reset(); } var rank = GetSkillRank(); var incAttackSpeed = GetSkillDataValue <int>(rank, "IncreasedAttackSpeed"); var buffDuration = GetSkillDataValue <float>(rank, "IncreasedAttackSpeedDuration"); var attackSpeedMax = GetSkillDataValue <int>(rank, "IncreasedAttackSpeedMaximum"); _frenzyBuff.Set(incAttackSpeed, attackSpeedMax, buffDuration); _frenzyBuff.Start(); } hero.Controller.Animator.PlayState("BasicSwing", AnimationTime, true); } }
public void UpdateCount(SufferStateProperty.SufferType key, SkillStatus skillStatus = null) { List <SufferStatePropertyCounter.CountData> list = null; this.countDictionary.TryGetValue(key, out list); if (list == null || list.Count == 0) { return; } using (List <SufferStatePropertyCounter.CountData> .Enumerator enumerator = list.GetEnumerator()) { while (enumerator.MoveNext()) { SufferStatePropertyCounter.CountData countData = enumerator.Current; HaveSufferState currentSufferState = countData.characterStateControl.currentSufferState; if (currentSufferState.FindSufferState(key)) { SufferStateProperty sufferStateProperty = currentSufferState.GetSufferStateProperty(key); SufferStateProperty.Data[] array = sufferStateProperty.GetNotIsMultiHitThroughDatas(); if (!string.IsNullOrEmpty(countData.id)) { array = array.Where((SufferStateProperty.Data item) => countData.id == item.id).ToArray <SufferStateProperty.Data>(); } if (array.Length > 0) { sufferStateProperty.AddCurrentKeepCount(array, -1, skillStatus, countData.characterStateControl); } } } } }
public void AddSkillStatus(string key, SkillStatus value) { if (!string.IsNullOrEmpty(key) && value != null && !this.skillStatusDictionary.ContainsKey(key)) { this.skillStatusDictionary.Add(key, value); } }
public void BeginCast(Creature target, NVector3 pos) { this.IsCasting = true; this.castTime = 0; this.skillTime = 0; this.cd = this.Define.Cd; this.Hit = 0; this.Target = target; this.TargetPostion = pos; this.Owner.PlayAnim(this.Define.SkillAnim); this.Bullets.Clear(); this.HitMap.Clear(); if (this.Define.CastTarget == Common.Battle.TargetType.Position) { if (this.TargetPostion != null) { this.Owner.FaceTo(this.TargetPostion.ToVector3Int()); } } else if (this.Define.CastTarget == Common.Battle.TargetType.Target) { if (this.Target != null) { this.Owner.FaceTo(this.Target.position); } } if (this.Define.CastTime > 0) { this.Status = SkillStatus.Casting; } else { StarSkill(); } }
public void AddCurrentKeepCount(SufferStateProperty.Data[] datas, int value, SkillStatus skillStatus = null, CharacterStateControl control = null) { bool flag = false; foreach (SufferStateProperty.Data data in datas) { if (!data.doRoundUpdate) { if ((int)data.toleranceValue[14] == 2) { foreach (AffectEffectProperty affectEffectProperty in skillStatus.affectEffect) { if ((int)data.toleranceValue[(int)affectEffectProperty.attribute] != 0) { flag = true; } } } else { flag = true; } } if (flag && data.isActive && data.removeOptionType != SufferStateProperty.RemoveOptionType.Not) { data.currentKeepRound += value; if (data.currentKeepRound <= 0) { data.isActive = false; data.currentKeepRound = -1; } } } }
public SkillStatus GetSkillStatus(string key) { SkillStatus result = null; this.skillStatusDictionary.TryGetValue(key, out result); return(result); }
/// <summary> /// Check a rank against the skill charts too determine if the skill is at max /// </summary> /// <returns>Returns true if skill is max rank; false if skill is below max rank</returns> private bool IsSkillMaxRank(uint rank, SkillStatus status) { List <uint> xpList; var xpTable = DatManager.PortalDat.XpTable; if (status == SkillStatus.Trained) { xpList = xpTable.TrainedSkillXpList; } else if (status == SkillStatus.Specialized) { xpList = xpTable.SpecializedSkillXpList; } else { throw new Exception(); } if (rank == (xpList.Count - 1)) { return(true); } return(false); }
protected override void OnStatusChanged(SkillStatus prevStatus, SkillStatus newStatus) { if (newStatus == SkillStatus.Swinging) { hero.Controller.AnimateToDestination(destination, 18f); } }
private IEnumerator PlayDefaultEffect(ExtraEffectStatus extraEffectStatus) { List <CharacterStateControl> targetList = new List <CharacterStateControl>(); foreach (CharacterStateControl characterStateControl in base.battleStateData.GetTotalCharacters()) { if (!characterStateControl.isDied && extraEffectStatus.IsHitExtraEffect(characterStateControl, EffectStatusBase.ExtraEffectType.Skill)) { targetList.Add(characterStateControl); } } if (targetList.Count == 0) { yield break; } if (!this.isShowBattleStageEffect) { base.stateManager.uiControl.ShowBattleExtraEffect(BattleExtraEffectUI.AnimationType.Stage); yield return(null); while (base.stateManager.uiControl.IsBattleExtraEffect()) { yield return(null); } base.stateManager.uiControl.HideBattleExtraEffect(); this.isShowBattleStageEffect = true; } string key = ((int)extraEffectStatus.EffectValue).ToString(); SkillStatus status = base.hierarchyData.GetSkillStatus(key); IEnumerator playFunction = null; if (status != null) { playFunction = this.PlaySkill(status, targetList); } else { playFunction = this.PlayNotSkill(extraEffectStatus, targetList); } while (playFunction.MoveNext()) { yield return(null); } this.subStateEnemiesItemDroppingFunction.Init(targetList.Where((CharacterStateControl item) => item.isDied).ToArray <CharacterStateControl>()); base.SetState(this.subStateEnemiesItemDroppingFunction.GetType()); while (base.isWaitState) { yield return(null); } IEnumerator wait = base.stateManager.time.WaitForCertainPeriodTimeAction(base.stateManager.stateProperty.skillAfterWaitSecond, null, null); while (wait.MoveNext()) { object obj = wait.Current; yield return(obj); } base.stateManager.uiControl.HideCharacterHUDFunction(); base.stateManager.uiControl.ApplyHideHitIcon(); yield break; }
/*喷射火焰*/ protected void projectFire() { SkillStatu = SkillStatus.ProjectFire; //Debug.Log("projectFire!"); //执行动画,产生发射物 SkillStatu = SkillStatus.Busy; StartCoroutine(recoverFromSkill(4)); }
private IEnumerator PlaySkill(SkillStatus status, List <CharacterStateControl> targetList) { foreach (CharacterStateControl characterStateControl in this.GetTotalCharacters()) { characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.DamagePossibility); } foreach (AffectEffectProperty affectEffectProperty in status.affectEffect) { int hitNumber = 1; if (AffectEffectProperty.IsDamage(affectEffectProperty.type)) { hitNumber = affectEffectProperty.hitNumber; } for (int i = 0; i < hitNumber; i++) { IEnumerator playSkill = this.PlaySkill(affectEffectProperty, targetList); while (playSkill.MoveNext()) { yield return(null); } } } foreach (CharacterStateControl characterStateControl2 in this.GetTotalCharacters()) { characterStateControl2.ClearGutsData(); } this.sufferStatePropertyCounter.UpdateCount(SufferStateProperty.SufferType.CountGuard, null); this.sufferStatePropertyCounter.UpdateCount(SufferStateProperty.SufferType.CountBarrier, null); this.sufferStatePropertyCounter.UpdateCount(SufferStateProperty.SufferType.CountEvasion, null); yield break; }
/*普通攻击*/ protected void attack() { if (SkillStatu != SkillStatus.Attack) { //开始攻击 SkillStatu = SkillStatus.Attack; //Debug.Log("attack!"); //执行攻击 MonsterAnimator.SetTrigger("SwordAttack"); } else { //正在攻击 AnimatorClipInfo[] animatorClipInfos = MonsterAnimator.GetCurrentAnimatorClipInfo(0); if (animatorClipInfos[0].clip.name == "Idel") { //已经攻击完毕 //Debug.Log("攻击完毕!"); SkillStatu = SkillStatus.Busy; StartCoroutine(recoverFromSkill(3)); } else { } } }
protected override void OnStatusChanged(SkillStatus prevStatus, SkillStatus newStatus) { if (newStatus == SkillStatus.Swinging) { hero.Controller.Animator.PlayState("BasicSwing", AnimationTime, true); } }
public void AutoPlayCharacterAndSkillSelectFunction(CharacterStateControl currentCharacter) { if (currentCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.SkillLock)) { currentCharacter.isSelectSkill = 0; } else { currentCharacter.isSelectSkill = 0; SkillStatus[] array = currentCharacter.skillStatus.Where((SkillStatus item) => item.skillId != this.stateManager.publicAttackSkillId).ToArray <SkillStatus>(); int num = currentCharacter.SkillIdToIndexOf(base.stateManager.publicAttackSkillId); SkillStatus skillStatus = currentCharacter.skillStatus[num]; foreach (SkillStatus skillStatus2 in array) { if (skillStatus2.skillType == SkillType.Deathblow) { skillStatus = skillStatus2; break; } } for (int j = 0; j < currentCharacter.skillStatus.Length; j++) { if (currentCharacter.skillStatus[j] == skillStatus && currentCharacter.isUseSkill(j)) { currentCharacter.isSelectSkill = j; break; } } } CharacterStateControl[] characterStatus = null; switch (currentCharacter.currentSkillStatus.target) { case EffectTarget.Enemy: characterStatus = base.battleStateData.enemies; break; case EffectTarget.Ally: characterStatus = base.battleStateData.playerCharacters; break; case EffectTarget.Attacker: characterStatus = new CharacterStateControl[] { currentCharacter }; break; case EffectTarget.EnemyWithoutAttacker: characterStatus = base.battleStateData.enemies.Where((CharacterStateControl item) => item.myIndex != currentCharacter.myIndex).ToArray <CharacterStateControl>(); break; case EffectTarget.AllyWithoutAttacker: characterStatus = base.battleStateData.playerCharacters.Where((CharacterStateControl item) => item.myIndex != currentCharacter.myIndex).ToArray <CharacterStateControl>(); break; } CharacterStateControl[] aliveCharacters = CharacterStateControl.GetAliveCharacters(characterStatus); CharacterStateControl[] array3 = CharacterStateControlSorter.SortedTargetSelect(aliveCharacters, currentCharacter.currentSkillStatus, null); currentCharacter.targetCharacter = array3[0]; }
public EffectReceiver(EffectReceiver baseObj) { OwnerId = baseObj.OwnerId; EffectDuration = baseObj.EffectDuration; Status = baseObj.Status; Particle = baseObj.Particle; Damage = baseObj.Damage; }
public virtual void OnSkillEvent(SkillStatus status, Skill skill) { if (status == SkillStatus.EndSkill) { Debug.Log("Skill end event "); PlayerRoundFinished(); } }
private void BroadCastSkillStateEvent(SkillStatus status) { this.status = status; if (onSkillEvent != null) { onSkillEvent(status, this); } }
public CharacterSkill(Character character, Skill skill, SkillStatus status, uint ranks, uint xpSpent) { this.character = character; Skill = skill; Status = status; Ranks = ranks; ExperienceSpent = xpSpent; }
void CastDenial() { if (Input.GetButton("Fire2")) { currentMouseStatus = SkillStatus.None; } // Get casting starting point. if (Input.GetButtonDown("Fire1") && currentMouseStatus == SkillStatus.None) { worldClickPoint = new Vector3(mainCamera.ScreenToWorldPoint(Input.mousePosition).x, mainCamera.ScreenToWorldPoint(Input.mousePosition).y, 0); denialStartPosition = worldClickPoint; line.SetPosition(0, denialStartPosition); currentMouseStatus = SkillStatus.ButtonDown; } if (currentMouseStatus == SkillStatus.ButtonDown) { worldClickPoint = new Vector3(mainCamera.ScreenToWorldPoint(Input.mousePosition).x, mainCamera.ScreenToWorldPoint(Input.mousePosition).y, 0); line.SetPosition(1, worldClickPoint); if (CheckBarrierObstructionAvailablity(denialStartPosition, worldClickPoint)) { line.material.color = Color.blue; } else { line.material.color = Color.red; } } // Get casting ending point. if (Input.GetButtonUp("Fire1") && currentMouseStatus == SkillStatus.ButtonDown) { worldClickPoint = new Vector3(mainCamera.ScreenToWorldPoint(Input.mousePosition).x, mainCamera.ScreenToWorldPoint(Input.mousePosition).y, 0); denialEndPosition = worldClickPoint; currentMouseStatus = SkillStatus.ButtonUp; } if (currentMouseStatus == SkillStatus.ButtonUp) { if (CheckBarrierDistanceAvailablity(denialStartPosition, denialEndPosition) && CheckBarrierObstructionAvailablity(denialStartPosition, denialEndPosition)) { SpawnBarrier(denialStartPosition, denialEndPosition); } currentMouseStatus = SkillStatus.None; line.SetPosition(0, Vector3.zero); line.SetPosition(1, Vector3.zero); } }
public async Task <Character> LoadCharacter(uint id) { MySqlResult result = await SelectPreparedStatementAsync(CharacterPreparedStatement.CharacterSelect, id); Character c = null; if (result?.Count > 0) { uint guid = result.Read <uint>(0, "guid"); uint accountId = result.Read <uint>(0, "accountId"); c = new Character(guid, accountId); c.Name = result.Read <string>(0, "name"); c.TemplateOption = result.Read <uint>(0, "templateOption"); c.StartArea = result.Read <uint>(0, "startArea"); c.IsAdmin = result.Read <bool>(0, "isAdmin"); c.IsEnvoy = result.Read <bool>(0, "isEnvoy"); c.Position = await this.GetPosition(guid); result = await SelectPreparedStatementAsync(CharacterPreparedStatement.CharacterSkillsSelect, id); for (uint i = 0; i < result?.Count; i++) { Skill s = result.Read <Skill>(i, "skillId"); SkillStatus ss = result.Read <SkillStatus>(i, "skillStatus"); uint ranks = result.Read <uint>(i, "skillPoints"); c.Skills.Add(s, new CharacterSkill(c, s, ss, ranks)); } result = await SelectPreparedStatementAsync(CharacterPreparedStatement.CharacterStatsSelect, id); if (result?.Count > 0) { c.Strength.Base = result.Read <uint>(0, "strength"); c.Strength.Ranks = result.Read <uint>(0, "strength_ranks"); c.Endurance.Base = result.Read <uint>(0, "endurance"); c.Endurance.Ranks = result.Read <uint>(0, "endurance_ranks"); c.Coordination.Base = result.Read <uint>(0, "coordination"); c.Coordination.Ranks = result.Read <uint>(0, "coordination_ranks"); c.Quickness.Base = result.Read <uint>(0, "quickness"); c.Quickness.Ranks = result.Read <uint>(0, "quickness_ranks"); c.Focus.Base = result.Read <uint>(0, "focus"); c.Focus.Ranks = result.Read <uint>(0, "focus_ranks"); c.Self.Base = result.Read <uint>(0, "self"); c.Self.Ranks = result.Read <uint>(0, "self_ranks"); c.Health.Ranks = result.Read <uint>(0, "health_ranks"); c.Health.Current = result.Read <uint>(0, "health_current"); c.Stamina.Ranks = result.Read <uint>(0, "stamina_ranks"); c.Stamina.Current = result.Read <uint>(0, "stamina_current"); c.Mana.Ranks = result.Read <uint>(0, "mana_ranks"); c.Mana.Current = result.Read <uint>(0, "mana_current"); } } return(c); }
public GameEventPrivateUpdateSkill(Session session, Skill skill, SkillStatus status, uint ranks, uint baseValue, uint totalInvestment) : base(session) { this.skill = skill; this.status = status; this.ranks = ranks; this.baseValue = baseValue; this.totalInvestment = totalInvestment; }
private void InitSkillUseCount() { this.skillUseCounts = new int[this._skillStatus.Length]; for (int i = 0; i < this.skillUseCounts.Length; i++) { SkillStatus skillStatus = this._skillStatus[i]; this.skillUseCounts[i] = skillStatus.useCountValue; } }
private void SetSkillIndex(int index) { SkillStatus skillStatus = SkillStatus.idle; switch (index) { case 1: skillStatus = SkillStatus.skill1; break; case 2: skillStatus = SkillStatus.skill2; break; case 3: skillStatus = SkillStatus.skill3; break; case 4: skillStatus = SkillStatus.skill4; break; case 5: skillStatus = SkillStatus.attack1; break; case 6: skillStatus = SkillStatus.attack2; break; case 7: skillStatus = SkillStatus.attack3; break; case 8: skillStatus = SkillStatus.attack4; break; case 9: skillStatus = SkillStatus.run; break; case 10: skillStatus = SkillStatus.hit; break; case 11: skillStatus = SkillStatus.prepare; break; default: skillStatus = SkillStatus.idle; break; } SetCurCharacterStateStatus(skillStatus); }