示例#1
0
int
SetupSerp(short SpriteNum)
{
    SPRITEp sp = &sprite[SpriteNum];
    USERp u;
    ANIMATOR DoActorDecide;

    if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
    {
        u = User[SpriteNum];
        ASSERT(u);
    }
    else
    {
        User[SpriteNum] = u = SpawnUser(SpriteNum,SERP_RUN_R0,s_SerpRun[0]);
        u->Health = HEALTH_SERP_GOD;
    }

    if (Skill == 0) u->Health = 1100;
    if (Skill == 1) u->Health = 2200;

    ChangeState(SpriteNum, s_SerpRun[0]);
    u->Attrib = &SerpAttrib;
    DoActorSetSpeed(SpriteNum, NORM_SPEED);
    u->StateEnd = s_SerpDie;
    u->Rot = sg_SerpRun;

    EnemyDefaults(SpriteNum, &SerpActionSet, &SerpPersonality);

    // Mini-Boss Serp
    if (sp->pal == 16)
    {
        u->Health = 1000;
        sp->yrepeat = 74;
        sp->xrepeat = 74;
    }
    else
    {
        sp->yrepeat = 100;
        sp->xrepeat = 128;
    }

    sp->clipdist = (512) >> 2;
    SET(u->Flags, SPR_XFLIP_TOGGLE|SPR_ELECTRO_TOLERANT);

    u->loz = sp->z;

    // amount to move up for clipmove
    u->zclip = Z(80);
    // size of step can walk off of
    u->lo_step = Z(40);

    u->floor_dist = u->zclip - u->lo_step;
    u->ceiling_dist = SPRITEp_SIZE_Z(sp) - u->zclip;

    return 0;
}
示例#2
0
VOID EnemyDefaults(short SpriteNum, ACTOR_ACTION_SETp action, PERSONALITYp person)
    {
    USERp u = User[SpriteNum];
    SPRITEp sp = &sprite[SpriteNum];
    unsigned int wpn;
    short wpn_cnt;
    short depth = 0;
    extern short TotalKillable;
    extern BOOL DebugSecret;

    switch(u->ID)
        {
        case PACHINKO1:
        case PACHINKO2:
        case PACHINKO3:
        case PACHINKO4:
        case 623:
        case TOILETGIRL_R0:
        case WASHGIRL_R0:
        case CARGIRL_R0:
        case MECHANICGIRL_R0:
        case SAILORGIRL_R0:
        case PRUNEGIRL_R0:
        case TRASHCAN:
        case BUNNY_RUN_R0:
            break;
        default:
            {
            TotalKillable++;
            #if DEBUG
            if (DebugSecret)
                {
                sprintf(ds,"COUNTED: spnum %d, pic %d, x %d, y %d",SpriteNum,sp->picnum,sp->x,sp->y);
                DebugWriteString(ds);
                }
            #endif    
            }
            
        break;
        }
    
    RESET(sp->cstat, CSTAT_SPRITE_RESTORE);

    u->spal = sp->pal;
    
    u->RotNum = 5;
    sp->clipdist = (256) >> 2;
    
    u->zclip = Z(48);
    u->lo_step = Z(32);
    
    u->floor_dist = u->zclip - u->lo_step;
    u->ceiling_dist = SPRITEp_SIZE_Z(sp) - u->zclip;
    
    u->Radius = 400;
    
    u->MaxHealth = u->Health;

    u->PainThreshold = DIV16(u->Health) - 1;
    //u->PainThreshold = DIV4(u->Health) - 1;
    
    SET(sp->cstat,CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
    SET(sp->extra,SPRX_PLAYER_OR_ENEMY);
    
    sprite[SpriteNum].picnum = u->State->Pic;
    change_sprite_stat(SpriteNum, STAT_ENEMY);
  
    u->Personality = person;
    u->ActorActionSet = action;

    DoActorZrange(SpriteNum);

    //KeepActorOnFloor(SpriteNum); // for swimming actors
    
    // make sure we start in the water if thats where we are
    if (u->lo_sectp)// && SectUser[u->lo_sectp - sector])
        {
        short i,nexti;
        short sectnum = u->lo_sectp - sector;
        
        if (SectUser[sectnum] && TEST(u->lo_sectp->extra, SECTFX_SINK))
            {
            depth = SectUser[sectnum]->depth;
            }
        else    
            {
            TRAVERSE_SPRITE_SECT(headspritesect[sectnum],i,nexti)
                {
                SPRITEp np = &sprite[i];
                if (np->picnum == ST1 && np->hitag == SECT_SINK)
                    {
                    depth = np->lotag;
                    }
                }
            }