中级玩家
- 贡献度
- 0
- 金元
- 2245
- 积分
- 225
- 精华
- 0
- 注册时间
- 2016-7-18
|
辛苦了 我彻底放弃了 是在弄不懂 只是知道随机三个个人技能 但是不会改成固定的 根本找不到技能的关键词 有没有办法从console commands 入手
比如 teach 命令怎么用 是不是修改这个的呀。
/ Token: 0x06006F5C RID: 28508 RVA: 0x001CC19C File Offset: 0x001CA39C
[ConsoleCommand(Command = "teach", Description = "(ability_def_name) [bool] - teach an ability to the actor under the cursor (true - add to selected equipment, false - add to actor)"
public static void CmdTeachAbility(IConsole console, params string[] args)
{
DefRepository defRepo = GameUtl.GameComponent<DefRepository>();
Func<string> func = () => string.Join(", ", from itDef in defRepo.GetAllDefs<TacticalAbilityDef>()
select itDef.name into itName
orderby itName
select itName);
if (args.Length < 1)
{
throw new ConsoleCommandException("You must specify ability def name. Valid values are: " + func());
}
Level level = GameUtl.CurrentLevel();
TacticalLevelController tacticalLevelController = (level != null) ? level.GetComponent<TacticalLevelController>() : null;
TacticalView tacticalView = (tacticalLevelController != null) ? tacticalLevelController.View : null;
if (tacticalView == null)
{
throw new ConsoleCommandException("This command only works in a tactical level");
}
string abilityId = args[0];
TacticalAbilityDef tacticalAbilityDef = defRepo.GetAllDefs<TacticalAbilityDef>().FirstOrDefault((TacticalAbilityDef itDef) => itDef.name.StartsWith(abilityId, StringComparison.OrdinalIgnoreCase));
if (tacticalAbilityDef == null)
{
throw new ConsoleCommandException("Invalid ability def name: '" + abilityId + "'. Valid values are: " + func());
}
SelectionInfo selectionInfo = tacticalView.SelectAtCursor();
TacticalActor tacticalActor = selectionInfo.Actor as TacticalActor;
if (tacticalActor == null)
{
throw new ConsoleCommandException("No actor under the cursor");
}
if (args.Length < 2 || !Convert.ToBoolean(args[1]))
{
tacticalActor.AddAbility(tacticalAbilityDef, tacticalActor);
console.WriteLine("{0} taught to {1}", new object[]
{
tacticalAbilityDef.name,
tacticalActor.name
});
return;
}
selectionInfo.Actor.AddAbility(tacticalAbilityDef, tacticalActor.Equipments.SelectedEquipment);
console.WriteLine("{0} taught to {1}, via {2}", new object[]
{
tacticalAbilityDef.name,
tacticalActor.name,
tacticalActor.Equipments.SelectedEquipment
});
}
}
} |
|