30 lines
997 B
C#
30 lines
997 B
C#
|
|
using Godot;
|
||
|
|
using Theriapolis.Core;
|
||
|
|
using Theriapolis.Core.Rules.Character;
|
||
|
|
|
||
|
|
namespace Theriapolis.GodotHost.Rendering;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// NPC marker — small dot tinted by allegiance. M7.2 stand-in for the
|
||
|
|
/// MonoGame NpcSprite (which adds walking-cycle animation). Counter-scaled
|
||
|
|
/// with zoom by the owner so the on-screen size stays constant.
|
||
|
|
/// </summary>
|
||
|
|
public partial class NpcMarker : Node2D
|
||
|
|
{
|
||
|
|
private const float RadiusWorldPx = C.PLAYER_MARKER_SCREEN_PX * 0.4f;
|
||
|
|
|
||
|
|
public Allegiance Allegiance { get; set; } = Allegiance.Neutral;
|
||
|
|
|
||
|
|
public override void _Draw()
|
||
|
|
{
|
||
|
|
var fill = Allegiance switch
|
||
|
|
{
|
||
|
|
Allegiance.Hostile => new Color(0.78f, 0.18f, 0.20f),
|
||
|
|
Allegiance.Friendly => new Color(0.45f, 0.78f, 0.38f),
|
||
|
|
_ => new Color(0.70f, 0.70f, 0.68f),
|
||
|
|
};
|
||
|
|
DrawCircle(Vector2.Zero, RadiusWorldPx, new Color(0, 0, 0, 0.78f));
|
||
|
|
DrawCircle(Vector2.Zero, RadiusWorldPx * 0.80f, fill);
|
||
|
|
}
|
||
|
|
}
|