IEnumerator ContinueBuff() { while (true) { if (me != null) { GameInterface_Skill.AddSkillBuff(me.gameObject, (int)GameBuff.NuclearDamageHP, Vector3.zero, PlayerId); } yield return(new WaitForSeconds(1)); } }
private void OnTriggerEnter(Collider other) { var attr = NetworkUtil.GetAttr(other.gameObject); if (attr != null) { if (attr.IsMine()) { Util.ShowMsg("警告:进入核弹区域"); me = attr; GameInterface_Skill.AddSkillBuff(me.gameObject, (int)GameBuff.NuclearDamageHP, Vector3.zero, PlayerId); } } }
private void OnTriggerEnter(Collider other) { //Debug.LogError("OnTriggerEnter: "+other); var attr = NetworkUtil.GetAttr(other.gameObject); if (attr != null) { if (attr.IsMine()) { Util.ShowMsg("警告:进入辐射区域"); me = attr; GameInterface_Skill.AddSkillBuff(me.gameObject, (int)GameBuff.DamageHP, Vector3.zero); } } }
IEnumerator InitGameData() { GameInterface_Backpack.ClearDrug(); yield return(StartCoroutine(NetworkUtil.WaitForPlayer())); var me = ObjectManager.objectManager.GetMyPlayer(); GameInterface_Skill.AddSkillBuff(ObjectManager.objectManager.GetMyPlayer(), (int)SkillData.SkillConstId.AddMP, Vector3.zero); var attr = me.GetComponent <NpcAttribute>(); var sync = CGSetProp.CreateBuilder(); sync.Key = (int)CharAttribute.CharAttributeEnum.LEVEL; sync.Value = 1; KBEngine.Bundle.sendImmediate(sync); PlayerData.ResetSkillLevel(); }
//0.1s 开启关闭 private void OnTriggerEnter(Collider other) { var meId = ObjectManager.objectManager.GetMyServerID(); if (meId == PlayerId) { return; } var attr = NetworkUtil.GetAttr(other.gameObject); if (attr != null) { Log.Sys("LaserEnter: " + other.gameObject); if (attr.IsMine()) { me = attr; GameInterface_Skill.AddSkillBuff(me.gameObject, (int)GameBuff.LaserDamageHP, Vector3.zero, PlayerId); GameInterface_Skill.AddSkillBuff(me.gameObject, "SlowDown2", Vector3.zero, PlayerId); } } }
static System.Collections.IEnumerator UseItemCor(int itemId) { yield return(new WaitForSeconds(0.1f)); var id = BackPack.backpack.GetItemId(itemId); var itemData = Util.GetItemData(0, itemId); var use = CGUseUserProps.CreateBuilder(); use.UserPropsId = id; use.Count = 1; var packet = new KBEngine.PacketHolder(); Log.Net("Send Use Item"); yield return(ClientApp.Instance.StartCoroutine(KBEngine.Bundle.sendSimple(ClientApp.Instance, use, packet))); Log.Sys("UseResult " + packet.packet.flag); if (packet.packet.responseFlag == 0) { //GameInterface_Skill.MeUseSkill(itemData.triggerBuffId); GameInterface_Skill.AddSkillBuff(ObjectManager.objectManager.GetMyPlayer(), itemData.triggerBuffId, Vector3.zero); } }
void AddHP(GameObject go) { GameInterface_Skill.AddSkillBuff(go, (int)GameBuff.AddHP, Vector3.zero); healObjects.Add(go); }
public void PickItemFromNetwork(GameObject who) { pickYet = true; var whoAttr = NetworkUtil.GetAttr(who); BackgroundSound.Instance.PlayEffect("pickup"); GameObject.Destroy(gameObject); var me = ObjectManager.objectManager.GetMyPlayer(); Log.Sys("PickItemFromNetwork: " + whoAttr + " itemType: " + itemData.UnitType); var gen = Resources.Load <GameObject>("particles/drops/generic_item"); var par = ParticlePool.Instance.GetGameObject(gen, ParticlePool.InitParticle); //var par = Instantiate() as GameObject; //par.transform.parent = g.transform; par.transform.position = gameObject.transform.position; var rm = par.AddMissingComponent <RemoveSelf>(); rm.StartCoroutine(rm.WaitReturn(3)); if (whoAttr != null && whoAttr.gameObject == me) { if (itemData.UnitType == ItemData.UnitTypeEnum.POWER_DRUG) { WindowMng.windowMng.ShowNotifyLog("炸弹威力上升"); GameInterface_Backpack.LearnSkill((int)SkillData.SkillConstId.Bomb); } else if (itemData.UnitType == ItemData.UnitTypeEnum.QIPAO_DRUG) { var attr = ObjectManager.objectManager.GetMyAttr(); attr.AddMpMax(20); attr.AddThrowSpeed(0.1f); WindowMng.windowMng.ShowNotifyLog("MP上限增加"); } else if (itemData.UnitType == ItemData.UnitTypeEnum.XieZi_DRUG) { ObjectManager.objectManager.GetMyAttr().AddNetSpeed(0.1f); WindowMng.windowMng.ShowNotifyLog("速度提升"); } else if (itemData.UnitType == ItemData.UnitTypeEnum.LIAN_FA) { GameInterface_Skill.AddSkillBuff(me, (int)GameBuff.LianFa, Vector3.zero); WindowMng.windowMng.ShowNotifyLog("连发弹"); } else if (itemData.UnitType == ItemData.UnitTypeEnum.POTION) { GameInterface_Skill.AddSkillBuff(me, (int)GameBuff.AddHP, Vector3.zero); WindowMng.windowMng.ShowNotifyLog("恢复生命"); } else if (itemData.UnitType == ItemData.UnitTypeEnum.FASHI) { var attr = ObjectManager.objectManager.GetMyAttr(); attr.SetNetSpeed(0); attr.SetJob(Job.ALCHEMIST); WindowMng.windowMng.ShowNotifyLog("攻击提升", 2, null, true); WindowMng.windowMng.ShowNotifyLog("生命值变化", 2, null, true); } else if (itemData.UnitType == ItemData.UnitTypeEnum.CIKE) { var attr = ObjectManager.objectManager.GetMyAttr(); attr.SetJob(Job.ARMOURER); attr.SetNetSpeed(0.5f); WindowMng.windowMng.ShowNotifyLog("移动速度加快", 2, null, true); WindowMng.windowMng.ShowNotifyLog("生命值变化", 2, null, true); } else if (itemData.UnitType == ItemData.UnitTypeEnum.SUPER) { GameInterface_Skill.AddBuffWithNet(me, (int)GameBuff.SuperShoot, Vector3.zero); WindowMng.windowMng.ShowNotifyLog("拾获超能子弹", 2, null, true); } else if (itemData.UnitType == ItemData.UnitTypeEnum.HIDE) { GameInterface_Skill.AddBuffWithNet(me, (int)GameBuff.Hide, Vector3.zero); WindowMng.windowMng.ShowNotifyLog("拾获隐身药水", 2, null, true); } else if (itemData.UnitType == ItemData.UnitTypeEnum.NUCLEAR) { GameInterface_Skill.AddBuffWithNet(me, (int)GameBuff.NuclearBuff, Vector3.zero); WindowMng.windowMng.ShowNotifyLog("拾获核弹,使用后立即逃离区域", 4, null, true); } else if (itemData.UnitType == ItemData.UnitTypeEnum.KNOCK) { GameInterface_Skill.AddBuffWithNet(me, (int)GameBuff.KnockBuff, Vector3.zero); WindowMng.windowMng.ShowNotifyLog("获得击退能力", 4, null, true); } else if (itemData.UnitType == ItemData.UnitTypeEnum.WUDI) { GameInterface_Skill.AddBuffWithNet(me, (int)GameBuff.WuDi, Vector3.zero); } else if (itemData.UnitType == ItemData.UnitTypeEnum.DaoDan) { GameInterface_Skill.AddBuffWithNet(me, (int)GameBuff.DaoDan, Vector3.zero); } else if (itemData.UnitType == ItemData.UnitTypeEnum.DefaultSkill) { GameInterface_Skill.AddBuffWithNet(me, itemData.triggerBuffId, Vector3.zero); Util.ShowMsg("获得" + itemData.ItemName); } else { GameInterface_Backpack.PickItem(itemData, num); } } }