//技能参数获得 public static object SkillParam(Expression[] args) { if (args.Length != 2) { Logger.Error(string.Format("args error !! in SkillParam Expression !!")); return("args error !! in SkillParam Expression !!"); } try { var tableId = args[0].Evaluate(); var SkillLevel = Table_Tamplet.Convert_Int(args[1].Evaluate().ToString()); var tbUpgrade = Table.GetSkillUpgrading(Table_Tamplet.Convert_Int(tableId.ToString())); if (tbUpgrade == null) { return(string.Format("!ERROR_Table Not find {0}!", tableId)); } if (SkillLevel <= 0) { return(tbUpgrade.GetSkillUpgradingValue(SkillLevel)); } return(tbUpgrade.GetSkillUpgradingValue(SkillLevel - 1)); } catch (Exception ex) { Logger.Info("SkillParam Not arg Evaluate {0}", ex); } return(-1); }
private void OnAccomplishmentTipEvent(IEvent ievent) { var _a1 = Table_Tamplet.Convert_Int(Table.GetClientConfig(562).Value); if (!PlayerDataManager.Instance.GetFlag(_a1)) { return; } if (GuideManager.Instance.IsGuiding()) { return; } var _e = ievent as Event_AchievementTip; if (null == _e) { return; } var _id = _e.Id; m_listAchievementTipQueue.Add(_id); if (1 == m_listAchievementTipQueue.Count) { m_DataModel.Id = _id; EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.AchievementTip)); } else if (m_listAchievementTipQueue.Count > s_iMaxAchievement) { m_listAchievementTipQueue.RemoveAt(0); } }
//获得变量的值 private object GetVariable(string Name, string SysType) { var temp = GetVariable(Name); if (temp != null) { return(temp); } if (String.Compare("int", SysType, StringComparison.OrdinalIgnoreCase) == 0) { return(Table_Tamplet.Convert_Int(Name)); } if (String.Compare("int32", SysType, StringComparison.OrdinalIgnoreCase) == 0) { int tempInt; if (Int32.TryParse(Name, out tempInt)) { return(tempInt); } Logger.Error("GetVariable Not Find! ScriptId={0} funName={1} Line={2} Variable={3}", ScriptId, funName, nThisLine, Name); return(0); } if (String.Compare("float", SysType, StringComparison.OrdinalIgnoreCase) == 0) { return(Table_Tamplet.Convert_Double(Name)); } if (String.Compare("double", SysType, StringComparison.OrdinalIgnoreCase) == 0) { return(Table_Tamplet.Convert_Double(Name)); } return(null); }
private void OnAchievementTipEvent(IEvent ievent) { var a1 = Table_Tamplet.Convert_Int(Table.GetClientConfig(562).Value); if (!PlayerDataManager.Instance.GetFlag(a1)) { return; } if (GuideManager.Instance.IsGuiding()) { return; } var e = ievent as Event_AchievementTip; if (null == e) { return; } var id = e.Id; AchievementTipQueue.Add(id); if (1 == AchievementTipQueue.Count) { DataModel.Id = id; EventDispatcher.Instance.DispatchEvent(new Show_UI_Event(UIConfig.AchievementTip)); } else if (AchievementTipQueue.Count > MaxAchievement) { AchievementTipQueue.RemoveAt(0); } }
public static object SkillParamWithPower(Expression[] args) { if (args.Length != 2) { Logger.Error(string.Format("args error !! in SkillParamWithPower Expression !!")); return("args error !! in SkillParamWithPower Expression !!"); } try { var tableId = args[0].Evaluate(); var SkillLevel = Table_Tamplet.Convert_Int(args[1].Evaluate().ToString()); var tbUpgrade = Table.GetSkillUpgrading(Table_Tamplet.Convert_Int(tableId.ToString())); if (tbUpgrade == null) { return(string.Format("!ERROR_Table Not find {0}!", tableId)); } if (SkillLevel > 0) { SkillLevel -= 1; } var value = tbUpgrade.GetSkillUpgradingValue(SkillLevel) / 100f; // int power; // if (PlayerDataManager.Instance.GetRoleId() == 1) // { // power = PlayerDataManager.Instance.PlayerDataModel.Attributes.MagPowerMin; // } // else // { // power = PlayerDataManager.Instance.PlayerDataModel.Attributes.PhyPowerMin; // } // var addpro = PlayerDataManager.Instance.PlayerDataModel.Attributes.DamageAddPro/10000f; // var damage = value*power/100f; // damage = damage + damage*addpro; var str = string.Format("{0}%", value.ToString("f1") /*, damage.ToString("f0")*/); return(str); } catch (Exception ex) { Logger.Info("SkillParam Not arg Evaluate {0}", ex); } return(-1); }