chore: 地块类型标注 TileType (#15373)

* chore: 地块类型标注 TileType

* chore: tile

* style: format
This commit is contained in:
Status102
2026-01-12 11:01:30 +08:00
committed by GitHub
parent 7154dfde2a
commit 43ad090523
3 changed files with 42 additions and 29 deletions

View File

@@ -54,14 +54,25 @@ bool proc_data(
using TileInfo = asst::TilePack::TileInfo;
static const std::unordered_map<std::string, TileKey> TileKeyMapping = {
{ "tile_forbidden", TileKey::Forbidden }, { "tile_wall", TileKey::Wall },
{ "tile_road", TileKey::Road }, { "tile_end", TileKey::Home },
{ "tile_start", TileKey::EnemyHome }, { "tile_flystart", TileKey::Airport },
{ "tile_floor", TileKey::Floor }, { "tile_hole", TileKey::Hole },
{ "tile_telin", TileKey::Telin }, { "tile_telout", TileKey::Telout },
{ "tile_grass", TileKey::Grass }, { "tile_deepsea", TileKey::DeepSea },
{ "tile_deepwater", TileKey::DeepSea }, { "tile_volcano", TileKey::Volcano },
{ "tile_healing", TileKey::Healing }, { "tile_fence", TileKey::Fence },
{ "tile_forbidden", TileKey::Forbidden },
{ "tile_wall", TileKey::Wall },
{ "tile_road", TileKey::Road },
{ "tile_end", TileKey::Home },
{ "tile_start", TileKey::EnemyHome },
{ "tile_green", TileKey::Green },
{ "tile_flystart", TileKey::Airport },
{ "tile_floor", TileKey::Floor },
{ "tile_hole", TileKey::Hole },
{ "tile_telin", TileKey::Telin },
{ "tile_telout", TileKey::Telout },
{ "tile_grass", TileKey::Grass },
{ "tile_deepsea", TileKey::DeepSea },
{ "tile_deepwater", TileKey::DeepSea },
{ "tile_volcano", TileKey::Volcano },
{ "tile_healing", TileKey::Healing },
{ "tile_fence", TileKey::Fence /* 疑似弃用, 改为 tile_fence_bound */ },
{ "tile_fence_bound", TileKey::Fence },
{ "tile_infection", TileKey::Infection },
};
auto key = TileKey::Invalid;
@@ -70,7 +81,7 @@ bool proc_data(
}
else {
key = TileKey::Invalid;
Log.warn("Unknown tile type:", tile.tileKey);
LogWarn << "Unknown tile type" << loc << ":" << tile.tileKey;
}
dst.emplace(

View File

@@ -24,26 +24,27 @@ public:
Highland = 0,
Floor = 1
};
// clang-format off
enum class TileKey
{
Invalid = -1,
Forbidden, // 不能放干员,敌人也不能走
Wall, // 可以放高台干员的位置
Road, // 可以放地面干员,敌人也可以走
Home, // 门(可能还有其他的情况)
EnemyHome, // 红门(可能还有其他的情况)
Airport, // 无人机始发站
Floor, // 不能放干员,但敌人可以走
Hole, // 空降兵掉下去的地方(
Telin, // 传送门入口
Telout, // 传送门出口
Grass, // 草地,带有隐匿,可以放干员,部分地块敌人可以走
DeepSea, // 水,不能直接放干员(要借助泳圈道具),敌人可以走,但敌人会持续掉血
Volcano, // 岩浆地块,可以放干员,敌人也可以走,但是会持续掉血
Healing, // 治疗地块,可以放干员,敌人也可以走,会给干员回血
Fence, // 敌人不会走,但可以放干员的地面位置
}; // clang-format on
enum class TileKey
{
Invalid = -1,
Forbidden, // 不能放干员,敌人也不能走
Wall, // 可以放高台干员的位置
Road, // 可以放地面干员,敌人也可以走
Home, // 蓝门(可能还有其他的情况)
EnemyHome, // 门(可能还有其他的情况)
Green, // 绿门, 怪从绿门进入之后, 在后续阶段出现, 常见于引航者试炼
Airport, // 无人机始发站
Floor, // 不能放干员,但敌人可以走
Hole, // 空降兵掉下去的地方(
Telin, // 传送门入口
Telout, // 传送门出口
Grass, // 草地,带有隐匿,可以放干员,部分地块敌人可以走
DeepSea, // 水,不能直接放干员(要借助泳圈道具),敌人可以走,但敌人会持续掉血
Volcano, // 岩浆地块,可以放干员,敌人也可以走,但是会持续掉血
Healing, // 治疗地块,可以放干员,敌人也可以走,会给干员回血
Fence, // 敌人不会走,但可以放干员的地面位置
Infection, // 源石地板, 可以放干员,敌人也可以走,但是会持续掉血, 且攻击力增加
};
struct TileInfo
{

View File

@@ -1087,6 +1087,7 @@ asst::RoguelikeBattleTaskPlugin::DirectionAndScore asst::RoguelikeBattleTaskPlug
{ TileKey::Telin, 700 }, { TileKey::Telout, 800 }, { TileKey::Grass, 500 },
{ TileKey::DeepSea, 1000 }, { TileKey::Volcano, 1000 }, { TileKey::Healing, 1000 },
{ TileKey::Fence, 800 },
// Todo: TileKey::Green, TileKey::Infection
};
// 治疗干员朝向的权重
static const std::unordered_map<TileKey, int> TileKeyMedicWeights = {