Commit 85ba128e authored by wind2009's avatar wind2009

添加事件2、事件5对话

parent 47c53be8
Pipeline #24372 passed with stage
in 24 seconds
......@@ -1291,5 +1291,48 @@ namespace WindBot.Game.AI
return false;
}
private enum CustomMessage
{
InDanger,
MSG_FOR_EVENT_2,
MSG_FOR_EVENT_5
};
bool sendEventMsg2 = false;
bool sendEventMsg5 = false;
List<int> event2TriggerIdList = new List<int> { 90673288, 37818794, 60461804, 29432356, 48626373, 32909498, 41685633, 84330567, 21522601 };
List<int> event5TriggerIdList = new List<int> { 27279764, 40061558, 99267150, 62873545, 72989439, 98630720, 31833038, 98127546, 86221741,
80611581, 52085072, 63468625, 69120785, 31764700, 82103466, 84433295, 04167084, 13331639, 08505920, 21123811, 37442336, 97836203,
97489701, 15982593, 95095116, 18666161, 40939228, 41517789, 62180201, 47084486, 33746252, 21208154, 57793869, 14799437, 23440231,
10669138, 21637210, 03134857, 29479265, 08763963, 27572350, 72402069, 30604579, 96633955, 84815190, 67508932, 87460579, 60465049,
23288411, 91588074, 25451652, 22073844, 47556396, 51522296, 68199168, 06150044, 37663536, 75286621, 58481572 };
public override void OnNewTurn()
{
sendEventMsg2 = false;
sendEventMsg5 = false;
base.OnNewTurn();
}
public override void OnMove(int cardId, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
if (previousLocation == 0 && currentLocation == (int)CardLocation.MonsterZone)
{
if (!sendEventMsg2 && event2TriggerIdList.Contains(cardId) && currentControler == 1)
{
AI.SendCustomChat((int)CustomMessage.MSG_FOR_EVENT_2);
sendEventMsg2 = true;
}
if (!sendEventMsg5 && event2TriggerIdList.Contains(cardId) && currentControler == 0 && Duel.Phase == DuelPhase.Standby)
{
AI.SendCustomChat((int)CustomMessage.MSG_FOR_EVENT_5);
sendEventMsg5 = true;
}
}
base.OnMove(cardId, previousControler, previousLocation, currentControler, currentLocation);
}
}
}
......@@ -180,7 +180,7 @@ namespace WindBot.Game.AI
public void SendCustomChat(int index, params object[] opts)
{
if (!_game._chat || _custom == null)
if (!_game._chat || _custom == null || _custom.Length <= index)
return;
string message = string.Format(_custom[index], opts);
if (message != "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment