Exemple #1
0
        public static string GetIconNameFromTroopClass(TroopRole troopClass)
        {
            string result = string.Empty;

            switch (troopClass)
            {
            case TroopRole.Striker:
                result = "ClassIcon_general";
                break;

            case TroopRole.Breacher:
                result = "ClassIcon_wallbreaker";
                break;

            case TroopRole.Looter:
                result = "ClassIcon_neutralizer";
                break;

            case TroopRole.Bruiser:
                result = "ClassIcon_meatshield";
                break;

            case TroopRole.Healer:
                result = "ClassIcon_medic";
                break;

            default:
                result = "ClassIcon_general";
                break;
            }
            return(result);
        }
Exemple #2
0
        public TroopTab ConvertTroopRoleToTab(TroopRole role)
        {
            TroopTab result = TroopTab.All;

            switch (role)
            {
            case TroopRole.Generic:
                result = TroopTab.Generic;
                break;

            case TroopRole.Striker:
                result = TroopTab.Striker;
                break;

            case TroopRole.Breacher:
                result = TroopTab.Breacher;
                break;

            case TroopRole.Looter:
                result = TroopTab.Looter;
                break;

            case TroopRole.Bruiser:
                result = TroopTab.Bruiser;
                break;

            case TroopRole.Healer:
                result = TroopTab.Healer;
                break;

            case TroopRole.Destroyer:
                result = TroopTab.Destroyer;
                break;

            default:
                Service.Get <StaRTSLogger>().WarnFormat("Cannot convert TroopRole {0} to TroopTab", new object[]
                {
                    role
                });
                break;
            }
            return(result);
        }
Exemple #3
0
        private void ResetAttackFSM(SmartEntity troopEntity)
        {
            StaRTS.Utils.Diagnostics.Logger logger = Service.Logger;
            StateComponent stateComp = troopEntity.StateComp;

            if (stateComp == null)
            {
                logger.Error("ResetAttackFSM StateComp is null");
                return;
            }
            stateComp.Reset();
            TroopComponent troopComp = troopEntity.TroopComp;

            if (troopComp == null)
            {
                logger.Error("ResetAttackFSM TroopComp is null");
                return;
            }
            if (troopComp.TroopType == null)
            {
                logger.Error("ResetAttackFSM TroopVO is null");
                return;
            }
            ShooterComponent shooterComp = troopEntity.ShooterComp;

            if (shooterComp == null)
            {
                logger.Error("ResetAttackFSM ShooterComp is null");
                return;
            }
            TroopRole troopRole = shooterComp.ShooterVO.TroopRole;

            if (troopRole == TroopRole.None)
            {
                troopRole = shooterComp.OriginalShooterVO.TroopRole;
            }
            HealthType healthType = (troopRole != TroopRole.Healer) ? HealthType.Damaging : HealthType.Healing;

            shooterComp.Reset();
            shooterComp.AttackFSM = new AttackFSM(Service.BattleController, troopEntity, troopEntity.StateComp, shooterComp, troopEntity.TransformComp, healthType);
        }