Skip to content

Commit

Permalink
Merge pull request #6621 from ipdae/feature/6604
Browse files Browse the repository at this point in the history
아레나 시뮬레이션 개선
  • Loading branch information
ipdae authored Dec 31, 2024
2 parents 5905547 + 0204c0a commit 6ceab83
Show file tree
Hide file tree
Showing 58 changed files with 427 additions and 288 deletions.
54 changes: 51 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Example:
- Set notifications to **Suggestion** level.

#### Code Body
- Prefer block body over expression body for functions.
- Prefer block body over expression body for functions.
- Recommend expression body for properties, indexers, and events.

```csharp
Expand All @@ -253,7 +253,7 @@ private int Add(int a, int b)
```

#### Attributes
- Separate each attribute with its own square brackets.
- Separate each attribute with its own square brackets.

### Braces Layout
- Use BSD style (default setting).
Expand All @@ -269,4 +269,52 @@ private int Add(int a, int b)
- Place field or property/indexer/event attribute on the same line

### Spaces
- Use default settings except for **Between attribute sections**, which is set to `false`.
- Use default settings except for **Between attribute sections**, which is set to `false`.

Arena simulation
---
You can simulate an ArenaBattle using the Assets/_Scenes/BattleSimulation scene in the editor.
you can config avatar spec with `Assets/StreamingAssets/avatar.json`, `Assets/StreamingAssets/avatar-enemy.json`

### avatar.json format
```json5
{
"Level": 1, // Represents the level of the avatar in the simulation
"collectionIds": [
1, // Corresponds to a specific collection ID in the CollectionSheet. Refers to collections to activate.
8 // Refer to the CollectionSheet for more details.
],
"RuneItems": [
{
"Id": 30001, // ID of the rune, as defined in the RuneListSheet
"Level": 2, // The level of the rune
"SlotIndex": 0 // Slot where the rune is equipped (0-6). If empty, only level bonuses are applied.
}
],
"CostumeIds": [
49900024 // ID of the costume to equip. Refer to the CostumeItemSheet.
],
"EquipmentItems": [
{
"Id": 10120000, // ID of the equipment item, as defined in the EquipmentItemSheet
"Level": 17, // The level of the equipment
"StatOptions": [
{
"StatType": "HP", // The type of stat (e.g., HP, ATK, etc.) from StatType Enum
"Value": 100 // The value of the stat to be applied
}
],
"SkillOptions": [
{
"Id": 800072, // ID of the skill option
"Power": 100, // The power of the skill
"Chance": 100, // The probability of skill activation (percentage)
"StatPowerRatio": 1, // Skill power ratio based on stats
"StatType": "HP" // The type of stat influencing the skill (from StatType Enum)
}
]
}
]
}

```
38 changes: 38 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar-enemy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Level": 1,
"collectionIds": [
1,
8
],
"RuneItems": [
{
"Id": 30001,
"Level": 2,
"SlotIndex": 0
}
],
"CostumeIds": [
49900024
],
"EquipmentItems": [
{
"Id": 10120000,
"Level": 17,
"StatOptions": [
{
"StatType": "ATK",
"Value": 100
}
],
"SkillOptions": [
{
"Id": 800072,
"Power": 100,
"Chance": 100,
"StatPowerRatio": 1,
"StatType": "HP"
}
]
}
]
}
3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar-enemy.json.meta

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

38 changes: 38 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Level": 1,
"collectionIds": [
1,
8
],
"RuneItems": [
{
"Id": 30001,
"Level": 2,
"SlotIndex": 0
}
],
"CostumeIds": [
49900024
],
"EquipmentItems": [
{
"Id": 10120000,
"Level": 17,
"StatOptions": [
{
"StatType": "HP",
"Value": 100
}
],
"SkillOptions": [
{
"Id": 800072,
"Power": 100,
"Chance": 100,
"StatPowerRatio": 1,
"StatType": "HP"
}
]
}
]
}
3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar.json.meta

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

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_allrune1.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_allrune1.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_allrune2.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_allrune2.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_avatar1.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_avatar1.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_avatar2.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_avatar2.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_collection1.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_collection2.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_inventory1.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_inventory2.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt.meta

This file was deleted.

6 changes: 0 additions & 6 deletions nekoyume/Assets/_Scripts/Editor/TestArena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@
using Cysharp.Threading.Tasks;
using Libplanet.Crypto;
using Nekoyume;
using Nekoyume.Blockchain;
using Nekoyume.Editor;
using Nekoyume.Game;
using Nekoyume.Game.Battle;
using Nekoyume.Game.Character;
using Nekoyume.Game.Controller;
using Nekoyume.Game.Util;
using Nekoyume.Game.VFX.Skill;
using Nekoyume.Helper;
using Nekoyume.L10n;
using Nekoyume.Model;
using Nekoyume.Model.BattleStatus.Arena;
using Nekoyume.Model.Item;
using Nekoyume.Model.Skill;
using Nekoyume.UI;
using UniRx;
using UnityEngine;
using ArenaCharacter = Nekoyume.Model.ArenaCharacter;
Expand Down Expand Up @@ -418,4 +413,3 @@ public IEnumerator CoShatterStrike(ArenaCharacter caster, IEnumerable<ArenaSkill
}
}
}

8 changes: 3 additions & 5 deletions nekoyume/Assets/_Scripts/Editor/TestArenaCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
using Nekoyume.Game;
using Nekoyume.Game.Character;
using Nekoyume.Game.Controller;
using Nekoyume.Game.VFX;
using Nekoyume.Model.BattleStatus.Arena;
using Nekoyume.UI;
using UnityEngine;
using Nekoyume.Model.Skill;
using Nekoyume.Model.Elemental;
using Nekoyume.Model.Item;
using UnityEngine.Serialization;

namespace Nekoyume.Editor
{
Expand Down Expand Up @@ -103,7 +101,7 @@ public void Init(
_equipments.Clear();
_equipments.AddRange(digest.Equipments);
_target = target;
appearance.Set(digest, avatarAddress, Animator, _hudContainer);
appearance.Set(digest, avatarAddress, Animator, _hudContainer, TestArena.Instance.TableSheets);
}

public void Spawn(Model.ArenaCharacter model)
Expand All @@ -128,7 +126,7 @@ public void Spawn(Model.ArenaCharacter model)
public void UpdateStatusUI()
{
_hudContainer.UpdatePosition(ActionCamera.instance.Cam, gameObject, HUDOffset);
arenaBattle.UpdateStatus(CharacterModel.IsEnemy, _currentHp, CharacterModel.HP, CharacterModel.Buffs);
arenaBattle.UpdateStatus(CharacterModel.IsEnemy, _currentHp, CharacterModel.HP, CharacterModel.Buffs, TestArena.Instance.TableSheets, false);
UpdateBuffVfx();
}

Expand Down Expand Up @@ -256,7 +254,7 @@ private IEnumerator CoExecuteAction()
}
}

yield return new WaitForSeconds(StageConfig.instance.actionDelay);
yield return new WaitForSeconds(0.5f);
if (_runningAction != null)
{
yield return StartCoroutine(TestArena.Instance.CoSkill(_runningAction));
Expand Down
Loading

0 comments on commit 6ceab83

Please sign in to comment.