public void GetAttrData(NDAttribute RoleAttr, LifeMCore Core) { if (RoleAttr == null) { return; } PetInfo Info = CmCarbon.GetPetInfo(Core); m_AttrType = Info.m_type; m_speed = RoleAttr.Speed * Info.m_speedpercent * 0.01f; m_jumpDistance = (int)(RoleAttr.JumpDistance * Info.m_jumppercent * 0.01f); m_Hp = (int)(RoleAttr.Hp * Info.m_hppercent * 0.01f); m_FullHp = m_Hp; m_phy_attack = (int)(RoleAttr.PhyAttack * Info.m_phyattackpercent * 0.01f); m_phy_defend = (int)(RoleAttr.PhyDefend * Info.m_phydefendpercent * 0.01f); m_phy_crit = (int)(RoleAttr.PhyCrit * Info.m_phy_critpercent * 0.01f); m_magic_attack = (int)(RoleAttr.MagicAttack * Info.m_magicattackpercent * 0.01f); m_magic_defend = (int)(RoleAttr.MagicDefend * Info.m_phydefendpercent * 0.01f); m_magic_crit = (int)(RoleAttr.MagicCrit * Info.m_magic_critpercent * 0.01f); m_PetAttackType = Info.m_attacktype; m_PetDamage = Info.m_damage; m_Anger = Info.m_mp; m_FullAnger = 1000; m_TargetImmune = (ImmuneTarget)Info.m_isattack; //出生产生的状态 m_SelfStatus = Info.m_status; }
/// <summary> /// 创建Radar AI /// </summary> /// <param name="Core">雷达拥有者的核心信息</param> /// <param name="f">雷达拥有视野</param> public static RadarAI Create(LifeMCore Core, InVisionHook f) { if (f == null || Core == null) { return(null); } if (Core.m_type == LifeMType.SOLDIER || Core.m_type == LifeMType.SUMMONPET) { if (Core.m_Camp == LifeMCamp.ATTACK) { AttackRadarAI AI = new AttackRadarAI(); AI.SetVision(f); return(AI); } else if (Core.m_Camp == LifeMCamp.DEFENSE) { DefenseRadarAI AI = new DefenseRadarAI(); AI.SetVision(f); return(AI); } else { return(null); } } return(null); }
public override void Init(int SceneID, LifeMCore Core, Life Parent) { FloorType type = FloorType.Normal; if (Parent == null) { return; } base.Init(SceneID, Core, Parent); if (Parent is IggFloor) { type = (Parent as IggFloor).m_FloorType; m_BuildRoomAttr = GetBuildRoomAttr(type, (Parent as IggFloor).Layer, (Parent as IggFloor).StartUnit); } else { m_BuildRoomAttr.Add(GetBuildRoomAttr(Parent, (Parent as IggWall).Layer, (Parent as IggWall).StartUnit)); } FloorInfo info = CmCarbon.GetFloor(); if (info == null) { m_FullHp = 999999999; return; } m_FullHp = info.m_hp; m_IsDamage = true; m_phy_defend = info.m_phydefend; m_magic_defend = info.m_magicdefend; }
//加入战斗 public static void JoinCombat(int SceneID, Life m, LifeMCore Core) { if (m == null) { NGUIUtil.DebugLog("life is null do not join"); return; } List <SceneSoldier> l = GetSceneSoldierList(Core.m_type); if (l != null) { bool IsHave = false; for (int i = 0; i < l.Count; i++) { if (SceneID == l[i].m_SceneID) { if (Core.m_MoveState != l[i].m_Core.m_MoveState) { l [i].m_Life = m; l [i].m_Core.Copy(Core); } IsHave = true; } } if (IsHave == false) { l.Add(new SceneSoldier(SceneID, m, Core)); } } }
public override bool Init(int SceneID, LifeMCore Core) { m_SceneID = SceneID; //m_Parent = CM.GetLifeM(m_SceneID ,LifeMType.INHERITSUMMONPROS); m_CdTime = 0; return(true); }
public override int SetLifeCore(LifeMCore Core) { int ret = base.SetLifeCore(Core); SetLifeData(); return(ret); }
/// <summary> /// 设置lifeM 核心结构 /// </summary> /// <returns></returns> public virtual int SetLifeCore(LifeMCore Core) { m_SceneID = NdUtil.GetSceneID(); m_Core.Copy(Core); CM.JoinCombat(m_SceneID, this, Core); return(m_SceneID); }
public override void Init(int SceneID, LifeMCore Core, Life Parent) { WallType type = WallType.Normal; if (Parent == null) { return; } if (Parent is IggWall) { type = (Parent as IggWall).m_WallType; } base.Init(SceneID, Core, Parent); WallInfo info = WallM.GetWallData(type, Core.m_DataID); if (info == null) { return; } m_StartPos.Unit = info.m_cx; m_StartPos.Layer = info.m_cy; m_Size = 2; m_FullHp = info.m_hp; m_IsDamage = true; m_wood = info.m_wood; m_stone = info.m_stone; m_steel = info.m_steel; m_phy_defend = info.m_phydefned; m_magic_defend = info.m_magicdefend; m_DoorState = false; }
/// <summary> /// 添加死亡的玩家炮弹信息 /// </summary> public static void AddDiePlayerSoldier(LifeMCore Core, Int2 Pos) { if (Core == null) //|| Core.m_IsPlayer == false) { return; } if (Core.m_type != LifeMType.SOLDIER) { return; } SoldierInfo Info = GetSoldierInfo(Core); if (Info == null) { return; } if (Core.m_IsPlayer && m_DiePlayersoldier.ContainsKey(Info.ID) == false) { m_DiePlayersoldier.Add(Info.ID, Pos); } if (!Core.m_IsPlayer && m_DieNotPlayersoldier.ContainsKey(Info.ID) == false) { m_DieNotPlayersoldier.Add(Info.ID, Pos); } }
public override void Init(int SceneID, LifeMCore Core, Life Parent) { base.Init(SceneID, Core, Parent); m_info = CmCarbon.GetSummonPetInfo(Core); m_AttrType = m_info.m_modeltype; m_phy_defend = m_info.m_phy_defend; m_phy_crit = m_info.m_phy_crit; m_phy_attack = m_info.m_phy_attack; m_magic_defend = m_info.m_magic_defend; m_magic_crit = m_info.m_magic_crit; m_magic_attack = m_info.m_magic_attack; m_dodge = m_info.m_dodge; m_speed = m_info.m_speed; m_AntiPress = m_info.m_resist; m_FullHp = m_info.m_hp; m_Hp = FullHp; m_attack_time = m_info.m_attack_time; m_attack_like = m_info.m_attack_like; m_attack_type = m_info.m_attack_type; m_jumpDistance = m_info.m_jump_distance; m_shape = m_info.m_shape; m_goorder = m_info.m_goorder; m_main_proterty = 0; SetAddAttr(m_info.m_AddAttr); }
public void Copy(LifeMCore s) { this.m_DataID = s.m_DataID; this.m_type = s.m_type; this.m_Camp = s.m_Camp; this.m_MoveState = s.m_MoveState; this.m_IsPlayer = s.m_IsPlayer; }
/// <summary> /// 获取战斗副本中的召唤物 /// DataID 召唤物的id /// </summary> public static SummonpetInfo GetSummonPetInfo(LifeMCore Core) { if (Core == null) { return(null); } return(GetSummonPetInfo(Core.m_DataID)); }
/// <summary> /// 获取战斗副本中的道具 /// DataID 道具的id /// </summary> public static SummonProsInfo GetSummonProsInfo(LifeMCore Core) { if (Core == null) { return(null); } return(GetSummonProsInfo(Core)); }
public override void Init(int SceneID, LifeMCore Core, Life Parent) { base.Init(SceneID, Core, Parent); m_info = CmCarbon.GetSummonProsInfo(Core); m_AttrType = m_info.m_modeltype; m_FullHp = m_info.m_hp; m_Hp = FullHp; }
private void SetFloorCore() { //SetFloorType(); bool IsPlayer = CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE); m_Core = new LifeMCore(NdUtil.GetSceneID(), IsPlayer, LifeMType.FLOOR, LifeMCamp.DEFENSE, MoveState.Static); SetLifeCore(m_Core); m_Attr = new FloorAttribute(); m_Attr.Init(SceneID, m_Core, this); }
/// <summary> /// Floor不加入cm列表 /// </summary> /// <author>zhulin</author> public override int SetLifeCore(LifeMCore Core) { m_SceneID = NdUtil.GetSceneID(); m_Core.Copy(Core); if (IsCanAttack) { InBoat = true; CM.JoinCombat(m_SceneID, this, m_Core); } return m_SceneID; }
/// <summary> /// 初始化技能数据,从数据中心获取所有技能数据 /// </summary> public override bool Init(int SceneID, LifeMCore Core) { this.m_SceneID = SceneID; m_parent = CM.GetLifeM(m_SceneID, LifeMType.PET) as Pet; PetInfo Info = CmCarbon.GetPetInfo(Core); m_skill = Info.m_skillinfo1; return(true); }
public override void Init(int SceneID, LifeMCore Core, Life Parent) { base.Init(SceneID, Core, Parent); m_Broken = false; if (m_BuildInfo != null) { m_Durability = m_BuildInfo.m_data0; BuildAttributeType = SkillM.GetBuildAttributeType(m_BuildInfo.m_RoomKind); JoinMap(SceneID, m_StartPos, m_BuildInfo.m_Shape); } }
/// <summary> /// 获取战斗副本中的炮弹并信息 /// IsAttack true 攻击方,false 防守方 /// id 炮弹并的id /// SoildierID 炮弹兵ID /// </summary> public static SoldierInfo GetSoldierInfo(LifeMCore Core) { if (Core.m_bTurn) { return(GetTrunSoldierInfo(Core.m_Camp, Core.m_DataID)); } else { return(GetSoldierInfo(Core.m_Camp, Core.m_DataID)); } }
public GridActionCmdActiveSkill(DoQianyaoFun qianyaofun, DoAttackFun fun, int sceneID, int AttackSceneId, WalkDir AttackDir, int deep, int skillid, float blackscreentime) : base(qianyaofun, fun, AttackSceneId, AttackDir, deep, skillid) { m_iSceneID = sceneID; m_bRunOnce = true; m_LifePrent = CM.GetLifeM(m_iSceneID, LifeMType.SOLDIER); m_lifeMCore = m_LifePrent.m_Core; m_blackscreentime = blackscreentime; s_activeskill.Add(this); //Debug.Log("aaa:start="+ Time.time); }
public override void Init(int SceneID, LifeMCore Core, Life Parent) { base.Init(SceneID, Core, Parent); PetInfo Info = CmCarbon.GetPetInfo(Core); m_LifeTime = Info.LifeTime; if (m_LifeTime == 0) { m_LifeTime = int.MaxValue; } }
public override void SetCore() { bool IsPlayer = CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE); m_Core = new LifeMCore(NdUtil.GetSceneID(), IsPlayer, LifeMType.WALL, LifeMCamp.DEFENSE, MoveState.Static); SetLifeCore(m_Core); m_Attr = new FloorAttribute(); m_Attr.Init(SceneID, m_Core, this); m_Attr.StartPos = new Int2(StartUnit, Layer); HP = fullHP; }
/// <summary> /// 召唤物 /// </summary> public void SetBorn(Life Parent, int SummonProsID, PetInfo info, MapGrid pos) { m_Parent = Parent; m_info = info; m_MapGrid = pos; m_Pos = pos.GridPos; m_Skill = new InheritSummonProsSkill(info, this); m_Attr = new InheritSummonProsAttribute(); m_SceneID = NdUtil.GetSceneID(); m_Core = new LifeMCore(info.m_id, Parent.m_Core.m_IsPlayer, LifeMType.INHERITSUMMONPROS, Parent.m_Core.m_Camp, MoveState.Walk); m_Skill.Init(m_SceneID, m_Core); (m_Attr as InheritSummonProsAttribute).InheritInit(m_SceneID, m_Core, this, Parent); SetLifeCore(m_Core); InBoat = false; }
/// <summary> /// 创建FireActionCmd /// </summary> public static Move Create(Life lifeOwner, LifeMCore Core) { if (Core.m_MoveState == MoveState.Fly) { return(new Fly(lifeOwner)); } else if (Core.m_MoveState == MoveState.Walk) { return(new Walk(lifeOwner)); } else { return(null); } }
public override bool Init(int SceneID, LifeMCore Core) { m_SceneID = SceneID; m_Parent = CM.GetLifeM(m_SceneID, LifeMType.BUILD); // by zhulin 屏蔽 /*BuildInfo Info = CmCarbon.GetBuildInfo(Core.m_DataID); * if(Info == null || Info.m_Skill == null) * return false; * m_skill = Info.m_Skill; * * m_CDDuration = m_skill.m_cd*0.001f;*/ m_CdTime = 0; return(true); }
public virtual void SetCore() { bool IsPlayer = CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE); m_Core = new LifeMCore(m_WallID, IsPlayer, LifeMType.WALL, LifeMCamp.DEFENSE, MoveState.Static); SetLifeCore(m_Core); m_Attr = new WallAttribute(); m_Attr.Init(SceneID, m_Core, this); if (m_WallType == WallType.Normal) { StartUnit = m_Attr.StartPos.Unit; Layer = m_Attr.StartPos.Layer; Size = m_Attr.Size; } HP = fullHP; }
/// <summary> /// 满足Core条件判断 /// </summary> /// <param name="HaveList">不为空,则在这个列表中进行搜索,为空在所有CM管理的列表中进行搜索</param> /// <param name="Camp">按指定的阵营</param> /// <returns>true 满足条件,false 不满足条件</returns> private static bool CheckCoreConditions(LifeMCore Core, LifeMCamp Camp) { if (Core == null) { return(false); } if ((Camp & Core.m_Camp) == 0) { return(false); } else { return(true); } }
/// <summary> /// 添加死亡的玩家炮弹信息 /// </summary> public static void AddDieBuild(LifeMCore Core) { if (Core.m_type != LifeMType.BUILD) { return; } BuildInfo Info = CmCarbon.GetBuildInfo(Core.m_DataID); if (Info == null) { return; } if (m_DieBuild.Contains(Info.ID) == false) { m_DieBuild.Add(Info.ID); } }
/// <summary> /// 判断战斗中包含某类对象,不支持组合对象 /// </summary> public static bool HaveIntanseInScene(LifeMType Type, LifeMCamp Camp, int Data) { List <SceneSoldier> l = GetSceneSoldierList(Type); if (l != null) { foreach (SceneSoldier s in l) { LifeMCore Core = s.m_Core; if (Core.m_type == Type && Core.m_Camp == Camp && Core.m_DataID == Data) { return(true); } } } return(false); }
// 退出战斗,死亡,或被毁灭时。 public static void ExitCombat(LifeMCore Core, int SceneID) { List <SceneSoldier> l = GetSceneSoldierList(Core.m_type); if (l != null) { SceneSoldier s = GetSceneSoldier(l, SceneID); if (s != null) { l.Remove(s); if (Core.m_type == LifeMType.SOLDIER) { if (Core.m_Camp == LifeMCamp.ATTACK) { CmCarbon.DeadAttackSoldier(); } } else if (Core.m_type == LifeMType.BUILD) { } } } }