Exemplo n.º 1
0
        public static void BuildMegaMushrums()
        {
            megaMushrum       = Resources.Load <GameObject>("prefabs/characterbodies/MiniMushroomBody").InstantiateClone("MegaMushrumBody", true);
            megaMushrumMaster = Resources.Load <GameObject>("prefabs/charactermasters/MiniMushroomMaster").InstantiateClone("MegaMushrumMaster", true);
            projectile        = Resources.Load <GameObject>("prefabs/projectiles/SporeGrenadeProjectile").InstantiateClone("MegaSporeGrenadeProjectile", false);
            dotZone           = Resources.Load <GameObject>("prefabs/projectiles/SporeGrenadeProjectileDotZone").InstantiateClone("MegaSporeGrenadeProjectileDotZone", false);

            skillLocator = megaMushrum.GetComponent <SkillLocator>();

            BaseHelpers.RegisterNewBody(megaMushrum);
            BaseHelpers.RegisterNewMaster(megaMushrumMaster);
            BaseHelpers.RegisterNewProjectile(megaMushrum);
            BaseHelpers.RegisterNewProjectile(dotZone);

            megaMushrumMaster.GetComponent <CharacterMaster>().bodyPrefab = megaMushrum;

            BuildBody();
            BuildDirectorCard();
            SetupMegaMushrumSize();
            RebuildSkillDrivers();
            RebuildSkills();
            Createprojectile();

            Main.logger.LogInfo("Built Mega Mushrums!");
        }
Exemplo n.º 2
0
 private static void RebuildSkills()
 {
     BaseHelpers.DestroyGenericSkillComponents(clayMan);
     CreateSkillFamilies();
     CreatePrimary();
     CreateSecondary();
 }
 protected virtual void SetFilterParams(GeneralFilterParamsEx param)
 {
     param.ViewMode            = BaseHelpers.GetViewMode();
     param.ImageViewMode       = BaseHelpers.GetImageViewMode();
     param.PageSize            = Consts.PageSize;
     ViewData["filterParamEx"] = param;
 }
        public async Task <string> Handle(CreatePostWithFileCommand request, CancellationToken cancellationToken)
        {
            Domain.Entities.Post post =
                await _postService.CreatePostWithFileAsync(request.UserId, request.CreatePostWithFileDto);

            if (!PostHelpers.IsContentFile(request.CreatePostWithFileDto.Content))
            {
                throw new HttpStatusCodeException(HttpStatusCode.BadRequest, "Post creation failed");
            }

            FileData data = BaseHelpers.GetContentFileData <Domain.Entities.Post>(
                request.CreatePostWithFileDto.Content, post.Id
                );

            if (post.ContentType.Equals(data.FileName.GetContentType()))
            {
                await _blobService.UploadImageBlobAsync(data.Content, data.FileName);

                request.CreatePostWithFileDto.Content     = data.FileName;
                request.CreatePostWithFileDto.ContentType = data.FileName.GetContentType();

                await _postService.UpdatePostAsync(post, new UpdatePostDto
                {
                    Content = request.CreatePostWithFileDto.Content,
                    Title   = post.Title,
                });
            }
            else
            {
                throw new HttpStatusCodeException(HttpStatusCode.BadRequest,
                                                  "Can not update content type of a post");
            }

            return(post.Id);
        }
Exemplo n.º 5
0
 protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
 {
     if (!optionsBuilder.IsConfigured)
     {
         optionsBuilder.UseSqlServer(BaseHelpers.GetService <IConfiguration>().GetValue <string>("ConnectionStrings:BookStore"));
     }
 }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            var logServerSettings = BaseHelpers.GetConfigurationRoot(args).GetSection("ElasticSearchSettings").Get <ElasticSearchSettings>();

            Log.Logger = new LoggerHelpers(logServerSettings).Register(typeof(Startup).Assembly.GetName().Name, LogEventLevel.Warning);

            CreateHostBuilder(args).Build().Run();
        }
Exemplo n.º 7
0
 public void EndTransition()
 {
     if (IsTransitioning)
     {
         BaseHelpers.StopCoroutine(transitioning);
     }
     transitioning = null;
 }
Exemplo n.º 8
0
 private static void RebuildSkills()
 {
     BaseHelpers.DestroyGenericSkillComponents(megaMushrum);
     CreateSkillFamilies();
     CreatePrimary();
     CreateSecondary();
     CreateUtility();
     CreateSpecial();
 }
Exemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            //https://www.humankode.com/asp-net-core/logging-with-elasticsearch-kibana-asp-net-core-and-docker
            var logServerSettings = BaseHelpers.GetConfigurationRoot(args).GetSection("ElasticSearchSettings").Get <ElasticSearchSettings>();

            Log.Logger = new LoggerHelpers(logServerSettings).Register(typeof(Startup).Assembly.GetName().Name, LogEventLevel.Warning);

            CreateHostBuilder(args).Build().Run();
        }
Exemplo n.º 10
0
 public void StartTransition(Sprite sprite, float speed, bool smooth)
 {
     if (IsCurrent(sprite))
     {
         return;
     }
     EndTransition();
     transitioning = BaseHelpers.StartCoroutine(TransitioningSprite(sprite, speed, smooth));
 }
Exemplo n.º 11
0
 public void StopMoving(bool arriveTargetPositionImmediately = false)
 {
     if (IsMoving)
     {
         BaseHelpers.StopCoroutine(moving);
         if (arriveTargetPositionImmediately)
         {
             SetPosition(targetPosition);
         }
     }
     moving = null;
 }
Exemplo n.º 12
0
        public async Task <CommunityViewModel> Handle(UpdateCommunityImageCommand request,
                                                      CancellationToken cancellationToken)
        {
            FileData data = BaseHelpers.GetContentFileData <Domain.Entities.Community>(
                request.UpdateCommunityImageDto.Image, request.Community.Id
                );
            await _blobService.UploadImageBlobAsync(data.Content, data.FileName);

            request.UpdateCommunityImageDto.Image = data.FileName;

            return(await _communityService.UpdateCommunityImageAsync(request.Community,
                                                                     request.UpdateCommunityImageDto));
        }
Exemplo n.º 13
0
        public async Task <UserResponse> Handle(UpdateUserImageCommand request, CancellationToken cancellationToken)
        {
            FileData data =
                BaseHelpers.GetContentFileData <Domain.Entities.User>(request.UpdateUserImageDto.Image, request.UserId);
            await _blobService.UploadImageBlobAsync(data.Content, data.FileName);

            request.UpdateUserImageDto.Image = data.FileName;

            UserViewModel user = await _userService.UpdateUserImageAsync(request.UserId, request.UpdateUserImageDto);

            return(new UserResponse {
                User = user
            });
        }
Exemplo n.º 14
0
        public async Task <IActionResult> GetMany([FromQuery] CommentSearchParams searchParams)
        {
            if (!BaseHelpers.IsPaginatonSearchParamsValid(searchParams, out ErrorResponse errorResponse))
            {
                return(new BadRequestObjectResult(errorResponse));
            }

            FilteredDataViewModel <CommentViewModel> result = await _mediator.Send(new GetCommentsQuery(searchParams));

            return(Ok(new FilteredResponse <CommentViewModel>(searchParams)
            {
                Data = result.Data,
                Count = result.Count,
            }));
        }
Exemplo n.º 15
0
        public async Task <IActionResult> NewsFeed([FromQuery] PostSearchParams searchParams)
        {
            if (!BaseHelpers.IsPaginatonSearchParamsValid(searchParams, out ErrorResponse errorResponse))
            {
                return(new BadRequestObjectResult(errorResponse));
            }

            string userId = _httpContext.User.FindFirstValue("sub");

            FilteredDataViewModel <PostViewModel> result =
                await _mediator.Send(new GetNewsFeedQuery(userId, searchParams));

            return(Ok(new FilteredResponse <PostViewModel>(searchParams)
            {
                Data = result.Data,
                Count = result.Count,
            }));
        }
Exemplo n.º 16
0
        public async Task <PostViewModel> Handle(UpdatePostCommand request,
                                                 CancellationToken cancellationToken)
        {
            if (PostHelpers.IsContentFile(request.UpdatePostDto.Content) &&
                !request.Post.ContentType.Equals("application/text"))
            {
                FileData data = BaseHelpers.GetContentFileData <Domain.Entities.Post>(
                    request.UpdatePostDto.Content, request.Post.Id
                    );
                request.UpdatePostDto.Content = data.FileName;
                if (request.Post.ContentType.Equals(request.UpdatePostDto.Content.GetContentType()))
                {
                    await _blobService.UploadImageBlobAsync(data.Content, data.FileName);
                }
            }

            return(await _postService.UpdatePostAsync(request.Post, request.UpdatePostDto));
        }
Exemplo n.º 17
0
 public Coroutine StartCoroutine(IEnumerator coroutineFunction)
 {
     return(BaseHelpers.StartCoroutine(coroutineFunction));
 }
Exemplo n.º 18
0
 public void StopCoroutine(Coroutine coroutine)
 {
     BaseHelpers.StopCoroutine(coroutine);
 }
Exemplo n.º 19
0
        private static void RebuildSkillDrivers()
        {
            BaseHelpers.DestroySkillDrivers(clayManMaster);

            AISkillDriver Swing = clayManMaster.AddComponent <AISkillDriver>();
            AISkillDriver Chase = clayManMaster.AddComponent <AISkillDriver>();
            AISkillDriver Leap  = clayManMaster.AddComponent <AISkillDriver>();
            AISkillDriver anotherSkillDriver    = clayManMaster.AddComponent <AISkillDriver>();
            AISkillDriver andAnotherSkillDriver = clayManMaster.AddComponent <AISkillDriver>();

            Swing.skillSlot                         = SkillSlot.Primary;
            Swing.requireSkillReady                 = false;
            Swing.requireEquipmentReady             = false;
            Swing.moveTargetType                    = TargetType.CurrentEnemy;
            Swing.minUserHealthFraction             = float.NegativeInfinity;
            Swing.maxUserHealthFraction             = float.PositiveInfinity;
            Swing.minTargetHealthFraction           = float.NegativeInfinity;
            Swing.maxTargetHealthFraction           = float.PositiveInfinity;
            Swing.minDistance                       = 0;
            Swing.maxDistance                       = 2;
            Swing.selectionRequiresTargetLoS        = false;
            Swing.activationRequiresTargetLoS       = false;
            Swing.activationRequiresAimConfirmation = false;
            Swing.movementType                      = MovementType.ChaseMoveTarget;
            Swing.moveInputScale                    = 1;
            Swing.aimType                   = AimType.AtMoveTarget;
            Swing.ignoreNodeGraph           = true;
            Swing.driverUpdateTimerOverride = -1;
            Swing.resetCurrentEnemyOnNextDriverSelection = false;
            Swing.noRepeat            = false;
            Swing.shouldSprint        = false;
            Swing.shouldFireEquipment = false;
            Swing.shouldTapButton     = false;

            Leap.skillSlot                         = SkillSlot.Secondary;
            Leap.requireSkillReady                 = false;
            Leap.requireEquipmentReady             = false;
            Leap.moveTargetType                    = TargetType.CurrentEnemy;
            Leap.minUserHealthFraction             = float.NegativeInfinity;
            Leap.maxUserHealthFraction             = float.PositiveInfinity;
            Leap.minTargetHealthFraction           = float.NegativeInfinity;
            Leap.maxTargetHealthFraction           = float.PositiveInfinity;
            Leap.minDistance                       = 0;
            Leap.maxDistance                       = 30;
            Leap.selectionRequiresTargetLoS        = false;
            Leap.activationRequiresTargetLoS       = false;
            Leap.activationRequiresAimConfirmation = false;
            Leap.movementType                      = MovementType.ChaseMoveTarget;
            Leap.moveInputScale                    = 1;
            Leap.aimType                   = AimType.AtMoveTarget;
            Leap.ignoreNodeGraph           = true;
            Leap.driverUpdateTimerOverride = -1;
            Leap.resetCurrentEnemyOnNextDriverSelection = false;
            Leap.noRepeat            = false;
            Leap.shouldSprint        = false;
            Leap.shouldFireEquipment = false;
            Leap.shouldTapButton     = false;

            Chase.skillSlot                         = SkillSlot.None;
            Chase.requireSkillReady                 = false;
            Chase.requireEquipmentReady             = false;
            Chase.moveTargetType                    = TargetType.CurrentEnemy;
            Chase.minUserHealthFraction             = float.NegativeInfinity;
            Chase.maxUserHealthFraction             = float.PositiveInfinity;
            Chase.minTargetHealthFraction           = float.NegativeInfinity;
            Chase.maxTargetHealthFraction           = float.PositiveInfinity;
            Chase.minDistance                       = 10;
            Chase.maxDistance                       = 10;
            Chase.selectionRequiresTargetLoS        = true;
            Chase.activationRequiresTargetLoS       = false;
            Chase.activationRequiresAimConfirmation = false;
            Chase.movementType                      = MovementType.ChaseMoveTarget;
            Chase.moveInputScale                    = 1;
            Chase.aimType                   = AimType.AtMoveTarget;
            Chase.ignoreNodeGraph           = true;
            Chase.driverUpdateTimerOverride = -1;
            Chase.resetCurrentEnemyOnNextDriverSelection = false;
            Chase.noRepeat            = false;
            Chase.shouldSprint        = false;
            Chase.shouldFireEquipment = false;
            Chase.shouldTapButton     = false;

            anotherSkillDriver.customName                        = "FollowNodeGraphToTarget";
            anotherSkillDriver.skillSlot                         = SkillSlot.None;
            anotherSkillDriver.requireSkillReady                 = false;
            anotherSkillDriver.requireEquipmentReady             = false;
            anotherSkillDriver.moveTargetType                    = TargetType.CurrentEnemy;
            anotherSkillDriver.minUserHealthFraction             = float.NegativeInfinity;
            anotherSkillDriver.maxUserHealthFraction             = float.PositiveInfinity;
            anotherSkillDriver.minTargetHealthFraction           = float.NegativeInfinity;
            anotherSkillDriver.maxTargetHealthFraction           = float.PositiveInfinity;
            anotherSkillDriver.minDistance                       = 0;
            anotherSkillDriver.maxDistance                       = float.PositiveInfinity;
            anotherSkillDriver.selectionRequiresTargetLoS        = false;
            anotherSkillDriver.activationRequiresTargetLoS       = false;
            anotherSkillDriver.activationRequiresAimConfirmation = false;
            anotherSkillDriver.movementType                      = MovementType.ChaseMoveTarget;
            anotherSkillDriver.moveInputScale                    = 1;
            anotherSkillDriver.aimType                   = AimType.MoveDirection;
            anotherSkillDriver.ignoreNodeGraph           = false;
            anotherSkillDriver.driverUpdateTimerOverride = -1;
            anotherSkillDriver.resetCurrentEnemyOnNextDriverSelection = false;
            anotherSkillDriver.noRepeat            = false;
            anotherSkillDriver.shouldSprint        = false;
            anotherSkillDriver.shouldFireEquipment = false;
            anotherSkillDriver.shouldTapButton     = false;

            andAnotherSkillDriver.customName                        = "ChaseOffNodegraph";
            andAnotherSkillDriver.skillSlot                         = SkillSlot.None;
            andAnotherSkillDriver.requireSkillReady                 = false;
            andAnotherSkillDriver.requireEquipmentReady             = false;
            andAnotherSkillDriver.moveTargetType                    = TargetType.CurrentEnemy;
            andAnotherSkillDriver.minUserHealthFraction             = float.NegativeInfinity;
            andAnotherSkillDriver.maxUserHealthFraction             = float.PositiveInfinity;
            andAnotherSkillDriver.minTargetHealthFraction           = float.NegativeInfinity;
            andAnotherSkillDriver.maxTargetHealthFraction           = float.PositiveInfinity;
            andAnotherSkillDriver.minDistance                       = 0;
            andAnotherSkillDriver.maxDistance                       = 10;
            andAnotherSkillDriver.selectionRequiresTargetLoS        = true;
            andAnotherSkillDriver.activationRequiresTargetLoS       = false;
            andAnotherSkillDriver.activationRequiresAimConfirmation = false;
            andAnotherSkillDriver.movementType                      = MovementType.ChaseMoveTarget;
            andAnotherSkillDriver.moveInputScale                    = 1;
            andAnotherSkillDriver.aimType                   = AimType.AtMoveTarget;
            andAnotherSkillDriver.ignoreNodeGraph           = true;
            andAnotherSkillDriver.driverUpdateTimerOverride = -1;
            andAnotherSkillDriver.resetCurrentEnemyOnNextDriverSelection = false;
            andAnotherSkillDriver.noRepeat            = false;
            andAnotherSkillDriver.shouldSprint        = false;
            andAnotherSkillDriver.shouldFireEquipment = false;
            andAnotherSkillDriver.shouldTapButton     = false;
        }
Exemplo n.º 20
0
        private static void RebuildSkillDrivers()
        {
            BaseHelpers.DestroySkillDrivers(grandParentMaster);

            AISkillDriver GroundSwipe = grandParentMaster.AddComponent <AISkillDriver>();
            AISkillDriver SpiritPull  = grandParentMaster.AddComponent <AISkillDriver>();
            AISkillDriver Offspring   = grandParentMaster.AddComponent <AISkillDriver>();
            AISkillDriver PortalJump  = grandParentMaster.AddComponent <AISkillDriver>();
            AISkillDriver Path        = grandParentMaster.AddComponent <AISkillDriver>();

            GroundSwipe.customName = "Ground Swipe";
            GroundSwipe.skillSlot  = SkillSlot.Primary;
            //GroundSwipe.requiredSkill =
            GroundSwipe.requireSkillReady                 = true;
            GroundSwipe.requireEquipmentReady             = false;
            GroundSwipe.moveTargetType                    = TargetType.CurrentEnemy;
            GroundSwipe.minUserHealthFraction             = float.NegativeInfinity;
            GroundSwipe.maxUserHealthFraction             = float.PositiveInfinity;
            GroundSwipe.minTargetHealthFraction           = float.NegativeInfinity;
            GroundSwipe.maxTargetHealthFraction           = float.PositiveInfinity;
            GroundSwipe.minDistance                       = 0;
            GroundSwipe.maxDistance                       = 15;
            GroundSwipe.selectionRequiresTargetLoS        = false;
            GroundSwipe.activationRequiresTargetLoS       = true;
            GroundSwipe.activationRequiresAimConfirmation = true;
            GroundSwipe.movementType                      = MovementType.ChaseMoveTarget;
            GroundSwipe.moveInputScale                    = 1;
            GroundSwipe.aimType                   = AimType.AtMoveTarget;
            GroundSwipe.ignoreNodeGraph           = true;
            GroundSwipe.driverUpdateTimerOverride = -1;
            GroundSwipe.resetCurrentEnemyOnNextDriverSelection = false;
            GroundSwipe.noRepeat            = false;
            GroundSwipe.shouldSprint        = false;
            GroundSwipe.shouldFireEquipment = false;
            GroundSwipe.shouldTapButton     = false;


            SpiritPull.customName = "Spirit Pull";
            SpiritPull.skillSlot  = SkillSlot.Secondary;
            //SpiritPull.requiredSkill =
            SpiritPull.requireSkillReady                 = true;
            SpiritPull.requireEquipmentReady             = false;
            SpiritPull.moveTargetType                    = TargetType.CurrentEnemy;
            SpiritPull.minUserHealthFraction             = float.NegativeInfinity;
            SpiritPull.maxUserHealthFraction             = float.PositiveInfinity;
            SpiritPull.minTargetHealthFraction           = float.NegativeInfinity;
            SpiritPull.maxTargetHealthFraction           = float.PositiveInfinity;
            SpiritPull.minDistance                       = 15;
            SpiritPull.maxDistance                       = 200;
            SpiritPull.selectionRequiresTargetLoS        = false;
            SpiritPull.activationRequiresTargetLoS       = false;
            SpiritPull.activationRequiresAimConfirmation = false;
            SpiritPull.movementType                      = MovementType.ChaseMoveTarget;
            SpiritPull.moveInputScale                    = 1;
            SpiritPull.aimType                   = AimType.AtMoveTarget;
            SpiritPull.ignoreNodeGraph           = true;
            SpiritPull.driverUpdateTimerOverride = -1;
            SpiritPull.resetCurrentEnemyOnNextDriverSelection = false;
            SpiritPull.noRepeat            = false;
            SpiritPull.shouldSprint        = false;
            SpiritPull.shouldFireEquipment = false;
            SpiritPull.shouldTapButton     = false;

            Offspring.customName = "Off Spring";
            Offspring.skillSlot  = SkillSlot.Utility;
            //Offspring.requiredSkill =
            Offspring.requireSkillReady                 = true;
            Offspring.requireEquipmentReady             = false;
            Offspring.moveTargetType                    = TargetType.CurrentEnemy;
            Offspring.minUserHealthFraction             = float.NegativeInfinity;
            Offspring.maxUserHealthFraction             = float.PositiveInfinity;
            Offspring.minTargetHealthFraction           = float.NegativeInfinity;
            Offspring.maxTargetHealthFraction           = float.PositiveInfinity;
            Offspring.minDistance                       = 15;
            Offspring.maxDistance                       = float.PositiveInfinity;
            Offspring.selectionRequiresTargetLoS        = false;
            Offspring.activationRequiresTargetLoS       = false;
            Offspring.activationRequiresAimConfirmation = false;
            Offspring.movementType                      = MovementType.ChaseMoveTarget;
            Offspring.moveInputScale                    = 1;
            Offspring.aimType                   = AimType.AtMoveTarget;
            Offspring.ignoreNodeGraph           = true;
            Offspring.driverUpdateTimerOverride = -1;
            Offspring.resetCurrentEnemyOnNextDriverSelection = false;
            Offspring.noRepeat            = false;
            Offspring.shouldSprint        = false;
            Offspring.shouldFireEquipment = false;
            Offspring.shouldTapButton     = false;


            PortalJump.customName = "Portal Jump";
            PortalJump.skillSlot  = SkillSlot.Special;
            //PortalJump. requiredSkill =
            PortalJump.requireSkillReady                 = true;
            PortalJump.requireEquipmentReady             = false;
            PortalJump.moveTargetType                    = TargetType.CurrentEnemy;
            PortalJump.minUserHealthFraction             = float.NegativeInfinity;
            PortalJump.maxUserHealthFraction             = float.PositiveInfinity;
            PortalJump.minTargetHealthFraction           = float.NegativeInfinity;
            PortalJump.maxTargetHealthFraction           = float.PositiveInfinity;
            PortalJump.minDistance                       = 50;
            PortalJump.maxDistance                       = float.PositiveInfinity;
            PortalJump.selectionRequiresTargetLoS        = false;
            PortalJump.activationRequiresTargetLoS       = false;
            PortalJump.activationRequiresAimConfirmation = false;
            PortalJump.movementType                      = MovementType.ChaseMoveTarget;
            PortalJump.moveInputScale                    = 1;
            PortalJump.aimType                   = AimType.AtMoveTarget;
            PortalJump.ignoreNodeGraph           = true;
            PortalJump.driverUpdateTimerOverride = -1;
            PortalJump.resetCurrentEnemyOnNextDriverSelection = false;
            PortalJump.noRepeat            = false;
            PortalJump.shouldSprint        = false;
            PortalJump.shouldFireEquipment = false;
            PortalJump.shouldTapButton     = false;


            Path.customName = "Path";
            Path.skillSlot  = SkillSlot.None;
            //Path.requiredSkill =
            Path.requireSkillReady                 = false;
            Path.requireEquipmentReady             = false;
            Path.moveTargetType                    = TargetType.CurrentEnemy;
            Path.minUserHealthFraction             = float.NegativeInfinity;
            Path.maxUserHealthFraction             = float.PositiveInfinity;
            Path.minTargetHealthFraction           = float.NegativeInfinity;
            Path.maxTargetHealthFraction           = float.PositiveInfinity;
            Path.minDistance                       = 0;
            Path.maxDistance                       = float.PositiveInfinity;
            Path.selectionRequiresTargetLoS        = false;
            Path.activationRequiresTargetLoS       = false;
            Path.activationRequiresAimConfirmation = false;
            Path.movementType                      = MovementType.ChaseMoveTarget;
            Path.moveInputScale                    = 1;
            Path.aimType                   = AimType.AtMoveTarget;
            Path.ignoreNodeGraph           = true;
            Path.driverUpdateTimerOverride = -1;
            Path.resetCurrentEnemyOnNextDriverSelection = false;
            Path.noRepeat            = false;
            Path.shouldSprint        = false;
            Path.shouldFireEquipment = false;
            Path.shouldTapButton     = false;
        }
Exemplo n.º 21
0
        private static void RebuildSkillDrivers()
        {
            BaseHelpers.DestroySkillDrivers(megaMushrumMaster);

            AISkillDriver SporeGrenade = megaMushrumMaster.AddComponent <AISkillDriver>();
            AISkillDriver SuicideBomb  = megaMushrumMaster.AddComponent <AISkillDriver>();
            AISkillDriver Harvest      = megaMushrumMaster.AddComponent <AISkillDriver>();
            AISkillDriver Flee         = megaMushrumMaster.AddComponent <AISkillDriver>();
            AISkillDriver Path         = megaMushrumMaster.AddComponent <AISkillDriver>();
            AISkillDriver StrafePath   = megaMushrumMaster.AddComponent <AISkillDriver>();

            SporeGrenade.customName                        = "Spore Grenade";
            SporeGrenade.skillSlot                         = SkillSlot.Primary;
            SporeGrenade.requireSkillReady                 = true;
            SporeGrenade.requireEquipmentReady             = false;
            SporeGrenade.moveTargetType                    = TargetType.CurrentEnemy;
            SporeGrenade.minUserHealthFraction             = 0.5f;
            SporeGrenade.maxUserHealthFraction             = float.PositiveInfinity;
            SporeGrenade.minTargetHealthFraction           = float.NegativeInfinity;
            SporeGrenade.maxTargetHealthFraction           = float.PositiveInfinity;
            SporeGrenade.minDistance                       = 0;
            SporeGrenade.maxDistance                       = 60;
            SporeGrenade.selectionRequiresTargetLoS        = false;
            SporeGrenade.activationRequiresTargetLoS       = true;
            SporeGrenade.activationRequiresAimConfirmation = true;
            SporeGrenade.movementType                      = MovementType.StrafeMovetarget;
            SporeGrenade.moveInputScale                    = 1;
            SporeGrenade.aimType                   = AimType.AtMoveTarget;
            SporeGrenade.ignoreNodeGraph           = false;
            SporeGrenade.driverUpdateTimerOverride = -1;
            SporeGrenade.resetCurrentEnemyOnNextDriverSelection = false;
            SporeGrenade.noRepeat            = false;
            SporeGrenade.shouldSprint        = false;
            SporeGrenade.shouldFireEquipment = false;
            SporeGrenade.shouldTapButton     = false;

            SuicideBomb.customName = "Suicide Bomb";
            SuicideBomb.skillSlot  = SkillSlot.Secondary;
            //SpiritPull.requiredSkill =
            SuicideBomb.requireSkillReady                 = true;
            SuicideBomb.requireEquipmentReady             = false;
            SuicideBomb.moveTargetType                    = TargetType.CurrentEnemy;
            SuicideBomb.minUserHealthFraction             = float.NegativeInfinity;
            SuicideBomb.maxUserHealthFraction             = float.PositiveInfinity;
            SuicideBomb.minTargetHealthFraction           = float.NegativeInfinity;
            SuicideBomb.maxTargetHealthFraction           = float.PositiveInfinity;
            SuicideBomb.minDistance                       = 0;
            SuicideBomb.maxDistance                       = 10;
            SuicideBomb.selectionRequiresTargetLoS        = false;
            SuicideBomb.activationRequiresTargetLoS       = false;
            SuicideBomb.activationRequiresAimConfirmation = false;
            SuicideBomb.movementType                      = MovementType.ChaseMoveTarget;
            SuicideBomb.moveInputScale                    = 1;
            SuicideBomb.aimType                   = AimType.AtMoveTarget;
            SuicideBomb.ignoreNodeGraph           = true;
            SuicideBomb.driverUpdateTimerOverride = -1;
            SuicideBomb.resetCurrentEnemyOnNextDriverSelection = false;
            SuicideBomb.noRepeat            = false;
            SuicideBomb.shouldSprint        = false;
            SuicideBomb.shouldFireEquipment = false;
            SuicideBomb.shouldTapButton     = false;

            Harvest.customName = "Harvest";
            Harvest.skillSlot  = SkillSlot.Utility;
            //Offspring.requiredSkill =
            Harvest.requireSkillReady                 = true;
            Harvest.requireEquipmentReady             = false;
            Harvest.moveTargetType                    = TargetType.CurrentEnemy;
            Harvest.minUserHealthFraction             = float.NegativeInfinity;
            Harvest.maxUserHealthFraction             = 0.5f;
            Harvest.minTargetHealthFraction           = float.NegativeInfinity;
            Harvest.maxTargetHealthFraction           = float.PositiveInfinity;
            Harvest.minDistance                       = 0;
            Harvest.maxDistance                       = float.PositiveInfinity;
            Harvest.selectionRequiresTargetLoS        = false;
            Harvest.activationRequiresTargetLoS       = false;
            Harvest.activationRequiresAimConfirmation = false;
            Harvest.movementType                      = MovementType.Stop;
            Harvest.moveInputScale                    = 1;
            Harvest.aimType                   = AimType.None;
            Harvest.ignoreNodeGraph           = false;
            Harvest.driverUpdateTimerOverride = 4;
            Harvest.resetCurrentEnemyOnNextDriverSelection = false;
            Harvest.noRepeat            = false;
            Harvest.shouldSprint        = false;
            Harvest.shouldFireEquipment = false;
            Harvest.shouldTapButton     = false;

            Flee.customName = "Flee";
            Flee.skillSlot  = SkillSlot.None;
            //Flee.requiredSkill =
            Flee.requireSkillReady                 = false;
            Flee.requireEquipmentReady             = false;
            Flee.moveTargetType                    = TargetType.CurrentEnemy;
            Flee.minUserHealthFraction             = float.NegativeInfinity;
            Flee.maxUserHealthFraction             = 0.5f;
            Flee.minTargetHealthFraction           = float.NegativeInfinity;
            Flee.maxTargetHealthFraction           = float.PositiveInfinity;
            Flee.minDistance                       = 0;
            Flee.maxDistance                       = 60;
            Flee.selectionRequiresTargetLoS        = false;
            Flee.activationRequiresTargetLoS       = false;
            Flee.activationRequiresAimConfirmation = false;
            Flee.movementType                      = MovementType.FleeMoveTarget;
            Flee.moveInputScale                    = 1;
            Flee.aimType                   = AimType.AtMoveTarget;
            Flee.ignoreNodeGraph           = false;
            Flee.driverUpdateTimerOverride = 3;
            Flee.resetCurrentEnemyOnNextDriverSelection = false;
            Flee.noRepeat            = false;
            Flee.shouldSprint        = true;
            Flee.shouldFireEquipment = false;
            Flee.shouldTapButton     = false;

            Path.customName = "Path";
            Path.skillSlot  = SkillSlot.None;
            //Path.requiredSkill =
            Path.requireSkillReady                 = false;
            Path.requireEquipmentReady             = false;
            Path.moveTargetType                    = TargetType.CurrentEnemy;
            Path.minUserHealthFraction             = float.NegativeInfinity;
            Path.maxUserHealthFraction             = float.PositiveInfinity;
            Path.minTargetHealthFraction           = float.NegativeInfinity;
            Path.maxTargetHealthFraction           = float.PositiveInfinity;
            Path.minDistance                       = 0;
            Path.maxDistance                       = float.PositiveInfinity;
            Path.selectionRequiresTargetLoS        = false;
            Path.activationRequiresTargetLoS       = false;
            Path.activationRequiresAimConfirmation = false;
            Path.movementType                      = MovementType.ChaseMoveTarget;
            Path.moveInputScale                    = 1;
            Path.aimType                   = AimType.AtMoveTarget;
            Path.ignoreNodeGraph           = true;
            Path.driverUpdateTimerOverride = -1;
            Path.resetCurrentEnemyOnNextDriverSelection = false;
            Path.noRepeat            = false;
            Path.shouldSprint        = false;
            Path.shouldFireEquipment = false;
            Path.shouldTapButton     = false;

            StrafePath.customName = "Strafe Path";
            StrafePath.skillSlot  = SkillSlot.None;
            //Path.requiredSkill =
            StrafePath.requireSkillReady                 = false;
            StrafePath.requireEquipmentReady             = false;
            StrafePath.moveTargetType                    = TargetType.CurrentEnemy;
            StrafePath.minUserHealthFraction             = float.NegativeInfinity;
            StrafePath.maxUserHealthFraction             = float.PositiveInfinity;
            StrafePath.minTargetHealthFraction           = float.NegativeInfinity;
            StrafePath.maxTargetHealthFraction           = float.PositiveInfinity;
            StrafePath.minDistance                       = 0;
            StrafePath.maxDistance                       = 30;
            StrafePath.selectionRequiresTargetLoS        = false;
            StrafePath.activationRequiresTargetLoS       = false;
            StrafePath.activationRequiresAimConfirmation = false;
            StrafePath.movementType                      = MovementType.StrafeMovetarget;
            StrafePath.moveInputScale                    = 1;
            StrafePath.aimType                   = AimType.AtMoveTarget;
            StrafePath.ignoreNodeGraph           = false;
            StrafePath.driverUpdateTimerOverride = -1;
            StrafePath.resetCurrentEnemyOnNextDriverSelection = false;
            StrafePath.noRepeat            = false;
            StrafePath.shouldSprint        = false;
            StrafePath.shouldFireEquipment = false;
            StrafePath.shouldTapButton     = false;
        }
Exemplo n.º 22
0
 public void MoveTo(Vector2 target, float speed, bool smooth = true)
 {
     StopMoving();
     moving = BaseHelpers.StartCoroutine(Moving(target, speed, smooth));
 }