private void WriteEffectContents(EffectInfo effect, XmlWriter writer)
        {
            if (!string.IsNullOrWhiteSpace(effect.Name))
                writer.WriteAttributeString("name", effect.Name);

            if (effect.Filter != null)
            {
                writer.WriteStartElement("EntityFilter");

                if (effect.Filter.Type != null)
                    writer.WriteElementString("Type", effect.Filter.Type);

                if (effect.Filter.Direction != null)
                    writer.WriteElementString("Direction", effect.Filter.Direction.ToString());

                if (effect.Filter.Position != null)
                {
                    if (effect.Filter.Position.X != null)
                        WriteRangeFilter("X", writer, effect.Filter.Position.X);

                    if (effect.Filter.Position.Y != null)
                        WriteRangeFilter("Y", writer, effect.Filter.Position.Y);
                }

                writer.WriteEndElement();
            }

            foreach (var part in effect.Parts)
                WritePart(part, writer);
        }
 public void EnterExcute()
 {
     curTime = 0;
     //进入第一次创建过程,需要显示底座
     baseEffect = EntityManager.getInstance().AddStaticEffect(13, openSpaceInfo.GetPosition());
     openSpaceInfo.DoAction("hide");
 }
Exemple #3
0
    private void UpdateEffectItem(EffectInfo effectInfo)
    {
        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal();
        GUILayout.Label("EffectId:", GUILayout.Width(100));
        effectInfo.Id = EditorGUILayout.TextField(effectInfo.Id);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Scale:", GUILayout.Width(100));
        effectInfo.Scale = EditorGUILayout.FloatField(effectInfo.Scale);
        GUILayout.FlexibleSpace();
        GUILayout.Label("Offset:", GUILayout.Width(100));
        effectInfo.Offset.x = EditorGUILayout.FloatField(effectInfo.Offset.x);
        effectInfo.Offset.y = EditorGUILayout.FloatField(effectInfo.Offset.y);
        effectInfo.Offset.z = EditorGUILayout.FloatField(effectInfo.Offset.z);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("LifeTime:", GUILayout.Width(100));
        effectInfo.LifeTime = EditorGUILayout.IntField(effectInfo.LifeTime);
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();
    }
        protected void StartUpgrading(ushort buildingID, ref Building buildingData)
        {
            buildingData.m_frame0.m_constructState = (byte)0;
            buildingData.m_frame1.m_constructState = (byte)0;
            buildingData.m_frame2.m_constructState = (byte)0;
            buildingData.m_frame3.m_constructState = (byte)0;
            Building.Flags flags = (buildingData.m_flags | Building.Flags.Upgrading) & ~Building.Flags.Completed & ~Building.Flags.LevelUpEducation & ~Building.Flags.LevelUpLandValue;
            buildingData.m_flags = flags;
            BuildingManager instance1 = Singleton <BuildingManager> .instance;

            instance1.UpdateBuildingRenderer(buildingID, true);
            EffectInfo effect = instance1.m_properties.m_levelupEffect;

            if (effect != null)
            {
                InstanceID instance2 = new InstanceID();
                instance2.Building = buildingID;
                Vector3    meshPosition;
                Quaternion meshRotation;
                buildingData.CalculateMeshPosition(out meshPosition, out meshRotation);
                EffectInfo.SpawnArea spawnArea = new EffectInfo.SpawnArea(Matrix4x4.TRS(meshPosition, meshRotation, Vector3.one), this.m_info.m_lodMeshData);
                Singleton <EffectManager> .instance.DispatchEffect(effect, instance2, spawnArea, Vector3.zero, 0.0f, 1f, instance1.m_audioGroup);
            }
            Vector3 position = buildingData.m_position;

            position.y += this.m_info.m_size.y;
            Singleton <NotificationManager> .instance.AddEvent(NotificationEvent.Type.LevelUp, position, 1f);

            ++Singleton <SimulationManager> .instance.m_currentBuildIndex;
        }
    private void LoadEffectInfor()
    {
        TextAsset text = Resources.Load(_pathEffectInfo) as TextAsset;

        string[] lines = text.text.Split('\n');
        //Debug.Log("EffectInfo " + lines.Length);

        foreach (string line in lines)
        {
            string[] s = line.Split('\t');
            if (s.Length >= 2)
            {
                int        id         = int.Parse(s[0]);
                EffectInfo effectInfo = new EffectInfo();

                if (Global.language != Global.Language.VIETNAM)
                {
                    effectInfo.Name = s[1];
                    effectInfo.Desc = s[2];
                }
                else
                {
                    effectInfo.Name = s[1];
                    effectInfo.Desc = s[3];
                }

                _effectInfo[id] = effectInfo;
            }
        }
    }
Exemple #6
0
        public void ShowUserSelectListByCardEntry(CardEntry cardEntry, SendNotificationAddCardEntry sendNotificationAddCard)
        {
            //获取需要展示的效果
            EffectInfo needShowEffectInfo = cardEntry.needShowEffectInfo;
            //获取需要用户进行判断的效果
            EffectInfo needChoosePreEffect = needShowEffectInfo.needChoosePreEffect;
            List <OneUserSelectionItem> oneUserSelections = new List <OneUserSelectionItem>();
            //制作第一个选项,用户选择生效
            OneUserSelectionItem oneUserSelectionForYes = new OneUserSelectionItem();

            oneUserSelectionForYes.defaultAvailab = needChoosePreEffect.checkCanExecution;
            oneUserSelectionForYes.selectionText  = needChoosePreEffect.description;
            oneUserSelectionForYes.isExecute      = true;
            oneUserSelectionForYes.cardEntry      = cardEntry;
            //制作第二个选项,用户选择不生效
            OneUserSelectionItem oneUserSelectionForNo = new OneUserSelectionItem();

            oneUserSelectionForNo.defaultAvailab = true;
            oneUserSelectionForNo.selectionText  = "不执行";
            oneUserSelectionForNo.isExecute      = false;
            oneUserSelectionForNo.cardEntry      = cardEntry;
            oneUserSelections.Add(oneUserSelectionForYes);
            oneUserSelections.Add(oneUserSelectionForNo);
            //关闭窗口时执行的操作
            UnityAction choseThisView = () =>
            {
                cardIntactView.gameObject.SetActive(false);
            };

            userSelectionList.LoadingUserSelectionListToCreate(oneUserSelections, sendNotificationAddCard, choseThisView);
        }
Exemple #7
0
 public EffectData(EffectInfo info)
 {
     this.Name = info.Name;
     this.ArgumentDescription = info.ArgumentDescription;
     this.Description         = info.Description;
     this.IsScreenSaver       = info.IsScreenSaver;
 }
        public override void Execute(INotification notification)
        {
            GameContainerProxy gameContainerProxy =
                Facade.RetrieveProxy(GameContainerProxy.NAME) as GameContainerProxy;
            EffectInfoProxy effectInfoProxy =
                Facade.RetrieveProxy(EffectInfoProxy.NAME) as EffectInfoProxy;
            QuestStageCircuitProxy questStageCircuitProxy =
                Facade.RetrieveProxy(QuestStageCircuitProxy.NAME) as QuestStageCircuitProxy;

            switch (notification.Type)
            {
            case GameContainerEvent.GAME_CONTAINER_SYS_CARD_NEED_MOVE:
                CardEntry cardEntryNeedMoveToHand = notification.Body as CardEntry;
                gameContainerProxy.MoveOneCardFromOldeContainerItemToNeweContainerItem(cardEntryNeedMoveToHand, cardEntryNeedMoveToHand.nextGameContainerType);
                break;

            case GameContainerEvent.GAME_CONTAINER_SYS_CARD_NEED_ADD_TO_TTS:
                CardEntry cardEntryNeedAddToTTS = notification.Body as CardEntry;
                //获取卡牌的效果,如果是持续效果则添加到全局监听中
                foreach (string effectCode in cardEntryNeedAddToTTS.effectCodeList)
                {
                    EffectInfo oneEffectInfo = effectInfoProxy.GetDepthCloneEffectByName(effectCode);
                    if (oneEffectInfo.impactType == "Continue")
                    {
                        oneEffectInfo.player    = cardEntryNeedAddToTTS.controllerPlayerItem;
                        oneEffectInfo.cardEntry = cardEntryNeedAddToTTS;
                        questStageCircuitProxy.circuitItem.putOneEffectInfoInActiveMap(oneEffectInfo, effectInfoProxy.effectSysItem.impactTimeTriggerMap);
                    }
                }
                break;
            }
        }
        /// <summary>
        /// Adds the effect with name effectName to info
        /// </summary>
        public static bool AddEffect(VehicleInfo info, string effectName, Vehicle.Flags flagsRequired = Vehicle.Flags.Created, Vehicle.Flags flagsForbidden = 0)
        {
            EffectInfo effect = EffectCollection.FindEffect(effectName);

            if (effect == null)
            {
                return(false);
            }

            int size = info.m_effects != null ? info.m_effects.Length + 1 : 1;

            VehicleInfo.Effect[] tmp = new VehicleInfo.Effect[size];
            if (size > 1)
            {
                Array.Copy(info.m_effects, tmp, size - 1);
            }
            var newEffect = new VehicleInfo.Effect
            {
                m_effect = effect,
                m_parkedFlagsForbidden  = VehicleParked.Flags.Created,
                m_parkedFlagsRequired   = VehicleParked.Flags.None,
                m_vehicleFlagsForbidden = flagsForbidden,
                m_vehicleFlagsRequired  = flagsRequired,
            };

            tmp[size - 1]  = newEffect;
            info.m_effects = tmp;

            return(true);
        }
Exemple #10
0
    void SkillEvent(int idx)
    {
        EffType = (EffectType)(idx + 1);
        switch (EffType)
        {
        case EffectType.ACCELERATE:
            GameMgr.Instance.MainEntity.IsRecoverEnergy = false;
            break;

        case EffectType.WALKINSTANT:
            GameMgr.Instance.MainEntity.EndCurrentStateToOtherState(RoleStateID.Skill);
            break;
        }

        SkillInfo skillInfo = InfoMgr <SkillInfo> .Instance.GetInfo(m_skillInfos[idx].SkillId);

        EffectInfo effectInfo = InfoMgr <EffectInfo> .Instance.GetInfo(skillInfo.effectID);

        if (effectInfo.cd > 0)
        {
            m_btnImage[idx].raycastTarget = false;
            m_timerImage[idx].fillAmount  = 1;
            m_Renders[idx].cull           = false;
            m_timerImage[idx].DOFillAmount(0, (float)effectInfo.cd / AppConst.factor).SetEase(Ease.Linear)
            .OnComplete(() =>
            {
                m_btnImage[idx].raycastTarget = true;
                m_Renders[idx].cull           = true;
            });
        }
        else
        {
            Debug.LogError("技能没有CD。。。,有能量消耗");
        }
    }
Exemple #11
0
        protected void Explode(Mobile m, Point3D p)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            if (ExplodeID > 0)
            {
                var fx = new EffectInfo(p, Map, ExplodeID, ExplodeHue, ExplodeSpeed, ExplodeDuration, ExplodeRender);

                fx.Send();
            }

            if (ExplodeSound >= 0)
            {
                Effects.PlaySound(p, Map, ExplodeSound);
            }

            ExplodeStars(
                m,
                StarsEffect,
                p,
                Utility.RandomMinMax(StarsRangeMin, StarsRangeMax),
                StarsSound,
                Stars.ToArray(),
                StarsHue > 0 ? new[] { StarsHue } : StarHues.ToArray());
        }
Exemple #12
0
 //根据效果实例化一张卡(用作展示)
 public void InitializeByEffectInfo(EffectInfo oneEffectInfo)
 {
     this.effectCodeList = new string[1] {
         oneEffectInfo.code
     };
     this.description = oneEffectInfo.description;
 }
Exemple #13
0
 //执行一个效果
 public void ExecutionOneEffectContent(EffectInfoProxy effectInfoProxy, EffectInfo effectInfo, GameContainerProxy gameContainerProxy)
 {
     EffectExecution(effectInfo, EffectExeType.Execute, gameContainerProxy);
     effectInfo.effectInfoStage = EffectInfoStage.Finished;
     //进行效果执行完之后的检查
     //SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, null, UIViewSystemEvent.UI_EFFECT_DISPLAY_SYS_PUT_ONE_EFFECT);
 }
Exemple #14
0
        public virtual void ExplosionDamage(EffectInfo info)
        {
            ArrayList list = new ArrayList();

            Effects.PlaySound(info.Source.Location, info.Map, 777);

            foreach (Mobile m in
                     info.Source.Location.GetMobilesInRange(info.Map, 0)
                     .Where(m => m != null && !m.Deleted && m.CanBeHarmful(m, false, true)))
            {
                if (m == this || !CanBeHarmful(m))
                {
                    continue;
                }

                if (m.Player)
                {
                    list.Add(m);
                }
            }
            foreach (Mobile m in list)
            {
                DoHarmful(m);
                int toExplode = Utility.RandomMinMax(30, 40);
                m.Damage(toExplode, this);
            }
        }
    /// <summary>
    /// 特效播放完毕的回调
    /// </summary>
    void OnEffectPlayFinish(System.Object effect_object)
    {
        GameObject effet_game_object = effect_object as GameObject;

        if (effet_game_object != null)
        {
            EffectInfo effect_info = null;
            int        key         = effet_game_object.GetHashCode();
            if (mEffectObjects.TryGetValue(key, out effect_info))
            {
                mEffectObjects.Remove(key);
#if UNITY_EDITOR
                if (InSkillEffectEditor())
                {
                    GameObject.Destroy(effet_game_object);
                }
                else
#endif
                {
                    BeforeRecycleEffect(effet_game_object);
                    ObjCachePoolMgr.Instance.RecyclePrefab(effet_game_object, ObjCachePoolType.SFX, effect_info.mTriggerSetting.SuitEffectPath(mIsLocalPlayer ? 0 : 1));
                }
            }
        }
    }
        protected void Fail(Mobile m)
        {
            if (FailEffectID > 0)
            {
                var fx = new EffectInfo(
                    GetWorldLocation(),
                    Map,
                    FailEffectID,
                    FailEffectHue,
                    FailEffectSpeed,
                    FailEffectDuration,
                    FailEffectRender);

                fx.Send();
            }

            if (FailEffectSound > 0)
            {
                Effects.PlaySound(GetWorldLocation(), Map, 1488);
            }

            Movable = Visible = true;

            OnFail(m);
        }
        /// <summary>
        /// Play bulldoze sound (if enabled) for specified building.
        /// </summary>
        /// <param name="target">The building being destroyed.</param>
        protected void PlayBulldozeSound(Building target)
        {
            EffectInfo effect = BuildingManager.instance.m_properties.m_bulldozeEffect;

            if (effect == null)
            {
                return;                            //effect is disabled.
            }
            Log("Triggering bulldoze effect...");

            //var nullAudioGroup = new AudioGroup(0,
            //	new SavedFloat("Bulldoze",
            //		Settings.gameSettingsFile, 0, false));
            var instance  = new InstanceID();
            var spawnArea = new EffectInfo.SpawnArea(
                //Compute where the sound should come from in the world.
                Matrix4x4.TRS(
                    Building.CalculateMeshPosition(target.Info,
                                                   target.m_position, target.m_angle, target.m_length),
                    Building.CalculateMeshRotation(target.m_angle),
                    Vector3.one),
                target.Info.m_lodMeshData);

            EffectManager.instance.DispatchEffect(effect, instance, spawnArea,
                                                  Vector3.zero, 0.0f, 1f,
                                                  AudioManager.instance.EffectGroup);
            //nullAudioGroup);
            Log("Triggered bulldoze effect.");
        }
Exemple #18
0
        public GameObject GetEffectPrefab(long id)
        {
            EffectInfo model = GetEffectModel(id);

            if (model.id < 1)
            {
                return(null);
            }
            Transform target = GetPrefab <Transform>(model.bundle, model.assetPath, BundleType.Prefab_Effect);

            if (target != null)
            {
                ZEffectBase tool = target.GetComponent <ZEffectBase>();
                if (tool == null)
                {
                    tool = target.gameObject.AddComponent <ZEffectBase>();
                }
                tool.lifeTime = model.lifeTime;
                tool.id       = id;
                tool.isLoop   = model.isLoop;
                tool.name     = model.name;
                tool.type     = model.type;
                return(target.gameObject);
            }
            return(null);
        }
Exemple #19
0
        //为效果选择主语目标
        public bool ExecutionEffectFindTarget(EffectInfo effectInfo,
                                              EffectInfoProxy effectInfoProxy,
                                              PlayerGroupProxy playerGroupProxy,
                                              QuestStageCircuitProxy questStageCircuitProxy,
                                              GameContainerProxy gameContainerProxy)
        {
            bool hasTargetOver = true;

            if (effectInfo.effectInfoStage == EffectInfoStage.UnStart || effectInfo.effectInfoStage == EffectInfoStage.ConfirmingTarget)
            {
                effectInfo.effectInfoStage = EffectInfoStage.ConfirmingTarget;
                foreach (TargetSet targetSet in effectInfo.operationalTarget.selectTargetList)
                {
                    bool findOver = FindTargetOrObejct(effectInfo, targetSet, effectInfoProxy, playerGroupProxy, questStageCircuitProxy, gameContainerProxy);
                    if (!findOver)
                    {
                        return(false);
                    }
                }
                foreach (TargetSet targetSet in effectInfo.operationalTarget.selectTargetList)
                {
                    if (!targetSet.hasTarget)
                    {
                        hasTargetOver = false;
                    }
                }
                if (hasTargetOver)
                {
                    effectInfo.effectInfoStage = EffectInfoStage.ConfirmedTarget;
                }
            }


            return(hasTargetOver);
        }
Exemple #20
0
        public virtual void ExplosionStink(EffectInfo info)
        {
            Effects.PlaySound(info.Source.Location, info.Map, ImpactSound);

            Timer.DelayCall(
                TimeSpan.FromSeconds(1),
                () =>
            {
                var targets = info.Source.GetMobilesInRange(info.Map, 0);

                targets.RemoveAll(t => t == null || t.Deleted || t.Hidden || (!t.Alive && !AllowDeadTarget));

                foreach (Mobile m in targets)
                {
                    Effects.PlaySound(m.Location, m.Map, Utility.RandomList(1065, 1066, 1067));

                    if (StinkyDuration > TimeSpan.Zero)
                    {
                        MakeStinky(m, StinkyDuration);
                    }
                }

                targets.Free(true);
            });
        }
Exemple #21
0
 //为前置后置效果选择主语目标
 public bool ExecutionEffectFindTargetForBeforeAndAfter(EffectInfo effectInfo,
                                                        PlayerGroupProxy playerGroupProxy,
                                                        QuestStageCircuitProxy questStageCircuitProxy,
                                                        EffectInfoProxy effectInfoProxy,
                                                        GameContainerProxy gameContainerProxy
                                                        )
 {
     effectInfo.effectInfoStage = EffectInfoStage.ConfirmingTarget;
     //遍历每一个前置效果
     foreach (EffectInfo preEffect in effectInfo.preEffectEntryList)
     {
         preEffect.player    = effectInfo.player;
         preEffect.cardEntry = effectInfo.cardEntry;
         bool hasTarget = ExecutionEffectFindTarget(preEffect, effectInfoProxy, playerGroupProxy, questStageCircuitProxy, gameContainerProxy);
         if (!hasTarget)
         {
             return(hasTarget);
         }
     }
     //遍历每一个后置效果
     foreach (EffectInfo postEffect in effectInfo.postEffectEntryList)
     {
         postEffect.player    = effectInfo.player;
         postEffect.cardEntry = effectInfo.cardEntry;
         bool hasTarget = ExecutionEffectFindTarget(postEffect, effectInfoProxy, playerGroupProxy, questStageCircuitProxy, gameContainerProxy);
         if (!hasTarget)
         {
             return(hasTarget);
         }
     }
     effectInfo.effectInfoStage = EffectInfoStage.ConfirmedTarget;
     return(true);
 }
        public EffectInfo[] GetLoadedEffects()
        {
            var effectArray = new EffectInfo[m_effectDict.Count];

            m_effectDict.Values.CopyTo(effectArray, 0);
            return(effectArray);
        }
Exemple #23
0
        public EffectConfig(EffectData effectData, EffectInfo effectInfo)
        {
            InitializeComponent();

            _IsTimedEffect = effectInfo.IsTimed;

            if (_IsTimedEffect)
            {
                effectconf_timer_type_enable.IsChecked = effectData.EffectTimedType != (effectInfo.IsShort ? EffectTimedType.TIMED_SHORT : EffectTimedType.TIMED_NORMAL);
                effectconf_timer_type.ItemsSource      = new string[]
                {
                    "Normal",
                    "Short"
                };
                effectconf_timer_type.SelectedIndex = effectData.EffectTimedType == EffectTimedType.TIMED_SHORT ? 1 : 0;

                if (effectData.EffectCustomTime >= 0)
                {
                    effectconf_timer_time_enable.IsChecked = true;
                    effectconf_timer_time.Text             = $"{effectData.EffectCustomTime}";
                }
            }

            effectconf_timer_permanent_enable.IsChecked = effectData.EffectPermanent;

            int[] weightItems = new int[10];
            for (int i = 0; i < 10; i++)
            {
                weightItems[i] = i + 1;
            }
            effectconf_effect_weight.ItemsSource   = weightItems;
            effectconf_effect_weight.SelectedIndex = effectData.EffectWeight - 1;

            CheckEnableConfigurables();
        }
        protected virtual void WeatherImpactHandler(MovingEffectInfo info)
        {
            if (info == null || Deleted || !Options.Weather.Impacts || Options.Weather.ImpactEffectID <= 0 ||
                Options.Weather.ImpactEffectSpeed <= 0 || Options.Weather.ImpactEffectDuration <= 0)
            {
                return;
            }

            OnWeatherImpact(info);

            if (Options.Weather.ImpactEffectID <= 0)
            {
                return;
            }

            var effect = new EffectInfo(
                info.Target,
                info.Map,
                Options.Weather.ImpactEffectID,
                Options.Weather.ImpactEffectHue,
                Options.Weather.ImpactEffectSpeed,
                Options.Weather.ImpactEffectDuration,
                Options.Weather.ImpactEffectRender);

            effect.Send();

            OnWeatherImpact(effect);
        }
 public void setInfo(EffectInfo info)
 {
     this.info = info;
     if (this.info != null)
     {
         refreshEffect();
     }
 }
        public static Effect LoadTriggerEffect(EffectInfo info)
        {
            Effect effect = LoadEffect(info);
            if (info.Name != null)
                SaveEffect(info.Name, effect);

            return effect;
        }
Exemple #27
0
 private void OnHitEffectEditorCompleteHandler(EffectInfo effectInfo)
 {
     if (currentActionInfo != null)
     {
         currentActionInfo.HitEffectInfos.Add(effectInfo);
         ShowEffect(currentActionInfo.HitEffectInfos, false);
     }
 }
Exemple #28
0
    //创建effectPool
    void GenerateEffectPool()
    {
        effectSpawnPool = PoolManager.Pools.Create(effectPool);
        effectSpawnPool.group.parent = transform;
        enemyEffectInfo = Game.Instance.StaticData.enemyEffectList;
        foreach (EffectInfo info in enemyEffectInfo)
        {
            PrefabPool prefabPool = new PrefabPool(info.Prefab.transform);
            switch (info.Prefab.name)
            {
            case "GenerationEffect":
                PoolSetting(prefabPool, 8);
                break;

            case "DeadEffect":
                PoolSetting(prefabPool, 6);
                break;

            case "BubbleSinisterAttackEffect":
                PoolSetting(prefabPool, 50);
                break;

            case "BubbleAngryAttackEffect":
                PoolSetting(prefabPool, 4);
                break;
            }
            effectSpawnPool.CreatePrefabPool(prefabPool);
        }

        bossEffectInfo = Game.Instance.StaticData.bossEffectList;
        foreach (EffectInfo info in bossEffectInfo)
        {
            PrefabPool prefabPool = new PrefabPool(info.Prefab.transform);
            switch (info.Prefab.name)
            {
            case "MarkEffect":
                PoolSetting(prefabPool, 20);
                break;

            case "ThunderEffect":
                PoolSetting(prefabPool, 20);
                break;
            }
            effectSpawnPool.CreatePrefabPool(prefabPool);
        }

        if (SceneManager.GetActiveScene().name == Game.Instance.StaticData.Level3)
        {
            bonfireEffectInfo = Game.Instance.StaticData.bonfireEffect;
            PrefabPool prefabPool = new PrefabPool(bonfireEffectInfo.Prefab.transform);
            if (bonfireEffectInfo.Prefab.name == "BonfireEffect")
            {
                PoolSetting(prefabPool, 2);
            }
            effectSpawnPool.CreatePrefabPool(prefabPool);
        }
    }
        public void LoadingEffectBuffInfoByEffectInfo(EffectInfo effectInfo)
        {
            TextMeshProUGUI effectBuffTitle = UtilityHelper.FindChild <TextMeshProUGUI>(transform, "EffectBuffTitle");

            effectBuffTitle.text = effectInfo.cardEntry.name;
            TextMeshProUGUI effectBuffText = UtilityHelper.FindChild <TextMeshProUGUI>(transform, "EffectBuffText");

            effectBuffText.text = effectInfo.description;
        }
        public static Effect GetOrLoadEffect(string name, EffectInfo info)
        {
            if (!storedEffects.ContainsKey(name))
            {
                storedEffects[name] = LoadEffect(info);
            }

            return storedEffects[name];
        }
    //添加静态特效
    public EffectInfo AddEffect(int effectId, int effectType)
    {
        effectIndexId += 1;
        EffectInfo effectInfo = new EffectInfo(effectIndexId, effectId);

        effects.Add(effectIndexId, effectInfo);
        this.eventDispatcher.Broadcast("AddEffect", effectInfo);
        return(effectInfo);
    }
        internal EffectInfo Load(XElement effectNode)
        {
            var info = new EffectInfo();
            info.Name = effectNode.TryAttribute<string>("name");

            var filterNode = effectNode.Element("EntityFilter");
            if (filterNode != null)
            {
                info.Filter = new EntityFilterInfo() {
                    Type = filterNode.TryElementValue<string>("Type")
                };

                var direction = filterNode.TryElementValue<string>("Direction");
                if (direction != null)
                {
                    try
                    {
                        info.Filter.Direction = (Direction)Enum.Parse(typeof(Direction), direction, true);
                    }
                    catch
                    {
                        throw new GameXmlException(filterNode, "Entity filter direction was not valid.");
                    }
                }

                var positionNode = filterNode.Element("Position");
                if (positionNode != null)
                {
                    info.Filter.Position = new PositionFilter() {
                        X = LoadRangeFilter(positionNode.Element("X")),
                        Y = LoadRangeFilter(positionNode.Element("Y"))
                    };
                }
            }

            var parts = new List<IEffectPartInfo>();

            foreach (var node in effectNode.Elements().Where(e => e.Name != "EntityFilter"))
                parts.Add(LoadPart(node));

            info.Parts = parts;

            return info;
        }
        public override void RenderEffect(InstanceID id, EffectInfo.SpawnArea area, Vector3 velocity, float acceleration, float magnitude, float timeDelta, RenderManager.CameraInfo cameraInfo)
        {
            var pos = area.m_matrix.MultiplyPoint(Vector3.zero);
            if ((pos - Camera.main.transform.position).sqrMagnitude > 1000.0f)
            {
                return;
            }

            var dir = area.m_matrix.MultiplyVector(Vector3.forward);

              //  Log.Warning(dir.ToString());

            pos += Vector3.up * 8.0f;
            pos += dir*5.0f;

            id.Index = (uint)UnityEngine.Random.Range(0, 256);
            LightData data = new LightData(id, pos, new Color(1.0f, 0.827f, 0.471f), 0.6f, 32.0f, 10.0f);

            data.m_type = LightType.Spot;
            data.m_spotAngle = 60.0f;
            data.m_rotation = Quaternion.Euler(90, 0, 0);

            Singleton<RenderManager>.instance.DrawLight(data);
        }
Exemple #34
0
		private void DoEffect( EffectInfo effect )
		{
			Mobile m = effect.From;
			int count = effect.Count++;

			if ( !m.Alive )
				StopEffect( m, false );
			else
			{
				Torch torch = m.FindItemOnLayer( Layer.TwoHanded ) as Torch;

				if ( torch != null && torch.Burning )
					StopEffect( m, true );
				else
				{
					if ( (count % 4) == 0 )
					{
						m.LocalOverheadMessage( Network.MessageType.Emote, m.SpeechHue, true, "* The swarm of insects bites and stings your flesh! *" );
						m.NonlocalOverheadMessage( Network.MessageType.Emote, m.SpeechHue, true, String.Format( "* {0} is stung by a swarm of insects *", m.Name ) );
					}

					m.FixedParticles( 0x91C, 10, 180, 9539, EffectLayer.Waist );
					m.PlaySound( 0x00E );
					m.PlaySound( 0x1BC );

					m.Damage( Utility.RandomMinMax( 20, 30 ) , this);

					if ( !m.Alive )
						StopEffect( m, false );
				}
			}
		}
 public void WriteElse(EffectInfo effect, XmlWriter writer)
 {
     writer.WriteStartElement("Else");
     WriteEffectContents(effect, writer);
     writer.WriteEndElement();
 }
 public override void PlayEffect(InstanceID id, EffectInfo.SpawnArea area, Vector3 velocity, float acceleration, float magnitude, AudioManager.ListenerInfo listenerInfo, AudioGroup audioGroup)
 {
 }
 public void AddMeshToScene(Vector3[] vertices, Vector3[] normals, uint[] indices, BeginMode mode, Matrix4 world, Instance[] inst, String name = "mesh")
 {
     EffectInfo info = new EffectInfo();
     info.VertID = Renderer.LoadBuffer(vertices, sceneID, VertexPosition, 0);
     info.NormID = Renderer.LoadBuffer(normals, sceneID, VertexNormal, 1);
     info.IndcID = Renderer.LoadBuffer(indices);
     info.Count = indices.Length;
     info.Mode = mode;
     info.World = world;
     info.Name = GetNewName(name);
     info.Instances = new List<Instance>(inst);
     _info.Add(info.Name, info);
 }
        public static Effect GetOrLoadEffect(string name, EffectInfo info)
        {
            if (!storedEffects.ContainsKey(name))
            {
                storedEffects[name] = LoadEffect(info);
            }

            return storedEffects[name];
        }
Exemple #39
0
 public void AddFunction(EffectInfo effect)
 {
     _functions.Add(effect);
 }
		private void DoEffect( EffectInfo info )
		{
			if ( Deleted )
				return;

			Point3D p = info.Point;
			int index = ++info.Index;
			Mobile from = info.From;

			if ( index == 1 )
			{
				Effects.SendLocationEffect( p, Map, 0x352D, 16, 4 );
				Effects.PlaySound( p, Map, 0x364 );
			}
			else if ( index <= 7 || index == 14 )
			{
				if ( RequireDeepWater )
				{
					for ( int i = 0; i < 3; ++i )
					{
						int x, y;

						switch ( Utility.Random( 8 ) )
						{
							default:
							case 0: x = -1; y = -1; break;
							case 1: x = -1; y =  0; break;
							case 2: x = -1; y = +1; break;
							case 3: x =  0; y = -1; break;
							case 4: x =  0; y = +1; break;
							case 5: x = +1; y = -1; break;
							case 6: x = +1; y =  0; break;
							case 7: x = +1; y = +1; break;
						}

						Effects.SendLocationEffect( new Point3D( p.X + x, p.Y + y, p.Z ), Map, 0x352D, 16, 4 );
					}
				}
				else
				{
					Effects.SendLocationEffect( p, Map, 0x352D, 16, 4 );
				}

				if ( Utility.RandomBool() )
					Effects.PlaySound( p, Map, 0x364 );

				if ( index == 14 )
					FinishEffect( p, Map, from );
				else
					this.Z -= 1;
			}
		}
        public static Effect LoadTriggerEffect(EffectInfo info)
        {
            Effect effect = LoadEffect(info);
            if (info.Name != null)
                SaveEffect(info.Name, effect);

            return effect;
        }
Exemple #42
0
 private void _ui_dgBTLEffects_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         _cCurrentEffectInfo = (EffectInfo)((FrameworkElement)(((RoutedEventArgs)(e)).OriginalSource)).DataContext;
     }
     catch
     {
         _cCurrentEffectInfo = null;
     }
     _ui_cmBTLEffectsRefresh.IsEnabled = true;
     _ui_cmBTLEffectsStop.IsEnabled = true;
     VisualStateManager.GoToState(_ui_cmBTLEffectsStop, "Normal", true);
     _aSelectedItems.Clear();
     if (null == _cCurrentEffectInfo)
         _cCurrentEffectInfo = (EffectInfo)_ui_dgBTLEffects.SelectedItem;
     if (1 < _ui_dgBTLEffects.SelectedItems.Count)
     {
         foreach (EffectInfo cEI in _ui_dgBTLEffects.SelectedItems)
             _aSelectedItems.Add(cEI);
         _ui_cmBTLEffectsStop.Header = "остановить: " + _aSelectedItems.Count + " items";
     }
     else if (null != _cCurrentEffectInfo)
     {
         _aSelectedItems.Add(_cCurrentEffectInfo);
         _ui_cmBTLEffectsStop.Header = "остановить: " + _cCurrentEffectInfo.sInfo;
     }
     else
     {
         _ui_cmBTLEffectsStop.IsEnabled = false;
         VisualStateManager.GoToState(_ui_cmBTLEffectsStop, "Disabled", true);
         _ui_cmBTLEffectsStop.Header = "остановить: не выбраны элементы";
     }
 }
        private static Effect LoadEffect(EffectInfo info)
        {
            var effect = info.Parts.Aggregate(new Effect(e => { }), (c, part) => c + LoadEffectPart(part));

            if (info.Filter != null)
            {
                var filter = info.Filter;
                return e => {
                    var targets = GetFilteredEntities(e.Entities, filter);
                    foreach (var target in targets)
                    {
                        effect(target);
                    }
                };
            }
            else
            {
                return effect;
            }
        }
Exemple #44
0
 private void PlayEffect(EffectInfo effectInfo, bool play)
 {
     if(cloneObjects.ContainsKey(effectInfo))
     {
         var effectObject = cloneObjects[effectInfo];
         if (effectInfo.EffectType == EffectType.Particle)
         {
             var renderQ = effectObject.GetComponent<SetRenderQueue>() ?? effectObject.AddComponent<SetRenderQueue>();
             renderQ.RenderQueue = RenderQ;
             var particles = effectObject.GetComponentsInChildren<ParticleSystem>();
             foreach (var particle in particles)
             {
                 if (play)
                 {
                     particle.Play();
                 }
                 else
                 {
                     particle.Stop();
                 }
             }
         }
     }
 }