diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index 02068be..527ed3b 100644 --- a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx index e8367a2..ea4622f 100644 --- a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index cdb1b1f..d8c5fb5 100644 --- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn b/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn index e530d24..913f5af 100644 --- a/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn +++ b/DungeonShooting_Godot/prefab/effect/activityObject/Effect0001.tscn @@ -10,12 +10,14 @@ shader = ExtResource("2_b3d83") shader_parameter/blend = Color(0, 0, 0, 0.470588) shader_parameter/schedule = 1.0 +shader_parameter/alpha = 1.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_08fn3"] resource_local_to_scene = true shader = ExtResource("2_b3d83") shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/schedule = 0.0 +shader_parameter/alpha = 1.0 [sub_resource type="AtlasTexture" id="AtlasTexture_cldwb"] atlas = ExtResource("3_ntutm") diff --git a/DungeonShooting_Godot/prefab/prop/buff/Prop0001.tscn b/DungeonShooting_Godot/prefab/prop/buff/Prop0001.tscn index d1a1f24..e4a5795 100644 --- a/DungeonShooting_Godot/prefab/prop/buff/Prop0001.tscn +++ b/DungeonShooting_Godot/prefab/prop/buff/Prop0001.tscn @@ -8,8 +8,8 @@ resource_local_to_scene = true shader = ExtResource("2_ao13f") shader_parameter/blend = Color(0, 0, 0, 0.470588) -shader_parameter/schedule = 0.0 -shader_parameter/alpha = 0.0 +shader_parameter/schedule = 1.0 +shader_parameter/alpha = 1.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_b6ii6"] resource_local_to_scene = true diff --git a/DungeonShooting_Godot/prefab/prop/buff/Prop0002.tscn b/DungeonShooting_Godot/prefab/prop/buff/Prop0002.tscn new file mode 100644 index 0000000..ea24c2f --- /dev/null +++ b/DungeonShooting_Godot/prefab/prop/buff/Prop0002.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=7 format=3 uid="uid://cnh7h0ti23dwm"] + +[ext_resource type="Script" path="res://src/game/activity/prop/buff/HeartContainerBuff.cs" id="1_1kha7"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_cwlyf"] +[ext_resource type="SpriteFrames" uid="uid://7t57gsyff470" path="res://resource/spriteFrames/Buff0002.tres" id="3_k4xtc"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_mrkt4"] +resource_local_to_scene = true +shader = ExtResource("2_cwlyf") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/alpha = 1.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_b6ii6"] +resource_local_to_scene = true +shader = ExtResource("2_cwlyf") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/alpha = 1.0 + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpqup"] +size = Vector2(12, 10) + +[node name="Prop0002" type="CharacterBody2D" node_paths=PackedStringArray("ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 4 +script = ExtResource("1_1kha7") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_mrkt4") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +material = SubResource("ShaderMaterial_b6ii6") +sprite_frames = ExtResource("3_k4xtc") + +[node name="Collision" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_cpqup") diff --git a/DungeonShooting_Godot/prefab/prop/buff/Prop0003.tscn b/DungeonShooting_Godot/prefab/prop/buff/Prop0003.tscn new file mode 100644 index 0000000..d9ace93 --- /dev/null +++ b/DungeonShooting_Godot/prefab/prop/buff/Prop0003.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=7 format=3 uid="uid://im64ft74hmmg"] + +[ext_resource type="Script" path="res://src/game/activity/prop/buff/ShieldContainerBuff.cs" id="1_10xkd"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_q55qh"] +[ext_resource type="SpriteFrames" uid="uid://nqoieett75t3" path="res://resource/spriteFrames/Buff0003.tres" id="3_tffkd"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_mrkt4"] +resource_local_to_scene = true +shader = ExtResource("2_q55qh") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/alpha = 1.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_b6ii6"] +resource_local_to_scene = true +shader = ExtResource("2_q55qh") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/alpha = 1.0 + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpqup"] +size = Vector2(12, 10) + +[node name="Prop0003" type="CharacterBody2D" node_paths=PackedStringArray("ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 4 +script = ExtResource("1_10xkd") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_mrkt4") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +material = SubResource("ShaderMaterial_b6ii6") +sprite_frames = ExtResource("3_tffkd") + +[node name="Collision" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_cpqup") diff --git a/DungeonShooting_Godot/prefab/prop/buff/Prop0004.tscn b/DungeonShooting_Godot/prefab/prop/buff/Prop0004.tscn new file mode 100644 index 0000000..90adf44 --- /dev/null +++ b/DungeonShooting_Godot/prefab/prop/buff/Prop0004.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=7 format=3 uid="uid://dw3fey3hybie4"] + +[ext_resource type="Script" path="res://src/game/activity/prop/buff/ShieldRecoveryTimeBuff.cs" id="1_kn8t4"] +[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_ron1k"] +[ext_resource type="SpriteFrames" uid="uid://bj0k3pipwp46x" path="res://resource/spriteFrames/Buff0004.tres" id="3_gdu32"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_mrkt4"] +resource_local_to_scene = true +shader = ExtResource("2_ron1k") +shader_parameter/blend = Color(0, 0, 0, 0.470588) +shader_parameter/schedule = 1.0 +shader_parameter/alpha = 1.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_b6ii6"] +resource_local_to_scene = true +shader = ExtResource("2_ron1k") +shader_parameter/blend = Color(1, 1, 1, 1) +shader_parameter/schedule = 0.0 +shader_parameter/alpha = 1.0 + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpqup"] +size = Vector2(12, 10) + +[node name="Prop0004" type="CharacterBody2D" node_paths=PackedStringArray("ShadowSprite", "AnimatedSprite", "Collision")] +collision_layer = 4 +script = ExtResource("1_kn8t4") +ShadowSprite = NodePath("ShadowSprite") +AnimatedSprite = NodePath("AnimatedSprite") +Collision = NodePath("Collision") + +[node name="ShadowSprite" type="Sprite2D" parent="."] +z_index = -1 +material = SubResource("ShaderMaterial_mrkt4") + +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="."] +material = SubResource("ShaderMaterial_b6ii6") +sprite_frames = ExtResource("3_gdu32") + +[node name="Collision" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_cpqup") diff --git a/DungeonShooting_Godot/resource/config/ActivityObject.json b/DungeonShooting_Godot/resource/config/ActivityObject.json index 55a8baf..f7bac3a 100644 --- a/DungeonShooting_Godot/resource/config/ActivityObject.json +++ b/DungeonShooting_Godot/resource/config/ActivityObject.json @@ -105,6 +105,27 @@ "Prefab": "res://prefab/prop/buff/Prop0001.tscn" }, { + "Id": "prop0002", + "Type": 9, + "Name": "\u5FC3\u4E4B\u5BB9\u5668", + "Remark": "\u589E\u52A0\u8840\u91CF\u4E0A\u9650", + "Prefab": "res://prefab/prop/buff/Prop0002.tscn" + }, + { + "Id": "prop0003", + "Type": 9, + "Name": "\u62A4\u76FE", + "Remark": "\u589E\u52A0\u62A4\u76FE\u4E0A\u9650", + "Prefab": "res://prefab/prop/buff/Prop0003.tscn" + }, + { + "Id": "prop0004", + "Type": 9, + "Name": "\u62A4\u76FE\u5FEB\u901F\u6062\u590D", + "Remark": "\u63D0\u9AD8\u62A4\u76FE\u6062\u590D\u901F\u5EA6", + "Prefab": "res://prefab/prop/buff/Prop0004.tscn" + }, + { "Id": "other_door_e", "Type": 99, "Name": "", diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn index df5af1d..7413463 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn @@ -29,3 +29,24 @@ Type = 9 ItemExpression = "0001" WaveNumber = 2 + +[node name="ActivityMark9" type="Node2D" parent="."] +position = Vector2(125, 68) +script = ExtResource("3_m4jrh") +Type = 9 +ItemExpression = "0002" +WaveNumber = 2 + +[node name="ActivityMark10" type="Node2D" parent="."] +position = Vector2(124, 18) +script = ExtResource("3_m4jrh") +Type = 9 +ItemExpression = "0003" +WaveNumber = 2 + +[node name="ActivityMark11" type="Node2D" parent="."] +position = Vector2(34, 19) +script = ExtResource("3_m4jrh") +Type = 9 +ItemExpression = "0004" +WaveNumber = 2 diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0001.png b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0001.png index 61303db..6fe4302 100644 --- a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0001.png +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0001.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0002.png b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0002.png new file mode 100644 index 0000000..3dbfda5 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0002.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0002.png.import b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0002.png.import new file mode 100644 index 0000000..52de2ce --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0002.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cv2joc07ymofw" +path="res://.godot/imported/Buff0002.png-d91464bb53e0e88b01f5baa35217c454.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/prop/buff/Buff0002.png" +dest_files=["res://.godot/imported/Buff0002.png-d91464bb53e0e88b01f5baa35217c454.ctex"] + +[params] + +compress/mode=0 +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/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=1 diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0003.png b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0003.png new file mode 100644 index 0000000..b5ea631 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0003.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0003.png.import b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0003.png.import new file mode 100644 index 0000000..7f73e44 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0003.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://osr0v1c6l8ly" +path="res://.godot/imported/Buff0003.png-584cb6fcf8fce750a2603c98c852dabb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/prop/buff/Buff0003.png" +dest_files=["res://.godot/imported/Buff0003.png-584cb6fcf8fce750a2603c98c852dabb.ctex"] + +[params] + +compress/mode=0 +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/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=1 diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0004.png b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0004.png new file mode 100644 index 0000000..b2fd5f5 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0004.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0004.png.import b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0004.png.import new file mode 100644 index 0000000..72ea312 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/prop/buff/Buff0004.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c0c25nihdcgt1" +path="res://.godot/imported/Buff0004.png-29449655cacc702b1b5df1587e70bcd4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/prop/buff/Buff0004.png" +dest_files=["res://.godot/imported/Buff0004.png-29449655cacc702b1b5df1587e70bcd4.ctex"] + +[params] + +compress/mode=0 +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/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=1 diff --git a/DungeonShooting_Godot/resource/spriteFrames/Buff0002.tres b/DungeonShooting_Godot/resource/spriteFrames/Buff0002.tres new file mode 100644 index 0000000..10e71f0 --- /dev/null +++ b/DungeonShooting_Godot/resource/spriteFrames/Buff0002.tres @@ -0,0 +1,14 @@ +[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://7t57gsyff470"] + +[ext_resource type="Texture2D" uid="uid://cv2joc07ymofw" path="res://resource/sprite/prop/buff/Buff0002.png" id="1_8nnhb"] + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_8nnhb") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] diff --git a/DungeonShooting_Godot/resource/spriteFrames/Buff0003.tres b/DungeonShooting_Godot/resource/spriteFrames/Buff0003.tres new file mode 100644 index 0000000..ee3770b --- /dev/null +++ b/DungeonShooting_Godot/resource/spriteFrames/Buff0003.tres @@ -0,0 +1,14 @@ +[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://nqoieett75t3"] + +[ext_resource type="Texture2D" uid="uid://osr0v1c6l8ly" path="res://resource/sprite/prop/buff/Buff0003.png" id="1_p16yr"] + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_p16yr") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] diff --git a/DungeonShooting_Godot/resource/spriteFrames/Buff0004.tres b/DungeonShooting_Godot/resource/spriteFrames/Buff0004.tres new file mode 100644 index 0000000..05d16c9 --- /dev/null +++ b/DungeonShooting_Godot/resource/spriteFrames/Buff0004.tres @@ -0,0 +1,14 @@ +[gd_resource type="SpriteFrames" load_steps=2 format=3 uid="uid://bj0k3pipwp46x"] + +[ext_resource type="Texture2D" uid="uid://c0c25nihdcgt1" path="res://resource/sprite/prop/buff/Buff0004.png" id="1_a2o8b"] + +[resource] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("1_a2o8b") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_EditorTool.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_EditorTool.cs index af7f5d6..cbc700a 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_EditorTool.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_EditorTool.cs @@ -31,6 +31,7 @@ ResourceManager.Load(ResourcePath.resource_material_Blend_tres, false); material.SetShaderParameter("blend", new Color(0, 0, 0, 0.47058824F)); material.SetShaderParameter("schedule", 1); + material.SetShaderParameter("alpha", 1); sprite.Material = material; } } @@ -44,6 +45,7 @@ ResourceManager.Load(ResourcePath.resource_material_Blend_tres, false); material.SetShaderParameter("blend", new Color(1, 1, 1, 1)); material.SetShaderParameter("schedule", 0); + material.SetShaderParameter("alpha", 1); animatedSprite.Material = material; } } diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs index 78a9f49..9d7aa94 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs @@ -86,6 +86,21 @@ /// public const string Id_prop0001 = "prop0001"; /// + /// 名称: 心之容器
+ /// 备注: 增加血量上限 + ///
+ public const string Id_prop0002 = "prop0002"; + /// + /// 名称: 护盾
+ /// 备注: 增加护盾上限 + ///
+ public const string Id_prop0003 = "prop0003"; + /// + /// 名称: 护盾快速恢复
+ /// 备注: 提高护盾恢复速度 + ///
+ public const string Id_prop0004 = "prop0004"; + /// /// 名称:
/// 备注: 地牢房间的门(东侧) ///
@@ -123,6 +138,9 @@ _activityRegisterMap.Add("shell0003", new RegisterActivityData("res://prefab/shell/Shell0003.tscn", ExcelConfig.ActivityObject_Map["shell0003"])); _activityRegisterMap.Add("effect0001", new RegisterActivityData("res://prefab/effect/activityObject/Effect0001.tscn", ExcelConfig.ActivityObject_Map["effect0001"])); _activityRegisterMap.Add("prop0001", new RegisterActivityData("res://prefab/prop/buff/Prop0001.tscn", ExcelConfig.ActivityObject_Map["prop0001"])); + _activityRegisterMap.Add("prop0002", new RegisterActivityData("res://prefab/prop/buff/Prop0002.tscn", ExcelConfig.ActivityObject_Map["prop0002"])); + _activityRegisterMap.Add("prop0003", new RegisterActivityData("res://prefab/prop/buff/Prop0003.tscn", ExcelConfig.ActivityObject_Map["prop0003"])); + _activityRegisterMap.Add("prop0004", new RegisterActivityData("res://prefab/prop/buff/Prop0004.tscn", ExcelConfig.ActivityObject_Map["prop0004"])); _activityRegisterMap.Add("other_door_e", new RegisterActivityData("res://prefab/map/RoomDoor_E.tscn", ExcelConfig.ActivityObject_Map["other_door_e"])); _activityRegisterMap.Add("other_door_w", new RegisterActivityData("res://prefab/map/RoomDoor_W.tscn", ExcelConfig.ActivityObject_Map["other_door_w"])); _activityRegisterMap.Add("other_door_s", new RegisterActivityData("res://prefab/map/RoomDoor_S.tscn", ExcelConfig.ActivityObject_Map["other_door_s"])); diff --git a/DungeonShooting_Godot/src/framework/activity/components/MoveController.cs b/DungeonShooting_Godot/src/framework/activity/components/MoveController.cs index 6df946e..67dff7f 100644 --- a/DungeonShooting_Godot/src/framework/activity/components/MoveController.cs +++ b/DungeonShooting_Godot/src/framework/activity/components/MoveController.cs @@ -211,6 +211,7 @@ { if (_basisVelocity == Vector2.Zero && _forceList.Count == 0) { + ActivityInstance.Velocity = Vector2.Zero; return; } diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/HeartContainerBuff.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/HeartContainerBuff.cs new file mode 100644 index 0000000..e2c500f --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/prop/buff/HeartContainerBuff.cs @@ -0,0 +1,20 @@ + +using Godot; + +/// +/// 血量上限buff, 心之容器 + 1 +/// +[GlobalClass, Tool] +public partial class HeartContainerBuff : Buff +{ + protected override void OnPickUp(Role master) + { + master.MaxHp += 2; + master.Hp += 2; + } + + protected override void OnRemove(Role master) + { + master.MaxHp -= 2; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/MoveSpeedBuff.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/MoveSpeedBuff.cs index 7c4eb06..bee5301 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/buff/MoveSpeedBuff.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/buff/MoveSpeedBuff.cs @@ -2,18 +2,22 @@ using Godot; /// -/// 移速 buff +/// 移速 buff, 移速 + 3 /// [GlobalClass, Tool] public partial class MoveSpeedBuff : Buff { protected override void OnPickUp(Role master) { - master.RoleState.MoveSpeed += 100; + master.RoleState.MoveSpeed += 30; + master.RoleState.Acceleration += 400; + master.RoleState.Friction += 300; } protected override void OnRemove(Role master) { - master.RoleState.MoveSpeed -= 100; + master.RoleState.MoveSpeed -= 30; + master.RoleState.Acceleration -= 400; + master.RoleState.Friction -= 300; } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/ShieldContainerBuff.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/ShieldContainerBuff.cs new file mode 100644 index 0000000..4826b06 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/prop/buff/ShieldContainerBuff.cs @@ -0,0 +1,20 @@ + +using Godot; + +/// +/// 护盾上限buff, 护盾 + 1 +/// +[GlobalClass, Tool] +public partial class ShieldContainerBuff : Buff +{ + protected override void OnPickUp(Role master) + { + master.MaxShield += 1; + master.Shield += 1; + } + + protected override void OnRemove(Role master) + { + master.MaxShield -= 1; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/ShieldRecoveryTimeBuff.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/ShieldRecoveryTimeBuff.cs new file mode 100644 index 0000000..1e17305 --- /dev/null +++ b/DungeonShooting_Godot/src/game/activity/prop/buff/ShieldRecoveryTimeBuff.cs @@ -0,0 +1,19 @@ + +using Godot; + +/// +/// 护盾恢复时间buff, 恢复时间 - 1.5s +/// +[GlobalClass, Tool] +public partial class ShieldRecoveryTimeBuff : Buff +{ + protected override void OnPickUp(Role master) + { + master.RoleState.ShieldRecoveryTime -= 1.5f; + } + + protected override void OnRemove(Role master) + { + master.RoleState.ShieldRecoveryTime += 1.5f; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/role/Player.cs b/DungeonShooting_Godot/src/game/activity/role/Player.cs index 5da029d..9d33b71 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Player.cs @@ -11,16 +11,6 @@ /// 获取当前操作的角色 /// public static Player Current { get; private set; } - - /// - /// 移动加速度 - /// - public float Acceleration { get; set; } = 1500f; - - /// - /// 移动摩擦力 - /// - public float Friction { get; set; } = 800f; /// /// 设置当前操作的玩家对象 @@ -49,8 +39,8 @@ MaxHp = 6; Hp = 6; - MaxShield = 2; - Shield = 2; + MaxShield = 0; + Shield = 0; // debug用 // Acceleration = 3000; @@ -208,22 +198,22 @@ // 如果 有输入 就以当前速度,用acceleration 插值到 对应方向 * 最大速度 if (Mathf.IsZeroApprox(dir.X)) { - BasisVelocity = new Vector2(Mathf.MoveToward(BasisVelocity.X, 0, Friction * delta), BasisVelocity.Y); + BasisVelocity = new Vector2(Mathf.MoveToward(BasisVelocity.X, 0, RoleState.Friction * delta), BasisVelocity.Y); } else { - BasisVelocity = new Vector2(Mathf.MoveToward(BasisVelocity.X, dir.X * RoleState.MoveSpeed, Acceleration * delta), + BasisVelocity = new Vector2(Mathf.MoveToward(BasisVelocity.X, dir.X * RoleState.MoveSpeed, RoleState.Acceleration * delta), BasisVelocity.Y); } if (Mathf.IsZeroApprox(dir.Y)) { - BasisVelocity = new Vector2(BasisVelocity.X, Mathf.MoveToward(BasisVelocity.Y, 0, Friction * delta)); + BasisVelocity = new Vector2(BasisVelocity.X, Mathf.MoveToward(BasisVelocity.Y, 0, RoleState.Friction * delta)); } else { BasisVelocity = new Vector2(BasisVelocity.X, - Mathf.MoveToward(BasisVelocity.Y, dir.Y * RoleState.MoveSpeed, Acceleration * delta)); + Mathf.MoveToward(BasisVelocity.Y, dir.Y * RoleState.MoveSpeed, RoleState.Acceleration * delta)); } } diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs index 6e10cc3..d924ead 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs @@ -82,11 +82,14 @@ public int Hp { get => _hp; - protected set + set { int temp = _hp; _hp = value; - if (temp != _hp) OnChangeHp(_hp); + if (temp != _hp) + { + OnChangeHp(_hp); + } } } private int _hp = 20; @@ -97,12 +100,20 @@ public int MaxHp { get => _maxHp; - protected set + set { int temp = _maxHp; _maxHp = value; - //护盾值改变 - if (temp != _maxHp) OnChangeMaxHp(_maxHp); + //最大血量值改变 + if (temp != _maxHp) + { + OnChangeMaxHp(_maxHp); + } + //调整血量 + if (Hp > _maxHp) + { + Hp = _maxHp; + } } } private int _maxHp = 20; @@ -113,14 +124,20 @@ public int Shield { get => _shield; - protected set + set { int temp = _shield; _shield = value; //护盾被破坏 - if (temp > 0 && _shield <= 0) OnShieldDestroy(); + if (temp > 0 && _shield <= 0 && _maxShield > 0) + { + OnShieldDestroy(); + } //护盾值改变 - if (temp != _shield) OnChangeShield(_shield); + if (temp != _shield) + { + OnChangeShield(_shield); + } } } private int _shield = 0; @@ -131,21 +148,25 @@ public int MaxShield { get => _maxShield; - protected set + set { int temp = _maxShield; _maxShield = value; - if (temp != _maxShield) OnChangeMaxShield(_maxShield); + //最大护盾值改变 + if (temp != _maxShield) + { + OnChangeMaxShield(_maxShield); + } + //调整护盾值 + if (Shield > _maxShield) + { + Shield = _maxShield; + } } } private int _maxShield = 0; /// - /// 单格护盾恢复时间 - /// - private float ShieldRecoveryTime { get; set; } = 8; - - /// /// 无敌状态 /// public bool Invincible @@ -370,7 +391,7 @@ if (Shield < MaxShield) { _shieldRecoveryTimer += delta; - if (_shieldRecoveryTimer >= ShieldRecoveryTime) //时间到, 恢复 + if (_shieldRecoveryTimer >= RoleState.ShieldRecoveryTime) //时间到, 恢复 { Shield++; _shieldRecoveryTimer = 0; diff --git a/DungeonShooting_Godot/src/game/activity/role/RoleState.cs b/DungeonShooting_Godot/src/game/activity/role/RoleState.cs index 08d3338..db381f0 100644 --- a/DungeonShooting_Godot/src/game/activity/role/RoleState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/RoleState.cs @@ -8,4 +8,19 @@ /// 移动速度 /// public float MoveSpeed = 120f; + + /// + /// 移动加速度 + /// + public float Acceleration = 1500f; + + /// + /// 移动摩擦力 + /// + public float Friction = 900f; + + /// + /// 单格护盾恢复时间, 单位: 秒 + /// + public float ShieldRecoveryTime = 8; } \ No newline at end of file