示例#1
0
    protected override void DropLoot(IInventoryHolder target, float dropModifier)
    {
        base.DropLoot(target, dropModifier);

        for (int i = 0; i < DefaultInventory.Size; i++)
        {
            ItemStack stack = DefaultInventory.ItemStacks[i];
            for (int j = 0; j < stack.Amount; j++)
            {
                PartGen.DropResource(target,
                                     transform.position, stack.ItemType);
            }
        }
    }
示例#2
0
    private void CreateDebris(Vector2 pos)
    {
        if (!IsInViewRange || Pause.IsStopped)
        {
            return;
        }

        if (!PartGen)
        {
            return;
        }

        int randomChoose = Random.Range(0, debrisSprites.Count);

        PartGen.GenerateParticle(
            debrisSprites[randomChoose], pos, speed: Random.value * 3f, slowDown: true, lifeTime: 1.5f,
            rotationDeg: Random.value * 360f, rotationSpeed: Random.value * 3f,
            sortingLayer: sprRend.sortingLayerID, sortingOrder: debrisSortingOrder);
    }
示例#3
0
    protected override void DropLoot(IInventoryHolder target, float dropModifier)
    {
        base.DropLoot(target, dropModifier);

        if (FirstQuestScriptedDrops.scriptedDropsActive)
        {
            List <ItemStack> stacks = FirstQuestScriptedDrops.GetScriptedDrop(target);
            if (stacks != null)
            {
                for (int i = 0; i < stacks.Count; i++)
                {
                    ItemStack stack = stacks[i];
                    for (int j = 0; j < stack.Amount; j++)
                    {
                        PartGen.DropResource(target,
                                             transform.position, stack.ItemType);
                    }
                }
                return;
            }
        }
    }
示例#4
0
    private void CreateDust(Vector2 pos, float alpha = 0.1f)
    {
        if (!IsInViewRange || Pause.IsStopped)
        {
            return;
        }

        if (PartGen == null)
        {
            return;
        }

        int randomChoose = Random.Range(0, dustSprites.Count);

        PartGen.GenerateParticle(
            dustSprites[randomChoose], pos, speed: Random.value * 0.5f, slowDown: true,
            lifeTime: Random.value * 3f + 2f, rotationDeg: Random.value * 360f,
            rotationSpeed: Random.value * 0.5f,
            size: 0.3f + Mathf.Pow(Random.value, 2f) * 0.7f, alpha: alpha,
            fadeIn: Random.value + 0.5f, sortingLayer: sprRend.sortingLayerID,
            growthOverLifetime: 2f, sortingOrder: dustSortingOrder);
    }