-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit: Added the ability 'Burrow' for the 'Mole'
- Loading branch information
Showing
16 changed files
with
378 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
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,34 @@ | ||
package store | ||
|
||
import "time" | ||
|
||
type AbilitySplit struct { | ||
// UnitID is the other unit | ||
// that belong to this Split. | ||
// The bounty must only be given | ||
// when all are dead | ||
UnitID string `mapstructure:"UnitID"` | ||
} | ||
|
||
const ( | ||
burrowTime = time.Second * 15 | ||
maxBurrowTime = time.Second * 45 | ||
) | ||
|
||
type AbilityBurrow struct { | ||
// BurrowAt is the time in which it was burrowed. | ||
// It'll stay there for 15s and then the next unit | ||
// that steps on it it'll pop up again. | ||
// If in 45s no unit stept on it it'll unburrow | ||
// itself up | ||
BurrowAt time.Time `mapstructure:"BurrowAt"` | ||
Unburrowed bool `mapstructure:"Unburrowed"` | ||
} | ||
|
||
func (ab AbilityBurrow) CanUnburrow(t time.Time) bool { | ||
return t.Sub(ab.BurrowAt) > burrowTime | ||
} | ||
|
||
func (ab AbilityBurrow) MustUnburrow(t time.Time) bool { | ||
return t.Sub(ab.BurrowAt) > maxBurrowTime | ||
} |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
package store | ||
|
||
type Buffs struct { | ||
Burrowed *BuffBurrowed | ||
} | ||
|
||
type BuffBurrowed struct{} |
Oops, something went wrong.