-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Add BasicAttack to all PlayerUnits
Still need to implement PerformAttack inside of BasicAttack
- Loading branch information
1 parent
4ed6e89
commit f18e554
Showing
8 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// Basic Attack | ||
/// </summary> | ||
/// Author: Sarah (GitHub: @skim74) | ||
/// 2/14/16 - Jordan (GitHub: @skorlir) - fixed properties and PerformAttack stub | ||
/// Also add inherit from MonoBehaviour so can be used as Component | ||
/// 2/14/16 | ||
public class BasicAttack : MonoBehaviour, IAttack { | ||
/// <summary> | ||
/// Private member infrastructure for properties | ||
/// </summary> | ||
private bool allowed; | ||
|
||
/// <summary> | ||
/// Does 1hp damage | ||
/// </summary> | ||
public float Damage { | ||
get { | ||
return 1f; | ||
} | ||
} | ||
/// <summary> | ||
/// Hits 100% of the time | ||
/// </summary> | ||
public float Accuracy { | ||
get { | ||
return 1f; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Displays "Basic Attack" at name of attack | ||
/// </summary> | ||
public string DisplayName { | ||
get { | ||
return "Basic Attack"; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Property getter and setter for Allowed | ||
/// </summary> | ||
public bool Allowed { | ||
get { | ||
return allowed; | ||
} | ||
set { | ||
allowed = value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Performs attack on target and returns change in health | ||
/// </summary> | ||
/// <param name="target">Unit to perform attack on</param> | ||
public float PerformAttack (Unit target) { | ||
// TODO(jordan): implement this | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters