-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
106 additions
and
19 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
File renamed without changes.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// Modifier that hacks the affected player and fills their screen with spam. | ||
/// </summary> | ||
public class HackingModifier : MonoBehaviour, ProjectileModifier | ||
{ | ||
[SerializeField] private float damageToSpamAmount = 4; | ||
|
||
[SerializeField] | ||
private Priority priority = Priority.ARBITRARY; | ||
|
||
public Priority GetPriority() | ||
{ | ||
return priority; | ||
} | ||
|
||
public void Attach(ProjectileController projectile) | ||
{ | ||
projectile.OnColliderHit += Hack; | ||
} | ||
|
||
public void Detach(ProjectileController projectile) | ||
{ | ||
projectile.OnColliderHit -= Hack; | ||
} | ||
|
||
private void Hack(Collider collider, ref ProjectileState state) | ||
{ | ||
Debug.Log("Hitbox?"); | ||
if (!collider.TryGetComponent<HitboxController>(out var hitboxController)) | ||
return; | ||
Debug.Log("Popup?"); | ||
if (!hitboxController.health.TryGetComponent<PopupSpammer>(out var spammer)) | ||
return; | ||
Debug.Log("Popup?"); | ||
spammer.Spam(Mathf.FloorToInt(state.damage / damageToSpamAmount)); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Scripts/Augment/BulletModifiers/HackingModifier.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.