DEG-34 [feat] 캐릭터 베이스 추가
This commit is contained in:
parent
73cc82de24
commit
df9abb63bf
2
Assembly-CSharp.csproj.DotSettings
Normal file
2
Assembly-CSharp.csproj.DotSettings
Normal file
@ -0,0 +1,2 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cjyy_005Cscripts/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
8
Assets/JYY/Scripts.meta
Normal file
8
Assets/JYY/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d71915ab89436f04291470c4877deb39
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/JYY/Scripts/Character.meta
Normal file
8
Assets/JYY/Scripts/Character.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04daad0a5fd8ee441ac26c6addd95d0c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
63
Assets/JYY/Scripts/Character/CharacterBase.cs
Normal file
63
Assets/JYY/Scripts/Character/CharacterBase.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class CharacterBase : MonoBehaviour
|
||||
{
|
||||
[Header("기본 능력치")]
|
||||
public string characterName; // 이름
|
||||
public int maxHP = 100; // 최대 체력
|
||||
public int currentHP; // 현재 체력
|
||||
public float attackPower = 10f; // 공격력
|
||||
public float defensePower = 5f; // 방어력
|
||||
public float moveSpeed = 5f; // 이동 속도
|
||||
public float gravity = -9.81f; // 중력
|
||||
|
||||
[Header("상태 이상")]
|
||||
public List<StatusEffect> statusEffects = new List<StatusEffect>();
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
currentHP = maxHP;
|
||||
}
|
||||
|
||||
public virtual void TakeDamage(float damage)
|
||||
{
|
||||
float actualDamage = Mathf.Max(0, damage - defensePower);
|
||||
currentHP -= Mathf.RoundToInt(actualDamage);
|
||||
Debug.Log($"{characterName}이 {actualDamage}의 피해를 입었습니다. 현재 체력: {currentHP}");
|
||||
|
||||
if (currentHP <= 0)
|
||||
{
|
||||
Die();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Die()
|
||||
{
|
||||
Debug.Log($"{characterName}이 사망했습니다.");
|
||||
// TODO: 사망 처리
|
||||
}
|
||||
|
||||
// 상태이상 추가 메서드
|
||||
public virtual void AddStatusEffect(StatusEffect effect)
|
||||
{
|
||||
statusEffects.Add(effect);
|
||||
// TODO: 상태이상 처리 로직 추가
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class StatusEffect
|
||||
{
|
||||
// 받는 피해 증가
|
||||
// 주는 피해 감소
|
||||
// 느려짐
|
||||
// 기절
|
||||
// 넉백
|
||||
|
||||
public string effectName;
|
||||
public float duration;
|
||||
|
||||
public virtual void ApplyEffect(CharacterBase target) {}
|
||||
public virtual void RemoveEffect(CharacterBase target) {}
|
||||
}
|
11
Assets/JYY/Scripts/Character/CharacterBase.cs.meta
Normal file
11
Assets/JYY/Scripts/Character/CharacterBase.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ca899178d924fa4e8de15831c666f22
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user