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; } }
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 }); } }
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 }); }
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; } }
IEffect IEffectCollection.this[EffectId effectId] { get { Contract.Ensures(Contract.Result<IEffect>() != null); throw new NotImplementedException(); } }
IEffect IEffectCollection.this[EffectId effectId] { get { Contract.Ensures(Contract.Result <IEffect>() != null); throw new NotImplementedException(); } }
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); }
public void EndStrike(EffectId id) { if (CurrentStrikeOwner != id) { return; } CurrentStrikeOwner = default; _currentStrike = null; }
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)); }
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); } }
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); } }
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); }
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); } }
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; } } }
public Effect GetEffect(EffectId id) { return(this.activeEffects.ContainsKey(id) ? this.activeEffects[id] : null); }
public bool HasActiveEffect(EffectId id) { return(activeEffects.ContainsKey(id)); }
public void RemoveEffect(EffectId id) { activeEffects.Remove(id); }
public void PrepareStrike(EffectId id, StrikeDef def) { CurrentStrikeOwner = id; _currentStrike = def; _struckEntities.Clear(); }
bool IEffectCollection.ContainsKey(EffectId effectId) { throw new NotImplementedException(); }
public virtual void InitData(GameEntity gameEntity, EffectId effectId) { _entity = gameEntity; _effectId = effectId; }
public Effect(int id, int duration = 0) { this.Id = (EffectId)id; this.Duration = duration; this.CanExpire = duration > 0; }
public ContinousEffectInfo(int pl, int set, float shake, EffectId effectId) : base(pl, set, shake) { id = effectId; }
bool IEveRepository.TryGetEffectById(EveTypeId itemTypeId, EffectId effectId, out Effect value) { throw new NotImplementedException(); }
EffectType IEveRepository.GetEffectTypeById(EffectId id) { throw new NotImplementedException(); }
private void CacheLastData(ProjectileLaunshSetupComponentData data) { lastOnParticleStops = data.effectOnParticleStops; lastOnParticleRemoves = data.effectOnParticleRemoves; }
bool IEffectCollection.TryGetValue(EffectId effectId, out IEffect value) { Contract.Ensures(!Contract.Result <bool>() || Contract.ValueAtReturn(out value) != null); throw new NotImplementedException(); }
Effect IEveRepository.GetEffectById(EveTypeId itemTypeId, EffectId effectId) { throw new NotImplementedException(); }
public EffectContainer GetEffect(EffectId id) { return(effects.Where(e => e.id == id).FirstOrDefault()); }
public void RemoveLayer(EffectId id) { _overrides.Remove(id); }
/* 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)); }
bool IEffectCollection.TryGetValue(EffectId effectId, out IEffect value) { Contract.Ensures(!Contract.Result<bool>() || Contract.ValueAtReturn(out value) != null); throw new NotImplementedException(); }
bool IEveRepository.TryGetEffectTypeById(EffectId id, out EffectType value) { throw new NotImplementedException(); }