Souljack/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs

207 lines
8.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
namespace _Project.Scripts.PlayerUtils
{
public enum BodyClass
{
Spirit,
Scout,
Trooper,
Juggernaut,
Sniper
}
[CreateAssetMenu(menuName = "Player/Body Profile", fileName = "BodyProfile")]
public class BodyProfile : ScriptableObject
{
public BodyClass bodyClass = BodyClass.Trooper;
public string displayName = "Штурмовик";
public float maxHealth = 100f;
[Header("Передвижение (PlayerMovement)")]
public float moveSpeed = 6.5f;
public float sprintSpeed = 9.5f;
public float crouchSpeed = 3f;
public bool canSlide = true;
public float slideInitialSpeed = 15f;
public float slideDuration = 0.85f;
public float airAcceleration = 80f;
public float jumpHeight = 1.35f;
public float gravity = -25f;
public float standingHeight = 2f;
[Header("Камера и Звук (PlayerCamera & Sound)")]
public float standingCameraY = 1.6f;
public float crouchingCameraY = 0.8f;
public float walkBobSpeed = 12f;
public float walkBobAmount = 0.04f;
public float slideTiltAngle = 4f;
public float footstepPitch = 1f;
[Header("Оружие и Снаряды (PlayerCombat)")]
public bool canShoot = true;
public bool isAutomatic = true;
public float damage = 25f;
public float fireRate = 0.12f;
public float weaponRange = 100f;
public int pelletsPerShot = 1;
public float spreadAngle = 0f;
public bool pierceTargets = false;
public float recoilKick = 1.2f;
[Header("Параметры летящего снаряда")]
[Tooltip("Скорость полёта снаряда в м/с (чтобы от него можно было увернуться!)")]
public float projectileSpeed = 30f;
public float projectileSize = 0.22f;
public Color projectileColor = new Color(1f, 0.6f, 0.1f, 1f);
public static BodyProfile CreateDefault(BodyClass type)
{
var p = CreateInstance<BodyProfile>();
p.bodyClass = type;
switch (type)
{
case BodyClass.Spirit:
p.displayName = "ДУХ МЩЕНИЯ";
p.maxHealth = 25f;
p.moveSpeed = 11f;
p.sprintSpeed = 15f;
p.crouchSpeed = 6f;
p.canSlide = true;
p.slideInitialSpeed = 22f;
p.slideDuration = 1.1f;
p.airAcceleration = 160f;
p.jumpHeight = 1.8f;
p.gravity = -18f;
p.standingHeight = 1.6f;
p.standingCameraY = 1.3f;
p.walkBobAmount = 0.015f;
p.canShoot = false;
break;
case BodyClass.Scout:
p.displayName = "СКАУТ (Чистильщик)";
p.maxHealth = 70f;
p.moveSpeed = 9f;
p.sprintSpeed = 13f;
p.crouchSpeed = 4.5f;
p.canSlide = true;
p.slideInitialSpeed = 20f;
p.slideDuration = 1.15f;
p.airAcceleration = 140f;
p.jumpHeight = 1.65f;
p.gravity = -24f;
p.standingHeight = 1.8f;
p.standingCameraY = 1.5f;
p.walkBobSpeed = 15f;
p.walkBobAmount = 0.05f;
p.slideTiltAngle = 7f;
p.footstepPitch = 1.2f;
p.canShoot = true;
p.isAutomatic = true;
p.damage = 14f;
p.fireRate = 0.08f;
p.weaponRange = 45f;
p.pelletsPerShot = 1;
p.spreadAngle = 2.5f;
p.recoilKick = 0.6f;
p.projectileSpeed = 36f; // Жёлтые быстрые очереди
p.projectileSize = 0.16f;
p.projectileColor = new Color(1f, 0.9f, 0.2f, 1f);
break;
case BodyClass.Trooper:
p.displayName = "ШТУРМОВИК СБ";
p.maxHealth = 120f;
p.moveSpeed = 6.5f;
p.sprintSpeed = 9.5f;
p.crouchSpeed = 3f;
p.canSlide = true;
p.slideInitialSpeed = 15f;
p.slideDuration = 0.85f;
p.airAcceleration = 80f;
p.jumpHeight = 1.35f;
p.gravity = -25f;
p.standingHeight = 2f;
p.standingCameraY = 1.6f;
p.walkBobSpeed = 12f;
p.walkBobAmount = 0.04f;
p.footstepPitch = 1f;
p.canShoot = true;
p.isAutomatic = true;
p.damage = 25f;
p.fireRate = 0.14f;
p.weaponRange = 90f;
p.pelletsPerShot = 1;
p.spreadAngle = 1.2f;
p.recoilKick = 1.1f;
p.projectileSpeed = 28f; // Голубые плазменные сгустки средней скорости
p.projectileSize = 0.22f;
p.projectileColor = new Color(0.2f, 0.7f, 1f, 1f);
break;
case BodyClass.Juggernaut:
p.displayName = "ДЖАГГЕРНАУТ (Танк)";
p.maxHealth = 280f;
p.moveSpeed = 4.2f;
p.sprintSpeed = 5.8f;
p.crouchSpeed = 2f;
p.canSlide = false;
p.airAcceleration = 35f;
p.jumpHeight = 0.85f;
p.gravity = -35f;
p.standingHeight = 2.4f;
p.standingCameraY = 1.95f;
p.crouchingCameraY = 1.2f;
p.walkBobSpeed = 7f;
p.walkBobAmount = 0.07f;
p.footstepPitch = 0.65f;
p.canShoot = true;
p.isAutomatic = false;
p.damage = 18f;
p.fireRate = 0.85f;
p.weaponRange = 35f;
p.pelletsPerShot = 8;
p.spreadAngle = 7f;
p.recoilKick = 4.2f;
p.projectileSpeed = 22f; // Крупная ярко-оранжевая картечь (отлично видно для уворота!)
p.projectileSize = 0.25f;
p.projectileColor = new Color(1f, 0.3f, 0.1f, 1f);
break;
case BodyClass.Sniper:
p.displayName = "СНАЙПЕР-ФАНТОМ";
p.maxHealth = 85f;
p.moveSpeed = 6.2f;
p.sprintSpeed = 8.8f;
p.crouchSpeed = 3.2f;
p.canSlide = true;
p.slideInitialSpeed = 14f;
p.slideDuration = 0.8f;
p.airAcceleration = 90f;
p.jumpHeight = 1.45f;
p.gravity = -20f;
p.standingHeight = 2f;
p.standingCameraY = 1.65f;
p.walkBobSpeed = 10f;
p.walkBobAmount = 0.015f;
p.footstepPitch = 1.05f;
p.canShoot = true;
p.isAutomatic = false;
p.damage = 110f;
p.fireRate = 1.1f;
p.weaponRange = 200f;
p.pelletsPerShot = 1;
p.spreadAngle = 0f;
p.pierceTargets = true;
p.recoilKick = 3.0f;
p.projectileSpeed = 60f; // Фиолетовый скоростной заряд рейлгана
p.projectileSize = 0.28f;
p.projectileColor = new Color(0.85f, 0.2f, 1f, 1f);
break;
}
return p;
}
}
}