R475KN7MR3OG7EBLVNOO7QRIKXDGY2PIDXXV3HW4KBD5QM7B5OJQC
RJXFDWT7OWTX3DQ7SBJFK6M66AQ2LGGIO32QD6G7VTJJS7U2R7XQC
DTKCWM4J7PFNWAAES3RZHQGDA6PTDNX4TZVOXAKF5V7LCZBI3XUAC
L4TF5YRRHYUPEAF72DU2GO3PBK5CXXHPYZB5SX3NRCUN6AQELH2QC
CG73LGDDWA4UBELKXPUJBNDMGVO3JRE2A6QUNURTJVEEZAJJM6FAC
DGUHVA7XX4HWCIXCARJCI7T6VTXEJUOPUYZOLDOOOWIZYFEJQYFQC
JLT7KOJ5QGXMRLXQXOHDTF62W3EGPX7XTHNEYAKGMJKK3V4QUPGQC
HDXZWK64UDKEV5JBETQK6KMT5RXW5XPDU3YY4HLBCGP5XA6727BQC
YI7M5RWLKUG256YXK6CGZKUPDCNHREU2PGV344L2IV24FF5PHG3AC
FH3NHDU7BEUXKJLPIB2SZWCTI37CEQF6OMTKGP2T7WYE6V73NKVQC
JC4YSSPLLFZVYO7TPBHS6RGGEYAW3I3LF36QK7A3WDDDTM6P3LJAC
MQD6ISMHW27RCHAGJUINEULYXSY3JQ3UKVQPEM5PYDMM32TUYAYQC
FQZF2IY4T2F7KEVSHMFID35WNAU55CRRDF6XEXZB7PYZH26UGYPQC
XRWOXKR3MD3O73SH33CWRUYMTS6KVWGN6U2AIKNVNGHN37MY7UYQC
ROTMK5LNNK7T5YXVOMUODVMCQWIHPZYOME4WDIAMZJ4VXD7SOEBAC
CXWTEVMUJI7NXVWZKXTQOOIVCMPCXUEB3Q3SGIYYHDVRA3JHNBBAC
CD5FF75KTOBTMVMTMCKMR6F5DFKOF26I5K43ITNHGBI3ZAZHA4RAC
HXTSBPAP75A7EC4RKWYQMVPPHPNZFPHUORBZWDHGEB6MPAGI7G7AC
foreach (var effect in Effects.Select(pair => pair.Effect)) {
effect.Effect(context);
foreach (var effect in Effects.Where(effect => effect.Mode != null)) {
effect.Mode.ImmediateAction(context,effect.Effect);
fileFormatVersion: 2
guid: a8efadd05877db24e8435a5ade937797
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using UnityEngine;
{
[Serializable]
public class ReleaseEffect : IEffect
{
}
}
public void Apply(EffectContext context) { }
[SerializeField] AreaOfEffect AreaOfEffect;
public void Effect(EffectContext context) {
context.TriggerEffect(AreaOfEffect);
}
namespace TagFighter.Effects
}
public void Effect(EffectContext context) {
Debug.Log($"{_effectName}: Effect");
Unit<TUnit> newAdded = MultiplicativeBeforeFlat?
context.GetAdded<TResource, TUnit>() / Multiplicative - Flat :
Unit<TUnit> newAdded = MultiplicativeBeforeFlat ?
context.GetAdded<TResource, TUnit>() / Multiplicative - Flat :
fileFormatVersion: 2
guid: 14e87101af452fa4c9bc9e17c684c4d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TagFighter.Effects
{
public interface IDelayedEffect
{
void DelayedAction(EffectContext context);
}
public interface IImmediateEffect
{
void ImmediateAction(EffectContext context, IEffect effect);
}
public interface IEffectMode
{
void Apply(EffectContext context);
void Effect(EffectContext context, IEffect effect);
}
public class DelayedEffect : IImmediateEffect, IDelayedEffect
{
IEffect _effect;
public void DelayedAction(EffectContext context) {
_effect.Apply(context, context.GetAffectedUnits());
context.EffectSystem.ApplyTagsEffect(null, context.EffectLocation, context.AreaOfEffect);
}
public void ImmediateAction(EffectContext context, IEffect effect) {
if (effect != null) {
_effect = effect;
context.EffectsToTrigger.Add(this);
}
}
}
public class ImmediateEffect : IImmediateEffect
{
[SerializeField] AreaOfEffect _areaOfEffect;
public void ImmediateAction(EffectContext context, IEffect effect) {
if (effect != null) {
effect.Apply(context, _areaOfEffect.GetAffectedUnits(context.EffectLocation));
}
context.EffectSystem.ApplyTagsEffect(null, context.EffectLocation, _areaOfEffect);
}
}
public class ReleaseEffect : IImmediateEffect
{
public void ImmediateAction(EffectContext context, IEffect effect) {
if (effect != null) {
effect.Apply(context, context.GetAffectedUnits());
}
context.TriggerEffect();
}
}
}
var targets = AreaOfEffect.GetEffectedUnits(context.EffectLocation).Select(t => t.GetComponent<TaggableUnit>()).Where(t => t != null);
var targets = AreaOfEffect.GetAffectedUnits(context.EffectLocation).Select(t => t.GetComponent<TaggableUnit>()).Where(t => t != null);
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);
var amount = affected
.Select(transform => transform.GetComponent<TResource>())
.Where(resource => resource != null)
.Select(resource => resource.Current)
.Aggregate((Unit<TUnit>)0, (sum, next) => sum += next);
foreach (var resource in context.GetEffectedUnits().Select(target => target.GetComponent<TResource>()).Where(resource => resource != null)) {
foreach (var resource in affected.Select(target => target.GetComponent<TResource>()).Where(resource => resource != null)) {
fileFormatVersion: 2
guid: a8efadd05877db24e8435a5ade937797
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using UnityEngine;
namespace TagFighter.Effects
{
[Serializable]
public class AeoEffect : IEffect
{
[SerializeField] AreaOfEffect _areaOfEffect;
public void Apply(EffectContext context, IEnumerable<Transform> affected) {
// Consider changing AreaOfEffect to Value type
if (context.AreaOfEffect == null) {
context.AreaOfEffect = new();
}
context.AreaOfEffect.length = _areaOfEffect.length;
context.AreaOfEffect.width = _areaOfEffect.width;
context.AreaOfEffect.shape = _areaOfEffect.shape;
}
}
}
- EffectType:
_classRef: TagFighter.Effects.ReleaseEffect, Assembly-CSharp
- _mode:
_classRef: TagFighter.Effects.DelayedEffect, Assembly-CSharp
Mode:
rid: 7043444486337986591
EffectType:
_classRef: TagFighter.Effects.AddResource.AddBlueTagEffect, Assembly-CSharp
Effect:
rid: 7043444486337986570
- _mode:
_classRef:
Mode:
rid: -2
EffectType:
_classRef: TagFighter.Effects.AeoEffect, Assembly-CSharp
- rid: 7043444486337986561
type: {class: ReleaseEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}
- rid: 7043444486337986570
type: {class: AddBlueTagEffect, ns: TagFighter.Effects.AddResource, asm: Assembly-CSharp}
data:
Multiplicative: 1
Flat:
_value: 0
MultiplicativeBeforeFlat: 0
- rid: 7043444486337986578
type: {class: AeoEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}
- rid: 7043444486337986590
type: {class: DelayedEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}
- rid: 7043444486337986591
type: {class: DelayedEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}
- rid: 7043444486337986593
type: {class: DelayedEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}
- EffectType:
_classRef: TagFighter.Effects.CountTagsImmidiateEffect, Assembly-CSharp
- _mode:
_classRef: TagFighter.Effects.ImmediateEffect, Assembly-CSharp
Mode:
rid: 7043444486337986571
EffectType:
_classRef: TagFighter.Effects.CountResource.CountBlueTagEffect, Assembly-CSharp