Exemple #1
0
    /// <summary>
    /// 完胜
    /// </summary>
    private void CompleteWin()
    {
        ReportMsg_.fightresult  = proto.S2CFightReport.Result.Win;
        ReportMsg_.grade        = Def.BattleGrade.S;
        ReportMsg_.destroyratio = 100;
        ReportMsg_.exp          = GetExpByGrade(ReportMsg_.grade);

        ReportMsg_.energy   = 10000;
        ReportMsg_.capital  = 20000;
        ReportMsg_.mdeal    = 3;
        ReportMsg_.extraexp = 0;

        FillLostUnitInfo();


        BattleSys.OnFightReport(ReportMsg_);
    }
Exemple #2
0
    /// <summary>
    /// 分析战斗结果
    /// </summary>
    private void  AnalyzeFightResult()
    {
        // 如果没有打破总部,破坏度也低于50% 在判定这波攻击失败
        int destoryRaio = GetDestoryRatio();

        // 如果击破率低于50%且没有打破敌方指挥中心
        if (destoryRaio < 50 && !DestoryHeadquarters_)
        {
            ReportMsg_.fightresult = proto.S2CFightReport.Result.Fail;
        }
        else
        {
            ReportMsg_.fightresult = proto.S2CFightReport.Result.Win;
        }

        ReportMsg_.destroyratio = destoryRaio;

        FillLostUnitInfo();

        int grade = GetGrade(destoryRaio);

        ReportMsg_.grade = grade;
        if (ReportMsg_.fightresult == proto.S2CFightReport.Result.Fail)
        {
            BattleSys.OnFightReport(ReportMsg_);
            return;
        }

        int exp = GetExpByGrade(grade);

        ReportMsg_.exp = exp;

        ReportMsg_.energy   = 10000;
        ReportMsg_.capital  = 20000;
        ReportMsg_.extraexp = 0;
        ReportMsg_.mdeal    = 3;

        BattleSys.OnFightReport(ReportMsg_);
    }