예제 #1
0
    public override bool Activate(WorldThing worldThing)
    {
        if (CanActivateWith(worldThing))
        {
            switch (worldThing.type)
            {
            case WorldThing.Type.Field:
                if (full)
                {
                    full = false;
                    worldThing.Absorb(WorldThing.Resource.Water);
                }

                break;

            case WorldThing.Type.Fire:
                if (full)
                {
                    full = false;
                    worldThing.Absorb(WorldThing.Resource.Water);
                }

                break;

            case WorldThing.Type.River:
                full = true;
                break;

            default:
                break;
            }
        }

        return(false); // not exhausted
    }
예제 #2
0
    public virtual bool CanActivateWith(WorldThing worldThing)
    {
        foreach (var WT_Type in Safe_WT_Types)
        {
            if (worldThing.type == WT_Type)
            {
                return(true);
            }
        }

        return(false);
    }
예제 #3
0
    private void OnTriggerExit2D(Collider2D other)
    {
        if (other.GetComponent <WorldThing>() != null)
        {
            worldThingInfocus.Highlight(false);
            worldThingInfocus = worldNothing;
        }

        if (other.GetComponent <ItemController>() != null)
        {
            AvailableItems.Remove(other.GetComponent <ItemController>());
            AvailableItems.TrimExcess();
        }
        // Debug.Log("There are " + AvailableItems.Count + " items available.");
    }
예제 #4
0
    public override bool Activate(WorldThing worldThing)
    {
        if (CanActivateWith(worldThing))
        {
            switch (worldThing.type)
            {
            case WorldThing.Type.Buyer:
                worldThing.Absorb(WorldThing.Resource.Plant);
                return(true);

            default:
                break;
            }
        }

        return(false);
    }
예제 #5
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent <WorldThing>() != null)
        {
            worldThingInfocus = other.GetComponent <WorldThing>();
            if (EquippedItem)
            {
                worldThingInfocus.Highlight(EquippedItem.CanActivateWith(worldThingInfocus));
            }
        }

        if (other.GetComponent <ItemController>() != null)
        {
            SafeAdd(other.GetComponent <ItemController>());
        }
        // Debug.Log("There are " + AvailableItems.Count + " items available.");
    }
예제 #6
0
    public override bool Activate(WorldThing worldThing)
    {
        if (CanActivateWith(worldThing))
        {
            switch (worldThing.type)
            {
            case WorldThing.Type.Field:
                worldThing.Absorb(WorldThing.Resource.ClassicalMusic);
                return(false);

            default:
                break;
            }
        }

        return(false);
    }
예제 #7
0
    public override bool Activate(WorldThing worldThing)
    {
        if (CanActivateWith(worldThing))
        {
            switch (worldThing.type)
            {
            case WorldThing.Type.Field:
                worldThing.Absorb(WorldThing.Resource.Seeds);
                return(true);

            case WorldThing.Type.Fire:
                return(true);    // destroyed you idiot

            default:
                break;
            }
        }

        return(false); // not exhausted
    }
예제 #8
0
 private void Start()
 {
     worldThingInfocus = worldNothing;
     _as = this.GetComponent <AudioSource>();
 }
예제 #9
0
 public virtual bool Activate(WorldThing worldThing)
 {
     // ... do your thang
     return(false); // Not exhausted
 }