Esempio n. 1
0
void Lattice::AttackBy(id_ptr_on<Item> item)
{
    if (id_ptr_on<FloorTile> tile = item)
    {
        tile->delThis();

        GetTurf()->delThis();
        SetTurf(GetItemFabric().newItem<ITurf>(Floor::T_ITEM_S()));

        PlaySoundIfVisible("Deconstruct.ogg", owner.ret_id());

        delThis();
    }
}
Esempio n. 2
0
void Ghost::Process()
{
    --seconds_until_respawn_;
    if (seconds_until_respawn_ < 0)
    {
        size_t net_id = GetFactory().GetNetId(GetId());
        if (net_id)
        {
            auto login_mob = GetFactory().Create<IMob>(LoginMob::T_ITEM_S());

            GetFactory().SetPlayerId(net_id, login_mob.ret_id());
            if (GetId() == GetMob().ret_id())
            {
                ChangeMob(login_mob);
            }
            delThis();
            //qDebug() << "Ghost deleted: net_id: " << net_id;
        }
    }
}
Esempio n. 3
0
void Grille::AttackBy(id_ptr_on<Item> item)
{
    if (id_ptr_on<Wirecutters> w = item)
    {
        PlaySoundIfVisible("Wirecutter.ogg", owner.ret_id());
        if (!cutted_)
        {
            SetState("brokengrille");
            SetPassable(D_ALL, Passable::FULL);
            cutted_ = true;
            GetFactory().Create<IOnMapObject>(Rod::T_ITEM_S(), GetOwner());
        }
        else
        {
            GetFactory().Create<IOnMapObject>(Rod::T_ITEM_S(), GetOwner());
            delThis();
        }
    }
    else
        Structure::AttackBy(item);
}