Browse Source

Initialize version control

This commit is equal to version 0.0.2. Version 0.0.1 source code is available on archive.org
master
discomrade 2 years ago
committed by Discomrade
commit
f3bf534682
  1. 2
      .gitattributes
  2. 30
      .github/ISSUE_TEMPLATE/bug-report.md
  3. 13
      .github/ISSUE_TEMPLATE/enhancement-request.md
  4. 6
      .github/dependabot.yml
  5. 19
      .github/workflows/static_checks.yml
  6. 22
      .gitignore
  7. 21
      addons/godot-git-plugin/LICENSE
  8. 1062
      addons/godot-git-plugin/THIRDPARTY.md
  9. 18
      addons/godot-git-plugin/git_api.gdnlib
  10. 9
      addons/godot-git-plugin/git_api.gdns
  11. BIN
      addons/godot-git-plugin/osx/release/libgitapi.dylib
  12. 7
      addons/godot-git-plugin/plugin.cfg
  13. BIN
      addons/godot-git-plugin/win64/release/libgitapi.dll
  14. BIN
      addons/godot-git-plugin/win64/release/libgitapi.exp
  15. BIN
      addons/godot-git-plugin/win64/release/libgitapi.lib
  16. BIN
      addons/godot-git-plugin/x11/release/libgitapi.so
  17. 0
      bin/.gdignore
  18. 32
      default_bus_layout.tres
  19. 7
      default_env.tres
  20. 227
      effects_shared/animu.shader
  21. BIN
      effects_shared/bullet/BlastMesh.glb
  22. 1065
      effects_shared/bullet/BlastMesh.glb.import
  23. BIN
      effects_shared/bullet/BlastMesh_Sphere.mesh
  24. BIN
      effects_shared/bullet/BlastTexture.png
  25. 36
      effects_shared/bullet/BlastTexture.png.import
  26. 58
      effects_shared/bullet/effect/BlastMaterial.tres
  27. BIN
      effects_shared/bullet/effect/BlastSpark.png
  28. 36
      effects_shared/bullet/effect/BlastSpark.png.import
  29. 26
      effects_shared/bullet/effect/BlastSparksParticles.tres
  30. BIN
      effects_shared/bullet/effect/FlarePolar.png
  31. 36
      effects_shared/bullet/effect/FlarePolar.png.import
  32. BIN
      effects_shared/bullet/effect/FlareStraight.png
  33. 35
      effects_shared/bullet/effect/FlareStraight.png.import
  34. 12
      effects_shared/bullet/effect/InnerBlastLightParticle.tres
  35. 29
      effects_shared/bullet/effect/LightParticle.tres
  36. 21
      effects_shared/bullet/effect/MainBodyParticle.tres
  37. 16
      effects_shared/bullet/effect/SmokeOverrideMaterial.tres
  38. 36
      effects_shared/bullet/effect/SmokeParticles.tres
  39. 28
      effects_shared/bullet/effect/TrailParticle.tres
  40. 11
      effects_shared/bullet/effect/light_rays_material.tres
  41. BIN
      effects_shared/muzzle_flash_particle_mesh.glb
  42. 1065
      effects_shared/muzzle_flash_particle_mesh.glb.import
  43. BIN
      effects_shared/muzzle_flash_particle_mesh_Cone.mesh
  44. BIN
      enemies/bad_cat/audio/jump.wav
  45. 21
      enemies/bad_cat/audio/jump.wav.import
  46. BIN
      enemies/bad_cat/audio/land.wav
  47. 21
      enemies/bad_cat/audio/land.wav.import
  48. BIN
      enemies/bad_cat/audio/shoot.wav
  49. 21
      enemies/bad_cat/audio/shoot.wav.import
  50. BIN
      enemies/bad_cat/audio/step.wav
  51. 21
      enemies/bad_cat/audio/step.wav.import
  52. 8
      enemies/bad_cat/audio/step_random_pitch.tres
  53. 169
      enemies/bad_cat/bad_cat.gd
  54. 311
      enemies/bad_cat/bad_cat.tscn
  55. BIN
      enemies/bad_cat/bullet/blue_myst.png
  56. 36
      enemies/bad_cat/bullet/blue_myst.png.import
  57. 24
      enemies/bad_cat/bullet/bullet.gd
  58. 405
      enemies/bad_cat/bullet/bullet.tscn
  59. BIN
      enemies/bad_cat/bullet/bullet_explode.wav
  60. 21
      enemies/bad_cat/bullet/bullet_explode.wav.import
  61. 11
      enemies/bad_cat/bullet/bullet_material.tres
  62. BIN
      enemies/bad_cat/model/Bandana.material
  63. BIN
      enemies/bad_cat/model/Colette_Body.material
  64. BIN
      enemies/bad_cat/model/Colette_Ears.material
  65. BIN
      enemies/bad_cat/model/Colette_Hair.material
  66. BIN
      enemies/bad_cat/model/Colette_Head.material
  67. BIN
      enemies/bad_cat/model/muzzle_flash_particle_mesh.glb
  68. 1065
      enemies/bad_cat/model/muzzle_flash_particle_mesh.glb.import
  69. BIN
      enemies/bad_cat/model/muzzle_flash_particle_mesh_Cone.mesh
  70. 14
      enemies/bad_cat/model/robotemitter.tres
  71. 58
      enemies/bad_cat/textures/animu_alunya_shadermat.tres
  72. 6
      enemies/common/Hitbox.gd
  73. BIN
      enemies/common/audio/explosion.wav
  74. 21
      enemies/common/audio/explosion.wav.import
  75. BIN
      enemies/common/audio/hit.wav
  76. 21
      enemies/common/audio/hit.wav.import
  77. BIN
      enemies/standard_merc/model/Balaclava.material
  78. BIN
      enemies/standard_merc/model/BeltGreen.material
  79. BIN
      enemies/standard_merc/model/GlassesGreen.material
  80. BIN
      enemies/standard_merc/model/Helmet.material
  81. BIN
      enemies/standard_merc/model/Material.material
  82. BIN
      enemies/standard_merc/model/NavyBlue.material
  83. BIN
      enemies/standard_merc/model/PadBlack.material
  84. BIN
      enemies/standard_merc/model/PadKevlar.material
  85. BIN
      enemies/standard_merc/model/ShotgunShellCopper.material
  86. BIN
      enemies/standard_merc/model/darkMatteBlack.material
  87. BIN
      enemies/standard_merc/model/matteBlack.material
  88. BIN
      enemies/standard_merc/model/merc1.glb
  89. 1065
      enemies/standard_merc/model/merc1.glb.import
  90. BIN
      enemies/standard_merc/model/metallic.material
  91. BIN
      enemies/standard_merc/model/shotgunShellRed.material
  92. BIN
      enemies/standard_merc/model/skin.material
  93. 190
      enemies/standard_merc/standard_merc.gd
  94. 380
      enemies/standard_merc/standard_merc1.tscn
  95. 55
      file_format.sh
  96. BIN
      icon.ico
  97. BIN
      icon.png
  98. 35
      icon.png.import
  99. 0
      level/catalunya/IGNORED_textures_original_size/.gdignore
  100. BIN
      level/catalunya/IGNORED_textures_original_size/1024px-Estelada_roja.svg.png

2
.gitattributes

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

30
.github/ISSUE_TEMPLATE/bug-report.md

@ -0,0 +1,30 @@
---
name: Bug Report
about: Report a bug with the TPS demo.
title: ''
labels: bug
assignees: ''
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/tps-demo/issues?q=is%3Aissue
Only submit an issue if it is reproducible with the latest stable Godot version.
-->
**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
**Issue description:**
<!-- What happened, what was expected, and what went wrong. -->
**Screenshots of issue:**
<!--
This section is optional.
Drag in an image, or post an image with a link in the form of:
![Alt Text Here](https://pbs.twimg.com/media/DW5AJnZVAAM1805?format=jpg)
-->

13
.github/ISSUE_TEMPLATE/enhancement-request.md

@ -0,0 +1,13 @@
---
name: Enhancement Request
about: Request improvements to the TPS demo.
title: ''
labels: enhancement
assignees: ''
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/tps-demo/issues?q=is%3Aissue
-->

6
.github/dependabot.yml

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

19
.github/workflows/static_checks.yml

@ -0,0 +1,19 @@
name: Static Checks
on: [push, pull_request]
jobs:
format:
name: File formatting (file_format.sh)
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq dos2unix recode
- name: File formatting checks (file_format.sh)
run: |
bash ./file_format.sh

22
.gitignore

@ -0,0 +1,22 @@
# Godot 4+ specific ignores
.godot/
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
# Imported translations (automatically generated from CSV files)
*.translation
# Mono-specific ignores
.mono/
data_*/
mono_crash.*.json
# System/tool-specific ignores
.directory
*~
# Blender versioning
*.blend[0-9]*

21
addons/godot-git-plugin/LICENSE

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2022 The Godot Engine community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1062
addons/godot-git-plugin/THIRDPARTY.md

File diff suppressed because it is too large

18
addons/godot-git-plugin/git_api.gdnlib

@ -0,0 +1,18 @@
[general]
singleton=true
load_once=true
symbol_prefix="godot_"
reloadable=false
[entry]
OSX.64="res://addons/godot-git-plugin/osx/release/libgitapi.dylib"
Windows.64="res://addons/godot-git-plugin/win64/release/libgitapi.dll"
X11.64="res://addons/godot-git-plugin/x11/release/libgitapi.so"
[dependencies]
OSX.64=[ ]
Windows.64=[ ]
X11.64=[ ]

9
addons/godot-git-plugin/git_api.gdns

@ -0,0 +1,9 @@
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://addons/godot-git-plugin/git_api.gdnlib" type="GDNativeLibrary" id=1]
[resource]
resource_name = "GitAPI"
class_name = "GitAPI"
library = ExtResource( 1 )
script_class_name = "GitAPI"

BIN
addons/godot-git-plugin/osx/release/libgitapi.dylib

Binary file not shown.

7
addons/godot-git-plugin/plugin.cfg

@ -0,0 +1,7 @@
[plugin]
name="Godot Git Plugin"
description="This plugin lets you interact with Git without leaving the Godot editor. More information can be found at https://github.com/godotengine/godot-git-plugin/wiki"
author="ChronicallySerious"
version="v1.2.3"
script="git_api.gdns"

BIN
addons/godot-git-plugin/win64/release/libgitapi.dll

Binary file not shown.

BIN
addons/godot-git-plugin/win64/release/libgitapi.exp

Binary file not shown.

BIN
addons/godot-git-plugin/win64/release/libgitapi.lib

Binary file not shown.

BIN
addons/godot-git-plugin/x11/release/libgitapi.so

Binary file not shown.

0
bin/.gdignore

32
default_bus_layout.tres

@ -0,0 +1,32 @@
[gd_resource type="AudioBusLayout" load_steps=3 format=2]
[sub_resource type="AudioEffectReverb" id=1]
resource_name = "Reverb"
room_size = 0.98
hipass = 0.42
wet = 0.29
[sub_resource type="AudioEffectReverb" id=2]
resource_name = "Reverb"
room_size = 0.74
hipass = 0.14
wet = 0.56
[resource]
bus/0/volume_db = -10.0
bus/1/name = "Outside"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = 0.0
bus/1/send = "Master"
bus/1/effect/0/effect = SubResource( 1 )
bus/1/effect/0/enabled = true
bus/2/name = "Reactor"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = 0.0
bus/2/send = "Master"
bus/2/effect/0/effect = SubResource( 2 )
bus/2/effect/0/enabled = true

7
default_env.tres

@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

227
effects_shared/animu.shader

@ -0,0 +1,227 @@
// AnimuEyes - procedurally generated anime eyes shader
// add an extra shader pass to your character model and set uvArea to the uv range where you want
// the eyes to appear. xy are the middle point of the rectangle, zw are width/height.
// _if you have other transparent materials, make sure to adjust the render priority_
// adjust the depthOffset if you don't want them to render through hair or if rendering through
// hair is wonky
// godot version tested: 3.2.2 stable
// license: public domain (UNLICENSE)
shader_type spatial;
render_mode unshaded;
// these are the uniforms that should be dynamically changed for facial expressions and such
uniform vec3 lookAt = vec3(0, 0, 100000); // target point relative to eyes
uniform vec4 maxLook = vec4(-.4, -.2, .4, .2); // eye movement range
uniform vec2 lookSens = vec2(.2, .2); // adjust until eyes match up with the look target
uniform float irisScale : hint_range(.1, 1.5) = 1;
uniform float eyebrowOffset = 0;
uniform float eyebrowRotationOffsetDegrees : hint_range(-180, 180) = 0;
uniform float open : hint_range(0, 1) = 1; // might cause some artifacts, mainly used for blinking
// everything else is only recommended to be used to define the base eye aesthetic
uniform vec4 uvArea = vec4(.5, .5, 1, 1);
uniform float position = .2;
uniform float dist = .2;
uniform float depthOffset = .01;
uniform vec4 color : hint_color = vec4(1, .3, 0, 1);
uniform vec4 whiteColor : hint_color = vec4(1, 1, 1, 1);
uniform vec4 rimColor : hint_color = vec4(1, 1, 1, 1);
uniform vec4 eyebrowColor : hint_color = vec4(0, 0, 0, 1);
uniform vec4 border1Color : hint_color = vec4(0, 0, 0, 1);
uniform vec4 border2Color : hint_color = vec4(0, 0, 0, 1);
uniform float shapeSquare : hint_range(0, 1) = .554;
uniform float irisSquare : hint_range(0, 1) = .219;
uniform float border1Square : hint_range(0, 1) = .5;
uniform float border2Square : hint_range(0, 1) = 1;
uniform float eyebrowSquare : hint_range(0, 1) = .5;
uniform vec4 topEllipse = vec4(.444, .598, .5, .4);
uniform vec4 bottomEllipse = vec4(.49, .297, .3, .33);
uniform vec4 irisEllipse = vec4(.53, .35, .17, .236);
uniform vec4 pupilEllipse = vec4(0, .02, .08, .1);
uniform float eyebrowPosition = 0;
uniform vec4 eyebrow = vec4(.037, -.369, 1.1, 1.1);
uniform vec4 eyebrowFalloffEllipse = vec4(.5, -.315, .028, .039);
uniform float eyebrowFalloff : hint_range(0, 1) = .5;
uniform float eyebrowRotationDegrees : hint_range(-180, 180) = -10;
uniform float eyebrowThickness : hint_range(0, .1) = .025;
uniform vec4 border1 = vec4(.025, .016, 1.1, 1.1);
uniform vec4 border1FalloffEllipse = vec4(.222, -.03, .3, .2);
uniform float border1Falloff : hint_range(0, 1) = .3;
uniform float border1RotationDegrees : hint_range(-180, 180) = -3;
uniform float border1Thickness : hint_range(0, .1) = .025;
uniform vec4 border2 = vec4(-.043, .057, .916, 1);
uniform vec4 border2FalloffEllipse = vec4(.5, .861, .03, .049);
uniform float border2Falloff : hint_range(0, 1) = .2;
uniform float border2RotationDegrees : hint_range(-180, 180) = 0;
uniform float border2Thickness : hint_range(0, .1) = .008;
uniform float sharpness : hint_range(100, 1000) = 200;
uniform vec2 scale = vec2(.3, .3);
uniform float attenuation : hint_range(0, 1) = .3;
uniform float irisAttenuation : hint_range(0, 1) = .1;
uniform vec4 highlightEllipse = vec4(.608, .6, .4, .3);
uniform vec2 irisGradientOffset = vec2(0, -.01);
uniform vec4 rim1Ellipse = vec4(0.128, -0.034, .067, .043);
uniform float rim1RotationDegrees : hint_range(-180, 180) = 10;
uniform vec4 rim2Ellipse = vec4(-0.135, 0.057, .05, .03);
uniform float rim2RotationDegrees : hint_range(-180, 180) = 10;
float ellipse(vec2 c, vec2 r, vec2 uv) {
// this is essentialy doing a circle sdf and then distorting the space by the aspect ratio
float smallDim = min(r.x, r.y);
return length((c - uv) / r) * smallDim - smallDim;
}
float ellipse4(vec4 cr, vec2 uv) {
return ellipse(cr.xy, cr.zw, uv);
}
float rect(vec2 c, vec2 r, vec2 uv) {
return length(max(abs(uv - c) - r, 0));
}
float rect4(vec4 cr, vec2 uv) {
return rect(cr.xy, cr.zw, uv);
}
// this gives a smooth transition when doing min distance to combine shapes
float smin(float a, float b, float k) {
float h = clamp(0.5 + 0.5 * (b - a) / k, 0., 1.);
return mix(b, a, h) - k * h * (1.0 - h);
}
float squaredEllipse(vec4 cr, vec2 uv, float squareAmt) {
float e = ellipse4(cr, uv);
float r = rect4(vec4(cr.xy, cr.zw * squareAmt), uv);
return smin(e, r, .3);
}
float hardEdge(float d) {
return 1.0 - smoothstep(0, 1.0 / sharpness, d);
}
mat2 rotateMat(float deg) {
float rad = radians(deg);
float s = sin(rad), c = cos(rad);
return mat2(vec2(c, -s), vec2(s, c));
}
vec2 rotate(vec2 uv, float deg, vec2 origin) {
return (uv - origin) * rotateMat(deg) + origin;
}
vec4 openDelta(float openAmt) {
return -(bottomEllipse - topEllipse) * vec4(0, 1. - openAmt, 0, 0);
}
float shape(vec2 uv, float square, float openAmt) {
float dTop = squaredEllipse(topEllipse + openDelta(openAmt), uv, square);
float dBot = squaredEllipse(bottomEllipse, uv, square);
return max(dTop, dBot);
}
float border(vec2 uv, float ds, vec4 posScale, float rotDeg, vec4 fallEl, float thick,
float square, float fall, float openAmt)
{
// arbitrary small scaling delta to make stuff look better from far away
float epsilon = ds * .00011;
vec2 borderUv = rotate((uv + posScale.xy) / posScale.zw, rotDeg, vec2(.5, .5));
float dShape = shape(borderUv, square, openAmt); // shape sdf offset by border offset
float d = bottomEllipse.y - topEllipse.y;
float dFalloff = ellipse4(fallEl + openDelta(openAmt), borderUv);
float falloffAmt = 1.0 - smoothstep(0, fall, dFalloff);
float thicc = thick * falloffAmt;
float dBorder = abs(dShape - thick * falloffAmt) - thicc; // always touching edge of shape
float borderAmt = 1.0 - hardEdge(falloffAmt);
return hardEdge(dBorder / ds + epsilon) * borderAmt;
}
float brow(vec2 uv, float dScale) {
float r = eyebrowRotationDegrees + eyebrowRotationOffsetDegrees;
return border(uv, dScale, eyebrow, r, eyebrowFalloffEllipse,
eyebrowThickness, eyebrowSquare, eyebrowFalloff, 1);
}
vec4 eye(float flipRims, vec2 uv, vec2 look, float dScale) {
float epsilon = dScale * .00011;
float shapeEdge = hardEdge(shape(uv, shapeSquare, open) / dScale);
float border1Edge = border(uv, dScale, border1, border1RotationDegrees, border1FalloffEllipse,
border1Thickness, border1Square, border1Falloff, open);
float border2Edge = border(uv, dScale, border2, border2RotationDegrees, border2FalloffEllipse,
border2Thickness, border2Square, border2Falloff, open);
vec4 irisE = irisEllipse;
irisE.xy += look;
irisE.zw *= irisScale;
float dIris = squaredEllipse(irisE, uv, irisSquare) / dScale;
float dIrisGradient = squaredEllipse(irisE, uv + irisGradientOffset, irisSquare);
float irisEdge = hardEdge(dIris + epsilon * .5);
float irisGradient = (1.0 - smoothstep(-.001, -.03, dIrisGradient)) * irisEdge;
vec4 pupilE = pupilEllipse;
pupilE.xy += irisE.xy;
pupilE.zw *= irisScale;
float dPupil = ellipse4(pupilE, uv);
float pupilEdge = 1.0 - smoothstep(0, .035, dPupil);
float highlight = ellipse4(highlightEllipse, uv);
float highlightEdge = smoothstep(0, .05, highlight);
vec4 r1 = rim1Ellipse;
vec4 r2 = rim2Ellipse;
r1.x *= flipRims;
r2.x *= flipRims;
r1.xy += irisE.xy;
r2.xy += irisE.xy;
float dRim1 = ellipse4(r1, rotate(uv, rim1RotationDegrees * flipRims, r1.xy));
float rim1Edge = hardEdge(dRim1 / dScale + epsilon);
float dRim2 = ellipse4(r2, rotate(uv, rim2RotationDegrees * flipRims, r2.xy));
float rim2Edge = hardEdge(dRim2 / dScale + epsilon);
vec4 col = vec4(0, 0, 0, 0);
col = mix(col, whiteColor, shapeEdge);
col = mix(col, color, irisEdge);
col = mix(col, color * irisAttenuation, pupilEdge);
col = mix(col, col * irisAttenuation, irisGradient);
col = mix(col, col * attenuation, highlightEdge);
col = mix(col, rimColor, max(rim1Edge, rim2Edge));
col = mix(col, border1Color, border1Edge);
col = mix(col, border2Color, border2Edge);
col.a = max(max(shapeEdge, border1Edge), border2Edge);
return col;
}
// maps uvs that fall into area (x, y, width, height) to 0.0-1.0 - this way functions don't need
// to be aware of position and scale
vec2 toLocal(vec2 uv, vec4 area) {
return (uv - area.xy) / area.zw + .5;
}
void fragment() {
// this is used to scale smoothsteps so it's equally smooth regardless of distance.
// if I didn't do this, it would become blurry close-up and aliased from afar
float dScale = abs(VERTEX.z) / scale.x;
vec2 uv = toLocal(UV, uvArea);
uv = (uv - .5) / vec2(uvArea.z / uvArea.w, 1) + .5; // adjust for uvArea aspect ratio
dScale /= uvArea.z;
vec3 look = normalize(lookAt);
look.xy *= lookSens;
look.xy = clamp(look.xy, maxLook.xy, maxLook.zw);
look.x *= -1.;
vec4 right = eye(1, toLocal(uv, vec4(.5 - dist, position, scale.x, scale.y)), look.xy, dScale);
look.x *= -1.;
vec4 left = eye(-1, toLocal(uv, vec4(.5 + dist, position, -scale.x, scale.y)), look.xy, dScale);
float browpos = eyebrowOffset + eyebrowPosition;
float browR = brow(toLocal(uv, vec4(.5 - dist, browpos, scale.x, scale.y)), dScale);
float browL = brow(toLocal(uv, vec4(.5 + dist, browpos, -scale.x, scale.y)), dScale);
vec4 col = mix(right, left, left.a);
col = mix(col, eyebrowColor, max(browR, browL));
ALPHA = col.a;
ALBEDO = col.rgb;
// adjust depth to render through hair
vec4 fragpos = FRAGCOORD * INV_PROJECTION_MATRIX;
fragpos.z += depthOffset; // view space Z
DEPTH = (fragpos * PROJECTION_MATRIX).z;
}

BIN
effects_shared/bullet/BlastMesh.glb

Binary file not shown.

1065
effects_shared/bullet/BlastMesh.glb.import

File diff suppressed because it is too large

BIN
effects_shared/bullet/BlastMesh_Sphere.mesh

Binary file not shown.

BIN
effects_shared/bullet/BlastTexture.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

36
effects_shared/bullet/BlastTexture.png.import

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/BlastTexture.png-c527c26bd9b5d1df74298d8ce80bc295.s3tc.stex"
metadata={
"imported_formats": [ "s3tc" ],
"vram_texture": true
}
[deps]
source_file="res://effects_shared/bullet/BlastTexture.png"
dest_files=[ "res://.import/BlastTexture.png-c527c26bd9b5d1df74298d8ce80bc295.s3tc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

58
effects_shared/bullet/effect/BlastMaterial.tres

@ -0,0 +1,58 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
[ext_resource path="res://effects_shared/bullet/BlastTexture.png" type="Texture" id=1]
[sub_resource type="Shader" id=1]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_never,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform int particles_anim_h_frames;
uniform int particles_anim_v_frames;
uniform bool particles_anim_loop;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
mat4 mat_world = mat4(normalize(CAMERA_MATRIX[0])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[1])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[2])*length(WORLD_MATRIX[2]),WORLD_MATRIX[3]);
mat_world = mat_world * mat4( vec4(cos(INSTANCE_CUSTOM.x),-sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0),vec4(0.0, 0.0, 1.0, 0.0),vec4(0.0, 0.0, 0.0, 1.0));
MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat_world;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb * COLOR.rgb;
EMISSION = albedo.rgb * albedo.a * 1.0 * COLOR.rgb * COLOR.a;
METALLIC = metallic;
ROUGHNESS = roughness;
SPECULAR = specular;
ALPHA = albedo_tex.a * COLOR.a;
}
"
[resource]
shader = SubResource( 1 )
shader_param/albedo = Color( 0, 1, 1, 1 )
shader_param/specular = 0.0
shader_param/metallic = 0.0
shader_param/roughness = 1.0
shader_param/point_size = 1.0
shader_param/particles_anim_h_frames = 1
shader_param/particles_anim_v_frames = 1
shader_param/particles_anim_loop = false
shader_param/uv1_scale = Vector3( 1, 1, 1 )
shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
shader_param/texture_albedo = ExtResource( 1 )

BIN
effects_shared/bullet/effect/BlastSpark.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

36
effects_shared/bullet/effect/BlastSpark.png.import

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/BlastSpark.png-6abcee349e2987154845483c37251625.s3tc.stex"
metadata={
"imported_formats": [ "s3tc" ],
"vram_texture": true
}
[deps]
source_file="res://effects_shared/bullet/effect/BlastSpark.png"
dest_files=[ "res://.import/BlastSpark.png-6abcee349e2987154845483c37251625.s3tc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

26
effects_shared/bullet/effect/BlastSparksParticles.tres

@ -0,0 +1,26 @@
[gd_resource type="ParticlesMaterial" load_steps=5 format=2]
[sub_resource type="Gradient" id=17]
offsets = PoolRealArray( 0, 0.237037, 0.859259 )
colors = PoolColorArray( 1, 1, 1, 1, 0, 0.972656, 0.972656, 0.967582, 0.0107751, 0.00360107, 0.921875, 0.478431 )
[sub_resource type="GradientTexture" id=18]
gradient = SubResource( 17 )
width = 128
[sub_resource type="Curve" id=19]
_data = [ Vector2( 0, 1 ), 0.0, -1.96199e-07, 0, 0, Vector2( 0.848101, 0.781818 ), -1.30578, -1.30578, 0, 0, Vector2( 1, 0.0090909 ), -0.0813035, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=20]
width = 128
curve = SubResource( 19 )
[resource]
flag_align_y = true
direction = Vector3( 0, 1, 0 )
spread = 151.58
gravity = Vector3( 0, 0, 0 )
initial_velocity = 12.0
damping = 31.5
scale_curve = SubResource( 20 )
color_ramp = SubResource( 18 )

BIN
effects_shared/bullet/effect/FlarePolar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

36
effects_shared/bullet/effect/FlarePolar.png.import

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/FlarePolar.png-62b323305bf480f361cf2ea871ca1be9.s3tc.stex"
metadata={
"imported_formats": [ "s3tc" ],
"vram_texture": true
}
[deps]
source_file="res://effects_shared/bullet/effect/FlarePolar.png"
dest_files=[ "res://.import/FlarePolar.png-62b323305bf480f361cf2ea871ca1be9.s3tc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
effects_shared/bullet/effect/FlareStraight.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

35
effects_shared/bullet/effect/FlareStraight.png.import

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/FlareStraight.png-482a1c66e3d92a3e71190d2bffbb48c0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://effects_shared/bullet/effect/FlareStraight.png"
dest_files=[ "res://.import/FlareStraight.png-482a1c66e3d92a3e71190d2bffbb48c0.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

12
effects_shared/bullet/effect/InnerBlastLightParticle.tres

@ -0,0 +1,12 @@
[gd_resource type="ParticlesMaterial" load_steps=3 format=2]
[sub_resource type="Curve" id=39]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.379747, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=40]
width = 128
curve = SubResource( 39 )
[resource]
gravity = Vector3( 0, 0, 0 )
scale_curve = SubResource( 40 )

29
effects_shared/bullet/effect/LightParticle.tres

@ -0,0 +1,29 @@
[gd_resource type="ParticlesMaterial" load_steps=5 format=2]
[sub_resource type="Curve" id=33]
min_value = -1.0
_data = [ Vector2( 0, 0.0181819 ), 0.0, 0.0, 0, 0, Vector2( 1, -0.745454 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=34]
width = 128
curve = SubResource( 33 )
[sub_resource type="Curve" id=35]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.746835, 1 ), 2.15455, -3.73455, 0, 1, Vector2( 1, 0.0545454 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=36]
width = 128
curve = SubResource( 35 )
[resource]
emission_shape = 1
emission_sphere_radius = 0.3
direction = Vector3( 0, 1, 0 )
spread = 180.0
gravity = Vector3( 0, 3, 0 )
initial_velocity = 0.3
radial_accel = 1.0
radial_accel_curve = SubResource( 34 )
scale = 1.5
scale_random = 1.0
scale_curve = SubResource( 36 )

21
effects_shared/bullet/effect/MainBodyParticle.tres

@ -0,0 +1,21 @@
[gd_resource type="ParticlesMaterial" load_steps=5 format=2]
[sub_resource type="Gradient" id=43]
colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 1, 0 )
[sub_resource type="GradientTexture" id=44]
gradient = SubResource( 43 )
[sub_resource type="Curve" id=45]
max_value = 4.0
_data = [ Vector2( 0.150987, 4 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.6936 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=46]
curve = SubResource( 45 )
[resource]
spread = 180.0
gravity = Vector3( 0, -1, 0 )
scale = 0.3
scale_curve = SubResource( 46 )
color_ramp = SubResource( 44 )

16
effects_shared/bullet/effect/SmokeOverrideMaterial.tres

@ -0,0 +1,16 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2]
[ext_resource path="res://player/bullet/blue_myst.png" type="Texture" id=1]
[resource]
flags_transparent = true
vertex_color_use_as_albedo = true
params_cull_mode = 2
params_depth_draw_mode = 2
params_billboard_mode = 3
params_billboard_keep_scale = true
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
albedo_color = Color( 0.701961, 0.701961, 0.701961, 0.560784 )
albedo_texture = ExtResource( 1 )

36
effects_shared/bullet/effect/SmokeParticles.tres

@ -0,0 +1,36 @@
[gd_resource type="ParticlesMaterial" load_steps=7 format=2]
[sub_resource type="Curve" id=24]
min_value = -1.0
_data = [ Vector2( 0, 0.890909 ), 0.0, 0.0, 0, 0, Vector2( 1, -0.0545454 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=25]
width = 128
curve = SubResource( 24 )
[sub_resource type="Gradient" id=26]
offsets = PoolRealArray( 0, 0.918519 )
colors = PoolColorArray( 1, 1, 1, 0.8, 0, 0.309753, 0.792969, 0.0196078 )
[sub_resource type="GradientTexture" id=27]
gradient = SubResource( 26 )
width = 128
[sub_resource type="Curve" id=28]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.14557, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), -3.50114, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=29]
width = 128
curve = SubResource( 28 )
[resource]
emission_shape = 1
emission_sphere_radius = 0.4
gravity = Vector3( 0, 2, 0 )
angular_velocity = 82.76
angular_velocity_random = 0.53
angular_velocity_curve = SubResource( 25 )
angle = -248.2
angle_random = 0.44
scale_curve = SubResource( 29 )
color_ramp = SubResource( 27 )

28
effects_shared/bullet/effect/TrailParticle.tres

@ -0,0 +1,28 @@
[gd_resource type="ParticlesMaterial" load_steps=5 format=2]
[sub_resource type="Gradient" id=50]
colors = PoolColorArray( 1, 1, 1, 1, 0, 0.0313726, 0.501961, 0.752941 )
[sub_resource type="GradientTexture" id=51]
gradient = SubResource( 50 )
width = 128
[sub_resource type="Curve" id=52]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.417722, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=53]
width = 128
curve = SubResource( 52 )
[resource]
emission_shape = 1
emission_sphere_radius = 0.1
flag_align_y = true
direction = Vector3( 0, 0, -1 )
spread = 0.0
gravity = Vector3( 0, 0, 0 )
initial_velocity = 9.0
damping = 9.0
scale = 0.3
scale_curve = SubResource( 53 )
color_ramp = SubResource( 51 )

11
effects_shared/bullet/effect/light_rays_material.tres

@ -0,0 +1,11 @@
[gd_resource type="SpatialMaterial" load_steps=2 format=2]
[ext_resource path="res://effects_shared/bullet/effect/FlarePolar.png" type="Texture" id=1]
[resource]
flags_transparent = true
flags_unshaded = true
vertex_color_use_as_albedo = true
params_billboard_mode = 1
params_billboard_keep_scale = true
albedo_texture = ExtResource( 1 )

BIN
effects_shared/muzzle_flash_particle_mesh.glb

Binary file not shown.

1065
effects_shared/muzzle_flash_particle_mesh.glb.import

File diff suppressed because it is too large

BIN
effects_shared/muzzle_flash_particle_mesh_Cone.mesh

Binary file not shown.

BIN
enemies/bad_cat/audio/jump.wav

Binary file not shown.

21
enemies/bad_cat/audio/jump.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/jump.wav-7da1ee513bc08bdb8de7368683f83a8f.sample"
[deps]
source_file="res://enemies/bad_cat/audio/jump.wav"
dest_files=[ "res://.import/jump.wav-7da1ee513bc08bdb8de7368683f83a8f.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

BIN
enemies/bad_cat/audio/land.wav

Binary file not shown.

21
enemies/bad_cat/audio/land.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/land.wav-b0953dafa50529bde0f15882cfc8634f.sample"
[deps]
source_file="res://enemies/bad_cat/audio/land.wav"
dest_files=[ "res://.import/land.wav-b0953dafa50529bde0f15882cfc8634f.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

BIN
enemies/bad_cat/audio/shoot.wav

Binary file not shown.

21
enemies/bad_cat/audio/shoot.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/shoot.wav-a1925bc236c059a9752e02a1e62106dd.sample"
[deps]
source_file="res://enemies/bad_cat/audio/shoot.wav"
dest_files=[ "res://.import/shoot.wav-a1925bc236c059a9752e02a1e62106dd.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

BIN
enemies/bad_cat/audio/step.wav

Binary file not shown.

21
enemies/bad_cat/audio/step.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/step.wav-197836f56b95238920bd13064a10b2bf.sample"
[deps]
source_file="res://enemies/bad_cat/audio/step.wav"
dest_files=[ "res://.import/step.wav-197836f56b95238920bd13064a10b2bf.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=false
edit/loop=false
compress/mode=0

8
enemies/bad_cat/audio/step_random_pitch.tres

@ -0,0 +1,8 @@
[gd_resource type="AudioStreamRandomPitch" load_steps=2 format=2]
[ext_resource path="res://player/audio/step.wav" type="AudioStream" id=1]
[resource]
audio_stream = ExtResource( 1 )
random_pitch = 1.1

169
enemies/bad_cat/bad_cat.gd

@ -0,0 +1,169 @@
extends KinematicBody
enum State {
APPROACH = 0,
AIM = 1,
SHOOTING = 2,
}
const PLAYER_AIM_TOLERANCE_DEGREES = 15
const SHOOT_WAIT = 0.5
const AIM_TIME = 1
const AIM_PREPARE_TIME = 0.5
const BLEND_AIM_SPEED = 0.05
export(int) var health = 5
export(bool) var test_shoot = false
var state = State.APPROACH
var shoot_countdown = SHOOT_WAIT
var aim_countdown = AIM_TIME
var aim_preparing = AIM_PREPARE_TIME
var dead = false
var player = null
var velocity = Vector3()
var orientation = Transform()
const ROTATION_INTERPOLATE_SPEED = 0.025
var root_motion = Transform()
var motion = Vector2()
var last_player_sighting = Vector3()
onready var initial_position = transform.origin
onready var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
onready var animation_tree = $AnimationTree
onready var player_model = $PlayerModel
onready var shoot_from = player_model.get_node(@"Colette_Armature/Skeleton/GunBone/ShootFrom")
onready var fire_cooldown = $FireCooldown
onready var collision_shape = $CapsuleShape
onready var sound_effects = $SoundEffects
onready var sound_effect_jump = sound_effects.get_node(@"Jump")
onready var sound_effect_land = sound_effects.get_node(@"Land")
onready var sound_effect_shoot = sound_effects.get_node(@"Shoot")
onready var explosion_sound = sound_effects.get_node(@"Explosion")
onready var hit_sound = sound_effects.get_node(@"Hit")
onready var debug_marker = $debug_marker
func _ready():
# Pre-initialize orientation transform.
orientation = player_model.global_transform
orientation.origin = Vector3()
func _physics_process(delta):
if dead:
return
if player != null and fire_cooldown.time_left == 0:
# See if player can be killed because in they're sight.
var ray_origin = shoot_from.global_transform.origin
var ray_to = player.global_transform.origin + Vector3.UP # Above middle of player.
var col = get_world().direct_space_state.intersect_ray(ray_origin, ray_to, [self], 0b111)
# If our raycast hit a player
if not col.empty() and col.collider == player:
# Record last sighting (in case they hide later)
last_player_sighting = ray_to
state = State.AIM
aim_countdown = AIM_TIME
aim_preparing = 0
animation_tree["parameters/state/current"] = 1
# If the player is detected by at too large an angle, slerp rotate towards them
var to_player_local = global_transform.xform_inv(player.global_transform.origin)
# The front of this is +Z, and atan2 is zero at +X, so we need to use the Z for the X parameter (second one).
var angle_to_player = atan2(to_player_local.x, to_player_local.z)
var tolerance = deg2rad(PLAYER_AIM_TOLERANCE_DEGREES)
if angle_to_player > tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
debug_marker.global_transform.origin = self.global_transform.origin + (self.transform.basis.z * 3)
elif angle_to_player < -tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
debug_marker.global_transform.origin = self.global_transform.origin + (self.transform.basis.z * 3)
else:
# Facing player, try to shoot.
self.look_at(ray_to, Vector3.UP)
self.rotate_object_local(Vector3.UP, PI)
var bullet = preload("res://player/bullet/bullet.tscn").instance()
get_parent().add_child(bullet)
bullet.global_transform.origin = ray_origin
# If we don't rotate the bullets there is no useful way to control the particles ..
bullet.look_at(ray_to, Vector3.UP)
bullet.add_collision_exception_with(self)
var shoot_particle = $PlayerModel/Colette_Armature/Skeleton/GunBone/ShootFrom/ShootParticle
shoot_particle.restart()
shoot_particle.emitting = true
var muzzle_particle = $PlayerModel/Colette_Armature/Skeleton/GunBone/ShootFrom/MuzzleFlash
muzzle_particle.restart()
muzzle_particle.emitting = true
fire_cooldown.start()
sound_effect_shoot.play()
# Player not in sight.
shoot_countdown = SHOOT_WAIT
# Run at their last known position
if last_player_sighting != Vector3():
# If the player is detected by at too large an angle, slerp rotate towards them
var to_player_local = global_transform.xform_inv(last_player_sighting)
# The front of this is +Z, and atan2 is zero at +X, so we need to use the Z for the X parameter (second one).
var angle_to_player = atan2(to_player_local.x, to_player_local.z)
var tolerance = deg2rad(PLAYER_AIM_TOLERANCE_DEGREES)
if angle_to_player > tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
debug_marker.global_transform.origin = self.global_transform.origin + (self.transform.basis.z * 3)
elif angle_to_player < -tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
debug_marker.global_transform.origin = self.global_transform.origin + (self.transform.basis.z * 3)
animation_tree["parameters/state/current"] = 2
# Blend position for walk speed based on motion.
# Run animation straight forward, high speed
animation_tree["parameters/walk/blend_position"] = Vector2(0.5, 0)
# move in XY direction facing
root_motion = global_transform.basis.z * 3# * delta
move_and_slide(root_motion.length() * self.transform.basis.z * Vector3(1,0,1), Vector3.UP)
if get_slide_count() == 0:
move_and_slide(Vector3.DOWN * 9.8, Vector3.UP)
# else: # Not in air or aiming, idle.
func lerp_to_face_player(angle_to_player, rot_speed):
var langle = lerp_angle(0, angle_to_player, rot_speed)
# restrict to Y axis (no vertical rotation)
self.global_transform.basis = Basis(Vector3(0, 1, 0), langle) * self.global_transform.basis
func hit(col):
health -= 1
if health <= 0:
dead = true
animation_tree.active = false
player_model.visible = false
collision_shape.disabled = true
explosion_sound.play()
self.queue_free() # delete self
hit_sound.play()
func _on_Area_body_entered(body):
if body.name == "Player" or body.name == "Target":
player = body
animation_tree["parameters/idle_aim/current"] = 1
func _on_Area_body_exited(body):
if body.name == "Player":
player = null
animation_tree["parameters/idle_aim/current"] = 0

311
enemies/bad_cat/bad_cat.tscn

@ -0,0 +1,311 @@
[gd_scene load_steps=50 format=2]
[ext_resource path="res://enemies/bad_cat/bad_cat.gd" type="Script" id=1]
[ext_resource path="res://enemies/bad_cat/model/Colette_Head.material" type="Material" id=2]
[ext_resource path="res://enemies/common/audio/hit.wav" type="AudioStream" id=3]
[ext_resource path="res://player/audio/step_random_pitch.tres" type="AudioStream" id=4]
[ext_resource path="res://player/audio/jump.wav" type="AudioStream" id=5]
[ext_resource path="res://player/audio/land.wav" type="AudioStream" id=6]
[ext_resource path="res://player/audio/shoot.wav" type="AudioStream" id=7]
[ext_resource path="res://enemies/common/audio/explosion.wav" type="AudioStream" id=8]
[ext_resource path="res://player/bullet/bullet_material.tres" type="Material" id=9]
[ext_resource path="res://enemies/bad_cat/model/muzzle_flash_particle_mesh_Cone.mesh" type="ArrayMesh" id=10]
[ext_resource path="res://effects_shared/bullet/effect/FlarePolar.png" type="Texture" id=11]
[ext_resource path="res://enemies/bad_cat/textures/animu_alunya_shadermat.tres" type="Material" id=12]
[ext_resource path="res://player/model/Alunya.glb" type="PackedScene" id=13]
[ext_resource path="res://enemies/bad_cat/model/Colette_Hair.material" type="Material" id=14]
[ext_resource path="res://enemies/bad_cat/model/Bandana.material" type="Material" id=15]
[ext_resource path="res://enemies/common/Hitbox.gd" type="Script" id=16]
[ext_resource path="res://player/model/materials/ear.tres" type="Material" id=17]
[ext_resource path="res://enemies/bad_cat/model/Colette_Body.material" type="Material" id=18]
[sub_resource type="ParticlesMaterial" id=1]
flag_align_y = true
direction = Vector3( 0, 0, -1 )
spread = 15.0
gravity = Vector3( 0, -3, 0 )
initial_velocity = 3.0
[sub_resource type="SphereMesh" id=2]
radius = 0.003
height = 0.02
[sub_resource type="SpatialMaterial" id=3]
flags_transparent = true
flags_unshaded = true
vertex_color_use_as_albedo = true
params_cull_mode = 2
albedo_texture = ExtResource( 11 )
[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0.325926, 1 )
colors = PoolColorArray( 0.0507812, 0.955505, 1, 1, 0.875, 0.888672, 1, 0.305882 )
[sub_resource type="GradientTexture" id=42]
gradient = SubResource( 4 )
width = 32
[sub_resource type="Curve" id=6]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.791139, 0.990909 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=43]
width = 64
curve = SubResource( 6 )
[sub_resource type="ParticlesMaterial" id=8]
gravity = Vector3( 0, 0, 0 )
angle = -4.0
angle_random = 1.0
scale = 0.3
scale_curve = SubResource( 43 )
color_ramp = SubResource( 42 )
[sub_resource type="CapsuleShape" id=41]
radius = 0.253575
height = 0.808991
[sub_resource type="AnimationNodeBlend2" id=69]
filter_enabled = true
filters = [ "Colette_Armature/Skeleton:ElbowF.R", "Colette_Armature/Skeleton:ElbowM.R", "Colette_Armature/Skeleton:ElbowU.R", "Colette_Armature/Skeleton:F_Index_1.R", "Colette_Armature/Skeleton:F_Index_2.R", "Colette_Armature/Skeleton:F_Index_3.R", "Colette_Armature/Skeleton:F_Index_4.R", "Colette_Armature/Skeleton:F_Middle_1.R", "Colette_Armature/Skeleton:F_Middle_2.R", "Colette_Armature/Skeleton:F_Middle_3.R", "Colette_Armature/Skeleton:F_Middle_4.R", "Colette_Armature/Skeleton:F_Pinky_1.R", "Colette_Armature/Skeleton:F_Pinky_2.R", "Colette_Armature/Skeleton:F_Pinky_3.R", "Colette_Armature/Skeleton:F_Pinky_4.R", "Colette_Armature/Skeleton:F_Ring_1.R", "Colette_Armature/Skeleton:F_Ring_2.R", "Colette_Armature/Skeleton:F_Ring_3.R", "Colette_Armature/Skeleton:F_Ring_4.R", "Colette_Armature/Skeleton:F_Thumb_1.R", "Colette_Armature/Skeleton:F_Thumb_2.R", "Colette_Armature/Skeleton:F_Thumb_3.R", "Colette_Armature/Skeleton:ForeArm.R", "Colette_Armature/Skeleton:ForeArmSkin1.R", "Colette_Armature/Skeleton:ForeArmSkin2.R", "Colette_Armature/Skeleton:ForeArmSkin3.R", "Colette_Armature/Skeleton:Hand.R", "Colette_Armature/Skeleton:HandMark_IK_FK.R", "Colette_Armature/Skeleton:Shoulder.R", "Colette_Armature/Skeleton:UpperArm.R", "Colette_Armature/Skeleton:UpperArmSkin1.R", "Colette_Armature/Skeleton:UpperArmSkin2.R", "Colette_Armature/Skeleton:UpperArmSkin3.R" ]
[sub_resource type="AnimationNodeAnimation" id=39]
animation = "idle-loop"
[sub_resource type="AnimationNodeAnimation" id=70]
animation = "idle-loop"
[sub_resource type="AnimationNodeTransition" id=68]
input_count = 2
xfade_time = 0.2
input_0/name = "idle"
input_0/auto_advance = false
input_1/name = "aim"
input_1/auto_advance = false
[sub_resource type="AnimationNodeAnimation" id=67]
animation = "aim_pistol-loop"
[sub_resource type="AnimationNodeTransition" id=49]
resource_local_to_scene = true
input_count = 3
xfade_time = 0.15
input_0/name = "idle"
input_0/auto_advance = false
input_1/name = "strafe"
input_1/auto_advance = false
input_2/name = "walk"
input_2/auto_advance = false
[sub_resource type="AnimationNodeAnimation" id=71]
animation = "walking-cycle-loop"
[sub_resource type="AnimationNodeAnimation" id=72]
animation = "walking-cycle-loop"
[sub_resource type="AnimationNodeAnimation" id=73]
animation = "walking-cycle-loop"
[sub_resource type="AnimationNodeAnimation" id=74]
animation = "run-cycle-loop"
[sub_resource type="AnimationNodeAnimation" id=79]
animation = "idle-loop"
[sub_resource type="AnimationNodeBlendSpace2D" id=55]
resource_local_to_scene = true
blend_point_0/node = SubResource( 71 )
blend_point_0/pos = Vector2( -1, 0 )
blend_point_1/node = SubResource( 72 )
blend_point_1/pos = Vector2( 0, -1 )
blend_point_2/node = SubResource( 73 )
blend_point_2/pos = Vector2( 1, 0 )
blend_point_3/node = SubResource( 74 )
blend_point_3/pos = Vector2( 0, 1 )
blend_point_4/node = SubResource( 79 )
blend_point_4/pos = Vector2( 0, 0 )
[sub_resource type="AnimationNodeAnimation" id=76]
animation = "run-cycle-loop"
[sub_resource type="AnimationNodeAnimation" id=78]
animation = "walking_gun-cycle"
[sub_resource type="AnimationNodeAnimation" id=80]
animation = "idle-loop"
[sub_resource type="AnimationNodeBlendSpace2D" id=60]
resource_local_to_scene = true
blend_point_0/node = SubResource( 76 )
blend_point_0/pos = Vector2( 1, 0 )
blend_point_1/node = SubResource( 78 )
blend_point_1/pos = Vector2( 0, 1 )
blend_point_2/node = SubResource( 80 )
blend_point_2/pos = Vector2( 0, 0 )
min_space = Vector2( 0, 0 )
x_label = "speed"
y_label = "gun"
[sub_resource type="AnimationNodeBlendTree" id=30]
resource_local_to_scene = true
graph_offset = Vector2( -937.444, 37.3194 )
nodes/Blend2/node = SubResource( 69 )
nodes/Blend2/position = Vector2( 460, 80 )
nodes/idle/node = SubResource( 39 )
nodes/idle/position = Vector2( -340, -20 )
nodes/idle1/node = SubResource( 70 )
nodes/idle1/position = Vector2( 20, -140 )
nodes/idle_aim/node = SubResource( 68 )
nodes/idle_aim/position = Vector2( 220, -80 )
nodes/output/position = Vector2( 760, 120 )
nodes/shoot_pose/node = SubResource( 67 )
nodes/shoot_pose/position = Vector2( -20, -20 )
nodes/state/node = SubResource( 49 )
nodes/state/position = Vector2( -80, 120 )
nodes/strafe/node = SubResource( 55 )
nodes/strafe/position = Vector2( -640, 40 )
nodes/walk/node = SubResource( 60 )
nodes/walk/position = Vector2( -640, 200 )
node_connections = [ "state", 0, "idle", "state", 1, "strafe", "state", 2, "walk", "output", 0, "Blend2", "Blend2", 0, "state", "Blend2", 1, "idle_aim", "idle_aim", 0, "idle1", "idle_aim", 1, "shoot_pose" ]
[sub_resource type="CapsuleShape" id=64]
radius = 0.68932
height = 0.002
[sub_resource type="AudioStreamRandomPitch" id=35]
audio_stream = ExtResource( 7 )
[sub_resource type="AudioStreamRandomPitch" id=38]
audio_stream = ExtResource( 3 )
[sub_resource type="SphereShape" id=36]
radius = 20.0
[sub_resource type="PrismMesh" id=37]
[node name="BadCat" type="KinematicBody"]
collision_layer = 4
collision_mask = 23
script = ExtResource( 1 )
[node name="PlayerModel" parent="." instance=ExtResource( 13 )]
[node name="GunBone" type="BoneAttachment" parent="PlayerModel/Colette_Armature/Skeleton" index="0"]
transform = Transform( -0.0209218, -0.185609, -0.982401, 0.0101222, -0.982548, 0.185422, -0.999672, -0.00606411, 0.0224358, -0.201483, 0.742031, -0.0377114 )
bone_name = "Hand.R"
[node name="ShootFrom" type="Position3D" parent="PlayerModel/Colette_Armature/Skeleton/GunBone"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0 )
[node name="ShootParticle" type="Particles" parent="PlayerModel/Colette_Armature/Skeleton/GunBone/ShootFrom"]
transform = Transform( 1, 2.04891e-08, 0, 3.21306e-08, 1, 5.58794e-09, 0, 0, 1, 0, 0, 0 )
material_override = ExtResource( 9 )
emitting = false
amount = 10
lifetime = 0.3
one_shot = true
explosiveness = 0.79
local_coords = false
process_material = SubResource( 1 )
draw_pass_1 = SubResource( 2 )
[node name="MuzzleFlash" type="Particles" parent="PlayerModel/Colette_Armature/Skeleton/GunBone/ShootFrom"]
transform = Transform( 1, 0, -2.00234e-08, 1.21072e-08, -4.37722e-08, -1, -2.98023e-08, 1, -4.74975e-08, 0, 0, 0 )
material_override = SubResource( 3 )
emitting = false
amount = 1
lifetime = 0.1
one_shot = true
explosiveness = 1.0
process_material = SubResource( 8 )
draw_pass_1 = ExtResource( 10 )
[node name="ChestBone" type="BoneAttachment" parent="PlayerModel/Colette_Armature/Skeleton" index="1"]
transform = Transform( 1, 9.83052e-08, -4.4973e-07, -9.24421e-08, 0.998489, -0.0538833, 3.5868e-07, 0.0538833, 0.998489, 6.63939e-09, 1.00081, 0.0376625 )
bone_name = "Chest"
[node name="Hitbox" type="KinematicBody" parent="PlayerModel/Colette_Armature/Skeleton/ChestBone"]
transform = Transform( 0.697, 4.07329e-05, 0.000196172, -2.55566e-05, 1.19195, 0.00618147, -0.000195948, -0.0105715, 0.696972, -7.45737e-05, -0.195816, -0.0145013 )
collision_layer = 64
collision_mask = 0
script = ExtResource( 16 )
node_with_hit = NodePath("../../../../..")
[node name="CollisionShape" type="CollisionShape" parent="PlayerModel/Colette_Armature/Skeleton/ChestBone/Hitbox"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 41 )
[node name="Colette_Mesh" parent="PlayerModel/Colette_Armature/Skeleton" index="2"]
material/0 = ExtResource( 12 )
material/1 = ExtResource( 12 )
material/2 = ExtResource( 2 )
material/3 = ExtResource( 18 )
material/4 = ExtResource( 17 )
material/5 = ExtResource( 14 )
material/6 = ExtResource( 15 )
[node name="RootMotionView" type="RootMotionView" parent="."]
animation_path = NodePath("../AnimationTree")
[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource( 30 )
anim_player = NodePath("../PlayerModel/AnimationPlayer")
active = true
process_mode = 0
root_motion_track = NodePath("Colette_Armature/Skeleton:Root")
parameters/Blend2/blend_amount = 1.0
parameters/idle_aim/current = 0
parameters/state/current = 0
parameters/strafe/blend_position = Vector2( 0, 0 )
parameters/walk/blend_position = Vector2( 0, 0 )
[node name="CapsuleShape" type="CollisionShape" parent="."]
transform = Transform( 0.999835, 0.0162343, -0.00821726, 0.0079643, 0.0155836, 0.999847, 0.0163598, -0.999747, 0.0154518, 0, 0.701, 0 )
shape = SubResource( 64 )
[node name="SoundEffects" type="Node" parent="."]
[node name="Step" type="AudioStreamPlayer" parent="SoundEffects"]
stream = ExtResource( 4 )
[node name="Jump" type="AudioStreamPlayer" parent="SoundEffects"]
stream = ExtResource( 5 )
[node name="Land" type="AudioStreamPlayer" parent="SoundEffects"]
stream = ExtResource( 6 )
[node name="Shoot" type="AudioStreamPlayer" parent="SoundEffects"]
stream = SubResource( 35 )
[node name="Explosion" type="AudioStreamPlayer3D" parent="SoundEffects"]
stream = ExtResource( 8 )
unit_db = 12.0
unit_size = 15.0
[node name="Hit" type="AudioStreamPlayer3D" parent="SoundEffects"]
stream = SubResource( 38 )
unit_db = 3.0
unit_size = 15.0
[node name="FireCooldown" type="Timer" parent="."]
wait_time = 0.4
one_shot = true
autostart = true
[node name="PlayerDetectionArea" type="Area" parent="."]
collision_layer = 2
collision_mask = 2
[node name="CollisionShape" type="CollisionShape" parent="PlayerDetectionArea"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00589287, -1.19209e-07, 0.000506759 )
shape = SubResource( 36 )
[node name="debug_marker" type="MeshInstance" parent="."]
transform = Transform( 0.245, 0, 0, 0, 0.205, 0, 0, 0, 0.115, 0, 0, 3.06692 )
visible = false
mesh = SubResource( 37 )
material/0 = null
[connection signal="body_entered" from="PlayerDetectionArea" to="." method="_on_Area_body_entered"]
[connection signal="body_exited" from="PlayerDetectionArea" to="." method="_on_Area_body_exited"]
[editable path="PlayerModel"]

BIN
enemies/bad_cat/bullet/blue_myst.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

36
enemies/bad_cat/bullet/blue_myst.png.import

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/blue_myst.png-7727ef8a9a4fafec2d4a943494dcd294.s3tc.stex"
metadata={
"imported_formats": [ "s3tc" ],
"vram_texture": true
}
[deps]
source_file="res://enemies/bad_cat/bullet/blue_myst.png"
dest_files=[ "res://.import/blue_myst.png-7727ef8a9a4fafec2d4a943494dcd294.s3tc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

24
enemies/bad_cat/bullet/bullet.gd

@ -0,0 +1,24 @@
extends KinematicBody
const BULLET_VELOCITY = 20
var time_alive = 5
var hit = false
onready var animation_player = $AnimationPlayer
onready var collision_shape = $CollisionShape
func _physics_process(delta):
if hit:
return
time_alive -= delta
if time_alive < 0:
hit = true
animation_player.play("explode")
var col = move_and_collide(-delta * BULLET_VELOCITY * transform.basis.z)
if col:
if col.collider and col.collider.has_method("hit"):
col.collider.hit(col)
collision_shape.disabled = true
animation_player.play("explode")
hit = true

405
enemies/bad_cat/bullet/bullet.tscn

@ -0,0 +1,405 @@
[gd_scene load_steps=38 format=2]
[ext_resource path="res://player/bullet/bullet.gd" type="Script" id=1]
[ext_resource path="res://effects_shared/bullet/BlastMesh_Sphere.mesh" type="ArrayMesh" id=2]
[ext_resource path="res://player/bullet/bullet_explode.wav" type="AudioStream" id=3]
[ext_resource path="res://effects_shared/bullet/effect/BlastMaterial.tres" type="Material" id=4]
[ext_resource path="res://effects_shared/bullet/effect/light_rays_material.tres" type="Material" id=5]
[ext_resource path="res://effects_shared/bullet/effect/LightParticle.tres" type="Material" id=6]
[ext_resource path="res://effects_shared/bullet/effect/SmokeParticles.tres" type="Material" id=7]
[ext_resource path="res://effects_shared/bullet/effect/SmokeOverrideMaterial.tres" type="Material" id=8]
[ext_resource path="res://player/bullet/bullet_material.tres" type="Material" id=9]
[ext_resource path="res://effects_shared/bullet/effect/MainBodyParticle.tres" type="Material" id=10]
[ext_resource path="res://effects_shared/bullet/effect/InnerBlastLightParticle.tres" type="Material" id=11]
[ext_resource path="res://effects_shared/bullet/effect/BlastSparksParticles.tres" type="Material" id=12]
[ext_resource path="res://effects_shared/bullet/effect/TrailParticle.tres" type="Material" id=13]
[sub_resource type="SphereMesh" id=1]
radial_segments = 9
rings = 5
[sub_resource type="SphereShape" id=2]
radius = 0.170413
[sub_resource type="Animation" id=3]
resource_name = "explode"
length = 3.0
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("OmniLight:light_energy")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.85 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ 1.5, 3.0, 0.0 ]
}
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 1.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "queue_free"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("BulletBody/MainBody:emitting")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("MeshInstance:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("ExplosionAudio:playing")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0.1 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Blast/BlastParticle:emitting")
tracks/5/interp = 1
tracks/5/loop_wrap = false
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("Blast/LightBlast:emitting")
tracks/6/interp = 1
tracks/6/loop_wrap = false
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/7/type = "value"
tracks/7/path = NodePath("Blast/BlastSparks:emitting")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/8/type = "value"
tracks/8/path = NodePath("Blast/Smoke:emitting")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/keys = {
"times": PoolRealArray( 0.2 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/9/type = "value"
tracks/9/path = NodePath("Blast/LightParticle:emitting")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/keys = {
"times": PoolRealArray( 0.05 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/10/type = "value"
tracks/10/path = NodePath("Blast/InnerBlastLight:emitting")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/11/type = "value"
tracks/11/path = NodePath("BulletBody/Trail:emitting")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/imported = false
tracks/11/enabled = true
tracks/11/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0, 0.318519, 1 )
colors = PoolColorArray( 0.828125, 1, 1, 1, 0, 1, 1, 1, 0, 0.0829163, 0.964844, 0 )
[sub_resource type="GradientTexture" id=5]
gradient = SubResource( 4 )
width = 128
[sub_resource type="Curve" id=6]
_data = [ Vector2( 0, 0 ), 0.0, 3.2107, 0, 0, Vector2( 0.575949, 1 ), 1.59619e-07, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=7]
width = 128
curve = SubResource( 6 )
[sub_resource type="ParticlesMaterial" id=8]
spread = 0.0
gravity = Vector3( 0, 0, 0 )
scale = 0.7
scale_curve = SubResource( 7 )
color_ramp = SubResource( 5 )
[sub_resource type="Gradient" id=9]
offsets = PoolRealArray( 0, 0.703704 )
colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 1, 0 )
[sub_resource type="GradientTexture" id=10]
gradient = SubResource( 9 )
width = 128
[sub_resource type="Curve" id=11]
_data = [ Vector2( 0, 0.236364 ), 0.0, 0.0, 0, 0, Vector2( 0.259494, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.763636 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=12]
width = 128
curve = SubResource( 11 )
[sub_resource type="ParticlesMaterial" id=13]
gravity = Vector3( 0, 0, 0 )
scale = 0.8
scale_curve = SubResource( 12 )
color_ramp = SubResource( 10 )
[sub_resource type="QuadMesh" id=14]
size = Vector2( 2, 2 )
[sub_resource type="Shader" id=15]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_alpha_prepass,cull_back,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float point_size : hint_range(0,128);
uniform float emission_energy = 2.0;
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
EMISSION = ALBEDO * emission_energy;
}
"
[sub_resource type="ShaderMaterial" id=16]
shader = SubResource( 15 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/point_size = 1.0
shader_param/emission_energy = 7.34
[sub_resource type="SphereMesh" id=22]
radius = 0.03
height = 0.06
[sub_resource type="QuadMesh" id=31]
size = Vector2( 2, 2 )
[sub_resource type="SpatialMaterial" id=32]
albedo_color = Color( 0.00784314, 0.988235, 0.988235, 1 )
emission_enabled = true
emission = Color( 0, 0.486275, 1, 1 )
emission_energy = 4.0
emission_operator = 0
emission_on_uv2 = false
[sub_resource type="SphereMesh" id=38]
radius = 0.05
height = 0.1
radial_segments = 4
rings = 4
[sub_resource type="SphereMesh" id=42]
radius = 0.3
height = 0.6
[sub_resource type="SpatialMaterial" id=48]
flags_transparent = true
vertex_color_use_as_albedo = true
vertex_color_is_srgb = true
roughness = 0.0
emission_enabled = true
emission = Color( 0, 0.929412, 1, 1 )
emission_energy = 2.0
emission_operator = 0
emission_on_uv2 = false
[sub_resource type="SphereMesh" id=49]
material = SubResource( 48 )
radius = 0.1
height = 0.2
radial_segments = 5
rings = 3
[sub_resource type="SphereMesh" id=55]
radius = 0.05
height = 0.3
radial_segments = 4
rings = 4
[node name="Bullet" type="KinematicBody"]
collision_layer = 0
collision_mask = 97
script = ExtResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0 )
visible = false
cast_shadow = 0
mesh = SubResource( 1 )
material/0 = null
[node name="OmniLight" type="OmniLight" parent="."]
light_color = Color( 0, 1, 0.952941, 1 )
light_energy = 0.778846
light_bake_mode = 0
shadow_enabled = true
omni_range = 3.0
omni_attenuation = 2.0
omni_shadow_mode = 0
[node name="CollisionShape" type="CollisionShape" parent="."]
shape = SubResource( 2 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/explode = SubResource( 3 )
[node name="ExplosionAudio" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource( 3 )
unit_size = 20.0
[node name="Blast" type="Spatial" parent="."]
[node name="BlastParticle" type="Particles" parent="Blast"]
material_override = ExtResource( 4 )
emitting = false
amount = 1
lifetime = 0.6
one_shot = true
process_material = SubResource( 8 )
draw_pass_1 = ExtResource( 2 )
[node name="LightBlast" type="Particles" parent="Blast"]
material_override = ExtResource( 5 )
emitting = false
amount = 1
lifetime = 0.15
one_shot = true
process_material = SubResource( 13 )
draw_pass_1 = SubResource( 14 )
[node name="BlastSparks" type="Particles" parent="Blast"]
material_override = SubResource( 16 )
emitting = false
amount = 10
lifetime = 0.3
one_shot = true
explosiveness = 0.92
process_material = ExtResource( 12 )
draw_pass_1 = SubResource( 22 )
[node name="Smoke" type="Particles" parent="Blast"]
material_override = ExtResource( 8 )
emitting = false
amount = 5
lifetime = 1.5
one_shot = true
explosiveness = 1.0
process_material = ExtResource( 7 )
draw_pass_1 = SubResource( 31 )
[node name="LightParticle" type="Particles" parent="Blast"]
material_override = SubResource( 32 )
emitting = false
amount = 3
lifetime = 0.8
one_shot = true
explosiveness = 0.84
process_material = ExtResource( 6 )
draw_pass_1 = SubResource( 38 )
[node name="InnerBlastLight" type="Particles" parent="Blast"]
material_override = ExtResource( 9 )
emitting = false
amount = 1
lifetime = 0.2
one_shot = true
process_material = ExtResource( 11 )
draw_pass_1 = SubResource( 42 )
[node name="MeshInstance2" type="MeshInstance" parent="."]
visible = false
material_override = ExtResource( 4 )
mesh = ExtResource( 2 )
material/0 = null
[node name="BulletBody" type="Spatial" parent="."]
[node name="MainBody" type="Particles" parent="BulletBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00988865, 0, 0 )
amount = 100
lifetime = 0.1
local_coords = false
process_material = ExtResource( 10 )
draw_pass_1 = SubResource( 49 )
[node name="Trail" type="Particles" parent="BulletBody"]
material_override = ExtResource( 9 )
amount = 10
local_coords = false
process_material = ExtResource( 13 )
draw_pass_1 = SubResource( 55 )

BIN
enemies/bad_cat/bullet/bullet_explode.wav

Binary file not shown.

21
enemies/bad_cat/bullet/bullet_explode.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/bullet_explode.wav-780facb1896cb2021cdaeb47e5a3e1c7.sample"
[deps]
source_file="res://enemies/bad_cat/bullet/bullet_explode.wav"
dest_files=[ "res://.import/bullet_explode.wav-780facb1896cb2021cdaeb47e5a3e1c7.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

11
enemies/bad_cat/bullet/bullet_material.tres

@ -0,0 +1,11 @@
[gd_resource type="SpatialMaterial" format=2]
[resource]
vertex_color_use_as_albedo = true
albedo_color = Color( 0, 0, 0, 1 )
roughness = 0.0
emission_enabled = true
emission = Color( 0.109804, 0.894118, 1, 1 )
emission_energy = 7.34
emission_operator = 0
emission_on_uv2 = false

BIN
enemies/bad_cat/model/Bandana.material

Binary file not shown.

BIN
enemies/bad_cat/model/Colette_Body.material

Binary file not shown.

BIN
enemies/bad_cat/model/Colette_Ears.material

Binary file not shown.

BIN
enemies/bad_cat/model/Colette_Hair.material

Binary file not shown.

BIN
enemies/bad_cat/model/Colette_Head.material

Binary file not shown.

BIN
enemies/bad_cat/model/muzzle_flash_particle_mesh.glb

Binary file not shown.

1065
enemies/bad_cat/model/muzzle_flash_particle_mesh.glb.import

File diff suppressed because it is too large

BIN
enemies/bad_cat/model/muzzle_flash_particle_mesh_Cone.mesh

Binary file not shown.

14
enemies/bad_cat/model/robotemitter.tres

@ -0,0 +1,14 @@
[gd_resource type="SpatialMaterial" format=2]
[resource]
resource_name = "robotemitter"
albedo_color = Color( 0.196078, 0.388235, 0.639216, 1 )
roughness = 0.0960784
emission_enabled = true
emission = Color( 0.196078, 0.388235, 0.639216, 1 )
emission_energy = 6.19
emission_operator = 0
emission_on_uv2 = false
distance_fade_mode = 3
distance_fade_min_distance = 0.2
distance_fade_max_distance = 0.8

58
enemies/bad_cat/textures/animu_alunya_shadermat.tres

@ -0,0 +1,58 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=2]
[ext_resource path="res://effects_shared/animu.shader" type="Shader" id=1]
[resource]
shader = ExtResource( 1 )
shader_param/lookAt = Vector3( 0, 0, 5 )
shader_param/maxLook = Plane( -0.4, -0.2, 0.4, 0.2 )
shader_param/lookSens = Vector2( 0.2, 0.2 )
shader_param/irisScale = 0.841
shader_param/eyebrowOffset = 0.0
shader_param/eyebrowRotationOffsetDegrees = 0.0
shader_param/open = 0.541
shader_param/uvArea = Plane( 0.102, 0.514, 1, 1 )
shader_param/position = 0.125
shader_param/dist = 0.048
shader_param/depthOffset = 0.0
shader_param/color = Color( 0.831373, 0.858824, 0.0117647, 1 )
shader_param/whiteColor = Color( 1, 1, 1, 1 )
shader_param/rimColor = Color( 1, 1, 1, 1 )
shader_param/eyebrowColor = Color( 0, 0, 0, 1 )
shader_param/border1Color = Color( 0, 0, 0, 1 )
shader_param/border2Color = Color( 0, 0, 0, 1 )
shader_param/shapeSquare = 0.554
shader_param/irisSquare = 0.111
shader_param/border1Square = 0.5
shader_param/border2Square = 1.0
shader_param/eyebrowSquare = 0.5
shader_param/topEllipse = Plane( 0.343, 0.558, 0.454, 0.408 )
shader_param/bottomEllipse = Plane( 0.45, 0.308, 0.284, 0.336 )
shader_param/irisEllipse = Plane( 0.53, 0.388, 0.144, 0.236 )
shader_param/pupilEllipse = Plane( 0, -0.023, 0.075, 0.209 )
shader_param/eyebrowPosition = 0.0
shader_param/eyebrow = Plane( 0.037, -0.369, 1.1, 1.1 )
shader_param/eyebrowFalloffEllipse = Plane( 0.5, -0.315, 0.028, 0.039 )
shader_param/eyebrowFalloff = 0.5
shader_param/eyebrowRotationDegrees = -10.0
shader_param/eyebrowThickness = 0.025
shader_param/border1 = Plane( 0.025, 0.016, 1.1, 1.1 )
shader_param/border1FalloffEllipse = Plane( 0.125, -0.018, 0.297, 0.305 )
shader_param/border1Falloff = 0.222
shader_param/border1RotationDegrees = -3.0
shader_param/border1Thickness = 0.009
shader_param/border2 = Plane( -0.043, 0.057, 0.916, 1 )
shader_param/border2FalloffEllipse = Plane( 0.5, 0.861, 0.03, 0.049 )
shader_param/border2Falloff = 0.0
shader_param/border2RotationDegrees = 0.0
shader_param/border2Thickness = 0.0
shader_param/sharpness = 200.0
shader_param/scale = Vector2( 0.088, 0.081 )
shader_param/attenuation = 0.747
shader_param/irisAttenuation = 0.147
shader_param/highlightEllipse = Plane( 0.608, 0.36, 0.489, 0.3 )
shader_param/irisGradientOffset = Vector2( -0.007, -0.095 )
shader_param/rim1Ellipse = Plane( 0.128, -0.034, 0.067, 0.043 )
shader_param/rim1RotationDegrees = 10.0
shader_param/rim2Ellipse = Plane( -0.276, 0.162, 0.081, 0.007 )
shader_param/rim2RotationDegrees = 0.0

6
enemies/common/Hitbox.gd

@ -0,0 +1,6 @@
extends KinematicBody
export(NodePath) var node_with_hit
func hit(col):
get_node(node_with_hit).hit(col)

BIN
enemies/common/audio/explosion.wav

Binary file not shown.

21
enemies/common/audio/explosion.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/explosion.wav-ca6425df2c1e6db7ccfe4bfba076f858.sample"
[deps]
source_file="res://enemies/common/audio/explosion.wav"
dest_files=[ "res://.import/explosion.wav-ca6425df2c1e6db7ccfe4bfba076f858.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

BIN
enemies/common/audio/hit.wav

Binary file not shown.

21
enemies/common/audio/hit.wav.import

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/hit.wav-239559cb80f688cad81fbb36658c3b19.sample"
[deps]
source_file="res://enemies/common/audio/hit.wav"
dest_files=[ "res://.import/hit.wav-239559cb80f688cad81fbb36658c3b19.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0

BIN
enemies/standard_merc/model/Balaclava.material

Binary file not shown.

BIN
enemies/standard_merc/model/BeltGreen.material

Binary file not shown.

BIN
enemies/standard_merc/model/GlassesGreen.material

Binary file not shown.

BIN
enemies/standard_merc/model/Helmet.material

Binary file not shown.

BIN
enemies/standard_merc/model/Material.material

Binary file not shown.

BIN
enemies/standard_merc/model/NavyBlue.material

Binary file not shown.

BIN
enemies/standard_merc/model/PadBlack.material

Binary file not shown.

BIN
enemies/standard_merc/model/PadKevlar.material

Binary file not shown.

BIN
enemies/standard_merc/model/ShotgunShellCopper.material

Binary file not shown.

BIN
enemies/standard_merc/model/darkMatteBlack.material

Binary file not shown.

BIN
enemies/standard_merc/model/matteBlack.material

Binary file not shown.

BIN
enemies/standard_merc/model/merc1.glb

Binary file not shown.

1065
enemies/standard_merc/model/merc1.glb.import

File diff suppressed because it is too large

BIN
enemies/standard_merc/model/metallic.material

Binary file not shown.

BIN
enemies/standard_merc/model/shotgunShellRed.material

Binary file not shown.

BIN
enemies/standard_merc/model/skin.material

Binary file not shown.

190
enemies/standard_merc/standard_merc.gd

@ -0,0 +1,190 @@
extends KinematicBody
enum State {
APPROACH = 0,
AIM = 1,
SHOOTING = 2,
}
const PLAYER_AIM_TOLERANCE_DEGREES = 15
const SHOOT_WAIT = 0.5
const AIM_TIME = 1
const AIM_PREPARE_TIME = 0.5
const BLEND_AIM_SPEED = 0.05
export(int) var health = 5
export(bool) var test_shoot = false
var state = State.APPROACH
var shoot_countdown = SHOOT_WAIT
var aim_countdown = AIM_TIME
var aim_preparing = AIM_PREPARE_TIME
var dead = false
var player = null
var velocity = Vector3()
var orientation = Transform()
var dummy : Spatial
var in_detection_normal = false
var in_detection_focused = false
const ROTATION_INTERPOLATE_SPEED = 0.025
var root_motion = Transform()
var motion = Vector2()
var last_player_sighting = Vector3()
onready var initial_position = transform.origin
onready var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
onready var animation_tree = $AnimationTree
onready var player_model = $merc1/CharacterRig001
onready var shoot_from = player_model.get_node(@"Skeleton/GunBone/ShootFrom")
onready var fire_cooldown = $FireCooldown
onready var collision_shape = $CapsuleShape
onready var sound_effects = $SoundEffects
onready var sound_effect_jump = sound_effects.get_node(@"Jump")
onready var sound_effect_land = sound_effects.get_node(@"Land")
onready var sound_effect_shoot = sound_effects.get_node(@"Shoot")
onready var explosion_sound = sound_effects.get_node(@"Explosion")
onready var hit_sound = sound_effects.get_node(@"Hit")
onready var reaction_time = $ReactionTime.get_wait_time()
onready var sight_normal = $"PlayerDetection1/NormalLoS"
onready var sight_focused = $"PlayerDetection1/AttentiveLoS"
func _ready():
# Pre-initialize orientation transform.
orientation = player_model.global_transform
orientation.origin = Vector3()
dummy = Spatial.new()
func _physics_process(delta):
if dead:
return
if player != null and fire_cooldown.time_left == 0:
# See if player can be killed because in they're sight.
var ray_origin = shoot_from.global_transform.origin
var ray_to = player.global_transform.origin + Vector3.UP # Above middle of player.
var col = get_world().direct_space_state.intersect_ray(ray_origin, ray_to, [self], 0b111)
# If our raycast hit a player
if not col.empty() and col.collider == player:
# Record last sighting (in case they hide later)
last_player_sighting = ray_to
state = State.AIM
aim_countdown = AIM_TIME
aim_preparing = 0
animation_tree["parameters/state/current"] = 1
if $ReactionTime.time_left == 0:
# If the player is detected by at too large an angle, slerp rotate towards them
var to_player_local = global_transform.xform_inv(player.global_transform.origin)
# The front of this is +Z, and atan2 is zero at +X, so we need to use the Z for the X parameter (second one).
var angle_to_player = atan2(to_player_local.x, to_player_local.z)
var tolerance = deg2rad(PLAYER_AIM_TOLERANCE_DEGREES)
if angle_to_player > tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
elif angle_to_player < -tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
else:
# Facing player, try to shoot.
self.look_at(ray_to, Vector3.UP)
self.rotate_object_local(Vector3.UP, PI)
var bullet = preload("res://player/bullet/bullet.tscn").instance()
get_parent().add_child(bullet)
bullet.global_transform.origin = ray_origin
# If we don't rotate the bullets there is no useful way to control the particles ..
bullet.look_at(ray_to, Vector3.UP)
bullet.add_collision_exception_with(self)
var shoot_particle = player_model.get_node(@"Skeleton/GunBone/ShootFrom/ShootParticle")
shoot_particle.restart()
shoot_particle.emitting = true
var muzzle_particle = player_model.get_node(@"Skeleton/GunBone/ShootFrom/MuzzleFlash")
muzzle_particle.restart()
muzzle_particle.emitting = true
fire_cooldown.start()
sound_effect_shoot.play()
else:
if $ReactionTime.is_paused():
$ReactionTime.set_paused(false) #restart reaction time
else:
# Player not in sight.
shoot_countdown = SHOOT_WAIT
if $ReactionTime.time_left != reaction_time:
$ReactionTime.start()
$ReactionTime.set_paused(true)
# Run at their last known position
if last_player_sighting != Vector3():
# If the player is detected by at too large an angle, slerp rotate towards them
var to_player_local = global_transform.xform_inv(last_player_sighting)
# The front of this is +Z, and atan2 is zero at +X, so we need to use the Z for the X parameter (second one).
var angle_to_player = atan2(to_player_local.x, to_player_local.z)
var tolerance = deg2rad(PLAYER_AIM_TOLERANCE_DEGREES)
if angle_to_player > tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
elif angle_to_player < -tolerance:
lerp_to_face_player(angle_to_player, ROTATION_INTERPOLATE_SPEED)
animation_tree["parameters/state/current"] = 2
# Blend position for walk speed based on motion.
# Run animation straight forward, high speed
animation_tree["parameters/walk/blend_position"] = Vector2(0.5, 0)
# move in XY direction facing
root_motion = animation_tree.get_root_motion_transform()
velocity = move_and_slide(root_motion.origin.length() * self.transform.basis.z * Vector3(1,0,1), Vector3.UP)
self.global_transform.origin += velocity
#self.global_transform.origin += root_motion.origin.length() * self.transform.basis.z * Vector3(1,0,1)
func lerp_to_face_player(angle_to_player, rot_speed):
var langle = lerp_angle(0, angle_to_player, rot_speed)
# restrict to Y axis (no vertical rotation)
self.global_transform.basis = Basis(Vector3(0, 1, 0), langle) * self.global_transform.basis
func hit(col):
health -= 1
if health <= 0:
dead = true
animation_tree.active = false
player_model.visible = false
collision_shape.disabled = true
explosion_sound.play()
self.queue_free() # delete self
hit_sound.play()
# If shot at, attempt to look for player. This will extrapolate from impact position
# so they may validly look the wrong direction
if player == null or player == dummy:
player = dummy
last_player_sighting = (col.position - self.global_transform.origin) * 20 + self.global_transform.origin
# Enable longer focus detection shape
sight_focused.disabled = false
func _on_PlayerDetection1_body_entered(body):
if body.name == "Player" or body.name == "Target":
in_detection_normal = true
player = body
# Enable longer focus detection shape
sight_focused.disabled = false
func _on_PlayerDetection1_body_exited(body):
if body.name == "Player":
player = null
sight_focused.disabled = true

380
enemies/standard_merc/standard_merc1.tscn

@ -0,0 +1,380 @@
[gd_scene load_steps=51 format=2]
[ext_resource path="res://enemies/standard_merc/model/merc1.glb" type="PackedScene" id=1]
[ext_resource path="res://player/bullet/bullet_material.tres" type="Material" id=2]
[ext_resource path="res://effects_shared/bullet/effect/FlarePolar.png" type="Texture" id=3]
[ext_resource path="res://enemies/standard_merc/standard_merc.gd" type="Script" id=4]
[ext_resource path="res://player/model/muzzle_flash_particle_mesh_Cone.mesh" type="ArrayMesh" id=5]
[ext_resource path="res://enemies/common/audio/explosion.wav" type="AudioStream" id=6]
[ext_resource path="res://player/audio/land.wav" type="AudioStream" id=7]
[ext_resource path="res://player/audio/shoot.wav" type="AudioStream" id=8]
[ext_resource path="res://player/audio/jump.wav" type="AudioStream" id=9]
[ext_resource path="res://enemies/bad_cat/audio/step.wav" type="AudioStream" id=10]
[ext_resource path="res://player/audio/step_random_pitch.tres" type="AudioStream" id=11]
[ext_resource path="res://enemies/common/Hitbox.gd" type="Script" id=12]
[ext_resource path="res://level/catalunya/map/Water.material" type="Material" id=13]
[sub_resource type="ParticlesMaterial" id=2]
flag_align_y = true
direction = Vector3( 0, 0, -1 )
spread = 15.0
gravity = Vector3( 0, -3, 0 )
initial_velocity = 3.0
[sub_resource type="SphereMesh" id=3]
radius = 0.003
height = 0.02
[sub_resource type="SpatialMaterial" id=4]
flags_transparent = true
flags_unshaded = true
vertex_color_use_as_albedo = true
params_cull_mode = 2
albedo_texture = ExtResource( 3 )
[sub_resource type="Gradient" id=5]
offsets = PoolRealArray( 0.325926, 1 )
colors = PoolColorArray( 0.0507812, 0.955505, 1, 1, 0.875, 0.888672, 1, 0.305882 )
[sub_resource type="GradientTexture" id=6]
gradient = SubResource( 5 )
width = 32
[sub_resource type="Curve" id=7]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.791139, 0.990909 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=8]
width = 64
curve = SubResource( 7 )
[sub_resource type="ParticlesMaterial" id=9]
gravity = Vector3( 0, 0, 0 )
angle = -4.0
angle_random = 1.0
scale = 0.3
scale_curve = SubResource( 8 )
color_ramp = SubResource( 6 )
[sub_resource type="CapsuleShape" id=75]
radius = 0.838398
height = 3.62302
[sub_resource type="CapsuleShape" id=1]
radius = 1.77315
height = 1.96526
[sub_resource type="SphereShape" id=74]
radius = 100.0
[sub_resource type="CapsuleShape" id=77]
radius = 36.0
height = 250.0
[sub_resource type="CapsuleMesh" id=78]
radius = 50.0
mid_height = 250.0
[sub_resource type="AudioStreamRandomPitch" id=11]
audio_stream = ExtResource( 8 )
[sub_resource type="AnimationNodeAdd3" id=40]
resource_local_to_scene = true
filter_enabled = true
filters = [ "Colette_Armature/Skeleton:ElbowF.R", "Colette_Armature/Skeleton:ElbowM.R", "Colette_Armature/Skeleton:ElbowTargetIK.R", "Colette_Armature/Skeleton:ElbowU.R", "Colette_Armature/Skeleton:F_Index_1.R", "Colette_Armature/Skeleton:F_Index_2.R", "Colette_Armature/Skeleton:F_Index_3.R", "Colette_Armature/Skeleton:F_Index_4.R", "Colette_Armature/Skeleton:F_Middle_1.R", "Colette_Armature/Skeleton:F_Middle_2.R", "Colette_Armature/Skeleton:F_Middle_3.R", "Colette_Armature/Skeleton:F_Middle_4.R", "Colette_Armature/Skeleton:F_Pinky_1.R", "Colette_Armature/Skeleton:F_Pinky_2.R", "Colette_Armature/Skeleton:F_Pinky_3.R", "Colette_Armature/Skeleton:F_Pinky_4.R", "Colette_Armature/Skeleton:F_Ring_1.R", "Colette_Armature/Skeleton:F_Ring_2.R", "Colette_Armature/Skeleton:F_Ring_3.R", "Colette_Armature/Skeleton:F_Ring_4.R", "Colette_Armature/Skeleton:F_Thumb_1.R", "Colette_Armature/Skeleton:F_Thumb_2.R", "Colette_Armature/Skeleton:F_Thumb_3.R", "Colette_Armature/Skeleton:ForeArm.R", "Colette_Armature/Skeleton:ForeArmSkin1.R", "Colette_Armature/Skeleton:ForeArmSkin2.R", "Colette_Armature/Skeleton:ForeArmSkin3.R", "Colette_Armature/Skeleton:Hand.R", "Colette_Armature/Skeleton:HandMark_IK_FK.R", "Colette_Armature/Skeleton:Shoulder.R", "Colette_Armature/Skeleton:UpperArm.R", "Colette_Armature/Skeleton:UpperArmSkin1.R", "Colette_Armature/Skeleton:UpperArmSkin2.R", "Colette_Armature/Skeleton:UpperArmSkin3.R", "Colette_Armature/Skeleton:hand_r", "Robot_Skeleton/Skeleton:neck.001", "Robot_Skeleton/Skeleton:upper_arm.R" ]
[sub_resource type="AnimationNodeAnimation" id=61]
resource_local_to_scene = true
animation = "AIM-Down"
[sub_resource type="AnimationNodeAnimation" id=62]
resource_local_to_scene = true
animation = "AIM-Up"
[sub_resource type="AnimationNodeBlend2" id=63]
resource_local_to_scene = true
filter_enabled = true
filters = [ "Colette_Armature/Skeleton:Eye.L", "Colette_Armature/Skeleton:Eye.L.001", "Colette_Armature/Skeleton:Eye.L.002", "Colette_Armature/Skeleton:Eye.R", "Colette_Armature/Skeleton:Eye.R.001", "Colette_Armature/Skeleton:Eye.R.002", "Colette_Armature/Skeleton:EyeMaster", "Colette_Armature/Skeleton:Eyebrowflex.L", "Colette_Armature/Skeleton:Eyebrowflex.R", "Colette_Armature/Skeleton:Eyeslash.L", "Colette_Armature/Skeleton:Eyeslash.R", "Colette_Armature/Skeleton:eyebrow1.L", "Colette_Armature/Skeleton:eyebrow1.R", "Colette_Armature/Skeleton:eyebrow2.L.001", "Colette_Armature/Skeleton:eyebrow2.R.001", "Colette_Armature/Skeleton:eyebrow3.L.001", "Colette_Armature/Skeleton:eyebrow3.R.001", "Colette_Armature/Skeleton:eyebrow4.L.001", "Colette_Armature/Skeleton:eyebrow4.R.001", "Colette_Armature/Skeleton:eyebrow5.L", "Colette_Armature/Skeleton:eyebrow5.R", "Colette_Armature/Skeleton:eyebrowMaster.L", "Colette_Armature/Skeleton:eyebrowMaster.R", "Robot_Skeleton/Skeleton:eyelid.d.L", "Robot_Skeleton/Skeleton:eyelid.d.R", "Robot_Skeleton/Skeleton:eyelid.u.L", "Robot_Skeleton/Skeleton:eyelid.u.R", "Robot_Skeleton/Skeleton:eyes" ]
[sub_resource type="AnimationNodeAnimation" id=44]
resource_local_to_scene = true
animation = "eyes-cycle"
[sub_resource type="AnimationNodeAnimation" id=45]
resource_local_to_scene = true
animation = "jump_5_hardlanding"
[sub_resource type="AnimationNodeAnimation" id=39]
animation = "Aim"
[sub_resource type="AnimationNodeAnimation" id=46]
resource_local_to_scene = true
animation = "jump_4_falling-cycle"
[sub_resource type="AnimationNodeAnimation" id=47]
resource_local_to_scene = true
animation = "jump_2_upwards-cycle"
[sub_resource type="AnimationNodeOneShot" id=48]
resource_local_to_scene = true
fadein_time = 0.25
fadeout_time = 0.25
autorestart_random_delay = 1.0
[sub_resource type="AnimationNodeTransition" id=49]
resource_local_to_scene = true
input_count = 5
xfade_time = 0.15
input_0/name = "idle"
input_0/auto_advance = false
input_1/name = "strafe"
input_1/auto_advance = false
input_2/name = "walk"
input_2/auto_advance = false
input_3/name = "jump_up"
input_3/auto_advance = false
input_4/name = "jump_down"
input_4/auto_advance = false
[sub_resource type="AnimationNodeAnimation" id=64]
resource_local_to_scene = true
animation = "strafe_left-cycle"
[sub_resource type="AnimationNodeAnimation" id=65]
resource_local_to_scene = true
animation = "strafe_right-cycle"
[sub_resource type="AnimationNodeAnimation" id=66]
resource_local_to_scene = true
animation = "strafe_back-cycle"
[sub_resource type="AnimationNodeAnimation" id=67]
resource_local_to_scene = true
animation = "strafe_front-cycle"
[sub_resource type="AnimationNodeAnimation" id=68]
resource_local_to_scene = true
animation = "Idlecombat-cycle"
[sub_resource type="AnimationNodeBlendSpace2D" id=55]
resource_local_to_scene = true
blend_point_0/node = SubResource( 64 )
blend_point_0/pos = Vector2( 1, 0 )
blend_point_1/node = SubResource( 65 )
blend_point_1/pos = Vector2( -1, 0 )
blend_point_2/node = SubResource( 66 )
blend_point_2/pos = Vector2( 0, -1 )
blend_point_3/node = SubResource( 67 )
blend_point_3/pos = Vector2( 0, 1 )
blend_point_4/node = SubResource( 68 )
blend_point_4/pos = Vector2( 0, 0 )
[sub_resource type="AnimationNodeAnimation" id=69]
resource_local_to_scene = true
animation = "Idle-cycle"
[sub_resource type="AnimationNodeAnimation" id=70]
resource_local_to_scene = true
animation = "running_nogun-cycle"
[sub_resource type="AnimationNodeAnimation" id=71]
resource_local_to_scene = true
animation = "running_gun-cycle"
[sub_resource type="AnimationNodeAnimation" id=72]
resource_local_to_scene = true
animation = "Idlecombat-cycle"
[sub_resource type="AnimationNodeBlendSpace2D" id=60]
resource_local_to_scene = true
blend_point_0/node = SubResource( 69 )
blend_point_0/pos = Vector2( 0, 0 )
blend_point_1/node = SubResource( 70 )
blend_point_1/pos = Vector2( 1, 0 )
blend_point_2/node = SubResource( 71 )
blend_point_2/pos = Vector2( 1, 1 )
blend_point_3/node = SubResource( 72 )
blend_point_3/pos = Vector2( 0, 1 )
min_space = Vector2( 0, 0 )
x_label = "speed"
y_label = "gun"
[sub_resource type="AnimationNodeBlendTree" id=73]
resource_local_to_scene = true
graph_offset = Vector2( -819, 27 )
nodes/aim/node = SubResource( 40 )
nodes/aim/position = Vector2( 380, 120 )
nodes/aimdown/node = SubResource( 61 )
nodes/aimdown/position = Vector2( 120, 60 )
nodes/aimup/node = SubResource( 62 )
nodes/aimup/position = Vector2( 140, 380 )
nodes/eye_blend/node = SubResource( 63 )
nodes/eye_blend/position = Vector2( 640, 120 )
nodes/eyes/node = SubResource( 44 )
nodes/eyes/position = Vector2( 380, 360 )
nodes/hardland/node = SubResource( 45 )
nodes/hardland/position = Vector2( -160, 400 )
nodes/idle/node = SubResource( 39 )
nodes/idle/position = Vector2( -420, -40 )
nodes/jumpdown/node = SubResource( 46 )
nodes/jumpdown/position = Vector2( -420, 400 )
nodes/jumpup/node = SubResource( 47 )
nodes/jumpup/position = Vector2( -440, 280 )
nodes/land/node = SubResource( 48 )
nodes/land/position = Vector2( 120, 180 )
nodes/output/position = Vector2( 840, 120 )
nodes/state/node = SubResource( 49 )
nodes/state/position = Vector2( -120, 120 )
nodes/strafe/node = SubResource( 55 )
nodes/strafe/position = Vector2( -640, 40 )
nodes/walk/node = SubResource( 60 )
nodes/walk/position = Vector2( -640, 200 )
node_connections = [ "state", 0, "idle", "state", 1, "strafe", "state", 2, "walk", "state", 3, "jumpup", "state", 4, "jumpdown", "output", 0, "eye_blend", "eye_blend", 0, "aim", "eye_blend", 1, "eyes", "land", 0, "state", "land", 1, "hardland", "aim", 0, "aimdown", "aim", 1, "land", "aim", 2, "aimup" ]
[node name="merc_st_1" type="KinematicBody"]
script = ExtResource( 4 )
[node name="merc1" parent="." instance=ExtResource( 1 )]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
[node name="BoneAttachment" parent="merc1/CharacterRig001/Skeleton" index="0"]
transform = Transform( 1, -1.77636e-15, 0, 1.77636e-14, 0.999486, -0.0320689, -5.68434e-14, 0.032069, 0.999485, -0.141024, 2.85038, 0.253468 )
[node name="BoneAttachment2" parent="merc1/CharacterRig001/Skeleton" index="1"]
transform = Transform( -0.864423, -0.469201, -0.180617, -0.0894964, -0.209907, 0.973616, -0.494735, 0.857782, 0.139457, 0.253897, 1.91372, 0.970537 )
[node name="BoneAttachment3" parent="merc1/CharacterRig001/Skeleton" index="2"]
transform = Transform( 0.41059, -0.0995836, -0.906366, -0.762978, -0.58181, -0.281711, -0.499279, 0.807205, -0.314866, -1.05637, 1.45186, 0.211358 )
[node name="BoneAttachment4" parent="merc1/CharacterRig001/Skeleton" index="3"]
transform = Transform( 0.987501, 0.0954544, -0.125421, 0.00230877, -0.804427, -0.594048, -0.157597, 0.586333, -0.794592, 0.336515, 0.182227, 1.29471 )
[node name="BoneAttachment5" parent="merc1/CharacterRig001/Skeleton" index="4"]
transform = Transform( 0.990442, 0.133285, -0.0354968, 0.00633056, -0.301008, -0.953602, -0.137785, 0.944261, -0.298975, 0.179503, 0.536819, 0.182357 )
[node name="BoneAttachment6" parent="merc1/CharacterRig001/Skeleton" index="5"]
transform = Transform( 0.993216, -0.0799971, 0.0843927, -0.115633, -0.756083, 0.64418, 0.0122754, -0.64957, -0.760203, -0.415847, -0.78547, 0.189681 )
[node name="BoneAttachment7" parent="merc1/CharacterRig001/Skeleton" index="6"]
transform = Transform( 0.995782, -0.0915606, 0.00586568, -0.0916677, -0.995552, 0.0218013, 0.00384344, -0.0222471, -0.999746, -0.307987, 0.387305, 0.215888 )
[node name="BoneAttachment8" parent="merc1/CharacterRig001/Skeleton" index="7"]
transform = Transform( 1, -1.06581e-14, 2.38419e-07, 6.17289e-08, 0.965901, -0.25891, -2.30289e-07, 0.25891, 0.965901, -0.141024, 0.588151, 0.19426 )
[node name="BoneAttachment9" parent="merc1/CharacterRig001/Skeleton" index="8"]
transform = Transform( 1, -1.06581e-14, 2.38419e-07, 6.17289e-08, 0.965901, -0.25891, -2.30289e-07, 0.25891, 0.965901, -0.141024, 0.588151, 0.19426 )
[node name="GunBone" type="BoneAttachment" parent="merc1/CharacterRig001/Skeleton" index="20"]
[node name="ShootFrom" type="Position3D" parent="merc1/CharacterRig001/Skeleton/GunBone"]
transform = Transform( 1, 0, 0, 0, -1, 8.74228e-08, 0, -8.74228e-08, -1, -0.83252, 1.76359, 2.32827 )
[node name="ShootParticle" type="Particles" parent="merc1/CharacterRig001/Skeleton/GunBone/ShootFrom"]
transform = Transform( 1, 2.04891e-08, 0, 3.21306e-08, 1, 5.58794e-09, 0, 0, 1, 0, 0, 0 )
material_override = ExtResource( 2 )
emitting = false
amount = 10
lifetime = 0.3
one_shot = true
explosiveness = 0.79
local_coords = false
process_material = SubResource( 2 )
draw_pass_1 = SubResource( 3 )
[node name="MuzzleFlash" type="Particles" parent="merc1/CharacterRig001/Skeleton/GunBone/ShootFrom"]
transform = Transform( 1, 0, -2.00234e-08, 1.21072e-08, -4.37722e-08, -1, -2.98023e-08, 1, -4.74975e-08, 0, 0, 0 )
material_override = SubResource( 4 )
emitting = false
amount = 1
lifetime = 0.1
one_shot = true
explosiveness = 1.0
process_material = SubResource( 9 )
draw_pass_1 = ExtResource( 5 )
[node name="ChestBone" type="BoneAttachment" parent="merc1/CharacterRig001/Skeleton" index="21"]
transform = Transform( 1, -4.84561e-15, -2.38419e-07, 2.16312e-10, 0.999999, 0.000907198, 2.38418e-07, -0.000907179, 0.999999, -0.141024, 1.4479, 0.307752 )
bone_name = "spine2"
[node name="Hitbox" type="KinematicBody" parent="merc1/CharacterRig001/Skeleton/ChestBone"]
collision_layer = 64
collision_mask = 0
script = ExtResource( 12 )
node_with_hit = NodePath("../../../../..")
[node name="CollisionShape" type="CollisionShape" parent="merc1/CharacterRig001/Skeleton/ChestBone/Hitbox"]
transform = Transform( 1, 0, -6.93889e-17, -6.93889e-17, -4.4005e-08, -1, 0, 1, -4.4005e-08, 7.45058e-08, -0.228799, 0.156217 )
shape = SubResource( 75 )
[node name="CapsuleShape" type="CollisionShape" parent="."]
transform = Transform( 0.25, 0, 0, 0, -1.09278e-08, 0.25, 0, -0.25, -1.09278e-08, 0, 0.716, 0 )
shape = SubResource( 1 )
[node name="FireCooldown" type="Timer" parent="."]
wait_time = 0.4
one_shot = true
autostart = true
[node name="ReactionTime" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="PlayerDetection1" type="Area" parent="."]
transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 )
collision_layer = 2
collision_mask = 2
[node name="NormalDetection" type="CollisionShape" parent="PlayerDetection1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 43.7507 )
shape = SubResource( 74 )
[node name="AttentiveLoS" type="CollisionShape" parent="PlayerDetection1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 143.478 )
shape = SubResource( 77 )
disabled = true
[node name="DebugMesh" type="MeshInstance" parent="PlayerDetection1/AttentiveLoS"]
visible = false
mesh = SubResource( 78 )
material/0 = ExtResource( 13 )
[node name="SoundEffects" type="Node" parent="."]
[node name="Step" type="AudioStreamPlayer" parent="SoundEffects"]
stream = ExtResource( 11 )
[node name="Jump" type="AudioStreamPlayer" parent="SoundEffects"]
stream = ExtResource( 9 )
[node name="Land" type="AudioStreamPlayer" parent="SoundEffects"]
stream = ExtResource( 7 )
[node name="Shoot" type="AudioStreamPlayer" parent="SoundEffects"]
stream = SubResource( 11 )
[node name="Explosion" type="AudioStreamPlayer3D" parent="SoundEffects"]
stream = ExtResource( 6 )
unit_db = 12.0
unit_size = 15.0
[node name="Hit" type="AudioStreamPlayer3D" parent="SoundEffects"]
stream = ExtResource( 10 )
unit_db = 3.0
unit_size = 15.0
[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource( 73 )
anim_player = NodePath("../merc1/AnimationPlayer")
active = true
process_mode = 0
root_motion_track = NodePath("Colette_Armature/Skeleton:Root")
parameters/aim/add_amount = 0
parameters/eye_blend/blend_amount = 1.0
parameters/land/active = false
parameters/state/current = 0
parameters/strafe/blend_position = Vector2( 0.00158477, 0.982759 )
parameters/walk/blend_position = Vector2( 0, 0 )
[connection signal="body_entered" from="PlayerDetection1" to="." method="_on_PlayerDetection1_body_entered"]
[connection signal="body_exited" from="PlayerDetection1" to="." method="_on_PlayerDetection1_body_exited"]
[editable path="merc1"]

55
file_format.sh

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# This script ensures proper POSIX text file formatting and a few other things.
set -uo pipefail
IFS=$'\n\t'
# Loops through all text files tracked by Git.
git grep -zIl '' |
while IFS= read -rd '' f; do
# Exclude some types of files.
if [[ "$f" == *"csproj" ]]; then
continue
elif [[ "$f" == *"hdr" ]]; then
continue
fi
# Ensure that files are UTF-8 formatted.
recode UTF-8 "$f" 2> /dev/null
# Ensure that files have LF line endings and do not contain a BOM.
dos2unix "$f" 2> /dev/null
# Remove trailing space characters and ensures that files end
# with newline characters. -l option handles newlines conveniently.
perl -i -ple 's/\s*$//g' "$f"
# Remove the character sequence "== true" if it has a leading space.
perl -i -pe 's/\x20== true//g' "$f"
# We don't want to change lines around braces in godot/tscn files.
if [[ "$f" == *"godot" ]]; then
continue
elif [[ "$f" == *"tscn" ]]; then
continue
fi
# Disallow empty lines after the opening brace.
sed -z -i 's/\x7B\x0A\x0A/\x7B\x0A/g' "$f"
# Disallow some empty lines before the closing brace.
sed -z -i 's/\x0A\x0A\x7D/\x0A\x7D/g' "$f"
done
git diff > patch.patch
FILESIZE="$(stat -c%s patch.patch)"
MAXSIZE=5
# If no patch has been generated all is OK, clean up, and exit.
if (( FILESIZE < MAXSIZE )); then
printf "Files in this commit comply with the formatting rules.\n"
rm -f patch.patch
exit 0
fi
# A patch has been created, notify the user, clean up, and exit.
printf "\n*** The following differences were found between the code "
printf "and the formatting rules:\n\n"
cat patch.patch
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
rm -f patch.patch
exit 1

BIN
icon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

BIN
icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

35
icon.png.import

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

0
level/catalunya/IGNORED_textures_original_size/.gdignore

BIN
level/catalunya/IGNORED_textures_original_size/1024px-Estelada_roja.svg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save