Пример #1
0
void DisplayMeter::TriggerMsg(HOBJECT hSender, const char *szMsg)
{
    ILTCommon* pCommon = g_pLTServer->Common();
	if (!pCommon) return;

	// ConParse does not destroy szMsg, so this is safe
	ConParse parse;
	parse.Init((char*)szMsg);

	while (pCommon->Parse(&parse) == LT_OK)
	{
		if (parse.m_nArgs > 0 && parse.m_Args[0])
		{
			if ((_stricmp(parse.m_Args[0], "show") == 0))
			{
				if (parse.m_nArgs > 1)
				{
                    HandleShow((uint8)atoi(parse.m_Args[1]));
				}
				else
					HandleShow(100);
			}
			else if (_stricmp(parse.m_Args[0], "plus") == 0)
			{
				if (parse.m_nArgs > 1)
				{
                    HandlePlus((uint8)atoi(parse.m_Args[1]));
				}
			}
			else if (_stricmp(parse.m_Args[0], "minus") == 0)
			{
				if (parse.m_nArgs > 1)
				{
                    HandleMinus((uint8)atoi(parse.m_Args[1]));
				}
			}
			else if (_stricmp(parse.m_Args[0], "set") == 0)
			{
				if (parse.m_nArgs > 1)
				{
                    HandleSet((uint8)atoi(parse.m_Args[1]));
				}
			}
			else if (_stricmp(parse.m_Args[0], "hide") == 0)
			{
				HandleEnd();
			}
		}
	}
}
Пример #2
0
bool DecisionObject::OnTrigger(HOBJECT hSender, const CParsedMsg &cMsg)
{
	static CParsedMsg::CToken s_cTok_Start("START");
	static CParsedMsg::CToken s_cTok_On("ON");
	static CParsedMsg::CToken s_cTok_Stop("STOP");
	static CParsedMsg::CToken s_cTok_Off("OFF");
	static CParsedMsg::CToken s_cTok_Lock("LOCK");
	static CParsedMsg::CToken s_cTok_Unlock("UNLOCK");

	if ((cMsg.GetArg(0) == s_cTok_Start) ||
		(cMsg.GetArg(0) == s_cTok_On)
		)
	{
		HandleShow();
	}
	else if ((cMsg.GetArg(0) == s_cTok_Stop) ||
		(cMsg.GetArg(0) == s_cTok_Off)
		)
	{
		HandleAbort();
	}
	else if( cMsg.GetArg(0) == s_cTok_Lock )
	{
		m_bLock = true;
	}
	else if( cMsg.GetArg(0) == s_cTok_Unlock )
	{
		m_bLock = false;
	}
	else
		return GameBase::OnTrigger(hSender, cMsg);

	return true;
}
Пример #3
0
void DisplayMeter::HandlePlus(uint8 val)
{
	if (val == 0) return;
	if (val > 100) val = 100;

	if (m_nValue == 0)
	{
		HandleShow(val);
		return;
	}

	m_nValue += val;
	if (m_nValue > 100) m_nValue = 100;

	// Send message to clients telling them about the DisplayMeter...
	UpdateClients();

	// Update the DisplayMeter...
//    g_pLTServer->SetNextUpdate(m_hObject, 0.001f);
}
Пример #4
0
  void BeginBattlePhase::Show (bool isVisible)
  {
    isVisible_ = isVisible;

    HandleShow (isVisible);
  }
Пример #5
0
  void RunWildBattlePhase::Show (bool isVisible)
  {
    isVisible_ = isVisible;

    HandleShow (isVisible);
  }
Пример #6
0
/*----------------------------------------------------------------------------------------------------------------------
|	This function provides the ability to read everything following the block name (which is read by the NxsReader
|	object) to the END or ENDBLOCK statement. Characters are read from the input stream `in'. Overrides the virtual
|	function in the base class.
*/
void GarliReader::Read(
    NxsToken &token)	/* the token used to read from `in' */
{
    isEmpty = false;

    // This should be the semicolon after the block name
    //
    token.GetNextToken();

    if (!token.Equals(";"))
    {
        errormsg = "Expecting ';' after ";
        errormsg += id;
        errormsg += " block name, but found ";
        errormsg += token.GetToken();
        errormsg += " instead";
        throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
    }

    for (;;)
    {
        token.GetNextToken();

        if (token.Abbreviation("ENdblock"))
        {
            HandleEndblock(token);
            break;
        }
        else if (token.Abbreviation("GarliReader"))
        {
            HandleGarliReader(token);
        }
        else if (token.Abbreviation("Help"))
        {
            HandleHelp(token);
        }
        else if (token.Abbreviation("Log"))
        {
            HandleLog(token);
        }
        else if (token.Abbreviation("EXecute"))
        {
            HandleExecute(token);
        }
        else if (token.Abbreviation("Show"))
        {
            HandleShow(token);
        }
        else if (token.Abbreviation("Quit"))
        {
            quit_now = true;

            message = "\nGarliReader says goodbye\n";
            PrintMessage();

            break;
        }
        else
        {
            SkippingCommand(token.GetToken());
            do
            {
                token.GetNextToken();
            }
            while (!token.AtEOF() && !token.Equals(";"));

            if (token.AtEOF())
            {
                errormsg = "Unexpected end of file encountered";
                throw NxsException(errormsg, token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn());
            }
        }
    }
}
Пример #7
0
  void Battle::Show (bool isVisible)
  {
    isVisible_ = isVisible;

    HandleShow (isVisible);
  }