UBKE7KXKA35CBKZLD366TUQXK72GYT7RLPEMMLCR4XC3TLMXD7EQC
R475KN7MR3OG7EBLVNOO7QRIKXDGY2PIDXXV3HW4KBD5QM7B5OJQC
RJXFDWT7OWTX3DQ7SBJFK6M66AQ2LGGIO32QD6G7VTJJS7U2R7XQC
MML56TWYWB6SUY5JEWHG2PNLAH3JY72PGCEXIGOYE54EAC2WSWBAC
MQD6ISMHW27RCHAGJUINEULYXSY3JQ3UKVQPEM5PYDMM32TUYAYQC
L4TF5YRRHYUPEAF72DU2GO3PBK5CXXHPYZB5SX3NRCUN6AQELH2QC
DTKCWM4J7PFNWAAES3RZHQGDA6PTDNX4TZVOXAKF5V7LCZBI3XUAC
JLT7KOJ5QGXMRLXQXOHDTF62W3EGPX7XTHNEYAKGMJKK3V4QUPGQC
JZVIQ3IPEXQ5OWCAKZQW666LXIZLMP5U247YI6Y2EJ7MDNWPGCZQC
FQZF2IY4T2F7KEVSHMFID35WNAU55CRRDF6XEXZB7PYZH26UGYPQC
HDXZWK64UDKEV5JBETQK6KMT5RXW5XPDU3YY4HLBCGP5XA6727BQC
YI7M5RWLKUG256YXK6CGZKUPDCNHREU2PGV344L2IV24FF5PHG3AC
ROTMK5LNNK7T5YXVOMUODVMCQWIHPZYOME4WDIAMZJ4VXD7SOEBAC
CD5FF75KTOBTMVMTMCKMR6F5DFKOF26I5K43ITNHGBI3ZAZHA4RAC
HXTSBPAP75A7EC4RKWYQMVPPHPNZFPHUORBZWDHGEB6MPAGI7G7AC
fileFormatVersion: 2
guid: 7ff27c2a85e3e604b816a56c73b916b6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Linq;
using UnityEngine;
{
public void Apply(EffectContext context, IEnumerable<Transform> affected) { }
}
}
}
context.EffectSystem.ApplyTagsEffect(tags, context.EffectLocation, AreaOfEffect);
public void Effect(EffectContext context) {
Debug.Log("CountTagsImmidiateEffect: Effect");
// TODO: Apply friendOrFoeOff
float amount = 0;
foreach (TaggableUnit taggableUnit in targets) {
amount += taggableUnit.CurrentTags[Color];
}
context.CurrentTags[Color] += amount;
TagCounter tags = new() { };
tags[Color] += amount;
var targets = AreaOfEffect.GetAffectedUnits(context.EffectLocation).Select(t => t.GetComponent<TaggableUnit>()).Where(t => t != null);
[SerializeField] bool FriendOrFoeOff;
public class CountTagsImmidiateEffect : IEffect
{
[SerializeField] TagColor Color;
[SerializeField] AreaOfEffect AreaOfEffect;
namespace TagFighter.Effects
using System.Collections.Generic;
Debug.Log($"{_effectName}: Apply");
Unit<TUnit> newAdded = MultiplicativeBeforeFlat ?
context.GetAdded<TResource, TUnit>() / Multiplicative - Flat :
(context.GetAdded<TResource, TUnit>() - Flat) * Multiplicative;
context.SetAdded<TResource, TUnit>(newAdded);
Debug.Log($"{_effectName} : Apply");
var resource = context.Resource<TResource, TUnit>();
resource.Added = MultiplicativeBeforeFlat?
resource.Added / Multiplicative - Flat :
(resource.Added - Flat) * Multiplicative;
public Unit<TUnit> GetAdded<TResource, TUnit>()
where TResource : Resource<TUnit>
where TUnit : IUnit {
if (!ResourceCounter.TryGetValue(typeof(TResource), out var resourceContext)) {
resourceContext = new ResourceContext<TUnit>();
ResourceCounter.Add(typeof(TResource), resourceContext);
}
return ((ResourceContext<TUnit>)resourceContext).Added;
}
public Unit<TUnit> SetAdded<TResource, TUnit>(Unit<TUnit> value)
where TResource : Resource<TUnit>
where TUnit : IUnit {
if (!ResourceCounter.TryGetValue(typeof(TResource), out var resourceContext)) {
resourceContext = new ResourceContext<TUnit>();
ResourceCounter.Add(typeof(TResource), resourceContext);
}
((ResourceContext<TUnit>)resourceContext).Added = value;
return ((ResourceContext<TUnit>)resourceContext).Added;
}
public Unit<TUnit> GetRemoved<TResource, TUnit>()
where TResource : Resource<TUnit>
where TUnit : IUnit {
if (!ResourceCounter.TryGetValue(typeof(TResource), out var resourceContext)) {
resourceContext = new ResourceContext<TUnit>();
ResourceCounter.Add(typeof(TResource), resourceContext);
}
return ((ResourceContext<TUnit>)resourceContext).Removed;
}
public Unit<TUnit> SetRemoved<TResource, TUnit>(Unit<TUnit> value)
where TResource : Resource<TUnit>
where TUnit : IUnit {
if (!ResourceCounter.TryGetValue(typeof(TResource), out var resourceContext)) {
resourceContext = new ResourceContext<TUnit>();
ResourceCounter.Add(typeof(TResource), resourceContext);
}
((ResourceContext<TUnit>)resourceContext).Removed = value;
return ((ResourceContext<TUnit>)resourceContext).Removed;
}
public EffectContext(TagSystem tagSystem, EffectSystem effectSystem) {
TagSystem = tagSystem;
public EffectContext(EffectSystem effectSystem) {
context.SetCurrent<TResource, TUnit>(context.GetCurrent<TResource, TUnit>() + amount);
Debug.Log($"{_effectName}: {context.GetCurrent<TResource, TUnit>()}");
var resource = context.Resource<TResource, TUnit>();
resource.Current += amount;
Debug.Log($"{_effectName}: {resource.Current}");
Debug.Log($"{_effectName}: Apply");
Unit<TUnit> newAdded = MultiplicativeBeforeFlat?
context.GetAdded<TResource, TUnit>() * Multiplicative + Flat :
(context.GetAdded<TResource, TUnit>() + Flat) * Multiplicative;
context.SetAdded<TResource, TUnit>(newAdded);
Debug.Log($"{_effectName} : Apply");
var resource = context.Resource<TResource, TUnit>();
resource.Added = MultiplicativeBeforeFlat?
resource.Added * Multiplicative + Flat :
(resource.Added + Flat) * Multiplicative;
var unitlessByResource = Multiplier * (int)context.GetCurrent<TResourceBy, TUnitBy>();
Debug.Log($"Accumulating {unitlessByResource} into {typeof(TResourceDest).Name}.Current");
context.SetCurrent<TResourceDest, TUnitDest>((Unit<TUnitDest>)unitlessByResource);
var resourceBy = context.Resource<TResourceBy, TUnitBy>();
var resourceDest = context.Resource<TResourceDest, TUnitDest>();
var unitlessResourceBy = Multiplier * (int)resourceBy.Current;
Debug.Log($"Accumulating {unitlessResourceBy} into {typeof(TResourceDest).Name}.Current");
resourceDest.Current = (Unit<TUnitDest>)unitlessResourceBy;
- rid: 7043444486337986594
type: {class: ReleaseEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}