OverlayManager refactor and Flash (#1218)
* Flash component, overlay and shader Add BeginDraw method to Overlay.cs * Add flash icons, sounds * Progress * Multiple overlays without enums * This is probably the worst way to do this IDK * Remove nullable reference type * Add AttackEventArgs as parameter to OnHitEntities MeleeWeaponComponent.Attack now continues when OnHitEntities returns true (it hit something) Add OverlayType enum so client and server can agree on overlay ids Move IConfigurable to its own file Add AoE flash with shorter duration Flashing someone slows them down * Add arc to flash Set item size to something reasonable Remove chat log message when flash burns out * Remove unused interface
This commit is contained in:
BIN
Resources/Audio/weapons/flash.ogg
Normal file
BIN
Resources/Audio/weapons/flash.ogg
Normal file
Binary file not shown.
@@ -74,6 +74,8 @@
|
||||
- mindinfo
|
||||
- addrole
|
||||
- rmrole
|
||||
- addoverlay
|
||||
- rmoverlay
|
||||
- showtime
|
||||
- group
|
||||
- addai
|
||||
@@ -121,6 +123,8 @@
|
||||
- mindinfo
|
||||
- addrole
|
||||
- rmrole
|
||||
- addoverlay
|
||||
- rmoverlay
|
||||
- srvpopupmsg
|
||||
- group
|
||||
- showtime
|
||||
|
||||
@@ -23,3 +23,30 @@
|
||||
HeldPrefix: off
|
||||
|
||||
- type: ItemCooldown
|
||||
|
||||
- type: entity
|
||||
name: flash
|
||||
parent: BaseItem
|
||||
id: Flash
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Melee/flash.rsi
|
||||
state: flash
|
||||
|
||||
- type: Icon
|
||||
sprite: Objects/Melee/flash.rsi
|
||||
state: flash
|
||||
|
||||
- type: Flash
|
||||
damage: 0
|
||||
cooldownTime: 1
|
||||
arc: smash
|
||||
hitSound: /Audio/weapons/flash.ogg
|
||||
slowTo: 0.7
|
||||
|
||||
- type: Item
|
||||
Size: 2
|
||||
sprite: Objects/Melee/flash.rsi
|
||||
|
||||
- type: ItemCooldown
|
||||
|
||||
|
||||
@@ -7,3 +7,8 @@
|
||||
id: GradientCircleMask
|
||||
kind: source
|
||||
path: "/Shaders/gradient_circle_mask.swsl"
|
||||
|
||||
- type: shader
|
||||
id: FlashedEffect
|
||||
kind: source
|
||||
path: "/Shaders/flashed_effect.swsl"
|
||||
|
||||
18
Resources/Shaders/flashed_effect.swsl
Normal file
18
Resources/Shaders/flashed_effect.swsl
Normal file
@@ -0,0 +1,18 @@
|
||||
uniform float percentComplete;
|
||||
uniform float fadeFalloffExp = 8;
|
||||
|
||||
void fragment() {
|
||||
// Higher exponent -> stronger blinding effect
|
||||
float remaining = -pow(percentComplete, fadeFalloffExp) + 1;
|
||||
|
||||
// Two ghost textures that spin around the character
|
||||
vec4 tex1 = texture(TEXTURE, vec2(UV.x + (0.02) * sin(TIME * 3), UV.y + (0.02) * cos(TIME * 3)));
|
||||
vec4 tex2 = texture(TEXTURE, vec2(UV.x + (0.01) * sin(TIME * 2), UV.y + (0.01) * cos(TIME * 2)));
|
||||
|
||||
vec4 textureMix = mix(tex1, tex2, 0.5);
|
||||
|
||||
// Gradually mixes between the texture mix and a full-white texture, causing the "blinding" effect
|
||||
vec4 mixed = mix(vec4(1, 1, 1, 1), textureMix, percentComplete);
|
||||
|
||||
COLOR = vec4(mixed.rgb, remaining);
|
||||
}
|
||||
BIN
Resources/Textures/Objects/Melee/flash.rsi/burnt.png
Normal file
BIN
Resources/Textures/Objects/Melee/flash.rsi/burnt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 354 B |
BIN
Resources/Textures/Objects/Melee/flash.rsi/flash.png
Normal file
BIN
Resources/Textures/Objects/Melee/flash.rsi/flash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 368 B |
BIN
Resources/Textures/Objects/Melee/flash.rsi/flashing.png
Normal file
BIN
Resources/Textures/Objects/Melee/flash.rsi/flashing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 385 B |
BIN
Resources/Textures/Objects/Melee/flash.rsi/inhand-left.png
Normal file
BIN
Resources/Textures/Objects/Melee/flash.rsi/inhand-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 280 B |
BIN
Resources/Textures/Objects/Melee/flash.rsi/inhand-right.png
Normal file
BIN
Resources/Textures/Objects/Melee/flash.rsi/inhand-right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 296 B |
76
Resources/Textures/Objects/Melee/flash.rsi/meta.json
Normal file
76
Resources/Textures/Objects/Melee/flash.rsi/meta.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"version": 1,
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"license": "CC BY-SA 3.0",
|
||||
"copyright": "Taken from CEV Eris",
|
||||
"states": [
|
||||
{
|
||||
"name": "flash",
|
||||
"directions": 1,
|
||||
"delays": [
|
||||
[
|
||||
1.0
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "flashing",
|
||||
"directions": 1,
|
||||
"delays": [
|
||||
[
|
||||
0.1,
|
||||
0.1,
|
||||
0.3
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "burnt",
|
||||
"directions": 1,
|
||||
"delays": [
|
||||
[
|
||||
1.0
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "inhand-right",
|
||||
"directions": 4,
|
||||
"delays": [
|
||||
[
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "inhand-left",
|
||||
"directions": 4,
|
||||
"delays": [
|
||||
[
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0
|
||||
],
|
||||
[
|
||||
1.0
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user