Skip to content

Commit

Permalink
Fix password list bug
Browse files Browse the repository at this point in the history
Level Select was only displaying the first 29 passwords, even if a campaign had more than this. Regular Season now has 30 passwords (up from 28).

Also fixed an issue with the level editor, and improved auxiliary support.
  • Loading branch information
ChallengeSY committed Jun 14, 2023
1 parent 3eba764 commit 98992fe
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 129 deletions.
19 changes: 11 additions & 8 deletions NNCampaign.bi
Original file line number Diff line number Diff line change
Expand Up @@ -660,19 +660,20 @@ sub shuffle_levels
end sub

function level_list as string
dim as short SelectLevel = 1, LevelsRegistered, LegalLevel, LegalChoice
dim as short SelectLevel = 1, LevelsRegistered, AdjustPagination, LegalLevel, LegalChoice
dim as string LevelPass, OutPass

do
AdjustPagination = min(max(SelectLevel-15,0),max(LevelsRegistered-29,0))
LevelsRegistered = 0
cls
gfxstring("Level list for "+CampaignName,0,0,5,4,4,rgb(0,255,255))
for LevelID as short = 1 to HighLevel
LevelPass = check_level(LevelID)
if LevelID = 1 then
LegalLevel = 1
LevelPass = "++++++++"
else
LevelPass = check_level(LevelID)
if LevelPass <> "--------" AND LevelPass <> "++++++++" then
LegalLevel = 1
else
Expand All @@ -683,13 +684,15 @@ function level_list as string
if LegalLevel then
LevelsRegistered += 1

if LevelsRegistered = SelectLevel then
line(0,18+LevelsRegistered*25)-(1023,41+LevelsRegistered*25),rgb(0,0,128),bf
LegalChoice = LegalLevel
OutPass = LevelPass
if LevelsRegistered-AdjustPagination > 0 AND LevelsRegistered-AdjustPagination < 30 then
if LevelsRegistered = SelectLevel then
line(0,18+(LevelsRegistered-AdjustPagination)*25)-(1023,41+(LevelsRegistered-AdjustPagination)*25),rgb(0,0,128),bf
LegalChoice = LegalLevel
OutPass = LevelPass
end if

gfxstring("["+LevelPass+"] Level "+str(LevelID),0,20+(LevelsRegistered-AdjustPagination)*25,4,4,3,rgb(255,255,255))
end if

gfxstring("["+LevelPass+"] Level "+str(LevelID),0,20+LevelsRegistered*25,4,4,3,rgb(255,255,255))
end if
next LevelID
screencopy
Expand Down
2 changes: 1 addition & 1 deletion NebEdit.bi
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ sub save_level(SaveLvNum as short)
else
print #2,
end if
print #2, "Brush "+str(BID)+" Increase Speed"+space(1-len(str(BID)))+":= "+SpeedIncrease
print #2, "Brush "+str(BID)+" Increase Spd"+space(3-len(str(BID)))+":= "+SpeedIncrease
end with
next BID
print #2,
Expand Down
51 changes: 28 additions & 23 deletions NebSDL.bas
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ enum SoundFX
SFX_POWER_UP
SFX_POWER_DOWN
SFX_DEATH
SFX_SHOOT
SFX_SHOOT_BULLET
SFX_SHOOT_MISSILE
SFX_LIFE
SFX_BALL = 10
SFX_WALL = 28
SFX_BRICKS_RESPAWN
SFX_WALL_BROKEN
SFX_BALL
SFX_WALL
SFX_MAX
end enum

Expand All @@ -32,6 +35,7 @@ const clipCount = SFX_MAX - 1
dim shared as Mix_Chunk ptr clip(clipCount)
dim shared as integer clipChannel(clipCount), clipPause(clipCount)
dim shared music as Mix_Music ptr
dim as string SFXNames(clipCount)
for CID as ubyte = 0 to clipCount
clip(CID) = NULL
clipChannel(CID) = -1
Expand All @@ -53,26 +57,33 @@ if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) then
close #1
end 1
end if
clip(SFX_BRICK) = Mix_LoadWAV("sfx/modern/brick.wav")
for SPD as byte = 8 to 26
clip(int(SFX_BALL+SPD-9)) = Mix_LoadWAV("sfx/modern/paddle"+str(SPD)+".wav")
next SPD
clip(SFX_EXPLODE) = Mix_LoadWAV("sfx/modern/explode.wav")
clip(SFX_HARDEN) = Mix_LoadWAV("sfx/modern/harden.wav")
clip(SFX_INVINCIBLE) = Mix_LoadWAV("sfx/modern/invincible.wav")
clip(SFX_POWER_UP) = Mix_LoadWAV("sfx/modern/powerup.wav")
clip(SFX_POWER_DOWN) = Mix_LoadWAV("sfx/modern/powerdown.wav")
clip(SFX_DEATH) = Mix_LoadWAV("sfx/modern/death.wav")
clip(SFX_SHOOT) = Mix_LoadWAV("sfx/modern/shoot.wav")
clip(SFX_WALL) = Mix_LoadWAV("sfx/modern/wall.wav")

SFXNames(SFX_BRICK) = "brick"
SFXNames(SFX_EXPLODE) = "explode"
SFXNames(SFX_HARDEN) = "harden"
SFXNames(SFX_INVINCIBLE) = "invincible"
SFXNames(SFX_POWER_UP) = "powerup"
SFXNames(SFX_POWER_DOWN) = "powerdown"
SFXNames(SFX_DEATH) = "death"
SFXNames(SFX_SHOOT_BULLET) = "bullet"
SFXNames(SFX_SHOOT_MISSILE) = "missile"
SFXNames(SFX_LIFE) = "life"
SFXNames(SFX_BRICKS_RESPAWN) = "respawn"
SFXNames(SFX_WALL_BROKEN) = "wallBroken"
SFXNames(SFX_BALL) = "paddle"
SFXNames(SFX_WALL) = "wall"

for PID as short = 0 to clipCount
clip(PID) = Mix_LoadWAV("sfx/modern/"+SFXNames(PID)+".wav")
next PID
music = NULL

sub play_clip(ID as byte, Panning as short = 320, HertzMod as short = 100)
if ID >= 0 then
dim as ubyte PauseLength(0 to clipCount)
for clipID as ubyte = 0 to clipCount
select case clipID
case SFX_SHOOT
case SFX_SHOOT_BULLET
PauseLength(clipID) = 15
case SFX_POWER_UP, SFX_POWER_DOWN
PauseLength(clipID) = 12
Expand All @@ -89,13 +100,7 @@ sub play_clip(ID as byte, Panning as short = 320, HertzMod as short = 100)
end if
end sub
sub dynamic_speed_clip(BallSpeed as double, Panning as short = 320)
if int(BallSpeed) > MaxSpeed then
play_clip(SFX_BALL+17)
elseif int(BallSpeed) >= DefaultSpeed then
play_clip(SFX_BALL+BallSpeed-8)
else
play_clip(SFX_BALL-1)
end if
play_clip(SFX_BALL)
end sub
sub decrement_pauses
for ID as ubyte = 0 to clipCount
Expand Down
4 changes: 3 additions & 1 deletion Nebunoid.bas
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#IFNDEF __FB_DOS__
#DEFINE __USE_FBSOUND__
#ENDIF

#include "Nebunoid.bi"
#include "NNCampaign.bas"
windowtitle "Nebunoid"
windowtitle "Nebunoid 1.01"

if FileExists("portable") = 0 then
#IF defined(__FB_WIN32__)
Expand Down
1 change: 1 addition & 0 deletions Nebunoid.bi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Masterdir = curdir
#ELSE
#include "NebNull.bas"
#ENDIF

#include "WordWrap.bi"
#IFDEF __FB_WIN32__
#include "windows.bi"
Expand Down
4 changes: 2 additions & 2 deletions campaigns/official/regular/L29.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ LEVEL DATA FILE - REGULAR SEASON LEVEL 29
*BEGIN*
================================================================================

Level Name := Almost there...
Level Description := So close... yet so very far.
Level Name := Slim Pickings
Level Description :=
Level Password := CPNGCSOF
Level game number := 3
Level time limit := 300
Expand Down
116 changes: 58 additions & 58 deletions campaigns/official/regular/L33.txt
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
================================================================================
LEVEL DATA FILE - REGULAR CAMPAIGN LEVEL 33
LEVEL DATA FILE - REGULAR SEASON LEVEL 33
================================================================================
*BEGIN*
================================================================================

Level Name := Getting closer...
Level Description :=
Level Password := ++++++++
Level game number := &b0001000000001011
Level Name := Well Rounded
Level Description :=
Level Password := ULALFFIS
Level game number := 4107
Level time limit := 0
Number of Block Sets := 13
Set 1 Color := &h80FF00FF
Set 1 Score Value := 10*
Set 1 Hit Degrade := 0
Set 1 Increase Speed := FALSE
Set 2 Color := &h80FF20FF
Set 2 Score Value := 10*
Set 2 Hit Degrade := 0
Set 2 Increase Speed := FALSE
Set 3 Color := &h80FF40FF
Set 3 Score Value := 10*
Set 3 Hit Degrade := 0
Set 3 Increase Speed := FALSE
Set 4 Color := &h80FF60FF
Set 4 Score Value := 10*
Set 4 Hit Degrade := 0
Set 4 Increase Speed := FALSE
Set 5 Color := &h80FF80FF
Set 5 Score Value := 10*
Set 5 Hit Degrade := 0
Set 5 Increase Speed := FALSE
Set 6 Color := &h80FFA0FF
Set 6 Score Value := 10*
Set 6 Hit Degrade := 0
Set 6 Increase Speed := FALSE
Set 7 Color := &h80FFC0FF
Set 7 Score Value := 10*
Set 7 Hit Degrade := 0
Set 7 Increase Speed := FALSE
Set 8 Color := &h80404040
Set 8 Score Value := 10*
Set 8 Hit Degrade := 0
Set 8 Increase Speed := FALSE
Set 9 Color := &h80808080
Set 9 Score Value := 2
Set 9 Hit Degrade := 8
Set 9 Increase Speed := FALSE
Set 10 Color := &h80FFFFFF
Set 10 Score Value := 2
Set 10 Hit Degrade := 9
Set 10 Increase Speed := FALSE
Set 11 Color := &hB0FFD700
Set 11 Score Value := 10*
Set 11 Hit Degrade := 11
Set 11 Increase Speed := FALSE
Set 12 Color := &hB0CD7F32
Set 12 Score Value := 2
Set 12 Hit Degrade := 11
Set 12 Increase Speed := FALSE
Set 13 Color := 0
Set 13 Score Value := 2
Set 13 Hit Degrade := 1
Set 13 Increase Speed := FALSE
Number of Brushes := 13
Brush 1 Color := &h80FF00FF
Brush 1 Score Value := 10*
Brush 1 Hit Degrade := 0
Brush 1 Increase Spd := FALSE
Brush 2 Color := &h80FF20FF
Brush 2 Score Value := 10*
Brush 2 Hit Degrade := 0
Brush 2 Increase Spd := FALSE
Brush 3 Color := &h80FF40FF
Brush 3 Score Value := 10*
Brush 3 Hit Degrade := 0
Brush 3 Increase Spd := FALSE
Brush 4 Color := &h80FF60FF
Brush 4 Score Value := 10*
Brush 4 Hit Degrade := 0
Brush 4 Increase Spd := FALSE
Brush 5 Color := &h80FF80FF
Brush 5 Score Value := 10*
Brush 5 Hit Degrade := 0
Brush 5 Increase Spd := FALSE
Brush 6 Color := &h80FFA0FF
Brush 6 Score Value := 10*
Brush 6 Hit Degrade := 0
Brush 6 Increase Spd := FALSE
Brush 7 Color := &h80FFC0FF
Brush 7 Score Value := 10*
Brush 7 Hit Degrade := 0
Brush 7 Increase Spd := FALSE
Brush 8 Color := &h80404040
Brush 8 Score Value := 10*
Brush 8 Hit Degrade := 0
Brush 8 Increase Spd := FALSE
Brush 9 Color := &h80808080
Brush 9 Score Value := 2
Brush 9 Hit Degrade := 8
Brush 9 Increase Spd := FALSE
Brush 10 Color := &h80FFFFFF
Brush 10 Score Value := 2
Brush 10 Hit Degrade := 9
Brush 10 Increase Spd := FALSE
Brush 11 Color := &hB0FFD700
Brush 11 Score Value := 10*
Brush 11 Hit Degrade := 11
Brush 11 Increase Spd := FALSE
Brush 12 Color := &hB0CD7F32
Brush 12 Score Value := 2
Brush 12 Hit Degrade := 11
Brush 12 Increase Spd := FALSE
Brush 13 Color := &h00000000
Brush 13 Score Value := 2
Brush 13 Hit Degrade := 1
Brush 13 Increase Spd := FALSE

Level Grid 11111111112
12345678901234567890
Expand Down
72 changes: 36 additions & 36 deletions campaigns/official/regular/L34.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
================================================================================
LEVEL DATA FILE - REGULAR CAMPAIGN LEVEL 34
LEVEL DATA FILE - REGULAR SEASON LEVEL 34
================================================================================
*BEGIN*
================================================================================

Level Name := Don't give up!
Level Description := Only one... more... level...
Level Password := ++++++++
Level game number := &b0001000100000011
Level Name := Hyper Smiley
Level Description :=
Level Password := LBHOGHOX
Level game number := 4355
Level time limit := 0
Number of Block Sets := 3
Set 1 Color := &h80FF8000
Set 1 Score Value := 10*
Set 1 Hit Degrade := -1
Set 1 Increase Speed := FALSE
Set 2 Color := &hB0FFD700
Set 2 Score Value := 10*
Set 2 Hit Degrade := 2
Set 2 Increase Speed := FALSE
Set 3 Color := &hB0CD7F32
Set 3 Score Value := 2
Set 3 Hit Degrade := 2
Set 3 Increase Speed := FALSE
Number of Brushes := 3
Brush 1 Color := &h80FF8000
Brush 1 Score Value := 10*
Brush 1 Hit Degrade := -1
Brush 1 Increase Spd := FALSE
Brush 2 Color := &hB0FFD700
Brush 2 Score Value := 10*
Brush 2 Hit Degrade := 2
Brush 2 Increase Spd := FALSE
Brush 3 Color := &hB0CD7F32
Brush 3 Score Value := 2
Brush 3 Hit Degrade := 2
Brush 3 Increase Spd := FALSE

Level Grid 11111111112
12345678901234567890
-----------------------
1|
2|
3| 11 11
1|
2|
3| 11 11
4|1221 1221
5|3333 3333
6|
7|
8| 333 333
9| 31333 33313
10| 3111111113
11| 33333333
12|
13|
14|
15|
16|
17|
18|
19|
20|
6|
7|
8| 333 333
9| 31333 33313
10| 3111111113
11| 33333333
12|
13|
14|
15|
16|
17|
18|
19|
20|

================================================================================
*END*
Expand Down

0 comments on commit 98992fe

Please sign in to comment.