diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import
index c36be94..b20c9a6 100644
--- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import
+++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://chd2vtesap5cf"
-path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex"
+path="res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://resource/sprite/role/enemy0001/Enemy0001.png"
-dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex"]
+source_file="res://resource/sprite/role/enemy0001/enemy0001.png"
+dest_files=["res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex"]
[params]
diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import
index d563acf..56388a2 100644
--- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import
+++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://d2f55lu60x64i"
-path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex"
+path="res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://resource/sprite/role/enemy0001/Enemy0001_Debris.png"
-dest_files=["res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex"]
+source_file="res://resource/sprite/role/enemy0001/enemy0001_Debris.png"
+dest_files=["res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex"]
[params]
diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres
index 895ea5d..54b921f 100644
--- a/DungeonShooting_Godot/resource/theme/mainTheme.tres
+++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres
@@ -352,7 +352,7 @@
[sub_resource type="ImageTexture" id="58"]
-[sub_resource type="Image" id="Image_wuwj5"]
+[sub_resource type="Image" id="Image_b6nkn"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -362,7 +362,7 @@
}
[sub_resource type="ImageTexture" id="60"]
-image = SubResource("Image_wuwj5")
+image = SubResource("Image_b6nkn")
[sub_resource type="StyleBoxTexture" id="61"]
content_margin_left = 2.0
@@ -372,7 +372,7 @@
texture = SubResource("60")
region_rect = Rect2(0, 0, 12, 12)
-[sub_resource type="Image" id="Image_nrr6i"]
+[sub_resource type="Image" id="Image_j48uy"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -382,7 +382,7 @@
}
[sub_resource type="ImageTexture" id="63"]
-image = SubResource("Image_nrr6i")
+image = SubResource("Image_j48uy")
[sub_resource type="StyleBoxTexture" id="64"]
content_margin_left = 2.0
@@ -392,7 +392,7 @@
texture = SubResource("63")
region_rect = Rect2(0, 0, 12, 12)
-[sub_resource type="Image" id="Image_qxe4e"]
+[sub_resource type="Image" id="Image_nhoc6"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -402,7 +402,7 @@
}
[sub_resource type="ImageTexture" id="66"]
-image = SubResource("Image_qxe4e")
+image = SubResource("Image_nhoc6")
[sub_resource type="StyleBoxTexture" id="67"]
content_margin_left = 2.0
@@ -412,7 +412,7 @@
texture = SubResource("66")
region_rect = Rect2(0, 0, 12, 12)
-[sub_resource type="Image" id="Image_iplm4"]
+[sub_resource type="Image" id="Image_1wmhk"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -422,7 +422,7 @@
}
[sub_resource type="ImageTexture" id="69"]
-image = SubResource("Image_iplm4")
+image = SubResource("Image_1wmhk")
[sub_resource type="StyleBoxTexture" id="70"]
content_margin_left = 0.0
@@ -446,7 +446,7 @@
content_margin_right = 4.0
content_margin_bottom = 4.0
-[sub_resource type="Image" id="Image_trdur"]
+[sub_resource type="Image" id="Image_1ypfp"]
data = {
"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
"format": "RGBA8",
@@ -456,7 +456,7 @@
}
[sub_resource type="ImageTexture" id="56"]
-image = SubResource("Image_trdur")
+image = SubResource("Image_1ypfp")
[sub_resource type="StyleBoxFlat" id="57"]
content_margin_left = 6.0
diff --git a/DungeonShooting_Godot/src/framework/common/SeedRandom.cs b/DungeonShooting_Godot/src/framework/common/SeedRandom.cs
new file mode 100644
index 0000000..e9697b3
--- /dev/null
+++ b/DungeonShooting_Godot/src/framework/common/SeedRandom.cs
@@ -0,0 +1,147 @@
+
+using System;
+using System.Collections.Generic;
+using Godot;
+
+///
+/// 随机数类
+///
+public class SeedRandom
+{
+ ///
+ /// 种子值
+ ///
+ public int Seed { get; }
+
+ private Random _random;
+ private static int _staticSeed = 0;
+
+ public SeedRandom(int seed)
+ {
+ Seed = seed;
+ _random = new Random(seed);
+ }
+
+ public SeedRandom()
+ {
+ var dateTime = DateTime.Now;
+ var num = dateTime.Year * 100000 + dateTime.Month * 100000 + dateTime.Day * 100000 + dateTime.Hour * 10000 + dateTime.Minute * 100 + dateTime.Second;
+ num += _staticSeed;
+ _staticSeed += 11111;
+ _random = new Random(num);
+ }
+
+ ///
+ /// 返回一个随机的double值
+ ///
+ public double RandomDouble()
+ {
+ return _random.NextDouble();
+ }
+
+ ///
+ /// 返回随机 boolean 值
+ ///
+ public bool RandomBoolean()
+ {
+ return _random.NextSingle() >= 0.5f;
+ }
+ ///
+ /// 指定概率会返回 true, probability 范围 0 - 1
+ ///
+ public bool RandomBoolean(float probability)
+ {
+ return _random.NextSingle() <= probability;
+ }
+
+ ///
+ /// 返回一个区间内的随机小数
+ ///
+ public float RandomRangeFloat(float min, float max)
+ {
+ if (min == max) return min;
+ if (min > max)
+ return _random.NextSingle() * (min - max) + max;
+ return _random.NextSingle() * (max - min) + min;
+ }
+
+ ///
+ /// 返回一个区间内的随机整数
+ ///
+ public int RandomRangeInt(int min, int max)
+ {
+ if (min == max) return min;
+ if (min > max)
+ return Mathf.FloorToInt(_random.NextSingle() * (min - max + 1) + max);
+ return Mathf.FloorToInt(_random.NextSingle() * (max - min + 1) + min);
+ }
+
+ ///
+ /// 随机返回其中一个参数
+ ///
+ public T RandomChoose(params T[] list)
+ {
+ if (list.Length == 0)
+ {
+ return default;
+ }
+
+ return list[RandomRangeInt(0, list.Length - 1)];
+ }
+
+ ///
+ /// 随机返回集合中的一个元素
+ ///
+ public T RandomChoose(List list)
+ {
+ if (list.Count == 0)
+ {
+ return default;
+ }
+
+ return list[RandomRangeInt(0, list.Count - 1)];
+ }
+
+ ///
+ /// 随机返回集合中的一个元素, 并将其从集合中移除
+ ///
+ public T RandomChooseAndRemove(List list)
+ {
+ if (list.Count == 0)
+ {
+ return default;
+ }
+
+ var index = RandomRangeInt(0, list.Count - 1);
+ var result = list[index];
+ list.RemoveAt(index);
+ return result;
+ }
+
+ ///
+ /// 从权重列表中随机抽取下标值
+ ///
+ public int RandomWeight(List weightList)
+ {
+ // 计算总权重
+ var totalWeight = 0;
+ foreach (var weight in weightList)
+ {
+ totalWeight += weight;
+ }
+
+ var randomNumber = _random.Next(totalWeight);
+ var currentWeight = 0;
+ for (var i = 0; i < weightList.Count; i++)
+ {
+ var value = weightList[i];
+ currentWeight += value;
+ if (randomNumber < currentWeight)
+ {
+ return i;
+ }
+ }
+
+ return RandomRangeInt(0, weightList.Count - 1);
+ }
+}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/framework/common/Utils.cs b/DungeonShooting_Godot/src/framework/common/Utils.cs
index c35931d..1968085 100644
--- a/DungeonShooting_Godot/src/framework/common/Utils.cs
+++ b/DungeonShooting_Godot/src/framework/common/Utils.cs
@@ -1,5 +1,3 @@
-using System;
-using System.Collections.Generic;
using System.Linq;
using Godot;
@@ -8,133 +6,18 @@
///
public static class Utils
{
-
- private static readonly Random _random;
+ ///
+ /// 默认随机数对象
+ ///
+ public static SeedRandom Random { get; }
static Utils()
{
- var dateTime = DateTime.Now;
- var num = dateTime.Year * 100000 + dateTime.Month * 100000 + dateTime.Day * 100000 + dateTime.Hour * 10000 + dateTime.Minute * 100 + dateTime.Second;
- //_random = new Random(204313957);
- _random = new Random(num);
- GD.Print("随机种子为: ", num);
+ Random = new SeedRandom();
+ GD.Print("随机种子为: ", Random.Seed);
}
///
- /// 返回一个随机的double值
- ///
- public static double RandomDouble()
- {
- return _random.NextDouble();
- }
-
- ///
- /// 返回随机 boolean 值
- ///
- public static bool RandomBoolean()
- {
- return _random.NextSingle() >= 0.5f;
- }
- ///
- /// 指定概率会返回 true, probability 范围 0 - 1
- ///
- public static bool RandomBoolean(float probability)
- {
- return _random.NextSingle() <= probability;
- }
-
- ///
- /// 返回一个区间内的随机小数
- ///
- public static float RandomRangeFloat(float min, float max)
- {
- if (min == max) return min;
- if (min > max)
- return _random.NextSingle() * (min - max) + max;
- return _random.NextSingle() * (max - min) + min;
- }
-
- ///
- /// 返回一个区间内的随机整数
- ///
- public static int RandomRangeInt(int min, int max)
- {
- if (min == max) return min;
- if (min > max)
- return Mathf.FloorToInt(_random.NextSingle() * (min - max + 1) + max);
- return Mathf.FloorToInt(_random.NextSingle() * (max - min + 1) + min);
- }
-
- ///
- /// 随机返回其中一个参数
- ///
- public static T RandomChoose(params T[] list)
- {
- if (list.Length == 0)
- {
- return default;
- }
-
- return list[RandomRangeInt(0, list.Length - 1)];
- }
-
- ///
- /// 随机返回集合中的一个元素
- ///
- public static T RandomChoose(List list)
- {
- if (list.Count == 0)
- {
- return default;
- }
-
- return list[RandomRangeInt(0, list.Count - 1)];
- }
-
- ///
- /// 随机返回集合中的一个元素, 并将其从集合中移除
- ///
- public static T RandomChooseAndRemove(List list)
- {
- if (list.Count == 0)
- {
- return default;
- }
-
- var index = RandomRangeInt(0, list.Count - 1);
- var result = list[index];
- list.RemoveAt(index);
- return result;
- }
-
- ///
- /// 从权重列表中随机抽取下标值
- ///
- public static int RandomWeight(List weightList)
- {
- // 计算总权重
- var totalWeight = 0;
- foreach (var weight in weightList)
- {
- totalWeight += weight;
- }
-
- var randomNumber = _random.Next(totalWeight);
- var currentWeight = 0;
- for (var i = 0; i < weightList.Count; i++)
- {
- var value = weightList[i];
- currentWeight += value;
- if (randomNumber < currentWeight)
- {
- return i;
- }
- }
-
- return RandomRangeInt(0, weightList.Count - 1);
- }
-
- ///
/// 根据四个点计算出矩形
///
public static Rect2 CalcRect(float start1, float end1, float start2, float end2)
diff --git a/DungeonShooting_Godot/src/framework/common/WeightRandom.cs b/DungeonShooting_Godot/src/framework/common/WeightRandom.cs
index f0c7511..2c432cc 100644
--- a/DungeonShooting_Godot/src/framework/common/WeightRandom.cs
+++ b/DungeonShooting_Godot/src/framework/common/WeightRandom.cs
@@ -8,7 +8,13 @@
public class WeightRandom
{
private (float, int)[] _prepareAdRewardWeight;
+ private SeedRandom _random;
+ public WeightRandom(SeedRandom random)
+ {
+ _random = random;
+ }
+
///
/// 初始化权重列表
///
@@ -59,7 +65,7 @@
///
public int GetRandomIndex()
{
- var randomNum = Utils.RandomDouble() * _prepareAdRewardWeight.Length;
+ var randomNum = _random.RandomDouble() * _prepareAdRewardWeight.Length;
var intRan = (int)Math.Floor(randomNum);
var p = _prepareAdRewardWeight[intRan];
if (p.Item1 > randomNum - intRan)
diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs
index 1cc6cd9..e7ff185 100644
--- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs
+++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs
@@ -27,6 +27,11 @@
/// boss房间
///
public List BossRoom { get; } = new List();
+
+ ///
+ /// 随机数对象
+ ///
+ public SeedRandom Random { get; }
//用于标记地图上的坐标是否被占用
private Grid _roomGrid { get; } = new Grid();
@@ -39,12 +44,6 @@
//下一个房间类型
private DungeonRoomType _nextRoomType = DungeonRoomType.Battle;
- //宽高
- // private int _roomMinWidth = 15;
- // private int _roomMaxWidth = 35;
- // private int _roomMinHeight = 15;
- // private int _roomMaxHeight = 30;
-
//间隔
private int _roomMinInterval = 6;
private int _roomMaxInterval = 10;
@@ -60,8 +59,8 @@
//区域限制
private bool _enableLimitRange = true;
- private int _rangeX = 110;
- private int _rangeY = 110;
+ private int _rangeX = 200;
+ private int _rangeY = 200;
//找房间失败次数, 过大则会关闭区域限制
private int _maxFailCount = 10;
@@ -77,6 +76,7 @@
//指定只能生成的房间
private static List _designatedRoom;
+
private enum GenerateRoomErrorCode
{
@@ -105,6 +105,8 @@
{
_config = config;
_roomGroup = GameApplication.Instance.RoomConfig[config.GroupName];
+ Random = new SeedRandom();
+ GD.Print("创建地牢生成器, 随机种子: " + Random.Seed);
//验证该组是否满足生成地牢的条件
if (_roomGroup.InletList.Count == 0)
@@ -124,7 +126,7 @@
}
}
- _roomGroup.InitWeight();
+ _roomGroup.InitWeight(Random);
}
///
@@ -199,12 +201,12 @@
}
else
{
- tempPrevRoom = Utils.RandomChoose(RoomInfos);
+ tempPrevRoom = Random.RandomChoose(RoomInfos);
}
}
else
{
- tempPrevRoom = Utils.RandomChoose(RoomInfos);
+ tempPrevRoom = Random.RandomChoose(RoomInfos);
}
//生成下一个房间
@@ -229,7 +231,7 @@
else if (nextRoomType == DungeonRoomType.Battle)
{
chainTryCount = 0;
- chainMaxTryCount = Utils.RandomRangeInt(1, 3);
+ chainMaxTryCount = Random.RandomRangeInt(1, 3);
}
prevRoom = nextRoom;
CalcNextRoomType(prevRoom);
@@ -307,7 +309,7 @@
}
else //指定了房间
{
- roomSplit = Utils.RandomChoose(_designatedRoom);
+ roomSplit = Random.RandomChoose(_designatedRoom);
}
var room = new RoomInfo(_id, roomType, roomSplit);
@@ -335,19 +337,19 @@
}
for (; tryCount < maxTryCount; tryCount++)
{
- var direction = Utils.RandomRangeInt(0, 3);
+ var direction = Random.RandomRangeInt(0, 3);
//房间间隔
- var space = Utils.RandomRangeInt(_roomMinInterval, _roomMaxInterval);
+ var space = Random.RandomRangeInt(_roomMinInterval, _roomMaxInterval);
//中心偏移
int offset;
if (direction == 0 || direction == 2)
{
- offset = Utils.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion),
+ offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion),
(int)(prevRoomInfo.Size.X * _roomVerticalMaxDispersion));
}
else
{
- offset = Utils.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion),
+ offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion),
(int)(prevRoomInfo.Size.Y * _roomHorizontalMaxDispersion));
}
@@ -546,7 +548,7 @@
}
}
- return Utils.RandomChoose(list);
+ return Random.RandomChoose(list);
}
///
@@ -565,7 +567,7 @@
nextRoomDoor.ConnectDoor = roomDoor;
//先寻找直通门
- if (Utils.RandomBoolean())
+ if (Random.RandomBoolean())
{
//直行通道, 优先横轴
if (TryConnectHorizontalDoor(room, roomDoor, nextRoom, nextRoomDoor)
@@ -605,8 +607,8 @@
while (rangeList.Count > 0)
{
//找到重叠区域
- var range = Utils.RandomChooseAndRemove(rangeList);
- var x = Utils.RandomRangeInt(range.X, range.Y);
+ var range = Random.RandomChooseAndRemove(rangeList);
+ var x = Random.RandomRangeInt(range.X, range.Y);
if (room.GetVerticalStart() < nextRoom.GetVerticalStart()) //room在上, nextRoom在下
{
@@ -657,8 +659,8 @@
while (rangeList.Count > 0)
{
//找到重叠区域
- var range = Utils.RandomChooseAndRemove(rangeList);
- var y = Utils.RandomRangeInt(range.X, range.Y);
+ var range = Random.RandomChooseAndRemove(rangeList);
+ var y = Random.RandomRangeInt(range.X, range.Y);
if (room.GetHorizontalStart() < nextRoom.GetHorizontalStart()) //room在左, nextRoom在右
{
@@ -704,7 +706,7 @@
{
if (room.GetVerticalStart() > nextRoom.GetVerticalStart())
{
- if (Utils.RandomBoolean()) //↑ //→
+ if (Random.RandomBoolean()) //↑ //→
{
if (!TryConnect_NE_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) &&
!TryConnect_WS_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross))
@@ -723,7 +725,7 @@
}
else
{
- if (Utils.RandomBoolean()) //↓ //→
+ if (Random.RandomBoolean()) //↓ //→
{
if (!TryConnect_SE_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) &&
!TryConnect_WN_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross))
@@ -745,7 +747,7 @@
{
if (room.GetVerticalStart() > nextRoom.GetVerticalStart()) //→ //↓
{
- if (Utils.RandomBoolean())
+ if (Random.RandomBoolean())
{
if (!TryConnect_ES_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) &&
!TryConnect_NW_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross))
@@ -764,7 +766,7 @@
}
else
{
- if (Utils.RandomBoolean()) //→ //↑
+ if (Random.RandomBoolean()) //→ //↑
{
if (!TryConnect_EN_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) &&
!TryConnect_SW_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross))
diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs
index 6ad860b..5d47401 100644
--- a/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs
+++ b/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs
@@ -82,7 +82,7 @@
///
/// 初始化权重处理
///
- public void InitWeight()
+ public void InitWeight(SeedRandom random)
{
if (_init)
{
@@ -94,14 +94,14 @@
foreach (var roomType in Enum.GetValues())
{
- InitAdRewardWeight(roomType);
+ InitAdRewardWeight(roomType, random);
}
}
- private void InitAdRewardWeight(DungeonRoomType roomType)
+ private void InitAdRewardWeight(DungeonRoomType roomType, SeedRandom random)
{
var dungeonRoomSplits = GetRoomList(roomType);
- var weightRandom = new WeightRandom();
+ var weightRandom = new WeightRandom(random);
_weightRandomMap.Add(roomType, weightRandom);
var list = new List();
diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
index b1f513e..4e96732 100644
--- a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
+++ b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs
@@ -34,17 +34,17 @@
///
/// 根据 startRoom 和 config 数据自动填充 tileMap 参数中的地图数据
///
- public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoom)
+ public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoom, SeedRandom random)
{
_connectNavigationItemList.Clear();
- _AutoFillRoomTile(config, startRoom);
+ _AutoFillRoomTile(config, startRoom, random);
}
- private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo)
+ private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo, SeedRandom random)
{
foreach (var info in roomInfo.Next)
{
- _AutoFillRoomTile(config, info);
+ _AutoFillRoomTile(config, info, random);
}
//铺房间
@@ -109,7 +109,7 @@
activityMark.Position = roomInfo.GetWorldPosition() + (pos - offset);
activityMark.TileRoot = _tileRoot;
//执行预处理操作
- activityMark.Pretreatment();
+ activityMark.Pretreatment(random);
}
roomInfo.ActivityMarks.AddRange(activityMarks);
diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs
index fa36fca..7a0c8ee 100644
--- a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs
+++ b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs
@@ -73,6 +73,11 @@
/// 当前标记所在Tile节点
///
public TileMap TileRoot;
+
+ ///
+ /// 随机数对象
+ ///
+ public SeedRandom Random { get; private set; }
//是否已经结束
private bool _isOver = true;
@@ -193,8 +198,8 @@
if (BirthRect != Vector2I.Zero)
{
result.ActivityObject.Position = new Vector2(
- Utils.RandomRangeInt((int)pos.X - BirthRect.X / 2, (int)pos.X + BirthRect.X / 2),
- Utils.RandomRangeInt((int)pos.Y - BirthRect.Y / 2, (int)pos.Y + BirthRect.Y / 2)
+ Random.RandomRangeInt((int)pos.X - BirthRect.X / 2, (int)pos.X + BirthRect.X / 2),
+ Random.RandomRangeInt((int)pos.Y - BirthRect.Y / 2, (int)pos.Y + BirthRect.Y / 2)
);
}
else
@@ -313,8 +318,9 @@
///
/// 执行预处理操作
///
- public void Pretreatment()
+ public void Pretreatment(SeedRandom random)
{
+ Random = random;
if (_activityExpressionMap.TryGetValue(GetType(), out var list))
{
foreach (var field in list)
@@ -351,7 +357,7 @@
}
}
//根据权重随机值
- var index = Utils.RandomWeight(list);
+ var index = Random.RandomWeight(list);
_currentExpression.Add(field, activityExpression[index]);
}
else
diff --git a/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs b/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs
index 33f0ddf..8eac590 100644
--- a/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs
+++ b/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs
@@ -58,7 +58,7 @@
//脸的朝向
if (FaceDirection == FaceDirectionValueEnum.Random)
{
- instance.Face = Utils.RandomBoolean() ? global::FaceDirection.Left : global::FaceDirection.Right;
+ instance.Face = Random.RandomBoolean() ? global::FaceDirection.Left : global::FaceDirection.Right;
}
else if (FaceDirection == FaceDirectionValueEnum.Left)
{
diff --git a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs
index c97f512..28d9bfa 100644
--- a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs
+++ b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs
@@ -106,7 +106,7 @@
node.AddToActivityRoot(RoomLayerEnum.YSortLayer);
//计算子弹造成的伤害
- var damage = Utils.RandomRangeInt(MinHarm, MaxHarm);
+ var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm);
if (Role != null)
{
var d = damage;
diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs
index 14133e0..7c39b5c 100644
--- a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs
+++ b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs
@@ -19,7 +19,7 @@
private void CalcHurtDamageEvent(int originDamage, RefValue refValue)
{
- if (refValue.Value > 0 && Utils.RandomBoolean(0.15f))
+ if (refValue.Value > 0 && Utils.Random.RandomBoolean(0.15f))
{
refValue.Value = 0;
}
diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs
index 787107a..b359f48 100644
--- a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs
+++ b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs
@@ -30,7 +30,7 @@
private void CalcBulletDeviationAngleEvent(Weapon weapon, float originAngle, RefValue refValue)
{
- refValue.Value += Utils.RandomRangeFloat(-8, 8);
+ refValue.Value += Utils.Random.RandomRangeFloat(-8, 8);
}
private void CalcDamageEvent(int originDamage, RefValue refValue)
@@ -45,6 +45,6 @@
private void CalcBulletSpeedEvent(Weapon weapon, float originSpeed, RefValue speed)
{
- speed.Value += originSpeed * Utils.RandomRangeFloat(-0.05f, 0.05f);
+ speed.Value += originSpeed * Utils.Random.RandomRangeFloat(-0.05f, 0.05f);
}
}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs
index 8979979..3c327dd 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs
@@ -124,7 +124,7 @@
blood.AddToActivityRoot(RoomLayerEnum.NormalLayer);
//创建敌人碎片
- var count = Utils.RandomRangeInt(3, 6);
+ var count = Utils.Random.RandomRangeInt(3, 6);
for (var i = 0; i < count; i++)
{
var debris = Create(Ids.Id_effect0001);
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs
index 20cad58..b0a208c 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs
@@ -90,7 +90,7 @@
}
else if (Master.NavigationAgent2D.IsNavigationFinished()) //到达终点
{
- _pauseTimer = Utils.RandomRangeFloat(0.3f, 2f);
+ _pauseTimer = Utils.Random.RandomRangeFloat(0.3f, 2f);
_isMoveOver = true;
_moveFlag = false;
Master.BasisVelocity = Vector2.Zero;
@@ -112,7 +112,7 @@
var lastSlideCollision = Master.GetLastSlideCollision();
if (lastSlideCollision != null && lastSlideCollision.GetCollider() is Role) //碰到其他角色
{
- _pauseTimer = Utils.RandomRangeFloat(0.1f, 0.5f);
+ _pauseTimer = Utils.Random.RandomRangeFloat(0.1f, 0.5f);
_isMoveOver = true;
_moveFlag = false;
Master.BasisVelocity = Vector2.Zero;
@@ -148,15 +148,15 @@
float angle;
if (_againstWall)
{
- angle = Utils.RandomRangeFloat(_againstWallNormalAngle - Mathf.Pi * 0.5f,
+ angle = Utils.Random.RandomRangeFloat(_againstWallNormalAngle - Mathf.Pi * 0.5f,
_againstWallNormalAngle + Mathf.Pi * 0.5f);
}
else
{
- angle = Utils.RandomRangeFloat(0, Mathf.Pi * 2f);
+ angle = Utils.Random.RandomRangeFloat(0, Mathf.Pi * 2f);
}
- var len = Utils.RandomRangeInt(30, 200);
+ var len = Utils.Random.RandomRangeInt(30, 200);
_nextPos = new Vector2(len, 0).Rotated(angle) + Master.GlobalPosition;
//获取射线碰到的坐标
if (Master.TestViewRayCast(_nextPos)) //碰到墙壁
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs
index c4a9b39..e8c0827 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs
@@ -92,7 +92,7 @@
}
else if (Master.NavigationAgent2D.IsNavigationFinished()) //到达终点
{
- _pauseTimer = Utils.RandomRangeFloat(0f, 0.5f);
+ _pauseTimer = Utils.Random.RandomRangeFloat(0f, 0.5f);
_isMoveOver = true;
_moveFlag = false;
Master.BasisVelocity = Vector2.Zero;
@@ -113,7 +113,7 @@
var lastSlideCollision = Master.GetLastSlideCollision();
if (lastSlideCollision != null && lastSlideCollision.GetCollider() is Role) //碰到其他角色
{
- _pauseTimer = Utils.RandomRangeFloat(0f, 0.3f);
+ _pauseTimer = Utils.Random.RandomRangeFloat(0f, 0.3f);
_isMoveOver = true;
_moveFlag = false;
Master.BasisVelocity = Vector2.Zero;
@@ -163,8 +163,8 @@
var weapon = Master.WeaponPack.ActiveItem;
var distance = (int)(weapon == null ? 150 : (weapon.Attribute.BulletMinDistance * 0.7f));
_nextPosition = new Vector2(
- targetPos.X + Utils.RandomRangeInt(-distance, distance),
- targetPos.Y + Utils.RandomRangeInt(-distance, distance)
+ targetPos.X + Utils.Random.RandomRangeInt(-distance, distance),
+ targetPos.Y + Utils.Random.RandomRangeInt(-distance, distance)
);
Master.NavigationAgent2D.TargetPosition = _nextPosition;
}
diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
index f6f1045..f6a5ab0 100644
--- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
+++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
@@ -753,7 +753,7 @@
if (!Attribute.ContinuousShoot)
{
_continuousCount =
- Utils.RandomRangeInt(Attribute.MinContinuousCount, Attribute.MaxContinuousCount);
+ Utils.Random.RandomRangeInt(Attribute.MinContinuousCount, Attribute.MaxContinuousCount);
}
}
@@ -873,7 +873,7 @@
//减子弹数量
if (_playerWeaponAttribute != _weaponAttribute) //Ai使用该武器, 有一定概率不消耗弹药
{
- if (Utils.RandomRangeFloat(0, 1) < _weaponAttribute.AiAmmoConsumptionProbability) //触发消耗弹药
+ if (Utils.Random.RandomRangeFloat(0, 1) < _weaponAttribute.AiAmmoConsumptionProbability) //触发消耗弹药
{
CurrAmmo -= UseAmmoCount();
}
@@ -920,14 +920,14 @@
var angle = new Vector2(GameConfig.ScatteringDistance, CurrScatteringRange).Angle();
//先算武器口方向
- var tempRotation = Utils.RandomRangeFloat(-angle, angle);
+ var tempRotation = Utils.Random.RandomRangeFloat(-angle, angle);
var tempAngle = Mathf.RadToDeg(tempRotation);
//开火时枪口角度
var fireRotation = tempRotation;
//开火发射的子弹数量
- var bulletCount = Utils.RandomRangeInt(Attribute.MaxFireBulletCount, Attribute.MinFireBulletCount);
+ var bulletCount = Utils.Random.RandomRangeInt(Attribute.MaxFireBulletCount, Attribute.MinFireBulletCount);
if (Master != null)
{
bulletCount = Master.RoleState.CallCalcBulletCountEvent(this, bulletCount);
@@ -952,7 +952,7 @@
//武器身位置
var max = Mathf.Abs(Mathf.Max(Attribute.MaxBacklash, Attribute.MinBacklash));
_currBacklashLength = Mathf.Clamp(
- _currBacklashLength - Utils.RandomRangeFloat(Attribute.MinBacklash, Attribute.MaxBacklash),
+ _currBacklashLength - Utils.Random.RandomRangeFloat(Attribute.MinBacklash, Attribute.MaxBacklash),
-max, max
);
Position = new Vector2(_currBacklashLength, 0).Rotated(Rotation);
@@ -1521,7 +1521,7 @@
//播放互动效果
if (flag)
{
- Throw(GlobalPosition, 0, Utils.RandomRangeInt(20, 50), Vector2.Zero, Utils.RandomRangeInt(-180, 180));
+ Throw(GlobalPosition, 0, Utils.Random.RandomRangeInt(20, 50), Vector2.Zero, Utils.Random.RandomRangeInt(-180, 180));
//没有子弹了, 停止播放泛白效果
if (IsTotalAmmoEmpty())
{
@@ -1582,7 +1582,7 @@
startPosition -= GripPoint.Position.Rotated(rotation);
var startHeight = -master.MountPoint.Position.Y;
var velocity = new Vector2(20, 0).Rotated(rotation);
- var yf = Utils.RandomRangeInt(50, 70);
+ var yf = Utils.Random.RandomRangeInt(50, 70);
Throw(startPosition, startHeight, yf, velocity, 0);
//继承role的移动速度
@@ -1719,10 +1719,10 @@
var startPos = ShellPoint.GlobalPosition;
var startHeight = -shellPosition.Y;
startPos.Y += startHeight;
- var direction = GlobalRotationDegrees + Utils.RandomRangeInt(-30, 30) + 180;
- var verticalSpeed = Utils.RandomRangeInt((int)(60 * speedScale), (int)(120 * speedScale));
- var velocity = new Vector2(Utils.RandomRangeInt((int)(20 * speedScale), (int)(60 * speedScale)), 0).Rotated(direction * Mathf.Pi / 180);
- var rotate = Utils.RandomRangeInt((int)(-720 * speedScale), (int)(720 * speedScale));
+ var direction = GlobalRotationDegrees + Utils.Random.RandomRangeInt(-30, 30) + 180;
+ var verticalSpeed = Utils.Random.RandomRangeInt((int)(60 * speedScale), (int)(120 * speedScale));
+ var velocity = new Vector2(Utils.Random.RandomRangeInt((int)(20 * speedScale), (int)(60 * speedScale)), 0).Rotated(direction * Mathf.Pi / 180);
+ var rotate = Utils.Random.RandomRangeInt((int)(-720 * speedScale), (int)(720 * speedScale));
var shell = Create(shellId);
shell.Rotation = (Master != null ? Master.MountPoint.RealRotation : Rotation);
shell.Throw(startPos, startHeight, verticalSpeed, velocity, rotate);
@@ -1744,10 +1744,10 @@
///
protected Bullet ShootBullet(float fireRotation, string bulletId)
{
- var speed = Utils.RandomRangeFloat(Attribute.BulletMinSpeed, Attribute.BulletMaxSpeed);
- var distance = Utils.RandomRangeFloat(Attribute.BulletMinDistance, Attribute.BulletMaxDistance);
+ var speed = Utils.Random.RandomRangeFloat(Attribute.BulletMinSpeed, Attribute.BulletMaxSpeed);
+ var distance = Utils.Random.RandomRangeFloat(Attribute.BulletMinDistance, Attribute.BulletMaxDistance);
var deviationAngle =
- Utils.RandomRangeFloat(Attribute.BulletMinDeviationAngle, Attribute.BulletMaxDeviationAngle);
+ Utils.Random.RandomRangeFloat(Attribute.BulletMinDeviationAngle, Attribute.BulletMaxDeviationAngle);
if (Master != null)
{
speed = Master.RoleState.CallCalcBulletSpeedEvent(this, speed);
diff --git a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs
index 6fbaf80..c754fa0 100644
--- a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs
+++ b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs
@@ -93,7 +93,7 @@
if (activityObject is Role role)
{
role.CallDeferred(nameof(Role.Hurt),
- Utils.RandomRangeInt(Attribute.BulletMinHarm, Attribute.BulletMaxHarm), (role.GetCenterPosition() - GlobalPosition).Angle());
+ Utils.Random.RandomRangeInt(Attribute.BulletMinHarm, Attribute.BulletMaxHarm), (role.GetCenterPosition() - GlobalPosition).Angle());
}
}
}
diff --git a/DungeonShooting_Godot/src/game/effects/Effect1.cs b/DungeonShooting_Godot/src/game/effects/Effect1.cs
index 5f43297..7905f99 100644
--- a/DungeonShooting_Godot/src/game/effects/Effect1.cs
+++ b/DungeonShooting_Godot/src/game/effects/Effect1.cs
@@ -5,7 +5,7 @@
public override void _Ready()
{
var c = GetNode("GPUParticles2D");
- c.Amount = Utils.RandomRangeInt(2, 6);
+ c.Amount = Utils.Random.RandomRangeInt(2, 6);
c.Emitting = true;
base._Ready();
diff --git a/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs b/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs
index 075e8d5..4e975ee 100644
--- a/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs
+++ b/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs
@@ -11,13 +11,13 @@
public override void OnInit()
{
var frameCount = AnimatedSprite.SpriteFrames.GetFrameCount(AnimatorNames.Default);
- AnimatedSprite.Frame = Utils.RandomRangeInt(0, frameCount - 1);
+ AnimatedSprite.Frame = Utils.Random.RandomRangeInt(0, frameCount - 1);
Throw(
- Utils.RandomRangeInt(0, 16),
- Utils.RandomRangeInt(10, 60),
- new Vector2(Utils.RandomRangeInt(-25, 25), Utils.RandomRangeInt(-25, 25)),
- Utils.RandomRangeInt(-360, 360)
+ Utils.Random.RandomRangeInt(0, 16),
+ Utils.Random.RandomRangeInt(10, 60),
+ new Vector2(Utils.Random.RandomRangeInt(-25, 25), Utils.Random.RandomRangeInt(-25, 25)),
+ Utils.Random.RandomRangeInt(-360, 360)
);
StartCoroutine(EmitParticles());
@@ -27,7 +27,7 @@
{
var gpuParticles2D = GetNode("GPUParticles2D");
gpuParticles2D.Emitting = true;
- yield return new WaitForSeconds(Utils.RandomRangeFloat(1f, 2.5f));
+ yield return new WaitForSeconds(Utils.Random.RandomRangeFloat(1f, 2.5f));
gpuParticles2D.Emitting = false;
yield return new WaitForSeconds(1);
BecomesStaticImage();
diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs
index 0f3d801..0506bb5 100644
--- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs
+++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs
@@ -111,7 +111,7 @@
//填充地牢
_autoTileConfig = new AutoTileConfig();
_dungeonTile = new DungeonTile(_world.TileRoot);
- _dungeonTile.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom);
+ _dungeonTile.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom, _dungeonGenerator.Random);
yield return 0;
//生成寻路网格, 这一步操作只生成过道的导航
diff --git a/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs b/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs
index bc8bfa3..1c9b7e9 100644
--- a/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs
+++ b/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs
@@ -19,14 +19,14 @@
for (int i = 0; i < 50000; i++)
{
- var texture = Utils.RandomChoose(ImageList);
- var x = Utils.RandomRangeInt(0, imageCanvas.Width);
- var y = Utils.RandomRangeInt(0, imageCanvas.Height);
- var centerX = Utils.RandomRangeInt(0, texture.GetWidth());
- var centerY = Utils.RandomRangeInt(0, texture.GetHeight());
- var angle = Utils.RandomRangeInt(0, 360);
+ var texture = Utils.Random.RandomChoose(ImageList);
+ var x = Utils.Random.RandomRangeInt(0, imageCanvas.Width);
+ var y = Utils.Random.RandomRangeInt(0, imageCanvas.Height);
+ var centerX = Utils.Random.RandomRangeInt(0, texture.GetWidth());
+ var centerY = Utils.Random.RandomRangeInt(0, texture.GetHeight());
+ var angle = Utils.Random.RandomRangeInt(0, 360);
imageCanvas.DrawImageInCanvas(texture, null, x, y,
- angle, centerX, centerY, Utils.RandomBoolean(),
+ angle, centerX, centerY, Utils.Random.RandomBoolean(),
() =>
{
successCount++;