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3SD24RPC56PHAC
CD5FF75KTOBTMVMTMCKMR6F5DFKOF26I5K43ITNHGBI3ZAZHA4RAC
IDXWT3DH3C3X7PP4VVKUZTCGDALW6NH7KREI4E2VFQVMCBJKDMTAC
public class PainUnit : IUnit { }
public class FatigueUnit : IUnit { }
public class StrainUnit : IUnit { }
public class RedTagUnit : IUnit { }
public class BlueTagUnit : IUnit { }
public class GreenTagUnit : IUnit { }
public sealed class PainUnit : IUnit { }
public sealed class FatigueUnit : IUnit { }
// public class StrainUnit : IUnit { }
public sealed class RedTagUnit : IUnit { }
public sealed class BlueTagUnit : IUnit { }
public sealed class GreenTagUnit : IUnit { }
fileFormatVersion: 2
guid: a0f98e069ccf22c4e8a510cac9b4772f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
[System.Serializable]
public class EffectRef
{
public TagColor Color;
public IEffect Build() {
iEffect.Populate(this);
return iEffect;
}
}
var iEffect = (IEffect)Activator.CreateInstance(EffectType.Type);
public AreaOfEffect Area;
public bool FriendOrFoeOff;
public bool MultiplicativeBeforeFlat;
public float Flat;
public float Multiplicative;
[ClassImplements(typeof(IEffect))]
public ClassTypeReference EffectType;
using TypeReferences;
public class EffectContext
public interface IResourceContext<TResource, TUnit>
where TResource : Resource<TUnit>
where TUnit : IUnit
{
public Unit<TUnit> Current { get; set; }
public Unit<TUnit> Added { get; set; }
public Unit<TUnit> Removed { get; set; }
}
public class EffectContext :
IResourceContext<Pain, PainUnit>,
IResourceContext<Fatigue, FatigueUnit>,
IResourceContext<BlueTag, BlueTagUnit>,
IResourceContext<RedTag, RedTagUnit>,
IResourceContext<GreenTag, GreenTagUnit>
public EffectSystem EffectSystem {get; private set;}
public EffectSystem EffectSystem { get; private set; }
Unit<PainUnit> IResourceContext<Pain, PainUnit>.Current { get; set; }
Unit<PainUnit> IResourceContext<Pain, PainUnit>.Added { get; set; }
Unit<PainUnit> IResourceContext<Pain, PainUnit>.Removed { get; set; }
Unit<FatigueUnit> IResourceContext<Fatigue, FatigueUnit>.Current { get; set; }
Unit<FatigueUnit> IResourceContext<Fatigue, FatigueUnit>.Added { get; set; }
Unit<FatigueUnit> IResourceContext<Fatigue, FatigueUnit>.Removed { get; set; }
Unit<BlueTagUnit> IResourceContext<BlueTag, BlueTagUnit>.Current { get; set; }
Unit<BlueTagUnit> IResourceContext<BlueTag, BlueTagUnit>.Added { get; set; }
Unit<BlueTagUnit> IResourceContext<BlueTag, BlueTagUnit>.Removed { get; set; }
Unit<RedTagUnit> IResourceContext<RedTag, RedTagUnit>.Current { get; set; }
Unit<RedTagUnit> IResourceContext<RedTag, RedTagUnit>.Added { get; set; }
Unit<RedTagUnit> IResourceContext<RedTag, RedTagUnit>.Removed { get; set; }
Unit<GreenTagUnit> IResourceContext<GreenTag, GreenTagUnit>.Current { get; set; }
Unit<GreenTagUnit> IResourceContext<GreenTag, GreenTagUnit>.Added { get; set; }
Unit<GreenTagUnit> IResourceContext<GreenTag, GreenTagUnit>.Removed { get; set; }
}
public void Populate(EffectRef effectRef) {
Color = effectRef.Color;
FriendOrFoeOff = effectRef.FriendOrFoeOff;
fileFormatVersion: 2
guid: 726bf443cd348dc4ab59db381be2a94b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Linq;
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects
{
public class CountResourceEffect<TResource, TUnit> : IEffect
where TResource : Resource<TUnit>
where TUnit : IUnit
{
[SerializeField] bool FriendOrFoeOff;
readonly string _effectName = $"Count({typeof(TResource).Name})Effect";
public void Apply(EffectContext context) {
Debug.Log($"{_effectName}: Apply");
var amount = context.GetEffectedUnits()
.Select(transform => transform.GetComponent<TResource>())
.Where(resource => resource != null)
.Select(resource => resource.Current)
.Aggregate((Unit<TUnit>)0, (sum, next) => sum += next);
((IResourceContext<TResource, TUnit>)context).Current += amount;
Debug.Log($"{_effectName}: {((IResourceContext<TResource, TUnit>)context).Current}");
context.EffectSystem.ApplyTagsEffect(null, context.EffectLocation, context.AreaOfEffect);
}
public void Effect(EffectContext context) {
Debug.Log($"{_effectName}: Effect");
context.EffectsToTrigger.Add(this);
}
}
namespace CountResource
{
public class CountPainEffect : CountResourceEffect<Pain, PainUnit> { }
public class CountFatigueEffect : CountResourceEffect<Fatigue, FatigueUnit> { }
public class CountBlueTagEffect : CountResourceEffect<BlueTag, BlueTagUnit> { }
public class CountRedTagEffect : CountResourceEffect<RedTag, RedTagUnit> { }
public class CountGreenTagEffect : CountResourceEffect<GreenTag, GreenTagUnit> { }
}
}
fileFormatVersion: 2
guid: abc49c2353e5fa840822c32bde63848e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Linq;
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects
{
public class ApplyResourceEffect<TResource, TUnit> : IEffect
where TResource : Resource<TUnit>
where TUnit : IUnit
{
readonly string _effectName = $"Apply({typeof(TResource).Name})Effect";
public void Apply(EffectContext context) {
Debug.Log($"{_effectName}: Apply");
foreach (var resource in context.GetEffectedUnits().Select(target => target.GetComponent<TResource>()).Where(resource => resource != null)) {
resource.Current += ((IResourceContext<TResource, TUnit>)context).Current;
}
context.EffectSystem.ApplyTagsEffect(null, context.EffectLocation, context.AreaOfEffect);
}
public void Effect(EffectContext context) {
Debug.Log($"{_effectName}: Effect");
context.EffectsToTrigger.Add(this);
}
}
namespace ApplyResource
{
public sealed class ApplyPainEffect : ApplyResourceEffect<Pain, PainUnit> { }
public sealed class ApplyFatigueEffect : ApplyResourceEffect<Fatigue, FatigueUnit> { }
public sealed class ApplyBlueTagEffect : ApplyResourceEffect<BlueTag, BlueTagUnit> { }
public sealed class ApplyRedTagEffect : ApplyResourceEffect<RedTag, RedTagUnit> { }
public sealed class ApplyGreenTagEffect : ApplyResourceEffect<GreenTag, GreenTagUnit> { }
}
}
public void Populate(EffectRef effectRef) {
Color = effectRef.Color;
Multiplicative = effectRef.Multiplicative;
Flat = effectRef.Flat;
MultiplicativeBeforeFlat = effectRef.MultiplicativeBeforeFlat;
}
fileFormatVersion: 2
guid: 7a03184999e76224183028f42dca8218
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects.AddResource
{
public class AddResourceEffect<TResource, TUnit> : IEffect
where TResource : Resource<TUnit>
where TUnit : IUnit
{
[SerializeField] float Multiplicative;
[SerializeField] Unit<TUnit> Flat;
[SerializeField] bool MultiplicativeBeforeFlat;
readonly string _effectName = $"Add({typeof(TResource).Name})Effect";
public void Apply(EffectContext context) {
Debug.Log($"{_effectName}: Apply");
}
public void Effect(EffectContext context) {
Debug.Log($"{_effectName}: Effect");
if (MultiplicativeBeforeFlat) {
((IResourceContext<TResource, TUnit>)context).Added = ((IResourceContext<TResource, TUnit>)context).Added * Multiplicative + Flat;
}
else {
((IResourceContext<TResource, TUnit>)context).Added = (((IResourceContext<TResource, TUnit>)context).Added + Flat) * Multiplicative;
}
}
}
public sealed class AddPainEffect : AddResourceEffect<Pain, PainUnit> { }
public sealed class AddFatigueEffect : AddResourceEffect<Fatigue, FatigueUnit> { }
public sealed class AddBlueTagEffect : AddResourceEffect<BlueTag, BlueTagUnit> { }
public sealed class AddRedTagEffect : AddResourceEffect<RedTag, RedTagUnit> { }
public sealed class AddGreenTagEffect : AddResourceEffect<GreenTag, GreenTagUnit> { }
}
fileFormatVersion: 2
guid: 25786a3bdf537c14ca2b19b61c9451e5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects
{
public class AccumulateResourceByResourceEffect<TResourceDest, TUnitDest, TResourceBy, TUnitBy> : IEffect
where TResourceDest : Resource<TUnitDest>
where TUnitDest : IUnit
where TResourceBy : Resource<TUnitBy>
where TUnitBy : IUnit
{
[SerializeField] float Multiplier = 1f;
readonly string _effectName = $"Accumulate({typeof(TResourceDest).Name})By({typeof(TResourceBy).Name})Effect";
public void Apply(EffectContext context) {
Debug.Log($"{_effectName}: Apply");
var unitlessByResource = Multiplier * (int)((IResourceContext<TResourceBy, TUnitBy>)context).Current;
Debug.Log($"Accumulating {unitlessByResource} into {typeof(TResourceDest).Name}.Current");
((IResourceContext<TResourceDest, TUnitDest>)context).Current += (Unit<TUnitDest>)unitlessByResource;
}
public void Effect(EffectContext context) {
Debug.Log($"{_effectName}: Effect");
context.EffectsToTrigger.Add(this);
}
}
namespace AccumulatePainByResource
{
public sealed class AccumulatePainByPainTagEffect : AccumulateResourceByResourceEffect<Pain, PainUnit, Pain, PainUnit> { }
public sealed class AccumulatePainByFatigueTagEffect : AccumulateResourceByResourceEffect<Pain, PainUnit, Fatigue, FatigueUnit> { }
public sealed class AccumulatePainByBlueTagEffect : AccumulateResourceByResourceEffect<Pain, PainUnit, BlueTag, BlueTagUnit> { }
public sealed class AccumulatePainByRedTagEffect : AccumulateResourceByResourceEffect<Pain, PainUnit, RedTag, RedTagUnit> { }
public sealed class AccumulatePainByGreenTagEffect : AccumulateResourceByResourceEffect<Pain, PainUnit, GreenTag, GreenTagUnit> { }
}
namespace AccumulateFatigueByResource
{
public sealed class AccumulateFatigueByPainTagEffect : AccumulateResourceByResourceEffect<Fatigue, FatigueUnit, Pain, PainUnit> { }
public sealed class AccumulateFatigueByFatigueTagEffect : AccumulateResourceByResourceEffect<Fatigue, FatigueUnit, Fatigue, FatigueUnit> { }
public sealed class AccumulateFatigueByBlueTagEffect : AccumulateResourceByResourceEffect<Fatigue, FatigueUnit, BlueTag, BlueTagUnit> { }
public sealed class AccumulateFatigueByRedTagEffect : AccumulateResourceByResourceEffect<Fatigue, FatigueUnit, RedTag, RedTagUnit> { }
public sealed class AccumulateFatigueByGreenTagEffect : AccumulateResourceByResourceEffect<Fatigue, FatigueUnit, GreenTag, GreenTagUnit> { }
}
namespace AccumulateBlueTagByResource
{
public sealed class AccumulateBlueTagByPainTagEffect : AccumulateResourceByResourceEffect<BlueTag, BlueTagUnit, Pain, PainUnit> { }
public sealed class AccumulateBlueTagByFatigueTagEffect : AccumulateResourceByResourceEffect<BlueTag, BlueTagUnit, Fatigue, FatigueUnit> { }
public sealed class AccumulateBlueTagByBlueTagEffect : AccumulateResourceByResourceEffect<BlueTag, BlueTagUnit, BlueTag, BlueTagUnit> { }
public sealed class AccumulateBlueTagByRedTagEffect : AccumulateResourceByResourceEffect<BlueTag, BlueTagUnit, RedTag, RedTagUnit> { }
public sealed class AccumulateBlueTagByGreenTagEffect : AccumulateResourceByResourceEffect<BlueTag, BlueTagUnit, GreenTag, GreenTagUnit> { }
}
namespace AccumulateRedTagByResource
{
public sealed class AccumulateRedTagByPainTagEffect : AccumulateResourceByResourceEffect<RedTag, RedTagUnit, Pain, PainUnit> { }
public sealed class AccumulateRedTagByFatigueEffect : AccumulateResourceByResourceEffect<RedTag, RedTagUnit, Fatigue, FatigueUnit> { }
public sealed class AccumulateRedTagByBlueTagEffect : AccumulateResourceByResourceEffect<RedTag, RedTagUnit, BlueTag, BlueTagUnit> { }
public sealed class AccumulateRedTagByRedTagEffect : AccumulateResourceByResourceEffect<RedTag, RedTagUnit, RedTag, RedTagUnit> { }
public sealed class AccumulateRedTagByGreenTagEffect : AccumulateResourceByResourceEffect<RedTag, RedTagUnit, GreenTag, GreenTagUnit> { }
}
namespace AccumulateGreenTagByResource
{
public sealed class AccumulateGreenTagByPainTagEffect : AccumulateResourceByResourceEffect<GreenTag, GreenTagUnit, Pain, PainUnit> { }
public sealed class AccumulateGreenTagByFatigueEffect : AccumulateResourceByResourceEffect<GreenTag, GreenTagUnit, Fatigue, FatigueUnit> { }
public sealed class AccumulateGreenTagByBlueTagEffect : AccumulateResourceByResourceEffect<GreenTag, GreenTagUnit, BlueTag, BlueTagUnit> { }
public sealed class AccumulateGreenTagByRedTagEffect : AccumulateResourceByResourceEffect<GreenTag, GreenTagUnit, RedTag, RedTagUnit> { }
public sealed class AccumulateGreenTagByGreenTagEffect : AccumulateResourceByResourceEffect<GreenTag, GreenTagUnit, GreenTag, GreenTagUnit> { }
}
}
- rid: 7043444400329588762
type: {class: AccumulatePainByBlueTagEffect, ns: TagFighter.Effects.AccumulatePainByResource,
asm: Assembly-CSharp}
data:
Multiplier: 10