[Megameknet-cvs] MegaMekNET/src/server/campaign/commands CheckAttackCommand.java,1.26,1.27
Status: Inactive
Brought to you by:
mcwizard
From: Helge R. <mcw...@us...> - 2005-04-02 14:29:20
|
Update of /cvsroot/megameknet/MegaMekNET/src/server/campaign/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21040/src/server/campaign/commands Modified Files: CheckAttackCommand.java Log Message: last bunch of TrainingTask fixes Index: CheckAttackCommand.java =================================================================== RCS file: /cvsroot/megameknet/MegaMekNET/src/server/campaign/commands/CheckAttackCommand.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CheckAttackCommand.java 8 Mar 2005 22:38:52 -0000 1.26 --- CheckAttackCommand.java 2 Apr 2005 14:29:10 -0000 1.27 *************** *** 24,27 **** --- 24,28 ---- import server.campaign.tasks.ConquerTask; import server.campaign.tasks.MechRaidTask; + import server.campaign.tasks.TrainingTask; import common.constants.PlayerStatus; *************** *** 66,69 **** --- 67,71 ---- StringBuffer raidResult = new StringBuffer("You may raid: "); StringBuffer conquerResult = new StringBuffer("You may conquer: "); + StringBuffer trainResult = new StringBuffer("You may train: "); SArmy army = (SArmy)armies.next(); result.append("Army "); *************** *** 86,89 **** --- 88,92 ---- List possibleRaidDefendings = pl.isAbleToDefendVs(p, army, 1.0, Integer.parseInt(CampaignMain.cm.getConfig("MaxBVDifference")), new MechRaidTask()); List possibleConquerDefendings = pl.isAbleToDefendVs(p, army, 1.0, Integer.parseInt(CampaignMain.cm.getConfig("MaxBVDifference")), new ConquerTask()); + List possibleTrainingDefendings = pl.isAbleToDefendVs(p, army, 1.0, Integer.parseInt(CampaignMain.cm.getConfig("MaxBVDifference")), new TrainingTask()); //Can he defend? if (possibleRaidDefendings.size() > 0) { *************** *** 98,101 **** --- 101,115 ---- } } + if (possibleTrainingDefendings.size() > 0) { + //Add Housename + trainResult.append(pl.getMyHouse().getHouseFightingFor(pl).getColoredAbbreviation() + " ("); + for (int i = 0; i < possibleTrainingDefendings.size(); i++) { + //Show all possible combinations + Object tmp = possibleTrainingDefendings.get(i); + SArmy defendArmy = ((SArmy)tmp); + trainResult.append(defendArmy.getAmountOfUnitsWithoutInfantry()); + trainResult.append((i < possibleTrainingDefendings.size() - 1) ? "," : ")"); + } + } if (possibleConquerDefendings.size() > 0) { //Add Housename *************** *** 116,120 **** } } ! result.append(raidResult + "<br>" + conquerResult + "<br>"); } return result.toString(); --- 130,134 ---- } } ! result.append(raidResult + "<br>" + conquerResult + "<br>" + trainResult + "<br>"); } return result.toString(); |