-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincrease_shield_device.verse
28 lines (22 loc) · 1.09 KB
/
increase_shield_device.verse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
# A Verse-authored creative device that can be placed in a level
increase_shield_device := class(increase_ability_device):
@editable IncreaseAmount: float = 100.0
@editable BaseAmount: float = 100.0
MAX_ITEM_REQUIRED_COUNT: int = 1000000
GetNewRequiredCount<override>(IncreasedCount: int):int =
var NewCount:int = BaseItemRequiredCount
for(Index : int = 0..IncreasedCount - 1 ):
set NewCount = NewCount * 10
if (NewCount > MAX_ITEM_REQUIRED_COUNT):
set NewCount = MAX_ITEM_REQUIRED_COUNT
return NewCount
UpdateAbility<override>(Agent: agent, IncreasedCount: int):void =
if (FortChar := Agent.GetFortCharacter[]):
New := BaseAmount + IncreaseAmount * IncreasedCount
Print("New Shield = {New}")
FortChar.SetMaxShield(New)