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
92bc6971
Commit
92bc6971
authored
2 years ago
by
Robin Halseth Sandvik
Browse files
Options
Downloads
Patches
Plain Diff
Implemented new system for attacks.
parent
82653d92
No related branches found
Branches containing commit
No related tags found
1 merge request
!25
Ability rework.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs
+25
-10
25 additions, 10 deletions
MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs
with
25 additions
and
10 deletions
MrBigsock/Assets/Code/Core/Abilities/BasicProjectile1.cs
+
25
−
10
View file @
92bc6971
...
...
@@ -16,17 +16,19 @@ namespace BigSock {
//protected static readonly GameObject PROJECTILE_BASE = new AttackMovement();
public
const
string
PROJECTILE_NAME
=
"attack"
;
/*
The attack stats of the ability.
*/
public
IAttackStats
AttackStats
{
get
;
set
;
}
public
override
ulong
Id
=>
101
;
public
override
string
Name
=>
"Basic Player Projectile Attack"
;
public
override
string
Description
=>
"A basic projectile shooting attack the player has."
;
public
BasicProjectile1
()
{
Name
=
"Basic Player Projectile Attack"
;
Id
=
101
;
Description
=
"A basic projectile shooting attack the player has."
;
AttackStats
=
new
AttackStats
{
Damage
=
1f
,
Knockback
=
1f
,
Range
=
10f
,
ProjectileSpeed
=
10f
,
AttackSpeed
=
1f
,
};
}
...
...
@@ -38,8 +40,21 @@ namespace BigSock {
This should be overridden in sub-classes for the actual abilities.
*/
protected
override
bool
Activate
(
Character
actor
,
Vector3
?
target
)
{
if
(
target
==
null
)
return
false
;
var
attack
=
(
AttackStats
)
AttackStats
.
Apply
(
actor
.
Stats
);
attack
.
Actor
=
actor
;
var
temp
=
(
target
.
Value
-
actor
.
transform
.
position
);
temp
.
z
=
0
;
var
bullet
=
PrefabService
.
SINGLETON
.
Instance
(
PROJECTILE_NAME
,
actor
.
transform
.
position
);
bullet
.
GetComponent
<
AttackMovement
>().
Actor
=
actor
;
var
bulletScript
=
bullet
.
GetComponent
<
AttackMovement
>();
//bulletScript.Actor = actor;
bulletScript
.
Stats
=
attack
;
bulletScript
.
Direction
=
temp
.
normalized
;
//MonoBehaviour.Instantiate(PROJECTILE_BASE, (Vector3) actor.transform.position, PROJECTILE_BASE.transform.rotation);
return
true
;
...
...
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