public static void stealTechno( byte player, byte adv ) { int techno = selectRandomUndiscoveredTechno( player, adv ); if ( techno != -1 ) { Form1.game.playerList[ player ].technos[ techno ].researched = true; if ( Form1.game.playerList[ player ].currentResearch == techno ) { if ( player == Form1.game.curPlayerInd ) { uiWrap.chooseNextTechno( player, "Your spies succesfully stole " + Statistics.technologies[ Form1.game.playerList[ player ].currentResearch ].name.ToLower() + " from " + Statistics.civilizations[ Form1.game.playerList[ adv ].civType ].name + ". Please chose your next research.", "Intelligence" ); } else { ai Ai = new ai(); Form1.game.playerList[ player ].currentResearch = ai.randomTechnology( player ); } } } }
public static void chooseNextTechno( byte player, string text, string caption ) { string technoName = Statistics.technologies[ Form1.game.playerList[ player ].currentResearch ].name; ai Ai = new ai(); byte[] technos = ai.returnDisponibleTechnologies( player ); byte nextTechno = ai.randomTechnology( player ); string[] choices = technoListStrings( player, technos ); userChoice uc = new userChoice( caption, text, choices, 0, language.getAString( language.order.uiAccept ), language.getAString( language.order.uiOpenTechnoTree ) ); uc.ShowDialog(); int res = uc.result; if ( res == -1 ) { // science tree Form1.game.playerList[ player ].currentResearch = (byte)nextTechno; sciTree sciTree1 = new sciTree(); sciTree1.ShowDialog(); } else { // accept Form1.game.playerList[ player ].currentResearch = (byte)technos[ res ]; } }