mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
Shooting and big tank fix
This commit is contained in:
parent
cc00c8eaf0
commit
0a6e89faed
26 changed files with 797 additions and 9 deletions
1
3D/BlockbenchModels/FloorEmitter/Floor_Emitter.bbmodel
Normal file
1
3D/BlockbenchModels/FloorEmitter/Floor_Emitter.bbmodel
Normal file
File diff suppressed because one or more lines are too long
1
3D/BlockbenchModels/FloorEmitter/Floor_Emitter.gltf
Normal file
1
3D/BlockbenchModels/FloorEmitter/Floor_Emitter.gltf
Normal file
File diff suppressed because one or more lines are too long
37
3D/BlockbenchModels/FloorEmitter/Floor_Emitter.gltf.import
Normal file
37
3D/BlockbenchModels/FloorEmitter/Floor_Emitter.gltf.import
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://sy821kigcoqx"
|
||||
path="res://.godot/imported/Floor_Emitter.gltf-1cce213213ebe4efb5932c1347f0601f.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://3D/BlockbenchModels/FloorEmitter/Floor_Emitter.gltf"
|
||||
dest_files=["res://.godot/imported/Floor_Emitter.gltf-1cce213213ebe4efb5932c1347f0601f.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/naming_version=1
|
||||
gltf/embedded_image_handling=1
|
||||
BIN
3D/BlockbenchModels/FloorEmitter/Floor_Emitter_0.png
(Stored with Git LFS)
Normal file
BIN
3D/BlockbenchModels/FloorEmitter/Floor_Emitter_0.png
(Stored with Git LFS)
Normal file
Binary file not shown.
37
3D/BlockbenchModels/FloorEmitter/Floor_Emitter_0.png.import
Normal file
37
3D/BlockbenchModels/FloorEmitter/Floor_Emitter_0.png.import
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://1cuticategid"
|
||||
path="res://.godot/imported/Floor_Emitter_0.png-80f8ab069919460163571a408c1b25cc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
generator_parameters={
|
||||
"md5": "03044050c81c04b0e47e67d76e9b6c81"
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://3D/BlockbenchModels/FloorEmitter/Floor_Emitter_0.png"
|
||||
dest_files=["res://.godot/imported/Floor_Emitter_0.png-80f8ab069919460163571a408c1b25cc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=3
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
BIN
3D/BlockbenchModels/FloorEmitter/Floor_Emitter_Texture.png
(Stored with Git LFS)
Normal file
BIN
3D/BlockbenchModels/FloorEmitter/Floor_Emitter_Texture.png
(Stored with Git LFS)
Normal file
Binary file not shown.
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://vak6buokgaem"
|
||||
path="res://.godot/imported/Floor_Emitter_Texture.png-65ae20c317b4847f0ac11fbf70da0349.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://3D/BlockbenchModels/FloorEmitter/Floor_Emitter_Texture.png"
|
||||
dest_files=["res://.godot/imported/Floor_Emitter_Texture.png-65ae20c317b4847f0ac11fbf70da0349.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=3
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=270 format=4 uid="uid://c8gtrjf2xeue7"]
|
||||
[gd_scene load_steps=272 format=4 uid="uid://c8gtrjf2xeue7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://kno58homctew" path="res://addons/func_godot/src/map/func_godot_map.gd" id="1_n6h0p"]
|
||||
[ext_resource type="Script" uid="uid://crpgy1o73rtlx" path="res://Scripts/Utils/MapProxy3D.cs" id="1_pvlbf"]
|
||||
|
|
@ -64,6 +64,8 @@
|
|||
[ext_resource type="PackedScene" uid="uid://c0262d4ffxx1w" path="res://3D/Scenes/Props/Door_Path_3D.tscn" id="57_orfn6"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0fu2ul3gg8fl" path="res://3D/BlockbenchModels/Tank/Tank_3D_Huge.tscn" id="57_r8ono"]
|
||||
[ext_resource type="PackedScene" uid="uid://dx4denbc7xkfm" path="res://3D/Scenes/Props/Posters/Poster_Warning.tscn" id="63_booe2"]
|
||||
[ext_resource type="PackedScene" uid="uid://d4ek8xjuh6y11" path="res://3D/Scenes/Props/Floor_Emitter_3D.tscn" id="63_r8ono"]
|
||||
[ext_resource type="Resource" uid="uid://bbogxl60hvdp1" path="res://Resources/BulletScripts/Emitter_Sprial_Test_Bullets.tres" id="64_fi82p"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_aq78g"]
|
||||
albedo_texture = ExtResource("25_btjo4")
|
||||
|
|
@ -2199,6 +2201,10 @@ metadata/_edit_group_ = true
|
|||
[node name="Door" parent="Props" instance=ExtResource("57_orfn6")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 7.38277, 2, 25.0228)
|
||||
|
||||
[node name="FloorEmitter" parent="Props" instance=ExtResource("63_r8ono")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 24.9526, 1.32944, 25.5859)
|
||||
Script = ExtResource("64_fi82p")
|
||||
|
||||
[node name="Light" type="Node3D" parent="."]
|
||||
|
||||
[node name="OmniLight3D4" type="OmniLight3D" parent="Light"]
|
||||
|
|
|
|||
|
|
@ -1517,6 +1517,106 @@
|
|||
( 196 372 20 ) ( 197 372 20 ) ( 196 372 21 ) Floors/Floor26 [ 1 0 0 0 ] [ 0 0 -1 0 ] 270 1 1
|
||||
( 196 372 20 ) ( 196 372 21 ) ( 196 373 20 ) Floors/Floor26 [ 0 1 0 -4 ] [ 0 0 -1 0 ] 90 1 1
|
||||
}
|
||||
// brush 168
|
||||
{
|
||||
( 244 624 20 ) ( 244 596 20 ) ( 244 624 16 ) __TB_empty [ 0 1 0 -8 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 252 596 16 ) ( 244 596 16 ) ( 252 596 20 ) __TB_empty [ 1 0 0 28 ] [ 0 0 -1 0 ] 180 1 1
|
||||
( 252 624 16 ) ( 244 624 16 ) ( 252 596 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 252 596 20 ) ( 244 596 20 ) ( 252 624 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 252 624 20 ) ( 244 624 20 ) ( 252 624 16 ) __TB_empty [ -1 0 0 -28 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 252 596 20 ) ( 252 624 20 ) ( 252 596 16 ) __TB_empty [ 0 1 0 0 ] [ 0 0 -1 0 ] 180 1 1
|
||||
}
|
||||
// brush 169
|
||||
{
|
||||
( 224 596 16 ) ( 224 624 16 ) ( 224 596 20 ) __TB_empty [ 0 -1 0 0 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 224 596 20 ) ( 232 596 20 ) ( 224 596 16 ) __TB_empty [ 1 0 0 28 ] [ 0 0 -1 0 ] 180 1 1
|
||||
( 224 596 16 ) ( 232 596 16 ) ( 224 624 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 224 624 20 ) ( 232 624 20 ) ( 224 596 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 224 624 16 ) ( 232 624 16 ) ( 224 624 20 ) __TB_empty [ -1 0 0 -28 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 232 596 16 ) ( 232 596 20 ) ( 232 624 16 ) __TB_empty [ 0 -1 0 8 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 170
|
||||
{
|
||||
( 244 611.6076951545867 20 ) ( 244 611.6076951545867 16 ) ( 236.84529946162075 624 20 ) __TB_empty [ -0.4999999999999999 0.8660254037844387 0 -6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 244 624 16 ) ( 236.84529946162075 624 16 ) ( 244 611.6076951545867 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 244 624 20 ) ( 244 611.6076951545867 20 ) ( 236.84529946162075 624 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 244 624 20 ) ( 236.84529946162075 624 20 ) ( 244 624 16 ) __TB_empty [ -1 0 0 -28 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 244 624 16 ) ( 244 611.6076951545867 16 ) ( 244 624 20 ) __TB_empty [ 0 1 0 -8 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 171
|
||||
{
|
||||
( 232 596 16 ) ( 232 608.3923048454133 16 ) ( 232 596 20 ) __TB_empty [ 0 -1 0 8 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 232 596 20 ) ( 239.15470053837925 596 20 ) ( 232 596 16 ) __TB_empty [ 1 0 0 28 ] [ 0 0 -1 0 ] 180 1 1
|
||||
( 232 596 16 ) ( 239.15470053837925 596 16 ) ( 232 608.3923048454133 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 232 596 20 ) ( 232 608.3923048454133 20 ) ( 239.15470053837925 596 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 232 608.3923048454133 16 ) ( 239.15470053837925 596 16 ) ( 232 608.3923048454133 20 ) __TB_empty [ 0.4999999999999999 -0.8660254037844387 0 6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 172
|
||||
{
|
||||
( 232 624 20 ) ( 232 611.6076951545867 20 ) ( 232 624 16 ) __TB_empty [ 0 -1 0 8 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 232 624 16 ) ( 232 611.6076951545867 16 ) ( 236.84529946162075 624 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 236.84529946162075 624 20 ) ( 238 622 20 ) ( 232 624 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 232 624 16 ) ( 236.84529946162075 624 16 ) ( 232 624 20 ) __TB_empty [ -1 0 0 -28 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 238 622 20 ) ( 238 622 16 ) ( 232 611.6076951545867 20 ) __TB_empty [ -0.4999999999999999 -0.8660254037844387 0 6.9282227 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 236.84529946162075 624 16 ) ( 238 622 16 ) ( 236.84529946162075 624 20 ) __TB_empty [ -0.4999999999999999 0.8660254037844387 0 -6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 173
|
||||
{
|
||||
( 239.15470053837925 596 16 ) ( 238 598 16 ) ( 239.15470053837925 596 20 ) __TB_empty [ 0.4999999999999999 -0.8660254037844387 0 6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 244 608.3923048454133 16 ) ( 244 608.3923048454133 20 ) ( 238 598 16 ) __TB_empty [ 0.4999999999999999 0.8660254037844387 0 -6.9282227 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 244 596 16 ) ( 239.15470053837925 596 16 ) ( 244 596 20 ) __TB_empty [ 1 0 0 28 ] [ 0 0 -1 0 ] 180 1 1
|
||||
( 244 596 16 ) ( 244 608.3923048454133 16 ) ( 239.15470053837925 596 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 239.15470053837925 596 20 ) ( 238 598 20 ) ( 244 596 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 244 596 20 ) ( 244 608.3923048454133 20 ) ( 244 596 16 ) __TB_empty [ 0 1 0 -8 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 174
|
||||
{
|
||||
( 238 622 20 ) ( 234.53589838486224 616 20 ) ( 238 622 16 ) __TB_empty [ -0.4999999999999999 -0.8660254037844387 0 0.92822266 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 234.53589838486224 616 16 ) ( 234.53589838486224 616 20 ) ( 241.46410161513776 616 16 ) __TB_empty [ -1 0 0 0 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 238 622 16 ) ( 234.53589838486224 616 16 ) ( 241.46410161513776 616 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 238 622 20 ) ( 241.46410161513776 616 20 ) ( 234.53589838486224 616 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 238 622 16 ) ( 241.46410161513776 616 16 ) ( 238 622 20 ) __TB_empty [ -0.4999999999999999 0.8660254037844387 0 -6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 175
|
||||
{
|
||||
( 238 598 16 ) ( 234.53589838486224 604 16 ) ( 238 598 20 ) __TB_empty [ 0.4999999999999999 -0.8660254037844387 0 6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 238 598 16 ) ( 241.46410161513776 604 16 ) ( 234.53589838486224 604 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 238 598 20 ) ( 234.53589838486224 604 20 ) ( 241.46410161513776 604 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 241.46410161513776 604 16 ) ( 241.46410161513776 604 20 ) ( 234.53589838486224 604 16 ) __TB_empty [ 1 0 0 0 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 238 598 20 ) ( 241.46410161513776 604 20 ) ( 238 598 16 ) __TB_empty [ 0.4999999999999999 0.8660254037844387 0 -6.9282227 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 176
|
||||
{
|
||||
( 239.60769515458685 616 20 ) ( 242.39230484541324 614.3923048454133 20 ) ( 239.60769515458685 616 16 ) __TB_empty [ -0.8660254037844387 0.4999999999999999 0 -4 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 241.46410161513776 616 16 ) ( 239.60769515458685 616 16 ) ( 242.39230484541324 614.3923048454133 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 241.46410161513776 616 20 ) ( 242.39230484541324 614.3923048454133 20 ) ( 239.60769515458685 616 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 241.46410161513776 616 20 ) ( 239.60769515458685 616 20 ) ( 241.46410161513776 616 16 ) __TB_empty [ -1 0 0 0 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 241.46410161513776 616 16 ) ( 242.39230484541324 614.3923048454133 16 ) ( 241.46410161513776 616 20 ) __TB_empty [ -0.4999999999999999 0.8660254037844387 0 -6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 177
|
||||
{
|
||||
( 234.53589838486224 604 16 ) ( 233.60769515458668 605.6076951545868 16 ) ( 234.53589838486224 604 20 ) __TB_empty [ 0.4999999999999999 -0.8660254037844387 0 6.928192 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 234.53589838486224 604 20 ) ( 236.39230484541338 604 20 ) ( 234.53589838486224 604 16 ) __TB_empty [ 1 0 0 0 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 234.53589838486224 604 16 ) ( 236.39230484541338 604 16 ) ( 233.60769515458668 605.6076951545868 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 234.53589838486224 604 20 ) ( 233.60769515458668 605.6076951545868 20 ) ( 236.39230484541338 604 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 236.39230484541338 604 20 ) ( 233.60769515458668 605.6076951545868 20 ) ( 236.39230484541338 604 16 ) __TB_empty [ 0.8660254037844387 -0.4999999999999999 0 4 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
// brush 178
|
||||
{
|
||||
( 242.39230484541324 605.6076951545867 16 ) ( 242.39230484541324 605.6076951545867 20 ) ( 239.60769515458682 604 16 ) __TB_empty [ 0.8660254037844387 0.4999999999999999 0 -4 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 241.46410161513776 604 16 ) ( 239.60769515458682 604 16 ) ( 241.46410161513776 604 20 ) __TB_empty [ 1 0 0 0 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 241.46410161513776 604 16 ) ( 242.39230484541324 605.6076951545867 16 ) ( 239.60769515458682 604 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 241.46410161513776 604 20 ) ( 239.60769515458682 604 20 ) ( 242.39230484541324 605.6076951545867 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 241.46410161513776 604 20 ) ( 242.39230484541324 605.6076951545867 20 ) ( 241.46410161513776 604 16 ) __TB_empty [ 0.4999999999999999 0.8660254037844387 0 -0.92822266 ] [ 0 0 -1 0 ] 90 1 1
|
||||
}
|
||||
// brush 179
|
||||
{
|
||||
( 234.53589838486224 616 20 ) ( 233.6076951545867 614.3923048454133 20 ) ( 234.53589838486224 616 16 ) __TB_empty [ -0.4999999999999999 -0.8660254037844387 0 0.92822266 ] [ 0 0 -1 0 ] 90 1 1
|
||||
( 234.53589838486224 616 16 ) ( 233.6076951545867 614.3923048454133 16 ) ( 236.39230484541332 616 16 ) __TB_empty [ -1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 234.53589838486224 616 20 ) ( 236.39230484541332 616 20 ) ( 233.6076951545867 614.3923048454133 20 ) __TB_empty [ 1 0 0 0 ] [ 0 -1 0 8 ] 90 1 1
|
||||
( 234.53589838486224 616 16 ) ( 236.39230484541332 616 16 ) ( 234.53589838486224 616 20 ) __TB_empty [ -1 0 0 0 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
( 236.39230484541332 616 20 ) ( 236.39230484541332 616 16 ) ( 233.6076951545867 614.3923048454133 20 ) __TB_empty [ -0.8660254037844387 -0.4999999999999999 0 4 ] [ 0 0 -1 -4 ] 90 1 1
|
||||
}
|
||||
}
|
||||
// entity 1
|
||||
{
|
||||
|
|
@ -2231,6 +2331,7 @@
|
|||
"classname" "actor_box_red"
|
||||
"origin" "376 488 28"
|
||||
"targetname" "actor_elevator_test"
|
||||
"angle" "45"
|
||||
}
|
||||
// entity 69
|
||||
{
|
||||
|
|
@ -2753,6 +2854,6 @@
|
|||
// entity 148
|
||||
{
|
||||
"classname" "actor_tank_large"
|
||||
"origin" "432 464 32"
|
||||
"angle" "90"
|
||||
"origin" "429.93 463.728 32"
|
||||
"angles" "0 90 0"
|
||||
}
|
||||
|
|
|
|||
23
3D/Scenes/Props/Floor_Emitter_3D.tscn
Normal file
23
3D/Scenes/Props/Floor_Emitter_3D.tscn
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://d4ek8xjuh6y11"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dpibtd73awwp7" path="res://Scripts/Actors/ScriptableBulletsEmitter3D.cs" id="1_dtfaj"]
|
||||
[ext_resource type="PackedScene" uid="uid://sy821kigcoqx" path="res://3D/BlockbenchModels/FloorEmitter/Floor_Emitter.gltf" id="3_ro7iq"]
|
||||
[ext_resource type="Script" uid="uid://bf5f2phitdqw8" path="res://Scripts/Actors/BulletSpawner3D.cs" id="4_0cjnq"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_hsg1w"]
|
||||
size = Vector3(0.763428, 0.469452, 0.77832)
|
||||
|
||||
[node name="FloorEmitter" type="StaticBody3D"]
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("1_dtfaj")
|
||||
EmitOnStart = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00549316, 0.0253752, -0.000488281)
|
||||
shape = SubResource("BoxShape3D_hsg1w")
|
||||
|
||||
[node name="blockbench_export" parent="." instance=ExtResource("3_ro7iq")]
|
||||
|
||||
[node name="BulletSpawner3D" type="Node3D" parent="."]
|
||||
script = ExtResource("4_0cjnq")
|
||||
36
Resources/BulletScripts/Emitter_Sprial_Test_Bullets.tres
Normal file
36
Resources/BulletScripts/Emitter_Sprial_Test_Bullets.tres
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
[gd_resource type="Resource" script_class="BulletScript3D" load_steps=6 format=3 uid="uid://bbogxl60hvdp1"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://wbdspte0ch33" path="res://Resources/Bullets/simple_enemy_bullet_3D.tres" id="1_bjips"]
|
||||
[ext_resource type="Script" uid="uid://b5s5mjuk1rng5" path="res://Scripts/Resources/TimeModifier.cs" id="2_yjtbi"]
|
||||
[ext_resource type="Script" uid="uid://bxiprx5nwmpnu" path="res://Scripts/AttackPatterns/ShootingPattern3D.cs" id="3_2rxa2"]
|
||||
[ext_resource type="Script" uid="uid://w8hcpu68ssq" path="res://Scripts/Resources/BulletScripts/BulletScript3D.cs" id="4_mksdg"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_2y301"]
|
||||
script = ExtResource("3_2rxa2")
|
||||
BulletResource = ExtResource("1_bjips")
|
||||
EmitterOffset = Vector3(0, 0, 0)
|
||||
bulletCount = 2
|
||||
rotationSpeed = 60.0
|
||||
_rotationOffset = 0.0
|
||||
duration = 10.0
|
||||
spread = 360.0
|
||||
burstInterval = 0.1
|
||||
ShotsPerBurst = 6
|
||||
BurstRate = 0.5
|
||||
_targetPlayer = false
|
||||
_predictPlayer = false
|
||||
OverrideOwner = false
|
||||
Owner = 0
|
||||
OverrideDamageType = false
|
||||
DamageType = 0
|
||||
OverrideControllable = false
|
||||
Controllable = false
|
||||
OverrideCreationModifier = false
|
||||
TimeModifiers = Array[ExtResource("2_yjtbi")]([])
|
||||
WaitForCompletion = true
|
||||
metadata/_custom_type_script = "uid://bxiprx5nwmpnu"
|
||||
|
||||
[resource]
|
||||
script = ExtResource("4_mksdg")
|
||||
Patterns = Array[Object]([SubResource("Resource_2y301")])
|
||||
metadata/_custom_type_script = "uid://w8hcpu68ssq"
|
||||
24
Resources/Bullets/simple_enemy_bullet_3D.tres
Normal file
24
Resources/Bullets/simple_enemy_bullet_3D.tres
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[gd_resource type="Resource" script_class="BulletResource" load_steps=3 format=3 uid="uid://wbdspte0ch33"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d28e1t2c0lwbp" path="res://Scenes/Weapons/base_enemy_bullet_3D.tscn" id="1_l7ter"]
|
||||
[ext_resource type="Script" uid="uid://dslyrfcej3g2n" path="res://Scripts/Resources/BulletResource.cs" id="2_5nrie"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_5nrie")
|
||||
BulletScene = ExtResource("1_l7ter")
|
||||
BulletSpeed = 2.0
|
||||
Direction = Vector2(1, 0)
|
||||
BulletDamage = 12.0
|
||||
MaxDamage = 1.0
|
||||
Knockback = 1.0
|
||||
LifeTime = 10.0
|
||||
DestroyOnCollision = true
|
||||
Owner = 2
|
||||
DamageType = 0
|
||||
RotateSprite = false
|
||||
Controllable = false
|
||||
Freezable = true
|
||||
Grazeable = true
|
||||
GrazeValue = 1.0
|
||||
Attributes = 290
|
||||
TimeModifiers = []
|
||||
29
Scenes/Weapons/base_enemy_bullet_3D.tscn
Normal file
29
Scenes/Weapons/base_enemy_bullet_3D.tscn
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://d28e1t2c0lwbp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cg6y36s7buapp" path="res://Scripts/Weapons/Bullet3D.cs" id="1_xnqcl"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfldr7l7dearo" path="res://Sprites/Bullets/mid_bullet_red.png" id="2_xnqcl"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_pklkt"]
|
||||
radius = 0.172059
|
||||
|
||||
[node name="Bullet" type="Area3D" groups=["bullets"]]
|
||||
collision_layer = 128
|
||||
collision_mask = 23
|
||||
script = ExtResource("1_xnqcl")
|
||||
Speed = 200.0
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="Sprite" type="Sprite3D" parent="."]
|
||||
pixel_size = 0.05
|
||||
billboard = 1
|
||||
texture_filter = 0
|
||||
texture = ExtResource("2_xnqcl")
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("SphereShape3D_pklkt")
|
||||
|
||||
[node name="VisibleOnScreenNotifier" type="VisibleOnScreenNotifier3D" parent="."]
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
[connection signal="screen_exited" from="VisibleOnScreenNotifier" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]
|
||||
55
Scripts/Actors/BulletSpawner3D.cs
Normal file
55
Scripts/Actors/BulletSpawner3D.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using Cirno.Scripts.Components;
|
||||
using Cirno.Scripts.Controllers;
|
||||
using Cirno.Scripts.Weapons;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
public partial class BulletSpawner3D : Node3D
|
||||
{
|
||||
[Export] public PackedScene BulletScene;
|
||||
|
||||
public void SpawnBullet(BulletInfo bulletInfo, Vector3 position)
|
||||
{
|
||||
var bulletScene = bulletInfo.BulletScene ?? BulletScene;
|
||||
Bullet3D bullet;
|
||||
int count = bulletInfo.BulletCount;
|
||||
float spreadRadians = Mathf.DegToRad(bulletInfo.Spread);
|
||||
float step = count > 1 ? spreadRadians / (count - 1) : 0;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
|
||||
bullet = PoolingManager.Instance.SpawnBullet<Bullet3D>(bulletInfo.OriginalBulletResource);
|
||||
bullet.GlobalPosition = position;
|
||||
|
||||
if (bulletInfo.Modifier is not null)
|
||||
{
|
||||
bulletInfo = bulletInfo.Modifier.ModifyBullet(bulletInfo, i, count);
|
||||
}
|
||||
|
||||
bullet.Initialize(bulletInfo);
|
||||
|
||||
Vector2 baseDirection = bulletInfo.Direction == Vector2.Zero ? Vector2.Right : bulletInfo.Direction.Normalized();
|
||||
float baseAngle = Mathf.Atan2(baseDirection.Y, baseDirection.X);
|
||||
|
||||
// Spread centered: offset from center
|
||||
float offsetFromCenter = (i - (count - 1) / 2.0f) * step;
|
||||
float angle = baseAngle + Mathf.DegToRad(bulletInfo.RotationOffset) + offsetFromCenter;
|
||||
|
||||
Vector2 bulletDirection = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle));
|
||||
bullet.SetDirection(bulletDirection);
|
||||
|
||||
// float offsetRadians = Mathf.DegToRad(bulletInfo.RotationOffset);
|
||||
// float spreadStep = Mathf.DegToRad(bulletInfo.Spread) / Mathf.Max(1, bulletInfo.BulletCount - 1); // Ensure proper spread spacing, also add 1 if 0
|
||||
// float angle = baseAngle + offsetRadians + (spreadStep * i);
|
||||
//
|
||||
//
|
||||
// Vector2 bulletDirection = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle));
|
||||
//
|
||||
// bullet.SetDirection(bulletDirection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Scripts/Actors/BulletSpawner3D.cs.uid
Normal file
1
Scripts/Actors/BulletSpawner3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bf5f2phitdqw8
|
||||
97
Scripts/Actors/ScriptableBulletsEmitter3D.cs
Normal file
97
Scripts/Actors/ScriptableBulletsEmitter3D.cs
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
using Cirno.Scripts.AttackPatterns;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Resources.BulletScripts;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
public partial class ScriptableBulletsEmitter3D : Node3D, IActivable, IScriptHost3D
|
||||
{
|
||||
public Node3D ParentObject => this;
|
||||
|
||||
[Export]
|
||||
public BulletScript3D Script { get; set; }
|
||||
|
||||
[Export]
|
||||
public bool InvertSignal { get; private set; } = false;
|
||||
|
||||
[Export]
|
||||
public bool EmitOnStart { get; set; } = false;
|
||||
|
||||
[Signal]
|
||||
public delegate void StateChangedEventHandler(bool isEmitting);
|
||||
|
||||
private bool _isActive = false;
|
||||
|
||||
//private BulletScript _scriptInstance;
|
||||
|
||||
protected BulletScript3D.BulletScriptMachine ScriptMachine;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
//_scriptInstance = Script.Duplicate(true) as BulletScript;
|
||||
|
||||
ScriptMachine = Script.Make(this);
|
||||
|
||||
_homePosition = this.GlobalPosition;
|
||||
|
||||
if (EmitOnStart)
|
||||
{
|
||||
_isActive = true;
|
||||
ScriptMachine.Start();
|
||||
}
|
||||
EmitSignal(SignalName.StateChanged, _isActive);
|
||||
}
|
||||
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
switch (activationType)
|
||||
{
|
||||
case ActivationType.Use:
|
||||
case ActivationType.Toggle:
|
||||
_isActive = !_isActive;
|
||||
break;
|
||||
case ActivationType.Open:
|
||||
case ActivationType.Enable:
|
||||
_isActive = !InvertSignal;
|
||||
break;
|
||||
case ActivationType.Close:
|
||||
case ActivationType.Disable:
|
||||
_isActive = InvertSignal;
|
||||
break;
|
||||
case ActivationType.Destroy:
|
||||
_isActive = InvertSignal;
|
||||
// TODO: Explode
|
||||
break;
|
||||
}
|
||||
|
||||
if (_isActive)
|
||||
{
|
||||
ScriptMachine.Start();
|
||||
}
|
||||
|
||||
EmitSignal(SignalName.StateChanged, _isActive);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Toggle()
|
||||
{
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (!_isActive) return;
|
||||
|
||||
ScriptMachine.UpdatePhase(delta);
|
||||
}
|
||||
|
||||
private Vector3 _homePosition;
|
||||
public Vector3 HomePosition => _homePosition;
|
||||
|
||||
public void ChangeSpriteDirection(Vector2 direction)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
1
Scripts/Actors/ScriptableBulletsEmitter3D.cs.uid
Normal file
1
Scripts/Actors/ScriptableBulletsEmitter3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dpibtd73awwp7
|
||||
10
Scripts/AttackPatterns/IScriptHost3D.cs
Normal file
10
Scripts/AttackPatterns/IScriptHost3D.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.AttackPatterns;
|
||||
|
||||
public interface IScriptHost3D
|
||||
{
|
||||
public Node3D ParentObject { get; }
|
||||
public Vector3 HomePosition { get; }
|
||||
public void ChangeSpriteDirection(Vector2 direction);
|
||||
}
|
||||
1
Scripts/AttackPatterns/IScriptHost3D.cs.uid
Normal file
1
Scripts/AttackPatterns/IScriptHost3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c4mqs0ovhgk0x
|
||||
228
Scripts/AttackPatterns/ShootingPattern3D.cs
Normal file
228
Scripts/AttackPatterns/ShootingPattern3D.cs
Normal file
|
|
@ -0,0 +1,228 @@
|
|||
using Cirno.Scripts.Actors;
|
||||
using Cirno.Scripts.Components;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Utils;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.AttackPatterns;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class ShootingPattern3D : AttackPattern
|
||||
{
|
||||
[Export] public BulletResource BulletResource { get; set; }
|
||||
|
||||
[Export] public Vector3 EmitterOffset { get; set; } = Vector3.Zero;
|
||||
|
||||
[Export] public int bulletCount = 16;
|
||||
[Export] public float rotationSpeed = 0f;
|
||||
[Export] public float _rotationOffset = 0f;
|
||||
[Export] public float duration = 5f;
|
||||
[Export] public float spread = 360f;
|
||||
[Export] public float burstInterval = 0.5f;
|
||||
|
||||
[ExportCategory("Burst")] [Export] public int ShotsPerBurst { get; private set; } = 100;
|
||||
|
||||
[Export] public float BurstRate { get; private set; } = 0f;
|
||||
|
||||
[ExportCategory("Other")] [Export] public bool _targetPlayer = false;
|
||||
[ExportCategory("Other")] [Export] public bool _predictPlayer = false;
|
||||
|
||||
[ExportCategory("Overrides")]
|
||||
[Export] public bool OverrideOwner { get; private set; } = false;
|
||||
[Export] public BulletOwner Owner { get; private set; } = BulletOwner.None;
|
||||
[Export] public bool OverrideDamageType { get; private set; } = false;
|
||||
[Export] public DamageType DamageType { get; private set; } = DamageType.Neutral;
|
||||
[Export] public bool OverrideControllable { get; private set; } = false;
|
||||
[Export] public bool Controllable { get; private set; } = false;
|
||||
|
||||
[ExportCategory("Extra Modifiers")]
|
||||
[Export]
|
||||
public bool OverrideCreationModifier { get; private set; } = false;
|
||||
|
||||
[Export] public BulletCreationModifier Modifier;
|
||||
[Export] public Array<TimeModifier> TimeModifiers = [];
|
||||
|
||||
protected virtual BulletInfo MakeBullet(Vector2 position, int count = 1, float spread = 0f, float rotationOffset = 0f)
|
||||
{
|
||||
var bullet = this.BulletResource.MakeBullet(position, count,
|
||||
spread, rotationOffset);
|
||||
|
||||
if (OverrideOwner)
|
||||
{
|
||||
bullet.Owner = this.Owner;
|
||||
}
|
||||
|
||||
if (OverrideDamageType)
|
||||
{
|
||||
bullet.DamageType = DamageType;
|
||||
}
|
||||
|
||||
if (OverrideControllable)
|
||||
{
|
||||
bullet.Controllabe = Controllable;
|
||||
}
|
||||
|
||||
if (OverrideCreationModifier)
|
||||
{
|
||||
bullet.Modifier = this.Modifier;
|
||||
}
|
||||
|
||||
if (TimeModifiers.Count != 0)
|
||||
{
|
||||
bullet.TimeModifiers.AddRange(TimeModifiers);
|
||||
}
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public override IPatternMachine MakeMachine(Node parent)
|
||||
{
|
||||
return new SpiralPatternMachine(this, parent);
|
||||
}
|
||||
|
||||
public class SpiralPatternMachine(ShootingPattern3D pattern, Node parent) : IPatternMachine
|
||||
{
|
||||
public Node Parent => parent;
|
||||
public IScriptHost3D ScriptHost { get; private set; }
|
||||
private double timer;
|
||||
private double burstTimer;
|
||||
//private double _burstRateTimer;
|
||||
private BulletSpawner3D spawner;
|
||||
|
||||
private ShootStatus _state = ShootStatus.Idle;
|
||||
|
||||
private int _burstBullets;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
ScriptHost = Parent as IScriptHost3D;
|
||||
|
||||
timer = 0;
|
||||
_burstBullets = pattern.ShotsPerBurst;
|
||||
burstTimer = pattern.burstInterval; // start immediately
|
||||
|
||||
spawner = parent.GetNode<BulletSpawner3D>("BulletSpawner3D");
|
||||
|
||||
_state = ShootStatus.Shooting;
|
||||
}
|
||||
|
||||
private void WaitingBurstUpdate(double delta)
|
||||
{
|
||||
timer += delta;
|
||||
burstTimer += delta;
|
||||
|
||||
if (burstTimer >= pattern.burstInterval)
|
||||
{
|
||||
_state = ShootStatus.Shooting;
|
||||
}
|
||||
}
|
||||
|
||||
private void WaitingReloadUpdate(double delta)
|
||||
{
|
||||
timer += delta;
|
||||
burstTimer += delta;
|
||||
|
||||
if (burstTimer >= pattern.BurstRate)
|
||||
{
|
||||
_burstBullets = pattern.ShotsPerBurst;
|
||||
_state = ShootStatus.Shooting;
|
||||
}
|
||||
}
|
||||
|
||||
private void ShootingUpdate(double delta)
|
||||
{
|
||||
timer += delta;
|
||||
burstTimer = 0;
|
||||
Shoot();
|
||||
_burstBullets--;
|
||||
|
||||
if (_burstBullets <= 0)
|
||||
{
|
||||
_state = ShootStatus.WaitingReload;
|
||||
}
|
||||
else
|
||||
{
|
||||
_state = ShootStatus.WaitingBurst;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePattern(double delta)
|
||||
{
|
||||
switch (_state)
|
||||
{
|
||||
case ShootStatus.Idle:
|
||||
case ShootStatus.Done:
|
||||
return;
|
||||
case ShootStatus.Shooting:
|
||||
ShootingUpdate(delta);
|
||||
break;
|
||||
case ShootStatus.WaitingBurst:
|
||||
WaitingBurstUpdate(delta);
|
||||
break;
|
||||
case ShootStatus.WaitingReload:
|
||||
WaitingReloadUpdate(delta);
|
||||
break;
|
||||
}
|
||||
|
||||
if (timer >= pattern.duration)
|
||||
{
|
||||
_state = ShootStatus.Done;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Shoot()
|
||||
{
|
||||
float angleOffset = pattern._rotationOffset + (float)(pattern.rotationSpeed * timer);
|
||||
|
||||
Vector2 direction = pattern.BulletResource.Direction;
|
||||
|
||||
// TODO: Fix player aiming for 3D
|
||||
// if (pattern._targetPlayer && GameManager.Instance.PlayerPosition.HasValue)
|
||||
// {
|
||||
// if (pattern._predictPlayer && GameManager.Instance.PlayerVelocity.HasValue)
|
||||
// {
|
||||
// var predictedDirection = MathFunctions.PredictInterceptPosition(ScriptHost.ParentObject.GlobalPosition,
|
||||
// GameManager.Instance.PlayerPosition.Value, GameManager.Instance.PlayerVelocity.Value,
|
||||
// pattern.BulletResource.BulletSpeed);
|
||||
// if (predictedDirection.HasValue)
|
||||
// {
|
||||
// direction = (predictedDirection.Value - ScriptHost.ParentObject.GlobalPosition).Normalized();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// direction = (GameManager.Instance.PlayerPosition.Value - ScriptHost.ParentObject.GlobalPosition).Normalized();
|
||||
// }
|
||||
// }
|
||||
|
||||
var spawnPosition = ScriptHost.ParentObject.GlobalPosition + pattern.EmitterOffset;
|
||||
|
||||
var bullet = pattern.MakeBullet(spawnPosition.ToVector2(), pattern.bulletCount,
|
||||
pattern.spread, angleOffset);
|
||||
|
||||
bullet.Direction = direction;
|
||||
|
||||
//spawner.SpawnBullet(MakeBullet(Boss.GlobalPosition, direction, angleOffset));
|
||||
spawner.SpawnBullet(bullet, spawnPosition);
|
||||
}
|
||||
|
||||
|
||||
public bool IsComplete()
|
||||
{
|
||||
//return timer >= pattern.duration;
|
||||
return _state is ShootStatus.Done;
|
||||
}
|
||||
|
||||
private enum ShootStatus
|
||||
{
|
||||
Idle,
|
||||
Shooting,
|
||||
WaitingBurst,
|
||||
WaitingReload,
|
||||
Done
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Scripts/AttackPatterns/ShootingPattern3D.cs.uid
Normal file
1
Scripts/AttackPatterns/ShootingPattern3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bxiprx5nwmpnu
|
||||
52
Scripts/Resources/BulletScripts/BulletScript3D.cs
Normal file
52
Scripts/Resources/BulletScripts/BulletScript3D.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using Cirno.Scripts.AttackPatterns;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.Resources.BulletScripts;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class BulletScript3D : Resource
|
||||
{
|
||||
[Export]
|
||||
public Array<AttackPattern> Patterns { get; private set; }
|
||||
|
||||
public BulletScriptMachine Make(Node parent)
|
||||
{
|
||||
return new BulletScriptMachine(parent, Patterns);
|
||||
}
|
||||
|
||||
public class BulletScriptMachine(Node parent, Array<AttackPattern> patterns)
|
||||
{
|
||||
private int _currentPatternIndex = 0;
|
||||
//private double _patternTimer;
|
||||
|
||||
private AttackPattern CurrentPattern => patterns[_currentPatternIndex];
|
||||
|
||||
private IPatternMachine _currentPatternMachine;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (patterns.Count == 0) return;
|
||||
_currentPatternIndex = 0;
|
||||
|
||||
_currentPatternMachine = CurrentPattern.MakeMachine(parent);
|
||||
_currentPatternMachine.Start();
|
||||
}
|
||||
|
||||
public void UpdatePhase(double delta)
|
||||
{
|
||||
//_patternTimer += delta;
|
||||
|
||||
_currentPatternMachine.UpdatePattern(delta);
|
||||
//CurrentPattern.UpdatePattern(delta);
|
||||
|
||||
if (!CurrentPattern.WaitForCompletion || _currentPatternMachine.IsComplete())
|
||||
{
|
||||
_currentPatternIndex = (_currentPatternIndex + 1) % patterns.Count;
|
||||
_currentPatternMachine = CurrentPattern.MakeMachine(parent);
|
||||
_currentPatternMachine.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Scripts/Resources/BulletScripts/BulletScript3D.cs.uid
Normal file
1
Scripts/Resources/BulletScripts/BulletScript3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://w8hcpu68ssq
|
||||
|
|
@ -8,4 +8,9 @@ public static class VectorExtensions
|
|||
{
|
||||
return new Vector2(original.X, original.Z);
|
||||
}
|
||||
|
||||
public static Vector3 ToVector3(this Vector2 original, float height = 0)
|
||||
{
|
||||
return new Vector3(original.X, height, original.Y);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,25 +3,26 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cfldr7l7dearo"
|
||||
path="res://.godot/imported/mid_bullet_red.png-5bc1e79f4456468a638cf530366492d7.ctex"
|
||||
path.s3tc="res://.godot/imported/mid_bullet_red.png-5bc1e79f4456468a638cf530366492d7.s3tc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/Bullets/mid_bullet_red.png"
|
||||
dest_files=["res://.godot/imported/mid_bullet_red.png-5bc1e79f4456468a638cf530366492d7.ctex"]
|
||||
dest_files=["res://.godot/imported/mid_bullet_red.png-5bc1e79f4456468a638cf530366492d7.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
|
|
@ -31,4 +32,4 @@ process/normal_map_invert_y=false
|
|||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
detect_3d/compress_to=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue