Made levels for cards
This commit is contained in:
parent
bc53f03e57
commit
646163986d
Binary file not shown.
|
@ -7,7 +7,7 @@ using UnityEngine.UI;
|
|||
|
||||
public class Card : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private CardConfig cardConfig;
|
||||
[SerializeField] public CardConfig cardConfig;
|
||||
private CardCharacteristics _card;
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,21 @@ public enum AttackCount : int
|
|||
|
||||
};
|
||||
|
||||
public enum CardLevel : int
|
||||
{
|
||||
zero,
|
||||
one,
|
||||
two,
|
||||
three
|
||||
|
||||
};
|
||||
|
||||
public enum Characteristic
|
||||
{
|
||||
quantityStamina = 7,
|
||||
quantityHealth = 8
|
||||
};
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class CardCharacteristics
|
||||
|
@ -53,4 +68,20 @@ public class CardCharacteristics
|
|||
|
||||
[Header("Mass Damage")]
|
||||
public AttackCount enemyCount = AttackCount.none;
|
||||
|
||||
[Header("Level")]
|
||||
public CardLevel level = CardLevel.zero;
|
||||
|
||||
[Header("Cost")]
|
||||
[Header("SecondLevelCharacteristic")]
|
||||
public int quantityStamina2;
|
||||
public int quantityHealth2;
|
||||
[Space]
|
||||
[Header("Damage")]
|
||||
public int damage2;
|
||||
[Space]
|
||||
[Header("Effects")]
|
||||
public int addHealth2;
|
||||
public int addStamina2;
|
||||
public int addArmor2;
|
||||
}
|
|
@ -20,6 +20,14 @@ MonoBehaviour:
|
|||
quantityStamina: 0
|
||||
quantityHealth: 0
|
||||
damage: 0
|
||||
healing: 0
|
||||
addStamina: 1
|
||||
armor: 0
|
||||
addHealth: 0
|
||||
addStamina: 2
|
||||
addArmor: 0
|
||||
enemyCount: 0
|
||||
level: 1
|
||||
quantityStamina2: 0
|
||||
quantityHealth2: 0
|
||||
damage2: 0
|
||||
addHealth2: 0
|
||||
addStamina2: 2
|
||||
addArmor2: 0
|
||||
|
|
|
@ -52,6 +52,21 @@ public class DeckManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public void CheckLevel(GameObject _card)
|
||||
{
|
||||
// Мне за это стыдно, но в голову иных варинтов не приходит
|
||||
var _cardCharacteristics = _card.GetComponent<Card>().cardConfig.CardCharacteristics;
|
||||
if (((int)_cardCharacteristics.level) == 1)
|
||||
{
|
||||
_cardCharacteristics.quantityStamina = _cardCharacteristics.quantityStamina2;
|
||||
_cardCharacteristics.quantityHealth = _cardCharacteristics.quantityHealth2;
|
||||
_cardCharacteristics.damage = _cardCharacteristics.damage2;
|
||||
_cardCharacteristics.addHealth = _cardCharacteristics.addHealth2;
|
||||
_cardCharacteristics.addStamina = _cardCharacteristics.addStamina2;
|
||||
_cardCharacteristics.addArmor = _cardCharacteristics.addArmor2;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddCard(GameObject card)
|
||||
{
|
||||
deck.Add(card);
|
||||
|
@ -70,7 +85,6 @@ public class DeckManager : MonoBehaviour
|
|||
}
|
||||
public void HandingOut()
|
||||
{
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (currentDeck.Count > 0)
|
||||
|
@ -82,6 +96,7 @@ public class DeckManager : MonoBehaviour
|
|||
GameObject _card = Instantiate(currentDeck[_number], cardsPosition[i]);
|
||||
_card.GetComponent<Card>().number = i;
|
||||
CardInTable.Add(_card);
|
||||
CheckLevel(_card);
|
||||
currentDeck.RemoveAt(_number);
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -48,7 +48,7 @@ MonoBehaviour:
|
|||
m_MinSize: {x: 679, y: 492}
|
||||
m_MaxSize: {x: 14002, y: 14042}
|
||||
vertical: 0
|
||||
controlID: 89
|
||||
controlID: 124
|
||||
--- !u!114 &3
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
|
@ -68,8 +68,8 @@ MonoBehaviour:
|
|||
y: 0
|
||||
width: 389
|
||||
height: 947
|
||||
m_MinSize: {x: 276, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_MinSize: {x: 275, y: 50}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_ActualView: {fileID: 14}
|
||||
m_Panes:
|
||||
- {fileID: 14}
|
||||
|
@ -226,7 +226,7 @@ MonoBehaviour:
|
|||
m_MinSize: {x: 403, y: 492}
|
||||
m_MaxSize: {x: 10001, y: 14042}
|
||||
vertical: 1
|
||||
controlID: 90
|
||||
controlID: 58
|
||||
--- !u!114 &10
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
|
@ -251,7 +251,7 @@ MonoBehaviour:
|
|||
m_MinSize: {x: 403, y: 221}
|
||||
m_MaxSize: {x: 8003, y: 4021}
|
||||
vertical: 0
|
||||
controlID: 91
|
||||
controlID: 59
|
||||
--- !u!114 &11
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
|
@ -343,22 +343,22 @@ MonoBehaviour:
|
|||
m_SkipHidden: 0
|
||||
m_SearchArea: 1
|
||||
m_Folders:
|
||||
- Assets/Inventory
|
||||
- Assets/Scripts/Configs/CardConfigs
|
||||
m_Globs: []
|
||||
m_OriginalText:
|
||||
m_ViewMode: 1
|
||||
m_StartGridSize: 64
|
||||
m_LastFolders:
|
||||
- Assets/Inventory
|
||||
- Assets/Scripts/Configs/CardConfigs
|
||||
m_LastFoldersGridSize: -1
|
||||
m_LastProjectPath: "E:\\Projects \u0441#\\Unity\\omega"
|
||||
m_LockTracker:
|
||||
m_IsLocked: 0
|
||||
m_FolderTreeState:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: 0c470000
|
||||
m_LastClickedID: 18188
|
||||
m_ExpandedIDs: 000000000647000000ca9a3b
|
||||
scrollPos: {x: 0, y: 3}
|
||||
m_SelectedIDs: 32470000
|
||||
m_LastClickedID: 18226
|
||||
m_ExpandedIDs: 000000000647000014470000184700002447000000ca9a3b
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
|
@ -507,9 +507,9 @@ MonoBehaviour:
|
|||
m_SceneHierarchy:
|
||||
m_TreeViewState:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: a6150000
|
||||
m_SelectedIDs: 3e470000
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs:
|
||||
m_ExpandedIDs: caeeffff96f5ffff98600000c0600000ea600000f8600000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -2,5 +2,3 @@ Base path: 'C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data', plugins
|
|||
Cmd: initializeCompiler
|
||||
|
||||
Cmd: shutdown
|
||||
|
||||
Quitting shader compiler process
|
||||
|
|
|
@ -2,5 +2,3 @@ Base path: 'C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data', plugins
|
|||
Cmd: initializeCompiler
|
||||
|
||||
Cmd: shutdown
|
||||
|
||||
Quitting shader compiler process
|
||||
|
|
|
@ -2,5 +2,3 @@ Base path: 'C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data', plugins
|
|||
Cmd: initializeCompiler
|
||||
|
||||
Cmd: shutdown
|
||||
|
||||
Quitting shader compiler process
|
||||
|
|
Loading…
Reference in New Issue