Esempio n. 1
0
void CHSSysEngines::CutPower(HS_INT32 level)
{
    if (level == 0)
    {
        if (GetOwnerObject() && GetOwnerObject()->GetType() == HST_SHIP)
        {
            CHSShip *cShip;

            cShip = (CHSShip *) GetOwnerObject();

            if (hsInterface.AtrGet(cShip->GetDbref(), "HSMSG_ENGINES_CUT"))
            {
                HS_DBREF idx = cShip->GetDbref();

                char *msg = hsInterface.EvalExpression(hsInterface.m_buffer,
                                                       idx, idx, idx);
                cShip->NotifySrooms(msg);
            }
            else
            {
                cShip->NotifySrooms(HSCONF.engines_cut);
            }
        }
    }
}
Esempio n. 2
0
void CHSSysThrusters::PowerUp(int level)
{
    if (!GetOwnerObject())
    {
        return;
    }

    if (GetOwnerObject()->GetType() == HST_SHIP)
    {
        CHSShip *cShip;

        cShip = (CHSShip *) GetOwnerObject();

        if (hsInterface.
            AtrGet(cShip->GetDbref(), "HSMSG_THRUSTERS_ACTIVATING"))
        {
            char *msg = hsInterface.EvalExpression(hsInterface.m_buffer,
                                                   cShip->GetDbref(),
                                                   cShip->GetDbref(),
                                                   cShip->GetDbref());
            cShip->NotifySrooms(msg);
        }
        else
        {
            cShip->NotifySrooms(HSCONF.thrusters_activating);
        }
    }
}
Esempio n. 3
0
void CHSJumpDrive::CutPower(HS_INT32 level)
{
    if (level == 0)
    {
        if (GetOwnerObject() && (GetOwnerObject()->GetType() == HST_SHIP))
        {
            CHSShip *cShip;

            cShip = (CHSShip *) GetOwnerObject();

            if (hsInterface.AtrGet(cShip->GetDbref(), "HSMSG_JUMPERS_CUT"))
            {
                char *msg = hsInterface.EvalExpression(hsInterface.m_buffer,
                                                       cShip->GetDbref(),
                                                       cShip->GetDbref(),
                                                       cShip->GetDbref());
                cShip->NotifySrooms(msg);
            }
            else
            {
                cShip->NotifySrooms(HSCONF.jumpers_cut);
            }
        }

        // Set charge level to 0.
        m_fChargeLevel = 0;

        // If jumpers are engaged and power is set to 0, then
        // disengage.
        if (GetEngaged())
        {
            HS_INT8 tbuf[128];

            m_bEngaged = false;
            sprintf(tbuf, "%s%s-%s Jump drive disengaged.",
                    ANSI_HILITE, ANSI_GREEN, ANSI_NORMAL);
            if (GetOwnerObject())
            {
                GetOwnerObject()->HandleMessage(tbuf, MSG_ENGINEERING);
            }
        }

    }
}