Skip to content
Snippets Groups Projects
Commit ec33d9f2 authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Removed iframes from enemies.

- Set the IFrameDuration on hit to 0 in character.
- Made PlayerController override it so only players have it.
- Also fixed bug where only default duration would be used for all iframes.
parent f2d7b183
No related branches found
No related tags found
Loading
......@@ -545,9 +545,9 @@ namespace BigSock {
*/
public TimeSpan IFrameDuration {
get => _iFrameDuration;
private set => _iFrameDuration = value;
protected set => _iFrameDuration = value;
}
public TimeSpan _iFrameDuration = new TimeSpan(0, 0, 0, 0, 333);
public TimeSpan _iFrameDuration = new TimeSpan(0, 0, 0, 0, 0);
......@@ -676,7 +676,7 @@ namespace BigSock {
*/
public bool AddIFrames(TimeSpan amount) {
// Get when the IFrames would expire.
var nextCanTakeDamage = DateTime.Now + IFrameDuration;
var nextCanTakeDamage = DateTime.Now + amount;
// Only if that's later than current.
if(nextCanTakeDamage > NextTimeCanTakeDamage) {
......
......@@ -63,6 +63,7 @@ namespace BigSock {
public PlayerController()
{
IFrameDuration = new TimeSpan(0, 0, 0, 0, 250);
//TryPickUpItem(ItemService.SINGLETON.Get(201));
//TryPickUpItem(ItemService.SINGLETON.Get(105));
//TryPickUpItem(ItemService.SINGLETON.Get(202));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment