コード例 #1
0
ファイル: Enemy.cs プロジェクト: HuskyGameDev/2018-team7
    // Spawns a new weapon with at a 25% chance at the Vector3 position
    public void SpawnWeapon(Vector3 pos)
    {
        EnemyLoot loot = GetComponent <EnemyLoot>();

        if (loot != null)
        {
            loot.SpawnGun(pos.x, pos.y);
        }
    }
コード例 #2
0
        /// <summary>
        /// Remove an item from a enemy's loot
        /// </summary>
        /// <param name="enemyId">Id of enemy</param>
        /// <param name="itemId">Id of item</param>
        /// <returns>Successful result of item removal</returns>
        public async Task RemoveItemFromLoot(int enemyId, int itemId)
        {
            EnemyLoot result = await _context.EnemyLoot.FindAsync(enemyId, itemId);

            if (result != null)
            {
                _context.Entry(result).State = EntityState.Deleted;
                await _context.SaveChangesAsync();
            }
        }
コード例 #3
0
ファイル: LootHolder.cs プロジェクト: sebulba69/AscendedRPG
 public List <Loot> FilterLoot(int rarity)
 {
     try
     {
         return(EnemyLoot.FindAll(l => l.Rarity == rarity));
     }
     catch (NullReferenceException)
     {
         return(null);
     }
 }
コード例 #4
0
        /// <summary>
        /// Add an item to a enemy's loot
        /// </summary>
        /// <param name="enemyId">Id of enemy</param>
        /// <param name="itemId">Id of item</param>
        /// <returns>Successful result of item addition</returns>
        public async Task AddItemToLoot(int enemyId, int itemId)
        {
            EnemyLoot loot = new EnemyLoot()
            {
                EnemyId = enemyId,
                ItemId  = itemId
            };

            _context.Entry(loot).State = EntityState.Added;
            await _context.SaveChangesAsync();
        }
コード例 #5
0
    void EnemyDifficultyWithLevel()
    {
        //this.level = GameObject.FindObjectOfType<PlayerAttribute>().Level;
        this.life.Max = (this.level * 10 * this.level) + 30;

        this.damage.Initialize((int)(this.level * this.level * 2f) + 15, (int)(this.level * this.level * 3f) + 18);
        this.moveSpeed += this.level * 2;
        this.attributes[((int)e_entityAttribute.Attack_Speed_Percent)] = 1f - this.level * 0.005f;
        this.attributes[(int)(e_entityAttribute.Range)] = 2f;

        this.enemyLoot = new EnemyLoot <TModuleType>();
        //this.enemyLoot.Initialize(this, this.trans);
    }