Ejemplo n.º 1
0
 private bool RetrieveSubstanceOnRect(PlayerSubstanceColliderType colliderType, BoxCollider2D collider)
 {
     SubstanceManager.RetrieveSubstances(
         collider,
         parent.SubstanceSet,
         new PlayerSubstanceFilter {
         ColliderType = colliderType
     },
         groundLayers,
         out bool touch);
     return(touch);
 }
Ejemplo n.º 2
0
 private bool RetrieveSubstanceOnRect(PlayerSubstanceColliderType colliderType, Rect localRect, bool noTouchOnTriggers = false)
 {
     SubstanceManager.RetrieveSubstances(
         localRect.LocalToWorldRect(transform),
         parent.SubstanceSet,
         new PlayerSubstanceFilter {
         ColliderType = colliderType
     },
         groundLayers,
         out bool touch,
         noTouchOnTriggers);
     return(touch);
 }
Ejemplo n.º 3
0
 private bool RetrieveSubstancePreview(Matrix4x4 trs, SubstanceSet subSet, PlayerSubstanceColliderType colliderType, Rect localRect, bool noTouchOnTriggers = false)
 {
     SubstanceManager.RetrieveSubstances(
         trs.Multiply(localRect),
         subSet,
         new PlayerSubstanceFilter {
         ColliderType = colliderType
     },
         groundLayers,
         out bool touch,
         noTouchOnTriggers);
     return(touch);
 }
Ejemplo n.º 4
0
    /// <summary>
    /// Deal damage to this entity. Returns remaining health
    /// </summary>
    /// <param name="demageDelt">The amount of damage the attack delt this entity. Must be positive</param>
    ///

    //Sebi du hund, wenn du die funktion ersetzt dann lösch sie oder schreib n comment, aber lass sie nich einfach stehn als würde sie benutzt

    //public float Damage(float damageDelt)
    //{
    //    if (damageDelt < 0)
    //        return Health;

    //    if (damageDelt >= Health)
    //        return Health = 0;

    //    return (Health -= damageDelt);
    //}

    /// <summary>
    /// Deal damage to this entity. Returns whether the attack delt damage
    /// </summary>
    /// <param name="damageToDeal">The amount of damage the attack delt this entity. Must be positive</param>
    public bool TryToDamage(float damageToDeal, Substance attackedSubstance = Substance.none_physical)
    {
        if (infusedSubstance == Substance.none_physical)
        {
            infusedSubstance = attackedSubstance;
        }
        else if (infusedSubstance != attackedSubstance)  // if the substances are the same, nothing has to be done
        {
            SubstanceManager.ReactSubstances(UseInfusedSubstance, attackedSubstance, transform);
        }

        if (damageToDeal < 0)
        {
            return(false);
        }



        float remainingDamageToDeal = damageToDeal;

        for (int index = 0; index < interruptActions.Count; index++)
        {
            //Debug.Log("start block");
            interruptActions[index](ref remainingDamageToDeal);
            if (remainingDamageToDeal <= 0)
            {
                return(false);
            }
        }

        if (remainingDamageToDeal >= Health)
        {
            Health = 0;
            remainingDamageToDeal = 0;
        }

        Health -= remainingDamageToDeal;
        return(true);
    }
Ejemplo n.º 5
0
 public SubstancesService()
 {
     _substances = new SubstanceManager();
     _elements   = new ElementManager();
 }
Ejemplo n.º 6
0
 public ChemIndexSpider()
 {
     _substances = new SubstanceManager();
 }
Ejemplo n.º 7
0
 public CharChemSubstSpider()
 {
     _substances = new SubstanceManager();
     _categories = new CategoryManager(_substances.GetContext());
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     inst     = this;
     Effected = Global.GetSelectedEntries(effected);
 }