示例#1
0
dd_bool P_ActivateLine(Line *ld, mobj_t *mo, int side, int actType)
{
    // Clients do not activate lines.
    if(IS_CLIENT) return false;

    switch(actType)
    {
    case SPAC_CROSS:
        P_CrossSpecialLine(ld, side, mo);
        return true;

    case SPAC_USE:
        return P_UseSpecialLine(mo, ld, side);

    case SPAC_IMPACT:
        P_ShootSpecialLine(mo, ld);
        return true;

    default:
        DENG2_ASSERT(!"P_ActivateLine: Unknown activation type");
        break;
    }

    return false;
}
示例#2
0
// [crispy] trigger all special lines available on the map
static int ST_cheat_spechits()
{
    int i, speciallines = 0;
    boolean origcards[NUMCARDS];
    line_t dummy;

    // temporarily give all keys
    for (i = 0; i < NUMCARDS; i++)
    {
	origcards[i] = plyr->cards[i];
	plyr->cards[i] = true;
    }

    for (i = 0; i < numlines; i++)
    {
	if (lines[i].special)
	{
	    // do not trigger level exit switches/lines or teleporters
	    if (lines[i].special == 11 || lines[i].special == 51 ||
	        lines[i].special == 52 || lines[i].special == 124 ||
	        lines[i].special == 39 || lines[i].special == 97)
	        continue;

	    P_CrossSpecialLine (i, 0, plyr->mo);
	    P_ShootSpecialLine (plyr->mo, &lines[i]);
	    P_UseSpecialLine (plyr->mo, &lines[i], 0);

	    speciallines++;
	}
    }

    for (i = 0; i < NUMCARDS; i++)
    {
	plyr->cards[i] = origcards[i];
    }

    // [crispy] trigger tag 666/667 events
    dummy.tag = 666;
    if (gamemode == commercial)
    {
	if (gamemap == 7)
	{
	    // Mancubi
	    speciallines += EV_DoFloor(&dummy, lowerFloorToLowest);

	    // Arachnotrons
	    dummy.tag = 667;
	    speciallines += EV_DoFloor(&dummy, raiseToTexture);
	}
    }
    else
    {
	if (gameepisode == 1)
	    // Barons of Hell
	    speciallines += EV_DoFloor(&dummy, lowerFloorToLowest);
	else
	if (gameepisode == 4)
	{
	     if (gamemap == 6)
		// Cyberdemons
		speciallines += EV_DoDoor(&dummy, vld_blazeOpen);
	    else
	    if (gamemap == 8)
		// Spider Masterminds
		speciallines += EV_DoFloor(&dummy, lowerFloorToLowest);
	}
    }
    // Keens (no matter which level they are on)
    // this call will be ignored if the tagged sector is already moving
    // so actions triggered in the condition above will have precedence
    speciallines += EV_DoDoor(&dummy, vld_open);

    return (speciallines);
}