2.5d test
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System.Collections.Generic;
|
||||
using BumpCombat.Combat;
|
||||
using BumpCombat.Player;
|
||||
|
||||
namespace BumpCombat.Constants
|
||||
{
|
||||
/// <summary>Existing authored feedback timings and paths used by the 2.5D presentation.</summary>
|
||||
public static class Defense25DCombatFeedbackConstants
|
||||
{
|
||||
public const string ChargeResourceRoot = "Artifacts/ThreeColor-v1/Charge/";
|
||||
public const string ChargeAuraSuffix = "-Aura-v1";
|
||||
public const string ChargeReadyAuraSuffix = "-ReadyAura-v1";
|
||||
public const string ChargeFlashSuffix = "-Flash-v1";
|
||||
public const string ChargeReleaseSuffix = "-Release-v1";
|
||||
public const string BlockedBumpResource = "Combat/BlockedBump-Wizard-v1";
|
||||
public const float PulseGatherDuration = .1f;
|
||||
public const float InteractionStreakDuration = .11f;
|
||||
|
||||
public static IReadOnlyList<float> BumpFrames { get; } = new[]
|
||||
{
|
||||
CombatFeedback.GetBumpImpactFrameDuration(0),
|
||||
CombatFeedback.GetBumpImpactFrameDuration(1),
|
||||
CombatFeedback.GetBumpImpactFrameDuration(2),
|
||||
CombatFeedback.GetBumpImpactFrameDuration(3),
|
||||
};
|
||||
|
||||
public static IReadOnlyList<float> ArtifactFrames { get; } = new[]
|
||||
{
|
||||
CombatFeedback.GetArtifactImpactFrameDuration(0),
|
||||
CombatFeedback.GetArtifactImpactFrameDuration(1),
|
||||
CombatFeedback.GetArtifactImpactFrameDuration(2),
|
||||
CombatFeedback.GetArtifactImpactFrameDuration(3),
|
||||
};
|
||||
|
||||
public static IReadOnlyList<float> PlayerHurtFrames { get; } = new[]
|
||||
{
|
||||
CombatFeedback.GetPlayerHurtImpactFrameDuration(0),
|
||||
CombatFeedback.GetPlayerHurtImpactFrameDuration(1),
|
||||
CombatFeedback.GetPlayerHurtImpactFrameDuration(2),
|
||||
};
|
||||
|
||||
public static IReadOnlyList<float> ChargeAuraFrames { get; } = new[]
|
||||
{ .06f, .06f, .06f, .06f, .06f, .06f };
|
||||
public static IReadOnlyList<float> ChargeFlashFrames { get; } = new[]
|
||||
{ .03f, .04f, .04f, .03f };
|
||||
public static IReadOnlyList<float> ChargeReleaseFrames { get; } = new[]
|
||||
{ .03f, .04f, .04f, .04f, .04f, .05f };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2a7338f9d1144eb9ab4bc9b7d29c26f
|
||||
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BumpCombat.Constants
|
||||
{
|
||||
public static class Defense25DCombatPopupConstants
|
||||
{
|
||||
public const int MaximumConcurrentPopups = 12;
|
||||
public const float LifetimeSeconds = 0.6f;
|
||||
public const float RisePixelsAt1080p = 40f;
|
||||
public const float ReferenceScreenHeight = 1080f;
|
||||
public const float ReferenceInternalHeight = 360f;
|
||||
public const float FontPixelsAt1080p = 30f;
|
||||
public const float OutlinePixels = 1f;
|
||||
public const float PopupWidthInternal = 100f;
|
||||
public const float PopupHeightInternal = 20f;
|
||||
|
||||
public static readonly Color PlayerDamageColor =
|
||||
new(244f / 255f, 117f / 255f, 112f / 255f, 1f);
|
||||
public static readonly Color LaunchColor = new(0.95f, 0.55f, 1f);
|
||||
public static readonly Color BackHitColor = new(1f, 0.75f, 0.2f);
|
||||
public static readonly Color SideHitColor = new(0.65f, 1f, 0.3f);
|
||||
public static readonly Color OutlineColor = new(18f / 255f, 23f / 255f, 34f / 255f,
|
||||
230f / 255f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4bdb0ea9afc64f17a25d84d1cf8a7a31
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using BumpCombat.Defense;
|
||||
using BumpCombat.Enemies;
|
||||
using BumpCombat.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BumpCombat.Constants
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class ComparisonSpriteFrames
|
||||
{
|
||||
public Sprite[] Idle = Array.Empty<Sprite>();
|
||||
public Sprite[] Walk = Array.Empty<Sprite>();
|
||||
public Sprite[] Attack = Array.Empty<Sprite>();
|
||||
public Sprite[] Hurt = Array.Empty<Sprite>();
|
||||
public Sprite[] Death = Array.Empty<Sprite>();
|
||||
}
|
||||
|
||||
[CreateAssetMenu(menuName = "BumpCombat/Constants/Defense 2.5D Comparison")]
|
||||
public sealed class Defense25DComparisonSettings : ScriptableObject
|
||||
{
|
||||
public const float SummonBodyPixelsPerUnit = 32f;
|
||||
public const float SlimeBodyCoreDiameterPixels = 11f;
|
||||
public const float GiantSlimeBodyCoreDiameterPixels = 22f;
|
||||
public const float LavaSlimeBodyCoreDiameterPixels = 13f;
|
||||
public static readonly Vector2 SlimeBodyCenterFromFootPixels = new(-1.5f, 7.5f);
|
||||
public static readonly Vector2 GiantSlimeBodyCenterFromFootPixels = new(-3f, 17f);
|
||||
public static readonly Vector2 LavaSlimeBodyCenterFromFootPixels = new(-2f, 8.5f);
|
||||
|
||||
[Header("Independent comparison layout; not final balance")]
|
||||
public float GroundY;
|
||||
public Vector2 MapHalfExtents = new(10.5f, 5.5f);
|
||||
public Vector2 PlayerSpawn = new(-5f, -2f);
|
||||
public Vector2 TowerPosition = new(1f, 1.8f);
|
||||
public Vector2[] Route = { new(-9f, 0f), new(-4f, 0f), new(-2f, 2.4f), new(4f, 2.4f), new(9f, 0f) };
|
||||
public Vector2[] SummonSlots = { new(-.6f, -.9f), new(.6f, -.9f) };
|
||||
public DefenseTowerKind PortalImmunity = DefenseTowerKind.Direct;
|
||||
public float CameraPitch = 50f;
|
||||
public float CameraSize = 6.5f;
|
||||
[Range(.1f, 1f)] public float SouthBoundaryRenderHeightFraction = .4f;
|
||||
|
||||
[Header("XZ footprints baked from existing prefab XY colliders")]
|
||||
public float PlayerRadius = .275f;
|
||||
public Vector2 PlayerColliderOffset = new(0f, -.075f);
|
||||
public float PlayerVisualScale = 1.25f;
|
||||
public float PlayerFootOffset = -7.5f / 32f * 1.25f;
|
||||
public float EnemyRadius = .275f;
|
||||
public Vector2 EnemyColliderOffset = new(0f, -.35f);
|
||||
public float EnemyVisualScale = 1.25f;
|
||||
public float EnemyFootOffset = -.4f;
|
||||
public float EnemyBodyCenterCorrectionPixels = 3f;
|
||||
public float SummonVisualScale = 1.1f;
|
||||
public float SummonFootOffset = -9f / 32f * 1.1f;
|
||||
public float ActorHeight = .85f;
|
||||
public float MovementSkin = .002f;
|
||||
public float ContactSensorMargin = .025f;
|
||||
|
||||
// Unnamed, otherwise unused layers in the baseline project; no TagManager edits.
|
||||
public const int TerrainLayer = 9;
|
||||
public const int ActorLayer = 10;
|
||||
public const int TerrainMask = 1 << TerrainLayer;
|
||||
public const int ActorMask = 1 << ActorLayer;
|
||||
|
||||
[Header("Existing definitions and art; originals are not edited")]
|
||||
public EnemyDefinition Enemy;
|
||||
public AnimationClip EnemyAttackClip;
|
||||
public ActiveArtifactDefinition Cyclone;
|
||||
public ComparisonSpriteFrames PlayerArt = new();
|
||||
public ComparisonSpriteFrames EnemyArt = new();
|
||||
public Material CutoutMaterial;
|
||||
public Material TransparentMaterial;
|
||||
public Material GroundMaterial;
|
||||
public Material WallMaterial;
|
||||
public Material PathMaterial;
|
||||
public Material ShadowMaterial;
|
||||
public Material BaseMaterial;
|
||||
public Material BoundaryMaterial;
|
||||
public Material HitBoundaryMaterial;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5366a103ee5d47b79aa3feb1b3ca3f4d
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace BumpCombat.Constants
|
||||
{
|
||||
/// <summary>Sample cadence copied from the authored Swordsman animation clips.</summary>
|
||||
public static class Defense25DPlayerAnimationConstants
|
||||
{
|
||||
public const float IdleFrameSeconds = 1f / 8f;
|
||||
public const float WalkFrameSeconds = 1f / 10f;
|
||||
public const float HurtFrameSeconds = 1f / 10f;
|
||||
public const float DeathFrameSeconds = 1f / 8f;
|
||||
public const float DashFrameSeconds = 1f / 60f;
|
||||
public const float BumpFrameSeconds = 1f / 25f;
|
||||
public const float ArtifactUseFrameSeconds = 1f / 20f;
|
||||
public const float NonPlayerDeathFallbackDuration = 0.5f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ee47e8d5cf8ceb40bf54520dc0485a1
|
||||
@@ -72,12 +72,26 @@ namespace BumpCombat.Constants
|
||||
[Min(0.1f)] public float TowerRange = 5.5f;
|
||||
[Min(0.1f)] public float DirectTowerDamage = 10f;
|
||||
[Min(0.05f)] public float DirectTowerAttackInterval = 0.75f;
|
||||
[Min(0f)] public float FireT4BeamSecondTierSeconds = 1f;
|
||||
[Min(0f)] public float FireT4BeamMaximumTierSeconds = 2f;
|
||||
[Min(0f)] public float FireT4BeamBaseDamageMultiplier = 0.4f;
|
||||
[Min(1f)] public float FireT4BeamSecondTierMultiplier = 1.5f;
|
||||
[Min(1f)] public float FireT4BeamMaximumMultiplier = 2f;
|
||||
[Min(0f)] public float FireT4BeamResetAfterSeconds = 1f;
|
||||
[Min(1f)] public float FireT4BeamSecondTierWidthMultiplier = 1.5f;
|
||||
[Min(1f)] public float FireT4BeamMaximumWidthMultiplier = 2f;
|
||||
[Min(0.1f)] public float SummonDamage = 6f;
|
||||
[Min(0.05f)] public float SummonAttackInterval = 0.9f;
|
||||
[Min(1)] public int SummonUnitCount = 2;
|
||||
[Min(1f)] public float SummonUnitMaximumHealth = 30f;
|
||||
[Min(0.05f)] public float SummonUnitCollisionRadius = 0.32f;
|
||||
[Min(0f)] public float SummonUnitRespawnSeconds = 3f;
|
||||
[Min(0.1f)] public float SummonAreaRadius = 2.25f;
|
||||
[Min(0.1f)] public float SummonUnitMoveSpeed = 2.5f;
|
||||
[Min(0.1f)] public float SummonAttackRange = 1.2f;
|
||||
[Range(0, 5)] public int SummonBodySlamImpactFrame = 3;
|
||||
[Min(0f)] public float SummonBodySlamContactMargin = 0.06f;
|
||||
[Min(1f)] public float SummonBodySlamSpeedMultiplier = 2f;
|
||||
[Header("Six tower family comparison values")]
|
||||
[Min(0.1f)] public float LightningDamage = 6f;
|
||||
[Min(0.05f)] public float LightningInterval = 1.1f;
|
||||
@@ -86,6 +100,8 @@ namespace BumpCombat.Constants
|
||||
[Min(0.05f)] public float ColdInterval = 1.2f;
|
||||
[Min(0f)] public float ColdSlowFraction = 0.35f;
|
||||
[Min(0f)] public float ColdSlowSeconds = 1.5f;
|
||||
[Min(0.01f)] public float ColdProjectileBurstInterval = 0.12f;
|
||||
[Min(1)] public int FreezeboltProjectileCount = 5;
|
||||
[Min(0.1f)] public float SeismicDamage = 2f;
|
||||
[Min(0.05f)] public float SeismicInterval = 2f;
|
||||
[Min(0f)] public float SeismicStunSeconds = 0.45f;
|
||||
@@ -156,4 +172,41 @@ namespace BumpCombat.Constants
|
||||
: fallback;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DefenseTowerHitTestLayout
|
||||
{
|
||||
public static readonly DefenseTowerKind[] KindsByPad =
|
||||
{
|
||||
DefenseTowerKind.Direct,
|
||||
DefenseTowerKind.Summon,
|
||||
DefenseTowerKind.Cold,
|
||||
DefenseTowerKind.Lightning,
|
||||
DefenseTowerKind.Empowering,
|
||||
DefenseTowerKind.Seismic,
|
||||
};
|
||||
|
||||
public static readonly Vector2[] DummyPositionsByPad =
|
||||
{
|
||||
new(-2.25f, 2.95f),
|
||||
new(3.95f, -3.2f),
|
||||
new(-4.9f, -1.4f),
|
||||
new(4.9f, 1.4f),
|
||||
new(1f, 2.5f),
|
||||
new(0f, -1.4f),
|
||||
};
|
||||
|
||||
public static Vector2 GetDummyPosition(DefenseTowerKind kind)
|
||||
{
|
||||
for (int i = 0; i < KindsByPad.Length; i++)
|
||||
{
|
||||
if (KindsByPad[i] == kind)
|
||||
{
|
||||
return DummyPositionsByPad[i];
|
||||
}
|
||||
}
|
||||
|
||||
return Vector2.zero;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -96,11 +96,13 @@ namespace BumpCombat.Defense
|
||||
["Effects/Fire/Meteor-Impact"] = new[] { 40, 50, 60, 70, 60, 60, 60, 80 },
|
||||
["Sources/BlackKnight-NoSkull"] = new[] { 125, 125, 125, 125, 125, 125, 125 },
|
||||
["Effects/Fire/Flamethrower"] = new[] { 80, 80, 80, 70, 65, 65, 70 },
|
||||
["Effects/Fire/Eyeball Monster_Beam-Clean"] = new[] { 100, 100, 120 },
|
||||
["Effects/Lightning/T1-Bolt"] = new[] { 30, 40, 30, 30, 40, 40, 40, 50 },
|
||||
["Effects/Lightning/T2-Bolt"] = new[] { 30, 40, 30, 30, 40, 40, 40, 50 },
|
||||
["Effects/Lightning/T3-Bolt"] = new[] { 30, 40, 30, 30, 40, 40, 40, 50 },
|
||||
["Effects/Lightning/Arc"] = new[] { 30, 40, 30, 30, 40, 40, 40, 50 },
|
||||
["Effects/Lightning/ImpactWave"] = new[] { 40, 40, 50, 50, 60, 60 },
|
||||
["Effects/Ice/Blizzard-Wave-v1"] = new[] { 40, 40, 50, 50, 60, 60 },
|
||||
["Effects/Lightning/LightningStorm"] = new[] { 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 },
|
||||
["Effects/Ice/T1-Volley"] = new[] { 125 },
|
||||
["Effects/Ice/T2-Volley"] = new[] { 125 },
|
||||
@@ -167,6 +169,58 @@ namespace BumpCombat.Constants
|
||||
/// <summary>Offline pixel measurements for non-readable defense art and original shadows.</summary>
|
||||
public static class DefenseTowerArtBounds
|
||||
{
|
||||
public const float TowerBillboardScale = 0.72f * 2.1f;
|
||||
public static readonly Vector2 LightningStormGroundCenterPixels = new(61f, 34f);
|
||||
public const float LightningStormGroundRadiusPixels = 55.362442f;
|
||||
public const float SeismicGroundMarkerWidthPixels = 18f;
|
||||
public const int FireBeamStartX = 1;
|
||||
public const int FireBeamEndX = 99;
|
||||
public const float FireBeamCenterY = 49.5f;
|
||||
public const float FireBeamIgnitionSeconds = 0.1f;
|
||||
public const float FireBeamExtinguishSeconds = 0.12f;
|
||||
public const float FireT4BeamBaseWidthMultiplier = 1f;
|
||||
public static Vector2 StaffTipPixels(bool attack, int frame)
|
||||
{
|
||||
frame = Mathf.Clamp(frame, 0, 5);
|
||||
if (attack)
|
||||
{
|
||||
return frame switch
|
||||
{
|
||||
0 => new Vector2(56.5f, 44.5f),
|
||||
1 => new Vector2(57.5f, 43.5f),
|
||||
_ => new Vector2(58.5f, 42.5f),
|
||||
};
|
||||
}
|
||||
return frame < 2
|
||||
? new Vector2(56.5f, 44.5f)
|
||||
: new Vector2(56.5f, 43.5f);
|
||||
}
|
||||
public const int TowerHitSortingOffset = 102;
|
||||
public const int BlizzardShardCount = 8;
|
||||
public const float BlizzardLaunchIntervalSeconds = 0.04f;
|
||||
public const float BlizzardLandingSeconds = 0.24f;
|
||||
public const float BlizzardLastLandingSeconds = BlizzardLandingSeconds
|
||||
+ (BlizzardShardCount - 1) * BlizzardLaunchIntervalSeconds;
|
||||
public const float BlizzardLandingRadiusFraction = 0.65f;
|
||||
public const float BlizzardRangeAlpha = 0.15f;
|
||||
public const float BlizzardImpactRadiusAlpha = 0.18f;
|
||||
public const float BlizzardShardScale = 0.52f;
|
||||
public const float BlizzardTrailScale = 0.3f;
|
||||
public const float BlizzardTrailAlpha = 0.32f;
|
||||
public const float BlizzardTrailOffset = 0.12f;
|
||||
public const float BlizzardImpactScale = 0.16f;
|
||||
public const float BlizzardWaveScale = 0.7f;
|
||||
// Maximum visible half-extents measured from Blizzard-Wave-v1's alpha frames.
|
||||
public const float BlizzardWaveHalfWidthPixels = 22.5f;
|
||||
public const float BlizzardWaveHalfHeightPixels = 11f;
|
||||
public const float BlizzardWavePixelsPerUnit = 32f;
|
||||
public const float BlizzardWaveRadiusX = BlizzardWaveHalfWidthPixels
|
||||
/ BlizzardWavePixelsPerUnit * BlizzardWaveScale;
|
||||
public const float BlizzardWaveRadiusY = BlizzardWaveHalfHeightPixels
|
||||
/ BlizzardWavePixelsPerUnit * BlizzardWaveScale;
|
||||
public const float BlizzardDropHeight = 1.2f;
|
||||
public const float BlizzardDropHeightStep = 0.22f;
|
||||
|
||||
private static readonly Vector2Int[] LightningBeamBounds =
|
||||
{
|
||||
new(8, 56), new(8, 89), new(8, 89), new(8, 89),
|
||||
@@ -181,6 +235,14 @@ namespace BumpCombat.Constants
|
||||
public static Vector2Int LightningBeamXBounds(int frame) =>
|
||||
LightningBeamBounds[Mathf.Clamp(frame, 0, LightningBeamBounds.Length - 1)];
|
||||
|
||||
public static Vector2 BlizzardLandingOffset(int index, float radius)
|
||||
{
|
||||
float fraction = BlizzardLandingRadiusFraction
|
||||
* Mathf.Sqrt((index + 0.5f) / BlizzardShardCount);
|
||||
float angle = index * 2.39996323f;
|
||||
return radius * fraction * new Vector2(Mathf.Cos(angle), Mathf.Sin(angle));
|
||||
}
|
||||
|
||||
public static Vector2 ImpactWaveCenterPixels(int frame, Sprite sprite)
|
||||
{
|
||||
return frame >= ImpactWaveCenters.Length
|
||||
|
||||
Reference in New Issue
Block a user