/// <summary> /// gets a timed array of all valid effects /// </summary> /// <param name="effectType"></param> /// <returns></returns> public Effect[] getListOfTriggerableEffectsOfType(EffectTypes effectType) { LinkedList <TimedEffect> listOfTimedEffects = timedAndTriggerdEffects[(int)effectType]; //list of all effects of that type LinkedList <Effect> listOfEffects = effects[(int)effectType]; //list of all effects of that type int totalEffectCount = listOfTimedEffects.Count + listOfEffects.Count; Effect[] effectGrouping = new Effect[listOfTimedEffects.Count + listOfEffects.Count]; if (!(listOfEffects.Count == 0)) { LinkedListNode <Effect> curNode = listOfEffects.First; while (curNode != null) { Effect effect = curNode.Value; if (effect.NumberOfUsesLeft <= 0) { LinkedListNode <Effect> tempNode = curNode.Next; listOfEffects.Remove(curNode); curNode = tempNode; totalEffectCount--; } else { curNode.Value.apply(actor); curNode = curNode.Next; } } } if (listOfTimedEffects.Count == 0) { Array.Resize(ref effectGrouping, totalEffectCount); return(effectGrouping); } LinkedListNode <TimedEffect> curNode2 = listOfTimedEffects.First; while (curNode2 != null) { TimedEffect effect2 = curNode2.Value; if (effect2.NumberOfUsesLeft <= 0) { LinkedListNode <TimedEffect> tempNode = curNode2.Next; listOfTimedEffects.Remove(curNode2); curNode2 = tempNode; totalEffectCount--; } else { curNode2.Value.apply(actor); curNode2 = curNode2.Next; } } Array.Resize(ref effectGrouping, totalEffectCount); return(effectGrouping); }
public DummyEffect(EffectTypes type, int targetUniq, string message, int value) { _type = type; _targetUniq = targetUniq; _message = message; _value = value; }
private void OnEffectTypeSelected(int index, string title) { //|| string.IsNullOrEmpty(effectInfo.EffectName) || effectInfo.EffectName == BindTypes.NONE if (effectInfo == null) { return; } int ty = EffectTypes.GetKey(title); if (effectInfo != null) { effectInfo.EffectType = ty; } if (ty == EffectTypes.Normal) { effectBindTypeSet.transform.parent.gameObject.SetActive(true); effectBindNameSet.transform.parent.gameObject.SetActive(true); text1.SetActive(true); text2.SetActive(true); flySpeed.gameObject.SetActive(false); } else if (ty == EffectTypes.Bullet) { flySpeed.gameObject.SetActive(true); //effectBindTypeSet.transform.parent.gameObject.SetActive(false); //effectBindNameSet.transform.parent.gameObject.SetActive(false); //text1.SetActive(false); //text2.SetActive(false); //if (effectInfo != null) //{ // effectInfo.BindType = BindTypes.None; // effectInfo.BindName = BindTypes.NONE; //} } }
public virtual void TestPower(Type type, ActionType actionType, AttackType attackType, string range, DamageTypes damageTypes, string effect, EffectTypes effectTypes, PowerFrequency frequency, PowerSource powerSource, string trigger) { Power power; power = Character.GetPowers().Where(x => (x.GetType() == type)).First(); Assert.NotNull(power, "Power not found"); Assert.AreEqual(actionType, power.Action); Assert.AreEqual(attackType, power.AttackTypeAndRange.AttackType); Assert.AreEqual(range, power.AttackTypeAndRange.Range); Assert.AreEqual(damageTypes, power.DamageTypes); Assert.AreEqual(effect != null, power.HasEffect); if (effect != null) { Assert.AreEqual(effect, power.Effect); } Assert.AreEqual(effectTypes, power.EffectTypes); Assert.AreEqual(frequency, power.Frequency); Assert.AreEqual(powerSource, power.PowerSource); Assert.AreEqual(trigger != null, power.HasTrigger); if (trigger != null) { Assert.AreEqual(trigger, power.Trigger); } }
public ShipMovementInfoChange RemoveEffectTypes(EffectTypes types) { ShipMovementInfoChange removed = new ShipMovementInfoChange(); if ((types & EffectTypes.MaxAngularAcceleration) == EffectTypes.MaxAngularAcceleration) { removed.MaxAngularAcceleration = MaxAngularAcceleration; this.MaxAngularAcceleration = 0; } if ((types & EffectTypes.MaxAngularVelocity) == EffectTypes.MaxAngularVelocity) { removed.MaxAngularVelocity = MaxAngularVelocity; this.MaxAngularVelocity = 0; } if ((types & EffectTypes.MaxLinearAcceleration) == EffectTypes.MaxLinearAcceleration) { removed.MaxLinearAcceleration = MaxLinearAcceleration; this.MaxLinearAcceleration = 0; } if ((types & EffectTypes.MaxLinearVelocity) == EffectTypes.MaxLinearVelocity) { removed.MaxLinearVelocity = MaxLinearVelocity; this.MaxLinearVelocity = 0; } return(removed); }
public RandomTeleport(TargetingInfo effectWho, EffectTypes harmfulEffectTypes, EffectSounds effectSounds, float maxDistance) : base(effectWho, harmfulEffectTypes, effectSounds) { this.maxDistance = maxDistance; }
private static void AddGenericToEffectSpecList( EffectSpecListRec EffectSpecList, EffectTypes Type, object GenericSpec, bool EnabledFlag) { #if DEBUG if (!(((GenericSpec is DelayEffectRec) && (Type == EffectTypes.eDelayEffect)) || ((GenericSpec is NonlinProcSpecRec) && (Type == EffectTypes.eNLProcEffect)) || ((GenericSpec is FilterSpecRec) && (Type == EffectTypes.eFilterEffect)) || ((GenericSpec is AnalyzerSpecRec) && (Type == EffectTypes.eAnalyzerEffect)) || ((GenericSpec is HistogramSpecRec) && (Type == EffectTypes.eHistogramEffect)) || ((GenericSpec is ResamplerSpecRec) && (Type == EffectTypes.eResamplerEffect)) || ((GenericSpec is CompressorSpecRec) && (Type == EffectTypes.eCompressorEffect)) || ((GenericSpec is VocoderSpecRec) && (Type == EffectTypes.eVocoderEffect)) || ((GenericSpec is IdealLPSpecRec) && (Type == EffectTypes.eIdealLowpassEffect)) || ((GenericSpec is ConvolverSpecRec) && (Type == EffectTypes.eConvolverEffect)) || ((GenericSpec is UserEffectSpecRec) && (Type == EffectTypes.eUserEffect)) || ((GenericSpec is PluggableSpec) && (Type == EffectTypes.ePluggableEffect)))) { Debug.Assert(false); throw new ArgumentException(); } #endif EffectNodeRec Effect = new EffectNodeRec(); Effect.Type = Type; Effect.u = GenericSpec; Effect.EnabledFlag = EnabledFlag; Array.Resize(ref EffectSpecList.List, EffectSpecList.List.Length + 1); EffectSpecList.List[EffectSpecList.List.Length - 1] = Effect; }
public AbsorptionSheild(TargetingInfo effectWho, EffectTypes harmfulEffectTypes, EffectSounds effectSounds, LifeSpan lifeTime, EffectTypes filteredEffectTypes, float absorptionRatio) : base(effectWho, harmfulEffectTypes, effectSounds, lifeTime, filteredEffectTypes) { this.absorptionRatio = absorptionRatio; }
public override GeneralChange RemoveEffectTypes(EffectTypes types) { GeneralChange returnvalue = new GeneralChange(); returnvalue.ShipStateChange = ssc.RemoveEffectTypes(types); return(returnvalue); }
/// <summary> /// if an effect type must be a child of a particular class /// this method insures there are no errors /// /// </summary> /// <param name="effect"></param> /// <param name="et"></param> /// <returns>true if effect passes sanity check</returns> private bool varifyEffectType(Effect effect, EffectTypes et) { switch (et) { case EffectTypes.damageDealtChange: return(effect is DamageDealtChange); case EffectTypes.damageReceavedChange: break; case EffectTypes.damageOverTime: return(effect is DamageOverTimeEffect); case EffectTypes.preventCardPlaying: break; case EffectTypes.modifyProjectileSpeed: return(effect is ProjectileSpeedModification); case EffectTypes.changeEquipment: break; case EffectTypes.changeSpeed: break; case EffectTypes.damageOnContact: return(effect is DamageOnContactEffect); default: break; } return(true); }
public override GeneralChange RemoveEffectTypes(EffectTypes types) { GeneralChange returnvalue = new GeneralChange(); returnvalue.MovementInfoChange = smic.RemoveEffectTypes(types); return(returnvalue); }
public override GeneralChange RemoveEffectTypes(EffectTypes types) { GeneralChange returnvalue = new GeneralChange(); PhysicsState psc = PhysicsStateChange; bool filtered = false; if (((int)types * (int)EffectTypes.Position) != 0) { if (returnvalue.PhysicsChange == null) { returnvalue.PhysicsChange = new PhysicsState(); } returnvalue.PhysicsChange.Position += psc.Position; psc.Position = ALVector2D.Zero; filtered = true; } if (((int)types * (int)EffectTypes.Velocity) != 0) { if (returnvalue.PhysicsChange == null) { returnvalue.PhysicsChange = new PhysicsState(); } returnvalue.PhysicsChange.Velocity += psc.Velocity; psc.Velocity = ALVector2D.Zero; filtered = true; } if (filtered) { PhysicsStateChange = psc; } return(returnvalue); }
public ShipStateChange RemoveEffectTypes(EffectTypes types) { ShipStateChange removed = new ShipStateChange(); if ((types & EffectTypes.Energy) == EffectTypes.Energy) { removed.Energy = Energy; this.Energy = 0; } if ((types & EffectTypes.EnergyChangeRate) == EffectTypes.EnergyChangeRate) { removed.EnergyChangeRate = EnergyChangeRate; this.EnergyChangeRate = 0; } if ((types & EffectTypes.Health) == EffectTypes.Health) { removed.Health = Health; this.Health = 0; } if ((types & EffectTypes.HealthChangeRate) == EffectTypes.HealthChangeRate) { removed.HealthChangeRate = HealthChangeRate; this.HealthChangeRate = 0; } return(removed); }
public BackwardsTeleport(TargetingInfo effectWho, EffectTypes harmfulEffectTypes, EffectSounds effectSounds, float distance) : base(effectWho, harmfulEffectTypes, effectSounds) { this.distance = distance; }
Effect(string n, int d, float v, EffectTypes t) { this.name = n; this.duration = d; this.value = v; this.type = t; }
public Effect getEffectofType(EffectTypes type) { // This makes a new effect of specified type Effect e; switch (type) { case EffectTypes.test: e = new TestEffect(""); break; case EffectTypes.moveUnit: e = new MoveEffect(); break; case EffectTypes.enemySpawn: e = new EnemyEffect(); break; case EffectTypes.enemyConversion: e = new ConversationEffect(); break; default: e = new NullEffect(); break; } return(e); }
/// <summary> /// Creates a new effect that increases or decreases a specified stat or skill over time. /// </summary> /// <param name="effectType">Effect type.</param> /// <param name="attributeType">Attribute type.</param> /// <param name="rounds">Rounds.</param> public Effect(EffectTypes effectType, AttributeTypes attributeType, int rounds, int effectValue) { EffectType = effectType; AttributeType = attributeType; PeriodType = PeriodTypes.EffectOverTime; Rounds = rounds; EffectValue = effectValue; }
public AttackEffect(AttackEffect other) { type = other.type; effectType = other.effectType; CalculatedEffectValue = other.CalculatedEffectValue; CalculatedDurationValue = other.CalculatedDurationValue; currentDuration = CalculatedDurationValue; }
/// <summary> /// Creates an on going effect that increases or decreases a specified stat or skill /// </summary> /// <param name="effectType">Effect type.</param> /// <param name="attributeType">Attribute type.</param> public Effect(EffectTypes effectType, AttributeTypes attributeType, int effectValue) { EffectType = effectType; AttributeType = attributeType; PeriodType = PeriodTypes.OnGoing; Rounds = -1; EffectValue = effectValue; }
public Effect(EffectTypes type, int parameter, int parameter2 = 0, int Who = 1, States setstate = States.NONE) { this.Type = type; this.Parameter = parameter; this.Parameter2 = parameter2; this.Who = Who; this.SetState = setstate; }
public Effect(Characteristics target, float amount, EffectTypes type, int duration, DurationTypes durType) { Target = target; Amount = amount; Type = type; Duration = duration; DurType = durType; }
public RemoteActionEffect(TargetingInfo effectsWho, EffectTypes effectTypes, EffectSounds effectSounds, IAction action) : base(effectsWho, effectTypes, effectSounds) { this.action = action; }
public void triggerEffects(EffectTypes effectType, Actor actor) { Effect[] list = getListOfTriggerableEffectsOfType(effectType); for (int i = 0; i < list.Length; i++) { list[i].apply(actor); } }
public override void initContentImpl(int aId) { DataTable dt = Database.getData("effect_def", "effect_def_id", aId, null); if (dt == null) { Program.MainForm.logError("Could not load Effect [" + aId + "]"); return; } if (dt.Rows.Count == 0) { Program.MainForm.logError("Could not load Effect [" + aId + "]"); return; } Program.MainForm.logInfo("Effect loaded [" + aId + "]"); DataRow dataRow = dt.Rows[0]; txtSystemName.Text = dataRow["system_name"].ToString(); txtDisplayName.Text = dataRow["display_name"].ToString(); txtDisplayDescription.Text = dataRow["display_description"].ToString(); int flags = (int)dataRow["flags"]; chkIsFriendly.Checked = ((flags & Globals.EFFECT_FLAG_Friendly) != 0) ? true : false; ComboUtils.fillCombo(cboEffectType, "ref_effect_type", "name", "ref_effect_type_id", Database.getNullableId(dataRow, "ref_effect_type_id")); int duration = (int)dataRow["duration"]; if (duration <= 0) { radInstant.Checked = true; numDuration.Enabled = false; } else { radDuration.Checked = true; numDuration.Enabled = true; numDuration.Value = duration; } dt.Dispose(); ControlName = txtSystemName.Text; // Choose the proper sub-item type, load the data into all controls EffectTypes effectType = (EffectTypes)Database.getNullableId(dataRow, "ref_effect_type_id"); switchEffectType(EffectTypes.HealthChange); switchEffectType(effectType); { mHealthChangeControl.loadEffectData(Id); mStatModControl.loadEffectData(Id); mGiveObjectControl.loadEffectData(Id); mSpaceEffectControl.loadEffectData(Id); mChangePositionControl.loadEffectData(Id); } }
public VuxSlowDownEffect(TargetingInfo effectsWho, EffectTypes effectTypes, EffectSounds effectSounds, LifeSpan lifeTime, ShipMovementInfoChange percents) : base(effectsWho, effectTypes, effectSounds, lifeTime, percents) { this.isHarmful = percents.MaxAngularAcceleration < 1 || percents.MaxAngularVelocity < 1 || percents.MaxLinearAcceleration < 1 || percents.MaxLinearVelocity < 1; }
public ShipStateEffect(TargetingInfo effectsWho, EffectTypes effectTypes, EffectSounds effectSounds, ShipStateChange ssc) : base(effectsWho, effectTypes | ssc.HarmfulEffectTypes, effectSounds) { this.ssc = ssc; this.isHarmful = ssc.Energy < 0 || ssc.EnergyChangeRate < 0 || ssc.Health < 0 || ssc.HealthChangeRate < 0; }
public static List <TypeInfo> GetEffectTypes() { if (!EffectTypes.Any()) { var all = LoadAllEffects <IHueEffect>(); EffectTypes = all; } return(EffectTypes); }
public BaseProlongedEffect(TargetingInfo effectsWho, EffectTypes harmfulEffectTypes, EffectSounds effectSounds, LifeSpan lifeTime) : base(effectsWho, harmfulEffectTypes, effectSounds) { this.lifeTime = lifeTime; }
public LayerInfo GetEffect(EffectTypes eType) { string eTypeKey = Enum.GetName(typeof(EffectTypes), eType); if (!_resources.ContainsKey(eTypeKey)) { return(null); } return(_resources[eTypeKey]); }
protected virtual void SwitchTo(uint handle, EffectTypes effect) { if (RunningEffects[handle].Type == effect) { return; } RunningEffects[handle].PrevType = RunningEffects[handle].Type; RunningEffects[handle].Type = effect; Log("Effect " + handle.ToString() + " [" + RunningEffects[handle].PrevType.ToString() + "] to [" + effect.ToString() + "]"); }
public bool enableEffect(EffectTypes eType) { LayerInfo effect = GetEffect(eType); if (effect == null) { return(false); } return(((EffectBase)effect).Enabled); }
private Weapon CreateWeaponSword(EffectTypes effectType, AttributeTypes attributeTypes, int value, string name) { List <Effect> effects = new List <Effect>(); Effect tempEffect = new Effect(effectType, attributeTypes, value); effects.Add(tempEffect); return(new Weapon(6, WeaponTypes.Sword, Handedness.Single, DamageTypes.Slashing, name, ItemTypes.Weapon, MaterialTypes.Steel, 400, effects)); }
public MovementInfoEffect(TargetingInfo effectsWho, EffectTypes effectTypes, EffectSounds effectSounds, LifeSpan lifeTime, ShipMovementInfoChange smic) : base(effectsWho, effectTypes | smic.HarmfulEffectTypes, effectSounds, lifeTime) { this.smic = smic; this.isHarmful = smic.MaxAngularAcceleration < 0 || smic.MaxAngularVelocity < 0 || smic.MaxLinearAcceleration < 0 || smic.MaxLinearVelocity < 0; }
public override void TestPower(Type type, ActionType actionType, AttackType attackType, string range, DamageTypes damageTypes, string effect, EffectTypes effectTypes, PowerFrequency frequency, PowerSource powerSource, string trigger) { base.TestPower(type, actionType, attackType, range, damageTypes, effect, effectTypes, frequency, powerSource, trigger); }
private void removeSpecificEffectType(EffectTypes effectType) { List<IEffect> toRemove = new List<IEffect>(); foreach (IEffect e in currentEffects) { if (e.type == effectType) { toRemove.Add(e); } } foreach (IEffect e in toRemove) { currentEffects.Remove(e); } }
public virtual void Release( Mobile m ) { if ( effect != EffectTypes.None ) m.CumulativeAuraEffects[ effect ] = null; if ( auraPeriodicTimer != null ) { auraPeriodicTimer.Stop(); auraPeriodicTimer = null; } effect = EffectTypes.None; val = 0; if ( OnRelease != null ) { ( OnRelease as AuraReleaseDelegate )( m ); } }
public Aura( EffectTypes et ) { }
/// <summary> /// 移除特效 /// </summary> /// <param name="type">特效类型</param> public void RemoveEffect(EffectTypes type) { AnimationBase animation = effects.SingleOrDefault(X => X.Key == type).Value; if (animation != null) { effects.Remove(type); this.Children.Remove(animation); animation.Dispose(animation, null); } }
// Event for the effect. Parameter function vary based on the type. Who is 0 (User) and 1 (target) public static void Event(VSPlayer User, TSPlayer Target, EffectTypes type, int Parameter, int Parameter2 = 0, int Who = 1, States setstate = States.NONE) { if (type.Equals(EffectTypes.BUFF)) { try { if (Who == 0) User.TSPlayer.SetBuff(Parameter, Parameter2 * 60, false); else Target.SetBuff(Parameter, Parameter2 * 60, false); } catch (Exception) { Log.ConsoleError("[VSSystem] A command has returned an error at Effect parameter: Invalid buff ID"); } } else if (type.Equals(EffectTypes.HEALSELF)) { if (Who == 0) User.TSPlayer.Heal(Parameter); else Target.Heal(Parameter); } else if (type.Equals(EffectTypes.TICKLE)) { if (Who == 0) { if (VSSystem.ItemCheck(TShock.Utils.GetItemByName("Hand Warmer")[0].netID, User.TSPlayer)) { User.TSPlayer.DamagePlayer(10000); User.TSPlayer.TPlayer.KillMe(10000, 0, true, " was tickled to death for having Hand Warmer."); } else User.TSPlayer.SetBuff(47, Parameter * 60, false); } else { if (VSSystem.ItemCheck(TShock.Utils.GetItemByName("Hand Warmer")[0].netID, Target)) { Target.DamagePlayer(10000); Target.TPlayer.KillMe(10000, 0, true, " was tickled to death for having Hand Warmer."); } else Target.SetBuff(47, Parameter * 60, false); } } else if (type.Equals(EffectTypes.STATE) && setstate != States.NONE) { if (Who == 0) User.SetState(setstate, Parameter); else VSSystem.VSPlayers[Target.UserID].SetState(setstate, Parameter); } }
public void DrawConeBlast(List<Point> points, TCODColor color) { m_type = EffectTypes.Cone; m_animationStartTime = TCODSystem.getElapsedMilli(); m_points = points; m_color = color; m_done = false; }
public void DrawExploadingPointBlast(List<Point> path, List<List<Point>> blast, TCODColor color) { m_type = EffectTypes.ExploadingPoint; m_animationStartTime = TCODSystem.getElapsedMilli(); m_path = path; m_blast = blast; m_color = color; m_done = false; }
/// <summary> /// 通过调整色相改变特效颜色 /// </summary> /// <param name="type">特效类型</param> /// <param name="value"></param> public void ShiftEffectColor(EffectTypes type, double value) { AnimationBase animation = effects.SingleOrDefault(X => X.Key == type).Value; if (animation != null) { animation.Effect = value == 0 ? null : new ShiftHue() { HueShift = value }; } }
/// <summary> /// 设置特效是否显示 /// </summary> /// <param name="type"></param> /// <param name="visible"></param> public void SetEffectVisible(EffectTypes type, bool visible) { AnimationBase animation = effects.SingleOrDefault(X => X.Key == type).Value; if (animation != null) { animation.IsVisible = visible; } }
/// <summary> /// 设置特效位置 /// </summary> /// <param name="type"></param> /// <param name="p"></param> public void SetEffectPosition(EffectTypes type, Point p) { AnimationBase animation = effects.SingleOrDefault(X => X.Key == type).Value; if (animation != null) { animation.Position = p; } }
/// <summary> /// Returns a collection of effects with the specifed type. /// </summary> /// <param name="effectType"></param> /// <returns></returns> public List<EffectEntry> GetEffectsByType(EffectTypes effectType) { List<EffectEntry> result = new List<EffectEntry>(); /*foreach (EffectHolder effect in effectList) { if (effect.EffectInfo.EffectType == effectType) result.Add(effect.EffectInfo); }*/ for (int i = 0; i < effectList.Count; ++i) { if (effectList[i].EffectInfo.EffectType == effectType) result.Add(effectList[i].EffectInfo); } return result; }
public void DrawRangedBolt(List<Point> path, TCODColor color, int tailLength, bool drawLastTargetSquare) { m_type = EffectTypes.RangedBolt; m_animationStartTime = TCODSystem.getElapsedMilli(); m_points = path; if (!drawLastTargetSquare) m_points.RemoveAt(m_points.Count - 1); m_color = color; m_tailLength = tailLength; m_done = false; }
/// <summary> /// Determines whether the unit has applied aura with the specified effect type. /// </summary> /// <param name="effectType">One of the <see cref="EffectTypes"/> value.</param> /// <returns><c>true</c> if the unit has at least one aura with the specified type; otherwise, <c>false</c>.</returns> public bool HasEffectType(EffectTypes effectType) { return GetEffectsByType(effectType).Count > 0; }
private void FinishAnimation() { m_done = true; m_type = EffectTypes.None; return; }
public void DrawStream(List<Point> path, TCODColor color, Dictionary<Point, bool> locationsOccupied) { m_type = EffectTypes.Stream; m_animationStartTime = TCODSystem.getElapsedMilli(); m_points = path; m_color = color; m_locationsOccupied = locationsOccupied; m_done = false; }
/// <summary> /// 添加特效 /// </summary> /// <param name="animation">特效动画</param> /// <param name="type">特效类型</param> public void AddEffect(AnimationBase animation, EffectTypes type) { RemoveEffect(type); effects.Add(type, animation); this.Children.Add(animation); animation.HeartStart(); }