The world will be generated automatically after the player dies.
玩家死亡之后会自动生成世界了。
This commit is contained in:
parent
9352f2c32b
commit
6807064bd8
|
@ -71,6 +71,7 @@ log_weapon_not_in_pickup_range,武器不在拾取范围内。,The weapon is not
|
||||||
log_weapon_picked_up,武器被拾取。,Weapon picked up.,武器が拾い取られました。
|
log_weapon_picked_up,武器被拾取。,Weapon picked up.,武器が拾い取られました。
|
||||||
log_weapon_pickup_failed,武器拾取失败。,Weapon pickup failed.,武器の拾い取りに失敗しました。
|
log_weapon_pickup_failed,武器拾取失败。,Weapon pickup failed.,武器の拾い取りに失敗しました。
|
||||||
log_enter_the_picking_range_body,进入拾取范围。,Enter the picking range.,拾い取り範囲に入ります。
|
log_enter_the_picking_range_body,进入拾取范围。,Enter the picking range.,拾い取り範囲に入ります。
|
||||||
|
log_exit_the_picking_range_body,退出拾取范围。,Exit the picking range.,ピックアップ範囲から外します。
|
||||||
log_search_for_weapon_timeout,搜索武器超时。,Search for weapon timeout.,武器の検索がタイムアウトしました。
|
log_search_for_weapon_timeout,搜索武器超时。,Search for weapon timeout.,武器の検索がタイムアウトしました。
|
||||||
log_initialize_the_context,初始化上下文环境。,Initialize the context environment.,コンテキスト環境を初期化します。
|
log_initialize_the_context,初始化上下文环境。,Initialize the context environment.,コンテキスト環境を初期化します。
|
||||||
log_initialize_the_context_failed,初始化上下文环境失败。,Initialize the context environment failed.,コンテキスト環境の初期化に失敗しました。
|
log_initialize_the_context_failed,初始化上下文环境失败。,Initialize the context environment failed.,コンテキスト環境の初期化に失敗しました。
|
||||||
|
@ -124,4 +125,5 @@ log_placement_position_is_empty,房间{0}放置位置为空。,The room {0} posi
|
||||||
log_parameter_inconsistency,参数不齐。,Parameter inconsistency.,パラメーターが不揃いです。
|
log_parameter_inconsistency,参数不齐。,Parameter inconsistency.,パラメーターが不揃いです。
|
||||||
log_room_slot_position_is_empty,房间位置描述为空。,Room location is described as empty.,部屋の位置は空です。
|
log_room_slot_position_is_empty,房间位置描述为空。,Room location is described as empty.,部屋の位置は空です。
|
||||||
log_room_overlap,房间重叠。,The rooms overlap.,部屋が重なります。
|
log_room_overlap,房间重叠。,The rooms overlap.,部屋が重なります。
|
||||||
log_game_over_event_is_empty,游戏结束事件为空。,End of game event is empty.,ゲームオーバーでイベントは空です。
|
log_game_over_event_is_empty,游戏结束事件为空。,End of game event is empty.,ゲームオーバーでイベントは空です。
|
||||||
|
log_cannot_resurrect_non_existent_player,不能复活不存在的玩家。,Cannot resurrect non-existent players.,存在しないプレイヤーを復活させることはできません。
|
|
|
@ -35,6 +35,7 @@ ui_translator,翻译,translator,翻訳
|
||||||
ui_unordered_list_tip,排名不分先后,Ranking is not in order,順位は関係ありません
|
ui_unordered_list_tip,排名不分先后,Ranking is not in order,順位は関係ありません
|
||||||
ui_loading,正在加载...,Loading...,読み込み中...
|
ui_loading,正在加载...,Loading...,読み込み中...
|
||||||
ui_spell_editor,法术编辑器,Spell editor,スペルエディター
|
ui_spell_editor,法术编辑器,Spell editor,スペルエディター
|
||||||
|
ui_rebuild_the_world,正在重新构建世界...,Is reconstructing the world...,世界を再構築しています…
|
||||||
ui_tutorial_spellEditor,按E捡起地上的武器,\n法杖需要搭配法术使用,\n靠近工作台,\n鼠标左键使用工作台。\n鼠标左键拖动物品,\n以实现在不同的容器之间移动它们。,"Press E to pick up the weapon on the ground, \nthe wand needs to be used with the spell, \nclose to the workbench, \nthe left mouse button to use the workbench.\nDrag items with the left mouse button \nto move them between different containers.",Eを押して地面の武器を拾い上げます。\n杖は魔法と組み合わせて使います。\n作業台に近づいて、\nマウスの左ボタンで作業台を使います。\nマウスの左ボタンでモノをドラッグすると、\nさまざまな容器の間を移動できます。
|
ui_tutorial_spellEditor,按E捡起地上的武器,\n法杖需要搭配法术使用,\n靠近工作台,\n鼠标左键使用工作台。\n鼠标左键拖动物品,\n以实现在不同的容器之间移动它们。,"Press E to pick up the weapon on the ground, \nthe wand needs to be used with the spell, \nclose to the workbench, \nthe left mouse button to use the workbench.\nDrag items with the left mouse button \nto move them between different containers.",Eを押して地面の武器を拾い上げます。\n杖は魔法と組み合わせて使います。\n作業台に近づいて、\nマウスの左ボタンで作業台を使います。\nマウスの左ボタンでモノをドラッグすると、\nさまざまな容器の間を移動できます。
|
||||||
ui_tutorial_break_box,鼠标左键使用武器打破箱子->,"Use the left mouse button to \nbreak the box with the weapon->",マウスの左ボタンで箱を破ります->
|
ui_tutorial_break_box,鼠标左键使用武器打破箱子->,"Use the left mouse button to \nbreak the box with the weapon->",マウスの左ボタンで箱を破ります->
|
||||||
ui_tutorial_jump_onto_platform,W跳上平台,\nS从平台上跳下。,"W jumps onto the platform, \nS jumps off the platform.",Wは踊り場に、\nSは踊り場に飛び降りるのです。
|
ui_tutorial_jump_onto_platform,W跳上平台,\nS从平台上跳下。,"W jumps onto the platform, \nS jumps off the platform.",Wは踊り場に、\nSは踊り場に飛び降りるのです。
|
||||||
|
|
|
|
@ -36,10 +36,8 @@ script = ExtResource("1_ubaid")
|
||||||
InitWeaponId = "staff_necromancy"
|
InitWeaponId = "staff_necromancy"
|
||||||
CharacterName = "character_evil_crow"
|
CharacterName = "character_evil_crow"
|
||||||
CanMutateAfterDeath = false
|
CanMutateAfterDeath = false
|
||||||
_initialHp = null
|
|
||||||
MaxHp = 50
|
MaxHp = 50
|
||||||
CampId = "Mazoku"
|
CampId = "Mazoku"
|
||||||
LootListId = null
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2(2, 10)
|
position = Vector2(2, 10)
|
||||||
|
|
|
@ -63,6 +63,9 @@ mouse_filter = 2
|
||||||
theme_override_constants/margin_top = 10
|
theme_override_constants/margin_top = 10
|
||||||
theme_override_constants/margin_bottom = 150
|
theme_override_constants/margin_bottom = 150
|
||||||
|
|
||||||
[node name="RestartButton" type="Button" parent="CenterContainer/VBoxContainer/MarginContainer2"]
|
[node name="CenterContainer" type="CenterContainer" parent="CenterContainer/VBoxContainer/MarginContainer2"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "ui_restart"
|
|
||||||
|
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/MarginContainer2/CenterContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "ui_rebuild_the_world"
|
||||||
|
|
|
@ -276,7 +276,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
base._Ready();
|
base._Ready();
|
||||||
PickingRangeBodiesList = new List<Node>();
|
PickingRangeBodiesList = [];
|
||||||
|
|
||||||
if (MaxHp <= 0)
|
if (MaxHp <= 0)
|
||||||
{
|
{
|
||||||
|
@ -693,6 +693,7 @@ public partial class CharacterTemplate : CharacterBody2D
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LogCat.Log("exit_the_picking_range_body");
|
||||||
PickingRangeBodiesList?.Remove(node);
|
PickingRangeBodiesList?.Remove(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -340,28 +340,8 @@ public class UniversalItemContainer(int totalCapacity) : IItemContainer
|
||||||
{
|
{
|
||||||
foreach (var itemDictionaryKey in _itemDictionary.Keys)
|
foreach (var itemDictionaryKey in _itemDictionary.Keys)
|
||||||
{
|
{
|
||||||
var item = _itemDictionary[itemDictionaryKey];
|
ClearItem(itemDictionaryKey);
|
||||||
item.QueueFreeSelf();
|
|
||||||
ItemDataChangeEvent?.Invoke(new ItemDataChangeEvent
|
|
||||||
{
|
|
||||||
NewItem = null,
|
|
||||||
NewIndex = itemDictionaryKey,
|
|
||||||
OldIndex = itemDictionaryKey,
|
|
||||||
OldItem = null,
|
|
||||||
Type = Config.ItemDataChangeEventType.Clear
|
|
||||||
});
|
|
||||||
if (SupportSelect && itemDictionaryKey == _selectIndex)
|
|
||||||
{
|
|
||||||
SelectedItemChangeEvent?.Invoke(new SelectedItemChangeEvent
|
|
||||||
{
|
|
||||||
NewIndex = itemDictionaryKey,
|
|
||||||
OldIndex = itemDictionaryKey,
|
|
||||||
NewItem = null,
|
|
||||||
OldItem = null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_itemDictionary.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -112,6 +112,8 @@ public partial class GameSceneLoader : SceneLoaderTemplate
|
||||||
NodeUtils.DeleteAllChild(GameSceneDepend.SpellContainer);
|
NodeUtils.DeleteAllChild(GameSceneDepend.SpellContainer);
|
||||||
}
|
}
|
||||||
await GenerateMap();
|
await GenerateMap();
|
||||||
|
var replayEvent = new GameReplayEvent();
|
||||||
|
EventBus.GameReplayEvent?.Invoke(replayEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void _ExitTree()
|
public override void _ExitTree()
|
||||||
|
|
|
@ -10,7 +10,6 @@ namespace ColdMint.scripts.loader.uiLoader;
|
||||||
public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
private Label? _deathInfoLabel;
|
private Label? _deathInfoLabel;
|
||||||
private Button? _restartButton;
|
|
||||||
|
|
||||||
public override void InitializeUi()
|
public override void InitializeUi()
|
||||||
{
|
{
|
||||||
|
@ -19,23 +18,19 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
||||||
|
|
||||||
public override void InitializeData()
|
public override void InitializeData()
|
||||||
{
|
{
|
||||||
_restartButton = GetNodeOrNull<Button>("CenterContainer/VBoxContainer/MarginContainer2/RestartButton");
|
|
||||||
_deathInfoLabel =
|
_deathInfoLabel =
|
||||||
GetNode<Label>("CenterContainer/VBoxContainer/MarginContainer/CenterContainer2/DeathInfoLabel");
|
GetNode<Label>("CenterContainer/VBoxContainer/MarginContainer/CenterContainer2/DeathInfoLabel");
|
||||||
EventBus.GameOverEvent += OnGameOver;
|
EventBus.GameOverEvent += OnGameOver;
|
||||||
|
EventBus.GameReplayEvent += OnGameReplayEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGameReplayEvent(GameReplayEvent obj)
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadUiActions()
|
public override void LoadUiActions()
|
||||||
{
|
{
|
||||||
if (_restartButton != null)
|
|
||||||
{
|
|
||||||
_restartButton.Pressed += () =>
|
|
||||||
{
|
|
||||||
var replayEvent = new GameReplayEvent();
|
|
||||||
EventBus.GameReplayEvent?.Invoke(replayEvent);
|
|
||||||
Hide();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGameOver(GameOverEvent gameOverEvent)
|
private void OnGameOver(GameOverEvent gameOverEvent)
|
||||||
|
@ -53,5 +48,6 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
|
||||||
{
|
{
|
||||||
base._ExitTree();
|
base._ExitTree();
|
||||||
EventBus.GameOverEvent -= OnGameOver;
|
EventBus.GameOverEvent -= OnGameOver;
|
||||||
|
EventBus.GameReplayEvent -= OnGameReplayEvent;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,13 +31,13 @@ public partial class PlayerSpawn : Marker2D, ISpawnMarker
|
||||||
|
|
||||||
private void GameReplayEvent(GameReplayEvent gameReplayEvent)
|
private void GameReplayEvent(GameReplayEvent gameReplayEvent)
|
||||||
{
|
{
|
||||||
if (GameSceneDepend.Player != null)
|
if (GameSceneDepend.Player == null)
|
||||||
{
|
{
|
||||||
GameSceneDepend.Player.FullHpRevive();
|
LogCat.LogError("cannot_resurrect_non_existent_player");
|
||||||
GameSceneDepend.Player.GlobalPosition = GlobalPosition;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Spawn(PlayerWaveNumber);
|
GameSceneDepend.Player.GlobalPosition = GlobalPosition;
|
||||||
|
GameSceneDepend.Player.FullHpRevive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user