25 lines
828 B
C#
25 lines
828 B
C#
using RebootKit.Engine.Main;
|
|
using RebootKit.Engine.Simulation;
|
|
using RebootReality.jelycho.Main;
|
|
using RebootReality.jelycho.Player;
|
|
using UnityEngine;
|
|
|
|
namespace RebootReality.jelycho.Items {
|
|
public class ItemQuickAttackAction : IItemQuickAttackAction {
|
|
public void Attack(Actor attacker, ItemActor itemActor) {
|
|
if (RR.World.Context is not WorldContext worldContext) {
|
|
return;
|
|
}
|
|
|
|
var playerActor = attacker as PlayerActor;
|
|
if (playerActor == null) {
|
|
return;
|
|
}
|
|
|
|
Vector3 attackPosition = playerActor.GetAttackPosition();
|
|
float attackRadius = 0.5f;
|
|
|
|
worldContext.HitboxManager.HitSphere(attackPosition, attackRadius, attacker, itemActor.Config.baseDamage);
|
|
}
|
|
}
|
|
} |