示例#1
0
void ParticleHandler::spawnDefencePing(const std::shared_ptr<Object> &object, const std::shared_ptr<Object> &attacker)
{
    if (0 != object->damage_timer) return;

    spawnGlobalParticle(object->getPosition(), object->ori.facing_z, LocalParticleProfileRef(PIP_DEFEND), 0);

    object->damage_timer = DEFENDTIME;
    SET_BIT(object->ai.alert, ALERTIF_BLOCKED);

    // For the ones attacking a shield
    if(attacker != nullptr && !attacker->isTerminated()) {
        object->ai.setLastAttacker(attacker->getObjRef());
    }
    else {
        object->ai.setLastAttacker(ObjectRef::Invalid);
    }
}
示例#2
0
//--------------------------------------------------------------------------------------------
void wawalite_weather_t::read(ReadContext& ctxt, wawalite_data_t *enclosing, wawalite_weather_t *profile)
{
    if (!profile)
    {
        throw std::invalid_argument("nullptr == profile");
    }
    // Reset to defaults.
    *profile = wawalite_weather_t::getDefaults();

    // weather data
    profile->part_gpip = LocalParticleProfileRef(PIP_WEATHER);
    if (enclosing->version >= WAWALITE_FILE_VERSION)
    {
        STRING line;

        //Parse the weather type line
        vfs_get_next_string_lit(ctxt, line, SDL_arraysize(line));
        profile->weather_name = line;
        Ego::toupper(profile->weather_name);
    }

    profile->over_water = vfs_get_next_bool(ctxt);
    profile->timer_reset = vfs_get_next_int(ctxt);
}
#include "egolib/Profiles/LocalParticleProfileRef.hpp"

const LocalParticleProfileRef LocalParticleProfileRef::Invalid = LocalParticleProfileRef();