예제 #1
0
 // be attacked by the player
 public void damage(CastData data, int d, int element, ICaster caster, bool crit, bool reflect = false)
 {
     //Apply repel and return if applicable
     if (CasterOps.calcRepel(data, d, element, caster, this, crit, reflect))
     {
         return;
     }
     CasterOps.calcDamage(data, d, element, caster, this, crit, Is_stunned);
     //log stun stun actually happens in update condition
     data.isStun = curr_stagger <= 0 && is_stunned == false;
     //opacity and death are now updated in updateCondition()
     was_hit = true;
 }
예제 #2
0
파일: Ally.cs 프로젝트: atrus159/typocrypha
 public void damage(CastData data, int d, int element, ICaster caster, bool crit, bool reflect = false)
 {
     //Apply repel and return if applicable
     if (CasterOps.calcRepel(data, d, element, caster, this, crit, reflect))
     {
         return;
     }
     CasterOps.calcDamage(data, d, element, caster, this, crit);
     //Apply stun if applicable
     if (curr_stagger <= 0 && is_stunned == false)
     {
         data.isStun = true;
         stun();
     }
 }
예제 #3
0
    //ICaster interface overrides

    //Damage player
    public void damage(CastData data, int baseDmg, int element, ICaster caster, bool crit, bool reflect = false)
    {
        //Apply repel and return if applicable
        if (CasterOps.calcRepel(data, baseDmg, element, caster, this, crit, reflect))
        {
            return;
        }
        bool damaged = CasterOps.calcDamage(data, baseDmg, element, caster, this, crit);

        if (damaged && element != Elements.@null)
        {
            status_manager.inflictCondition(this, element, 0, data.damageInflicted);
        }
        if (Curr_hp <= 0)
        { // check if killed
            Debug.Log("Player" + " has been slain!");
            is_dead = true;
        }
        // return Is_dead;
    }