示例#1
0
TbBool ambient_sound_prepare(void)
{
    struct Thing *thing;
    struct Coord3d pos;
    memset(&pos,0,sizeof(struct Coord3d)); // ambient sound position
    thing = create_ambient_sound(&pos, 1, game.neutral_player_num);
    if (thing_is_invalid(thing))
    {
        game.ambient_sound_thing_idx = 0;
        ERRORLOG("Could not create ambient sound object");
        return false;
    }
    game.ambient_sound_thing_idx = thing->index;
    return true;
}
示例#2
0
struct Thing *create_thing(struct Coord3d *pos, unsigned short tngclass, unsigned short model, unsigned short owner, long parent_idx)
{
    struct Thing *thing;
    //return _DK_create_thing(pos, tngclass, model, owner, a4);
    thing = INVALID_THING;
    switch (tngclass)
    {
    case TCls_Object:
        thing = create_object(pos, model, owner, parent_idx);
        break;
    case TCls_Shot:
        thing = create_shot(pos, model, owner);
        break;
    case TCls_EffectElem:
        thing = create_effect_element(pos, model, owner);
        break;
    case TCls_DeadCreature:
        thing = create_dead_creature(pos, model, 1, owner, 0);
        break;
    case TCls_Creature:
        thing = create_creature(pos, model, owner);
        break;
    case TCls_Effect:
        thing = create_effect(pos, model, owner);
        break;
    case TCls_Trap:
        thing = create_trap(pos, model, owner);
        break;
    case TCls_AmbientSnd:
        thing = create_ambient_sound(pos, model, owner);
        break;
    case TCls_CaveIn:
        thing = create_cave_in(pos, model, owner);
        break;
    default:
        break;
    }
    return thing;
}