JC4YSSPLLFZVYO7TPBHS6RGGEYAW3I3LF36QK7A3WDDDTM6P3LJAC
if (multiplicativeBeforeFlat) {
context.addedTags[color] = context.addedTags[color] / multiplicative - flat;
} else {
context.addedTags[color] = (context.addedTags[color] - flat) * multiplicative;
if (MultiplicativeBeforeFlat) {
context.AddedTags[Color] = context.AddedTags[Color] / Multiplicative - Flat;
}
else {
context.AddedTags[Color] = (context.AddedTags[Color] - Flat) * Multiplicative;
}
}
public void Populate(EffectRef effectRef) {
Color = effectRef.Color;
Multiplicative = effectRef.Multiplicative;
Flat = effectRef.Flat;
MultiplicativeBeforeFlat = effectRef.MultiplicativeBeforeFlat;
}
public TagCounter currentTags {get; set;} = new TagCounter();
public TagCounter addedTags {get; set;} = new TagCounter();
public TagCounter removedTags {get; set;} = new TagCounter();
public TagCounter CurrentTags {get; set;} = new TagCounter();
public TagCounter AddedTags {get; set;} = new TagCounter();
public TagCounter RemovedTags {get; set;} = new TagCounter();
switch (shape) {
case AoeShape.SingleTarget: return AffectSingle(origin);
case AoeShape.Radius: return AffectRadius(origin);
case AoeShape.Cone: return AffectCone(origin);
case AoeShape.Path: return AffectPath(origin);
default:
throw new IndexOutOfRangeException();
}
return shape switch {
AoeShape.SingleTarget => AffectSingle(origin),
AoeShape.Radius => AffectRadius(origin),
AoeShape.Cone => AffectCone(origin),
AoeShape.Path => AffectPath(origin),
_ => throw new IndexOutOfRangeException(),
};
if (multiplicativeBeforeFlat) {
context.addedTags[color] = context.addedTags[color] * multiplicative + flat;
} else {
context.addedTags[color] = (context.addedTags[color] + flat) * multiplicative;
if (MultiplicativeBeforeFlat) {
context.AddedTags[Color] = context.AddedTags[Color] * Multiplicative + Flat;
}
else {
context.AddedTags[Color] = (context.AddedTags[Color] + Flat) * Multiplicative;
[SerializeField]
TagColor color {get; set;}
[SerializeField]
float multiplier {get; set;} = 1;
[SerializeField]
TagColor Color { get; set; }
[SerializeField]
float Multiplier { get; set; } = 1;
context.currentDamage += multiplier * context.currentTags[color];
}
context.CurrentDamage += Multiplier * context.CurrentTags[Color];
}
public void Populate(EffectRef effectRef) {
Color = effectRef.Color;
Multiplier = effectRef.Multiplicative;
}
// TODO: Find a better way
switch (EffectType) {
case "AddTags": return new AddTagsEffect {};
case "RemoveTags": return new RemoveTagsEffect {};
case "AccumulateDamageByTag": return new AccumulateDamageByTagEffect {};
case "ApplyDamage": return new ApplyDamageEffect {};
case "CountTags": return new CountTagsEffect {};
default: throw new IndexOutOfRangeException();
Type effectType = typeof(IEffect).Assembly.GetTypes().Where(t => typeof(IEffect).IsAssignableFrom(t) && !t.IsInterface && t.Name == EffectType + EffectTypeSuffix).FirstOrDefault();
if (effectType == null) {
throw new IndexOutOfRangeException();