コード例 #1
0
    public vMeleeWeapon CurrentMeleeAttack(HitboxFrom hitboxFrom = HitboxFrom.RightArm)
    {
        switch (hitboxFrom)
        {
        case HitboxFrom.LeftArm:
            if (currentMeleeWeaponLA != null && (currentMeleeWeaponLA.meleeType == vMeleeWeapon.MeleeType.Attack || currentMeleeWeaponLA.meleeType == vMeleeWeapon.MeleeType.All))
            {
                return(currentMeleeWeaponLA);
            }
            if (leftArmHitbox != null && useDefaultHitbox)
            {
                return(leftArmHitbox);
            }
            break;

        case HitboxFrom.RightArm:
            if (currentMeleeWeaponRA != null && (currentMeleeWeaponRA.meleeType == vMeleeWeapon.MeleeType.Attack || currentMeleeWeaponRA.meleeType == vMeleeWeapon.MeleeType.All))
            {
                return(currentMeleeWeaponRA);
            }
            if (rightArmHitbox != null && useDefaultHitbox)
            {
                return(rightArmHitbox);
            }
            break;

        case HitboxFrom.BothArms:
            if (currentMeleeWeaponRA != null && (currentMeleeWeaponRA.meleeType == vMeleeWeapon.MeleeType.Attack || currentMeleeWeaponRA.meleeType == vMeleeWeapon.MeleeType.All))
            {
                return(currentMeleeWeaponRA);
            }
            if (rightArmHitbox != null && useDefaultHitbox)
            {
                return(rightArmHitbox);
            }
            break;

        case HitboxFrom.LeftLeg:
            if (leftLegHitbox != null)
            {
                return(leftLegHitbox);
            }
            break;

        case HitboxFrom.RightLeg:
            if (rightLegHitbox != null && useDefaultHitbox)
            {
                return(rightLegHitbox);
            }
            break;

        case HitboxFrom.BothLegs:
            if (rightLegHitbox != null && useDefaultHitbox)
            {
                return(rightLegHitbox);
            }
            break;
        }
        return(null);
    }
コード例 #2
0
    public void EnableDamage(AttackObject attackObject)
    {
        if (CurrentMeleeAttack(attackObject.hitboxFrom) == null)
        {
            return;
        }

        currentHitboxFrom = attackObject.hitboxFrom;
        applyDamage       = attackObject.value;
        var meleeWeapon = CurrentMeleeAttack(attackObject.hitboxFrom);

        meleeWeapon.SetActiveWeapon(attackObject.value);
        meleeWeapon.damage.recoil_id = attackObject.recoil_ID;
        attackName = attackObject.attackName;
        if (!applyDamage)
        {
            currentDamageMultiplier = 0;
        }
        else
        {
            currentHitboxFrom       = attackObject.hitboxFrom;
            currentDamageMultiplier = attackObject.damageMultiplier;
            attackName = attackObject.attackName;
        }
    }
コード例 #3
0
 public AttackObject(HitboxFrom hitboxFrom, int recoil_ID, float damageMultiplier, bool value, string attackName = "")
 {
     this.hitboxFrom       = hitboxFrom;
     this.recoil_ID        = recoil_ID;
     this.value            = value;
     this.damageMultiplier = damageMultiplier;
     this.attackName       = attackName;
 }
コード例 #4
0
 public void OnAttackEnter(HitboxFrom hitboxFrom)
 {
     ReduceStamina(meleeManager.CurrentMeleeAttack(hitboxFrom).staminaCost);
     recoveryDelay = meleeManager.CurrentMeleeAttack(hitboxFrom).a_staminaRecoveryDelay;
 }