static BlueprintFeature CreateLifeLink()
        {
            var feat = Helpers.CreateFeature("MysteryLifeLink", "生命连接",
                                             "以一个标准动作,你可以在你与一个生物之间建立生命连结。每轮开始的时候,如果该生物的生命值比最大生命值低5点或以上,该生物恢复5点生命值而你受到5点伤害。 " +
                                             "你可以激活每先知等级1个额外链接。这个链接持续到你或该生物死亡;当你与该生物的距离超过中距,或你用直觉动作切断也能使连结结束。若你同时保有多条连结,你可以用同一个直觉动作将其切断。",
                                             "1c493aa458b94e13b6cd727b492d6cb4",
                                             Helpers.GetIcon("f8bce986adfc88544a42bf4ab7ae75b2"), // remove paralysis
                                             FeatureGroup.None);

            var resource = Helpers.CreateAbilityResource($"{feat.name}Resource", feat.Name, "", "b51cb73f1d9d4381be54efe2ce10f5b5", null);

            resource.SetIncreasedByLevel(0, 1, oracleArray);

            var cureLightWounds = library.Get <BlueprintAbility>("47808d23c67033d4bbab86a1070fd62f");

            var removeBuff = Helpers.Create <ContextActionRemoveBuff>();
            var buff       = Helpers.CreateBuff($"{feat.name}Buff", feat.Name, feat.Description,
                                                "66ec04bf0853419fa5dd742dba10ea30", feat.Icon, null,
                                                (SpellDescriptor.RestoreHP | SpellDescriptor.Cure).CreateSpellDescriptor(),
                                                Helpers.CreateAddFactContextActions(
                                                    deactivated: Helpers.Create <ContextRestoreResource>(c => c.Resource = resource),
                                                    newRound: Helpers.CreateConditional(
                                                        Helpers.Create <ContextConditionDistanceToTarget>(c => c.DistanceGreater = 40.Feet()),
                                                        removeBuff,
                                                        Helpers.CreateConditional(
                                                            Helpers.Create <ContextConditionHasDamage>(),
                                                            new GameAction[] {
                Helpers.Create <ContextActionSpawnFx>(c =>
                                                      c.PrefabLink = cureLightWounds.GetComponent <AbilitySpawnFx>().PrefabLink),
                Helpers.Create <ContextActionTransferDamageToCaster>(c => c.Value = 5)
            }))));

            buff.SetBuffFlags(BuffFlags.RemoveOnRest);
            removeBuff.Buff = buff;

            var linkAbility = Helpers.CreateAbility($"{feat.name}Ability", feat.Name, feat.Description,
                                                    "3d1e78466db341b285fb3d97ce408a0d", feat.Icon,
                                                    AbilityType.Supernatural, CommandType.Standard, AbilityRange.Medium, "", "",
                                                    resource.CreateResourceLogic(),
                                                    Helpers.CreateRunActions(buff.CreateApplyBuff(Helpers.CreateContextDuration(),
                                                                                                  fromSpell: false, dispellable: false, permanent: true)));

            linkAbility.CanTargetFriends = true;
            linkAbility.EffectOnAlly     = AbilityEffectOnUnit.Helpful;

            var dismissAbility = library.CopyAndAdd(linkAbility, $"{feat.name}Dismiss", "9cadee2d79bd436596296704a5637578");

            dismissAbility.SetName($"End {feat.Name}");
            dismissAbility.ActionType = CommandType.Free;
            dismissAbility.SetComponents(
                Helpers.Create <AbilityTargetHasFact>(a => a.CheckedFacts = new BlueprintUnitFact[] { buff }),
                ResourceIsFullChecker.Create(resource, not: true),
                Helpers.CreateRunActions(removeBuff));

            feat.SetComponents(resource.CreateAddAbilityResource(),
                               linkAbility.CreateAddFact(), dismissAbility.CreateAddFact());
            return(lifeLink = feat);
        }
Пример #2
0
        static BlueprintFeature CreateLifeLink()
        {
            var feat = Helpers.CreateFeature("MysteryLifeLink", "Life Link",
                                             "As a standard action, you may create a bond between yourself and another creature. Each round at the start of your turn, if the bonded creature is wounded for 5 or more hit points below its maximum hit points, it heals 5 hit points and you take 5 hit points of damage. " +
                                             "You may have one bond active per oracle level. This bond continues until the bonded creature dies, you die, the distance between you and the other creature exceeds medium range, or you end it as an immediate action (if you have multiple bonds active, you may end as many as you want as part of the same immediate action).",
                                             "1c493aa458b94e13b6cd727b492d6cb4",
                                             Helpers.GetIcon("f8bce986adfc88544a42bf4ab7ae75b2"), // remove paralysis
                                             FeatureGroup.None);

            var resource = Helpers.CreateAbilityResource($"{feat.name}Resource", feat.Name, "", "b51cb73f1d9d4381be54efe2ce10f5b5", null);

            resource.SetIncreasedByLevel(0, 1, oracleArray);

            var cureLightWounds = library.Get <BlueprintAbility>("47808d23c67033d4bbab86a1070fd62f");

            var removeBuff = Helpers.Create <ContextActionRemoveBuff>();
            var buff       = Helpers.CreateBuff($"{feat.name}Buff", feat.Name, feat.Description,
                                                "66ec04bf0853419fa5dd742dba10ea30", feat.Icon, null,
                                                (SpellDescriptor.RestoreHP | SpellDescriptor.Cure).CreateSpellDescriptor(),
                                                Helpers.CreateAddFactContextActions(
                                                    deactivated: Helpers.Create <ContextRestoreResource>(c => c.Resource = resource),
                                                    newRound: Helpers.CreateConditional(
                                                        Helpers.Create <ContextConditionDistanceToTarget>(c => c.DistanceGreater = 40.Feet()),
                                                        removeBuff,
                                                        Helpers.CreateConditional(
                                                            Helpers.Create <ContextConditionHasDamage>(),
                                                            new GameAction[] {
                Helpers.Create <ContextActionSpawnFx>(c =>
                                                      c.PrefabLink = cureLightWounds.GetComponent <AbilitySpawnFx>().PrefabLink),
                Helpers.Create <ContextActionTransferDamageToCaster>(c => c.Value = 5)
            }))));

            buff.SetBuffFlags(BuffFlags.RemoveOnRest);
            removeBuff.Buff = buff;

            var linkAbility = Helpers.CreateAbility($"{feat.name}Ability", feat.Name, feat.Description,
                                                    "3d1e78466db341b285fb3d97ce408a0d", feat.Icon,
                                                    AbilityType.Supernatural, CommandType.Standard, AbilityRange.Medium, "", "",
                                                    resource.CreateResourceLogic(),
                                                    Helpers.CreateRunActions(buff.CreateApplyBuff(Helpers.CreateContextDuration(),
                                                                                                  fromSpell: false, dispellable: false, permanent: true)));

            linkAbility.CanTargetFriends = true;
            linkAbility.EffectOnAlly     = AbilityEffectOnUnit.Helpful;

            var dismissAbility = library.CopyAndAdd(linkAbility, $"{feat.name}Dismiss", "9cadee2d79bd436596296704a5637578");

            dismissAbility.SetName($"End {feat.Name}");
            dismissAbility.ActionType = CommandType.Free;
            dismissAbility.SetComponents(
                Helpers.Create <AbilityTargetHasFact>(a => a.CheckedFacts = new BlueprintUnitFact[] { buff }),
                ResourceIsFullChecker.Create(resource, not: true),
                Helpers.CreateRunActions(removeBuff));

            feat.SetComponents(resource.CreateAddAbilityResource(),
                               linkAbility.CreateAddFact(), dismissAbility.CreateAddFact());
            return(lifeLink = feat);
        }