コード例 #1
0
ファイル: WeaponListTests.cs プロジェクト: zakvdm/Frenetic
 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);
 }
コード例 #2
0
    void Start()
    {
        WeaponList newWeaponList = AvailableWeapons[UnityEngine.Random.Range(0, AvailableWeapons.Count)];

        MyWeapon = newWeaponList.availableWeaponData[UnityEngine.Random.Range(0, newWeaponList.availableWeaponData.Count)];

        mySkillList = weaponSkillList;
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        var player = GameObject.FindWithTag("Player");

        list = player.GetComponent <WeaponList>();

        info = GetComponent <EnemyInfo>();
    }
コード例 #4
0
        public MainWindow()
        {
            InitializeComponent();

            // Setup DataGrid Default Source
            weaponlistLoader         = new WeaponList();
            dgWeaponList.ItemsSource = weaponlistLoader;
        }
コード例 #5
0
ファイル: Player.cs プロジェクト: kkaren/Hackathon2017
    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();
    }
コード例 #6
0
 public void AddWeapon(Weapon weapon)
 {
     WeaponList.Add(weapon);
     if (WeaponList.Count > MAX_WEAPONS)
     {
         throw new ArgumentException("Too many weapons added to entity.");
     }
 }
コード例 #7
0
    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;
    }
コード例 #8
0
    public void ReceiveInventory(int inventoryID, WeaponList weapon)
    {
        if (!ownedWeapons.Contains(weapon))
        {
            return;
        }

        EquipWeapon(inventoryID, weapon);
    }
コード例 #9
0
    public void SendBuyWeapon(WeaponList weapon)
    {
        MessageBuffer msg = new MessageBuffer();

        msg.WriteShort((short)Protocol.PlayerBuyWeapon);
        msg.WriteByte((byte)weapon);

        Game.client.Send(msg);
    }
コード例 #10
0
        public ActionResult GetWeaponList(int wid)
        {
            WeaponList weaponlist = new WeaponList();

            weaponlist.WeaponID = wid;
            WeaponList lists = WeapDesignBll.GetWeaponList(weaponlist);

            return(Jsonp(ErrorCode.Succuess, lists));
        }
コード例 #11
0
 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;
 }
コード例 #12
0
        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);
        }
コード例 #13
0
ファイル: WeaponManager.cs プロジェクト: bmouritz/Space-Wars
 /// <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);
         }
     }
 }
コード例 #14
0
    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);
    }
コード例 #15
0
    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);
    }
コード例 #16
0
        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);
        }
コード例 #17
0
    MessageBuffer GetBuyWeaponMessage(WeaponList weapon)
    {
        MessageBuffer msg = new MessageBuffer();

        msg.WriteShort((short)Protocol.PlayerBuyWeapon);

        msg.WriteByte(id);
        msg.WriteByte((byte)weapon);

        return(msg);
    }
コード例 #18
0
        /// <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);
        }
コード例 #19
0
    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);
    }
コード例 #20
0
        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);
        }
コード例 #21
0
    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);
    }
コード例 #22
0
ファイル: Game1.cs プロジェクト: PingWIN7/project_chopper
        /// <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
        }
コード例 #23
0
ファイル: WeaponManager.cs プロジェクト: bmouritz/Space-Wars
        /// <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");
            }
        }
コード例 #24
0
    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);
        }
    }
コード例 #25
0
    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]);
    }
コード例 #26
0
        /// <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));
        }
コード例 #27
0
    // 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]));
    }
コード例 #28
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]);
        }
    }
コード例 #29
0
    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;
        }
    }
コード例 #30
0
 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);
     }
 }
コード例 #31
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);
        }
    }
コード例 #32
0
ファイル: Weapon.cs プロジェクト: EatWithMe/alfaSquad
    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");
        }
    }
コード例 #33
0
 void Awake()
 {
     currentWeaponList = this;
 }
コード例 #34
0
ファイル: UpgradeMenu.cs プロジェクト: EatWithMe/alfaSquad
 void initWeaponList()
 {
     GameObject tmp = GameObject.FindGameObjectWithTag("WeaponList");
     weaponPrefabs = tmp.GetComponent<WeaponList>();
 }
コード例 #35
0
ファイル: UIManager.cs プロジェクト: BaptisteBillet/Barababor
    /// <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];
        }
    }