public void SetUp() { Dictionary<WeaponType, IWeapon> weapons = new Dictionary<WeaponType, IWeapon>(); weapons.Add(WeaponType.RailGun, MockRepository.GenerateStub<IWeapon>()); weapons.Add(WeaponType.RocketLauncher, MockRepository.GenerateStub<IProjectileWeapon>()); weaponList = new WeaponList(weapons); }
void Start() { WeaponList newWeaponList = AvailableWeapons[UnityEngine.Random.Range(0, AvailableWeapons.Count)]; MyWeapon = newWeaponList.availableWeaponData[UnityEngine.Random.Range(0, newWeaponList.availableWeaponData.Count)]; mySkillList = weaponSkillList; }
// Use this for initialization void Start() { var player = GameObject.FindWithTag("Player"); list = player.GetComponent <WeaponList>(); info = GetComponent <EnemyInfo>(); }
public MainWindow() { InitializeComponent(); // Setup DataGrid Default Source weaponlistLoader = new WeaponList(); dgWeaponList.ItemsSource = weaponlistLoader; }
public new void Start() { base.Start(); this.transform.position = new Vector3(this.startPoint.position.x, this.startPoint.position.y, this.transform.position.z); this.weaponList = this.GetComponentInChildren <WeaponList>(); this.getDefaultWeapon(); }
public void AddWeapon(Weapon weapon) { WeaponList.Add(weapon); if (WeaponList.Count > MAX_WEAPONS) { throw new ArgumentException("Too many weapons added to entity."); } }
protected void SwitchToWeapon(WeaponType weapon) { //Debug.Log(newWeapon.GetTakeoutBehaviour().name + " " + currentWeapon.GetStashBehaviour().name); var newWeapon = WeaponList.GetWeapon(weapon).Instantiate(releasePoint); actionCoordinator.SwitchWeapon(currentWeapon, newWeapon); currentWeapon = newWeapon; }
public void ReceiveInventory(int inventoryID, WeaponList weapon) { if (!ownedWeapons.Contains(weapon)) { return; } EquipWeapon(inventoryID, weapon); }
public void SendBuyWeapon(WeaponList weapon) { MessageBuffer msg = new MessageBuffer(); msg.WriteShort((short)Protocol.PlayerBuyWeapon); msg.WriteByte((byte)weapon); Game.client.Send(msg); }
public ActionResult GetWeaponList(int wid) { WeaponList weaponlist = new WeaponList(); weaponlist.WeaponID = wid; WeaponList lists = WeapDesignBll.GetWeaponList(weaponlist); return(Jsonp(ErrorCode.Succuess, lists)); }
public Stats(WeaponList type, float damage, FireType fireType, float fireRate, float reloadTime, int ammo, int scrapCost) { this.type = type; this.damage = damage; this.fireType = fireType; this.fireRate = fireRate; this.reloadTime = reloadTime; this.ammo = ammo; this.scrapCost = scrapCost; }
public void Attack(Warrior enemy, WeaponList wpn) { weapon = new Weapon(wpn); int damage = weapon.Damage / enemy.armor.ArmorPoints; enemy.health = enemy.health - damage; //Console.WriteLine(wpn.ToString()); //Thread.Sleep(2000); AttackResult(enemy, damage, wpn); }
/// <summary> /// Removes all lasers from the list if off the screen. /// </summary> public void RemoveLaserIfOffScreen() { foreach (WeaponInstance weapon in WeaponList.ToList()) { if (weapon.X > SwinGame.ScreenWidth()) { WeaponList.Remove(weapon); } } }
public void SendInventory(int invID, WeaponList weapon) { MessageBuffer msg = new MessageBuffer(); msg.WriteShort((short)Protocol.PlayerInventory); msg.WriteByte(invID); msg.WriteByte((byte)(weapon)); Game.client.Send(msg); }
public override void BuyWeapon(WeaponList weapon) { if (ownedWeapons.Contains(weapon) || scrap < WeaponStats.GetStats(weapon).scrapCost) { return; } base.BuyWeapon(weapon); SetScrap(scrap - WeaponStats.GetStats(weapon).scrapCost); }
public void WeaponOptionNodeTest4() { WeaponList weaponList = new WeaponList("C:/Users/wfeij/Dropbox/WH8/Vergelijken units/TestWeapons.csv"); WeaponOptionNode won = new WeaponOptionNode("a/[b+c]", weaponList); Assert.IsNotNull(won); List <List <WeaponChoice> > wcl = won.validWeaponLists(); Assert.IsNotNull(wcl); }
MessageBuffer GetBuyWeaponMessage(WeaponList weapon) { MessageBuffer msg = new MessageBuffer(); msg.WriteShort((short)Protocol.PlayerBuyWeapon); msg.WriteByte(id); msg.WriteByte((byte)weapon); return(msg); }
/// <summary> /// 根据ID获取 WeaponList /// </summary> /// Create By zhouqi /// 2015/11/26 18:03:57 /// <param name="weaponList">WeaponList 实体</param> /// <returns></returns> public WeaponList GetWeaponList(WeaponList searchWeaponList) { DbCommand cmd = DB.GetStoredProcCommand("WeaponList_GetByWeaponID"); DB.AddInParameter(cmd, WeaponList.WeaponIDField, DbType.Int32, searchWeaponList.WeaponID); WeaponList weaponList = new WeaponList(); using (IDataReader dr = DB.ExecuteReader(cmd)) { if (dr.FieldCount > 0) { int coWeaponID = dr.GetOrdinal(WeaponList.WeaponIDField); int coWeaponName = dr.GetOrdinal(WeaponList.WeaponNameField); int coContactMethod = dr.GetOrdinal(WeaponList.ContactMethodField); int coWeaponDesc = dr.GetOrdinal(WeaponList.WeaponDescField); int coTruePraise = dr.GetOrdinal(WeaponList.TruePraiseField); int coShowPraise = dr.GetOrdinal(WeaponList.ShowPraiseField); int coPicAddress = dr.GetOrdinal(WeaponList.PicAddressField); int coSpicAddress = dr.GetOrdinal(WeaponList.SpicAddressField); int coLength = dr.GetOrdinal(WeaponList.LengthField); int coWidth = dr.GetOrdinal(WeaponList.WidthField); int coSLength = dr.GetOrdinal(WeaponList.SLengthField); int coSWidth = dr.GetOrdinal(WeaponList.SWidthField); int coCreateTS = dr.GetOrdinal(WeaponList.CreateTSField); int coUpdateTS = dr.GetOrdinal(WeaponList.UpdateTSField); int coStatusID = dr.GetOrdinal(WeaponList.StatusIDField); int coReason = dr.GetOrdinal(WeaponList.ReasonField); int coWeaType = dr.GetOrdinal(WeaponList.WeaTypeField); if (dr.Read()) { weaponList.WeaponID = dr.IsDBNull(coWeaponID) ? (int)0 : dr.GetInt32(coWeaponID); weaponList.WeaponName = dr.IsDBNull(coWeaponName) ? string.Empty : dr.GetString(coWeaponName); weaponList.ContactMethod = dr.IsDBNull(coContactMethod) ? string.Empty : dr.GetString(coContactMethod); weaponList.WeaponDesc = dr.IsDBNull(coWeaponDesc) ? string.Empty : dr.GetString(coWeaponDesc); weaponList.TruePraise = dr.IsDBNull(coTruePraise) ? (int)0 : dr.GetInt32(coTruePraise); weaponList.ShowPraise = dr.IsDBNull(coShowPraise) ? (int)0 : dr.GetInt32(coShowPraise); weaponList.PicAddress = dr.IsDBNull(coPicAddress) ? string.Empty : dr.GetString(coPicAddress); weaponList.SpicAddress = dr.IsDBNull(coSpicAddress) ? string.Empty : dr.GetString(coSpicAddress); weaponList.Length = dr.IsDBNull(coLength) ? (int)0 : dr.GetInt32(coLength); weaponList.Width = dr.IsDBNull(coWidth) ? (int)0 : dr.GetInt32(coWidth); weaponList.SLength = dr.IsDBNull(coSLength) ? (int)0 : dr.GetInt32(coSLength); weaponList.SWidth = dr.IsDBNull(coSWidth) ? (int)0 : dr.GetInt32(coSWidth); weaponList.CreateTS = dr.IsDBNull(coCreateTS) ? (DateTime)SqlDateTime.Null : dr.GetDateTime(coCreateTS); weaponList.UpdateTS = dr.IsDBNull(coUpdateTS) ? (DateTime)SqlDateTime.Null : dr.GetDateTime(coUpdateTS); weaponList.StatusID = dr.IsDBNull(coStatusID) ? (int)0 : dr.GetInt32(coStatusID); weaponList.Reason = dr.IsDBNull(coReason) ? string.Empty : dr.GetString(coReason); weaponList.WeaType = dr.IsDBNull(coWeaType) ? string.Empty : dr.GetString(coWeaType); } } } return(weaponList); }
public bool DoesPlayerOwnWeapon(WeaponList weapon_) { // if the player already has the weapon, return true if (WeaponsPickedUp[(int)weapon_]) { return(true); } // All other conditions, return false return(false); }
public void getWeaponOptionTest2() { WeaponList weaponList = new WeaponList("C:/Users/wfeij/Dropbox/WH8/Vergelijken units/TestWeapons.csv"); int min = 0, max = 0; Weapon weapon = null; string dummy = WeaponOptionNode.stripMinMaxOffString("3a", ref min, ref max); Assert.AreEqual(3, min); Assert.AreEqual(3, max); weapon = weaponList[dummy]; Assert.IsNotNull(weapon); }
MessageBuffer GetInventoryMessage(int inventoryID, WeaponList weapon) { MessageBuffer msg = new MessageBuffer(); msg.WriteShort((short)Protocol.PlayerInventory); msg.WriteByte(id); msg.WriteByte(inventoryID); msg.WriteByte((byte)weapon); return(msg); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { UI.LoadContent(Content, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); UIClass.LoadContent(Content); UpgradeSystem.LoadContent(Content, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); WeaponList.LoadContent(Content); ChopperList.LoadContent(Content); EffectsList.LoadContent(Content); EnemyMaker.LoadContent(Content); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); Level level = new Level(500, 500); Player player = new Player(ChopperList.GetChopper(ChopperType.Training), new Vector2(500, 2000)); //Player player = new Player(ChopperList.GetChopper(0), new Vector2(0, 0)); hud = new Hud(Content.Load <SpriteFont>("hudFont")); camera = new Camera(); //camera.Position = player.PlayerSpriteCenter; camera.Position = player.PlayerCenter; gameManager = new GameManager(level, player); List <Sprite> listOfEnemies = new List <Sprite>(); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.MGun, new Vector2(0, 0), 0, 0)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.MGun, new Vector2(0, 700), 0, 0)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.MGun, new Vector2(700, 700), 0, 0)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.MGun, new Vector2(700, 0), 0, 0)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.Rocket, new Vector2(350, 350), 0, 0)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.RocketHoming, new Vector2(800, 800), 0, 0)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.ShotGun, new Vector2(500, 500), 3, 1)); listOfEnemies.Add(EnemyMaker.GetTurret(TurretType.ShotGun, new Vector2(250, 450), 5, 0.5f)); level.AddEntity(listOfEnemies, true, true, true); listOfEnemies.Clear(); listOfEnemies.Add(new Building(Content.Load <Texture2D>("building"), new Vector2(1000, 1000))); List <Helipad> listOfHelipads = new List <Helipad>(); listOfHelipads.Add(new Helipad(Content.Load <Texture2D>("Allies\\helipad"), new Vector2(500, 2000))); level.AddLandingPad(listOfHelipads); level.AddEntity(listOfEnemies, true, true, false); missionScreen = new MissionScreen(1, "GameTest", "Yarrr mission is to blow up\nevery turret. Then return\nto the base\n\nWASD - Move \nLeft\\Right arrow - rotate\nSpace - fire \nX and L - land\\lift \nU - upgrade (on helipad)\nP- developer stats\n+ and - - zoom ", graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, Color.SaddleBrown); GameData.menuState = MenuState.MissionMenu; // TODO: use this.Content to load your game content here }
/// <summary> /// Processes the amount of shots available. /// </summary> /// <param name="type">what kind of laser</param> /// <param name="X">Float</param> /// <param name="Y">Float</param> public void ShootWeapon(Bitmap type, float X, float Y) { if (Shots > 0) { WeaponList.Add(new WeaponInstance(X, Y, type)); SwinGame.PlaySoundEffect("Laser"); } if (Shots <= 0) { SwinGame.PlaySoundEffect("Reload"); } }
public void _21_SpaceshipWeaponListContainsData() { WeaponList weaponList = spaceshipPrefab.GetComponent <SpaceshipController>().weaponList; Assert.IsNotNull(weaponList); Assert.IsTrue(weaponList.weapons.Count == 2); foreach (WeaponList.Weapon weapon in weaponList.weapons) { Assert.IsTrue(weapon.weaponName.Length != 0); Assert.IsNotNull(weapon.weaponPrefab); } }
public static Texture GetIcon(WeaponList weapon) { if (weaponIcons == null) { weaponIcons = new Texture[Enum.GetNames(typeof(WeaponList)).Length]; weaponIcons[(int)WeaponList.Pistol] = Art.Load("Res/weapons/pistol.png"); weaponIcons[(int)WeaponList.Rifle] = Art.Load("Res/weapons/rifle.png"); weaponIcons[(int)WeaponList.GrenadeLauncher] = Art.Load("Res/weapons/grenadeLauncher.png"); weaponIcons[(int)WeaponList.Bow] = Art.Load("Res/weapons/bow.png"); } return(weaponIcons[(int)weapon]); }
/// <summary> /// 查看 ] 编辑页面 /// </summary> /// <param name="WeaponID">要查看的WeaponID</param> /// <returns></returns> public ActionResult EditWeaponList(int WeaponID) { WeaponList wlist = new WeaponList(); wlist.WeaponID = WeaponID; WeaponList weaponList = _adminBLL.GetWeaponList(wlist); ViewBag.StatusID = GetWeaponStatusList(weaponList.StatusID); //记录日志 Log(string.Format("查看[WeaponList]]编辑页面 数据:{0}", WeaponID)); return(View("EditWeaponList", weaponList)); }
// Use this for initialization void Awake() { Instace = this; weaponlist = new WeaponList(); Squadloadout = new SquadLoadout(); squadlist = new List <Squad>(); SpawnPointList = new List <GameObject>(); AddSquad(new Squad(2, squadlist.Count, "Team_0", Squadloadout.LoadOut[0])); }
private static void InitalizeFactory() { if (IsInitialized) { return; } WeaponList weaponList = ResourcesIndex.GetAsset <WeaponList>(1); weaponObjectById = new Dictionary <int, WeaponInfo>(); for (int i = 0; i < weaponList.weaponInfo.Count; i++) { weaponObjectById.Add(weaponList.weaponInfo[i].id, weaponList.weaponInfo[i]); } }
public TensionBonus(TensionBonus t) { isActive = false; barMulti = t.barMulti; barThreshold = t.barThreshold; type = t.type; if (t.type == BONUSTYPE.NewWeapons) { newList = t.newList; lowGradeRate = t.lowGradeRate; midGradeRate = t.midGradeRate; specialGradeRate = t.specialGradeRate; } }
public Int32 UpdateWeaponStatus(WeaponList weaponList) { _admin = new WeaponDesignAdminService.WeaponDesignAdminServiceClient(); try { int rs = _admin.UpdateWeaponStatus(weaponList); _admin.Close(); return(rs); } catch (Exception ex) { _admin.CloseCatch(ex, "UpdateWeaponStatus 更新武器状态失败"); return(0); } }
public static Stats GetStats(WeaponList weapon) { switch (weapon) { case WeaponList.Pistol: return(Pistol); case WeaponList.Rifle: return(Rifle); case WeaponList.GrenadeLauncher: return(GrenadeLauncher); case WeaponList.Bow: return(Bow); default: return(Pistol); } }
void InitWeaponList() { GameObject tmp; tmp = GameObject.FindGameObjectWithTag("WeaponList"); if (tmp != null) { weaponList = tmp.GetComponent<WeaponList>(); if ( weaponList == null ) { Debug.LogError( "Cannot find Weapon List compounent" ); } } else { Debug.LogError("Cannot find Weapon List object"); } }
void Awake() { currentWeaponList = this; }
void initWeaponList() { GameObject tmp = GameObject.FindGameObjectWithTag("WeaponList"); weaponPrefabs = tmp.GetComponent<WeaponList>(); }
/// <summary> /// Initializes the action bar. /// </summary> /// <param name="number">The number.</param> /// <param name="weapon">The weapon.</param> public void InitializeActionBar(int number, WeaponList weapon) { int index = -1; switch(weapon.ToString()) { case "LeBonVieuxCanonDesFamilles": index = 0; break; case "SalveDePetitPlomb": index = 1; break; case "LourdParpaingDeDureRealite": index = 2; break; default: index = -1; break; } if(index>=0) { m_ActionImage[number].sprite = m_ActionSprite[index]; } }