public void PlayParticleEffectAboveTower(string effectPrefabName, float duration) { var offset = new Vector3(0, Height, 0); var pe = new ParticleEffectData(effectPrefabName, gameObject, offset, duration); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(pe); }
protected override void InitAttackData() { SplashRadius = 1.75f; FlightDuration = 1.5f; var fireTrail = new ParticleEffectData("FireTrail", gameObject, 10, true); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(fireTrail); }
protected void Splatter() { var specialEffect = new ParticleEffectData( effectPrefabName: "BloodEffect", origin: gameObject, duration: 3f, followsOrigin: false, diesWithOrigin: false); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(specialEffect); }
protected override void Attack(bool triggering = true) { //Does not attack "regulary" var se = new ParticleEffectData("BlacksmithyExplosion", gameObject, new Vector3(0, WeaponHeight, 0), 5); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(se); var r = GetAttributeValue(AttributeName.AttackRange); var npcs = TargetingHelper.GetNpcsInRadius(transform.position, r); npcs.ForEach(npc => { npc.DealDamage(GetAttributeValue(AttributeName.AttackDamage), this); }); }
public void BeginScreenParticleEffect(string name, int x, int y, string key) { if (!ModEntry.effectDict.TryGetValue(key, out ParticleEffectData template)) { return; } Point position = new Point(x, y); if (!ModEntry.screenDict.ContainsKey(position)) { ModEntry.screenDict[position] = new List <ParticleEffectData>(); } if (!ModEntry.screenDict[position].Exists(d => d.key == key)) { ParticleEffectData ped = ModEntry.CloneParticleEffect(key, "screen", name, x, y, template); ModEntry.screenDict[position].Add(ped); } }
private void MorphToEgg() { var sfx = new ParticleEffectData("FireCircle", gameObject, _hatchTime); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(sfx); var maxHealthAttr = Attributes[AttributeName.MaxHealth]; var movementSpeedAttr = Attributes[AttributeName.MovementSpeed]; maxHealthAttr.AddAttributeEffect(new AttributeEffect(maxHealthAttr.Value / 3, AttributeName.MaxHealth, AttributeEffectType.SetValue, this, _hatchTime, MorphToPhoenix)); Heal(); movementSpeedAttr.AddAttributeEffect(new AttributeEffect(0.0f, AttributeName.MovementSpeed, AttributeEffectType.SetValue, this, _hatchTime)); HealthBar.UpdateHealth(CurrentHealth / maxHealthAttr.Value); _isEgg = true; }
protected override void ApplyEffect(Tower source, Npc target) { if (target.HasAttribute(AttributeName.MovementSpeed)) { var movementSpeed = target.GetAttribute(AttributeName.MovementSpeed); var slowEffect = new AttributeEffect( 0.0f, AttributeName.MovementSpeed, AttributeEffectType.SetValue, this, _stunDuration); movementSpeed.AddAttributeEffect(slowEffect); var effect = new ParticleEffectData("StunEffect", target.gameObject, _stunDuration); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(effect); } }
public void BeginLocationParticleEffect(string location, int x, int y, string key) { if (!ModEntry.effectDict.TryGetValue(key, out ParticleEffectData template)) { return; } if (!ModEntry.locationDict.ContainsKey(location)) { ModEntry.locationDict.Add(location, new Dictionary <Point, List <ParticleEffectData> >()); } Point position = new Point(x, y); if (!ModEntry.locationDict[location].ContainsKey(position)) { ModEntry.locationDict[location][position] = new List <ParticleEffectData>(); } if (!ModEntry.locationDict[location][position].Exists(d => d.key == key)) { ParticleEffectData ped = ModEntry.CloneParticleEffect(key, "location", location, x, y, template); ModEntry.locationDict[location][position].Add(ped); } }
public override void Collide(Collider other, Vector3 pos) { var target = other.gameObject.GetComponentInParent <Npc>(); var tile = other.gameObject.GetComponent <Tile>(); if (target != null) { AttackEffects.ForEach(effect => effect.OnHit(Source, target)); tile = target.CurrentTile; } var offset = new Vector3(0, 0.2f + tile.GetTileHeight(), 0f); var axe = new ParticleEffectData("shred", tile.gameObject, offset, shreddingDuration); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(axe); var dmg = Source.Attributes[AttributeName.AttackDamage].Value; var tileEffect = new DamageTileEffect(tile, dmg, Source); tile.SetTileEffect(tileEffect, shreddingDuration); Destroy(gameObject); }
public void PlayLevelUpEffect() { var pe = new ParticleEffectData("LevelUpEffect", gameObject, 3f); GameManager.Instance.SpecialEffectManager.PlayParticleEffect(pe); }