XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

DeathMod

【Terraria】DeathMod (now aka Soul Harvest)

公开
关注 0 Fork 0 Star 0
UTF-8
using Microsoft.Xna.Framework;
using Terraria;

namespace SoulHarvest.Common;

/// <summary>
/// Shared, deterministic geometry and timing for the Death Reaper ultimate.
/// Combat, persistent world cuts and the final mirror shatter must all consume
/// these values so the screen can only break along cuts that actually happened.
/// </summary>
internal static class ReaperDeathUltimateGeometry
{
    internal const int CutCount = 18;
    internal const int FirstCutTick = 20;
    internal const int CutInterval = 6;
    internal const int ShatterTick = 172;
    internal const int Duration = 190;
    internal const float CutLength = 5200f;
    internal const float CutCollisionWidth = 11f;
    internal const float CutVisualWidth = 60f;

    internal static int GetCutTick(int cutIndex)
        => FirstCutTick + cutIndex * CutInterval;

    internal static Vector2 GetCutAxis(int actionId, int cutIndex)
    {
        uint hash = unchecked((uint)(actionId * 747796405
            + cutIndex * 2891336453));
        hash ^= hash >> 16;
        hash *= 0x7FEB352Du;
        hash ^= hash >> 15;
        float angle = (hash & 0x00FFFFFFu) / 16777215f
            * MathHelper.Pi - MathHelper.PiOver2;
        return angle.ToRotationVector2();
    }
}