something is no yes
This commit is contained in:
@@ -9,8 +9,6 @@ namespace RebootReality.jelycho.Items {
|
||||
static readonly Logger s_Logger = new Logger(nameof(ItemActor));
|
||||
|
||||
class ItemActorData : IActorData {
|
||||
public ItemConfig Config;
|
||||
|
||||
public void Serialize(NetworkBufferWriter writer) { }
|
||||
public void Deserialize(NetworkBufferReader reader) { }
|
||||
|
||||
@@ -33,9 +31,7 @@ namespace RebootReality.jelycho.Items {
|
||||
// @MARK: Actor
|
||||
//
|
||||
protected override IActorData CreateActorData() {
|
||||
return new ItemActorData {
|
||||
Config = Config
|
||||
};
|
||||
return new ItemActorData { };
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace RebootReality.jelycho.Items {
|
||||
public class ItemConfig {
|
||||
public Sprite icon;
|
||||
|
||||
[Header("Stats")]
|
||||
public ulong baseDamage = 10;
|
||||
|
||||
[Header("Mounting")]
|
||||
[MaxLength(32)] public string characterEquippedMountSlotName = "hand_right";
|
||||
|
||||
|
||||
@@ -1,31 +1,24 @@
|
||||
using RebootKit.Engine.Simulation;
|
||||
using RebootReality.jelycho.Enemies;
|
||||
using RebootKit.Engine.Main;
|
||||
using RebootKit.Engine.Simulation;
|
||||
using RebootReality.jelycho.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RebootReality.jelycho.Items {
|
||||
public class ItemQuickAttackAction : IItemQuickAttackAction {
|
||||
static readonly Collider[] s_CollidersBuffer = new Collider[512];
|
||||
|
||||
public void Attack(Actor attacker, ItemActor itemActor) {
|
||||
if (RR.World.Context is not WorldContext worldContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerActor playerActor = attacker as PlayerActor;
|
||||
if (playerActor == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 attackPosition = playerActor.GetAttackPosition();
|
||||
float attackRadius = 1.0f;
|
||||
|
||||
int count = Physics.OverlapSphereNonAlloc(attackPosition, 3.0f, s_CollidersBuffer);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
if (s_CollidersBuffer[i].TryGetComponent(out IKillable killable)) {
|
||||
Actor killableActor = killable as Actor;
|
||||
if (killableActor == attacker) {
|
||||
continue;
|
||||
}
|
||||
|
||||
playerActor.DealDamage(killable);
|
||||
}
|
||||
}
|
||||
worldContext.HitboxManager.HitSphere(attackPosition, attackRadius, attacker, itemActor.Config.baseDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user