Beispiel #1
0
 void excute(Ghost ghost)
 {
     var cf=findChess(ghost.from);
     var ct=findChess(ghost.to);
     int num=0;
     Performance.Period p;
     switch(ghost.command){
     case "endTurn":
     foreach(var e in getChesses){
         e.recover();
     }
     host.ghost.tryErrror=0;
     challenger.ghost.tryErrror=0;
     heros[0].numSummon=1;
     heros[1].numSummon=1;
     numTurn++;
     performance.turnToggle(numTurn);
     performance.draw(new Data.Card[]{new Data.Card()},troop);
     break;
     case "move":
     cf.cell=ghost.to;
     p=performance.push();
     p.chesses=new Chess[]{cf};
     p.to=ghost.to;
     p.type="move";
     p.time=0.5f;
     cf.numMove-=1;
     break;
     case "attack":
     num=findChess(ghost.from).attackDamage;
     ct.hp-=num;
     troopOpp.hpTroop-=num;
     p=performance.push();
     p.chesses=new Chess[]{cf,ct};
     p.type="attack";
     p.time=0.5f;
     p=performance.push();
     p.chesses=new Chess[]{ct};
     p.type="damage";
     p.value=num;
     p.time=0.1f;
     cf.numAttack-=1;
     break;
     case "summon":
     case "magic":
     handComsume(ghost.card.name);
     p=performance.push();
     p.chesses=new Chess[]{cf};
     p.to=ghost.to;
     p.type="cast";
     p.time=0.5f;
     p.cardName=ghost.card.name;
     num=0;
     switch(ghost.card.name){
     case"火球術":
         num=findChess(ghost.from).magicPower*2;
         findChess(ghost.to).hp-=num;
         performance.push("damage",ghost,num);
         break;
     case"政治行動":
         troopOpp.hpTroop-=cf.magicPower*1;
         break;
     case"追擊":
         if(ct.numAttack==0)ct.numAttack+=1;
         break;
     case"順風":
         ct.addBuff("順風");
         break;
     case"恢復術":
         ct.hp+=cf.magicPower*5;
         break;
     case"財富":
         troop.modHand(2);
         break;
     case"惡意":
         troop.modHand(-1);
         troopOpp.modHand(-1-cf.magicPower);
         break;
     case"颶風":
         cf.cell=ghost.to;
         break;
     case"增援":
         ct.numSummon+=1*ct.magicPower;
         break;
     case"黑洞":
         cf.cell=ghost.to;
         break;
     case"旅者":
         if(ct.numMove==0)ct.numMove+=1;
         break;
     case"協力":
         ct.addBuff("協力");
         break;
     case"炸藥":
         ct.hp-=1;
         break;
     case"捕獸夾":
     case"牆壁":
         performance.summon(ghost.card,ghost.to,troop.party);
         break;
     case"骷髏弓箭手":
     case"紅鴉法師":
     case"紅鴉護衛":
     case"紅鴉弓箭手":
     case"紅鴉劍士":
     case"帝國重槍兵":
     case"骷髏戰士":
     case"帝國劍兵":
     default:
         cf.numSummon-=1;
         performance.summon(ghost.card,ghost.to,troop.party);
         break;
     }
     break;
     }
     //judgement
     var score=new int[]{0,0};
     foreach(var e in getChesses){
     if(e.party=="host")score[0]+=e.hp.value;
     else score[1]+=e.hp.value;
     if(e.hp.rate>0)continue;
     lChess.Remove(e);
     performance.die(e);
     }
     var winner="";
     if(numTurn>=18){
     winner=(host.hpTroop.value+host.hpHero.value>=challenger.hpTroop.value+challenger.hpHero.value)?"host":"challenger";
     }
     if(host.hpTroop.rate<=0||host.hpHero.rate<=0)winner="challenger";
     if(challenger.hpTroop.rate<=0||challenger.hpHero.rate<=0)winner="host";
     if(winner=="host"){
     if(isHost)performance.win();
     else performance.lose();
     }if(winner=="challenger"){
     if(isHost)performance.lose();
     else performance.win();
     }
     if(winner!=""){
     sur="set";
     enabled=false;
     }
 }
Beispiel #2
0
 public void showCell(Ghost ghost)
 {
 }