Compare commits
No commits in common. "05763c25b1fca8780edc1d2ee738a546959782a6" and "5ca995d689985ebe41135be82575d233cdd7b140" have entirely different histories.
05763c25b1
...
5ca995d689
|
@ -1,5 +1,5 @@
|
||||||
id,zh,en,ja
|
id,zh,en,jp
|
||||||
#suicide
|
#kill self
|
||||||
#自杀
|
#自杀
|
||||||
death_info_self_1,{0}误伤了自己。,{0} accidentally shot themself.,{0}誤って自分を傷つけました。
|
death_info_self_1,{0}误伤了自己。,{0} accidentally shot himself.,{0}誤って自分を傷つけました。
|
||||||
death_info_self_2,{0}忘记了瞄准。,{0} forgot to aim.,{0}照準を忘れました。
|
death_info_self_2,{0}忘记了瞄准。,{0} forgot to aim.,{0}照準を忘れました。
|
|
|
@ -6,10 +6,10 @@ uid="uid://dwx0hwuy0uqio"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation"]
|
files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.jp.translation"]
|
||||||
|
|
||||||
source_file="res://locals/DeathInfo.csv"
|
source_file="res://locals/DeathInfo.csv"
|
||||||
dest_files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation"]
|
dest_files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.jp.translation"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +1,2 @@
|
||||||
id,zh,en,ja
|
id,zh,en,jp
|
||||||
Left Mouse Button,鼠标左键,Left Mouse Button,マウスの左ボタンです
|
Left Mouse Button,鼠标左键,Left Mouse Button,マウスの左ボタンです
|
|
|
@ -6,10 +6,10 @@ uid="uid://dvvc7sup2d2ii"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation"]
|
files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.jp.translation"]
|
||||||
|
|
||||||
source_file="res://locals/InputMapping.csv"
|
source_file="res://locals/InputMapping.csv"
|
||||||
dest_files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation"]
|
dest_files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.jp.translation"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
BIN
locals/InputMapping.jp.translation
Normal file
BIN
locals/InputMapping.jp.translation
Normal file
Binary file not shown.
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
id,zh,en,ja
|
id,zh,en,jp
|
||||||
map_generator_is_running,地图生成器正在运行中,请稍后重试。,"Map Generator is running, please try again later.",マップ生成器が動作中ですので、後ほどリトライしてください。
|
map_generator_is_running,地图生成器正在运行中,请稍后重试。,"Map Generator is running, please try again later.",マップ生成器が動作中ですので、後ほどリトライしてください。
|
||||||
missing_parameters,缺少参数。,Missing parameters.,パラメータが不足しています。
|
missing_parameters,缺少参数。,Missing parameters.,パラメータが不足しています。
|
||||||
room_root_node_must_be_node2d,房间根节点必须是 Node2D。,Room root node must be an instance of Node2D.,ルートノードはNode2Dでなければなりません。
|
room_root_node_must_be_node2d,房间根节点必须是 Node2D。,Room root node must be Node2D.,ルートノードはNode2Dでなければなりません。
|
||||||
width_or_height_of_room_slot_must_be_1,房间槽的宽度或高度必须为1。,The width or height of the room slot must be 1.,部屋の溝の幅または高さは1でなければなりません。
|
width_or_height_of_room_slot_must_be_1,房间槽的宽度或高度必须为1。,The width or height of the room slot must be 1.,部屋の溝の幅または高さは1でなければなりません。
|
||||||
connected_room_timeout,连接房间超时。,Timeout when connecting rooms.,接続部屋はタイムアウトです。
|
connected_room_timeout,连接房间超时。,Connecting the room timed out.,接続部屋はタイムアウトです。
|
||||||
projectiles_is_empty,未设置抛射体。,The projectile is not set.,射出体は設置されていません。
|
projectiles_is_empty,未设置抛射体。,The projectile is not set.,射出体は設置されていません。
|
||||||
map_generator_missing_parameters,地图生成器缺少参数。,Map generator missing parameters.,マップジェネレータが不足しています。
|
map_generator_missing_parameters,地图生成器缺少参数。,Map generator missing parameters.,マップジェネレータが不足しています。
|
||||||
map_generator_attempts_to_parse_empty_layout_diagrams,地图生成器尝试解析空的布局图。,Map generator attempts to parse empty layout diagrams.,マップジェネレータは空のレイアウト図を解析しようとしています。
|
map_generator_attempts_to_parse_empty_layout_diagrams,地图生成器尝试解析空的布局图。,Map generator attempts to parse empty layout diagrams.,マップジェネレータは空のレイアウト図を解析しようとしています。
|
||||||
|
@ -11,7 +11,7 @@ map_generator_has_no_starting_room_data,地图生成器没有起点房间数据
|
||||||
room_placement_strategy_terminates_map_generation,房间的放置策略终止了地图生成。,The room placement strategy terminates map generation.,部屋の配置ポリシーはマップ作成を終了します。
|
room_placement_strategy_terminates_map_generation,房间的放置策略终止了地图生成。,The room placement strategy terminates map generation.,部屋の配置ポリシーはマップ作成を終了します。
|
||||||
start_room_placement_information_returns_empty,起始房间放置信息返回空。,Start room placement information returns empty.,スタートルーム放置情報は空に戻ります。
|
start_room_placement_information_returns_empty,起始房间放置信息返回空。,Start room placement information returns empty.,スタートルーム放置情報は空に戻ります。
|
||||||
start_room_placement_failed,起始房间放置失败。,Start room placement failed.,スタートルーム放置失敗です。
|
start_room_placement_failed,起始房间放置失败。,Start room placement failed.,スタートルーム放置失敗です。
|
||||||
room_data_missing,房间数据缺失。,Missing room data.,部屋データが欠落しています。
|
room_data_missing,房间数据缺失。,Room data missing.,部屋データが欠落しています。
|
||||||
failed_to_calculate_the_room_location,计算房间{0}位置时失败。,Failed to calculate the location of room {0}.,部屋{0}の位置を計算するのに失敗します。
|
failed_to_calculate_the_room_location,计算房间{0}位置时失败。,Failed to calculate the location of room {0}.,部屋{0}の位置を計算するのに失敗します。
|
||||||
place_existing_rooms,放置已存在的房间{0}。,Place existing rooms {0}.,既存の部屋を置きます{0}。
|
place_existing_rooms,放置已存在的房间{0}。,Place existing rooms {0}.,既存の部屋を置きます{0}。
|
||||||
room_placement_failed,房间{0}放置失败。,Room {0} placement failed.,部屋{0}の放置に失敗します。
|
room_placement_failed,房间{0}放置失败。,Room {0} placement failed.,部屋{0}の放置に失敗します。
|
||||||
|
|
|
|
@ -6,10 +6,10 @@ uid="uid://btmjafjh5r6bk"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation"]
|
files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.jp.translation"]
|
||||||
|
|
||||||
source_file="res://locals/Log.csv"
|
source_file="res://locals/Log.csv"
|
||||||
dest_files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation"]
|
dest_files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.jp.translation"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
id,zh,en,ja
|
id,zh,en,jp
|
||||||
product_name,异界旅人,A traveler from another world,異界の旅人です
|
product_name,异界旅人,A traveler from another world,異界の旅人です
|
||||||
start_game,开始游戏,Start game,ゲームを始めます
|
start_game,开始游戏,Start game,ゲームを始めます
|
||||||
settings,设置,Settings,備え付け
|
settings,设置,Settings,備え付け
|
||||||
|
|
|
|
@ -6,10 +6,10 @@ uid="uid://bpdkorm7lprma"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation"]
|
files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.jp.translation"]
|
||||||
|
|
||||||
source_file="res://locals/UI.csv"
|
source_file="res://locals/UI.csv"
|
||||||
dest_files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation"]
|
dest_files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.jp.translation"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +1,3 @@
|
||||||
id,zh,en,ja
|
id,zh,en,jp
|
||||||
staff_of_the_undead,死灵法杖,StaffOfTheUndead,ネクロポリスの杖です
|
staff_of_the_undead,死灵法杖,StaffOfTheUndead,ネクロポリスの杖です
|
||||||
staff_of_the_undead_desc,发射诅咒,可将敌人转化为邪恶的怪物。,Cast a curse that transforms enemies into evil monsters.,呪いを発射して、敵を邪悪な怪物に変えることができます。
|
staff_of_the_undead_desc,发射诅咒,可将敌人转化为邪恶的怪物。,Cast a curse that transforms enemies into evil monsters.,呪いを発射して、敵を邪悪な怪物に変えることができます。
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
importer="csv_translation"
|
importer="csv_translation"
|
||||||
type="Translation"
|
type="Translation"
|
||||||
uid="uid://ci3wou75hhj6e"
|
uid="uid://dmhmjvtquyu16"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.ja.translation"]
|
files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.jp.translation"]
|
||||||
|
|
||||||
source_file="res://locals/Weapon.csv"
|
source_file="res://locals/Weapon.csv"
|
||||||
dest_files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.ja.translation"]
|
dest_files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.jp.translation"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,8 +1,6 @@
|
||||||
id,zh,en,ja
|
id,zh,en,jp
|
||||||
slogan_0,游戏属于每一个人。,The game belongs to everyone.,ゲームはすべての人のものです。
|
slogan_1,游戏属于每一个人。,The game belongs to everyone.,ゲームはすべての人のものです。
|
||||||
slogan_1,如果你想要得到爱,你就播种爱。,"If you want love, you sow love.",愛を手に入れたければ、愛の種をまきます。
|
slogan_2,如果你想要得到爱,你就播种爱。,"If you want love, you sow love.",愛を手に入れたければ、愛の種をまきます。
|
||||||
slogan_2,快乐?伤心?痛苦?,Happy? Sad? Pain?,楽しいですか?悲しいですか?苦しいですか?
|
slogan_3,快乐?伤心?痛苦?,Happy? Sad? Pain?,楽しいですか?悲しいですか?苦しいですか?
|
||||||
slogan_3,Kawaii!,Kawaii!,Kawaii!
|
slogan_4,kaWaYi!,kaWaYi!,kaWaYi!
|
||||||
slogan_4,魔法是想象的世界。,Magic is an imaginary world.,魔法は想像の世界です。
|
slogan_5,魔法是想象的世界。,Magic is an imaginary world.,魔法は想像の世界です。
|
||||||
slogan_5,也试试Minecraft!,Also try Minecraft!,Minecraftもやってみて!
|
|
||||||
slogan_6,也试试Terraria!,Also try Terraria!,Terrariaもやってみて!
|
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
importer="csv_translation"
|
importer="csv_translation"
|
||||||
type="Translation"
|
type="Translation"
|
||||||
uid="uid://bgfmprv2sm645"
|
uid="uid://dbgkevd34vb0d"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation"]
|
files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.jp.translation"]
|
||||||
|
|
||||||
source_file="res://locals/Slogan.csv"
|
source_file="res://locals/Slogan.csv"
|
||||||
dest_files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation"]
|
dest_files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.jp.translation"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
Binary file not shown.
BIN
locals/slogan.jp.translation
Normal file
BIN
locals/slogan.jp.translation
Normal file
Binary file not shown.
Binary file not shown.
|
@ -45,18 +45,3 @@ script = ExtResource("2_6p8mv")
|
||||||
|
|
||||||
[node name="StaffOfTheUndead" parent="." instance=ExtResource("3_ud0w8")]
|
[node name="StaffOfTheUndead" parent="." instance=ExtResource("3_ud0w8")]
|
||||||
position = Vector2(231, 116)
|
position = Vector2(231, 116)
|
||||||
|
|
||||||
[node name="StaffOfTheUndead2" parent="." instance=ExtResource("3_ud0w8")]
|
|
||||||
position = Vector2(113, 149)
|
|
||||||
|
|
||||||
[node name="StaffOfTheUndead5" parent="." instance=ExtResource("3_ud0w8")]
|
|
||||||
position = Vector2(213, 177)
|
|
||||||
|
|
||||||
[node name="StaffOfTheUndead6" parent="." instance=ExtResource("3_ud0w8")]
|
|
||||||
position = Vector2(290, 167)
|
|
||||||
|
|
||||||
[node name="StaffOfTheUndead3" parent="." instance=ExtResource("3_ud0w8")]
|
|
||||||
position = Vector2(70, 88)
|
|
||||||
|
|
||||||
[node name="StaffOfTheUndead4" parent="." instance=ExtResource("3_ud0w8")]
|
|
||||||
position = Vector2(367, 85)
|
|
||||||
|
|
|
@ -146,8 +146,7 @@ hotbar_previous={
|
||||||
|
|
||||||
[internationalization]
|
[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/Weapon.en.translation", "res://locals/Weapon.ja.translation", "res://locals/Weapon.zh.translation")
|
locale/translations=PackedStringArray("res://locals/UI.en.translation", "res://locals/UI.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.zh.translation", "res://locals/InputMapping.jp.translation", "res://locals/Log.jp.translation", "res://locals/UI.jp.translation", "res://locals/Weapon.jp.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.jp.translation", "res://locals/Slogan.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.jp.translation", "res://locals/DeathInfo.zh.translation")
|
||||||
locale/test="ja"
|
|
||||||
|
|
||||||
[layer_names]
|
[layer_names]
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ layout_mode = 2
|
||||||
|
|
||||||
[node name="GodotLabel" type="Label" parent="VBoxContainer2/HBoxContainer"]
|
[node name="GodotLabel" type="Label" parent="VBoxContainer2/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Powered by"
|
text = "Power by"
|
||||||
horizontal_alignment = 2
|
horizontal_alignment = 2
|
||||||
|
|
||||||
[node name="LinkButton" type="LinkButton" parent="VBoxContainer2/HBoxContainer"]
|
[node name="LinkButton" type="LinkButton" parent="VBoxContainer2/HBoxContainer"]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using ColdMint.scripts.utils;
|
using ColdMint.scripts.utils;
|
||||||
|
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace ColdMint.scripts;
|
namespace ColdMint.scripts;
|
||||||
|
@ -10,15 +9,7 @@ namespace ColdMint.scripts;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class SloganProvider
|
public static class SloganProvider
|
||||||
{
|
{
|
||||||
static SloganProvider()
|
private const int MaxSloganIndex = 5;
|
||||||
{
|
|
||||||
// Calculate SloganCount From translation file
|
|
||||||
// 从翻译文件中计算口号计数
|
|
||||||
var sloganTrans = ResourceLoader.Load<OptimizedTranslation>("res://locals/Slogan.en.translation")!;
|
|
||||||
SloganCount = sloganTrans.GetTranslatedMessageList().Length;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int SloganCount { get; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -28,7 +19,7 @@ public static class SloganProvider
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string? GetSlogan()
|
public static string? GetSlogan()
|
||||||
{
|
{
|
||||||
var index = GD.Randi() % SloganCount;
|
var index = GD.Randi() % MaxSloganIndex + 1;
|
||||||
return TranslationServerUtils.Translate($"slogan_{index}");
|
return TranslationServerUtils.Translate("slogan_" + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -151,7 +151,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
//Check whether the new Hp is greater than the maximum Hp. If yes, set the current Hp to the maximum Hp. If no, set the current Hp to the new HP
|
//Check whether the new Hp is greater than the maximum Hp. If yes, set the current Hp to the maximum Hp. If no, set the current Hp to the new HP
|
||||||
//判断新的Hp是否大于最大Hp,若大于那么将当前Hp设置为最大Hp,否则设置为新的Hp
|
//判断新的Hp是否大于最大Hp,若大于那么将当前Hp设置为最大Hp,否则设置为新的Hp
|
||||||
CurrentHp = newHp > MaxHp ? MaxHp : newHp;
|
CurrentHp = newHp > MaxHp ? MaxHp : newHp;
|
||||||
Show();
|
Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -318,7 +318,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pickAbleItem.Hide();
|
pickAbleItem.Visible = false;
|
||||||
pickAbleItem.ProcessMode = ProcessModeEnum.Disabled;
|
pickAbleItem.ProcessMode = ProcessModeEnum.Disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
var timeSpan = DateTime.Now - _lastDamageTime;
|
var timeSpan = DateTime.Now - _lastDamageTime;
|
||||||
if (timeSpan > Config.HealthBarDisplaysTime)
|
if (timeSpan > Config.HealthBarDisplaysTime)
|
||||||
{
|
{
|
||||||
_healthBar.Hide();
|
_healthBar.Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_healthBar.Show();
|
_healthBar.Visible = true;
|
||||||
_healthBar.Value = CurrentHp;
|
_healthBar.Value = CurrentHp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +437,6 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
//Character death
|
//Character death
|
||||||
//角色死亡
|
//角色死亡
|
||||||
OnDie(damageTemplate);
|
OnDie(damageTemplate);
|
||||||
ThrowAllItemOnDie();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,44 +528,6 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
_animatedSprite2D.FlipH = FacingLeft;
|
_animatedSprite2D.FlipH = FacingLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <para>Throw all items when the creature dies</para>
|
|
||||||
/// <para>当生物死亡后抛出所有物品</para>
|
|
||||||
/// </summary>
|
|
||||||
private void ThrowAllItemOnDie()
|
|
||||||
{
|
|
||||||
//If the item container is null, then return
|
|
||||||
//如果物品容器为null,那么返回
|
|
||||||
if (_itemContainer == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var len = _itemContainer.GetItemSlotCount();
|
|
||||||
if (len == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CurrentItem = null;
|
|
||||||
const float height = -Config.CellSize * 7;
|
|
||||||
const float horizontalDirection = Config.CellSize * 15;
|
|
||||||
for (var i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
//Generates a random number that controls the horizontal velocity of thrown items (range: 0.01 to 1)
|
|
||||||
//生成一个随机数,用于控制抛出物品的水平方向速度(范围为:0.01到1)
|
|
||||||
var percent = GD.Randf() + 0.01f;
|
|
||||||
if (GD.Randf() > 0.5)
|
|
||||||
{
|
|
||||||
ThrowItem(i, -1, new Vector2(horizontalDirection * percent, height));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ThrowItem(i, -1, new Vector2(-horizontalDirection * percent, height));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>Throw item</para>
|
/// <para>Throw item</para>
|
||||||
/// <para>抛出物品</para>
|
/// <para>抛出物品</para>
|
||||||
|
@ -578,8 +539,6 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
/// <param name="number">
|
/// <param name="number">
|
||||||
/// <para>How many to throw</para>
|
/// <para>How many to throw</para>
|
||||||
/// <para>要扔几个</para>
|
/// <para>要扔几个</para>
|
||||||
/// <para>The amount passed into a negative number will throw all the items in the slot at once.</para>
|
|
||||||
/// <para>数量传入一个负数,将一次扔出槽内的所有物品。</para>
|
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="velocity">
|
/// <param name="velocity">
|
||||||
///<para>The speed to be applied to the item</para>
|
///<para>The speed to be applied to the item</para>
|
||||||
|
@ -603,12 +562,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item is not Node2D node2D)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (item)
|
switch (item)
|
||||||
{
|
{
|
||||||
case WeaponTemplate weaponTemplate:
|
case WeaponTemplate weaponTemplate:
|
||||||
|
@ -617,7 +571,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CallDeferred("WeaponTemplateReparent", weaponTemplate);
|
weaponTemplate.Reparent(GameSceneNodeHolder.WeaponContainer);
|
||||||
var timer = new Timer();
|
var timer = new Timer();
|
||||||
weaponTemplate.AddChild(timer);
|
weaponTemplate.AddChild(timer);
|
||||||
timer.WaitTime = _itemCollisionRecoveryTime;
|
timer.WaitTime = _itemCollisionRecoveryTime;
|
||||||
|
@ -633,17 +587,13 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
};
|
};
|
||||||
timer.Start();
|
timer.Start();
|
||||||
weaponTemplate.Sleeping = false;
|
weaponTemplate.Sleeping = false;
|
||||||
//Setting an initial speed of 0 for items here prevents the problem of throwing items too fast.
|
// weaponTemplate.LinearVelocity = Vector2.Zero;
|
||||||
//在这里给物品设置一个为0的初始速度,可防止扔出物品时速度过快的问题。
|
|
||||||
weaponTemplate.LinearVelocity = Vector2.Zero;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
node2D.ProcessMode = ProcessModeEnum.Inherit;
|
|
||||||
node2D.Show();
|
|
||||||
//We apply force to objects.
|
//We apply force to objects.
|
||||||
//我们给物品施加力。
|
//我们给物品施加力。
|
||||||
switch (node2D)
|
switch (CurrentItem)
|
||||||
{
|
{
|
||||||
case CharacterBody2D characterBody2D:
|
case CharacterBody2D characterBody2D:
|
||||||
characterBody2D.Velocity = velocity;
|
characterBody2D.Velocity = velocity;
|
||||||
|
@ -655,25 +605,9 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
|
|
||||||
//Remove items from the item container
|
//Remove items from the item container
|
||||||
//在物品容器内移除物品
|
//在物品容器内移除物品
|
||||||
if (number < 0)
|
itemSlotNode.RemoveItem(number);
|
||||||
{
|
|
||||||
itemSlotNode.RemoveItem(item.Quantity);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
itemSlotNode.RemoveItem(number);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <para>Replace the parent node of the weapon</para>
|
|
||||||
/// <para>替换武器的父节点</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="weaponTemplate"></param>
|
|
||||||
private void WeaponTemplateReparent(WeaponTemplate weaponTemplate)
|
|
||||||
{
|
|
||||||
weaponTemplate.Reparent(GameSceneNodeHolder.WeaponContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void _PhysicsProcess(double delta)
|
public sealed override void _PhysicsProcess(double delta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -353,15 +353,9 @@ public partial class Player : CharacterTemplate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <para>When the player dies</para>
|
|
||||||
/// <para>当玩家死亡的时候</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="damageTemplate"></param>
|
|
||||||
protected override async Task OnDie(DamageTemplate damageTemplate)
|
protected override async Task OnDie(DamageTemplate damageTemplate)
|
||||||
{
|
{
|
||||||
Hide();
|
Visible = false;
|
||||||
ProcessMode = ProcessModeEnum.Disabled;
|
|
||||||
if (EventManager.GameOverEvent == null)
|
if (EventManager.GameOverEvent == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -97,7 +97,7 @@ public partial class ItemSlotNode : MarginContainer
|
||||||
|
|
||||||
if (_quantityLabel != null)
|
if (_quantityLabel != null)
|
||||||
{
|
{
|
||||||
_quantityLabel.Hide();
|
_quantityLabel.Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,16 +213,16 @@ public partial class ItemSlotNode : MarginContainer
|
||||||
switch (quantity)
|
switch (quantity)
|
||||||
{
|
{
|
||||||
case null:
|
case null:
|
||||||
_quantityLabel.Hide();
|
_quantityLabel.Visible = false;
|
||||||
return;
|
return;
|
||||||
case > 1:
|
case > 1:
|
||||||
//When the quantity is greater than 1, we display the quantity.
|
//When the quantity is greater than 1, we display the quantity.
|
||||||
//当数量大于1时,我们显示数量
|
//当数量大于1时,我们显示数量
|
||||||
_quantityLabel.Text = quantity.ToString();
|
_quantityLabel.Text = quantity.ToString();
|
||||||
_quantityLabel.Show();
|
_quantityLabel.Visible = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_quantityLabel.Hide();
|
_quantityLabel.Visible = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,6 +236,6 @@ public partial class ItemSlotNode : MarginContainer
|
||||||
_iconTextureRect = GetNode<TextureRect>("BackgroundTexture/CenterContainer/IconTextureRect");
|
_iconTextureRect = GetNode<TextureRect>("BackgroundTexture/CenterContainer/IconTextureRect");
|
||||||
_quantityLabel = GetNode<Label>("Control/QuantityLabel");
|
_quantityLabel = GetNode<Label>("Control/QuantityLabel");
|
||||||
_control = GetNode<Control>("Control");
|
_control = GetNode<Control>("Control");
|
||||||
_quantityLabel.Hide();
|
_quantityLabel.Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -15,7 +15,7 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
||||||
|
|
||||||
public override void InitializeUi()
|
public override void InitializeUi()
|
||||||
{
|
{
|
||||||
Hide();
|
Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void InitializeData()
|
public override void InitializeData()
|
||||||
|
@ -34,7 +34,7 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
var replayEvent = new GameReplayEvent();
|
var replayEvent = new GameReplayEvent();
|
||||||
EventManager.GameReplayEvent?.Invoke(replayEvent);
|
EventManager.GameReplayEvent?.Invoke(replayEvent);
|
||||||
Hide();
|
Visible = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Show();
|
Visible = true;
|
||||||
_deathInfoLabel.Text = gameOverEvent.DeathInfo;
|
_deathInfoLabel.Text = gameOverEvent.DeathInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,12 +269,12 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
if (_nodeBinding.GraphEdit != null)
|
if (_nodeBinding.GraphEdit != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.GraphEdit.Hide();
|
_nodeBinding.GraphEdit.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nodeBinding.CreateOrEditorPanel != null)
|
if (_nodeBinding.CreateOrEditorPanel != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.CreateOrEditorPanel.Show();
|
_nodeBinding.CreateOrEditorPanel.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nodeBinding.RoomNameLineEdit != null && _defaultRoomName != null)
|
if (_nodeBinding.RoomNameLineEdit != null && _defaultRoomName != null)
|
||||||
|
@ -301,7 +301,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
|
|
||||||
if (_nodeBinding.HBoxContainer != null)
|
if (_nodeBinding.HBoxContainer != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.HBoxContainer.Hide();
|
_nodeBinding.HBoxContainer.Visible = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
if (_nodeBinding.SaveOrLoadPanel != null)
|
if (_nodeBinding.SaveOrLoadPanel != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.SaveOrLoadPanel.Hide();
|
_nodeBinding.SaveOrLoadPanel.Visible = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
if (_nodeBinding.SaveOrLoadPanel != null)
|
if (_nodeBinding.SaveOrLoadPanel != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.SaveOrLoadPanel.Hide();
|
_nodeBinding.SaveOrLoadPanel.Visible = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
if (_nodeBinding.SaveOrLoadPanel != null)
|
if (_nodeBinding.SaveOrLoadPanel != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.SaveOrLoadPanel.Show();
|
_nodeBinding.SaveOrLoadPanel.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nodeBinding.ActionButton != null)
|
if (_nodeBinding.ActionButton != null)
|
||||||
|
@ -427,7 +427,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
if (_nodeBinding.SaveOrLoadPanel != null)
|
if (_nodeBinding.SaveOrLoadPanel != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.SaveOrLoadPanel.Show();
|
_nodeBinding.SaveOrLoadPanel.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nodeBinding.ActionButton != null)
|
if (_nodeBinding.ActionButton != null)
|
||||||
|
@ -716,17 +716,17 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
if (_nodeBinding.GraphEdit != null)
|
if (_nodeBinding.GraphEdit != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.GraphEdit.Show();
|
_nodeBinding.GraphEdit.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nodeBinding.CreateOrEditorPanel != null)
|
if (_nodeBinding.CreateOrEditorPanel != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.CreateOrEditorPanel.Hide();
|
_nodeBinding.CreateOrEditorPanel.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nodeBinding.HBoxContainer != null)
|
if (_nodeBinding.HBoxContainer != null)
|
||||||
{
|
{
|
||||||
_nodeBinding.HBoxContainer.Show();
|
_nodeBinding.HBoxContainer.Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -25,7 +25,6 @@ public partial class PlayerSpawn : Marker2D
|
||||||
{
|
{
|
||||||
if (GameSceneNodeHolder.Player != null)
|
if (GameSceneNodeHolder.Player != null)
|
||||||
{
|
{
|
||||||
GameSceneNodeHolder.Player.ProcessMode = ProcessModeEnum.Inherit;
|
|
||||||
GameSceneNodeHolder.Player.Position = GlobalPosition;
|
GameSceneNodeHolder.Player.Position = GlobalPosition;
|
||||||
GameSceneNodeHolder.Player.Revive(GameSceneNodeHolder.Player.MaxHp);
|
GameSceneNodeHolder.Player.Revive(GameSceneNodeHolder.Player.MaxHp);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user