コード例 #1
0
    public void ShowEmergency(string emergencyId)
    {
        gameMode.Pause();
        mUIMgr.ShowPanel("ActBranch", true, false);
        ActBranchCtrl  actrl = mUIMgr.GetCtrl("ActBranch") as ActBranchCtrl;
        EmergencyAsset ea    = GetEmergencyAsset(emergencyId);

        actrl.SetEmergency(ea);
        actrl.ActBranchEvent += delegate(int idx) {
            gameMode.Resume();
            EmergencyChoice c = ea.Choices[idx];
            if (c.NextEmId != null && c.NextEmId != string.Empty)
            {
            }
            if (c.Ret == "Hot")
            {
                if (idx == 0)
                {
                    gameMode.GainScore(-10);
                    mUIMgr.ShowHint("Get " + "-10" + " Score");
                }
                else if (idx == 1)
                {
                    gameMode.GainScore(15);
                    mUIMgr.ShowHint("Get " + "15" + " Score");
                }
                else
                {
                    gameMode.GainScore(30);
                    mUIMgr.ShowHint("Get " + "30" + " Score");
                }
            }
        };
    }
コード例 #2
0
ファイル: ZhiboBuffManager.cs プロジェクト: nmbswls/CSCI529
    public void TickSec()
    {
        bool changed = false;

        for (int i = gameMode.state.ZhiboBuffs.Count - 1; i >= 0; i--)
        {
            if (gameMode.state.ZhiboBuffs[i].isBasedOn(eBuffLastType.TIME_BASE))
            {
                gameMode.state.ZhiboBuffs[i].LeftTime -= 1f;
                if (gameMode.state.ZhiboBuffs[i].LeftTime < 0)
                {
                    changed = true;
                    RemoveBuff(gameMode.state.ZhiboBuffs[i]);
                }
            }
        }
        if (changed)
        {
            CalculateBuffExtras();
        }
        if (GainScorePerSec > 0)
        {
            gameMode.GainScore(GainScorePerSec);
        }
    }