Exemplo n.º 1
0
        public static bool CompAbilityEffect_WordOfLove_Prefix2(ref bool __result, CompAbilityEffect_WordOfLove __instance, LocalTargetInfo target, bool throwMessages)
        {
            Pawn pawn = target.Pawn;
            CompIndividuality comp = pawn.TryGetComp <CompIndividuality>();

            if (pawn != null)
            {
                if (comp.sexuality == CompIndividuality.Sexuality.Asexual)
                {
                    if (throwMessages)
                    {
                        Messages.Message("AbilityCantApplyOnAsexual".Translate(pawn), pawn, MessageTypeDefOf.RejectInput, false);
                    }
                    __result = false;
                    return(false);
                }
                if (!AbilityUtility.ValidateNoMentalState(pawn, throwMessages))
                {
                    __result = false;
                    return(false);
                }
            }
            __result = true;
            return(false);
        }
Exemplo n.º 2
0
        private static async ValueTask <IReadOnlyList <Ability> > CreateAbilities(GameServiceClient client, IReadOnlyList <GamePackage> packages)
        {
            ConsoleUtility.WriteLine("Creating abilities");

            var existingAbilities = await AbilityUtility.GetAbilitiesAsync(client, null);

            if (existingAbilities.Any())
            {
                return(existingAbilities);
            }

            var doc = XDocument.Load(@"C:\Users\Ryan\SkyDrive\code\LegendaryGameStarter\LegendaryGameModel2\Abilities\Abilities.xml");

            var request = new CreateAbilitiesRequest();

            request.Abilities.AddRange(doc.Root.Elements("Ability").Select(ability =>
            {
                var gamePackage = packages.First(x => x.Name.Equals(ability.Element("Source").Value, StringComparison.OrdinalIgnoreCase));
                return(new Ability {
                    Name = ability.Element("Name").Value, Description = ability.Element("Description").Value, GamePackage = gamePackage
                });
            }));

            var result = await client.CreateAbilitiesAsync(request);

            ConsoleUtility.WriteLine($"Status: {result.Status.Code}: {result.Status.Message}");

            return(result.Abilities);
        }
    // Use this for initialization
    void Awake()
    {
        ab = FindObjectOfType <AbilityUtility>();



        prewiew.SetActive(true);
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     timer                    = 0.5f;
     myTurn                   = false;
     lm                       = FindObjectOfType <LifeManager>();
     selection                = FindObjectOfType <SelectionController>();
     turn                     = FindObjectOfType <TurnManager>();
     transform.position       = grid.GetWorldPosition(x, y);
     maxRangeHzUtilityPlayer1 = x;
     maxRangeVtUtilityPlayer1 = y;
     turn.isTurn              = true;
     contMp                   = 4;
     att                      = FindObjectOfType <AttackBaseUtility>();
     ab                       = FindObjectOfType <AbilityUtility>();
 }
    void Start()
    {
        timer        = 0f;
        attTankP1    = FindObjectOfType <AttackBase1>();
        attTankP2    = FindObjectOfType <AttackBase2>();
        attHealerP1  = FindObjectOfType <AttackBaseHealer>();
        attHealerP2  = FindObjectOfType <AttackBaseHealer2>();
        attUtilityP1 = FindObjectOfType <AttackBaseUtility>();
        attUtilityP2 = FindObjectOfType <AttackBaseUtility2>();
        attDealerP1  = FindObjectOfType <AttackBaseDealer>();
        attDealerP2  = FindObjectOfType <AttackBaseDealer2>();

        abTankP1    = FindObjectOfType <AbilityTank>();
        abTankP2    = FindObjectOfType <AbilityTank2>();
        abHealerP1  = FindObjectOfType <AbilityHealer>();
        abHealerP2  = FindObjectOfType <AbilityHealer2>();
        abUtilityP1 = FindObjectOfType <AbilityUtility>();
        abUtilityP2 = FindObjectOfType <AbilityUtility2>();
        abDealerP1  = FindObjectOfType <AbilityDealer>();
        abDealerP2  = FindObjectOfType <AbilityDealer2>();

        inputPad     = FindObjectOfType <InputTester>();
        inputChecker = FindObjectOfType <InputChecker>();
    }
Exemplo n.º 6
0
 public override async Task <CreateAbilitiesReply> CreateAbilities(CreateAbilitiesRequest request, ServerCallContext context)
 {
     return(await AbilityUtility.CreateAbilitiesAsync(request, context));
 }