Skip to content

Commit

Permalink
aa
Browse files Browse the repository at this point in the history
  • Loading branch information
dugite-git committed Sep 17, 2024
1 parent 921e79a commit 1ab6009
Show file tree
Hide file tree
Showing 17 changed files with 413 additions and 16 deletions.
216 changes: 216 additions & 0 deletions Assets/App/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,127 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &325263820
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 325263821}
- component: {fileID: 325263824}
- component: {fileID: 325263823}
- component: {fileID: 325263822}
m_Layer: 5
m_Name: UseSkillButton1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &325263821
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 325263820}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 698169214}
m_Father: {fileID: 568042970}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -200.00014, y: 21.100006}
m_SizeDelta: {x: 160, y: 30.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &325263822
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 325263820}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 325263823}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &325263823
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 325263820}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &325263824
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 325263820}
m_CullTransparentMesh: 1
--- !u!1 &404842156
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -712,6 +833,7 @@ RectTransform:
- {fileID: 416316748}
- {fileID: 1110636000}
- {fileID: 1387411688}
- {fileID: 325263821}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
Expand Down Expand Up @@ -880,6 +1002,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 679057382}
m_CullTransparentMesh: 1
--- !u!1 &698169213
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 698169214}
- component: {fileID: 698169216}
- component: {fileID: 698169215}
m_Layer: 5
m_Name: Text (Legacy)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &698169214
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 698169213}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 325263821}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &698169215
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 698169213}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: UseSkillButton1
--- !u!222 &698169216
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 698169213}
m_CullTransparentMesh: 1
--- !u!1 &752973991
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1009,6 +1210,7 @@ MonoBehaviour:
autoInjectGameObjects: []
_BattleDebugEnemyPresenter: {fileID: 2048206442}
_BattleDebugStatePresenter: {fileID: 2048206443}
_BattleDebugUseSkillPresenter: {fileID: 2048206444}
--- !u!1 &842995928
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1589,6 +1791,7 @@ GameObject:
- component: {fileID: 2048206441}
- component: {fileID: 2048206442}
- component: {fileID: 2048206443}
- component: {fileID: 2048206444}
m_Layer: 0
m_Name: BattleDebugPresenter
m_TagString: Untagged
Expand Down Expand Up @@ -1640,6 +1843,19 @@ MonoBehaviour:
_cancelStateButton: {fileID: 416316749}
_increaseStateIndexButton: {fileID: 1110636001}
_decreaseStateIndexButton: {fileID: 1387411689}
--- !u!114 &2048206444
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2048206440}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 979a495aad96c2b498f91a66d2031d79, type: 3}
m_Name:
m_EditorClassIdentifier:
_useSkillButton1: {fileID: 325263822}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
Expand Down
4 changes: 4 additions & 0 deletions Assets/App/Scripts/Battle/BattleLifetimeScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine;
using VContainer;
using VContainer.Unity;
using App.Common.Data.MasterData;

public class BattleLifetimeScope : LifetimeScope
{
Expand All @@ -15,5 +16,8 @@ protected override void Configure(IContainerBuilder builder)
builder.Register<BattleEnemyUseCase>(Lifetime.Singleton).AsImplementedInterfaces();
builder.Register<BattleStateMachineUseCase>(Lifetime.Singleton).AsImplementedInterfaces();
builder.Register<BattleStateMachinePresenter>(Lifetime.Singleton).AsImplementedInterfaces();
builder.Register<BattleUseSkillUseCase>(Lifetime.Singleton).AsImplementedInterfaces();
builder.Register<BattleSkillDataBase>(Lifetime.Singleton).AsImplementedInterfaces();

}
}
43 changes: 43 additions & 0 deletions Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using App.Battle.Data;
using App.Common.Data;
using App.Battle.Interfaces.Datastores;
using System;
using System.Linq;
using System.Collections.Generic;
using UniRx;

namespace App.Battle.Datastores
{
public class BattleSkillDatastore : IBattleEnemyDatastore, IDisposable
{
private Dictionary<string, > _enemies = new();
public IEnumerable<Enemy> Enemies => _enemies.Values.ToArray();


public void RemoveEnemy(string id)
{
if(!_enemies.ContainsKey(id))
{
return;
}
_enemies.Remove(id);
}

public Enemy GetEnemyBy(string id)
{
if(!_enemies.ContainsKey(id))
{
return null;
}

var enemy = _enemies[id];
UnityEngine.Debug.Log($"{enemy} got");
return enemy;
}

public void Dispose()
{
_enemies.Clear();
}
}
}
11 changes: 11 additions & 0 deletions Assets/App/Scripts/Battle/Datastores/BattleSkillDatastore.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using App.Battle.Data;
using App.Common.Data;
using App.Common.Data.MasterData;

namespace App.Battle.Interfaces.Presenters
{
public interface IUseSkillPresenter
public interface IBattleUseSkillPresenter
{
HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, EnemyMasterData enemy);
HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, Enemy enemy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace App.Battle.Interfaces.UseCases
{
public interface IUseSkillUseCase
public interface IBattleUseSkillUseCase
{
void UseSkill(CharacterParameter player, int skillId, int enemyId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using App.Common.Data.MasterData;
using App.Common.Data;
using App.Battle.Interfaces.Presenters;
using App.Battle.Data;

namespace App.Battle.Presenters
{
public class BattleUseSkillPresenter: IUseSkillPresenter
public class BattleUseSkillPresenter: IBattleUseSkillPresenter
{
public HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, EnemyMasterData enemy)
public HealthPoint CalculateDamage(CharacterParameter player, BattleSkillData skill, Enemy enemy)
{
HealthPoint damage = new HealthPoint(player.Atk.CurrentValue*skill.AtkRate - enemy.CharacterParameter.Def.CurrentValue);
HealthPoint matdamage = new HealthPoint(player.Mat.CurrentValue*skill.MatRate - enemy.CharacterParameter.Mde.CurrentValue);
HealthPoint damage = new HealthPoint(player.Atk.CurrentValue*skill.AtkRate - enemy.characterParameter.Def.CurrentValue);
HealthPoint matdamage = new HealthPoint(player.Mat.CurrentValue*skill.MatRate - enemy.characterParameter.Mde.CurrentValue);

damage = damage.AddCurrentValue(matdamage);

Expand Down
Loading

0 comments on commit 1ab6009

Please sign in to comment.