Skip to content

Commit

Permalink
Damageable Code added to Moss Giant. Combat Distance set.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLaFritz committed Jul 14, 2021
1 parent e4f3574 commit 06c6aec
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
30 changes: 19 additions & 11 deletions Assets/Dungeon Escape Mobile/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -174646,7 +174646,7 @@ Tilemap:
- {fileID: 21300052, guid: db7fee7797a3d4531848c2d3c1bf6ce3, type: 3}
- {fileID: 21300056, guid: db7fee7797a3d4531848c2d3c1bf6ce3, type: 3}
- {fileID: 21300060, guid: db7fee7797a3d4531848c2d3c1bf6ce3, type: 3}
m_AnimationSpeed: 5
m_AnimationSpeed: 5.0000005
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 36, y: -13, z: 0}
Expand Down Expand Up @@ -174751,7 +174751,7 @@ Tilemap:
- {fileID: 21300052, guid: db7fee7797a3d4531848c2d3c1bf6ce3, type: 3}
- {fileID: 21300056, guid: db7fee7797a3d4531848c2d3c1bf6ce3, type: 3}
- {fileID: 21300060, guid: db7fee7797a3d4531848c2d3c1bf6ce3, type: 3}
m_AnimationSpeed: 5.0000005
m_AnimationSpeed: 5
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 41, y: -13, z: 0}
Expand Down Expand Up @@ -175603,7 +175603,7 @@ Tilemap:
- {fileID: 21300054, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300056, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300058, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
m_AnimationSpeed: 15
m_AnimationSpeed: 15.000001
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 15, y: -7, z: 0}
Expand Down Expand Up @@ -175963,7 +175963,7 @@ Tilemap:
- {fileID: 21300054, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
- {fileID: 21300056, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
- {fileID: 21300058, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
m_AnimationSpeed: 15.000001
m_AnimationSpeed: 15
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 13, y: -5, z: 0}
Expand Down Expand Up @@ -176215,7 +176215,7 @@ Tilemap:
- {fileID: 21300054, guid: fe5d55fda73284d578e2308ee216ae69, type: 3}
- {fileID: 21300056, guid: fe5d55fda73284d578e2308ee216ae69, type: 3}
- {fileID: 21300058, guid: fe5d55fda73284d578e2308ee216ae69, type: 3}
m_AnimationSpeed: 15.000001
m_AnimationSpeed: 15
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 14, y: -4, z: 0}
Expand Down Expand Up @@ -176683,7 +176683,7 @@ Tilemap:
- {fileID: 21300054, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300056, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300058, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
m_AnimationSpeed: 15.000001
m_AnimationSpeed: 15
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 13, y: -2, z: 0}
Expand Down Expand Up @@ -176899,7 +176899,7 @@ Tilemap:
- {fileID: 21300054, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
- {fileID: 21300056, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
- {fileID: 21300058, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
m_AnimationSpeed: 15
m_AnimationSpeed: 15.000001
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: -3, y: -1, z: 0}
Expand Down Expand Up @@ -177727,7 +177727,7 @@ Tilemap:
- {fileID: 21300054, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300056, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300058, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
m_AnimationSpeed: 15.000001
m_AnimationSpeed: 15
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: -12, y: 2, z: 0}
Expand Down Expand Up @@ -177907,7 +177907,7 @@ Tilemap:
- {fileID: 21300054, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300056, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
- {fileID: 21300058, guid: 8de99d5a1cb5e490f918c041c6d12f30, type: 3}
m_AnimationSpeed: 15.000001
m_AnimationSpeed: 15
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 15, y: 2, z: 0}
Expand Down Expand Up @@ -177979,7 +177979,7 @@ Tilemap:
- {fileID: 21300054, guid: fe5d55fda73284d578e2308ee216ae69, type: 3}
- {fileID: 21300056, guid: fe5d55fda73284d578e2308ee216ae69, type: 3}
- {fileID: 21300058, guid: fe5d55fda73284d578e2308ee216ae69, type: 3}
m_AnimationSpeed: 15
m_AnimationSpeed: 15.000001
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: -13, y: 3, z: 0}
Expand Down Expand Up @@ -178339,7 +178339,7 @@ Tilemap:
- {fileID: 21300054, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
- {fileID: 21300056, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
- {fileID: 21300058, guid: 4a492d99503fa410f86d547985e5cfa5, type: 3}
m_AnimationSpeed: 15
m_AnimationSpeed: 15.000001
m_AnimationTimeOffset: 0
m_IsLooping: 1
- first: {x: 13, y: 5, z: 0}
Expand Down Expand Up @@ -231140,6 +231140,14 @@ PrefabInstance:
propertyPath: m_Layer
value: 12
objectReference: {fileID: 0}
- target: {fileID: 9202079216611228565, guid: deb710c69e236e24e96c409408271212, type: 3}
propertyPath: m_combatDistance
value: 1.75
objectReference: {fileID: 0}
- target: {fileID: 9202079216611228565, guid: deb710c69e236e24e96c409408271212, type: 3}
propertyPath: m_combatCheckOffset.y
value: -0.75
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 9202079216611228567, guid: deb710c69e236e24e96c409408271212, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: deb710c69e236e24e96c409408271212, type: 3}
13 changes: 12 additions & 1 deletion Assets/Dungeon Escape Mobile/Scripts/Enemy/MossGiant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ public class MossGiant : Enemy, IDamageable
#region Implementation of IDamageable

/// <inheritdoc />
public void Damage(int amount) { }
public void Damage(int amount)
{
TriggerGotHit();

// Subtract amount from health
Health -= amount;

if (Health < 1)
{
Destroy(gameObject);
}
}

#endregion
}

0 comments on commit 06c6aec

Please sign in to comment.