From f313240400cddb47ba582c592e59cfbd36ae9d2b Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Sun, 6 Oct 2024 16:10:00 +0800 Subject: [PATCH] =?UTF-8?q?The=20discharge=20certificate=20will=20no=20lon?= =?UTF-8?q?ger=20be=20deducted.=20=E7=A6=BB=E8=81=8C=E8=AF=81=E6=98=8E?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=8C=81=E7=BB=AD=E6=89=A3=E8=A1=80=E4=BA=86?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prefab/items/resignationCertificate.tscn | 1 + scripts/inventory/ResignationCertificate.cs | 7 +++---- scripts/pickable/PickAbleTemplate.cs | 2 +- scripts/spell/SpellPickAble.cs | 10 ++++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/prefab/items/resignationCertificate.tscn b/prefab/items/resignationCertificate.tscn index a5c5197..99a037a 100644 --- a/prefab/items/resignationCertificate.tscn +++ b/prefab/items/resignationCertificate.tscn @@ -17,6 +17,7 @@ collision_layer = 8 collision_mask = 34 angular_damp = -1.0 script = ExtResource("1_nydte") +FiringIntervalAsMillisecond = 1000 [node name="DamageArea2D" type="Area2D" parent="."] collision_layer = 8 diff --git a/scripts/inventory/ResignationCertificate.cs b/scripts/inventory/ResignationCertificate.cs index 95566c6..67c7c64 100644 --- a/scripts/inventory/ResignationCertificate.cs +++ b/scripts/inventory/ResignationCertificate.cs @@ -1,6 +1,6 @@ using ColdMint.scripts.character; using ColdMint.scripts.damage; -using ColdMint.scripts.pickable; +using ColdMint.scripts.weapon; using Godot; namespace ColdMint.scripts.inventory; @@ -9,13 +9,12 @@ namespace ColdMint.scripts.inventory; /// ResignationCertificate /// 离职证明 /// -public partial class ResignationCertificate : PickAbleTemplate +public partial class ResignationCertificate : WeaponTemplate { private readonly Damage _damage = new() { MaxDamage = 1, MinDamage = 1, - CriticalStrikeProbability = 100, Type = Config.DamageType.Magic }; @@ -30,7 +29,7 @@ public partial class ResignationCertificate : PickAbleTemplate { get => Config.ItemType.Item; } - public override bool Use(Node2D? owner, Vector2 targetGlobalPosition) + protected override bool DoFire(Node2D? owner, Vector2 enemyGlobalPosition) { if (Owner is CharacterTemplate characterTemplate) { diff --git a/scripts/pickable/PickAbleTemplate.cs b/scripts/pickable/PickAbleTemplate.cs index 93a1ac3..0ae4099 100644 --- a/scripts/pickable/PickAbleTemplate.cs +++ b/scripts/pickable/PickAbleTemplate.cs @@ -57,7 +57,7 @@ public partial class PickAbleTemplate : RigidBody2D, IItem /// Enabled contact injury /// 启用接触伤害 /// - public bool EnableContactInjury; + public virtual bool EnableContactInjury { get; set; } [Export] private int _minContactInjury = 1; [Export] private int _maxContactInjury = 2; diff --git a/scripts/spell/SpellPickAble.cs b/scripts/spell/SpellPickAble.cs index 441d199..252d5f0 100644 --- a/scripts/spell/SpellPickAble.cs +++ b/scripts/spell/SpellPickAble.cs @@ -18,6 +18,16 @@ public partial class SpellPickAble : PickAbleTemplate, ISpell [Export] private string? _projectilePath; + /// + /// Spells do no collision damage + /// 法术没有碰撞伤害 + /// + public override bool EnableContactInjury + { + get => false; + set { } + } + private PackedScene? _projectileScene; public override void _Ready() {