public bool CheckRunEffEnabl(int skillId, ISkillTarget target) { EffSkillInstance inst = new EffSkillInstance(); inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId)); if (null == inst.m_data) { // TODO : a warning message of no such skill return(false); } if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, inst.m_data.m_cdInfo.m_type))) { // TODO : a warning message of another instance of this effskill is still running return(false); } if (null != m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId))) { // TODO : a warning message of another instance of this effskill is still running return(false); } // TODO : cd info check if (!inst.m_data.CheckTargetsValid(this, target)) { // TODO : a warning message of not target in scope return(false); } return(true); }
public EffSkillInstance RunEffOnProxy(int skillId, ISkillTarget target) { EffSkillInstance inst = new EffSkillInstance(); inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId)); if (null == inst.m_data) { // TODO : a warning message of no such skill return(null); } if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, inst.m_data.m_cdInfo.m_type))) { // TODO : a warning message of another instance of this effskill is still running return(null); } if (null != m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId))) { // TODO : a warning message of another instance of this effskill is still running return(null); } // TODO : cd info check //if (!inst.m_data.CheckTargetsValid(this, target)) //{ // // TODO : a warning message of not target in scope // return null; //} inst.m_timeStartPrep = Time.time; inst.m_runner = new CoroutineStoppable(this, inst.m_data.ExecProxy(this, target, inst)); inst.m_sharedRunner = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst)); return(inst); }
public bool IsSkillRunning(int skillId) { EffSkillInstance inst = m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId)); return(inst != null && inst.m_section > EffSkillInstance.EffSection.None && inst.m_section < EffSkillInstance.EffSection.Completed); }
public EffSkillInstance SkipEff(int skillId) { //enter skill's cooldown without taking effect EffSkillInstance inst = new EffSkillInstance(); inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId)); if (null == inst.m_data) { // TODO : a warning message of no such skill return(null); } inst.m_runner = new CoroutineStoppable(this, inst.m_data.SkipExec(this, inst)); inst.m_sharedRunner = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst)); return(inst); }
//public void RunEff(EffSkillInstance inst, ISkillTarget target) //{ // // Stand alone and client mine should check target, client proxy should not // if (!GameConfig.IsMultiMode) // { // if (!inst.m_data.CheckTargetsValid(this, target)) // { // // TODO : a warning message of not target in scope // return; // } // } // if (GameConfig.IsMultiMode) // { // ESkillTargetType type = target.GetTargetType(); // switch (type) // { // case ESkillTargetType.TYPE_SkillRunner: // { // SkillRunner ta = target as SkillRunner; // if (null != ta) // RPC("RPC_C2S_SkillCast", inst.m_data.m_id, ta.OwnerNetworkView.viewID); // } // break; // } // } // inst.m_timeStartPrep = Time.time; // inst.m_runner = new CoroutineStoppable(this, inst.m_data.Exec(this, target, inst)); // inst.m_sharedRunner = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst)); //} //public void RunEffOnProxy(EffSkillInstance inst, ISkillTarget target) //{ // // Stand alone and client mine should check target, client proxy should not // if (!GameConfig.IsMultiMode) // { // if (!inst.m_data.CheckTargetsValid(this, target)) // { // // TODO : a warning message of not target in scope // return; // } // } // inst.m_timeStartPrep = Time.time; // inst.m_runner = new CoroutineStoppable(this, inst.m_data.Exec(this, target, inst)); // inst.m_sharedRunner = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst)); //} public ISkillTarget GetTargetByGameObject(RaycastHit hitinfo, EffSkillInstance inst) { ISkillTarget target = null; GameObject obj = hitinfo.collider.gameObject; if (obj != null) { int layer = obj.layer; switch (layer) { //VFVoxelTerrain case 12: { //VFVoxelChunkGo chunk; if ((obj.GetComponent <VFVoxelChunkGo>()) != null) { Vector3 fCurPos = hitinfo.point; Vector3 vPos = fCurPos / VoxelTerrainConstants._scale; vPos += -Vector3.up * 0.01f; IntVector3 fVoxelCenterPos = new IntVector3(Mathf.FloorToInt(vPos.x + 1), Mathf.FloorToInt(vPos.y + 1), Mathf.FloorToInt(vPos.z + 1)); VFVoxel voxel = VFVoxelTerrain.self.Voxels.SafeRead(fVoxelCenterPos.x, fVoxelCenterPos.y, fVoxelCenterPos.z); target = new VFTerrainTarget(hitinfo.point, fVoxelCenterPos, ref voxel); } } break; //Player case 10: { target = obj.GetComponent <SkillRunner>(); } break; } } if (!inst.m_data.CheckTargetsValid(this, target)) { // TODO : a warning message of not target in scope return(null); } return(target); }
public bool IsSharedCooling(int skillId) { EffSkill skill = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId)); if (skill == null) { return(false); } if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, skill.m_cdInfo.m_type))) { // TODO : a warning message of another instance of this effskill is still running return(true); } return(false); }
// TODO : Confirm how an enemy to attack building public EffSkillInstance RunEff(int skillId, ISkillTarget target) { EffSkillInstance inst = new EffSkillInstance(); inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId)); if (null == inst.m_data) { // TODO : a warning message of no such skill return(null); } if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, inst.m_data.m_cdInfo.m_type))) { // TODO : a warning message of another instance of this effskill is still running return(null); } if (null != m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId))) { // TODO : a warning message of another instance of this effskill is still running return(null); } // TODO : cd info check if (!inst.m_data.CheckTargetsValid(this, target)) { // TODO : a warning message of not target in scope return(null); } if (!GameConfig.IsMultiMode || IsController) { if (GameConfig.IsMultiMode) { if (target is CommonInterface) { CommonInterface ta = target as CommonInterface; if (null != ta && null != ta.OwnerView) { RPCServer(EPacketType.PT_InGame_SkillCast, skillId, ta.OwnerView.viewID); } else { RPCServer(EPacketType.PT_InGame_SkillCast, skillId, uLink.NetworkViewID.unassigned); } } else if (target is DefaultPosTarget) { RPCServer(EPacketType.PT_InGame_SkillShoot, skillId, target.GetPosition()); } else { RPCServer(EPacketType.PT_InGame_SkillCast, skillId, uLink.NetworkViewID.unassigned); } } inst.m_timeStartPrep = Time.time; inst.m_runner = new CoroutineStoppable(this, inst.m_data.Exec(this, target, inst)); inst.m_sharedRunner = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst)); } return(inst); }
public static bool MatchType(EffSkillInstance iter, short type) { return(iter.m_data.m_cdInfo.m_type == type); }
public static bool MatchId(EffSkillInstance iter, int id) { return(iter.m_data.m_id == id); }
public bool IsSkillCoolingByType(short type) { return(m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, type)) != null); }
public EffSkillInstance GetRunningEff(int skillId) { return(m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId))); }
public bool IsEffRunning(int skillId) { return(m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId)) != null); }