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
4e31861b
Commit
4e31861b
authored
2 years ago
by
Robin Halseth Sandvik
Browse files
Options
Downloads
Patches
Plain Diff
Added new item trigger types and character events.
parent
0c7479bd
Branches
main
No related tags found
1 merge request
!22
Implemented initial version of conditional items.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MrBigsock/Assets/Code/Character.cs
+96
-1
96 additions, 1 deletion
MrBigsock/Assets/Code/Character.cs
MrBigsock/Assets/Code/Item/Base/TriggerType.cs
+19
-4
19 additions, 4 deletions
MrBigsock/Assets/Code/Item/Base/TriggerType.cs
with
115 additions
and
5 deletions
MrBigsock/Assets/Code/Character.cs
+
96
−
1
View file @
4e31861b
...
...
@@ -7,7 +7,7 @@ using BigSock.Item;
namespace
BigSock
{
// Common class for all characters.
public
class
Character
:
Entity
{
public
partial
class
Character
:
Entity
{
/*
Attack speed of the character.
...
...
@@ -214,4 +214,99 @@ namespace BigSock {
}
}
/*
Events
*/
public
partial
class
Character
{
/*
Triggers when character uses an attack.
Params: actor, attack stats.
*/
public
event
Action
<
Character
,
AttackStats
>
OnFire
;
/*
Triggers when character hits an enemy.
Params: actor, target, attack stats.
*/
public
event
Action
<
Character
,
Character
,
AttackStats
>
OnHit
;
/*
Triggers when character kills an enemy.
Params: actor, target, attack stats.
*/
public
event
Action
<
Character
,
Character
,
AttackStats
>
OnKill
;
/*
Triggers when character takes damage.
Params: actor, target, attack stats.
(Target here is the character that dealt damage to this one)
*/
public
event
Action
<
Character
,
Character
,
AttackStats
>
OnTakeDamage
;
/*
Triggers when character heals back health.
Params: actor, amount.
(Add heal source later on)
*/
public
event
Action
<
Character
,
int
>
OnHeal
;
/*
Triggers when character has taken fatal damage.
(This is before the character is killed, so can be used to prevent death)
Params: actor, target, attack stats.
(Target here is the character that dealt damage to this one)
*/
public
event
Action
<
Character
,
Character
,
AttackStats
>
OnDeath
;
/*
Triggers when character picked up an item.
Params: actor, item.
*/
public
event
Action
<
Character
,
IItem
>
OnPickedUpItem
;
/*
Triggers when character gains xp.
Params: actor, amount.
*/
public
event
Action
<
Character
,
int
>
OnGainedXP
;
/*
Triggers when character levels up.
Params: actor.
*/
public
event
Action
<
Character
>
OnLevelUp
;
/*
Triggers when character enters a new room.
Params: actor.
(Add room object later)
*/
public
event
Action
<
Character
>
OnEnterNewRoom
;
/*
Triggers when character clears a room.
Params: actor.
(Add room object later)
*/
public
event
Action
<
Character
>
OnClearedRoom
;
/*
Triggers when character enters a new level.
Params: actor.
(Add level object later)
*/
public
event
Action
<
Character
>
OnEnterNewStage
;
}
}
This diff is collapsed.
Click to expand it.
MrBigsock/Assets/Code/Item/Base/TriggerType.cs
+
19
−
4
View file @
4e31861b
...
...
@@ -12,9 +12,24 @@ namespace BigSock.Item {
*/
public
enum
TriggerType
{
None
,
OnKill
,
OnAttack
,
OnHit
,
OnDamage
,
// Target
Fire
,
Hit
,
Kill
,
// Actor
TakeDamage
,
Heal
,
Death
,
PickedUpItem
,
GainedXP
,
LevelUp
,
// Stage
EnterNewRoom
,
ClearedRoom
,
EnterNewStage
,
}
}
\ No newline at end of file
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