制作新道具
This commit is contained in:
parent
82b0732c39
commit
8c0710190d
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,31 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bb7xvumnivsho"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/buffComp/active/Prop5003Area.cs" id="1_nxrjx"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_41obf"]
|
||||
colors = PackedColorArray(1, 0, 0, 0.392157, 1, 0, 0, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ih8qw"]
|
||||
gradient = SubResource("Gradient_41obf")
|
||||
width = 128
|
||||
height = 128
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(0.827839, 0.291819)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_1llif"]
|
||||
radius = 15.0333
|
||||
|
||||
[node name="Prop5003Area" type="Area2D" node_paths=PackedStringArray("CircleSprite", "Collision")]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
monitorable = false
|
||||
script = ExtResource("1_nxrjx")
|
||||
CircleSprite = NodePath("Circle")
|
||||
Collision = NodePath("CollisionShape2D")
|
||||
|
||||
[node name="Circle" type="Sprite2D" parent="."]
|
||||
texture = SubResource("GradientTexture2D_ih8qw")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_1llif")
|
|
@ -14,7 +14,9 @@
|
|||
2
|
||||
]
|
||||
},
|
||||
"CooldownTime": 0,
|
||||
"Charge": null,
|
||||
"Duration": 0,
|
||||
"CooldownTime": 2,
|
||||
"IsConsumables": true,
|
||||
"MaxCount": 10
|
||||
},
|
||||
|
@ -31,7 +33,9 @@
|
|||
"Effect": {
|
||||
"TotalAmmo": []
|
||||
},
|
||||
"CooldownTime": 0,
|
||||
"Charge": null,
|
||||
"Duration": 0,
|
||||
"CooldownTime": 2,
|
||||
"IsConsumables": true,
|
||||
"MaxCount": 10
|
||||
},
|
||||
|
@ -46,8 +50,29 @@
|
|||
2
|
||||
]
|
||||
},
|
||||
"Charge": null,
|
||||
"Duration": 0,
|
||||
"CooldownTime": 0,
|
||||
"IsConsumables": true,
|
||||
"MaxCount": 1
|
||||
},
|
||||
{
|
||||
"Id": "0004",
|
||||
"Remark": "\u7EA2\u5916\u9065\u63A7\u5668",
|
||||
"__Activity": "prop5003",
|
||||
"Buff": null,
|
||||
"Condition": null,
|
||||
"Effect": {
|
||||
"AreaTrigger": []
|
||||
},
|
||||
"Charge": {
|
||||
"Hurt": [
|
||||
100
|
||||
]
|
||||
},
|
||||
"Duration": 0,
|
||||
"CooldownTime": 0,
|
||||
"IsConsumables": false,
|
||||
"MaxCount": 1
|
||||
}
|
||||
]
|
|
@ -677,14 +677,28 @@
|
|||
"Type": 9,
|
||||
"Quality": 1,
|
||||
"Price": 0,
|
||||
"Intro": "",
|
||||
"Details": "\u62FE\u8D77\u8BE5\u9053\u5177\u540E\u73A9\u5BB6\u6361\u5230\u7684\u6240\u6709\u91D1\u5E01\u5C06\u4F1A\u88AB\u5B58\u5165\u5230\u5B58\u94B1\u7F50\u4E2D, \u4F7F\u7528\u8BE5\u9053\u5177, \u4F1A\u6467\u6BC1\u5B58\u94B1\u7F50, \u5E76\u8FD4\u56DE\u53CC\u500D\u7684\u91D1\u5E01,",
|
||||
"Intro": "\u62FE\u8D77\u8BE5\u9053\u5177\u540E\u73A9\u5BB6\u6361\u5230\u7684\u6240\u6709\u91D1\u5E01\u5C06\u4F1A\u88AB\u5B58\u5165\u5230\u5B58\u94B1\u7F50\u4E2D, \u4F7F\u7528\u8BE5\u9053\u5177, \u4F1A\u6467\u6BC1\u5B58\u94B1\u7F50, \u5E76\u8FD4\u56DE\u53CC\u500D\u7684\u91D1\u5E01",
|
||||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/ActiveProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/active/ActiveProp5002.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
{
|
||||
"Id": "prop5003",
|
||||
"Name": "\u7EA2\u5916\u9065\u63A7\u5668",
|
||||
"Type": 9,
|
||||
"Quality": 1,
|
||||
"Price": 0,
|
||||
"Intro": "\u4F7F\u7528\u540E\u4F1A\u89E6\u53D1\u9644\u8FD1\u5730\u4E0A\u7684\u6B66\u5668\u5F00\u706B",
|
||||
"Details": "",
|
||||
"IsStatic": false,
|
||||
"__Material": "",
|
||||
"Prefab": "res://prefab/prop/ActiveProp.tscn",
|
||||
"Icon": "res://resource/sprite/prop/active/ActiveProp5003.png",
|
||||
"ShowInMapEditor": true
|
||||
},
|
||||
{
|
||||
"Id": "treasure_box0001",
|
||||
"Name": "\u6728\u8D28\u5B9D\u7BB1",
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 424 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cjf00ob376y3e"
|
||||
path="res://.godot/imported/ActiveProp5003.png-26abcb759a746b5ad719977590650d45.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resource/sprite/prop/active/ActiveProp5003.png"
|
||||
dest_files=["res://.godot/imported/ActiveProp5003.png-26abcb759a746b5ad719977590650d45.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
|
|
@ -49,6 +49,23 @@ public static partial class ExcelConfig
|
|||
[JsonInclude]
|
||||
public Dictionary<string, float[]> Effect;
|
||||
|
||||
/// <summary>
|
||||
/// 道具充能效果 <br/>
|
||||
/// 参数配置方式与buff字段相同 <br/>
|
||||
/// 性名称请参阅charge属性表 <br/>
|
||||
/// 注意: 仅当'IsConsumables'为false是生效
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public Dictionary<string, float[]> Charge;
|
||||
|
||||
/// <summary>
|
||||
/// 使用道具的效果持续时间 <br/>
|
||||
/// 单位: 秒 <br/>
|
||||
/// 注意: 该持续时间与具体道具属性片段无关, 仅用于程序计算何时可以开始冷却道具
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public float Duration;
|
||||
|
||||
/// <summary>
|
||||
/// 使用一次后的冷却时间 <br/>
|
||||
/// 单位: 秒
|
||||
|
@ -63,7 +80,7 @@ public static partial class ExcelConfig
|
|||
public bool IsConsumables;
|
||||
|
||||
/// <summary>
|
||||
/// 最大叠加次数, 仅当IsConsumables为true时有效
|
||||
/// 最大叠加次数, 仅当'IsConsumables'为true时有效
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public uint MaxCount;
|
||||
|
@ -80,6 +97,8 @@ public static partial class ExcelConfig
|
|||
inst.Buff = Buff;
|
||||
inst.Condition = Condition;
|
||||
inst.Effect = Effect;
|
||||
inst.Charge = Charge;
|
||||
inst.Duration = Duration;
|
||||
inst.CooldownTime = CooldownTime;
|
||||
inst.IsConsumables = IsConsumables;
|
||||
inst.MaxCount = MaxCount;
|
||||
|
|
|
@ -250,10 +250,15 @@ public partial class ActivityObject
|
|||
public const string Id_prop5001 = "prop5001";
|
||||
/// <summary>
|
||||
/// 名称: 猪猪存钱罐 <br/>
|
||||
/// 简介:
|
||||
/// 简介: 拾起该道具后玩家捡到的所有金币将会被存入到存钱罐中, 使用该道具, 会摧毁存钱罐, 并返回双倍的金币
|
||||
/// </summary>
|
||||
public const string Id_prop5002 = "prop5002";
|
||||
/// <summary>
|
||||
/// 名称: 红外遥控器 <br/>
|
||||
/// 简介: 使用后会触发附近地上的武器开火
|
||||
/// </summary>
|
||||
public const string Id_prop5003 = "prop5003";
|
||||
/// <summary>
|
||||
/// 名称: 木质宝箱 <br/>
|
||||
/// 简介: 木质宝箱
|
||||
/// </summary>
|
||||
|
|
|
@ -93,6 +93,8 @@ public partial class ActiveProp : PropActivity, IPackageItem<Role>
|
|||
private readonly List<ConditionFragment> _conditionFragment = new List<ConditionFragment>();
|
||||
//效果
|
||||
private readonly List<EffectFragment> _effectFragment = new List<EffectFragment>();
|
||||
//充能
|
||||
private readonly List<ChargeFragment> _chargeFragment = new List<ChargeFragment>();
|
||||
|
||||
public override void OnInit()
|
||||
{
|
||||
|
@ -241,6 +243,53 @@ public partial class ActiveProp : PropActivity, IPackageItem<Role>
|
|||
}
|
||||
}
|
||||
|
||||
//初始化道具冷却属性数据
|
||||
if (!buffAttribute.IsConsumables && buffAttribute.Charge != null)
|
||||
{
|
||||
foreach (var keyValuePair in buffAttribute.Charge)
|
||||
{
|
||||
var buffInfo = PropFragmentRegister.ChargeFragmentInfos[keyValuePair.Key];
|
||||
var item = keyValuePair.Value;
|
||||
switch (item.Length)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
var buff = (ChargeFragment)AddComponent(buffInfo.Type);
|
||||
_chargeFragment.Add(buff);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
var buff = (ChargeFragment)AddComponent(buffInfo.Type);
|
||||
buff.InitParam(item[0]);
|
||||
_chargeFragment.Add(buff);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
var buff = (ChargeFragment)AddComponent(buffInfo.Type);
|
||||
buff.InitParam(item[0], item[1]);
|
||||
_chargeFragment.Add(buff);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
var buff = (ChargeFragment)AddComponent(buffInfo.Type);
|
||||
buff.InitParam(item[0], item[1], item[2]);
|
||||
_chargeFragment.Add(buff);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
var buff = (ChargeFragment)AddComponent(buffInfo.Type);
|
||||
buff.InitParam(item[0], item[1], item[2], item[3]);
|
||||
_chargeFragment.Add(buff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//显示纹理
|
||||
if (!string.IsNullOrEmpty(ActivityBase.Icon))
|
||||
{
|
||||
|
@ -277,6 +326,11 @@ public partial class ActiveProp : PropActivity, IPackageItem<Role>
|
|||
{
|
||||
fragment.OnUse();
|
||||
}
|
||||
|
||||
foreach (var fragment in _chargeFragment)
|
||||
{
|
||||
fragment.OnUse();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -486,6 +540,11 @@ public partial class ActiveProp : PropActivity, IPackageItem<Role>
|
|||
{
|
||||
effectFragment.OnPickUpItem();
|
||||
}
|
||||
|
||||
foreach (var chargeFragment in _chargeFragment)
|
||||
{
|
||||
chargeFragment.OnPickUpItem();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoveItem()
|
||||
|
@ -504,6 +563,11 @@ public partial class ActiveProp : PropActivity, IPackageItem<Role>
|
|||
{
|
||||
effectFragment.OnRemoveItem();
|
||||
}
|
||||
|
||||
foreach (var chargeFragment in _chargeFragment)
|
||||
{
|
||||
chargeFragment.OnRemoveItem();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnActiveItem()
|
||||
|
|
|
@ -161,6 +161,9 @@ public abstract partial class Weapon : ActivityObject, IPackageItem<Role>
|
|||
|
||||
//--------------------------------------------------------------------------------------------
|
||||
|
||||
//触发板机是是否计算弹药消耗
|
||||
private bool _triggerCalcAmmon = true;
|
||||
|
||||
//用于记录是否有角色操作过这把武器
|
||||
private bool _triggerRoleFlag = false;
|
||||
|
||||
|
@ -805,7 +808,8 @@ public abstract partial class Weapon : ActivityObject, IPackageItem<Role>
|
|||
/// 扳机函数, 调用即视为按下扳机
|
||||
/// </summary>
|
||||
/// <param name="triggerRole">按下扳机的角色, 如果传 null, 则视为走火</param>
|
||||
public void Trigger(Role triggerRole)
|
||||
/// <param name="calcAmmo">是否计算弹药消耗</param>
|
||||
public void Trigger(Role triggerRole, bool calcAmmo = true)
|
||||
{
|
||||
//不能触发扳机
|
||||
if (!NoMasterCanTrigger && Master == null) return;
|
||||
|
@ -816,6 +820,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem<Role>
|
|||
//更新武器属性信息
|
||||
_triggerFlag = true;
|
||||
_triggerRoleFlag = true;
|
||||
_triggerCalcAmmon = calcAmmo;
|
||||
if (triggerRole != null)
|
||||
{
|
||||
TriggerRole = triggerRole;
|
||||
|
@ -1098,18 +1103,27 @@ public abstract partial class Weapon : ActivityObject, IPackageItem<Role>
|
|||
_reloadShellFlag = false;
|
||||
|
||||
//减子弹数量
|
||||
if (_playerWeaponAttribute != _weaponAttribute) //Ai使用该武器, 有一定概率不消耗弹药
|
||||
if (_triggerCalcAmmon)
|
||||
{
|
||||
if (_playerWeaponAttribute != _weaponAttribute) //Ai使用该武器, 有一定概率不消耗弹药
|
||||
{
|
||||
var count = UseAmmoCount();
|
||||
CurrAmmo -= count;
|
||||
if (Utils.Random.RandomRangeFloat(0, 1) >= _weaponAttribute.AiAttackAttr.AmmoConsumptionProbability) //不消耗弹药
|
||||
{
|
||||
ResidueAmmo += count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrAmmo -= UseAmmoCount();
|
||||
}
|
||||
}
|
||||
else //不消耗弹药
|
||||
{
|
||||
var count = UseAmmoCount();
|
||||
CurrAmmo -= count;
|
||||
if (Utils.Random.RandomRangeFloat(0, 1) >= _weaponAttribute.AiAttackAttr.AmmoConsumptionProbability) //不消耗弹药
|
||||
{
|
||||
ResidueAmmo += count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrAmmo -= UseAmmoCount();
|
||||
ResidueAmmo += count;
|
||||
}
|
||||
|
||||
if (CurrAmmo == 0)
|
||||
|
|
|
@ -66,7 +66,7 @@ public partial class Bow : Weapon
|
|||
|
||||
protected override void OnFire()
|
||||
{
|
||||
if (Master.IsPlayer())
|
||||
if (TriggerRole != null && TriggerRole.IsPlayer())
|
||||
{
|
||||
//创建抖动
|
||||
GameCamera.Main.DirectionalShake(Vector2.Right.Rotated(GlobalRotation) * Attribute.CameraShake);
|
||||
|
|
24
DungeonShooting_Godot/src/game/buff/ChargeFragment.cs
Normal file
24
DungeonShooting_Godot/src/game/buff/ChargeFragment.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
|
||||
/// <summary>
|
||||
/// 主动道具充能基类
|
||||
/// </summary>
|
||||
public abstract class ChargeFragment : PropFragment
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前组件所挂载的游戏对象
|
||||
/// </summary>
|
||||
public new ActiveProp Master => (ActiveProp)base.Master;
|
||||
|
||||
/// <summary>
|
||||
/// 当道具被使用是调用
|
||||
/// </summary>
|
||||
public abstract void OnUse();
|
||||
|
||||
public override void OnPickUpItem()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnRemoveItem()
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ChargeFragmentAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 充能属性名称
|
||||
/// </summary>
|
||||
public string ChargeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
public ChargeFragmentAttribute(string chargeName, string description)
|
||||
{
|
||||
ChargeName = chargeName;
|
||||
Description = description;
|
||||
}
|
||||
}
|
32
DungeonShooting_Godot/src/game/buff/charge/Cha_Hurt.cs
Normal file
32
DungeonShooting_Godot/src/game/buff/charge/Cha_Hurt.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
|
||||
[ChargeFragment("Hurt",
|
||||
"造成伤害充能, 参数1为充满能量需要造成的伤害值")]
|
||||
public class Cha_Hurt : ChargeFragment
|
||||
{
|
||||
private int _value = 100;
|
||||
|
||||
public override void InitParam(float arg1)
|
||||
{
|
||||
_value = (int)arg1;
|
||||
}
|
||||
|
||||
public override void OnUse()
|
||||
{
|
||||
Master.ChargeProgress = 0;
|
||||
}
|
||||
|
||||
public override void OnPickUpItem()
|
||||
{
|
||||
Role.OnDamageEvent += OnDamageEvent;
|
||||
}
|
||||
|
||||
public override void OnRemoveItem()
|
||||
{
|
||||
Role.OnDamageEvent -= OnDamageEvent;
|
||||
}
|
||||
|
||||
private void OnDamageEvent(Role role, int value)
|
||||
{
|
||||
Master.ChargeProgress += 1f / _value * value;
|
||||
}
|
||||
}
|
|
@ -1,44 +1,73 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
|
||||
[EffectFragment("AreaTrigger", "")]
|
||||
public class Eff_AreaTrigger : EffectFragment
|
||||
{
|
||||
private Area2D _areaNode;
|
||||
private CollisionShape2D _shapeNode;
|
||||
private CircleShape2D _shape;
|
||||
private Prop5003Area _areaNode;
|
||||
private List<Weapon> _weaponList = new List<Weapon>();
|
||||
|
||||
public override void Ready()
|
||||
{
|
||||
_areaNode = new Area2D();
|
||||
_shapeNode = new CollisionShape2D();
|
||||
_shape = new CircleShape2D();
|
||||
_shapeNode.Shape = _shape;
|
||||
|
||||
_areaNode.AddChild(_shapeNode);
|
||||
_areaNode = ResourceManager.LoadAndInstantiate<Prop5003Area>(ResourcePath.prefab_prop_activeComp_Prop5003_Area_tscn);
|
||||
_areaNode.BodyEntered += OnBodyEntered;
|
||||
_areaNode.BodyExited += OnBodyExited;
|
||||
AddChild(_areaNode);
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
_areaNode.QueueFree();
|
||||
_shapeNode.QueueFree();
|
||||
}
|
||||
|
||||
public override void OnUse()
|
||||
{
|
||||
|
||||
_areaNode.PlayEffect(0, 250, 6);
|
||||
}
|
||||
|
||||
public override void Process(float delta)
|
||||
{
|
||||
for (var i = 0; i < _weaponList.Count; i++)
|
||||
{
|
||||
var weapon = _weaponList[i];
|
||||
if (weapon.Master != null)
|
||||
{
|
||||
_weaponList.RemoveAt(i--);
|
||||
continue;
|
||||
}
|
||||
weapon.Trigger(Role, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnPickUpItem()
|
||||
{
|
||||
RemoveChild(_areaNode);
|
||||
Role.AddChild(_areaNode);
|
||||
Role.AnimatedSprite.AddChild(_areaNode);
|
||||
}
|
||||
|
||||
public override void OnRemoveItem()
|
||||
{
|
||||
Role.RemoveChild(_areaNode);
|
||||
Role.AnimatedSprite.RemoveChild(_areaNode);
|
||||
AddChild(_areaNode);
|
||||
}
|
||||
|
||||
private void OnBodyEntered(Node2D node)
|
||||
{
|
||||
if (node is Weapon weapon && weapon.Master == null)
|
||||
{
|
||||
if (!_weaponList.Contains(weapon))
|
||||
{
|
||||
_weaponList.Add(weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBodyExited(Node2D node)
|
||||
{
|
||||
if (node is Weapon weapon && weapon.Master == null)
|
||||
{
|
||||
_weaponList.Remove(weapon);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
|
||||
using System;
|
||||
using Godot;
|
||||
|
||||
public partial class Prop5003Area : Area2D
|
||||
{
|
||||
[Export]
|
||||
public Sprite2D CircleSprite;
|
||||
|
||||
[Export]
|
||||
public CollisionShape2D Collision;
|
||||
|
||||
public CircleShape2D CircleShape;
|
||||
public GradientTexture2D Gradient;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
CircleShape = (CircleShape2D)Collision.Shape;
|
||||
Gradient = (GradientTexture2D)CircleSprite.Texture;
|
||||
SetEnable(false);
|
||||
}
|
||||
|
||||
public void PlayEffect(int startRadius, int endRadius, float time)
|
||||
{
|
||||
var _tween = CreateTween();
|
||||
_tween.SetParallel();
|
||||
_tween.TweenCallback(Callable.From(() =>
|
||||
{
|
||||
SetEnable(true);
|
||||
Modulate = Colors.White;
|
||||
}));
|
||||
_tween.Chain();
|
||||
|
||||
_tween.TweenMethod(Callable.From<int>(SetRadius), startRadius, endRadius * 0.75f, time * 0.2f);
|
||||
_tween.Chain();
|
||||
|
||||
_tween.TweenInterval(time * 0.55f);
|
||||
_tween.Chain();
|
||||
|
||||
_tween.TweenMethod(Callable.From<int>(SetRadius), endRadius * 0.75f, endRadius, time * 0.25f);
|
||||
_tween.TweenProperty(this, "modulate", new Color(1, 1, 1, 0), time * 0.25f);
|
||||
_tween.Chain();
|
||||
|
||||
_tween.TweenCallback(Callable.From(() =>
|
||||
{
|
||||
SetEnable(false);
|
||||
}));
|
||||
_tween.Play();
|
||||
}
|
||||
|
||||
private void SetRadius(int radius)
|
||||
{
|
||||
Gradient.Width = radius * 2;
|
||||
Gradient.Height = radius * 2;
|
||||
CircleShape.Radius = radius;
|
||||
}
|
||||
|
||||
private void SetEnable(bool value)
|
||||
{
|
||||
Monitoring = value;
|
||||
CircleSprite.Visible = value;
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ public class PropFragmentRegister
|
|||
public static Dictionary<string, PropFragmentInfo> BuffFragmentInfos { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所有主动道具条件数据
|
||||
/// 所有主动道具使用条件数据
|
||||
/// </summary>
|
||||
public static Dictionary<string, PropFragmentInfo> ConditionFragmentInfos { get; private set; }
|
||||
|
||||
|
@ -22,6 +22,11 @@ public class PropFragmentRegister
|
|||
/// 所有主动道具效果数据
|
||||
/// </summary>
|
||||
public static Dictionary<string, PropFragmentInfo> EffectFragmentInfos { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所有主动道具充能条件数据
|
||||
/// </summary>
|
||||
public static Dictionary<string, PropFragmentInfo> ChargeFragmentInfos { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化 buff
|
||||
|
@ -31,6 +36,7 @@ public class PropFragmentRegister
|
|||
BuffFragmentInfos = new Dictionary<string, PropFragmentInfo>();
|
||||
ConditionFragmentInfos = new Dictionary<string, PropFragmentInfo>();
|
||||
EffectFragmentInfos = new Dictionary<string, PropFragmentInfo>();
|
||||
ChargeFragmentInfos = new Dictionary<string, PropFragmentInfo>();
|
||||
|
||||
var types = typeof(PropFragmentRegister).Assembly.GetTypes();
|
||||
//包含[BuffAttribute]特性
|
||||
|
@ -87,5 +93,23 @@ public class PropFragmentRegister
|
|||
EffectFragmentInfos.Add(attribute.EffectName, effectInfo);
|
||||
}
|
||||
}
|
||||
//包含[ChargeAttribute]特性
|
||||
var charges = types.Where(type =>
|
||||
type.IsClass && !type.IsAbstract && type.IsAssignableTo(typeof(ChargeFragment)));
|
||||
foreach (var type in charges)
|
||||
{
|
||||
var attribute = (ChargeFragmentAttribute)type.GetCustomAttribute(typeof(ChargeFragmentAttribute), false);
|
||||
if (attribute != null)
|
||||
{
|
||||
if (ChargeFragmentInfos.ContainsKey(attribute.ChargeName))
|
||||
{
|
||||
GD.PrintErr($"Charge '{attribute.ChargeName}' 重名!");
|
||||
continue;
|
||||
}
|
||||
|
||||
var chargeInfo = new PropFragmentInfo(attribute.ChargeName, attribute.Description, type);
|
||||
ChargeFragmentInfos.Add(attribute.ChargeName, chargeInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -45,22 +45,9 @@ public class ResourcePath
|
|||
public const string prefab_ui_EditorColorPicker_tscn = "res://prefab/ui/EditorColorPicker.tscn";
|
||||
public const string prefab_ui_RoomUI_tscn = "res://prefab/ui/RoomUI.tscn";
|
||||
public const string prefab_prop_PropTemplate_tscn = "res://prefab/prop/PropTemplate.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0003_tscn = "res://prefab/prop/buff/BuffProp0003.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0014_tscn = "res://prefab/prop/buff/BuffProp0014.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0002_tscn = "res://prefab/prop/buff/BuffProp0002.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0009_tscn = "res://prefab/prop/buff/BuffProp0009.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0005_tscn = "res://prefab/prop/buff/BuffProp0005.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0013_tscn = "res://prefab/prop/buff/BuffProp0013.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0012_tscn = "res://prefab/prop/buff/BuffProp0012.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0004_tscn = "res://prefab/prop/buff/BuffProp0004.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0008_tscn = "res://prefab/prop/buff/BuffProp0008.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0011_tscn = "res://prefab/prop/buff/BuffProp0011.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0007_tscn = "res://prefab/prop/buff/BuffProp0007.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0006_tscn = "res://prefab/prop/buff/BuffProp0006.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0010_tscn = "res://prefab/prop/buff/BuffProp0010.tscn";
|
||||
public const string prefab_prop_buff_BuffProp0001_tscn = "res://prefab/prop/buff/BuffProp0001.tscn";
|
||||
public const string prefab_prop_active_ActiveProp5001_tscn = "res://prefab/prop/active/ActiveProp5001.tscn";
|
||||
public const string prefab_prop_active_ActiveProp5000_tscn = "res://prefab/prop/active/ActiveProp5000.tscn";
|
||||
public const string prefab_prop_ActiveProp_tscn = "res://prefab/prop/ActiveProp.tscn";
|
||||
public const string prefab_prop_BuffProp_tscn = "res://prefab/prop/BuffProp.tscn";
|
||||
public const string prefab_prop_activeComp_Prop5003_Area_tscn = "res://prefab/prop/activeComp/Prop5003_Area.tscn";
|
||||
public const string prefab_weapon_Weapon0008_tscn = "res://prefab/weapon/Weapon0008.tscn";
|
||||
public const string prefab_weapon_Weapon0004_tscn = "res://prefab/weapon/Weapon0004.tscn";
|
||||
public const string prefab_weapon_Weapon0005_tscn = "res://prefab/weapon/Weapon0005.tscn";
|
||||
|
@ -175,22 +162,6 @@ public class ResourcePath
|
|||
public const string scene_test_TestNavigation2_tscn = "res://scene/test/TestNavigation2.tscn";
|
||||
public const string scene_test_TestLoadTileSetConfig_tscn = "res://scene/test/TestLoadTileSetConfig.tscn";
|
||||
public const string scene_test_TestDrawSprite_tscn = "res://scene/test/TestDrawSprite.tscn";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0009_tres = "res://resource/spriteFrames/prop/buff/BuffProp0009.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0013_tres = "res://resource/spriteFrames/prop/buff/BuffProp0013.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0005_tres = "res://resource/spriteFrames/prop/buff/BuffProp0005.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0004_tres = "res://resource/spriteFrames/prop/buff/BuffProp0004.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0012_tres = "res://resource/spriteFrames/prop/buff/BuffProp0012.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0008_tres = "res://resource/spriteFrames/prop/buff/BuffProp0008.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0003_tres = "res://resource/spriteFrames/prop/buff/BuffProp0003.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0002_tres = "res://resource/spriteFrames/prop/buff/BuffProp0002.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0014_tres = "res://resource/spriteFrames/prop/buff/BuffProp0014.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0001_tres = "res://resource/spriteFrames/prop/buff/BuffProp0001.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0007_tres = "res://resource/spriteFrames/prop/buff/BuffProp0007.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0011_tres = "res://resource/spriteFrames/prop/buff/BuffProp0011.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0010_tres = "res://resource/spriteFrames/prop/buff/BuffProp0010.tres";
|
||||
public const string resource_spriteFrames_prop_buff_BuffProp0006_tres = "res://resource/spriteFrames/prop/buff/BuffProp0006.tres";
|
||||
public const string resource_spriteFrames_prop_active_ActiveProp5001_tres = "res://resource/spriteFrames/prop/active/ActiveProp5001.tres";
|
||||
public const string resource_spriteFrames_prop_active_ActiveProp5000_tres = "res://resource/spriteFrames/prop/active/ActiveProp5000.tres";
|
||||
public const string resource_spriteFrames_weapon_Weapon0002_tres = "res://resource/spriteFrames/weapon/Weapon0002.tres";
|
||||
public const string resource_spriteFrames_weapon_Weapon0014_tres = "res://resource/spriteFrames/weapon/Weapon0014.tres";
|
||||
public const string resource_spriteFrames_weapon_Weapon0004_hit_tres = "res://resource/spriteFrames/weapon/Weapon0004_hit.tres";
|
||||
|
@ -231,11 +202,13 @@ public class ResourcePath
|
|||
public const string resource_config_LiquidMaterial_json = "res://resource/config/LiquidMaterial.json";
|
||||
public const string resource_config_ActivityBase_json = "res://resource/config/ActivityBase.json";
|
||||
public const string resource_config_EnemyBase_json = "res://resource/config/EnemyBase.json";
|
||||
public const string resource_config_ActivePropBase_json = "res://resource/config/ActivePropBase.json";
|
||||
public const string resource_config_BulletBase_json = "res://resource/config/BulletBase.json";
|
||||
public const string resource_config_AiAttackAttr_json = "res://resource/config/AiAttackAttr.json";
|
||||
public const string resource_config_ActivityMaterial_json = "res://resource/config/ActivityMaterial.json";
|
||||
public const string resource_config_WeaponBase_json = "res://resource/config/WeaponBase.json";
|
||||
public const string resource_config_Sound_json = "res://resource/config/Sound.json";
|
||||
public const string resource_config_BuffPropBase_json = "res://resource/config/BuffPropBase.json";
|
||||
public const string resource_navigation_NavigationPolygon_tres = "res://resource/navigation/NavigationPolygon.tres";
|
||||
public const string resource_curve_Curve1_tres = "res://resource/curve/Curve1.tres";
|
||||
public const string resource_theme_theme1_tres = "res://resource/theme/theme1.tres";
|
||||
|
@ -306,7 +279,9 @@ public class ResourcePath
|
|||
public const string resource_sprite_ui_encyclopedia_Item_png = "res://resource/sprite/ui/encyclopedia/Item.png";
|
||||
public const string resource_sprite_ui_encyclopedia_TabSelect_png = "res://resource/sprite/ui/encyclopedia/TabSelect.png";
|
||||
public const string resource_sprite_ui_encyclopedia_Select_png = "res://resource/sprite/ui/encyclopedia/Select.png";
|
||||
public const string resource_sprite_ui_encyclopedia_CloseSelect_png = "res://resource/sprite/ui/encyclopedia/CloseSelect.png";
|
||||
public const string resource_sprite_ui_encyclopedia_TabIcon1_png = "res://resource/sprite/ui/encyclopedia/TabIcon1.png";
|
||||
public const string resource_sprite_ui_encyclopedia_Close_png = "res://resource/sprite/ui/encyclopedia/Close.png";
|
||||
public const string resource_sprite_ui_mapEditorTools_DoorDragButton_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton.png";
|
||||
public const string resource_sprite_ui_mapEditorTools_DoorDragButton_hover_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png";
|
||||
public const string resource_sprite_ui_mapEditorTools_DoorDragButton_down_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton_down.png";
|
||||
|
@ -330,6 +305,8 @@ public class ResourcePath
|
|||
public const string resource_sprite_prop_buff_BuffProp0001export_png = "res://resource/sprite/prop/buff/BuffProp0001-export.png";
|
||||
public const string resource_sprite_prop_active_ActiveProp5001_png = "res://resource/sprite/prop/active/ActiveProp5001.png";
|
||||
public const string resource_sprite_prop_active_ActiveProp5000_png = "res://resource/sprite/prop/active/ActiveProp5000.png";
|
||||
public const string resource_sprite_prop_active_ActiveProp5002_png = "res://resource/sprite/prop/active/ActiveProp5002.png";
|
||||
public const string resource_sprite_prop_active_ActiveProp5003_png = "res://resource/sprite/prop/active/ActiveProp5003.png";
|
||||
public const string resource_sprite_weapon_weapon0014_Weapon0014_png = "res://resource/sprite/weapon/weapon0014/Weapon0014.png";
|
||||
public const string resource_sprite_weapon_weapon0013_weapon0014export_png = "res://resource/sprite/weapon/weapon0013/weapon0014-export.png";
|
||||
public const string resource_sprite_weapon_weapon0013_weapon0014_png = "res://resource/sprite/weapon/weapon0013/weapon0014.png";
|
||||
|
|
Loading…
Reference in New Issue
Block a user