Compare commits
4 Commits
13a70dd50e
...
645fbac190
Author | SHA1 | Date | |
---|---|---|---|
645fbac190 | |||
b736a60bd1 | |||
ec64cb6d7c | |||
9c88de3834 |
BIN
DungeonShooting_Godot/excel/ActivePropBase.xlsx
Normal file
BIN
DungeonShooting_Godot/excel/ActivePropBase.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
DungeonShooting_Godot/excel/BuffPropBase.xlsx
Normal file
BIN
DungeonShooting_Godot/excel/BuffPropBase.xlsx
Normal file
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://dfpic4nubu7cf"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/activity/prop/BuffActivity.cs" id="1_3ya6n"]
|
||||
[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_p5e2l"]
|
||||
[ext_resource type="Script" path="res://src/game/activity/prop/BuffProp.cs" id="1_nlcp6"]
|
||||
[ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="2_imicp"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_mrkt4"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("2_p5e2l")
|
||||
shader = ExtResource("2_imicp")
|
||||
shader_parameter/blend = Color(0, 0, 0, 0.470588)
|
||||
shader_parameter/schedule = 1.0
|
||||
shader_parameter/modulate = Color(1, 1, 1, 1)
|
||||
|
@ -17,7 +17,7 @@ shader_parameter/grey = 0.0
|
|||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b6ii6"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("2_p5e2l")
|
||||
shader = ExtResource("2_imicp")
|
||||
shader_parameter/blend = Color(1, 1, 1, 1)
|
||||
shader_parameter/schedule = 0.0
|
||||
shader_parameter/modulate = Color(1, 1, 1, 1)
|
||||
|
@ -33,9 +33,9 @@ resource_local_to_scene = true
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpqup"]
|
||||
size = Vector2(12, 10)
|
||||
|
||||
[node name="BuffActivity" type="CharacterBody2D" node_paths=PackedStringArray("ShadowSprite", "AnimatedSprite", "Collision")]
|
||||
[node name="BuffProp" type="CharacterBody2D" node_paths=PackedStringArray("ShadowSprite", "AnimatedSprite", "Collision")]
|
||||
collision_layer = 4
|
||||
script = ExtResource("1_3ya6n")
|
||||
script = ExtResource("1_nlcp6")
|
||||
ShadowSprite = NodePath("ShadowSprite")
|
||||
AnimatedSprite = NodePath("AnimatedSprite")
|
||||
Collision = NodePath("Collision")
|
|
@ -0,0 +1 @@
|
|||
[]
|
|
@ -457,7 +457,7 @@
|
|||
"Details": "\u63D0\u9AD8\u89D2\u8272\u7684\u57FA\u7840\u79FB\u52A8\u901F\u5EA6",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0001.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -471,7 +471,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0002.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -485,7 +485,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0003.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -499,7 +499,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0004.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -513,7 +513,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0005.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -527,7 +527,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0006.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -541,7 +541,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0007.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -555,7 +555,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0008.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -569,7 +569,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0009.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -583,7 +583,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0010.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -597,7 +597,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0011.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -611,7 +611,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0012.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -625,7 +625,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0013.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
@ -639,7 +639,7 @@
|
|||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/BuffActivity.tscn",
|
||||
"Prefab": "res://prefab/prop/BuffProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/buff/BuffProp0014.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
"Id": "0001",
|
||||
"Remark": "\u978B\u5B50",
|
||||
"__Activity": "prop0001",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"MoveSpeed": [
|
||||
30
|
||||
|
@ -14,7 +13,6 @@
|
|||
"Id": "0002",
|
||||
"Remark": "\u5FC3\u4E4B\u5BB9\u5668",
|
||||
"__Activity": "prop0002",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"MaxHp": [
|
||||
2
|
||||
|
@ -25,7 +23,6 @@
|
|||
"Id": "0003",
|
||||
"Remark": "\u62A4\u76FE",
|
||||
"__Activity": "prop0003",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"MaxShield": [
|
||||
1
|
||||
|
@ -36,7 +33,6 @@
|
|||
"Id": "0004",
|
||||
"Remark": "\u62A4\u76FE\u8BA1\u65F6\u5668",
|
||||
"__Activity": "prop0004",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"ShieldRecoveryTime": [
|
||||
2.5
|
||||
|
@ -47,7 +43,6 @@
|
|||
"Id": "0005",
|
||||
"Remark": "\u6740\u4F24\u5F39",
|
||||
"__Activity": "prop0005",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"Damage": [
|
||||
2,
|
||||
|
@ -59,7 +54,6 @@
|
|||
"Id": "0006",
|
||||
"Remark": "\u7EA2\u5B9D\u77F3\u6212\u6307",
|
||||
"__Activity": "prop0006",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"WoundedInvincibleTime": [
|
||||
2
|
||||
|
@ -70,7 +64,6 @@
|
|||
"Id": "0007",
|
||||
"Remark": "\u5907\u7528\u62A4\u76FE",
|
||||
"__Activity": "prop0007",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"OffsetInjury": [
|
||||
0.15
|
||||
|
@ -81,7 +74,6 @@
|
|||
"Id": "0008",
|
||||
"Remark": "\u773C\u955C",
|
||||
"__Activity": "prop0008",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"Scattering": [
|
||||
0.5
|
||||
|
@ -92,7 +84,6 @@
|
|||
"Id": "0009",
|
||||
"Remark": "\u9AD8\u901F\u5B50\u5F39",
|
||||
"__Activity": "prop0009",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"BulletSpeed": [
|
||||
2,
|
||||
|
@ -108,7 +99,6 @@
|
|||
"Id": "0010",
|
||||
"Remark": "\u5206\u88C2\u5B50\u5F39",
|
||||
"__Activity": "prop0010",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"BulletCount": [
|
||||
2,
|
||||
|
@ -136,7 +126,6 @@
|
|||
"Id": "0011",
|
||||
"Remark": "\u5F39\u5C04\u5B50\u5F39",
|
||||
"__Activity": "prop0011",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"BulletBounceCount": [
|
||||
2
|
||||
|
@ -147,7 +136,6 @@
|
|||
"Id": "0012",
|
||||
"Remark": "\u7A7F\u900F\u5B50\u5F39",
|
||||
"__Activity": "prop0012",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"BulletPenetration": [
|
||||
1
|
||||
|
@ -158,7 +146,6 @@
|
|||
"Id": "0013",
|
||||
"Remark": "\u6B66\u5668\u80CC\u5305",
|
||||
"__Activity": "prop0013",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"WeaponCapacity": [
|
||||
1
|
||||
|
@ -169,7 +156,6 @@
|
|||
"Id": "0014",
|
||||
"Remark": "\u9053\u5177\u80CC\u5305",
|
||||
"__Activity": "prop0014",
|
||||
"IsActivity": false,
|
||||
"Buff": {
|
||||
"ActivePropsCapacity": [
|
||||
1
|
|
@ -1 +1 @@
|
|||
[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":false,"WaveList":[[{"Position":{"X":39,"Y":8},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-16,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":6},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0009","Weight":100,"Attr":{"CurrAmmon":"1","ResidueAmmo":"25"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0010","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":47,"Y":-32},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0008","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":23,"Y":37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0010","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0005","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":24,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":40,"Y":-10},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":-37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-2,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":29,"Y":63},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0013","Weight":100,"Attr":{"CurrAmmon":"50","ResidueAmmo":"250"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-30,"Y":39},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-19,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":48,"Y":29},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":20,"Y":94},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0014","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-14,"Y":97},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0011","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":9,"Y":-7},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0011","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-41,"Y":61},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0016","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":73,"Y":-19},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-72,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]}]]}]
|
||||
[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":false,"WaveList":[[{"Position":{"X":39,"Y":8},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-16,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":6},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0009","Weight":100,"Attr":{"CurrAmmon":"1","ResidueAmmo":"25"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":66,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0010","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":47,"Y":-32},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0008","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":23,"Y":37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0010","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0005","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":24,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":40,"Y":-10},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":2,"Y":-37},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-2,"Y":47},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":29,"Y":63},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0013","Weight":100,"Attr":{"CurrAmmon":"50","ResidueAmmo":"250"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-30,"Y":39},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-19,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":48,"Y":29},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":20,"Y":94},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0014","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-14,"Y":97},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0011","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":9,"Y":-7},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0011","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-41,"Y":61},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0016","Weight":100,"Attr":{"CurrAmmon":"5","ResidueAmmo":"60"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":73,"Y":-19},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-72,"Y":71},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-67,"Y":50},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-91,"Y":46},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-92,"Y":74},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":5.551115E-14}]}]]}]
|
|
@ -7,6 +7,15 @@ namespace Config;
|
|||
|
||||
public static partial class ExcelConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// BuffPropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<BuffPropBase> BuffPropBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// BuffPropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, BuffPropBase> BuffPropBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sound.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
|
@ -43,15 +52,6 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public static Dictionary<string, AiAttackAttr> AiAttackAttr_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// BuffBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<BuffBase> BuffBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// BuffBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, BuffBase> BuffBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// BulletBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
|
@ -61,6 +61,15 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public static Dictionary<string, BulletBase> BulletBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ActivePropBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
public static List<ActivePropBase> ActivePropBase_List { get; private set; }
|
||||
/// <summary>
|
||||
/// ActivePropBase.xlsx表数据集合, 里 Map 形式存储, key 为 Id
|
||||
/// </summary>
|
||||
public static Dictionary<string, ActivePropBase> ActivePropBase_Map { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// EnemyBase.xlsx表数据集合, 以 List 形式存储, 数据顺序与 Excel 表相同
|
||||
/// </summary>
|
||||
|
@ -98,21 +107,41 @@ public static partial class ExcelConfig
|
|||
if (_init) return;
|
||||
_init = true;
|
||||
|
||||
_InitBuffPropBaseConfig();
|
||||
_InitSoundConfig();
|
||||
_InitWeaponBaseConfig();
|
||||
_InitActivityMaterialConfig();
|
||||
_InitAiAttackAttrConfig();
|
||||
_InitBuffBaseConfig();
|
||||
_InitBulletBaseConfig();
|
||||
_InitActivePropBaseConfig();
|
||||
_InitEnemyBaseConfig();
|
||||
_InitActivityBaseConfig();
|
||||
_InitLiquidMaterialConfig();
|
||||
|
||||
_InitBuffPropBaseRef();
|
||||
_InitWeaponBaseRef();
|
||||
_InitBuffBaseRef();
|
||||
_InitActivePropBaseRef();
|
||||
_InitEnemyBaseRef();
|
||||
_InitActivityBaseRef();
|
||||
}
|
||||
private static void _InitBuffPropBaseConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = _ReadConfigAsText("res://resource/config/BuffPropBase.json");
|
||||
BuffPropBase_List = new List<BuffPropBase>(JsonSerializer.Deserialize<List<Ref_BuffPropBase>>(text));
|
||||
BuffPropBase_Map = new Dictionary<string, BuffPropBase>();
|
||||
foreach (var item in BuffPropBase_List)
|
||||
{
|
||||
BuffPropBase_Map.Add(item.Id, item);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化表'BuffPropBase'失败!");
|
||||
}
|
||||
}
|
||||
private static void _InitSoundConfig()
|
||||
{
|
||||
try
|
||||
|
@ -185,24 +214,6 @@ public static partial class ExcelConfig
|
|||
throw new Exception("初始化表'AiAttackAttr'失败!");
|
||||
}
|
||||
}
|
||||
private static void _InitBuffBaseConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = _ReadConfigAsText("res://resource/config/BuffBase.json");
|
||||
BuffBase_List = new List<BuffBase>(JsonSerializer.Deserialize<List<Ref_BuffBase>>(text));
|
||||
BuffBase_Map = new Dictionary<string, BuffBase>();
|
||||
foreach (var item in BuffBase_List)
|
||||
{
|
||||
BuffBase_Map.Add(item.Id, item);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化表'BuffBase'失败!");
|
||||
}
|
||||
}
|
||||
private static void _InitBulletBaseConfig()
|
||||
{
|
||||
try
|
||||
|
@ -221,6 +232,24 @@ public static partial class ExcelConfig
|
|||
throw new Exception("初始化表'BulletBase'失败!");
|
||||
}
|
||||
}
|
||||
private static void _InitActivePropBaseConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = _ReadConfigAsText("res://resource/config/ActivePropBase.json");
|
||||
ActivePropBase_List = new List<ActivePropBase>(JsonSerializer.Deserialize<List<Ref_ActivePropBase>>(text));
|
||||
ActivePropBase_Map = new Dictionary<string, ActivePropBase>();
|
||||
foreach (var item in ActivePropBase_List)
|
||||
{
|
||||
ActivePropBase_Map.Add(item.Id, item);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化表'ActivePropBase'失败!");
|
||||
}
|
||||
}
|
||||
private static void _InitEnemyBaseConfig()
|
||||
{
|
||||
try
|
||||
|
@ -276,6 +305,25 @@ public static partial class ExcelConfig
|
|||
}
|
||||
}
|
||||
|
||||
private static void _InitBuffPropBaseRef()
|
||||
{
|
||||
foreach (Ref_BuffPropBase item in BuffPropBase_List)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.__Activity))
|
||||
{
|
||||
item.Activity = ActivityBase_Map[item.__Activity];
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化'BuffPropBase'引用其他表数据失败, 当前行id: " + item.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void _InitWeaponBaseRef()
|
||||
{
|
||||
foreach (Ref_WeaponBase item in WeaponBase_List)
|
||||
|
@ -344,9 +392,9 @@ public static partial class ExcelConfig
|
|||
}
|
||||
}
|
||||
}
|
||||
private static void _InitBuffBaseRef()
|
||||
private static void _InitActivePropBaseRef()
|
||||
{
|
||||
foreach (Ref_BuffBase item in BuffBase_List)
|
||||
foreach (Ref_ActivePropBase item in ActivePropBase_List)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -359,7 +407,7 @@ public static partial class ExcelConfig
|
|||
catch (Exception e)
|
||||
{
|
||||
GD.PrintErr(e.ToString());
|
||||
throw new Exception("初始化'BuffBase'引用其他表数据失败, 当前行id: " + item.Id);
|
||||
throw new Exception("初始化'ActivePropBase'引用其他表数据失败, 当前行id: " + item.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
using System.Text.Json.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Config;
|
||||
|
||||
public static partial class ExcelConfig
|
||||
{
|
||||
public class ActivePropBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Buff Id
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public string Id;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public string Remark;
|
||||
|
||||
/// <summary>
|
||||
/// 属性绑定Buff实体的Id,这个id时ActivityBase表Id
|
||||
/// </summary>
|
||||
public ActivityBase Activity;
|
||||
|
||||
/// <summary>
|
||||
/// 被动Buff效果 <br/>
|
||||
/// 也就是当前buff道具所有挂载的被动属性集合, 具体属性名称请参阅buff属性表 <br/>
|
||||
/// key为buff属性名称 <br/>
|
||||
/// value为buff初始化参数
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public Dictionary<string, float[]> Buff;
|
||||
|
||||
/// <summary>
|
||||
/// 使用完成后是否自动销毁
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public bool AutoDestroy;
|
||||
|
||||
/// <summary>
|
||||
/// 最大叠加次数
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public uint MaxCount;
|
||||
|
||||
/// <summary>
|
||||
/// 返回浅拷贝出的新对象
|
||||
/// </summary>
|
||||
public ActivePropBase Clone()
|
||||
{
|
||||
var inst = new ActivePropBase();
|
||||
inst.Id = Id;
|
||||
inst.Remark = Remark;
|
||||
inst.Activity = Activity;
|
||||
inst.Buff = Buff;
|
||||
inst.AutoDestroy = AutoDestroy;
|
||||
inst.MaxCount = MaxCount;
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
private class Ref_ActivePropBase : ActivePropBase
|
||||
{
|
||||
[JsonInclude]
|
||||
public string __Activity;
|
||||
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ namespace Config;
|
|||
|
||||
public static partial class ExcelConfig
|
||||
{
|
||||
public class BuffBase
|
||||
public class BuffPropBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Buff Id
|
||||
|
@ -24,12 +24,6 @@ public static partial class ExcelConfig
|
|||
/// </summary>
|
||||
public ActivityBase Activity;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是主动道具, 默认false
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public bool IsActivity;
|
||||
|
||||
/// <summary>
|
||||
/// 被动Buff效果 <br/>
|
||||
/// 也就是当前buff道具所有挂载的被动属性集合, 具体属性名称请参阅buff属性表 <br/>
|
||||
|
@ -42,18 +36,17 @@ public static partial class ExcelConfig
|
|||
/// <summary>
|
||||
/// 返回浅拷贝出的新对象
|
||||
/// </summary>
|
||||
public BuffBase Clone()
|
||||
public BuffPropBase Clone()
|
||||
{
|
||||
var inst = new BuffBase();
|
||||
var inst = new BuffPropBase();
|
||||
inst.Id = Id;
|
||||
inst.Remark = Remark;
|
||||
inst.Activity = Activity;
|
||||
inst.IsActivity = IsActivity;
|
||||
inst.Buff = Buff;
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
private class Ref_BuffBase : BuffBase
|
||||
private class Ref_BuffPropBase : BuffPropBase
|
||||
{
|
||||
[JsonInclude]
|
||||
public string __Activity;
|
|
@ -101,7 +101,7 @@ public partial class GameApplication : Node2D, ICoroutine
|
|||
//初始化敌人数据
|
||||
Enemy.InitEnemyAttribute();
|
||||
//初始化buff数据
|
||||
BuffActivity.InitBuffAttribute();
|
||||
BuffProp.InitBuffAttribute();
|
||||
|
||||
DungeonConfig = new DungeonConfig();
|
||||
DungeonConfig.GroupName = "Test1";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -75,6 +76,11 @@ public partial class World : CanvasModulate, ICoroutine
|
|||
/// 随机对象池
|
||||
/// </summary>
|
||||
public RandomPool RandomPool { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色死亡事件
|
||||
/// </summary>
|
||||
public event Action<Role> OnRoleDieEvent;
|
||||
|
||||
private bool _pause = false;
|
||||
private List<CoroutineData> _coroutineList;
|
||||
|
@ -166,4 +172,15 @@ public partial class World : CanvasModulate, ICoroutine
|
|||
Random = random;
|
||||
RandomPool = new RandomPool(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 角色死亡
|
||||
/// </summary>
|
||||
public void OnRoleDie(Role role)
|
||||
{
|
||||
if (OnRoleDieEvent != null)
|
||||
{
|
||||
OnRoleDieEvent(role);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,18 +1,15 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
|
||||
/// <summary>
|
||||
/// 主动使用道具
|
||||
/// </summary>
|
||||
public abstract partial class ActivePropActivity : PropActivity, IPackageItem<Role>
|
||||
[Tool]
|
||||
public partial class ActiveProp : PropActivity, IPackageItem<Role>
|
||||
{
|
||||
public int PackageIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 道具是否可以叠加
|
||||
/// </summary>
|
||||
public bool Superposition { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 道具可使用次数
|
||||
/// </summary>
|
||||
|
@ -92,16 +89,22 @@ public abstract partial class ActivePropActivity : PropActivity, IPackageItem<Ro
|
|||
|
||||
//冷却计时器
|
||||
private float _cooldownTimer = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当检测是否可以使用时调用
|
||||
/// </summary>
|
||||
public abstract bool OnCheckUse();
|
||||
public virtual bool OnCheckUse()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当道具被使用时调用, 函数返回值为消耗数量
|
||||
/// </summary>
|
||||
protected abstract int OnUse();
|
||||
protected virtual int OnUse()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 道具数量改变时调用
|
||||
|
@ -251,7 +254,7 @@ public abstract partial class ActivePropActivity : PropActivity, IPackageItem<Ro
|
|||
else
|
||||
{
|
||||
//处理同类型道具
|
||||
if (Superposition && item.Count < item.MaxCount) //允许叠加
|
||||
if (item.Count < item.MaxCount) //允许叠加
|
||||
{
|
||||
if (item.Count + Count > item.MaxCount)
|
||||
{
|
||||
|
@ -292,7 +295,7 @@ public abstract partial class ActivePropActivity : PropActivity, IPackageItem<Ro
|
|||
}
|
||||
|
||||
//处理同类型道具
|
||||
if (Superposition && item.Count < item.MaxCount) //允许叠加
|
||||
if (item.Count < item.MaxCount) //允许叠加
|
||||
{
|
||||
return new CheckInteractiveResult(this, true, CheckInteractiveResult.InteractiveType.Bullet);
|
||||
}
|
|
@ -8,7 +8,7 @@ using Godot;
|
|||
/// 通用被动道具实体类
|
||||
/// </summary>
|
||||
[Tool]
|
||||
public partial class BuffActivity : PropActivity
|
||||
public partial class BuffProp : PropActivity
|
||||
{
|
||||
//被动属性
|
||||
private readonly List<BuffFragment> _buffFragment = new List<BuffFragment>();
|
||||
|
@ -175,8 +175,8 @@ public partial class BuffActivity : PropActivity
|
|||
|
||||
|
||||
private static bool _init = false;
|
||||
private static Dictionary<string, ExcelConfig.BuffBase> _buffAttributeMap =
|
||||
new Dictionary<string, ExcelConfig.BuffBase>();
|
||||
private static Dictionary<string, ExcelConfig.BuffPropBase> _buffAttributeMap =
|
||||
new Dictionary<string, ExcelConfig.BuffPropBase>();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化 buff 属性数据
|
||||
|
@ -189,7 +189,7 @@ public partial class BuffActivity : PropActivity
|
|||
}
|
||||
|
||||
_init = true;
|
||||
foreach (var buffAttr in ExcelConfig.BuffBase_List)
|
||||
foreach (var buffAttr in ExcelConfig.BuffPropBase_List)
|
||||
{
|
||||
if (buffAttr.Activity != null)
|
||||
{
|
||||
|
@ -204,7 +204,7 @@ public partial class BuffActivity : PropActivity
|
|||
/// <summary>
|
||||
/// 根据 ActivityBase.Id 获取对应 buff 的属性数据
|
||||
/// </summary>
|
||||
public static ExcelConfig.BuffBase GetBuffAttribute(string itemId)
|
||||
public static ExcelConfig.BuffPropBase GetBuffAttribute(string itemId)
|
||||
{
|
||||
if (itemId == null)
|
||||
{
|
||||
|
@ -215,7 +215,6 @@ public partial class BuffActivity : PropActivity
|
|||
return attr;
|
||||
}
|
||||
|
||||
return null;
|
||||
//throw new Exception($"buff'{itemId}'没有在 BuffBase 表中配置属性数据!");
|
||||
throw new Exception($"buff'{itemId}'没有在 BuffBase 表中配置属性数据!");
|
||||
}
|
||||
}
|
|
@ -5,14 +5,13 @@ using Godot;
|
|||
/// 医药箱, 使用后恢复一颗红心
|
||||
/// </summary>
|
||||
[Tool]
|
||||
public partial class ActiveProp5000 : ActivePropActivity
|
||||
public partial class ActiveProp5000 : ActiveProp
|
||||
{
|
||||
public override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
AutoDestroy = true;
|
||||
MaxCount = 10;
|
||||
Superposition = true;
|
||||
}
|
||||
|
||||
public override bool OnCheckUse()
|
||||
|
|
|
@ -5,12 +5,11 @@ using Godot;
|
|||
/// 弹药箱, 使用后补全当前武器备用弹药
|
||||
/// </summary>
|
||||
[Tool]
|
||||
public partial class ActiveProp5001 : ActivePropActivity
|
||||
public partial class ActiveProp5001 : ActiveProp
|
||||
{
|
||||
public override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
Superposition = true;
|
||||
AutoDestroy = true;
|
||||
MaxCount = 10;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Config;
|
||||
|
@ -9,6 +10,13 @@ using Godot;
|
|||
/// </summary>
|
||||
public abstract partial class Role : ActivityObject
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前角色对其他角色造成伤害时对回调
|
||||
/// 参数1为目标角色
|
||||
/// 参数2为造成对伤害值
|
||||
/// </summary>
|
||||
public event Action<Role, int> OnDamageEvent;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是 Ai
|
||||
/// </summary>
|
||||
|
@ -54,12 +62,12 @@ public abstract partial class Role : ActivityObject
|
|||
/// <summary>
|
||||
/// 携带的被动道具列表
|
||||
/// </summary>
|
||||
public List<BuffActivity> BuffPropPack { get; } = new List<BuffActivity>();
|
||||
public List<BuffProp> BuffPropPack { get; } = new List<BuffProp>();
|
||||
|
||||
/// <summary>
|
||||
/// 携带的主动道具包裹
|
||||
/// </summary>
|
||||
public Package<ActivePropActivity, Role> ActivePropsPack { get; private set; }
|
||||
public Package<ActiveProp, Role> ActivePropsPack { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 互动碰撞区域
|
||||
|
@ -431,42 +439,42 @@ public abstract partial class Role : ActivityObject
|
|||
/// <summary>
|
||||
/// 当拾起某个主动道具时调用
|
||||
/// </summary>
|
||||
protected virtual void OnPickUpActiveProp(ActivePropActivity activePropActivity)
|
||||
protected virtual void OnPickUpActiveProp(ActiveProp activeProp)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当移除某个主动道具时调用
|
||||
/// </summary>
|
||||
protected virtual void OnRemoveActiveProp(ActivePropActivity activePropActivity)
|
||||
protected virtual void OnRemoveActiveProp(ActiveProp activeProp)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当切换到某个主动道具时调用
|
||||
/// </summary>
|
||||
protected virtual void OnExchangeActiveProp(ActivePropActivity activePropActivity)
|
||||
protected virtual void OnExchangeActiveProp(ActiveProp activeProp)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当拾起某个被动道具时调用
|
||||
/// </summary>
|
||||
protected virtual void OnPickUpBuffProp(BuffActivity buffActivity)
|
||||
protected virtual void OnPickUpBuffProp(BuffProp buffProp)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当移除某个被动道具时调用
|
||||
/// </summary>
|
||||
protected virtual void OnRemoveBuffProp(BuffActivity buffActivity)
|
||||
protected virtual void OnRemoveBuffProp(BuffProp buffProp)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
RoleState = OnCreateRoleState();
|
||||
ActivePropsPack = AddComponent<Package<ActivePropActivity, Role>>();
|
||||
ActivePropsPack = AddComponent<Package<ActiveProp, Role>>();
|
||||
ActivePropsPack.SetCapacity(RoleState.CanPickUpWeapon ? 1 : 0);
|
||||
|
||||
_startScale = Scale;
|
||||
|
@ -617,7 +625,7 @@ public abstract partial class Role : ActivityObject
|
|||
var props = ActivePropsPack.ItemSlot;
|
||||
if (props.Length > 0)
|
||||
{
|
||||
props = (ActivePropActivity[])props.Clone();
|
||||
props = (ActiveProp[])props.Clone();
|
||||
foreach (var prop in props)
|
||||
{
|
||||
if (prop != null && !prop.IsDestroyed)
|
||||
|
@ -673,15 +681,15 @@ public abstract partial class Role : ActivityObject
|
|||
/// <summary>
|
||||
/// 拾起主动道具, 返回是否成功拾起, 如果不想立刻切换到该道具, exchange 请传 false
|
||||
/// </summary>
|
||||
/// <param name="activePropActivity">主动道具对象</param>
|
||||
/// <param name="activeProp">主动道具对象</param>
|
||||
/// <param name="exchange">是否立即切换到该道具, 默认 true </param>
|
||||
public bool PickUpActiveProp(ActivePropActivity activePropActivity, bool exchange = true)
|
||||
public bool PickUpActiveProp(ActiveProp activeProp, bool exchange = true)
|
||||
{
|
||||
if (ActivePropsPack.PickupItem(activePropActivity, exchange) != -1)
|
||||
if (ActivePropsPack.PickupItem(activeProp, exchange) != -1)
|
||||
{
|
||||
//从可互动队列中移除
|
||||
InteractiveItemList.Remove(activePropActivity);
|
||||
OnPickUpActiveProp(activePropActivity);
|
||||
InteractiveItemList.Remove(activeProp);
|
||||
OnPickUpActiveProp(activeProp);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -716,28 +724,28 @@ public abstract partial class Role : ActivityObject
|
|||
/// <summary>
|
||||
/// 拾起被动道具, 返回是否成功拾起
|
||||
/// </summary>
|
||||
/// <param name="buffActivity">被动道具对象</param>
|
||||
public bool PickUpBuffProp(BuffActivity buffActivity)
|
||||
/// <param name="buffProp">被动道具对象</param>
|
||||
public bool PickUpBuffProp(BuffProp buffProp)
|
||||
{
|
||||
if (BuffPropPack.Contains(buffActivity))
|
||||
if (BuffPropPack.Contains(buffProp))
|
||||
{
|
||||
Debug.LogError("被动道具已经在背包中了!");
|
||||
return false;
|
||||
}
|
||||
BuffPropPack.Add(buffActivity);
|
||||
buffActivity.Master = this;
|
||||
OnPickUpBuffProp(buffActivity);
|
||||
buffActivity.OnPickUpItem();
|
||||
BuffPropPack.Add(buffProp);
|
||||
buffProp.Master = this;
|
||||
OnPickUpBuffProp(buffProp);
|
||||
buffProp.OnPickUpItem();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扔掉指定的被动道具
|
||||
/// </summary>
|
||||
/// <param name="buffActivity"></param>
|
||||
public void ThrowBuffProp(BuffActivity buffActivity)
|
||||
/// <param name="buffProp"></param>
|
||||
public void ThrowBuffProp(BuffProp buffProp)
|
||||
{
|
||||
var index = BuffPropPack.IndexOf(buffActivity);
|
||||
var index = BuffPropPack.IndexOf(buffProp);
|
||||
if (index < 0)
|
||||
{
|
||||
Debug.LogError("当前道具不在角色背包中!");
|
||||
|
@ -839,7 +847,16 @@ public abstract partial class Role : ActivityObject
|
|||
// GameApplication.Instance.Node3D.GetRoot().AddChild(blood);
|
||||
}
|
||||
OnHit(target, damage, angle, !flag);
|
||||
|
||||
|
||||
if (target is Role targetRole && !targetRole.IsDestroyed)
|
||||
{
|
||||
//造成伤害回调
|
||||
if (targetRole.OnDamageEvent != null)
|
||||
{
|
||||
targetRole.OnDamageEvent(this, damage);
|
||||
}
|
||||
}
|
||||
|
||||
//受伤特效
|
||||
PlayHitAnimation();
|
||||
|
||||
|
@ -851,6 +868,8 @@ public abstract partial class Role : ActivityObject
|
|||
{
|
||||
IsDie = true;
|
||||
OnDie();
|
||||
//死亡事件
|
||||
World.OnRoleDie(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -354,24 +354,24 @@ public partial class Player : Role
|
|||
UiManager.Open_Settlement();
|
||||
}
|
||||
|
||||
protected override void OnPickUpActiveProp(ActivePropActivity activePropActivity)
|
||||
protected override void OnPickUpActiveProp(ActiveProp activeProp)
|
||||
{
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerPickUpProp, activePropActivity);
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerPickUpProp, activeProp);
|
||||
}
|
||||
|
||||
protected override void OnRemoveActiveProp(ActivePropActivity activePropActivity)
|
||||
protected override void OnRemoveActiveProp(ActiveProp activeProp)
|
||||
{
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerRemoveProp, activePropActivity);
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerRemoveProp, activeProp);
|
||||
}
|
||||
|
||||
protected override void OnPickUpBuffProp(BuffActivity buffActivity)
|
||||
protected override void OnPickUpBuffProp(BuffProp buffProp)
|
||||
{
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerPickUpProp, buffActivity);
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerPickUpProp, buffProp);
|
||||
}
|
||||
|
||||
protected override void OnRemoveBuffProp(BuffActivity buffActivity)
|
||||
protected override void OnRemoveBuffProp(BuffProp buffProp)
|
||||
{
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerRemoveProp, buffActivity);
|
||||
EventManager.EmitEvent(EventEnum.OnPlayerRemoveProp, buffProp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -4,7 +4,7 @@ using System;
|
|||
/// <summary>
|
||||
/// 被动属性逻辑基类
|
||||
/// </summary>
|
||||
public abstract partial class BuffFragment : Component<BuffActivity>
|
||||
public abstract class BuffFragment : Component<BuffProp>
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属角色对象
|
||||
|
|
Loading…
Reference in New Issue
Block a user