/// <summary> /// 加载技能 /// TODO: 把 <see cref="SkillType.Displacement"/> 设置为固定技能 /// </summary> private void InitSkillDetail() { var skillDodge = new CommonSkillDetail.Builder(SkillType.DodgeNone, 0, "DodgeNone").SetColdDownTime(0) .Build(); var skillWpNone = new CommonSkillDetail.Builder(SkillType.WpNone, 0, "WpNone").SetColdDownTime(0).Build(); var skillDis = new CommonSkillDetail.Builder(SkillType.Displacement, 0, "Displacement") .SetColdDownTime(0.5f).Build(); var skillList = new List <SkillDetail> { new CommonSkillDetail.Builder(SkillType.FireBall, 0, "FireBall").SetColdDownTime(0.5f).Build(), new CommonSkillDetail.Builder(SkillType.LightningBolt, 0, "LightningBolt").SetColdDownTime(2f).Build(), skillDodge, skillWpNone, skillDis }; // Skill-pack (All skills) var skillPack = new SkillPack( skillDodge, skillWpNone, skillDis, skillList ); BasePlayer player = this; _skillManager.Init(ref player, ref skillPack); }
static public object Rit_CurseRemoval(Thea2.Server.Group target, RitualsTask sourceTask) { if (target != null && target.characters != null) { SkillPack spp = (SkillPack)"SKILL_PACK-CURSE_P"; SkillPack spm = (SkillPack)"SKILL_PACK-CURSE_M"; SkillPack sps = (SkillPack)"SKILL_PACK-CURSE_S"; foreach (var v in target.characters) { var si = v.Get().GetSkillEffectOnCharacterMatchingSkillpack(spp); if (si == null) { si = v.Get().GetSkillEffectOnCharacterMatchingSkillpack(spm); if (si == null) { si = v.Get().GetSkillEffectOnCharacterMatchingSkillpack(sps); } } if (si == null) { continue; } v.Get().LearnSkill(Character.SkillCategory.Effect, si.source, FInt.ONE, true, -1); } } return(null); }
static public object DEV_AddToxines(string data) { var v = GroupSelectionManager.Get().GetSelectedGroup(); if (v == null) { Debug.LogError("[ERROR]this script requires selected group"); return(null); } if (v != null) { var group = EntityManager.Get <Thea2.Server.Group>(v.GetID()); if (group.characters == null) { return(null); } SkillPack sp = Globals.GetInstanceFromDB <SkillPack>(SKILL_PACK.TOXINE); foreach (var c in group.characters) { c.Get().AddSkillEffect(sp, false, 5); } //request update / changes made to the group NOCSRequestGroupDetails.ServerSelfRequestOneGroup(v.GetID()); } return(null); }
public override void Init(TileSystem tileSystem) { base.Init(tileSystem); if (gotExpInGame == null) { gotExpInGame = new int[Define.selectedPetsCount]; } for (int i = 0; i < Define.selectedPetsCount; i++) { skillData[i] = new SkillPack(); } mapAssistance = GetAssistance(typeof(MapAssistance).Name) as MapAssistance; scoreAssistance = GetAssistance(typeof(ScoreAssistance).Name) as ScoreAssistance; gameTimeAssistance = GetAssistance(typeof(GameTimeAssistance).Name) as GameTimeAssistance; }
private void SettingUI(SkillPack skillPack, bool noCooltime, bool noValue, int skillLv) { skillPack.skillLevelLabel.text = GetSkillLevel(skillLv); if (!noCooltime && !noValue) { skillPack.skillLevelObject.localPosition = new Vector3(0f, doubleLevelHeight, 0f); skillPack.cooltimeObject.gameObject.SetActive(true); skillPack.cooltimeObject.localPosition = new Vector3(0f, -doubleSkillHeight, 0f); skillPack.valueObject.gameObject.SetActive(true); skillPack.valueObject.localPosition = new Vector3(0f, doubleSkillHeight, 0f); skillPack.cooltimeLabel.text = skillData.GetSkillCoolTime(skillLv).ToString(); skillPack.valueLabel.text = skillData.GetSkillValue(skillLv).ToString(); skillPack.background.height = doubleBackHeight; } else if (noCooltime) { skillPack.skillLevelObject.localPosition = new Vector3(0f, singleLevelHeight, 0f); skillPack.cooltimeObject.gameObject.SetActive(false); skillPack.valueObject.gameObject.SetActive(true); skillPack.valueObject.localPosition = new Vector3(0f, singleSkillHeight, 0f); skillPack.valueLabel.text = skillData.GetSkillValue(skillLv).ToString(); skillPack.background.height = singleBackHeight; } else if (noValue) { skillPack.skillLevelObject.localPosition = new Vector3(0f, singleLevelHeight, 0f); skillPack.valueObject.gameObject.SetActive(false); skillPack.cooltimeObject.gameObject.SetActive(true); skillPack.cooltimeObject.localPosition = new Vector3(0f, singleSkillHeight, 0f); skillPack.cooltimeLabel.text = skillData.GetSkillCoolTime(skillLv).ToString(); skillPack.background.height = singleBackHeight; } else { Debug.Log("something is wrong"); } }
/// <summary> /// 加载玩家信息 /// TODO:加载存档选项 /// </summary> public void LoadPlayerInfo() { QMhelper.Load(); var fileInfo = new FileInfo("Data.bin"); // if (fileInfo.Exists) if (false) { Debug.Log("---------READ FROM FILE----------"); Debug.Log("Path: " + fileInfo.Directory); var formatter = new BinaryFormatter(); Stream stream = new FileStream("Data.bin", FileMode.Open, FileAccess.Read, FileShare.Read); PlayerInfo = (PlayerInfo)formatter.Deserialize(stream); #if UNITY_EDITOR Debug.Log(PlayerInfo.ToString()); #endif } else { Debug.Log("---------NEW DATA----------"); // New skills (Common skill) var skillDodge = new CommonSkillDetail.Builder(SkillType.DodgeNone, 0, "DodgeNone").SetColdDownTime(0) .Build(); var skillWpNone = new CommonSkillDetail.Builder(SkillType.WpNone, 0, "WpNone").SetColdDownTime(0) .Build(); var skillDis = new CommonSkillDetail.Builder(SkillType.Displacement, 0, "Displacement") .SetColdDownTime(0.5f).Build(); // Data and skill order var skillList = new List <SkillDetail> { new CommonSkillDetail.Builder(SkillType.FireBall, 0, "FireBall").SetColdDownTime(0.5f).Build(), new CommonSkillDetail.Builder(SkillType.LightningBolt, 0, "LightningBolt").SetColdDownTime(2f) .Build(), skillDodge, skillWpNone, skillDis }; // Skill-pack (All skills) var skillPack = new SkillPack( skillDodge, skillWpNone, skillDis, skillList ); // TODO: 玩家昵称设置 PlayerInfo = new PlayerInfo("Player", new List <WeaponData>(), skillPack); } var playerGo = Instantiate(ResourceLoader.PlayerRes, new Vector3(16.5f, -71), Quaternion.Euler(Vector3.zero)); Player = playerGo.GetComponent <BasePlayer>(); Player.Health.health = (int)QMhelper.GetMaxHpVal(); QMhelper.SetupPlayer(Player.gameObject); ExpManager.Instance.Level = PlayerInfo.level; ExpManager.Instance.Exp = PlayerInfo.exp; PlayerInfo.OperateCoin(0, true); var player = Player; // Init if CommonPlayer if (Player is CommonPlayer commonPlayer) { commonPlayer.SkillManager.Init(ref player, ref PlayerInfo.skillPack); foreach (var weaponRes in PlayerInfo.weapons.Select(data => Resources.LoadAsync <Weapon>("Prefabs/Weapons/" + data.weaponName + "/" + data.weaponName))) { weaponRes.completed += operation => { commonPlayer.EquipWeapon((Weapon)weaponRes.asset, true); Debug.Log("LoadDone"); }; } } PixelCameraFollower.m_Target = Player.transform; // 设置小地图 if (miniPixelCameraFollower != null) { miniPixelCameraFollower.m_Target = Player.transform; } DontDestroyOnLoad(playerGo); }
public PlayerInfo(string playerName, List <WeaponData> weapon, SkillPack skillPack) { this.playerName = playerName; weapons = weapon; this.skillPack = skillPack; }
/// <summary> /// TODO: 设置技能栏 /// </summary> /// <param name="skillPack">skill 包</param> public void SetUpSkillBar(SkillPack skillPack) { }