Compare commits

..

5 Commits

37 changed files with 1556 additions and 814 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5d08decdacf201b45a16e73a769a8f51
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 29138ff75042d784e83244ddb11034ed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -18,7 +18,6 @@ MonoBehaviour:
cost: 1
attack: 5
defense: 10
tags: []
unitClasses:
- {fileID: 11400000, guid: 9c0ba6b77d1ad844d957f6d66b24dd1f, type: 2}
abilities: []
movement: 1
cardTags:
- {fileID: 11400000, guid: 099176a69eb9a6d408b4d4dba5232c84, type: 2}

View File

@ -18,7 +18,6 @@ MonoBehaviour:
cost: 1
attack: 5
defense: 20
tags: []
unitClasses:
- {fileID: 11400000, guid: 548b88e44eb600c4fa3a63033e23be30, type: 2}
abilities: []
movement: 1
cardTags:
- {fileID: 11400000, guid: cf728e5d8a62fa3418d2f3daa01f93df, type: 2}

View File

@ -18,7 +18,5 @@ MonoBehaviour:
cost: 1
attack: 10
defense: 10
tags: []
unitClasses:
- {fileID: 11400000, guid: 2c8cf65dbf365874ca1c1dee59e831c2, type: 2}
abilities: []
cardTags:
- {fileID: 11400000, guid: 53185ea05ebfbd843b009cb14101377a, type: 2}

View File

@ -18,7 +18,6 @@ MonoBehaviour:
cost: 1
attack: 5
defense: 10
tags: []
unitClasses:
- {fileID: 11400000, guid: 9c0ba6b77d1ad844d957f6d66b24dd1f, type: 2}
abilities: []
movement: 1
cardTags:
- {fileID: 11400000, guid: 099176a69eb9a6d408b4d4dba5232c84, type: 2}

View File

@ -18,7 +18,6 @@ MonoBehaviour:
cost: 1
attack: 3
defense: 18
tags: []
unitClasses:
- {fileID: 11400000, guid: 548b88e44eb600c4fa3a63033e23be30, type: 2}
abilities: []
movement: 1
cardTags:
- {fileID: 11400000, guid: cf728e5d8a62fa3418d2f3daa01f93df, type: 2}

View File

@ -18,7 +18,5 @@ MonoBehaviour:
cost: 1
attack: 7
defense: 8
tags: []
unitClasses:
- {fileID: 11400000, guid: 2c8cf65dbf365874ca1c1dee59e831c2, type: 2}
abilities: []
cardTags:
- {fileID: 11400000, guid: 53185ea05ebfbd843b009cb14101377a, type: 2}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d079f30f575342145b9a2e5b0204e326
guid: 29138ff75042d784e83244ddb11034ed
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -9,9 +9,9 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52ce9ab65798e6c46a62ac364d881763, type: 3}
m_Name: InfantryClass
m_Script: {fileID: 11500000, guid: c090164f177918042b3be10f378e9b5f, type: 3}
m_Name: Archer
m_EditorClassIdentifier:
name:
name: Archer
description:
artwork: {fileID: 0}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 548b88e44eb600c4fa3a63033e23be30
guid: 099176a69eb9a6d408b4d4dba5232c84
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@ -9,10 +9,9 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e099c37da90ac1b46ac0a5ee6f79f507, type: 3}
m_Name: CavalryClass
m_Script: {fileID: 11500000, guid: c090164f177918042b3be10f378e9b5f, type: 3}
m_Name: Cavalry
m_EditorClassIdentifier:
name:
name: Cavalry
description:
artwork: {fileID: 0}
extraMovement: 1

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2c8cf65dbf365874ca1c1dee59e831c2
guid: 53185ea05ebfbd843b009cb14101377a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@ -9,10 +9,9 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1bc96940f74c4ce4581f5cdec90d1e0b, type: 3}
m_Name: ArcherClass
m_Script: {fileID: 11500000, guid: c090164f177918042b3be10f378e9b5f, type: 3}
m_Name: Infantry
m_EditorClassIdentifier:
name:
name: Infantry
description:
artwork: {fileID: 0}
extraAttackRange: 2

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9c0ba6b77d1ad844d957f6d66b24dd1f
guid: cf728e5d8a62fa3418d2f3daa01f93df
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

File diff suppressed because it is too large Load Diff

View File

@ -387,6 +387,54 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 1455724355}
m_Modifications:
- target: {fileID: 1368154424702687206, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1368154424702687206, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1368154424702687206, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1368154424702687206, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1368154424702687206, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1368154424702687206, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224386513268639486, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224386513268639486, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224386513268639486, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224386513268639486, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224386513268639486, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224386513268639486, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3351518597856635956, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_Pivot.x
value: 0.5
@ -471,9 +519,149 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3460461322939268863, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3460461322939268863, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3460461322939268863, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 328
objectReference: {fileID: 0}
- target: {fileID: 3465344247853958630, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3465344247853958630, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0.00024414062
objectReference: {fileID: 0}
- target: {fileID: 3949232578393738854, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3949232578393738854, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3949232578393738854, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3949232578393738854, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3949232578393738854, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3949232578393738854, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4683416251428496599, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_Name
value: UIDeck
objectReference: {fileID: 0}
- target: {fileID: 4951491574161479434, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4951491574161479434, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4951491574161479434, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4951491574161479434, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4951491574161479434, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4951491574161479434, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6691872718163008490, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6691872718163008490, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6691872718163008490, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6691872718163008490, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6691872718163008490, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6691872718163008490, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6915207597938486102, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6915207597938486102, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6915207597938486102, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6915207597938486102, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6915207597938486102, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6915207597938486102, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299245348046405515, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299245348046405515, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299245348046405515, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299245348046405515, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299245348046405515, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8299245348046405515, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0890cb6eff04b7c46be2a388688fe4d6, type: 3}

View File

@ -321,10 +321,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 675490af7d7c9c142ae76d1b2e4920b1, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -692,10 +688,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 675490af7d7c9c142ae76d1b2e4920b1, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -831,10 +823,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 675490af7d7c9c142ae76d1b2e4920b1, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -1291,10 +1279,6 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5C0F\u5175 (4)"
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 5d7c6bbedeba24e4f98ea1ca65fc5c0a, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: standingCell
value:
@ -1839,10 +1823,6 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5C0F\u5175 (3)"
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 9eb62481994b51e4897a57499081c3db, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -2184,10 +2164,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 9eb62481994b51e4897a57499081c3db, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -2273,10 +2249,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 675490af7d7c9c142ae76d1b2e4920b1, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -2673,10 +2645,6 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5C0F\u5175 (2)"
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: adc3952bb833a224895877477b4ce92e, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -3134,10 +3102,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 9eb62481994b51e4897a57499081c3db, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -3333,10 +3297,6 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5C0F\u5175 (5)"
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 9eb62481994b51e4897a57499081c3db, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -3561,10 +3521,6 @@ PrefabInstance:
propertyPath: side
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 9eb62481994b51e4897a57499081c3db, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: cardData
value:
@ -3785,10 +3741,6 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5C0F\u5175 (1)"
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: adc3952bb833a224895877477b4ce92e, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: standingCell
value:
@ -3859,10 +3811,6 @@ PrefabInstance:
propertyPath: m_Name
value: "\u5C0F\u5175"
objectReference: {fileID: 0}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: baseData
value:
objectReference: {fileID: 11400000, guid: 5d7c6bbedeba24e4f98ea1ca65fc5c0a, type: 2}
- target: {fileID: 2394601694276102747, guid: 81eab03836e5b52448e4ad61de8f2406, type: 3}
propertyPath: standingCell
value:

View File

@ -1,41 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ability : ScriptableObject
{
public new string name;
public string description;
public virtual void OnPlaceUnit(Unit unit) { }
public virtual void OnBeginRound(Unit unit) { }
public virtual void OnEndRound(Unit unit) { }
public virtual void OnBeginMovePhase(Unit unit) { }
public virtual void OnMove(Unit unit, int travelDistance) { }
public virtual void OnEndMovePhase(Unit unit) { }
public virtual void OnBeginAttackPhase(Unit unit) { }
public virtual void OnBeginAttack(Unit unit, List<Unit> targets) { }
public virtual void OnAttack(Unit unit, List<Unit> targets) { }
public virtual void OnEndAttack(Unit unit, List<Unit> targets) { }
public virtual void OnEndAttackPhase(Unit unit) { }
public virtual void OnExecute(Unit unit, Unit target) { }
public virtual void OnAllyDeath(Unit unit) { }
public virtual void OnEnemyDeath(Unit unit) { }
public virtual void OnAnyDeath(Unit unit) { }
public virtual void OnCounterAttack(Unit unit, Unit attacker) { }
public virtual void OnDamaged(Unit unit, Unit attacker) { }
public virtual void OnArmorBreak(Unit unit, Unit attacker) { }
public virtual void OnDefeat(Unit unit, Unit attacker) { }
public virtual void OnEnterBattleGround(Unit unit) { }
public virtual void OnExitBattleGround(Unit unit) { }
public virtual void OnDraw(Unit unit) { }
public virtual void OnRecovered(Unit unit, Unit helper) { }
public virtual void OnEquippingArmor(Unit unit, int armorAmount) { }
public virtual void OnDiscard(Unit unit) { }
public virtual void OnCastStragedy(List<Unit> targets) { }
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 27a2e411b169b994891c431e7a183368
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: bebb282b5d98d3649bcb4e43de3f2de3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,14 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "ArcherClass", menuName = "Card Class/Archer Class Data")]
public class ArcherClass : UnitClass
{
public int extraAttackRange = 2;
public override void ApplyClassSpecilization(Unit unit)
{
unit.MeleeAttackRange = 0;
unit.RangedAttackRange += extraAttackRange;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 1bc96940f74c4ce4581f5cdec90d1e0b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,13 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "CavalryClass", menuName = "Card Class/Cavalry Class Data")]
public class CavalryClass : UnitClass
{
public int extraMovement = 1;
public override void ApplyClassSpecilization(Unit unit)
{
unit.Movement += extraMovement;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e099c37da90ac1b46ac0a5ee6f79f507
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "InfantryClass", menuName = "Card Class/Infantry Class Data")]
public class InfantryClass : UnitClass
{
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 52ce9ab65798e6c46a62ac364d881763
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "New Card Data", menuName = "Card/Card Data")]
public class CardData : ScriptableObject
{
public new string name;
@ -13,7 +14,5 @@ public class CardData : ScriptableObject
public int attack;
public int defense;
public CardTag[] tags;
public UnitClass[] unitClasses;
public Ability[] abilities;
public CardTag[] cardTags;
}

View File

@ -7,4 +7,6 @@ public class CardTag : ScriptableObject
{
public new string name;
public string description;
public Sprite artwork;
}

View File

@ -15,6 +15,7 @@ public class CellMap : MonoBehaviour
public int column = 0;
public int row = 0;
// Start is called before the first frame update
void Start()
{
@ -41,9 +42,4 @@ public class CellMap : MonoBehaviour
{
return cellMapData[y].cells[x];
}
public bool IsCellEmpty(int x, int y)
{
return GetCell(x, y).standingUnit == null;
}
}

View File

@ -1,162 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Left is Player, right is enemy.
public enum Side { left = 1, right = -1 }
public class CombatManager : MonoBehaviour
{
[SerializeField] private List<Unit> leftSideUnits = new List<Unit>();
[SerializeField] private List<Unit> rightSideUnits = new List<Unit>();
[SerializeField] private CellMap cellMap;
// Start is called before the first frame update
void Start()
{
// hack
cellMap = FindObjectOfType<CellMap>();
foreach (var unit in rightSideUnits)
{
foreach (var ability in unit.Abilities)
{
ability.OnPlaceUnit(unit);
}
}
foreach (var unit in rightSideUnits)
{
foreach (var ability in unit.Abilities)
{
ability.OnEnterBattleGround(unit);
}
}
}
List<Unit> QueryTargets(Unit attacker)
{
// TO DO:
return new List<Unit>();
}
// Called once before drawing cards
void BeginFight()
{
}
void BeginRound(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
foreach (var ability in unit.Abilities)
{
ability.OnBeginRound(unit);
}
}
}
void BeginMovePhase(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
foreach (var ability in unit.Abilities)
{
ability.OnBeginMovePhase(unit);
}
}
}
void EndMovePhase(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
foreach (var ability in unit.Abilities)
{
ability.OnEndMovePhase(unit);
}
}
}
void BeginAttackPhase(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
foreach (var ability in unit.Abilities)
{
ability.OnBeginAttackPhase(unit);
}
}
}
void UnitAttack(Unit unit, List<Unit> targets)
{
foreach (var ability in unit.Abilities)
{
ability.OnBeginAttack(unit, targets);
}
foreach (var ability in unit.Abilities)
{
ability.OnAttack(unit, targets);
}
foreach (var ability in unit.Abilities)
{
ability.OnEndAttack(unit, targets);
}
foreach (var target in targets)
{
foreach (var ability in target.Abilities)
{
ability.OnCounterAttack(target, unit);
}
}
}
void Attack(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
UnitAttack(unit, QueryTargets(unit));
}
}
void EndAttackPhase(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
foreach (var ability in unit.Abilities)
{
ability.OnEndAttackPhase(unit);
}
}
}
void EndRound(Side side)
{
List<Unit> units = side == Side.left ? leftSideUnits : rightSideUnits;
foreach (var unit in units)
{
foreach (var ability in unit.Abilities)
{
ability.OnEndRound(unit);
}
}
}
// Called once after result
void EndFight()
{
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ab8c50f6a5fd9be488ffeb604ccbc9fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,46 +2,56 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class Deck : MonoBehaviour
{
public List<CardData> cardDataList;
public List<CardData> drawList;
// Control Card Display
public List<GameObject> drawDisplayList;
public List<CardData> handList;
public List<CardData> discardList;
// Control Card Display
public List<GameObject> discardDisplayList;
public List<CardData> wasteList;
public int randomSeed;
public GameObject handCardTemplate;
public GameObject cardDisplayTemplate;
private GameObject cardTemplate;
private GameObject handListContent;
private GameObject drawListContent;
private GameObject discardListContent;
// Card Limit
public int maxCardinHandLimit = 10;
public int maxCardRemainLimit = 5;
private GameObject reachCardinHandLimitWarningDisplay;
private float warningDisplayCountDown;
private float warningDisplayTime = 1.0f;
private GameObject discardHoldingListContent;
private TextMeshProUGUI discardWarningDisplayText;
public GameObject drawListContent;
public GameObject discardListContent;
// Start is called before the first frame update
void Start()
{
drawListContent = transform.Find("DrawList/Viewport/Content").gameObject;
drawListContent.transform.parent.parent.gameObject.SetActive(false);
discardListContent = transform.Find("DiscardList/Viewport/Content").gameObject;
discardListContent.transform.parent.parent.gameObject.SetActive(false);
handListContent = transform.Find("Content/HandList/Viewport/Content").gameObject;
cardTemplate = transform.Find("CardTemplate").gameObject;
reachCardinHandLimitWarningDisplay = transform.Find("Content/LimitWarning").gameObject;
reachCardinHandLimitWarningDisplay.SetActive(false);
discardHoldingListContent = transform.Find("Content/DiscardHoldingList/Viewport/HoldingListContent").gameObject;
discardHoldingListContent.transform.parent.parent.gameObject.SetActive(false);
discardWarningDisplayText = transform.Find("Content/DiscardHoldingList/Viewport/DiscardWarning/Text").gameObject.GetComponent<TextMeshProUGUI>();
randomSeed = 200;
Random.InitState(randomSeed);
for (int i = 0; i < cardDataList.Count; i++)
{
drawList.Add(cardDataList[i]);
GameObject tempDrawDisplay = Instantiate(cardDisplayTemplate.gameObject, transform.Find("DrawListContent/Viewport/Content"));
GameObject tempDrawDisplay = Instantiate(cardTemplate.gameObject, transform.Find("DrawList/Viewport/Content"));
tempDrawDisplay.transform.Find("Card").gameObject.GetComponent<CardDisplay>().SetCardData(cardDataList[i]);
tempDrawDisplay.transform.Find("Button").gameObject.GetComponent<Image>().sprite = cardDataList[i].artwork;
tempDrawDisplay.SetActive(true);
drawDisplayList.Add(tempDrawDisplay);
}
drawListContent.SetActive(false);
discardListContent.SetActive(false);
}
// Update is called once per frame
@ -50,26 +60,37 @@ public class Deck : MonoBehaviour
}
private void FixedUpdate()
{
if (warningDisplayCountDown >= 0.0f)
{
warningDisplayCountDown -= Time.deltaTime;
if (warningDisplayCountDown <= 0.0f)
{
DeactivateCardInHandLimitWarning();
}
}
}
public void DrawCards(int amount)
{
for (int i = 0; i < amount; i++)
{
if (drawList.Count == 0)
if (handListContent.transform.childCount > maxCardinHandLimit - 1)
{
ActivateCardInHandLimitWarning();
return;
}
if (drawListContent.transform.childCount == 0)
{
Shuffle();
}
if(drawList.Count==0)
if (drawListContent.transform.childCount == 0)
{
return;
}
int randomIndex = Random.Range(0, drawList.Count);
GameObject cardObj = Instantiate(handCardTemplate.gameObject, transform.Find("Content/HandList"));
cardObj.SetActive(true);
cardObj.transform.Find("Card").gameObject.GetComponent<CardDisplay>().SetCardData(drawList[randomIndex]);
cardObj.transform.Find("Button").gameObject.GetComponent<Image>().sprite = drawList[randomIndex].artwork;
drawList.RemoveAt(randomIndex);
Destroy(drawDisplayList[randomIndex]);
drawDisplayList.RemoveAt(randomIndex);
int randomIndex = Random.Range(0, drawListContent.transform.childCount);
drawListContent.transform.GetChild(randomIndex).transform.SetParent(handListContent.transform);
}
}
@ -83,74 +104,116 @@ public class Deck : MonoBehaviour
//}
//else
//{
discardList.Add(handList[index]);
//}
handList.RemoveAt(index);
}
public void UseThisCard(GameObject card)
{
GameObject tempDiscardDisplay = Instantiate(cardDisplayTemplate.gameObject, transform.Find("DiscardListContent/Viewport/Content"));
tempDiscardDisplay.SetActive(true);
tempDiscardDisplay.transform.Find("Card").gameObject.GetComponent<CardDisplay>().SetCardData(card.transform.Find("Card").gameObject.gameObject.GetComponent<CardDisplay>().cardData);
tempDiscardDisplay.transform.Find("Button").gameObject.GetComponent<Image>().sprite = card.transform.Find("Card").gameObject.gameObject.GetComponent<CardDisplay>().cardData.artwork;
discardDisplayList.Add(tempDiscardDisplay);
discardList.Add(card.transform.Find("Card").gameObject.gameObject.GetComponent<CardDisplay>().cardData);
Destroy(card);
if(card.transform.parent == handListContent.transform)
{
if (!discardHoldingListContent.transform.parent.parent.gameObject.activeSelf)
{
// Use card in hand
card.transform.SetParent(discardListContent.transform);
}
else if (handListContent.transform.childCount > maxCardRemainLimit)
{
// Put card in discard holding list
card.transform.SetParent(discardHoldingListContent.transform);
}
}
else if (card.transform.parent == discardHoldingListContent.transform)
{
card.transform.SetParent(handListContent.transform);
}
else if (card.transform.parent == drawListContent.transform)
{
// card in draw list
Debug.Log("Card in Draw list");
}
else if (card.transform.parent == discardListContent.transform)
{
// card in discard list
Debug.Log("Card in Discard list");
}
}
// When unit dead
public void AddACardIntoDiscardList(CardData card)
{
discardList.Add(card);
}
public void Shuffle()
{
// Put all cards in drawList into discardList
for (int i = 0; i < drawList.Count; i++)
while (drawListContent.transform.childCount != 0)
{
discardList.Add(drawList[i]);
Destroy(drawDisplayList[i]);
drawListContent.transform.GetChild(drawListContent.transform.childCount - 1).SetParent(discardListContent.transform);
}
drawDisplayList.Clear();
drawList.Clear();
while (discardList.Count != 0)
while (discardListContent.transform.childCount != 0)
{
int index = Random.Range(0, discardList.Count);
drawList.Add(discardList[index]);
GameObject tempCardDisplay = Instantiate(cardDisplayTemplate.gameObject, transform.Find("DrawListContent/Viewport/Content"));
tempCardDisplay.transform.Find("Card").gameObject.GetComponent<CardDisplay>().SetCardData(discardList[index]);
tempCardDisplay.transform.Find("Button").gameObject.GetComponent<Image>().sprite = discardList[index].artwork;
tempCardDisplay.SetActive(true);
drawDisplayList.Add(tempCardDisplay);
discardList[index] = discardList[discardList.Count - 1];
discardList.RemoveAt(discardList.Count - 1);
int index = Random.Range(0, discardListContent.transform.childCount);
discardListContent.transform.GetChild(index).transform.SetParent(drawListContent.transform);
};
for (int i = 0; i < discardDisplayList.Count; i++)
{
Destroy(discardDisplayList[i]);
}
}
public void ActivateDisplayDrawList()
{
drawListContent.SetActive(true);
drawListContent.transform.parent.parent.gameObject.SetActive(true);
}
public void DeactivateDisplayDrawList()
{
drawListContent.SetActive(false);
drawListContent.transform.parent.parent.gameObject.SetActive(false);
}
public void ActivateDisplayDiscardList()
{
discardListContent.SetActive(true);
discardListContent.transform.parent.parent.gameObject.SetActive(true);
}
public void DeactivateDisplayDiscardList()
{
discardListContent.SetActive(false);
discardListContent.transform.parent.parent.gameObject.SetActive(false);
}
private void ActivateCardInHandLimitWarning()
{
reachCardinHandLimitWarningDisplay.SetActive(true);
warningDisplayCountDown = warningDisplayTime;
}
private void DeactivateCardInHandLimitWarning()
{
reachCardinHandLimitWarningDisplay.SetActive(false);
}
public void EndRound()
{
if (handListContent.transform.childCount > maxCardRemainLimit)
{
ActivateDiscardWarning();
}
}
private void ActivateDiscardWarning()
{
discardHoldingListContent.transform.parent.parent.gameObject.SetActive(true);
discardWarningDisplayText.text = string.Format("Choose {0} Card(s) to Discard", handListContent.transform.childCount - maxCardRemainLimit);
}
public void DiscardHoldingListCards()
{
while (discardHoldingListContent.transform.childCount != 0)
{
discardHoldingListContent.transform.GetChild(discardHoldingListContent.transform.childCount - 1).SetParent(discardListContent.transform);
}
if (handListContent.transform.childCount <= maxCardRemainLimit)
{
discardHoldingListContent.transform.parent.parent.gameObject.SetActive(false);
}
}
}

View File

@ -7,10 +7,13 @@ using TMPro;
public enum CurrentCommand { defend, moveForward, retreat }
// Left is Player, Enemy is right.
public enum Side { left = 1, right = -1 }
public class Unit : MonoBehaviour
{
public string unitName;
public CardData baseData;
public CardData cardData;
[SerializeField]
private int basicAttack;
@ -24,42 +27,12 @@ public class Unit : MonoBehaviour
private int finalMaxDefense;
[SerializeField]
private List<CardTag> cardTags;
private CardTag[] cardTags;
[SerializeField]
private List<UnitClass> unitClasses;
[SerializeField]
private List<Ability> abilities;
public List<Ability> Abilities
{
get { return abilities; }
set { abilities = value; }
}
[SerializeField]
private int meleeAttackRange = 1;
public int MeleeAttackRange
{
get { return meleeAttackRange; }
set { meleeAttackRange = value; }
}
[SerializeField]
private int rangedAttackRange = 1;
public int RangedAttackRange
{
get { return rangedAttackRange; }
set { rangedAttackRange = value; }
}
private int attackRange = 1;
[SerializeField]
private int movement = 1;
public int Movement
{
get { return movement; }
set { movement = value; }
}
[SerializeField]
private CurrentCommand currentCommand;
@ -80,11 +53,6 @@ public class Unit : MonoBehaviour
Camp allyCamp;
Camp enemyCamp;
public bool isUnitAlive()
{
return currentDefense > 0;
}
// Start is called before the first frame update
void Start()
{
@ -93,19 +61,24 @@ public class Unit : MonoBehaviour
transform.position = new Vector3(transform.position.x, transform.position.y, -1);
standingCell.standingUnit = this;
basicAttack = baseData.attack;
basicMaxDefense = baseData.defense;
basicAttack = cardData.attack;
basicMaxDefense = cardData.defense;
currentDefense = basicMaxDefense;
cardTags = baseData.tags.ToList();
unitClasses = baseData.unitClasses.ToList();
abilities = baseData.abilities.ToList();
cardTags = cardData.cardTags;
foreach (var unitClass in unitClasses)
foreach (var tag in cardData.cardTags)
{
unitClass.ApplyClassSpecilization(this);
if (tag.name == "Archer")
{
attackRange += 2;
}
else if (tag.name == "Cavalry")
{
movement += 1;
}
}
modelArt.GetComponent<SpriteRenderer>().sprite = baseData.artwork;
modelArt.GetComponent<SpriteRenderer>().sprite = cardData.artwork;
var camps = FindObjectsOfType<Camp>();
foreach (var camp in camps)
@ -121,7 +94,8 @@ public class Unit : MonoBehaviour
}
}
void UpdateAnimation()
// Update is called once per frame
void Update()
{
if (walkingToDestination && destinationCell && transform.position != destinationCell.transform.position)
{
@ -140,22 +114,13 @@ public class Unit : MonoBehaviour
//Debug.Log("Arrived.");
}
}
}
void UpdateText()
{
finalAttack = basicAttack; // For now.
attackText.GetComponent<TextMeshProUGUI>().text = finalAttack.ToString();
defenseText.GetComponent<TextMeshProUGUI>().text = currentDefense.ToString();
}
// Update is called once per frame
void Update()
{
UpdateAnimation();
finalAttack = basicAttack; // For now.
UpdateText();
}
public void MoveAndAttack()
{
MoveAction();
@ -168,34 +133,39 @@ public class Unit : MonoBehaviour
{
return;
}
// hack
if (rangedAttackRange > 0)
foreach (var tag in cardData.cardTags)
{
for (int i = 0; i < rangedAttackRange; ++i)
if (tag.name == "Archer")
{
int attackXPos = standingCell.xPos + (i + 1) * (int)side;
if (attackXPos >= cellMap.column || attackXPos < 0)
for (int i = 0; i < attackRange; ++i)
{
// Attack Camp
currentCommand = CurrentCommand.defend;
break;
}
Cell nextCellInRange = cellMap.GetCell(attackXPos, standingCell.yPos);
Unit targetUnit = nextCellInRange.standingUnit;
if (targetUnit)
{
if (targetUnit.side != side)
int attackXPos = standingCell.xPos + (i + 1) * (int)side;
if (attackXPos >= cellMap.column || attackXPos < 0)
{
// Add units to attack list.
// Attack Camp
currentCommand = CurrentCommand.defend;
break;
}
}
currentCommand = CurrentCommand.moveForward;
Cell nextCellInRange = cellMap.GetCell(attackXPos, standingCell.yPos);
Unit targetUnit = nextCellInRange.standingUnit;
if (targetUnit)
{
if (targetUnit.side != side)
{
// Add units to attack list.
currentCommand = CurrentCommand.defend;
break;
}
}
currentCommand = CurrentCommand.moveForward;
}
break;
}
}
//Debug.Log("Call MoveAction().");
switch (currentCommand)
{
@ -263,14 +233,21 @@ public class Unit : MonoBehaviour
public void AttackAction()
{
// Check if this unit is ranged unit
if (rangedAttackRange > 0)
// Check Attack Range
if (inDogFight(this))
{
return;
foreach (var tag in cardData.cardTags)
{
if (tag.name == "Archer")
{
// Archer can't dog fight.
return;
}
}
}
List<Unit> unitsInRange = new List<Unit>();
for (int i = 0; i < meleeAttackRange; ++i)
for (int i = 0; i < attackRange; ++i)
{
int attackXPos = standingCell.xPos + (i+1) * (int)side;
if (attackXPos >= cellMap.column || attackXPos < 0)
@ -330,6 +307,11 @@ public class Unit : MonoBehaviour
}
}
public bool isUnitAlive()
{
return currentDefense > 0;
}
bool checkDestinationCellEmpty(bool retreat = false)
{
int currentXPos = standingCell.xPos;

View File

@ -1,12 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnitClass : ScriptableObject
{
public new string name;
public string description;
public Sprite artwork;
public virtual void ApplyClassSpecilization(Unit unit) { }
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7d6c417b0c9236b4a915f410e56db822
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -25,6 +25,12 @@ public class UnitManager : MonoBehaviour
}
}
// Update is called once per frame
void Update()
{
}
public void handleDiedUnit(Unit unit)
{
if (unit.side == Side.left)
@ -33,7 +39,7 @@ public class UnitManager : MonoBehaviour
}
else if (unit.side == Side.right)
{
rightSideUnits.Remove(unit);
leftSideUnits.Remove(unit);
}
}