Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mr BigSock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gard Aleksander Furre
Mr BigSock
Commits
10754bf0
Commit
10754bf0
authored
2 years ago
by
Robin Halseth Sandvik
Browse files
Options
Downloads
Patches
Plain Diff
Added ability properties for charging.
parent
cde5b976
No related branches found
Branches containing commit
No related tags found
1 merge request
!56
New ability fire rework. (Charging)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs
+29
-0
29 additions, 0 deletions
MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs
MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs
+23
-0
23 additions, 0 deletions
MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs
with
52 additions
and
0 deletions
MrBigsock/Assets/Code/Core/Abilities/Base/BaseAbility.cs
+
29
−
0
View file @
10754bf0
...
...
@@ -61,6 +61,26 @@ namespace BigSock {
public
float
HPCost
{
get
;
protected
set
;
}
/*
--------------------
Charging related properties.
--------------------
*/
/*
What kind of firetype this ability uses.
*/
public
FireType
FireType
{
get
;
protected
set
;
}
/*
The minimum time in seconds the ability needs to be charged.
*/
public
float
MinCharge
{
get
;
protected
set
;
}
=
0.1f
;
/*
The maximum time in seconds the ability before the ability is fully charged.
*/
public
float
MaxCharge
{
get
;
protected
set
;
}
=
0.2f
;
...
...
@@ -71,6 +91,15 @@ namespace BigSock {
*/
public
bool
Use
(
IAbilityParam
par
)
{
var
actor
=
par
.
Actor
;
// Check the charging
if
(
FireType
==
FireType
.
Charge
)
{
// Check that we charged the minimum time.
if
(
par
.
ChargeTime
<
MinCharge
)
return
false
;
// Calculate how much optional charging we did.
par
.
ChargeTimePercent
=
Math
.
Clamp
(
par
.
ChargeTime
-
MinCharge
/
MaxCharge
-
MinCharge
,
0f
,
1f
);
}
// Check that the ability is cooled down.
if
(
Ready
)
{
...
...
This diff is collapsed.
Click to expand it.
MrBigsock/Assets/Code/Core/Abilities/Base/IAbility.cs
+
23
−
0
View file @
10754bf0
...
...
@@ -60,6 +60,29 @@ namespace BigSock {
/*
--------------------
Charging related properties.
--------------------
*/
/*
What kind of firetype this ability uses.
*/
FireType
FireType
{
get
;
}
/*
The minimum time in seconds the ability needs to be charged.
*/
float
MinCharge
{
get
;
}
/*
The maximum time in seconds the ability before the ability is fully charged.
*/
float
MaxCharge
{
get
;
}
/*
-----------------------------
Add in something for costs.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment