# PredictionInput
# 说明
用于配置和设置技能预测参数的结构体,包含技能的各种属性,用于计算最佳施放位置。
# 如何使用
// 创建预测输入参数
PredictionInput input;
input.Unit = target; // 目标英雄
input.Delay = 0.25f; // 技能释放延迟
input.Speed = 1600.f; // 技能飞行速度
input.Radius = 60.f; // 技能宽度/半径
input.Range = 1000.f; // 技能最大射程
input.Type = eSkillshotType::SkillshotLine; // 直线技能
// 设置起始位置(默认为玩家位置)
input.From_Set(ObjectManager::Player()->Position());
// 设置是否考虑碰撞
input.Collision = true;
input.CollisionObjects = { eCollisionableObjects::Minions, eCollisionableObjects::YasuoWall };
// 设置是否为AOE技能
input.Aoe = false;
// 设置是否考虑目标碰撞盒
input.AddHitBox = true;
// 使用Prediction类进行预测
PredictionOutput output = Prediction::GetPrediction(input);
// 检查预测结果命中率
if (output.Hitchance >= eHitChance::High)
{
// 在预测位置施放技能
ObjectManager::Player()->CastSpell(eSpellSlot::Q, output.CastPosition());
}
# Properties
属性名 | 类型 | 描述 |
---|---|---|
Aoe | bool | 是否为AOE技能 |
Collision | bool | 是否考虑碰撞 |
CollisionObjects | std::vector<eCollisionableObjects> | 碰撞检测的对象类型 |
Delay | float | 技能释放延迟(秒) |
Radius | float | 技能影响半径 |
Range | float | 技能最大射程 |
Speed | float | 技能飞行速度 |
Type | eSkillshotType | 技能类型(直线、圆形、锥形) |
Unit | AIBaseClient* | 预测目标单位 |
AddHitBox | bool | 是否考虑目标的碰撞盒 |
# 方法
方法名 | 返回类型 | 描述 |
---|---|---|
From() | Vector | 获取技能施放起始位置 |
From_Set(Vector const& value) | void | 设置技能施放起始位置 |
RangeCheckFrom() | Vector | 获取射程检查起始位置 |
RangeCheckFrom_Set(Vector const& value) | void | 设置射程检查起始位置 |
RealRadius() | float | 获取考虑目标碰撞盒的实际半径 |