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 }
public virtual bool CanActivateWith(WorldThing worldThing) { foreach (var WT_Type in Safe_WT_Types) { if (worldThing.type == WT_Type) { return(true); } } return(false); }
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."); }
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); }
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."); }
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); }
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 }
private void Start() { worldThingInfocus = worldNothing; _as = this.GetComponent <AudioSource>(); }
public virtual bool Activate(WorldThing worldThing) { // ... do your thang return(false); // Not exhausted }