asset modified

This commit is contained in:
2026-09-25 06:27:30 +09:00
parent 0aba40db2b
commit 84dd12414a
626 changed files with 86385 additions and 112 deletions
@@ -91,6 +91,18 @@ namespace BumpCombat.Constants
[Min(0f)] public float SeismicStunSeconds = 0.45f;
[Min(0.1f)] public float SeismicRadius = 1.4f;
[Min(0.1f)] public float SupportRadius = 3.5f;
[Range(0f, 1f)] public float SupportRangeAlpha = 0.4f;
// Alpha bounds in the 100x100 source cells, top-left origin, by frame.
public static readonly RectInt[] SupportRangeAlphaBounds =
{
new(35, 54, 30, 15), new(34, 54, 31, 16), new(34, 54, 32, 16),
new(35, 54, 30, 15), new(34, 54, 31, 16), new(34, 54, 32, 16),
};
public Color[] SupportTierColors =
{
new(151, 169, 119, 102), new(153, 183, 108, 148),
new(158, 201, 96, 194), new(170, 218, 103, 242),
};
[Min(0f)] public float SupportDamageBonusPerTier = 0.1f;
[Min(0f)] public float SmotheringDamageBonus = 0.3f;
[Range(0.1f, 1f)] public float ImbuingAttackIntervalMultiplier = 0.75f;
@@ -1,4 +1,7 @@
using System.Collections.Generic;
using BumpCombat.Defense;
using BumpCombat.Enemies;
using UnityEngine;
namespace BumpCombat.Defense
{
internal static class DefenseTowerArtDurations
@@ -113,6 +116,7 @@ namespace BumpCombat.Defense
["Effects/Support/T1-Aura"] = new[] { 140, 140, 140, 140, 140, 140 },
["Effects/Support/T2-Aura"] = new[] { 140, 140, 140, 140, 140, 140 },
["Effects/Support/T3-Aura"] = new[] { 140, 140, 140, 140, 140, 140 },
["SupportRange/T1-Aura"] = new[] { 140, 140, 140, 140, 140, 140 },
["Effects/Control/StoneGaze"] = new[] { 90, 90, 90, 90, 90, 90, 90, 90 },
["Effects/Control/Temporal"] = new[] { 170, 170, 170, 170, 170, 170, 170, 170 },
["Effects/Support/Imbuing"] = new[] { 130, 130, 130, 130, 130, 130, 130, 130 },
@@ -157,3 +161,70 @@ namespace BumpCombat.Defense
}
}
}
namespace BumpCombat.Constants
{
/// <summary>Offline pixel measurements for non-readable defense art and original shadows.</summary>
public static class DefenseTowerArtBounds
{
private static readonly Vector2Int[] LightningBeamBounds =
{
new(8, 56), new(8, 89), new(8, 89), new(8, 89),
new(8, 89), new(8, 89), new(24, 89), new(24, 89),
};
private static readonly Vector2[] ImpactWaveCenters =
{
new(50f, 39.5f), new(50f, 40f), new(50f, 40.5f),
new(49.5f, 40f), new(50.5f, 40f),
};
public static Vector2Int LightningBeamXBounds(int frame) =>
LightningBeamBounds[Mathf.Clamp(frame, 0, LightningBeamBounds.Length - 1)];
public static Vector2 ImpactWaveCenterPixels(int frame, Sprite sprite)
{
return frame >= ImpactWaveCenters.Length
? sprite.pivot
: ImpactWaveCenters[Mathf.Clamp(frame, 0, ImpactWaveCenters.Length - 1)];
}
public static Vector2 CharacterShadowOffset(DefenseTowerKind kind, bool flipX = false)
{
Vector2 shadowPixelCenter = kind switch
{
DefenseTowerKind.Summon => new Vector2(50.5f, 42.5f),
DefenseTowerKind.Seismic or DefenseTowerKind.Empowering => new Vector2(50.5f, 42f),
_ => new Vector2(50.5f, 42.5f),
};
Vector2 localPixels = shadowPixelCenter - new Vector2(50f, 50f);
if (flipX) localPixels.x = -localPixels.x;
return Vector2.Scale(localPixels / 32f, new Vector2(2.1f, 2.1f));
}
public static Vector2 EnemyShadowOffsetWorld(EnemyController enemy)
{
if (enemy == null) return Vector2.zero;
SpriteRenderer renderer = enemy.GetComponent<SpriteRenderer>();
Sprite sprite = renderer != null ? renderer.sprite : null;
if (sprite == null || enemy.Definition == null) return Vector2.zero;
Vector2 pixelCenter = EnemyShadowCenterPixels(enemy.Definition.Kind);
Vector2 localOffset = (pixelCenter - sprite.pivot) / sprite.pixelsPerUnit;
if (renderer.flipX) localOffset.x = -localOffset.x;
return renderer.transform.TransformVector(localOffset);
}
public static Vector2 EnemyShadowWorldPosition(EnemyController enemy, Vector2 fallback) =>
enemy != null ? (Vector2)enemy.transform.position + EnemyShadowOffsetWorld(enemy) : fallback;
private static Vector2 EnemyShadowCenterPixels(EnemyKind kind) => kind switch
{
EnemyKind.Slime => new Vector2(48.5f, 42f),
EnemyKind.Lancer => new Vector2(51f, 42.5f),
EnemyKind.Necrofire => new Vector2(52.5f, 42.5f),
EnemyKind.NecroGolem => new Vector2(51.5f, 42.5f),
EnemyKind.Werebear => new Vector2(51.5f, 42.5f),
EnemyKind.Werewolf => new Vector2(50.5f, 42f),
_ => new Vector2(50.5f, 42.5f),
};
}
}