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
0a18697f
Commit
0a18697f
authored
2 years ago
by
Robin Halseth Sandvik
Browse files
Options
Downloads
Patches
Plain Diff
Added new item that heals on kill.
parent
f8221b1e
No related branches found
Branches containing commit
No related tags found
1 merge request
!24
PrefabService & abilities
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs
+32
-0
32 additions, 0 deletions
MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs
MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs.meta
+11
-0
11 additions, 0 deletions
MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs.meta
with
43 additions
and
0 deletions
MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs
0 → 100644
+
32
−
0
View file @
0a18697f
using
System.Collections
;
using
System
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.InputSystem
;
namespace
BigSock.Item
{
/*
An item that heals the user on kill.
*/
public
class
ItemPlasticStraw
:
OnKillItemBase
{
public
override
ulong
Id
=>
202
;
public
override
string
Name
=>
"Plastic Straw"
;
public
override
string
Description
=>
"Heal the user on kill."
;
public
static
readonly
double
CHANCE
=
1.0
;
public
override
void
Handler
(
Character
source
,
Character
target
,
AttackStats
attack
)
{
// Check if it triggers.
var
roll
=
RND
.
NextDouble
();
if
(
roll
<=
CHANCE
)
{
MonoBehaviour
.
print
(
$"[ItemPlasticStraw.Handler()] Hit. (
{
roll
:
P1
}
<=
{
CHANCE
:
P1
}
)"
);
source
.
TryHeal
(
1.5f
);
}
else
{
MonoBehaviour
.
print
(
$"[ItemPlasticStraw.Handler()] Miss. (
{
roll
:
P1
}
>
{
CHANCE
:
P1
}
)"
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
MrBigsock/Assets/Code/Item/Items/ItemPlasticStraw.cs.meta
0 → 100644
+
11
−
0
View file @
0a18697f
fileFormatVersion: 2
guid: c24f1f2ed9cc63f4b9de7e0997060e4e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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