コード例 #1
0
ファイル: ConstructionSite.cs プロジェクト: amrnator/Fortress
    // TODO glitch where progress ends at -1
    public override void Interact(DwarfControl entity)
    {
        base.Interact(entity);

        progress--;             // chip at progress

        if (progress <= 0)
        {
            //we done
            harvested = true;
            //idle entity
            entity.setTask("Idle", null);
        }
        else
        {
            // wait a bit before reseting hasInteracted
            StartCoroutine(pause(1.0f, entity));
        }

        if (progress == -1)
        {
            //make the building
            construct();
        }
    }
コード例 #2
0
ファイル: Stockpile.cs プロジェクト: amrnator/Fortress
    public override void Interact(DwarfControl entity)
    {
        Resource x = entity.carriedResource;

        resources.Add(entity.carriedResource);

        entity.carriedResource = null;

        print("Resource: " + x.resourceName + " added to stockpile");

        //idle entity
        entity.setTask("Idle", null);
    }
コード例 #3
0
    public override void Interact(DwarfControl entity)
    {
        base.Interact(entity);

        //give entity wood
        entity.CarryResource(resource);

        //send to stockpile
        entity.setTask("Deposit", null);

        quantity--;

        if (quantity <= 0)
        {
            harvested = true;
        }
    }