public virtual bool Deal(float amount)
    {
        points.Set(type, points.Get(type) + amount * modifier);

        if (effect != null)
        {
            Instantiate(effect, transform.position, Quaternion.identity);
        }

        return(true);
    }
    public void AButtheadWith__HpIsNearby(float hp)
    {
        butthead = new GameObject();
        butthead.transform.Require <BoxCollider>().isTrigger = true;
        butthead.transform.Require <Rigidbody>().isKinematic = true;
        butthead.transform.position = transform.position + Vector3.left * 5;

        HasPoints buttheadPoints = butthead.transform.Require <HasPoints>();

        buttheadPoints.Set("hp", hp);

        ReceivesPointsFromSource modifier = butthead.transform.Require <ReceivesPointsFromSource>();

        modifier.type     = "hp";
        modifier.source   = "damage";
        modifier.modifier = -1;
    }
예제 #3
0
 public void ItHas____(float amount, string type)
 {
     it = transform.Require <HasPoints>();
     it.Set(type, amount);
 }
예제 #4
0
 public void ItHas__Unsavable__Points(float amount, string type)
 {
     it = it ?? transform.Require <HasPoints>();
     it.Set(type, amount);
     it.SetSavable(type, false);
 }
예제 #5
0
 public void HeHas____Points(float amount, string type)
 {
     points = transform.Require <HasPoints>();
     points.Set(type, amount);
 }