コード例 #1
0
    public void InstantEffect(EffectId effectId, Vector3 position)
    {
        EffectParticle func = (particle, pos, audioClip) => {
            GameObject obj = Instantiate(particle, pos, Quaternion.Euler(Vector3.zero)) as GameObject;
            Destroy(obj, destroyInterval);
            audioSource.PlayOneShot(audioClip);
        };

        switch (effectId)
        {
        case EffectId.GetItem:
            func(getItem.particle, position, getItem.se);
            break;

        case EffectId.KillEnemy:
            func(killEnemy.particle, position, killEnemy.se);
            break;

        case EffectId.GetSweet:
            func(getSweet.particle, position, getSweet.se);
            break;

        case EffectId.GameOver:
            func(checkPoint.particle, position, checkPoint.se);
            break;
        }
    }
コード例 #2
0
 public virtual void Strike(EffectId owner, EntityId targetId)
 {
     if (targetId == this.ParentEntity.Id)
     {
         return;
     }
     if (CurrentStrikeOwner != owner)
     {
         return;
     }
     if (_currentStrike == null)
     {
         return;
     }
     if (!_struckEntities.Add(targetId))
     {
         return;
     }
     if (_currentStrike.PredicateOnTarget == null ||
         _currentStrike.PredicateOnTarget.Def.Check(new ScriptingContext(ParentEntity)
     {
         Host = targetId, Target = targetId, Parent = new ScriptingContext()
         {
             Host = ParentEntity.Id
         }
     }))
     {
         ((IHasSpells)ParentEntity).SpellsEngine.CastFromInsideEntity(new SpellCast()
         {
             Def = _currentStrike.SpellOnStrike.Def, OwnerObject = ParentEntity.Id, TargetEntity = targetId
         });
     }
 }
コード例 #3
0
 public void SetLayer(EffectId id, Dictionary <SpellDef, SpellDef> overriddes)
 {
     _overrides.Add(id, new Layer()
     {
         Index = _overrides.Count == 0 ? 0 : _overrides.Max(x => x.Value.Index) + 1, Overrides = overriddes
     });
 }
コード例 #4
0
    public void InstantEffect(EffectId effectId)
    {
        switch (effectId)
        {
        case EffectId.GetItem:
            audioSource.PlayOneShot(getItem.se);
            break;

        case EffectId.KillEnemy:
            audioSource.PlayOneShot(killEnemy.se);
            break;

        case EffectId.GetSweet:
            audioSource.PlayOneShot(getSweet.se);
            break;

        case EffectId.GameOver:
            audioSource.PlayOneShot(gameOver.se);
            break;

        case EffectId.CheckPoint:
            audioSource.PlayOneShot(checkPoint.se);
            break;
        }
    }
コード例 #5
0
 IEffect IEffectCollection.this[EffectId effectId]
 {
     get
       {
     Contract.Ensures(Contract.Result<IEffect>() != null);
     throw new NotImplementedException();
       }
 }
コード例 #6
0
 IEffect IEffectCollection.this[EffectId effectId]
 {
     get
     {
         Contract.Ensures(Contract.Result <IEffect>() != null);
         throw new NotImplementedException();
     }
 }
コード例 #7
0
ファイル: EffectFactory.cs プロジェクト: swedendry/RandomCube
    public static void Spawn(EffectId id, Transform target, float durationTime, params object[] values)
    {
        var key    = id.Id2key();
        var entity = PoolFactory.Get <Effect>(key, Vector3.zero, Quaternion.identity);

        entity.OnReturn = Return;
        entity.Spawn(key, target, durationTime, values);
    }
コード例 #8
0
 public void EndStrike(EffectId id)
 {
     if (CurrentStrikeOwner != id)
     {
         return;
     }
     CurrentStrikeOwner = default;
     _currentStrike     = null;
 }
コード例 #9
0
ファイル: EffectCommand.cs プロジェクト: EEmulator/EEmulator
        private bool CanGiveEffect(Player player, EffectId effect)
        {
            var brick = "brickeffect" + effect.ToString().ToLower();

            switch (effect)
            {
            case EffectId.Fire: brick = "bricklava"; break;

            case EffectId.Run: brick = "brickeffectspeed"; break;
            }

            return(player.HasBrickPack(brick));
        }
コード例 #10
0
    public void RemoveContinousEffect(EffectId effectId, int player)
    {
        string key = effectId.ToString() + player.ToString();

        continousEffectList.Remove(key);

        //If that was the last effect, stop all effects
        if (temporalEffectList.Count == 0 && continousEffectList.Count == 0)
        {
            finalEffects.Reset();
            mainCameraController.SetEffects(finalEffects);
            entryCameraController.SetEffects(finalEffects);
            godCameraController.SetEffects(finalEffects);
        }
    }
コード例 #11
0
    public void AddContinousEffect(EffectId effectId, int player = 0, float shake = 0f, int effects = Effects.NONE)
    {
        if (!effectsActive)
        {
            return;
        }

        string key = effectId.ToString() + player.ToString();

        if (!continousEffectList.ContainsKey(key))
        {
            ContinousEffectInfo effect = new ContinousEffectInfo(player, effects, shake, effectId);
            continousEffectList.Add(key, effect);
        }
    }
コード例 #12
0
        static AEffect GetEffect(TargetEffects target, EffectId effectId)
        {
            if (!EffectsMap.ContainsKey(target))
            {
                EffectsMap.Add(target, new List <AEffect>());
            }

            var effect = EffectsMap[target].Find(e => e.Id == effectId);

            if (effect == null)
            {
                effect = Effects[effectId].Clone();
                EffectsMap[target].Add(effect);
            }
            return(effect);
        }
コード例 #13
0
    void OnTriggerEnter(Collider collider)
    {
        var ce = transform.root.GetComponent <Visual>()?.Obj as IHasCombatEngine;

        if (ce == null)
        {
            return;
        }
        var otherEnt = collider.transform.root.GetComponent <Visual>()?.Obj as GhostedEntity;

        if (_lastStrikeOwner != ce.CombatEngine.CurrentStrikeOwner)
        {
            _strikedEntities.Clear();
        }
        _lastStrikeOwner = ce.CombatEngine.CurrentStrikeOwner;
        if (ce != null && otherEnt != null && ce.CombatEngine.CurrentStrikeOwner != default && _strikedEntities.Add(otherEnt.Id))
        {
            ce.CombatEngine.Strike(ce.CombatEngine.CurrentStrikeOwner, otherEnt.Id);
        }
    }
コード例 #14
0
ファイル: Buff.cs プロジェクト: foolishfool/Spine
    IEnumerator DisplayEffect(string effectName, SpecialEffect effectConfig, EffectId id)
    {
        if (!string.IsNullOrEmpty(effectName))
        {
            yield return(StartCoroutine(AssetManager.LoadAsset(effectName, AssetManager.AssetType.Effect, false)));

            GameObject obj = AssetManager.GetGameObject(effectName, target.GetEffectPoint((EffectPoint)effectConfig.bone));
            if (id == EffectId.StartEffect)
            {
                startEffect = obj;
            }
            else if (id == EffectId.ProcessEffect)
            {
                processEffect = obj;
            }
            else if (id == EffectId.EndEffect)
            {
                endEffect = obj;
            }
        }
    }
コード例 #15
0
ファイル: Player.cs プロジェクト: EEmulator/EEmulator
 public Effect GetEffect(EffectId id)
 {
     return(this.activeEffects.ContainsKey(id) ? this.activeEffects[id] : null);
 }
コード例 #16
0
ファイル: Player.cs プロジェクト: EEmulator/EEmulator
 public bool HasActiveEffect(EffectId id)
 {
     return(activeEffects.ContainsKey(id));
 }
コード例 #17
0
ファイル: Player.cs プロジェクト: EEmulator/EEmulator
 public void RemoveEffect(EffectId id)
 {
     activeEffects.Remove(id);
 }
コード例 #18
0
 public void PrepareStrike(EffectId id, StrikeDef def)
 {
     CurrentStrikeOwner = id;
     _currentStrike     = def;
     _struckEntities.Clear();
 }
コード例 #19
0
 bool IEffectCollection.ContainsKey(EffectId effectId)
 {
     throw new NotImplementedException();
 }
コード例 #20
0
 public virtual void InitData(GameEntity gameEntity, EffectId effectId)
 {
     _entity   = gameEntity;
     _effectId = effectId;
 }
コード例 #21
0
 public Effect(int id, int duration = 0)
 {
     this.Id        = (EffectId)id;
     this.Duration  = duration;
     this.CanExpire = duration > 0;
 }
コード例 #22
0
 public ContinousEffectInfo(int pl, int set, float shake, EffectId effectId) : base(pl, set, shake)
 {
     id = effectId;
 }
コード例 #23
0
ファイル: DummyEveRepository.cs プロジェクト: jhtodd/Eve
 bool IEveRepository.TryGetEffectById(EveTypeId itemTypeId, EffectId effectId, out Effect value)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
ファイル: DummyEveRepository.cs プロジェクト: jhtodd/Eve
 EffectType IEveRepository.GetEffectTypeById(EffectId id)
 {
     throw new NotImplementedException();
 }
コード例 #25
0
 private void CacheLastData(ProjectileLaunshSetupComponentData data)
 {
     lastOnParticleStops   = data.effectOnParticleStops;
     lastOnParticleRemoves = data.effectOnParticleRemoves;
 }
コード例 #26
0
 bool IEffectCollection.TryGetValue(EffectId effectId, out IEffect value)
 {
     Contract.Ensures(!Contract.Result <bool>() || Contract.ValueAtReturn(out value) != null);
     throw new NotImplementedException();
 }
コード例 #27
0
ファイル: DummyEveRepository.cs プロジェクト: jhtodd/Eve
 Effect IEveRepository.GetEffectById(EveTypeId itemTypeId, EffectId effectId)
 {
     throw new NotImplementedException();
 }
コード例 #28
0
 public EffectContainer GetEffect(EffectId id)
 {
     return(effects.Where(e => e.id == id).FirstOrDefault());
 }
コード例 #29
0
 public void RemoveLayer(EffectId id)
 {
     _overrides.Remove(id);
 }
コード例 #30
0
 bool IEffectCollection.ContainsKey(EffectId effectId)
 {
     throw new NotImplementedException();
 }
コード例 #31
0
        /* Methods */

        /// <summary>
        /// Computes a compound ID for the specified sub-IDs.
        /// </summary>
        /// <param name="itemTypeId">
        /// The item type ID.
        /// </param>
        /// <param name="effectId">
        /// The effect ID.
        /// </param>
        /// <returns>
        /// A compound ID combining the two sub-IDs.
        /// </returns>
        public static IConvertible CreateCacheKey(int itemTypeId, EffectId effectId)
        {
            return(EveCache.CreateCompoundCacheKey(itemTypeId, effectId));
        }
コード例 #32
0
 bool IEffectCollection.TryGetValue(EffectId effectId, out IEffect value)
 {
     Contract.Ensures(!Contract.Result<bool>() || Contract.ValueAtReturn(out value) != null);
       throw new NotImplementedException();
 }
コード例 #33
0
ファイル: DummyEveRepository.cs プロジェクト: jhtodd/Eve
 bool IEveRepository.TryGetEffectTypeById(EffectId id, out EffectType value)
 {
     throw new NotImplementedException();
 }