Join Mr. Raven.

加入乌鸦先生。
This commit is contained in:
Cold-Mint 2024-08-11 00:25:00 +08:00
parent e10e22e3bd
commit 05ac2dec60
Signed by: Cold-Mint
GPG Key ID: C5A9BF8A98E0CE99
12 changed files with 189 additions and 17 deletions

3
locals/Character.csv Normal file
View File

@ -0,0 +1,3 @@
id,zh,en,ja
character_necromancer,死灵法师,Necromancer,ネクロマンサー
character_evil_crow,邪恶的乌鸦先生,Evil Mr. Raven,悪のミスター・レイヴン
1 id zh en ja
2 character_necromancer 死灵法师 Necromancer ネクロマンサー
3 character_evil_crow 邪恶的乌鸦先生 Evil Mr. Raven 悪のミスター・レイヴン

View File

@ -0,0 +1,17 @@
[remap]
importer="csv_translation"
type="Translation"
uid="uid://dwrygxaehoybb"
[deps]
files=["res://locals/Character.zh.translation", "res://locals/Character.en.translation", "res://locals/Character.ja.translation"]
source_file="res://locals/Character.csv"
dest_files=["res://locals/Character.zh.translation", "res://locals/Character.en.translation", "res://locals/Character.ja.translation"]
[params]
compress=true
delimiter=0

View File

@ -110,3 +110,7 @@ log_dll_does_not_register_lifecycle_processor,位于{0}的dll文件未注册
log_mod_lifecycle_handler_not_implement_interface,位于{0}的dll文件生命周期处理器未实现IModLifecycleHandler接口。,"The DLL file located at {0}, the lifecycle processor does not implement the IModLifecycleHandler interface.",{0}にあるDLLファイル、ライフサイクルプロセッサはIModLifecycleHandlerインターフェースを実装していません。
log_dll_no_parameterless_constructor,位于{0}的dll文件没有无参构造函数。,"The DLL file located at {0} does not have a parameterless constructor.",{0}にあるDLLファイルにはパラメータのないコンストラクタがありません。
log_dll_type_length,位于{0}的dll文件内共包含{1}个类型。,"The DLL file located at {0} contains a total of {1} types.",{0}にあるDLLファイルには合計{1}個のタイプが含まれています。
log_item_pickup_disables_collision_damage,物品捡起禁用碰撞伤害。,Item pickup disables collision damage.,アイテムのピックアップが衝突によるダメージを無効にする
log_item_thrown_restore_collision_damage,物品扔出恢复碰撞伤害。,Item Throw restores collision damage.,アイテム投げは衝突ダメージを回復する。
log_after_no_longer_in_contact_with_any_tiles,不再与任何瓦片接触后,可以造成伤害。,"After no longer coming into contact with any tiles, it can cause damage",タイルと接触しなくなった後、損傷を引き起こす可能性があります。
log_contact_with_tiles_disables_damage,与瓦片接触禁用伤害。,"Disabling damage on contact with tiles",タイルとの接触によるダメージの無効化
1 id zh en ja
110 log_mod_lifecycle_handler_not_implement_interface 位于{0}的dll文件,生命周期处理器未实现IModLifecycleHandler接口。 The DLL file located at {0}, the lifecycle processor does not implement the IModLifecycleHandler interface. {0}にあるDLLファイル、ライフサイクルプロセッサはIModLifecycleHandlerインターフェースを実装していません。
111 log_dll_no_parameterless_constructor 位于{0}的dll文件,没有无参构造函数。 The DLL file located at {0} does not have a parameterless constructor. {0}にあるDLLファイルにはパラメータのないコンストラクタがありません。
112 log_dll_type_length 位于{0}的dll文件内,共包含{1}个类型。 The DLL file located at {0} contains a total of {1} types. {0}にあるDLLファイルには合計{1}個のタイプが含まれています。
113 log_item_pickup_disables_collision_damage 物品捡起禁用碰撞伤害。 Item pickup disables collision damage. アイテムのピックアップが衝突によるダメージを無効にする
114 log_item_thrown_restore_collision_damage 物品扔出恢复碰撞伤害。 Item Throw restores collision damage. アイテム投げは衝突ダメージを回復する。
115 log_after_no_longer_in_contact_with_any_tiles 不再与任何瓦片接触后,可以造成伤害。 After no longer coming into contact with any tiles, it can cause damage タイルと接触しなくなった後、損傷を引き起こす可能性があります。
116 log_contact_with_tiles_disables_damage 与瓦片接触禁用伤害。 Disabling damage on contact with tiles タイルとの接触によるダメージの無効化

View File

@ -0,0 +1,99 @@
[gd_scene load_steps=11 format=3 uid="uid://dxx1vqpecig7i"]
[ext_resource type="Script" path="res://scripts/character/AiCharacter.cs" id="1_ubaid"]
[ext_resource type="Texture2D" uid="uid://c1yxhtiqrfvvp" path="res://sprites/character/BlackenedAboriginalWarrior.png" id="2_pcmq1"]
[ext_resource type="Script" path="res://scripts/damage/DamageNumberNodeSpawn.cs" id="3_kiam3"]
[ext_resource type="PackedScene" uid="uid://sqqfrmikmk5v" path="res://prefab/ui/HealthBar.tscn" id="4_gt388"]
[ext_resource type="Script" path="res://scripts/bubble/BubbleMarker.cs" id="5_y2fh5"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f8frw"]
size = Vector2(40, 46)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_a3myh"]
size = Vector2(46, 65)
[sub_resource type="SpriteFrames" id="SpriteFrames_qumby"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_pcmq1")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_c61vr"]
radius = 153.0
[sub_resource type="CircleShape2D" id="CircleShape2D_fowd5"]
radius = 172.29
[node name="BlackenedAboriginalWarrior" type="CharacterBody2D"]
collision_layer = 64
collision_mask = 38
script = ExtResource("1_ubaid")
CharacterName = "character_evil_crow"
MaxHp = 50
CampId = "Mazoku"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(2, 10)
shape = SubResource("RectangleShape2D_f8frw")
[node name="Area2DPickingArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 8
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2DPickingArea"]
position = Vector2(0, 5.5)
shape = SubResource("RectangleShape2D_a3myh")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_qumby")
[node name="ItemMarker2D" type="Marker2D" parent="."]
position = Vector2(15, 20)
[node name="AttackObstacleDetection" type="RayCast2D" parent="ItemMarker2D"]
collision_mask = 2
[node name="DamageNumber" type="Marker2D" parent="."]
position = Vector2(0, -32)
script = ExtResource("3_kiam3")
[node name="HealthBar" parent="." instance=ExtResource("4_gt388")]
visible = false
offset_left = -46.0
offset_top = 41.0
offset_right = 50.0
offset_bottom = 53.0
[node name="WallDetection" type="RayCast2D" parent="."]
position = Vector2(3, -1)
target_position = Vector2(50, 0)
collision_mask = 6
[node name="AttackArea2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 68
[node name="CollisionShape2D" type="CollisionShape2D" parent="AttackArea2D"]
shape = SubResource("CircleShape2D_c61vr")
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
[node name="BubbleMarker" type="Marker2D" parent="."]
position = Vector2(0, -79)
script = ExtResource("5_y2fh5")
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
position = Vector2(0, 5.5)
scale = Vector2(2.04, 3.05)
[node name="ScoutArea2D" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 76
[node name="CollisionShape2D" type="CollisionShape2D" parent="ScoutArea2D"]
shape = SubResource("CircleShape2D_fowd5")

View File

@ -34,7 +34,7 @@ radius = 172.29
collision_layer = 64
collision_mask = 38
script = ExtResource("1_ubaid")
CharacterName = "死灵法师"
CharacterName = "character_necromancer"
MaxHp = 50
CampId = "Mazoku"
LootListId = "test"

View File

@ -146,7 +146,7 @@ hotbar_previous={
[internationalization]
locale/translations=PackedStringArray("res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation", "res://locals/DeathInfo.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation", "res://locals/InputMapping.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation", "res://locals/Log.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation", "res://locals/Slogan.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation", "res://locals/UI.zh.translation", "res://locals/Item.en.translation", "res://locals/Item.ja.translation", "res://locals/Item.zh.translation", "res://locals/Action.en.translation", "res://locals/Action.ja.translation", "res://locals/Action.zh.translation", "res://locals/Misc.en.translation", "res://locals/Misc.ja.translation", "res://locals/Misc.zh.translation")
locale/translations=PackedStringArray("res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation", "res://locals/DeathInfo.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation", "res://locals/InputMapping.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation", "res://locals/Log.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation", "res://locals/Slogan.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation", "res://locals/UI.zh.translation", "res://locals/Item.en.translation", "res://locals/Item.ja.translation", "res://locals/Item.zh.translation", "res://locals/Action.en.translation", "res://locals/Action.ja.translation", "res://locals/Action.zh.translation", "res://locals/Misc.en.translation", "res://locals/Misc.ja.translation", "res://locals/Misc.zh.translation", "res://locals/Character.en.translation", "res://locals/Character.ja.translation", "res://locals/Character.zh.translation")
[layer_names]

View File

@ -73,10 +73,9 @@ public partial class CharacterTemplate : CharacterBody2D
//物品被扔出后多长时间恢复与地面和平台的碰撞(单位:秒)
private readonly double _itemCollisionRecoveryTime = 0.045f;
public string? ReadOnlyCharacterName => CharacterName;
public string? ReadOnlyCharacterName => TranslationServerUtils.Translate(CharacterName);
[Export]
public string? CharacterName;
[Export] public string? CharacterName;
protected IItemContainer? ProtectedItemContainer;
@ -157,18 +156,15 @@ public partial class CharacterTemplate : CharacterBody2D
//The initial health of the character after creation
//角色创建后的初始血量
[Export]
public int InitialHp;
[Export] public int InitialHp;
[Export]
public int MaxHp;
[Export] public int MaxHp;
/// <summary>
/// <para>The camp ID of the role</para>
/// <para>角色的阵营ID</para>
/// </summary>
[Export]
public string? CampId;
[Export] public string? CampId;
private DamageNumberNodeSpawn? _damageNumber;
@ -248,8 +244,10 @@ public partial class CharacterTemplate : CharacterBody2D
{
continue;
}
weaponTemplates.Add(weaponTemplate);
}
return weaponTemplates.ToArray();
}
@ -385,6 +383,7 @@ public partial class CharacterTemplate : CharacterBody2D
pickAbleTemplate.Picked = true;
pickAbleTemplate.SetCollisionMaskValue(Config.LayerNumber.Platform, false);
pickAbleTemplate.SetCollisionMaskValue(Config.LayerNumber.Ground, false);
LogCat.Log("item_pickup_disables_collision_damage", LogCat.LogLabel.ContactInjury);
pickAbleTemplate.EnableContactInjury = false;
pickAbleTemplate.Sleeping = true;
}
@ -519,6 +518,7 @@ public partial class CharacterTemplate : CharacterBody2D
ThrowAllItemOnDie();
return true;
}
UpDataHealthBar();
return false;
}
@ -751,6 +751,7 @@ public partial class CharacterTemplate : CharacterBody2D
//We cannot immediately resume the physical collision when the weapon is discharged, which will cause the weapon to collide with the ground and platform earlier, preventing the weapon from flying.
//仍出武器时,我们不能立即恢复物理碰撞,立即恢复会导致武器更早的与地面和平台碰撞,阻止武器的飞行。
pickAbleTemplate.EnableContactInjury = true;
LogCat.Log("item_thrown_restore_collision_damage", LogCat.LogLabel.ContactInjury);
pickAbleTemplate.SetCollisionMaskValue(Config.LayerNumber.Ground, true);
pickAbleTemplate.SetCollisionMaskValue(Config.LayerNumber.Platform, true);
timer.QueueFree();

View File

@ -70,6 +70,18 @@ public static class LogCat
/// <para>模组加载器</para>
/// </summary>
public const string ModLoader = "ModLoader";
/// <summary>
/// <para>PickAble Template</para>
/// <para>可拾取物模板</para>
/// </summary>
public const string PickAbleTemplate = "PickAbleTemplate";
/// <summary>
/// <para>ContactInjury</para>
/// <para>物品碰撞伤害</para>
/// </summary>
public const string ContactInjury = "ContactInjury";
}

View File

@ -106,6 +106,7 @@ public partial class PickAbleTemplate : RigidBody2D, IItem
//No longer in contact with any shingles can cause injury
//不再与任何瓦片接触后,可以造成伤害
EnableContactInjury = true;
LogCat.Log("after_no_longer_in_contact_with_any_tiles", LogCat.LogLabel.ContactInjury);
SetCollisionMaskValue(Config.LayerNumber.Player, false);
}
}
@ -127,6 +128,7 @@ public partial class PickAbleTemplate : RigidBody2D, IItem
{
_tileMapNumber++;
EnableContactInjury = false;
LogCat.Log("contact_with_tiles_disables_damage", LogCat.LogLabel.ContactInjury);
//Items can be pushed by the player when they are on the ground
//当物品在地面上时,可被玩家推动
SetCollisionMaskValue(Config.LayerNumber.Player, true);
@ -135,20 +137,20 @@ public partial class PickAbleTemplate : RigidBody2D, IItem
{
if (!EnableContactInjury)
{
LogCat.LogWarning("contact_damage_disabled_during_collision");
LogCat.LogWarning("contact_damage_disabled_during_collision", LogCat.LogLabel.ContactInjury);
return;
}
if (Owner == null)
{
LogCat.LogWarning("item_has_no_owner");
LogCat.LogWarning("item_has_no_owner", LogCat.LogLabel.PickAbleTemplate);
return;
}
if (Owner is not CharacterTemplate ownerCharacterTemplate)
{
LogCat.LogWarning("owner_of_the_item_is_not_character");
LogCat.LogWarning("owner_of_the_item_is_not_character", LogCat.LogLabel.PickAbleTemplate);
return;
}
@ -158,7 +160,7 @@ public partial class PickAbleTemplate : RigidBody2D, IItem
CampManager.GetCamp(characterTemplate.CampId));
if (!canCauseHarm)
{
LogCat.Log("no_damage_between_camps");
LogCat.Log("no_damage_between_camps", LogCat.LogLabel.PickAbleTemplate);
return;
}

View File

@ -69,7 +69,7 @@ public partial class ProjectileWeapon : WeaponTemplate
var nodeSpawnOnKillCharacterDecorator = new NodeSpawnOnKillCharacterDecorator
{
DefaultParentNode = this,
PackedScenePath = "res://prefab/entitys/DelivererOfDarkMagic.tscn"
PackedScenePath = "res://prefab/entitys/BlackenedAboriginalWarrior.tscn"
};
projectile.AddProjectileDecorator(nodeSpawnOnKillCharacterDecorator);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c1yxhtiqrfvvp"
path="res://.godot/imported/BlackenedAboriginalWarrior.png-483f0928238bc97273aa2fd838825f33.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/character/BlackenedAboriginalWarrior.png"
dest_files=["res://.godot/imported/BlackenedAboriginalWarrior.png-483f0928238bc97273aa2fd838825f33.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