示例#1
0
        public static WarningResult CheckWarning(bool dirty, int warnings, FightingStyle style, double defense)
        {
            WarningResult ret = new WarningResult();

            if (dirty)
            {
                bool warned = RandomGen.CheckRandom(Resources.Dirty_Warning_Percent);

                if (warned)
                {
                    ret.IsWarned       = true;
                    ret.IsDisqualified = CheckDqed(warnings);
                }
            }
            else
            {
                ret.IsWarned = ret.IsWarned || RandomGen.CheckRandom(Resources.Warning_NoDirty);
            }
            if (style == FightingStyle.Clinch && defense > Resources.Clinch_MaxDefense_NoWarning)
            {
                double percent = defense - Resources.Clinch_MaxDefense_NoWarning;
                percent = Math.Pow(percent, 2) / 100;
                bool warned = RandomGen.CheckRandom(percent);
                if (warned)
                {
                    ret.IsWarned       = true;
                    ret.IsDisqualified = ret.IsDisqualified || CheckDqed(warnings);
                }
            }
            return(ret);
        }
示例#2
0
        public void CheckFighterWarning(FighterFight fighter)
        {
            WarningResult res = CheckWarning(fighter);

            this.IsWarned       = res.IsWarned;
            this.IsDisqualified = res.IsDisqualified;
        }
示例#3
0
 public void Active(WarningModel value)
 {
     text.text = value.value;
     this.result = value.result;
     if (value.delay >0)
     {
         Invoke("Close",value.delay);
     }
     gameObject.SetActive(true);
 }
示例#4
0
 public void Active(WarningModel value)
 {
     text.text   = value.value;
     this.result = value.result;
     if (value.delay > 0)
     {
         Invoke("Close", value.delay);
     }
     gameObject.SetActive(true);
 }
示例#5
0
    WarningResult result;//回调

    public void active(WarningModel value)
    {
        GetComponent <errorPanel>().showPanel();
        text.text   = value.value;
        this.result = value.result;
        if (value.delay > 0)
        {
            Invoke("close", value.delay);
        }
        gameObject.SetActive(true);
    }
示例#6
0
        private static int CheckWarnings(bool dirty, int defense, int warnings, int numTimes, bool checkDq)
        {
            int times = 0;

            for (int i = 0; i < numTimes; i++)
            {
                WarningResult res = FighterRound.CheckWarning(dirty, warnings, FightingStyle.Clinch, defense);
                if (checkDq && res.IsDisqualified)
                {
                    times++;
                }
                if (!checkDq && res.IsWarned)
                {
                    times++;
                }
            }
            return(times);
        }
示例#7
0
 public WarningModel(string value, WarningResult relust = null, float delay = -1)
 {
     this.value  = value;
     this.result = relust;
     this.delay  = delay;
 }
示例#8
0
 public void active(WarningModel model)
 {
     text.text   = model.value;
     this.result = model.result;
     this.gameObject.SetActive(true);
 }
示例#9
0
 public WarningModel(string value, WarningResult result =null)
 {
     Value = value;
     Result = result;
 }
示例#10
0
 public WarningModel(string value, WarningResult result = null)
 {
     this.result = result;
     this.value  = value;
 }
示例#11
0
 /// <summary>
 /// 弹出提示窗并显示
 /// </summary>
 /// <param name="value"></param>
 public void Active(WarningModel value)
 {
     contentText.text = value.Value;
     result = value.Result;
     gameObject.SetActive(true);
 }
示例#12
0
    WarningResult result;       // 警告托管

    // 激活警告
    public void active(WarningModel value)
    {
        text.text   = value.value;
        this.result = value.result;
        gameObject.SetActive(true);
    }
示例#13
0
 public WarningModel(string value, WarningResult relust = null,float delay= -1)
 {
     this.value = value;
     this.result = relust;
     this.delay = delay;
 }
示例#14
0
        public static WarningResult CheckWarning(FighterFight fight)
        {
            WarningResult ret = CheckWarning(fight.RoundStats.Plan.Dirty, fight.Warnings, fight.RoundStats.Plan.Style, fight.RoundStats.Plan.Defense);

            return(ret);
        }