void InitializeAllyWeaponItems(RTSAllyComponentSpecificFields _specific, RTSAllyComponentsAllCharacterFields _allFields)
        {
            var _tpcAllyCompsToInit = (RTSAllyComponentsAllCharacterFieldsWrapper)_allFields;

            AssualtRifleType = _tpcAllyCompsToInit.AssualtRifleType;
            PistolType       = _tpcAllyCompsToInit.PistolType;
            ShotgunType      = _tpcAllyCompsToInit.ShotgunType;
            SniperRifleType  = _tpcAllyCompsToInit.SniperRifleType;
            FistType         = _tpcAllyCompsToInit.FistType;
            KnifeType        = _tpcAllyCompsToInit.KnifeType;
            AxeType          = _tpcAllyCompsToInit.AxeType;
            CrossbowType     = _tpcAllyCompsToInit.CrossbowType;
            KatanaType       = _tpcAllyCompsToInit.KatanaType;
        }
        //void Update()
        //{
        //    //SE_CheckForAttack();
        //}
        #endregion

        #region Handlers
        private void OnInitializeAllyComponents(RTSAllyComponentSpecificFields _specificComps, RTSAllyComponentsAllCharacterFields _allAllyComps)
        {
            var _RPGallAllyComps = (AllyComponentsAllCharacterFieldsRPG)_allAllyComps;

            if (_specificComps.bBuildCharacterCompletely)
            {
                var _rpgCharAttr = _RPGallAllyComps.bUseAStarPath == false ?
                                   ((AllyComponentSpecificFieldsRPG)_specificComps).RPGCharacterAttributesObject :
                                   ((AllyComponentSpecificFieldsRPG)_specificComps).ASTAR_RPGCharacterAttributesObject;

                this.baseDamage = _rpgCharAttr.baseDamage;
                if (_rpgCharAttr.currentWeaponConfig != null)
                {
                    this.currentWeaponConfig = _rpgCharAttr.currentWeaponConfig;
                }
            }
            animator  = GetComponent <Animator>();
            character = GetComponent <RPGCharacter>();

            PutWeaponInHand(currentWeaponConfig);
            SetAttackAnimation();

            //InvokeRepeating("SE_CheckForAttack", 1f, checkForAttackRate);
        }
        private void OnInitializeAllyComponents(RTSAllyComponentSpecificFields _specificComps, RTSAllyComponentsAllCharacterFields _allAllyComps)
        {
            var _RPGallAllyComps = (AllyComponentsAllCharacterFieldsRPG)_allAllyComps;

            if (_specificComps.bBuildCharacterCompletely)
            {
                var _rpgCharAttr = ((AllyComponentSpecificFieldsRPG)_specificComps).RPGCharacterAttributesObject;
                this.damageSounds               = _rpgCharAttr.damageSounds;
                this.deathSounds                = _rpgCharAttr.deathSounds;
                this.deathVanishSeconds         = _rpgCharAttr.deathVanishSeconds;
                this.animatorController         = _rpgCharAttr.animatorController;
                this.animatorOverrideController = _rpgCharAttr.animatorOverrideController;
                this.characterAvatar            = _rpgCharAttr.characterAvatar;
                this.animatorForwardCap         = _rpgCharAttr.animatorForwardCap;
                this.audioSourceSpatialBlend    = _rpgCharAttr.audioSourceSpatialBlend;
                this.colliderCenter             = _rpgCharAttr.colliderCenter;
                this.colliderRadius             = _rpgCharAttr.colliderRadius;
                this.colliderHeight             = _rpgCharAttr.colliderHeight;
                this.moveSpeedMultiplier        = _rpgCharAttr.moveSpeedMultiplier;

                //RPG Character Moving
                this.MyStationaryTurnSpeed      = _rpgCharAttr.stationaryTurnSpeed;
                this.MyMovingTurnSpeed          = _rpgCharAttr.movingTurnSpeed;
                this.MyMoveThreshold            = _rpgCharAttr.moveThreshold;
                this.MyAnimatorForwardCap       = _rpgCharAttr.animatorForwardCap;
                this.MyAnimationSpeedMultiplier = _rpgCharAttr.animationSpeedMultiplier;
            }

            AddRequiredComponents();
            bInitializedAlly = true;
        }
Exemple #4
0
        protected override void OnAllyInitComps(RTSAllyComponentSpecificFields _specific, RTSAllyComponentsAllCharacterFields _allFields)
        {
            //Make Sure Base is Called Before Override
            base.OnAllyInitComps(_specific, _allFields);
            var _RPGallAllyComps = (AllyComponentsAllCharacterFieldsRPG)_allFields;
            var _rpgCharAttr     = ((AllyComponentSpecificFieldsRPG)_specific).RPGCharacterAttributesObject;

            //Set Important NavMeshAgent Attributes
            myNavAgent.speed            = _rpgCharAttr.navMeshAgentSteeringSpeed;
            myNavAgent.stoppingDistance = _rpgCharAttr.navMeshAgentStoppingDistance;
            myNavAgent.autoBraking      = false;
            myNavAgent.updateRotation   = false;
            myNavAgent.updatePosition   = true;
            this.bUseAStarPath          = _RPGallAllyComps.bUseAStarPath;
            //Behavior Tree Init
            MyBehaviourChoice   = _RPGallAllyComps.MyBehaviourChoice;
            bUsingBehaviorTrees = _RPGallAllyComps.bUseBehaviourTrees;
            if (MyBehaviourChoice == BehaviourFrameworkChoice.BehaviorDesigner)
            {
                InitializeBehaviorDesignerTree(_specific, _RPGallAllyComps, _rpgCharAttr);
            }
            else if (MyBehaviourChoice == BehaviourFrameworkChoice.UNode)
            {
                InitializeUNodeTree(_specific, _RPGallAllyComps, _rpgCharAttr);
            }
        }
        protected override void InitializeAlly(RTSAllyComponentSpecificFields _specific, RTSAllyComponentsAllCharacterFields _allFields)
        {
            AllyFaction      = _specific.AllyFaction;
            GeneralCommander = _specific.GeneralCommander;
            if (_allFields.bBuildLOSChildObject)
            {
                LOSTransform = _specific.LOSChildObjectTransform;
            }

            if (gamemode == null)
            {
                Debug.LogError("No gamemode on ai player!");
            }

            //Adding To PartyMan Is Delayed Because AllyStatController
            //Is Not Added Before AllyMember
            StartCoroutine(InitializeAllyCoroutine());
            //Create Overrideable Late Start to Accommodate
            //Assets Having Long StartUp
            Invoke("OnDelayStart", 0.5f);
        }
        protected override void OnAllyInitComponents(RTSAllyComponentSpecificFields _specific, RTSAllyComponentsAllCharacterFields _allFields)
        {
            base.OnAllyInitComponents(_specific, _allFields);
            var _RPGallAllyComps = (AllyComponentsAllCharacterFieldsRPG)_allFields;

            this.bUseAStarPath = _RPGallAllyComps.bUseAStarPath;
        }
        private void OnInitializeAllyComponents(RTSAllyComponentSpecificFields _specificComps, RTSAllyComponentsAllCharacterFields _allAllyComps)
        {
            var _RPGallAllyComps = (AllyComponentsAllCharacterFieldsRPG)_allAllyComps;

            if (_specificComps.bBuildCharacterCompletely)
            {
                var _rpgCharAttr = _RPGallAllyComps.bUseAStarPath == false ?
                                   ((AllyComponentSpecificFieldsRPG)_specificComps).RPGCharacterAttributesObject :
                                   ((AllyComponentSpecificFieldsRPG)_specificComps).ASTAR_RPGCharacterAttributesObject;
                this.abilities = _rpgCharAttr.abilities;
                if (_rpgCharAttr.energyBar != null)
                {
                    this.energyBar = _rpgCharAttr.energyBar;
                }
                if (_rpgCharAttr.outOfEnergy != null)
                {
                    this.outOfEnergy = _rpgCharAttr.outOfEnergy;
                }
            }
            audioSource = GetComponent <AudioSource>();
            InitializeAbilityDictionary();
            InvokeRepeating("SE_AddEnergyPoints", 1f, addStaminaRepeatRate);
        }