Ejemplo n.º 1
0
 public void MechTypes()
 {
     foreach (var mechType in KnownMechTypes)
     {
         Assert.IsFalse(string.IsNullOrWhiteSpace(MechType.LookupOid(mechType)));
     }
 }
Ejemplo n.º 2
0
        public KerberosRequest(byte[] data)
        {
            var element = new Asn1Element(data);

            MechType         = new MechType(element[0].AsString());
            NegotiationToken = new NegTokenInit(element[1][0]);
        }
Ejemplo n.º 3
0
    public void Reset()
    {
        cameraPos.x = 0;
        cameraPos.y = 1;
        cameraPos.z = -10;
        Camera.main.transform.parent = null;
        //	Camera.main.transform.position = Vector3.zero;
        firstTime = true;
        fixedCam  = false;



        foreach (MechPrefab prefab in _prefabList)
        {
            Destroy(prefab.gameObject);
        }

        _prefabList.Clear();
        _currentMount  = 0;
        _currentPrefab = 0;
        _mechSize      = MechSize.Light;
        _mechType      = MechType.Biped;

        UpdateGui();
    }
Ejemplo n.º 4
0
 public void RestorePreviousState(bool restoreOldHp)
 {
     name     = previousState.name;
     mainGun  = previousState.MainGun;
     maxSpeed = previousState.MaxSpeed;
     maxHp    = previousState.maxHp;
     mechType = previousState.mechType;
 }
Ejemplo n.º 5
0
 public void RestoreDefaultState()
 {
     name     = defaultState.name;
     mainGun  = defaultState.MainGun;
     maxSpeed = defaultState.MaxSpeed;
     currHp   = defaultState.currHp;
     maxHp    = defaultState.maxHp;
     mechType = defaultState.mechType;
 }
Ejemplo n.º 6
0
 public Mechanic(int skill_id, string name, MechType mechtype, ushort bossid, string plotlyShape, string friendlyName)
 {
     this.skill_id    = skill_id;
     this.name        = name;
     this.mechType    = mechtype;
     this.bossid      = bossid;
     this.plotlyShape = plotlyShape;
     this.altname     = friendlyName;
 }
Ejemplo n.º 7
0
    public void PreviousType()
    {
        _mechType--;

        if (_mechType < 0)
        {
            _mechType = MechType.Any - 1;
        }

        UpdateGui();
    }
Ejemplo n.º 8
0
    public void NextType()
    {
        _mechType++;

        if (_mechType >= MechType.Any)
        {
            _mechType = 0;
        }

        UpdateGui();
    }
Ejemplo n.º 9
0
 public Mech(Mech source, int id)
 {
     name        = source.name;
     this.mechId = id;
     mainGun     = source.MainGun;
     maxSpeed    = source.MaxSpeed;
     currHp      = source.currHp;
     maxHp       = source.maxHp;
     mechType    = source.mechType;
     mechColor   = source.mechColor;
     size        = source.size;
     brain       = new MechAiStateMachine(source.brain);
 }
Ejemplo n.º 10
0
 public Mechanic(long skillId, string inGameName, MechType mechType, MechanicPlotlySetting plotlySetting, string shortName, string description, string fullName, int internalCoolDown, CheckSpecialCondition condition = null)
 {
     InGameName       = inGameName;
     SkillId          = skillId;
     MechanicType     = mechType;
     PlotlySetting    = plotlySetting;
     ShortName        = shortName;
     FullName         = fullName;
     Description      = description;
     InternalCooldown = internalCoolDown;
     SpecialCondition = condition;
     IsEnemyMechanic  = MechanicType == MechType.EnemyBoon || MechanicType == MechType.EnemyBoonStrip ||
                        MechanicType == MechType.EnemyCastEnd || MechanicType == MechType.EnemyCastStart ||
                        MechanicType == MechType.Spawn;
 }
Ejemplo n.º 11
0
        public static Texture2D GetMechTexture(MechType mechType)
        {
            switch (mechType)
            {
            case MechType.DebugMechA:
                return(debugMechA);

            case MechType.DebugMechB:
                return(debugMechB);

            case MechType.DebugMechC:
                return(debugMechC);

            default:
                return(errorTexture);
            }
        }
Ejemplo n.º 12
0
 public Mechanic(long skillId, string inGameName, MechType mechType, ParseEnum.BossIDS bossId,
                 string plotlyString, string shortName, string description, string plotlyName, int internalCoolDown,
                 CheckSpecialCondition condition = null)
 {
     InGameName       = inGameName;
     SkillId          = skillId;
     MechanicType     = mechType;
     BossID           = bossId;
     PlotlyString     = plotlyString;
     PlotlySymbol     = GeneralHelper.FindPattern(PlotlyString, "symbol\\s*:\\s*'([^']*)'");
     PlotlyColor      = GeneralHelper.FindPattern(PlotlyString, "color\\s*:\\s*'([^']*)'");
     ShortName        = shortName;
     Description      = description ?? InGameName;
     PlotlyName       = plotlyName ?? InGameName;
     InternalCooldown = internalCoolDown;
     SpecialCondition = condition;
     IsEnemyMechanic  = MechanicType == MechType.EnemyBoon || MechanicType == MechType.EnemyBoonStrip ||
                        MechanicType == MechType.EnemyCastEnd || MechanicType == MechType.EnemyCastStart ||
                        MechanicType == MechType.Spawn;
 }
Ejemplo n.º 13
0
        private void Init(string name, int mechId, MechType mechType, int maxHp, int maxSpeed, Color color)
        {
            this.name     = name;
            this.mechType = mechType;
            this.mechId   = mechId;
            this.maxHp    = maxHp;
            this.currHp   = maxHp;
            this.maxSpeed = maxSpeed;

            Position     = Vector2.Zero;
            facing       = Vector2.UnitX;
            smoothFacing = new VectorSmoother(20);
            smoothFacing.SetSmoothVector(facing);

            size = GameSettings.GetMechSize(mechType);

            this.brain = new MechAiStateMachine(this, new BasicMoveBehavior(), new BasicAttackBehavior());

            mechColor = color;
            mainGun   = Gun.DefaultGun;
        }
        public static byte[] EncodeInitialNegToken(byte[] token,
                                                   KerberosConstValue.OidPkt oidPkt)
        {
            int[] oidInt;
            if (oidPkt == KerberosConstValue.OidPkt.KerberosToken)
            {
                oidInt = KerberosConstValue.GetKerberosOidInt();
            }
            else if (oidPkt == KerberosConstValue.OidPkt.MSKerberosToken)
            {
                oidInt = KerberosConstValue.GetMsKerberosOidInt();
            }
            else
            {
                throw new NotSupportedException("oid not support");
            }

            MechTypeList mechTypeList = new MechTypeList(
                new MechType[]
            {
                new MechType(oidInt)
            }
                );

            Asn1OctetString octetString = new Asn1OctetString(token);
            NegTokenInit    init        = new NegTokenInit(mechTypeList, null, new Asn1OctetString(octetString.ByteArrayValue), new Asn1OctetString((byte[])null));

            NegotiationToken negToken = new NegotiationToken(NegotiationToken.negTokenInit, init);

            MechType        spnegoMech = new MechType(KerberosConstValue.GetSpngOidInt());
            InitialNegToken initToken  = new InitialNegToken(spnegoMech, negToken);

            Asn1BerEncodingBuffer buffer = new Asn1BerEncodingBuffer();

            initToken.BerEncode(buffer);

            return(buffer.Data);
        }
Ejemplo n.º 15
0
        public static Mech GetBaseMechFromType(MechType type)
        {
            Mech mech;

            switch (type)
            {
            case MechType.DebugMechA:
            {
                mech         = new Mech("DebugMechA", GetNextId(), 20, 4 * GameSettings.TileSize, type);
                mech.MainGun = new Gun(5, 6 * GameSettings.TileSize, 20 * GameSettings.TileSize, 1, 1.25f, BulletType.Basic);
                break;
            }

            case MechType.DebugMechB:
            {
                mech         = new Mech("DebugMechB", GetNextId(), 40, 3 * GameSettings.TileSize, type);
                mech.MainGun = new Gun(10, 4 * GameSettings.TileSize, 10 * GameSettings.TileSize, 0.5f, 2, BulletType.Basic);
                break;
            }

            case MechType.DebugMechC:
            {
                mech         = new Mech("DebugMechC", GetNextId(), 10, 5 * GameSettings.TileSize, type);
                mech.MainGun = new Gun(1, 8 * GameSettings.TileSize, 30 * GameSettings.TileSize, 1.5f, 1, BulletType.Basic);
                break;
            }

            default:
            {
                mech = new Mech("Error", -1, 0, 0, MechType.Error);
                break;
            }
            }

            mech.SaveAsDefaultState( );
            return(mech);
        }
Ejemplo n.º 16
0
        public KerberosRequest(byte[] data)
        {
            var element = new Asn1Element(data);

            for (var i = 0; i < element.Count; i++)
            {
                var child = element[i];

                switch (child.ContextSpecificTag)
                {
                case 0:
                    NegotiationToken = new NegTokenInit(child[0]);
                    break;

                case MechType.ContextTag:
                    MechType = new MechType(child.AsString());
                    break;

                case 110:
                    Request = new KrbApReq(child[0]);
                    break;
                }
            }
        }
Ejemplo n.º 17
0
 public Mechanic(long skillId, string inGameName, MechType mechType, ParseEnum.BossIDS bossId,
                 string plotlyString, string shortName, int internalCoolDown, CheckSpecialCondition condition = null) :
     this(skillId, inGameName, mechType, bossId, plotlyString, shortName, null, null, internalCoolDown, condition)
 {
 }
Ejemplo n.º 18
0
 public void UnknownMechType()
 {
     Assert.IsTrue(string.IsNullOrEmpty(MechType.LookupOid("1.2.3.4.5.6.7.8.9")));
 }
Ejemplo n.º 19
0
 public void SetType(MechType mechType)
 {
     _mechType = mechType;
 }
Ejemplo n.º 20
0
 public Mech(string name, int mechId, int maxHp, int speed, MechType mechType, Color color)
 {
     Init(name, mechId, mechType, maxHp, speed, color);
     Subscribe();
 }
Ejemplo n.º 21
0
 public Mechanic(long skillId, string inGameName, MechType mechType, MechanicPlotlySetting plotlySetting, string shortName, int internalCoolDown, CheckSpecialCondition condition = null) : this(skillId, inGameName, mechType, plotlySetting, shortName, shortName, shortName, internalCoolDown, null)
 {
 }
Ejemplo n.º 22
0
 public void SetType(MechType mechType)
 {
     _mechType = mechType;
 }
Ejemplo n.º 23
0
    public void Reset()
    {
        cameraPos.x = 0;
        cameraPos.y = 1;
        cameraPos.z = -10;
        Camera.main.transform.parent = null;
        //	Camera.main.transform.position = Vector3.zero;
        firstTime = true;
        fixedCam = false;

        foreach(MechPrefab prefab in _prefabList)
        {
            Destroy(prefab.gameObject);
        }

        _prefabList.Clear();
        _currentMount = 0;
        _currentPrefab = 0;
        _mechSize = MechSize.Light;
        _mechType = MechType.Biped;

        UpdateGui();
    }
Ejemplo n.º 24
0
    public void PreviousType()
    {
        _mechType--;

        if(_mechType < 0)
        {
            _mechType = MechType.Any - 1;
        }

        UpdateGui();
    }
Ejemplo n.º 25
0
    public void NextType()
    {
        _mechType++;

        if(_mechType >= MechType.Any)
        {
            _mechType = 0;
        }

        UpdateGui();
    }
Ejemplo n.º 26
0
        public static Vector2 GetMechSize(MechType mechType)
        {
            Texture2D mechImage = GameTextureRepo.GetMechTexture(mechType);

            return(new Vector2(mechImage.Width, mechImage.Height) * ArtScale);
        }