コード例 #1
0
        public override void ApplyToComponent <T>(T component)
        {
            var comp = component as HasStatusEffectEffectCondition;

            comp.Invert  = false;
            comp.Inverse = this.Invert;

            comp.CheckOwner = this.CheckOwner;
            comp.DiseaseAge = this.DiseaseAge;

            comp.StatusEffect = new StatusEffectSelector()
            {
                Type = this.StatusSelectorType,
            };

            var selector = comp.StatusEffect;

            switch (this.StatusSelectorType)
            {
            case StatusEffectSelector.Types.StatusFamily:
                selector.StatusFamily = new StatusEffectFamilySelector()
                {
                    SelectorValue = this.SelectorValue
                };
                break;

            case StatusEffectSelector.Types.StatusSpecific:
                selector.StatusEffect = ResourcesPrefabManager.Instance.GetStatusEffectPrefab(this.SelectorValue);
                break;

            case StatusEffectSelector.Types.StatusType:
                selector.StatusType = new TagSourceSelector(CustomTags.GetTag(this.SelectorValue));
                break;
            }
        }
コード例 #2
0
        protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            if (AffectedStat == null || AffectedStat.Tag == null || AffectedStat.Tag == Tag.None)
            {
                base.AffectedStat = new TagSourceSelector(CustomTags.GetTag(Stat.ToString()));
            }

            Update(); // refresh mana point value

            base.ActivateLocally(_affectedCharacter, _infos);
        }
コード例 #3
0
        public override void ApplyToComponent <T>(T component)
        {
            var tag = CustomTags.GetTag(ImmunityTag, false);

            if (tag == Tag.None)
            {
                SL.LogWarning($"{this.GetType().Name}: Could not find a tag with the name '{ImmunityTag}'!");
                return;
            }

            At.SetField(component as AddStatusImmunity, "m_statusImmunity", new TagSourceSelector(tag));
        }
コード例 #4
0
        public void CreateTag()
        {
            if (CustomTags.GetTag(this.TagName, false) != Tag.None)
            {
                SL.LogWarning($"Creating Tag '{this.TagName}', but it already exists!");
                return;
            }
            ;

            var tag = CustomTags.CreateTag(TagName);

            if (!string.IsNullOrEmpty(this.OptionalTagUID))
            {
                At.SetField(tag, "m_uid", new UID(this.OptionalTagUID));
            }
        }