public void MechTypes() { foreach (var mechType in KnownMechTypes) { Assert.IsFalse(string.IsNullOrWhiteSpace(MechType.LookupOid(mechType))); } }
public KerberosRequest(byte[] data) { var element = new Asn1Element(data); MechType = new MechType(element[0].AsString()); NegotiationToken = new NegTokenInit(element[1][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(); }
public void RestorePreviousState(bool restoreOldHp) { name = previousState.name; mainGun = previousState.MainGun; maxSpeed = previousState.MaxSpeed; maxHp = previousState.maxHp; mechType = previousState.mechType; }
public void RestoreDefaultState() { name = defaultState.name; mainGun = defaultState.MainGun; maxSpeed = defaultState.MaxSpeed; currHp = defaultState.currHp; maxHp = defaultState.maxHp; mechType = defaultState.mechType; }
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; }
public void PreviousType() { _mechType--; if (_mechType < 0) { _mechType = MechType.Any - 1; } UpdateGui(); }
public void NextType() { _mechType++; if (_mechType >= MechType.Any) { _mechType = 0; } UpdateGui(); }
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); }
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; }
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); } }
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; }
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); }
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); }
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; } } }
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) { }
public void UnknownMechType() { Assert.IsTrue(string.IsNullOrEmpty(MechType.LookupOid("1.2.3.4.5.6.7.8.9"))); }
public void SetType(MechType mechType) { _mechType = mechType; }
public Mech(string name, int mechId, int maxHp, int speed, MechType mechType, Color color) { Init(name, mechId, mechType, maxHp, speed, color); Subscribe(); }
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) { }
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(); }
public void PreviousType() { _mechType--; if(_mechType < 0) { _mechType = MechType.Any - 1; } UpdateGui(); }
public void NextType() { _mechType++; if(_mechType >= MechType.Any) { _mechType = 0; } UpdateGui(); }
public static Vector2 GetMechSize(MechType mechType) { Texture2D mechImage = GameTextureRepo.GetMechTexture(mechType); return(new Vector2(mechImage.Width, mechImage.Height) * ArtScale); }