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 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); } }
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); } }
protected virtual string GetEffectName() { return(_effectId.ToString()); }
public static string Id2key(this EffectId id) { return("Effect_" + id.ToString()); }