public virtual bool TriggerConditionHandler() { if (m_Attr.Broken) { return(false); } if (m_Skill.PropSkillInfo == null) { return(false); } BuildSkill skillBuild = m_Skill as BuildSkill; if (!skillBuild.CheckSkillTrigger(this)) { return(false); } m_bTriggerSkill = true; m_fTriggerTime = Time.time; m_nAttackIndex = 0; m_fAttackTickReady = 0; ActiveHidecdTimer(); List <Life> RoleList = skillBuild.GetBuildSkillTarget(this); if (RoleList.Count > 0) { TriggerSkillTime(ref RoleList, ref m_fReleaseDelay); } return(true); }
protected GameObject AttackRangeSemiCircle02; //攻击范围 光效半圆环 循环 public void SetBuildLife(BuildInfo Info, LifeProperty SkinProperty, LifeEnvironment Environment) { if (Info == null || SkinProperty == null) { return; } LifeProperty(SkinProperty); if (Info.m_Skill != null) { m_Skill = new BuildSkill(Info); } if (Environment == LifeEnvironment.Combat) { //初始化技能 m_Attr = new BuildAttribute(Info); m_Status = new Status(); BuildColider bc = this.GetComponent <BuildColider>(); if (bc != null && m_Attr.IsDamage) { bc.EnableBattleCollider(true); } } else { //HideHp(); SetEditModeSetting(Info, Environment); } }
public float GetCDTime() { if (m_Skill == null) { return(0); } else { BuildSkill skill = m_Skill as BuildSkill; return(skill.GetCDTime()); } }
public bool IsInCDStatus() { if (m_Skill == null) { return(true); } else { BuildSkill skill = m_Skill as BuildSkill; return(skill.IsInCDStatus()); } }
public virtual void BuildUpdate() { if (m_bTriggerSkill && Time.time - m_fTriggerTime > m_fReleaseDelay) { BuildSkill skillBuild = m_Skill as BuildSkill; List <Life> RoleList = skillBuild.GetBuildSkillTarget(this); if (RoleList.Count > 0) { bool bRet = false; m_fAttackTickReady += Time.deltaTime; if ((m_fAttackTickReady - Time.deltaTime) <= 0) { QianYaoSkill(ref RoleList, ref m_nAttackIndex); } if (m_fAttackTickReady > m_eventtime) { if (m_nAttackIndex < m_nAttackCount && m_fAttackTickReady > m_Attacktimes[m_nAttackIndex]) { if ((m_Skill.PropSkillInfo.m_AttributeType & AttributeType.Electric) == AttributeType.Electric) { Skill.GetWetTarget(ref RoleList, m_Skill.PropSkillInfo, this); } bRet = ReleaseSkill(ref RoleList, ref m_nAttackIndex); } if (bRet) { m_nAttackIndex++; if (m_nAttackIndex >= m_nAttackCount) { m_bTriggerSkill = false; } if (m_nAttackIndex == 1 && m_Attr.Durability > 0) { m_Attr.Durability = m_Attr.Durability - 1; if (m_Attr.Durability <= 0) { Dead(); } } } } } } }
public virtual void InitBuild() { InitHP(); HP = fullHP; SetSkin(); //读取连击次数 m_fAttackTickReady = 0; if (m_Skill != null) { BuildSkill skillBuild = m_Skill as BuildSkill; if (skillBuild.PropSkillInfo.m_attckmodeid > 0) { skillBuild.PropSkillInfo.GetAttackTimes(ref m_Attacktimes); } else { m_Attacktimes.Add(0.0f); } } m_nAttackCount = m_Attacktimes.Count; EventCenter.RegisterHooks(NDEventType.StatusCG, SetStatus); // -----buildingroom BuildColider bc = GetComponent <BuildColider>(); if (bc != null) { bc.EnableBattleCollider(true); } BuildInfo info = CmCarbon.GetBuildInfo(this.m_Core.m_DataID); if (info != null) { ShowHP(info.BuildType, info.m_bear); m_roomType = info.m_RoomType; } }
/// <summary> /// 释放技能主逻辑 /// </summary> protected override bool ReleaseSkill(ref List <Life> RoleList, ref int nAttackIndex) { bool IsRelease = false; m_AttackRoleList.Clear(); m_SkillReleaseInfoList.Clear(); if (RoleList.Count > 0) { if (nAttackIndex == 0) { IsRelease = true; m_fAttackTimer = Time.time; Vector3 posSrc = m_goEffectLeft1905021_03.transform.position; Vector3 posRole = new Vector3(RoleList[0].GetPos().x, RoleList[0].GetPos().y + 1.5f, RoleList[0].GetPos().z); float fRate = Vector2.Distance(posSrc, posRole) / 3.8f; m_goEffectLeft1905021_03.transform.localScale = new Vector3(fRate, 1.0f, 1.0f); float fAngle = NdUtil.V2toAngle(posSrc, posRole, Vector2.right); m_goEffectLeft1905021_03.transform.rotation = Quaternion.Euler(new Vector3(0, 180f, fAngle)); posSrc = m_goEffectRight1905021_03.transform.position; fRate = Vector2.Distance(posSrc, posRole) / 3.8f; m_goEffectRight1905021_03.transform.localScale = new Vector3(fRate, 1.0f, 1.0f); fAngle = NdUtil.V2toAngle(posSrc, posRole, Vector2.right); m_goEffectRight1905021_03.transform.rotation = Quaternion.Euler(new Vector3(0, 180f, fAngle)); foreach (Life w in RoleList) { IsRelease = true; GridActionCmd action = null; if (w is Role) { action = (w as Role).CurrentAction; } SkillReleaseInfo Info = m_Skill.SkillRelease(this, w, action, m_Skill.PropSkillInfo); m_SkillReleaseInfoList.Add(Info); m_AttackRoleList.Add(w); } m_bAttack = true; } int nRoleCount = m_AttackRoleList.Count; for (int nCnt = 0; nCnt < nRoleCount; nCnt++) { Life w = m_AttackRoleList[nCnt]; if (!w.InBoat || w.isDead) { continue; } SkillReleaseInfo info = m_SkillReleaseInfoList[nCnt]; BuildSkill rs = m_Skill as BuildSkill; float power = rs.PropSkillInfo.GetAttackPower(nAttackIndex + 1); info.m_Damage = (int)(info.m_Damage * power); info.mOwnerLevel = m_Attr.Level; w.ApplyDamage(info, m_thisT); } if (nRoleCount > 0) { SoundPlay.Play("Trap/trap_electricshock", false, false); } } return(IsRelease); }