本文整理汇总了C#中Players.GetActiveRecruit方法的典型用法代码示例。如果您正苦于以下问题:C# Players.GetActiveRecruit方法的具体用法?C# Players.GetActiveRecruit怎么用?C# Players.GetActiveRecruit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Players
的用法示例。
在下文中一共展示了Players.GetActiveRecruit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartEvolution
public static void StartEvolution(Players.Player player)
{
try {
int speciesNum = player.GetActiveRecruit().Species;
int evoIndex = -1;
List<int> evoToLoad;
for (int z = 0; z < Evolutions.MaxEvos; z++) {
if (Evolutions[z].Species == speciesNum) {
evoIndex = z;
}
}
if (evoIndex == -1) {
Messenger.PlayerMsg(player.Client, "You cannot evolve anymore.", Text.BrightRed);
} else {
evoToLoad = FindViableEvolutions(player.Client, evoIndex);
if (evoToLoad.Count == 0) {
Messenger.PlayerMsg(player.Client, "You do not meet the requirements to evolve.", Text.BrightRed);
} else if (evoToLoad.Count == 1) {
Messenger.AskQuestion(player.Client, "SingleEvolution", "You who seek awakening, you shall evolve into " + Evolutions[evoIndex].Branches[evoToLoad[0]].Name + ". Will you evolve?", -1);
} else {
string[] evochoices = new string[evoToLoad.Count + 1];
for(int i = 0; i < evoToLoad.Count; i++) {
evochoices[i] = Evolutions[evoIndex].Branches[evoToLoad[i]].Name;
}
evochoices[evochoices.Length - 1] = "Cancel";
Messenger.AskQuestion(player.Client, "BranchEvolution", "You who seek awakening, into what do you wish to evolve?", -1, evochoices);
}
/*
if (evoToLoad != -1) {
if (player.GetActiveRecruit().Level >= Evolutions[evoIndex].MinLvl) {
//Classes.ClassManager.ChangePlayerClass(player.Client, Evolutions[evoIndex].SplitEvos[evoToLoad].NewClass);
player.GetActiveRecruit().Sprite = Evolutions[evoIndex].SplitEvos[evoToLoad].NewSprite;
if (!player.GetActiveRecruit().HasMove(Evolutions[evoIndex].SplitEvos[evoToLoad].MoveLearned)) {
player.GetActiveRecruit().LearnNewMove(Evolutions[evoIndex].SplitEvos[evoToLoad].MoveLearned);
Messenger.SendPlayerMoves(player.Client);
Messenger.PlayerMsg(player.Client, "You have learned " + MoveManager.Moves[Evolutions[evoIndex].SplitEvos[evoToLoad].MoveLearned].Name + "!", Text.White);
}
player.TakeItem(Evolutions[evoIndex].SplitEvos[evoToLoad].RequiredItem, 1);
if (player.GetActiveRecruit().Nickname == false) {
player.GetActiveRecruit().Name = Evolutions[evoIndex].SplitEvos[evoToLoad].Name;
}
player.GetActiveRecruit().Save(player.GetCharFolder(), player.GetActiveRecruitSlot());
Messenger.SendActiveTeam(player.Client);
Messenger.SendPlayerData(player.Client);
Messenger.PlayerMsg(player.Client, "You have evolved into a " + Evolutions[evoIndex].SplitEvos[evoToLoad].Name + "! Congratulations!", Text.Yellow);
} else {
Messenger.PlayerMsg(player.Client, "You can't evolve yet... You must raise your level!", Text.BrightRed);
}
} else {
Messenger.PlayerMsg(player.Client, "You do not have the proper item equipped to evolve!", Text.BrightRed);
}
*/
}
} catch (Exception ex) {
Exceptions.ErrorLogger.WriteToErrorLog(ex, "Evolution, [Data] Index: " + player.Client.ToString() + ", Player Sprite: " + player.GetActiveRecruit().Sprite.ToString());
Messenger.PlayerMsg(player.Client, "Evolution Error", Text.BrightRed);
}
}