Soul Code…

Call it unorthodox.

Call it unconventional.

Call it a paradox, confuse the mental.

Byte crusher,reducing D-WORDs to little bits

ROM Hustler, spit tech slang with subtle wit.

circa 2003 :

static SequenceInfo_t boss_2_sequences[] =
{
{ BOSS_TWO_HEAD_SEQUENCE_01_STEPS , 0 , headSequence_01 , 0 , 0 , -1 } ,
{ BOSS_TWO_TORSO_SEQUENCE_01_STEPS , 0 , torsoSequence_01 , 0 , 0 , -1 } ,
{ BOSS_TWO_SEGMENT_SEQUENCE_01_STEPS , 0 , segmentSequence_01 , 0 , 0 , -1 } ,
{ BOSS_TWO_RETICULE_SEQUENCE_01_STEPS , 0 , reticuleSequence_01 , 0 , 0 , -1 } ,
{ BOSS_TWO_RETICULE_SEQUENCE_02_STEPS , 0 , reticuleSequence_02 , 0 , 0 , -1 } ,
{ BOSS_TWO_PROJECTILE_PROFILE_SEQUENCE_STEPS , 0 , projectileProfileSequence , 0 , 0 , -1 } ,
{ BOSS_TWO_PROJECTILE_FRONT_SEQUENCE_STEPS , 0 , projectileFrontSequence , 0 , 0 , -1 } ,
{ BOSS_TWO_EXPLOSION_SEQUENCE_STEPS , 0 , explosionSequence , 0 , 0 , -1 }
};
void B2_Spawn( pBoss_2t pB2 , pSpawnPoint_t pSpawnPoint )
{
P_CreateEntity( &pB2->segments[ BOSS_TWO_HEAD_SEGMENT ] , 0 , 0 , BOSS_TWO_SIZE_X , BOSS_TWO_SIZE_Y , pSpawnPoint->mapCoords.x , pSpawnPoint->mapCoords.y , BOSS_TWO_SPEED , BOSS_TWO_FRAMES , ENTITY_TYPE_BOSS_TWO );

P_CreateEntity( &pB2->segments[ BOSS_TWO_TORSO_SEGMENT ] , 0 , 0 , BOSS_TWO_SIZE_X , BOSS_TWO_SIZE_Y , pSpawnPoint->mapCoords.x , pSpawnPoint->mapCoords.y , BOSS_TWO_SPEED , BOSS_TWO_FRAMES , ENTITY_DUMMY_TYPE );

// animation stuff
Ent_SetAnimationParams( &pB2->segments[ BOSS_TWO_HEAD_SEGMENT ] , frames , BOSS_TWO_ANIMATION_RATE , &boss_2_sequences[ BOSS_TWO_HEAD_SEQUENCE_01 ] );
Ent_SetAnimationParams( &pB2->segments[ BOSS_TWO_TORSO_SEGMENT ] , frames , BOSS_TWO_ANIMATION_RATE , &boss_2_sequences[ BOSS_TWO_TORSO_SEQUENCE_01 ] );

for( int segment = 0;segment < BOSS_TWO_SEGMENTS;segment++ )
// each segment gets progressively smaller ( excluding the first two )
{
pB2->radius[ segment ] = BOSS_TWO_SIZE_X - ( segment<<2 );

pB2->segments[ segment ].position.x = SCREEN_W >> 1;
pB2->segments[ segment ].position.y = SCREEN_H >> 1;

pB2->distance[ segment ] = 10;

pB2->segments[ segment ].speed = 2;

pB2->trigIndex[ segment ] = segment * 10;

if( (segment != BOSS_TWO_HEAD_SEGMENT) && (segment != BOSS_TWO_TORSO_SEGMENT) )
{
P_CreateEntity( &pB2->segments[ segment ] , 0 , 0 , BOSS_TWO_SIZE_X , BOSS_TWO_SIZE_Y ,SCREEN_W >> 1 , SCREEN_H >> 1 ,2 ,BOSS_TWO_FRAMES ,ENTITY_DUMMY_TYPE );

Ent_SetAnimationParams( &pB2->segments[ segment ] , frames , BOSS_TWO_ANIMATION_RATE , &boss_2_sequences[ BOSS_TWO_SEGMENT_SEQUENCE_01 ] );
//Ent_SetAnimationParams( &pB2->segments[ segment ] , frames , BOSS_TWO_ANIMATION_RATE , &boss_2_sequences[ BOSS_TWO_EXPLOSION_SEQUENCE ] );
}

Ent_InitHealthStats( &pB2->segments[ segment ] , BOSS_TWO_HEALTH , BOSS_TWO_DAMAGE_RESISTANCE , BOSS_TWO_STRENGTH , BOSS_TWO_PROJECTILE_STRENGTH );

// pB2->segments[ segment ].explosions = 5;
}

for( int bullet = 0;bullet < BOSS_TWO_PROJECTILES;bullet++ )
// bullets
{
P_CreateEntity( &pB2->projectiles[ bullet ] , 0 , 0 , BOSS_TWO_PROJECTILE_SIZE_X , BOSS_TWO_PROJECTILE_SIZE_Y , 0 , 0 , 4 , 0 , ENTITY_DUMMY_TYPE );
Ent_SetAnimationParams( &pB2->projectiles[ bullet ] , frames , BOSS_TWO_ANIMATION_RATE , &boss_2_sequences[ BOSS_TWO_PROJECTILE_FRONT_SEQUENCE ] );
}

// init reticule
P_CreateEntity( &pB2->reticule ,
0 , 0 ,
BOSS_TWO_RETICULE_SIZE_X , BOSS_TWO_RETICULE_SIZE_Y ,
SCREEN_W >> 1 , SCREEN_H >> 1 ,
BOSS_TWO_RETICULE_SPEED ,
BOSS_TWO_FRAMES ,
ENTITY_DUMMY_TYPE );

Ent_SetAnimationParams( &pB2->reticule , frames , BOSS_TWO_RETICULE_ANIMATION_RATE , &boss_2_sequences[ BOSS_TWO_RETICULE_SEQUENCE_01 ] );

// rocket pack
P_CreateEntity( &pB2->rocketPack , 0 , 0 , 40 , 40 , 0 , 0 , 5 , 0 , ENTITY_DUMMY_TYPE );

// particles
for( int particle = 0;particle < BOSS_TWO_PARTICLES;particle++ )
{
B2_InitParticle( pB2 , particle );
}

// head scale
pB2->headScale = 1;

// start off in phase 1
//pB2->phase = BOSS_TWO_PHASE_ONE;
//pB2->phase = BOSS_TWO_PHASE_TWO;
//pB2->phase = BOSS_TWO_PHASE_THREE;
//pB2->phase = BOSS_TWO_FG_TRANSITION;
//pB2->phase = BOSS_TWO_BG_TRANSITION;

SetStates( &pB2->state , BOSS_TWO_TRANSITION_PHASE_ONE );

pB2->boomeranging[ BOSS_TWO_TORSO_SEGMENT ] = r_true;

// setup the order the phrases take place int
pB2->currentCallback[ 0 ] = B2_RunPhaseOne;
pB2->currentCallback[ 1 ] = B2_MoveToForeground;
pB2->currentCallback[ 2 ] = B2_RunPhaseTwo;
pB2->currentCallback[ 3 ] = B2_MoveToBackground;
pB2->currentCallback[ 4 ] = B2_RunPhaseOne;
pB2->currentCallback[ 5 ] = B2_MoveToForeground;
pB2->currentCallback[ 6 ] = B2_RunPhaseTwo;
pB2->currentCallback[ 7 ] = B2_MoveToBackground;
pB2->currentCallback[ 8 ] = B2_RunPhaseOne;
pB2->currentCallback[ 9 ] = B2_MoveToForeground;
pB2->currentCallback[ 10] = B2_RunPhaseThree;
pB2->currentCallback[ 11] = B2_MoveToBackground;

pB2->phases[ 0 ] = BOSS_TWO_PHASE_ONE;
pB2->phases[ 1 ] = BOSS_TWO_FG_TRANSITION;
pB2->phases[ 2 ] = BOSS_TWO_PHASE_TWO;
pB2->phases[ 3 ] = BOSS_TWO_BG_TRANSITION;
pB2->phases[ 4 ] = BOSS_TWO_PHASE_ONE;
pB2->phases[ 5 ] = BOSS_TWO_FG_TRANSITION;
pB2->phases[ 6 ] = BOSS_TWO_PHASE_TWO;
pB2->phases[ 7 ] = BOSS_TWO_BG_TRANSITION;
pB2->phases[ 8 ] = BOSS_TWO_PHASE_ONE;
pB2->phases[ 9 ] = BOSS_TWO_FG_TRANSITION;
pB2->phases[ 10] = BOSS_TWO_PHASE_THREE;
pB2->phases[ 11] = BOSS_TWO_BG_TRANSITION;

// set the time to spend in each phase
pB2->phaseLengths[ BOSS_TWO_PHASE_ONE ] = BOSS_TWO_PHASE_ONE_LENGTH;
pB2->phaseLengths[ BOSS_TWO_PHASE_TWO ] = BOSS_TWO_PHASE_TWO_LENGTH;
pB2->phaseLengths[ BOSS_TWO_PHASE_THREE ] = BOSS_TWO_PHASE_THREE_LENGTH;
pB2->phaseLengths[ BOSS_TWO_BG_TRANSITION] = BOSS_TWO_BG_TRANSITION_LENGTH;
pB2->phaseLengths[ BOSS_TWO_FG_TRANSITION] = BOSS_TWO_FG_TRANSITION_LENGTH;

// explosion stuffs
for( int seg = 0;seg < BOSS_TWO_SEGMENTS;seg++ )
{
Ent_AddExplosions( &pB2->segments[ seg ] , pB2->explosions[ seg ] , BOSS_TWO_SEGMENT_EXPLOSIONS , &boss_2_sequences[ BOSS_TWO_EXPLOSION_SEQUENCE ] );
}
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published.