public override void Finish() { base.Finish(); SkillStatusInfo ssi = SkillM.GetWetBodyStatusInfo(); m_LifePrent.m_Status.AddStatus(0, 0, ssi); }
protected int CalcDistanInfo(NDAttribute attrAttacter, NDAttribute attrDefence, int damage) { int diffLevel = attrAttacter.Level - attrDefence.Level; float factorStar = 0; float factorLevel = 0; SkillM.GetDistainFactor(diffLevel, ref factorStar, ref factorLevel); return(ScriptM.Formula <int>("CALC_DISTAIN_DAMAGE", damage, factorLevel, factorStar)); }
/// <summary> /// 获取炮弹兵数据 /// </summary> /// <param name="I">炮弹兵类型静态数据</param> /// <param name="Info">炮弹兵数据</param> private static void SetSoldierSkill(s_soldier_typeInfo I, ref SoldierInfo Info) { if (I == null || Info == null || Info.m_Skill == null) { return; } Info.m_Skill.SetSkillType(I); Info.m_Skill.InitSkill(); SkillM.SetSkillOrder(ref Info.m_Skill, I.id); }
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); } }
public override void RemoveStatus(float duration) { base.RemoveStatus(duration); mcd -= duration; if (mcd <= 0) { mStatusActive = true; SoldierSkill sourceSkill = new SoldierSkill(); SkillM.GetSkillInfo(m_StatusInfo.exSkill1, m_StatusInfo.exSkillLevel1, ref sourceSkill); mcd = sourceSkill.m_cd * 0.001f; Role attacker = CM.GetLifeM(m_StatusInfo.Releasescentid, LifeMType.SOLDIER) as Role; RoleSkill.GlobalUseSkill(attacker, mOwner, sourceSkill, Vector3.zero); } }
/// <summary> /// 确认属于某个系的房间 /// </summary> /// <author>zhulin</author> public bool CheckAttributeType(AttributeType KindType) { int value = (int)KindType; AttributeType v = SkillM.GetBuildAttributeType(m_RoomKind); int iv = (int)v; if ((value & iv) == iv) { return(true); } else { return(false); } }
public override void RemoveStatus(float duration) { if (mStatusActive) { return; } base.RemoveStatus(duration); if (IsStatusOver()) { mStatusActive = true; SoldierSkill sourceSkill = new SoldierSkill(); SkillM.GetSkillInfo(m_StatusInfo.exSkill2, m_StatusInfo.exSkillLevel2, ref sourceSkill); Role attacker = CM.GetLifeM(m_StatusInfo.Releasescentid, LifeMType.SOLDIER) as Role; RoleSkill.GlobalUseSkill(attacker, mOwner, sourceSkill, Vector3.zero); } }
public override void InterruptStatus(LifeAction Action) { if (mStatusActive) { return; } base.InterruptStatus(Action); if (Action == LifeAction.Die) { mStatusActive = true; SoldierSkill sourceSkill = new SoldierSkill(); SkillM.GetSkillInfo(m_StatusInfo.exSkill1, m_StatusInfo.exSkillLevel1, ref sourceSkill); Role attacker = CM.GetLifeM(m_StatusInfo.Releasescentid, LifeMType.SOLDIER) as Role; RoleSkill.GlobalUseSkill(attacker, mOwner, sourceSkill, Vector3.zero); } }
public void SetSkill(s_monsterInfo monster) { if (monster == null) { return; } SoldierSkill Info = new SoldierSkill(); //0 SkillM.GetSkillInfo(monster.gskillid, ref Info); m_Skillinfo.Add(Info); //1 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.skill1id, ref Info); m_skill1_level = Info.m_level; m_Skillinfo.Add(Info); //2 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.skill2id, ref Info); m_skill2_level = Info.m_level; m_Skillinfo.Add(Info); //3 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.skill3id, ref Info); m_skill3_level = Info.m_level; m_Skillinfo.Add(Info); //4 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.skill4id, ref Info); m_skill4_level = Info.m_level; m_Skillinfo.Add(Info); //5 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.skill5id, ref Info); m_skill5_level = Info.m_level; m_Skillinfo.Add(Info); //6 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.askillid, ref Info); m_Skillinfo.Add(Info); //7 Info = new SoldierSkill(); SkillM.GetSkillInfo(monster.lskillid, ref Info); m_Skillinfo.Add(Info); }
/// <summary> /// 从protobuf 解析静态数据到本地 /// </summary> /// <param name="msg"></param> public static void LoadStaticDataToLocal(sdata.StaticDataResponse msg) { ConfigM.Init(msg); buildingM.Init(msg); DeckM.Init(msg); UserM.Init(msg); SoldierM.Init(msg); SummonM.Init(msg); SkillM.Init(msg); StageM.Init(msg); RoleNameM.Init(msg); ItemM.Init(msg); GodSkillM.Init(msg); AthleticsM.Init(msg); ErnieM.Init(msg); FruitionM.Init(msg); ShipPlanM.Init(msg); }
/// <summary> /// 设置建筑房间类型图标. 临时放置,资源管理代码 /// </summary> /// <param name="spr">Spr.</param> /// <param name="RoomType">Room type.</param> public static void SetTrapTypeIcon(UISprite spr, int RoomKind) { if (spr == null) { return; } AttributeType type = SkillM.GetBuildAttributeType(RoomKind); string sprName = ""; switch (type) { case AttributeType.Fire: sprName = "icon004"; break; case AttributeType.Water: sprName = "icon007"; break; case AttributeType.Electric: sprName = "icon006"; break; case AttributeType.Poison: sprName = "icon005"; break; case AttributeType.NONE: sprName = "icon047"; break; case AttributeType.Gas: sprName = "icon008"; break; case AttributeType.Physical: sprName = "icon009"; break; } NGUIUtil.SetSprite(spr, sprName); }
public static void GetGodSkill(int type, int level, ref GodSkillInfo info) { foreach (sdata.s_godskilltypeInfo gs in m_lgodskill) { if (gs.type == type && gs.level == level) { info.m_id = gs.id; info.m_type = gs.type; info.m_level = gs.level; info.m_name = gs.name; info.m_action = gs.action; info.m_target = gs.target; info.m_multiple = gs.multiple; info.m_range = gs.range * 0.01f; info.m_power = gs.power; info.m_power2 = gs.power2; info.m_selectTarget = gs.selecttarget; info.m_own_status_info = new List <SkillStatusInfo>(); info.m_enemy_status_info = new List <SkillStatusInfo>(); info.m_mana = new List <int>(); SkillM.SetSkillStatus(ref info.m_own_status_info, gs.own_status); SkillM.SetSkillStatus(ref info.m_enemy_status_info, gs.enemy_status); int length = NdUtil.GetLength(gs.mana); if (length > 0) { for (int i = 0; i < length; ++i) { info.m_mana.Add(NdUtil.GetIntValue(gs.mana, i)); } } info.m_times = gs.times; info.m_blackscreentime = gs.blackscreentime * 0.001f; info.m_crystalneed = gs.crystalneed; info.m_coinneed = gs.coinneed; info.m_woodneed = gs.woodneed; info.m_explain = gs.explain; break; } } }
public static PetInfo GetPetInfo(int PetID) { foreach (sdata.s_summonInfo I in m_lPet) { if (I.id == PetID) { PetInfo Info = new PetInfo(); Info.m_id = I.id; Info.m_type = I.type; Info.m_mp = I.mp; Info.m_damage = I.damage; Info.m_name = I.name; Info.LifeTime = I.time; Info.m_isattack = I.isattack; Info.m_attacktype = I.attacktype; Info.m_speedpercent = I.speedpercent; Info.m_jumppercent = I.jumppercent; Info.m_hppercent = I.hppercent; Info.m_phydamagepercent = I.phydamagepercent; Info.m_phyattackpercent = I.phyattackpercent; Info.m_phydefendpercent = I.phydefendpercent; Info.m_magicattackpercent = I.magicattackpercent; Info.m_magicdamagepercent = I.magicdamagepercent; Info.m_magicdefendpercent = I.magicdefendpercent; Info.m_phy_critpercent = I.phy_critpercent; Info.m_magic_critpercent = I.magic_critpercent; Info.m_skill1 = I.skill1; SoldierSkill skillInfo = new SoldierSkill(); //0 SkillM.GetSkillInfo(Info.m_skill1, ref skillInfo); Info.m_skillinfo1 = skillInfo; SkillM.SetSkillStatus(ref Info.m_status, I.status); return(Info); } } return(null); }
/// <summary> /// 临时放置,资源管理代码 /// </summary> public static string GetTrapTypeName(int RoomKind) { AttributeType type = SkillM.GetBuildAttributeType(RoomKind); int name = 0; switch (type) { case AttributeType.Fire: name = 10000063; break; case AttributeType.Water: name = 10000064; break; case AttributeType.Electric: name = 10000065; break; case AttributeType.Poison: name = 10000066; break; case AttributeType.NONE: name = 10000062; break; case AttributeType.Gas: name = 10000067; break; case AttributeType.Physical: name = 10000164; break; } return(GetStringByKey(name) + GetStringByKey(10000129)); }
public void SetSkill() { int oldBigQua = ConfigM.GetBigQuality(m_oldBuildInfo.Quality); int oldSmall = ConfigM.GetSmallQuality(m_oldBuildInfo.Quality); int bigQua = ConfigM.GetBigQuality(m_buildInfo.Quality); int Small = ConfigM.GetSmallQuality(m_buildInfo.Quality); if (bigQua > oldBigQua && Small == 0) { BuildSkillInfo afterInfo = SkillM.GetBuildSkill(m_buildInfo.BuildType, bigQua); if (afterInfo != null) { MyHead.LblAfterSkill.text = afterInfo.m_desc; } BuildSkillInfo befInfo = SkillM.GetBuildSkill(m_oldBuildInfo.BuildType, oldBigQua); if (befInfo != null) { MyHead.LblForeSkill.text = befInfo.m_desc; } if (befInfo != null && afterInfo != null) { MyHead.GoSkill.SetActive(true); } else { MyHead.GoSkill.SetActive(false); } } else { MyHead.GoSkill.SetActive(false); } }
public void InitSkill() { m_Skillinfo.Clear(); SoldierSkill Info = new SoldierSkill(); //0 SkillM.GetSkillInfo(m_gskilltype, 1, ref Info); m_Skillinfo.Add(Info); //1 Info = new SoldierSkill(); if (m_skill1_level == 0) { SkillM.GetSkillInfo(m_skill1_type, 1, ref Info); Info.m_enable = false; Info.m_enableQuality = ConfigM.GetEnableSkillQuatlity(2); } else { SkillM.GetSkillInfo(m_skill1_type, m_skill1_level, ref Info); } m_Skillinfo.Add(Info); //2 Info = new SoldierSkill(); if (m_skill2_level == 0) { SkillM.GetSkillInfo(m_skill2_type, 1, ref Info); Info.m_enable = false; Info.m_enableQuality = ConfigM.GetEnableSkillQuatlity(3); } else { SkillM.GetSkillInfo(m_skill2_type, m_skill2_level, ref Info); } m_Skillinfo.Add(Info); //3 Info = new SoldierSkill(); if (m_skill3_level == 0) { SkillM.GetSkillInfo(m_skill3_type, 1, ref Info); Info.m_enable = false; Info.m_enableQuality = ConfigM.GetEnableSkillQuatlity(4); } else { SkillM.GetSkillInfo(m_skill3_type, m_skill3_level, ref Info); } m_Skillinfo.Add(Info); //4 Info = new SoldierSkill(); if (m_skill4_level == 0) { SkillM.GetSkillInfo(m_skill4_type, 1, ref Info); Info.m_enable = false; Info.m_enableQuality = ConfigM.GetEnableSkillQuatlity(5); } else { SkillM.GetSkillInfo(m_skill4_type, m_skill4_level, ref Info); } m_Skillinfo.Add(Info); //5 Info = new SoldierSkill(); if (m_skill5_level == 0) { SkillM.GetSkillInfo(m_skill5_type, 1, ref Info); Info.m_enable = false; Info.m_enableQuality = ConfigM.GetEnableSkillQuatlity(6); } else { SkillM.GetSkillInfo(m_skill5_type, m_skill5_level, ref Info); } m_Skillinfo.Add(Info); //6 Info = new SoldierSkill(); if (m_askill_level == 0) { SkillM.GetSkillInfo(m_askilltype, 1, ref Info); Info.m_enable = false; Info.m_enableQuality = ConfigM.GetEnableSkillQuatlity(1); } else { SkillM.GetSkillInfo(m_askilltype, m_askill_level, ref Info); } m_Skillinfo.Add(Info); //7 Info = new SoldierSkill(); SkillM.GetSkillInfo(m_lskilltype, 1, ref Info); m_Skillinfo.Add(Info); }
/// <summary> /// 填充建筑技能 /// </summary> private static BuildSkillInfo GetSkill(int BuildType, int Quality) { //获取技能 return(SkillM.GetBuildSkill(BuildType, Quality)); }
/// <summary> /// 设置召唤物数据 /// </summary> private static void SetSummonPetInfo(ref SummonpetInfo Info, s_summonpetInfo I) { if (Info == null || I == null) { return; } Info.m_id = I.id; Info.m_name = I.name; Info.m_type = I.type; Info.m_modeltype = I.modeltype; Info.m_isattack = I.isattack; Info.m_level = I.level; Info.m_shape = I.shape; Info.m_goorder = I.goorder; Info.m_attack_like = I.attack_like; Info.m_attack_type = I.attacktype; Info.m_attack_time = I.attack_time * 0.001f; Info.m_speed = I.speed * 1.0f / MapGrid.m_Pixel; Info.m_jump_distance = I.jump_distance / MapGrid.m_Pixel; Info.m_resist = I.resist; Info.m_hp = I.hp; Info.m_phy_attack = I.physical_attack; Info.m_phy_defend = I.physical_defend; Info.m_phy_crit = I.physical_crit; Info.m_magic_attack = I.magic_attack; Info.m_magic_defend = I.magic_defend; Info.m_magic_crit = I.magic_crit; Info.m_dodge = I.dodge; Info.m_time = I.time; Info.m_AddAttr.SetAddAttrInfo(I); //爆击及闪避 s_soldier_experienceInfo ExpInfo = SoldierM.GetSoldierExpData(I.level); if (ExpInfo != null) { Info.m_critratio = ExpInfo.critratio; Info.m_dodgeratio = ExpInfo.dodgeratio; } // if (I.gskillid > 0) { SoldierSkill skill = new SoldierSkill(); if (SkillM.GetSkillInfo(I.gskillid, ref skill) == true) { Info.m_Skillinfo.Add(skill); } } if (I.skill1id > 0) { SoldierSkill skill = new SoldierSkill(); if (SkillM.GetSkillInfo(I.skill1id, ref skill) == true) { Info.m_Skillinfo.Add(skill); } } if (I.skill2id > 0) { SoldierSkill skill = new SoldierSkill(); if (SkillM.GetSkillInfo(I.skill2id, ref skill) == true) { Info.m_Skillinfo.Add(skill); } } if (I.skill3id > 0) { SoldierSkill skill = new SoldierSkill(); if (SkillM.GetSkillInfo(I.skill3id, ref skill) == true) { Info.m_Skillinfo.Add(skill); } } if (I.skill4id > 0) { SoldierSkill skill = new SoldierSkill(); if (SkillM.GetSkillInfo(I.skill4id, ref skill) == true) { Info.m_Skillinfo.Add(skill); } } }
/// <summary> /// 对建筑数据进行分类 /// </summary> private List <BuildInfo> GetBuildInfo(AttributeType AType, TrapState trapState) { List <BuildInfo> l = new List <BuildInfo>(); if (trapState == TrapState.Exit) { foreach (BuildInfo Info in m_Build) { if (Info == null) { continue; } if (AType == AttributeType.ALL) { l.Add(Info); } AttributeType bAttr = SkillM.GetBuildAttributeType(Info.m_RoomKind); if (AType == bAttr) { l.Add(Info); } } } else if (trapState == TrapState.CanSum) { foreach (BuildInfo Info in m_CanSumBuild) { if (Info == null) { continue; } if (AType == AttributeType.ALL) { l.Add(Info); } AttributeType bAttr = SkillM.GetBuildAttributeType(Info.m_RoomKind); if (AType == bAttr) { l.Add(Info); } } } else if (trapState == TrapState.CanNotSum) { foreach (BuildInfo Info in m_CannotSumBuild) { if (Info == null) { continue; } if (AType == AttributeType.ALL) { l.Add(Info); } AttributeType bAttr = SkillM.GetBuildAttributeType(Info.m_RoomKind); if (AType == bAttr) { l.Add(Info); } } } return(l); }