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
Merge requests
!39
Gardaf
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Gardaf
gardaf
into
main
Overview
0
Commits
4
Pipelines
0
Changes
12
Merged
Gard Aleksander Furre
requested to merge
gardaf
into
main
2 years ago
Overview
0
Commits
4
Pipelines
0
Changes
12
Expand
0
0
Merge request reports
Compare
main
version 1
58ed2ab9
2 years ago
main (base)
and
latest version
latest version
2cc9dd00
4 commits,
2 years ago
version 1
58ed2ab9
3 commits,
2 years ago
12 files
+
1276
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
MrBigsock/Assets/Code/Core/Abilities/BasicArrow.cs
0 → 100644
+
75
−
0
Options
using
System.Collections
;
using
System
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.InputSystem
;
using
BigSock.Service
;
namespace
BigSock
{
/*
Basic projectile attack for the player..
*/
public
class
BasicArrow
:
BaseAttack
{
//protected static readonly GameObject PROJECTILE_BASE = new AttackMovement();
public
const
string
PROJECTILE_NAME
=
"bullets/enemy_arrow"
;
public
override
ulong
Id
=>
103
;
public
override
string
Name
=>
"Basic Player Projectile Attack"
;
public
override
string
Description
=>
"A basic projectile shooting attack the player has."
;
public
BasicArrow
()
{
AttackStats
=
new
AttackStats
{
Damage
=
1f
,
Knockback
=
1f
,
Range
=
10f
,
ProjectileSpeed
=
10f
,
AttackSpeed
=
1f
,
CritChance
=
0.1f
,
CritDamageModifier
=
2f
,
};
}
/*
Activates the ability.
Returns true if the ability was successfully activated.
- Even if nothing was hit, used to indicate that cooldowns should be updated.
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
.
Calculate
(
actor
.
Stats
);
//var attack = (AttackStats) AttackStats.Apply(actor.Stats);
attack
.
Actor
=
actor
;
var
temp
=
(
target
.
Value
-
actor
.
transform
.
position
);
var
temp1
=
temp
;
temp
.
z
=
0
;
temp1
.
z
=
90
;
var
bullet
=
PrefabService
.
SINGLETON
.
Instance
(
PROJECTILE_NAME
,
actor
.
transform
.
position
);
//bullet.transform.rotation = Quaternion.LookRotation(temp.normalized);
bullet
.
transform
.
rotation
=
Quaternion
.
LookRotation
(
temp1
,
Vector3
.
up
);
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
;
}
}
}
\ No newline at end of file
Loading