private void OnRefreshSkillItems() { foreach (var current in mSkillBtns) { ESkillPos pos = current.Key; ActSkill skill = CharacterManager.Main.Skill.GetSkill(pos); ItemSkill tab = current.Value; if (skill == null) { tab.maskSprite.gameObject.SetActive(true); tab.lockSprite.gameObject.SetActive(true); } else { tab.lockSprite.gameObject.SetActive(false); if (skill.IsCD()) { tab.maskSprite.gameObject.SetActive(true); tab.maskSprite.fillAmount = skill.GetLeftTime() / skill.CD; } else { tab.maskSprite.gameObject.SetActive(false); } } } }
public void TryCastSkill(ESkillPos pos) { if (GTWorld.Main == null || GTWorld.Main.CacheTransform == null) { return; } ActSkill skill = GTWorld.Main.Skill.GetSkill(pos); if (skill == null) { return; } if (GTWorld.Main.Target != null && GTWorld.Main.Target.IsDead()) { CharacterHelper.ClearTarget(GTWorld.Main); } if (GTWorld.Main.Target == null) { Character target = GTWorld.Main.FindEnemyNearest(GTWorld.Main.Skill.WarnerDist); CharacterHelper.SetTarget(GTWorld.Main, target); } GTWorld.Main.PausedAI(true); Resp resp = GTWorld.Main.Command.Get <CommandUseSkill>().Update(skill.ID).Do(); CharacterHelper.CalcCharacterOperateError(resp); if (resp == Resp.TYPE_YES) { GTWorld.Main.UsePowerByCostType(skill.CostType, skill.CostNum); GTEventCenter.FireEvent(GTEventID.TYPE_UPDATE_AVATAR_HP); GTEventCenter.FireEvent(GTEventID.TYPE_UPDATE_AVATAR_MP); } GTWorld.Main.PausedAI(false); }
private void OnCastSkillClick(GameObject go) { GTAudioManager.Instance.PlayEffectAudio(GTAudioKey.SOUND_UI_SKILLCLICK, 0.2f); int pos = go.name.ToInt32(); ESkillPos skillPos = (ESkillPos)pos; GTEventCenter.FireEvent(GTEventID.TYPE_CAST_SKILL, skillPos); }
public ActSkill GetSkill(ESkillPos pos) { if (pos == ESkillPos.Skill_0) { return(mNormalAttacks.Count > mComboIndex ? mNormalAttacks[mComboIndex] : null); } else { ActSkill skill = null; mSkillAttacks.TryGetValue(pos, out skill); return(skill); } }
public void OnCastSkill(ESkillPos arg1) { //if (!IsExistsMe()) //{ // return; //} ECommandReply reply = Laucher.instance.MainPlayer.Command(new USCommand(arg1)); if (reply == ECommandReply.Y) { ZTEvent.FireEvent(EventID.ACK_CAST_SKILL, arg1); } }
public bool UseSkill(ESkillPos pos) { SkillTree skillTree = GetSkill(pos); if (skillTree == null) { return(false); } mCurrSkillTree = skillTree; mCurrSkillTree.Start(); if (pos == ESkillPos.Skill_0) { mComboIndex = mComboIndex >= mComboSkills.Count - 1 ? 0 : ++mComboIndex; } return(true); }
public SkillTree GetSkill(ESkillPos pos) { for (int i = 0; i < Pool.Skills.Count; i++) { SkillTree skillTree = this.Pool.Skills[i]; if (skillTree.Pos == pos) { if (pos == ESkillPos.Skill_0) { return(mComboSkills[mComboIndex]); } return(skillTree); } } return(null); }
private void OnRefreshSkillIcons() { foreach (var current in mSkillBtns) { ESkillPos pos = current.Key; ActSkill skill = CharacterManager.Main.Skill.GetSkill(pos); ItemSkill tab = current.Value; if (skill != null) { DSkill db = ReadCfgSkill.GetDataById(skill.ID); if (db != null) { GTItemHelper.ShowTexture(tab.icon, db.Icon); } } } }
public CommandUseSkill Update(ESkillPos pos) { this.Pos = pos; return(this); }
public void OnClickSkill() { ESkillPos skillPos = ESkillPos.Skill_0; ZTEvent.FireEvent(EventID.REQ_CAST_SKILL, skillPos); }
public void TryCastSkill(ESkillPos pos) { GTEventCenter.FireEvent(GTEventID.TYPE_CAST_SKILL, pos); }
public ActSkill GetSkill(ESkillPos pos) { return(Skills.Find((data) => (data.Data.Pos == pos))); }
public void UseSkill(ESkillPos pos) { ActSkill skill = GetSkill(pos); //ActManager.Instance.Run(skill); }
public override void Read(XmlElement os) { base.Read(os); this.Pos = (ESkillPos)os.GetInt32("Pos"); this.Times = os.GetInt32("Times"); }
public USCommand(ESkillPos pos) { this.Pos = pos; this.Command = ECommand.TYPE_USESKILL; }