diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index 4ede33f10..e183d8dda 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -54,7 +54,8 @@ enum skin { skin_contspeed, skin_contangle, skin_soundsid, - skin_sprites + skin_sprites, + skin_natkcolor }; static const char *const skin_opt[] = { @@ -94,6 +95,7 @@ static const char *const skin_opt[] = { "contangle", "soundsid", "sprites", + "natkcolor", NULL}; #define UNIMPLEMENTED luaL_error(L, LUA_QL("skin_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", skin_opt[field]) @@ -218,6 +220,9 @@ static int skin_get(lua_State *L) case skin_sprites: LUA_PushUserdata(L, skin->sprites, META_SKINSPRITES); break; + case skin_natkcolor: + lua_pushinteger(L, skin->natkcolor); + break; } return 1; } diff --git a/src/m_menu.c b/src/m_menu.c index f9288f76f..6b6fa7ec9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5980,14 +5980,14 @@ static void M_DrawNightsAttackBackground(void) } // NiGHTS Attack floating Super Sonic. -static patch_t *ntssupersonic[2]; +/*static patch_t *ntssupersonic[2]; static void M_DrawNightsAttackSuperSonic(void) { const UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_YELLOW, GTC_CACHE); INT32 timer = FixedInt(ntsatkdrawtimer/4) % 2; angle_t fa = (FixedAngle((FixedInt(ntsatkdrawtimer * 4) % 360)<>ANGLETOFINESHIFT) & FINEMASK; V_DrawFixedPatch(235<spriteframes[spritetimer]; //Our animation frame is equal to the number on the timer + + NightsAttackSprite = W_CachePatchNum(sprframe->lumppat[6], PU_PATCH); //Draw the right facing angle + + if (skins[skinnumber].natkcolor) //If you set natkcolor use it + color = skins[skinnumber].natkcolor; + else if ((skins[skinnumber].flags & SF_SUPER) && !(skins[skinnumber].flags & SF_NONIGHTSSUPER)) //If you go super in NiGHTS, use supercolor + color = skins[skinnumber].supercolor+4; + else //If you don't go super in NiGHTS or at all, use prefcolor + color = skins[skinnumber].prefcolor; + + + + colormap = R_GetTranslationColormap(TC_BLINK, color, GTC_CACHE); //Make the sprite color be our prefcolor + + angle_t fa = (FixedAngle(((FixedInt(ntsatkdrawtimer * 4)) % 360)<>ANGLETOFINESHIFT) & FINEMASK; + + if (sprframe->flip & 1<<6) //If our sprite is supposed to be flipped + flags = V_FLIP; //Flip it + else + flags = 0; + + + V_DrawFixedPatch((270<width)*3)/2, 135, 0, ngradeletters[bestoverall]); @@ -10438,8 +10483,8 @@ static void M_NightsAttack(INT32 choice) // This is really just to make sure Sonic is the played character, just in case M_PatchSkinNameTable(); - ntssupersonic[0] = W_CachePatchName("NTSSONC1", PU_PATCH); - ntssupersonic[1] = W_CachePatchName("NTSSONC2", PU_PATCH); + //ntssupersonic[0] = W_CachePatchName("NTSSONC1", PU_PATCH); + //ntssupersonic[1] = W_CachePatchName("NTSSONC2", PU_PATCH); G_SetGamestate(GS_TIMEATTACK); // do this before M_SetupNextMenu so that menu meta state knows that we're switching titlemapinaction = TITLEMAP_OFF; // Nope don't give us HOMs please diff --git a/src/r_skins.c b/src/r_skins.c index 1605ca6c8..6b4aeefe1 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -144,6 +144,8 @@ static void Sk_SetDefaultValue(skin_t *skin) skin->contspeed = 17; skin->contangle = 0; + skin->natkcolor = SKINCOLOR_NONE; + for (i = 0; i < sfx_skinsoundslot0; i++) if (S_sfx[i].skinsound != -1) skin->soundsid[S_sfx[i].skinsound] = i; @@ -588,7 +590,6 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value) UINT16 color = R_GetSuperColorByName(value); skin->supercolor = (color ? color : SKINCOLOR_SUPERGOLD1); } - #define GETFLOAT(field) else if (!stricmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value)); GETFLOAT(jumpfactor) GETFLOAT(highresscale) @@ -629,6 +630,9 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value) GETFLAG(NOSHIELDABILITY) #undef GETFLAG + else if (!stricmp(stoken, "natkcolor")) + skin->natkcolor = R_GetColorByName(value); // SKINCOLOR_NONE is allowed here + else // let's check if it's a sound, otherwise error out { boolean found = false; diff --git a/src/r_skins.h b/src/r_skins.h index a97b24f96..cc3b63cbe 100644 --- a/src/r_skins.h +++ b/src/r_skins.h @@ -71,6 +71,7 @@ typedef struct UINT16 prefcolor; UINT16 supercolor; UINT16 prefoppositecolor; // if 0 use tables instead + UINT16 natkcolor; //Color for Nights Attack Menu fixed_t highresscale; // scale of highres, default is 0.5 UINT8 contspeed; // continue screen animation speed