TG9six 03a642d635 first push
first push
2025-09-06 17:17:39 +04:00

112 lines
4.9 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using NaughtyAttributes;
using AssetIcons;
//Thomas09
[CreateAssetMenu(fileName = "Weapon", menuName = "WeaponData")]
public class Weapon : ScriptableObject
{
[AssetIcon(maxSize:256)] public Texture2D assetIcon;
//this is the actual name of the asset.
public string SOName => base.name;
public enum WEAPON_TYPE
{
NONE = 0,
GUN = 1,
BOW = 2,
SWORD = 3,
PISTOL = 4,
MINER = 5,
GLOVE = 6
};
public enum WEAPONLEVEL
{
BASE = 0,
ONE = 1,
TWO = 2,
THREE = 3,
FOUR = 4,
FIVE = 5,
SIX = 6,
SEVEN = 7
}
[BoxGroup("Animation Stance")] public RuntimeAnimatorController playerAnimatorStance;
[BoxGroup("Camera Shake Attributes")] public float Magnitude = 1.0f;
[BoxGroup("Camera Shake Attributes")] public float Roughness = 5.0f;
[BoxGroup("Camera Shake Attributes")] public float fadeInTime = 0.1f;
[BoxGroup("Camera Shake Attributes")] public float fadeOutTime = 0.2f;
[BoxGroup("Item Details")] public string name;
[BoxGroup("Item Details")] public string description;
[BoxGroup("Item Details")] public int maxStack = 1;
[BoxGroup("Item Details")] public WEAPON_TYPE weaponType;
[BoxGroup("Item Details")] public WeaponAmmoType weaponAmmoType = WeaponAmmoType.Bullet;
[BoxGroup("Item Details")] public ItemType ItemType;
[BoxGroup("Generic")] public int WearSlot = 0;
[BoxGroup("Generic")] public float equipDuration = 1.0f;
[BoxGroup("Generic")] public bool isThrowable;
[BoxGroup("Generic")] public int maxDamage;
[BoxGroup("Forgeable")] public bool Forgeable = true;
[BoxGroup("Forgeable"), ShowIf(nameof(Forgeable))] public int baseID = -1;
[BoxGroup("Forgeable"), ShowIf(nameof(Forgeable))] public WEAPONLEVEL WeaponLevel;
[BoxGroup("Forgeable"), ShowIf(nameof(Forgeable))] public Weapon[] WeaponLevels;
[BoxGroup("Gun Stats")] public bool isGun;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public GunRecoilConfig aimedRecoil;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public GunRecoilConfig hipFireRecoil;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public string projectile;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public int ammoClipAmount;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public int effectiveRange;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public float reloadTime;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public float shootCooldown;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public int bulletsPerTap = 1;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public float timeBetweenShots;
[BoxGroup("Gun Stats"), ShowIf(nameof(isGun))] public WeaponCrosshairType reticletype;
[BoxGroup("Gun Types"), ShowIf(nameof(isGun))] public bool isAutomatic;
[BoxGroup("Gun Types"), ShowIf(nameof(isGun))] public bool isBurstFire;
[BoxGroup("Gun Types"), ShowIf(nameof(isGun))] public bool isRocketLauncher;
[BoxGroup("Gun Types"), ShowIf(nameof(isGun))] public bool isShotgun;
[BoxGroup("Gun Types"), ShowIf(nameof(isGun))] public bool isSniper;
[BoxGroup("Gun Types"), ShowIf(nameof(isGun))] public bool isMeleeFlameAttack = false;
[BoxGroup("Gun Types"), ShowIf(nameof(isSniper))] public float crosshairChangeTime;
[BoxGroup("Rocket Launcher Stats"), ShowIf(nameof(isRocketLauncher))]
public float explosionRadius = 750f;
[BoxGroup("Sounds"), ShowIf(nameof(isGun))] public string fireSound;
[BoxGroup("Sounds"), ShowIf(nameof(isGun))] public string emptySound;
[BoxGroup("Sounds"), ShowIf(nameof(isGun))] public string reloadSound;
[BoxGroup("Recoil Stats"), ShowIf(nameof(isGun))] public float verticleSpread;
[BoxGroup("Recoil Stats"), ShowIf(nameof(isGun))] public float horizontalSpread;
[BoxGroup("Recoil Stats"), ShowIf(nameof(isGun))] [System.NonSerialized] public float cachedVerticleSpread;
[BoxGroup("Recoil Stats"), ShowIf(nameof(isGun))] [System.NonSerialized] public float cachedHorizontalSpread;
[BoxGroup("Recoil Stats"), ShowIf(nameof(isGun))] public Vector2 cameraRecoil;
[BoxGroup("Recoil Stats"), ShowIf(nameof(isGun))] public float recoilDuration;
[BoxGroup("Aiming Stats"), ShowIf(nameof(isGun))] public float zoomSpeed = 20.0f;
[BoxGroup("Aiming Stats"), ShowIf(nameof(isGun))] public float scopedFOV;
[System.NonSerialized] public float normalFOV = 60.0f;
[BoxGroup("Melee Stats")] public bool IsMelee = false;
[BoxGroup("Melee Stats"), ShowIf(nameof(IsMelee))] public float raycastLength;
[BoxGroup("Melee Stats"), ShowIf(nameof(IsMelee))] public int meleeHitFlag;
[Header("Swing cooldown ALWAYS larger than swing animation time.")]
[BoxGroup("Melee Stats"), ShowIf(nameof(IsMelee))] public float SWING_COOLDOWN = 1;
}