Redesigned the level system + added a stub for effects
This commit is contained in:
parent
646163986d
commit
15fa1ab742
Binary file not shown.
|
@ -24,10 +24,17 @@ public class Card : MonoBehaviour
|
|||
[SerializeField] private Text quantity;
|
||||
|
||||
//этот колхоз надо переделать 100 процентов
|
||||
|
||||
[HideInInspector] int localquantityStamina = 0;
|
||||
[HideInInspector] int localquantityHealth = 0;
|
||||
[HideInInspector] int localdamage = 0;
|
||||
[HideInInspector] int localaddHealth = 0;
|
||||
[HideInInspector] int localaddStamina = 0;
|
||||
[HideInInspector] int localaddArmor = 0;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
SaveStartCharacterisics(cardObject);
|
||||
CheckLevel(cardObject);
|
||||
picture.sprite = cardConfig.CardCharacteristics.picture;
|
||||
_card = cardConfig.CardCharacteristics;
|
||||
picture.sprite = _card.picture;
|
||||
|
@ -118,8 +125,48 @@ public class Card : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public void SaveStartCharacterisics(GameObject _card)
|
||||
{
|
||||
var _cardCharacteristics = _card.GetComponent<Card>().cardConfig.CardCharacteristics;
|
||||
|
||||
localquantityStamina = _cardCharacteristics.quantityStamina;
|
||||
localquantityHealth = _cardCharacteristics.quantityHealth;
|
||||
localdamage = _cardCharacteristics.damage;
|
||||
localaddHealth = _cardCharacteristics.addHealth;
|
||||
localaddStamina = _cardCharacteristics.addStamina;
|
||||
localaddArmor = _cardCharacteristics.addArmor;
|
||||
}
|
||||
|
||||
public void CheckLevel(GameObject _card)
|
||||
{
|
||||
// Мне за это стыдно, но в голову иных варинтов не приходит
|
||||
var _cardCharacteristics = _card.GetComponent<Card>().cardConfig.CardCharacteristics;
|
||||
if (_cardCharacteristics.improvedLevel is true)
|
||||
{
|
||||
_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 ResetCardCharacteristic(GameObject _card)
|
||||
{
|
||||
var _cardCharacteristics = _card.GetComponent<Card>().cardConfig.CardCharacteristics;
|
||||
|
||||
_cardCharacteristics.quantityStamina = localquantityStamina;
|
||||
_cardCharacteristics.quantityHealth = localquantityHealth;
|
||||
_cardCharacteristics.damage = localdamage;
|
||||
_cardCharacteristics.addHealth = localaddHealth;
|
||||
_cardCharacteristics.addStamina = localaddStamina;
|
||||
_cardCharacteristics.addArmor = localaddArmor;
|
||||
}
|
||||
|
||||
public void DestroyObject()
|
||||
{
|
||||
ResetCardCharacteristic(cardObject);
|
||||
Destroy(cardObject);
|
||||
//Camera.main.GetComponent<DeckManager>().CardInTable.RemoveAt(number);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ public class CardConfig : ScriptableObject
|
|||
{
|
||||
public CardCharacteristics CardCharacteristics;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public enum Specialization
|
||||
{
|
||||
|
@ -28,19 +29,11 @@ public enum AttackCount : int
|
|||
|
||||
};
|
||||
|
||||
public enum CardLevel : int
|
||||
[Serializable]
|
||||
public enum CardEffects
|
||||
{
|
||||
zero,
|
||||
one,
|
||||
two,
|
||||
three
|
||||
|
||||
};
|
||||
|
||||
public enum Characteristic
|
||||
{
|
||||
quantityStamina = 7,
|
||||
quantityHealth = 8
|
||||
poison,
|
||||
stun
|
||||
};
|
||||
|
||||
|
||||
|
@ -53,7 +46,10 @@ public class CardCharacteristics
|
|||
public string description;
|
||||
[Tooltip("specialization is necessary for the right choice of goals")]
|
||||
public Specialization specialization;
|
||||
|
||||
|
||||
[Header("Level")]
|
||||
public bool improvedLevel;
|
||||
|
||||
[Header("Cost")]
|
||||
public int quantityStamina;
|
||||
public int quantityHealth;
|
||||
|
@ -69,8 +65,14 @@ public class CardCharacteristics
|
|||
[Header("Mass Damage")]
|
||||
public AttackCount enemyCount = AttackCount.none;
|
||||
|
||||
[Header("Level")]
|
||||
public CardLevel level = CardLevel.zero;
|
||||
[Serializable]
|
||||
public class ListEffects
|
||||
{
|
||||
public CardEffects effect;
|
||||
public int turns;
|
||||
}
|
||||
|
||||
public ListEffects[] effects;
|
||||
|
||||
[Header("Cost")]
|
||||
[Header("SecondLevelCharacteristic")]
|
||||
|
@ -84,4 +86,6 @@ public class CardCharacteristics
|
|||
public int addHealth2;
|
||||
public int addStamina2;
|
||||
public int addArmor2;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -17,14 +17,19 @@ MonoBehaviour:
|
|||
picture: {fileID: 21300000, guid: 11194064875365e48be6ed64b065cb41, type: 3}
|
||||
description: this is horosho
|
||||
specialization: 2
|
||||
improvedLevel: 1
|
||||
quantityStamina: 0
|
||||
quantityHealth: 0
|
||||
damage: 0
|
||||
addHealth: 0
|
||||
addStamina: 2
|
||||
addStamina: 1
|
||||
addArmor: 0
|
||||
enemyCount: 0
|
||||
level: 1
|
||||
effects:
|
||||
- effect: 0
|
||||
turns: 1
|
||||
- effect: 1
|
||||
turns: 2
|
||||
quantityStamina2: 0
|
||||
quantityHealth2: 0
|
||||
damage2: 0
|
||||
|
|
|
@ -52,21 +52,6 @@ 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);
|
||||
|
@ -96,7 +81,6 @@ 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.
|
@ -21,7 +21,7 @@ MonoBehaviour:
|
|||
m_ShowMode: 4
|
||||
m_Title: Game
|
||||
m_RootView: {fileID: 6}
|
||||
m_MinSize: {x: 875, y: 300}
|
||||
m_MinSize: {x: 875, y: 392}
|
||||
m_MaxSize: {x: 10000, y: 10000}
|
||||
m_Maximized: 1
|
||||
--- !u!114 &2
|
||||
|
@ -45,10 +45,10 @@ MonoBehaviour:
|
|||
y: 30
|
||||
width: 1920
|
||||
height: 947
|
||||
m_MinSize: {x: 679, y: 492}
|
||||
m_MaxSize: {x: 14002, y: 14042}
|
||||
m_MinSize: {x: 678, y: 342}
|
||||
m_MaxSize: {x: 12003, y: 8042}
|
||||
vertical: 0
|
||||
controlID: 124
|
||||
controlID: 61
|
||||
--- !u!114 &3
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
|
@ -111,7 +111,7 @@ MonoBehaviour:
|
|||
m_Enabled: 1
|
||||
m_EditorHideFlags: 1
|
||||
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name: ProjectBrowser
|
||||
m_Name: ConsoleWindow
|
||||
m_EditorClassIdentifier:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
|
@ -120,14 +120,14 @@ MonoBehaviour:
|
|||
y: 589
|
||||
width: 1531
|
||||
height: 358
|
||||
m_MinSize: {x: 231, y: 271}
|
||||
m_MaxSize: {x: 10001, y: 10021}
|
||||
m_ActualView: {fileID: 13}
|
||||
m_MinSize: {x: 100, y: 100}
|
||||
m_MaxSize: {x: 4000, y: 4000}
|
||||
m_ActualView: {fileID: 18}
|
||||
m_Panes:
|
||||
- {fileID: 13}
|
||||
- {fileID: 18}
|
||||
m_Selected: 0
|
||||
m_LastSelected: 1
|
||||
m_Selected: 1
|
||||
m_LastSelected: 0
|
||||
--- !u!114 &6
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
|
@ -223,10 +223,10 @@ MonoBehaviour:
|
|||
y: 0
|
||||
width: 1531
|
||||
height: 947
|
||||
m_MinSize: {x: 403, y: 492}
|
||||
m_MaxSize: {x: 10001, y: 14042}
|
||||
m_MinSize: {x: 403, y: 342}
|
||||
m_MaxSize: {x: 8003, y: 8042}
|
||||
vertical: 1
|
||||
controlID: 58
|
||||
controlID: 62
|
||||
--- !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: 59
|
||||
controlID: 63
|
||||
--- !u!114 &11
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
|
@ -356,9 +356,9 @@ MonoBehaviour:
|
|||
m_IsLocked: 0
|
||||
m_FolderTreeState:
|
||||
scrollPos: {x: 0, y: 3}
|
||||
m_SelectedIDs: 32470000
|
||||
m_LastClickedID: 18226
|
||||
m_ExpandedIDs: 000000000647000014470000184700002447000000ca9a3b
|
||||
m_SelectedIDs: 1c470000
|
||||
m_LastClickedID: 18204
|
||||
m_ExpandedIDs: 0000000006470000184700001e47000000ca9a3b
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
|
@ -411,8 +411,8 @@ MonoBehaviour:
|
|||
m_Icon: {fileID: 0}
|
||||
m_ResourceFile:
|
||||
m_ListAreaState:
|
||||
m_SelectedInstanceIDs:
|
||||
m_LastClickedInstanceID: 0
|
||||
m_SelectedInstanceIDs: 32470000
|
||||
m_LastClickedInstanceID: 18226
|
||||
m_HadKeyboardFocusLastEvent: 1
|
||||
m_ExpandedInstanceIDs: c6230000
|
||||
m_RenameOverlay:
|
||||
|
@ -507,9 +507,9 @@ MonoBehaviour:
|
|||
m_SceneHierarchy:
|
||||
m_TreeViewState:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs: 3e470000
|
||||
m_SelectedIDs: 32470000
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: caeeffff96f5ffff98600000c0600000ea600000f8600000
|
||||
m_ExpandedIDs: 7cd8ffff36edffffdc680000046900002e6900003c690000
|
||||
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.
|
@ -839,3 +839,23 @@ C# parse time : 191ms
|
|||
candidates check time : 34ms
|
||||
console write time : 0ms
|
||||
|
||||
[api-updater (non-obsolete-error-filter)] 05.02.2022 11:36:58 : Starting C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data/Tools/ScriptUpdater/APIUpdater.NonObsoleteApiUpdaterDetector.exe
|
||||
[api-updater (non-obsolete-error-filter)]
|
||||
----------------------------------
|
||||
jit/startup time : 357,3234ms
|
||||
moved types parse time: 38ms
|
||||
candidates parse time : 8ms
|
||||
C# parse time : 171ms
|
||||
candidates check time : 46ms
|
||||
console write time : 0ms
|
||||
|
||||
[api-updater (non-obsolete-error-filter)] 05.02.2022 11:59:50 : Starting C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data/Tools/ScriptUpdater/APIUpdater.NonObsoleteApiUpdaterDetector.exe
|
||||
[api-updater (non-obsolete-error-filter)]
|
||||
----------------------------------
|
||||
jit/startup time : 51,1383ms
|
||||
moved types parse time: 36ms
|
||||
candidates parse time : 7ms
|
||||
C# parse time : 128ms
|
||||
candidates check time : 40ms
|
||||
console write time : 0ms
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +0,0 @@
|
|||
Base path: 'C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2020.3.19f1/Editor/Data/PlaybackEngines'
|
||||
Cmd: initializeCompiler
|
||||
|
||||
Unhandled exception: Protocol error - failed to read magic number (error -2147483644, transferred 0/4)
|
||||
|
||||
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