mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-17 18:21:10 +00:00
* Modified A_RandomState. If var2 is supplied, it picks between var1, var2 and nextstate - otherwise, it picks between var1 and nextstate.
* Changed a caption.
This commit is contained in:
parent
b91dc51d6f
commit
b568816217
3 changed files with 20 additions and 6 deletions
|
@ -1201,7 +1201,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_BRAK, 4, 8, {A_BrakChase}, 3, 0, S_CYBRAKDEMON_WALK5}, // S_CYBRAKDEMON_WALK4
|
||||
{SPR_BRAK, 5, 8, {A_BrakChase}, 3, 0, S_CYBRAKDEMON_WALK6}, // S_CYBRAKDEMON_WALK5
|
||||
{SPR_BRAK, 6, 8, {A_BrakChase}, 3, sfx_bestp2, S_CYBRAKDEMON_WALK1}, // S_CYBRAKDEMON_WALK6
|
||||
{SPR_BRAK, 7, 6, {A_RandomState}, S_CYBRAKDEMON_MISSILE_ATTACK1, S_CYBRAKDEMON_FLAME_ATTACK1, S_CYBRAKDEMON_MISSILE_ATTACK1}, // S_CYBRAKDEMON_CHOOSE_ATTACK1
|
||||
{SPR_BRAK, 7, 6, {A_RandomState}, S_CYBRAKDEMON_MISSILE_ATTACK1, 0, S_CYBRAKDEMON_FLAME_ATTACK1}, // S_CYBRAKDEMON_CHOOSE_ATTACK1
|
||||
{SPR_BRAK, 7, 6, {A_FaceTarget}, 0, 0, S_CYBRAKDEMON_MISSILE_ATTACK2}, // S_CYBRAKDEMON_MISSILE_ATTACK1 // Aim
|
||||
{SPR_BRAK, 26 + FF_FULLBRIGHT, 12, {A_BrakFireShot}, MT_CYBRAKDEMON_MISSILE, 128, S_CYBRAKDEMON_MISSILE_ATTACK3}, // S_CYBRAKDEMON_MISSILE_ATTACK2 // Fire
|
||||
{SPR_BRAK, 7, 12, {A_FaceTarget}, 0, 0, S_CYBRAKDEMON_MISSILE_ATTACK4}, // S_CYBRAKDEMON_MISSILE_ATTACK3 // Aim
|
||||
|
@ -1212,7 +1212,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_BRAK, 7, 6, {A_FaceTarget}, 0, 0, S_CYBRAKDEMON_FLAME_ATTACK3}, // S_CYBRAKDEMON_FLAME_ATTACK2 // Aim
|
||||
{SPR_BRAK, 26 + FF_FULLBRIGHT, 2, {A_BrakFireShot}, MT_CYBRAKDEMON_FLAMESHOT, 128, S_CYBRAKDEMON_FLAME_ATTACK4}, // S_CYBRAKDEMON_FLAME_ATTACK3 // Fire
|
||||
{SPR_BRAK, 7, 1, {A_Repeat}, 30, S_CYBRAKDEMON_FLAME_ATTACK3, S_CYBRAKDEMON_FINISH_ATTACK1}, // S_CYBRAKDEMON_FLAME_ATTACK4 // Loop
|
||||
{SPR_BRAK, 0, 6, {A_RandomState}, S_CYBRAKDEMON_VILE_ATTACK1, S_CYBRAKDEMON_NAPALM_ATTACK1, S_CYBRAKDEMON_MISSILE_ATTACK1}, // S_CYBRAKDEMON_CHOOSE_ATTACK2
|
||||
{SPR_BRAK, 0, 6, {A_RandomState}, S_CYBRAKDEMON_VILE_ATTACK1, 0, S_CYBRAKDEMON_NAPALM_ATTACK1}, // S_CYBRAKDEMON_CHOOSE_ATTACK2
|
||||
{SPR_BRAK, 20, 0, {A_LinedefExecute}, LE_BRAKVILEATACK, 0, S_CYBRAKDEMON_VILE_ATTACK2}, // S_CYBRAKDEMON_VILE_ATTACK1
|
||||
{SPR_BRAK, 20, 24, {A_VileTarget}, MT_CYBRAKDEMON_TARGET_RETICULE, 1, S_CYBRAKDEMON_VILE_ATTACK3}, // S_CYBRAKDEMON_VILE_ATTACK2
|
||||
{SPR_BRAK, 19, 8, {A_FaceTarget}, 0, 0, S_CYBRAKDEMON_VILE_ATTACK4}, // S_CYBRAKDEMON_VILE_ATTACK3
|
||||
|
|
|
@ -8035,21 +8035,35 @@ void A_BossJetFume(mobj_t *actor)
|
|||
|
||||
// Function: A_RandomState
|
||||
//
|
||||
// Description: Chooses one of the two state numbers supplied randomly.
|
||||
// Description: Chooses one of either two or three state numbers supplied randomly.
|
||||
//
|
||||
// nextstate = state number 0
|
||||
// var1 = state number 1
|
||||
// var2 = state number 2
|
||||
// var2 = state number 2 (can be ommitted for binary chance)
|
||||
//
|
||||
void A_RandomState(mobj_t *actor)
|
||||
{
|
||||
INT32 locvar1 = var1;
|
||||
INT32 locvar2 = var2;
|
||||
UINT8 rand;
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_CallAction("A_RandomState", actor))
|
||||
return;
|
||||
#endif
|
||||
|
||||
P_SetMobjState(actor, P_RandomChance(FRACUNIT/2) ? locvar1 : locvar2);
|
||||
rand = (var2 ? P_RandomKey(3) : P_RandomKey(2));
|
||||
switch (rand)
|
||||
{
|
||||
case 0:
|
||||
P_SetMobjState(actor, actor->state->nextstate);
|
||||
return;
|
||||
case 1:
|
||||
P_SetMobjState(actor, locvar1);
|
||||
return;
|
||||
case 2:
|
||||
P_SetMobjState(actor, locvar2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Function: A_RandomStateRange
|
||||
|
|
|
@ -316,7 +316,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"s3k5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Aiming"},
|
||||
{"s3k5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Menu beep"},
|
||||
{"s3k5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Electric spark"},
|
||||
{"s3k5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bouncing missile"},
|
||||
{"s3k5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Heavy hit"},
|
||||
{"s3k5e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Firing laser"},
|
||||
{"s3k5f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"},
|
||||
{"s3k60", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Flying away"},
|
||||
|
|
Loading…
Reference in a new issue