yuanshen/Yuanshen.Gameserver/Game/GameWeapon.cs
wisedev 61cc2055cf First working version of the server
KCP gameserver with packet dispatch, scene streaming, combat, gacha and the
shop, plus a small HTTP server for the login flow and the wish history page.

Game data under assets is pulled out of the client instead of being typed by
hand. The excel tables come from the packed bin container and the spawn points
from the compiled scene scripts.
2026-09-04 02:06:53 +03:00

47 lines
1.1 KiB
C#

using Yuanshen.Protocol;
namespace Yuanshen.Gameserver.Game;
internal sealed class GameWeapon
{
public uint ItemId { get; }
public ulong Guid { get; }
public uint Level { get; set; } = 90;
public uint PromoteLevel { get; set; } = 6;
public uint Refinement { get; set; }
public GameWeapon(uint itemId, ulong guid)
{
ItemId = itemId;
Guid = guid;
}
public Item AsItem() => new()
{
ItemId = ItemId,
Guid = Guid,
Equip = new Equip
{
Weapon = new Weapon { Level = Level, PromoteLevel = PromoteLevel }
}
};
public SceneWeaponInfo AsSceneWeapon(uint entityId)
{
SceneWeaponInfo weapon = new()
{
EntityId = entityId,
GadgetId = 50000000 + ItemId,
ItemId = ItemId,
Guid = Guid,
Level = Level,
PromoteLevel = PromoteLevel,
AbilityInfo = new AbilitySyncStateInfo { IsInited = true }
};
if (Refinement > 0)
weapon.AffixMap.Add(111000 + ItemId % 1000, Math.Min(Refinement, 4u));
return weapon;
}
}